:root {
    --primary: #6366f1;
    --primary-hover: #4f46e5;
    --secondary: #8b5cf6;
    --dark-bg: #0f172a;
    --panel-bg: rgba(30, 41, 59, 0.7);
    --border-color: rgba(255, 255, 255, 0.1);
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', -apple-system, sans-serif;
}

body {
    background-color: var(--dark-bg);
    color: var(--text-main);
    background-image: 
        radial-gradient(at 0% 0%, rgba(99, 102, 241, 0.15) 0px, transparent 50%),
        radial-gradient(at 100% 100%, rgba(139, 92, 246, 0.15) 0px, transparent 50%);
    background-attachment: fixed;
    height: 100vh;
    overflow: hidden;
}

.app-container {
    display: flex;
    height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 260px;
    background-color: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(12px);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    padding: 24px;
    transition: all 0.3s ease;
}

.sidebar-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 40px;
}

.logo {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: white;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.sidebar-header h2 {
    font-size: 16px;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex-grow: 1;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: 8px;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
    cursor: pointer;
}

.nav-item:hover:not(.disabled) {
    background-color: rgba(255, 255, 255, 0.05);
    color: var(--text-main);
}

.nav-item.active {
    background-color: var(--primary);
    color: white;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.2);
}

.nav-item i {
    font-size: 18px;
}

.nav-divider {
    height: 1px;
    background-color: var(--border-color);
    margin: 16px 0;
}

.badge {
    margin-left: auto;
    background-color: rgba(255, 255, 255, 0.1);
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.nav-item.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 12px;
    padding-top: 24px;
    border-top: 1px solid var(--border-color);
}

.avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background-color: var(--secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}

.user-info {
    display: flex;
    flex-direction: column;
}

.user-name {
    font-size: 14px;
    font-weight: 600;
}

.user-role {
    font-size: 12px;
    color: var(--text-muted);
}

/* Main Content */
.main-content {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow-y: auto;
}

.top-header {
    padding: 32px 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-title h1 {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 4px;
}

.header-title p {
    color: var(--text-muted);
    font-size: 14px;
}

.header-actions {
    display: flex;
    gap: 16px;
}

.btn-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1px solid var(--border-color);
    background: transparent;
    color: var(--text-main);
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.btn-icon:hover {
    background: rgba(255,255,255,0.1);
}

.content-area {
    padding: 0 40px 40px 40px;
}

.tab-pane {
    display: none;
    animation: fadeIn 0.4s ease;
}

.tab-pane.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Sections */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.back-action {
    display: flex;
    align-items: center;
    gap: 16px;
}

.btn-primary {
    background-color: var(--primary);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s;
}

.btn-primary:hover {
    background-color: var(--primary-hover);
    transform: translateY(-1px);
}

/* Stats Dashboard */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 24px;
}

.stat-card {
    background-color: var(--panel-bg);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 20px;
}

.stat-icon {
    width: 56px;
    height: 56px;
    border-radius: 12px;
    background: rgba(99, 102, 241, 0.1);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}

.stat-details h3 {
    font-size: 14px;
    color: var(--text-muted);
    font-weight: 500;
    margin-bottom: 4px;
}

.stat-value {
    font-size: 28px;
    font-weight: 700;
}

/* Client Folders Grid */
.clients-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 24px;
}

.client-folder-card {
    background-color: var(--panel-bg);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 24px;
    transition: all 0.3s ease;
    cursor: pointer;
    display: flex;
    flex-direction: column;
}

.client-folder-card:hover {
    transform: translateY(-4px);
    border-color: var(--primary);
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);
}

.client-folder-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 20px;
}

.client-avatar {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: linear-gradient(45deg, #1e293b, #334155);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    font-weight: bold;
}

.client-folder-header h3 {
    font-size: 18px;
    font-weight: 600;
}

.client-networks-summary {
    display: flex;
    gap: -8px;
    margin-bottom: 20px;
}

.network-mini-icon {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background-color: #1e293b;
    border: 2px solid var(--panel-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-main);
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
    margin-top: auto;
}

.client-folder-card:hover .btn-outline {
    border-color: var(--primary);
    color: var(--primary);
}

/* Inner Client Tabs */
.client-tabs {
    display: flex;
    gap: 2px;
    background: rgba(0,0,0,0.2);
    padding: 4px;
    border-radius: 10px;
    margin-bottom: 24px;
    width: max-content;
}

.client-tab {
    background: transparent;
    border: none;
    color: var(--text-muted);
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.client-tab.active {
    background: var(--primary);
    color: white;
}

/* Redes conectadas do cliente */
.networks-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.network-card {
    background-color: var(--panel-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
}

.network-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    background-color: rgba(255,255,255,0.05);
}

.network-info {
    flex-grow: 1;
    overflow: hidden;
}

.network-info h4 {
    font-size: 15px;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.network-status {
    font-size: 12px;
    color: var(--success);
    display: flex;
    align-items: center;
    gap: 4px;
}

/* Posts Feed */
.posts-feed {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.post-card {
    background-color: var(--panel-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 16px;
    display: flex;
    gap: 20px;
    align-items: flex-start;
}

.post-media {
    width: 100px;
    height: 100px;
    border-radius: 8px;
    background-color: rgba(0,0,0,0.3);
    object-fit: cover;
}

.post-content {
    flex-grow: 1;
}

.post-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
}

.post-networks {
    display: flex;
    gap: 8px;
    font-size: 14px;
    color: var(--text-muted);
}

.post-status {
    font-size: 12px;
    padding: 4px 8px;
    border-radius: 4px;
    background: rgba(16, 185, 129, 0.1);
    color: var(--success);
}

.post-status.draft { background: rgba(245, 158, 11, 0.1); color: var(--warning); }
.post-status.failed { background: rgba(239, 68, 68, 0.1); color: var(--danger); }

.post-text {
    font-size: 14px;
    line-height: 1.5;
    margin-bottom: 16px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.post-metrics {
    display: flex;
    gap: 24px;
    border-top: 1px solid var(--border-color);
    padding-top: 12px;
}

.metric {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--text-muted);
}

.metric i {
    font-size: 16px;
    color: var(--primary);
}


/* Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s;
    z-index: 1000;
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: all;
}

.modal-content {
    background: var(--dark-bg);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    width: 100%;
    max-width: 500px;
    padding: 32px;
    transform: translateY(20px);
    transition: all 0.3s;
    box-shadow: 0 20px 40px rgba(0,0,0,0.4);
}

.modal-overlay.active .modal-content {
    transform: translateY(0);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.modal-header h2 {
    font-size: 20px;
}

.btn-close {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 24px;
    cursor: pointer;
}

.btn-close:hover {
    color: white;
}

.modal-body p {
    color: var(--text-muted);
    font-size: 14px;
    line-height: 1.5;
    margin-bottom: 24px;
}

.input-group {
    margin-bottom: 20px;
}

.input-group label {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    font-weight: 500;
}

select {
    width: 100%;
    padding: 12px 16px;
    background: rgba(0,0,0,0.2);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: white;
    font-size: 14px;
    outline: none;
    appearance: none;
}
select option {
    background: var(--dark-bg);
}

.copy-box {
    display: flex;
    background: rgba(0,0,0,0.2);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
}

.copy-box input {
    flex-grow: 1;
    background: transparent;
    border: none;
    padding: 12px 16px;
    color: white;
    font-size: 14px;
    outline: none;
}

.btn-copy {
    background: var(--primary);
    border: none;
    color: white;
    padding: 0 20px;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-copy:hover {
    background: var(--primary-hover);
}

/* Toast */
.toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background: var(--success);
    color: white;
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 500;
    transform: translateY(100px);
    opacity: 0;
    transition: all 0.3s;
    box-shadow: 0 10px 20px rgba(0,0,0,0.2);
}

.toast.show {
    transform: translateY(0);
    opacity: 1;
}

/* Loader */
.loading-overlay {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(15, 23, 42, 0.9);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 50;
    gap: 16px;
    transition: opacity 0.3s;
}

.loading-overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(99, 102, 241, 0.3);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}
