/* Mehdi OS — Command Center Styles
 * Premium Dark Theme
 */

:root {
    /* Base Colors */
    --bg-primary: #0a0a0b;
    --bg-secondary: #121214;
    --bg-tertiary: #1a1a1d;
    --bg-elevated: #202024;
    --bg-hover: #2a2a2e;
    
    /* Borders */
    --border-subtle: rgba(255, 255, 255, 0.06);
    --border-default: rgba(255, 255, 255, 0.1);
    --border-focus: rgba(255, 255, 255, 0.2);
    
    /* Text */
    --text-primary: #fafafa;
    --text-secondary: #a1a1aa;
    --text-tertiary: #71717a;
    --text-muted: #52525b;
    
    /* Accents */
    --accent-primary: #f59e0b;
    --accent-primary-hover: #fbbf24;
    --accent-secondary: #3b82f6;
    --accent-success: #10b981;
    --accent-warning: #f59e0b;
    --accent-danger: #ef4444;
    --accent-info: #06b6d4;
    
    /* Department Colors */
    --dept-ads: #f59e0b;
    --dept-youtube: #ef4444;
    --dept-instagram: #8b5cf6;
    --dept-sales: #10b981;
    --dept-finance: #06b6d4;
    --dept-content: #ec4899;
    
    /* Spacing */
    --space-xs: 0.25rem;
    --space-sm: 0.5rem;
    --space-md: 1rem;
    --space-lg: 1.5rem;
    --space-xl: 2rem;
    --space-2xl: 3rem;
    
    /* Radii */
    --radius-sm: 6px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    
    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.5);
    
    /* Transitions */
    --transition-fast: 150ms ease;
    --transition-base: 200ms ease;
    --transition-slow: 300ms ease;
    
    /* Layout */
    --sidebar-width: 240px;
    --topbar-height: 64px;
    --drawer-width: 420px;
}

/* Reset & Base */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.5;
    overflow: hidden;
}

#app {
    display: flex;
    height: 100vh;
    width: 100vw;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}

::-webkit-scrollbar-thumb {
    background: var(--bg-elevated);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--bg-hover);
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background: var(--bg-secondary);
    border-right: 1px solid var(--border-subtle);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    transition: transform var(--transition-base);
}

.sidebar-header {
    padding: var(--space-lg);
    border-bottom: 1px solid var(--border-subtle);
}

.logo {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    margin-bottom: var(--space-sm);
}

.logo-icon {
    font-size: 1.5rem;
    color: var(--accent-primary);
}

.logo-text {
    font-size: 1.125rem;
    font-weight: 600;
    letter-spacing: -0.02em;
}

.gateway-status {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    font-size: 0.75rem;
    color: var(--text-tertiary);
}

.status-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--accent-success);
    box-shadow: 0 0 6px var(--accent-success);
}

.status-dot.offline {
    background: var(--accent-danger);
    box-shadow: 0 0 6px var(--accent-danger);
}

.sidebar-nav {
    flex: 1;
    padding: var(--space-md);
    overflow-y: auto;
}

.nav-section {
    margin-bottom: var(--space-lg);
}

.nav-label {
    display: block;
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    padding: 0 var(--space-sm);
    margin-bottom: var(--space-xs);
}

.nav-item {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-sm) var(--space-md);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all var(--transition-fast);
    position: relative;
}

.nav-item:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.nav-item.active {
    background: var(--bg-elevated);
    color: var(--text-primary);
}

.nav-item.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 16px;
    background: var(--accent-primary);
    border-radius: 0 2px 2px 0;
}

.nav-icon {
    font-size: 1rem;
    width: 20px;
    text-align: center;
}

.badge {
    margin-left: auto;
    font-size: 0.6875rem;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 10px;
    background: var(--bg-hover);
    color: var(--text-secondary);
    min-width: 18px;
    text-align: center;
}

.badge.urgent {
    background: rgba(239, 68, 68, 0.2);
    color: var(--accent-danger);
}

.sidebar-footer {
    padding: var(--space-md);
    border-top: 1px solid var(--border-subtle);
}

.last-sync {
    font-size: 0.6875rem;
    color: var(--text-muted);
    margin-bottom: var(--space-sm);
}

/* Main Content */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: var(--bg-primary);
}

/* Top Bar */
.top-bar {
    height: var(--topbar-height);
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-subtle);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 var(--space-xl);
    flex-shrink: 0;
}

.top-bar-left {
    display: flex;
    align-items: center;
    gap: var(--space-md);
}

.menu-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.25rem;
    cursor: pointer;
    padding: var(--space-xs);
}

.page-title {
    font-size: 1.25rem;
    font-weight: 600;
    letter-spacing: -0.02em;
}

.top-bar-right {
    display: flex;
    align-items: center;
    gap: var(--space-lg);
}

.search-box {
    position: relative;
}

.search-box input {
    width: 320px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: var(--space-sm) var(--space-md);
    padding-right: 48px;
    color: var(--text-primary);
    font-size: 0.875rem;
    transition: all var(--transition-fast);
}

.search-box input:focus {
    outline: none;
    border-color: var(--border-focus);
    background: var(--bg-elevated);
}

.search-box input::placeholder {
    color: var(--text-muted);
}

.search-shortcut {
    position: absolute;
    right: var(--space-sm);
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.6875rem;
    color: var(--text-muted);
    background: var(--bg-hover);
    padding: 2px 6px;
    border-radius: var(--radius-sm);
}

.quick-filters {
    display: flex;
    gap: var(--space-xs);
}

.filter-btn {
    background: transparent;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: var(--space-xs) var(--space-md);
    color: var(--text-secondary);
    font-size: 0.8125rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.filter-btn:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.filter-btn.active {
    background: var(--bg-elevated);
    border-color: var(--border-default);
    color: var(--text-primary);
}

/* Page Container */
.page-container {
    flex: 1;
    overflow: auto;
    padding: var(--space-xl);
}

.page {
    display: none;
    animation: fadeIn var(--transition-base);
}

.page.active {
    display: block;
}

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

/* Dashboard Grid */
.dashboard-grid {
    display: flex;
    flex-direction: column;
    gap: var(--space-xl);
}

/* KPI Cards */
.kpi-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--space-md);
}

.kpi-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    transition: all var(--transition-fast);
}

.kpi-card:hover {
    border-color: var(--border-default);
    transform: translateY(-2px);
}

.kpi-card.highlight {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.1) 0%, var(--bg-secondary) 100%);
    border-color: rgba(245, 158, 11, 0.3);
}

.kpi-label {
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-tertiary);
    margin-bottom: var(--space-xs);
}

.kpi-value {
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: -0.03em;
    margin-bottom: var(--space-xs);
}

.kpi-trend {
    font-size: 0.8125rem;
    color: var(--text-secondary);
}

.kpi-trend.up {
    color: var(--accent-success);
}

.kpi-trend.down {
    color: var(--accent-danger);
}

/* Board Section */
.board-section {
    background: var(--bg-secondary);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-lg);
}

.section-header h2 {
    font-size: 1rem;
    font-weight: 600;
}

.section-actions {
    display: flex;
    gap: var(--space-sm);
}

/* Kanban Board */
.kanban-board {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: var(--space-md);
    min-height: 400px;
}

.kanban-board.full {
    grid-template-columns: repeat(5, 1fr);
}

.kanban-column {
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    display: flex;
    flex-direction: column;
    min-height: 200px;
}

.kanban-column-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-md);
    border-bottom: 1px solid var(--border-subtle);
}

.column-title {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.column-count {
    font-size: 0.75rem;
    color: var(--text-muted);
    background: var(--bg-elevated);
    padding: 2px 8px;
    border-radius: 10px;
}

.kanban-column-content {
    flex: 1;
    padding: var(--space-sm);
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
    overflow-y: auto;
    max-height: 600px;
}

/* Task Card */
.task-card {
    background: var(--bg-elevated);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: var(--space-md);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.task-card:hover {
    border-color: var(--border-default);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.task-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: var(--space-sm);
    margin-bottom: var(--space-sm);
}

.task-title {
    font-size: 0.875rem;
    font-weight: 500;
    line-height: 1.4;
    color: var(--text-primary);
}

.task-priority {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.task-priority.urgent { background: var(--accent-danger); }
.task-priority.high { background: var(--accent-warning); }
.task-priority.medium { background: var(--accent-secondary); }
.task-priority.low { background: var(--text-muted); }

.task-meta {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    flex-wrap: wrap;
}

.task-tag {
    font-size: 0.6875rem;
    font-weight: 500;
    padding: 2px 8px;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.task-tag.ads { background: rgba(245, 158, 11, 0.15); color: var(--dept-ads); }
.task-tag.youtube { background: rgba(239, 68, 68, 0.15); color: var(--dept-youtube); }
.task-tag.instagram { background: rgba(139, 92, 246, 0.15); color: var(--dept-instagram); }
.task-tag.sales { background: rgba(16, 185, 129, 0.15); color: var(--dept-sales); }
.task-tag.finance { background: rgba(6, 182, 212, 0.15); color: var(--dept-finance); }
.task-tag.content { background: rgba(236, 72, 153, 0.15); color: var(--dept-content); }
.task-tag.general { background: var(--bg-hover); color: var(--text-secondary); }

.task-owner {
    font-size: 0.75rem;
    color: var(--text-tertiary);
}

.task-owner.ai {
    color: var(--accent-info);
}

.task-due {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-left: auto;
}

.task-due.overdue {
    color: var(--accent-danger);
}

/* Split Row */
.split-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-xl);
}

.panel {
    background: var(--bg-secondary);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-md) var(--space-lg);
    border-bottom: 1px solid var(--border-subtle);
}

.panel-header h3 {
    font-size: 0.875rem;
    font-weight: 600;
}

.link {
    color: var(--accent-secondary);
    text-decoration: none;
    font-size: 0.8125rem;
    font-weight: 500;
}

.link:hover {
    text-decoration: underline;
}

/* Activity Log */
.activity-log {
    padding: var(--space-sm);
    max-height: 300px;
    overflow-y: auto;
}

.activity-item {
    display: flex;
    gap: var(--space-md);
    padding: var(--space-md);
    border-radius: var(--radius-md);
    transition: background var(--transition-fast);
}

.activity-item:hover {
    background: var(--bg-tertiary);
}

.activity-icon {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-md);
    background: var(--bg-elevated);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.875rem;
    flex-shrink: 0;
}

.activity-content {
    flex: 1;
}

.activity-title {
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: 2px;
}

.activity-desc {
    font-size: 0.8125rem;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.activity-meta {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* Recommendations */
.recommendations {
    padding: var(--space-sm);
}

.rec-item {
    display: flex;
    align-items: flex-start;
    gap: var(--space-md);
    padding: var(--space-md);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.rec-item:hover {
    background: var(--bg-tertiary);
}

.rec-priority {
    width: 4px;
    height: 40px;
    border-radius: 2px;
    flex-shrink: 0;
}

.rec-priority.high { background: var(--accent-danger); }
.rec-priority.medium { background: var(--accent-warning); }
.rec-priority.low { background: var(--accent-secondary); }

.rec-content h4 {
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: 4px;
}

.rec-content p {
    font-size: 0.8125rem;
    color: var(--text-secondary);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-xs);
    padding: var(--space-sm) var(--space-md);
    border-radius: var(--radius-md);
    font-size: 0.8125rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
    border: none;
    background: none;
}

.btn-primary {
    background: var(--accent-primary);
    color: #000;
}

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

.btn-secondary {
    background: var(--bg-elevated);
    border: 1px solid var(--border-default);
    color: var(--text-primary);
}

.btn-secondary:hover {
    background: var(--bg-hover);
    border-color: var(--border-focus);
}

.btn-ghost {
    color: var(--text-secondary);
}

.btn-ghost:hover {
    color: var(--text-primary);
    background: var(--bg-hover);
}

.btn-full {
    width: 100%;
}

.btn-sm {
    padding: var(--space-xs) var(--space-sm);
    font-size: 0.75rem;
}

/* Drawer */
.drawer-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-base);
    z-index: 100;
}

.drawer-overlay.active {
    opacity: 1;
    visibility: visible;
}

.task-drawer {
    position: fixed;
    top: 0;
    right: 0;
    width: var(--drawer-width);
    height: 100%;
    background: var(--bg-secondary);
    border-left: 1px solid var(--border-subtle);
    transform: translateX(100%);
    transition: transform var(--transition-base);
    z-index: 101;
    display: flex;
    flex-direction: column;
}

.task-drawer.active {
    transform: translateX(0);
}

.drawer-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-lg);
    border-bottom: 1px solid var(--border-subtle);
}

.drawer-header h2 {
    font-size: 1.125rem;
    font-weight: 600;
}

.drawer-content {
    flex: 1;
    overflow-y: auto;
    padding: var(--space-lg);
}

.drawer-actions {
    display: flex;
    justify-content: flex-end;
    gap: var(--space-md);
    padding: var(--space-lg);
    border-top: 1px solid var(--border-subtle);
}

/* Forms */
.form-group {
    margin-bottom: var(--space-lg);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-md);
}

.form-group label {
    display: block;
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: var(--space-xs);
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: var(--space-sm) var(--space-md);
    color: var(--text-primary);
    font-size: 0.875rem;
    font-family: inherit;
    transition: all var(--transition-fast);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--accent-primary);
    background: var(--bg-elevated);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: var(--text-muted);
}

.form-group select {
    cursor: pointer;
}

.form-group textarea {
    resize: vertical;
    min-height: 80px;
}

/* Department Pages */
.dept-header {
    margin-bottom: var(--space-xl);
}

.dept-tabs {
    display: flex;
    gap: var(--space-xs);
}

.tab-btn {
    background: transparent;
    border: none;
    padding: var(--space-sm) var(--space-lg);
    color: var(--text-secondary);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
}

.tab-btn:hover {
    color: var(--text-primary);
    background: var(--bg-secondary);
}

.tab-btn.active {
    color: var(--text-primary);
    background: var(--bg-elevated);
}

.coming-soon {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--space-2xl);
    text-align: center;
    background: var(--bg-secondary);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    min-height: 400px;
}

.cs-icon {
    font-size: 4rem;
    margin-bottom: var(--space-lg);
    opacity: 0.7;
}

.coming-soon h2 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: var(--space-sm);
}

.coming-soon p {
    color: var(--text-secondary);
    margin-bottom: var(--space-lg);
}

.cs-features {
    display: flex;
    gap: var(--space-sm);
    flex-wrap: wrap;
    justify-content: center;
}

.tag {
    font-size: 0.75rem;
    font-weight: 500;
    padding: var(--space-xs) var(--space-md);
    background: var(--bg-tertiary);
    border: 1px solid var(--border-subtle);
    border-radius: 20px;
    color: var(--text-secondary);
}

/* Knowledge Base */
.knowledge-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: var(--space-lg);
}

.knowledge-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: var(--space-xl);
    transition: all var(--transition-fast);
}

.knowledge-card:hover {
    border-color: var(--border-default);
    transform: translateY(-4px);
}

.knowledge-card h3 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: var(--space-sm);
}

.knowledge-card p {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: var(--space-md);
}

/* Settings */
.settings-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-lg);
}

.settings-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: var(--space-xl);
}

.settings-card h3 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: var(--space-lg);
}

.setting-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-md) 0;
    border-bottom: 1px solid var(--border-subtle);
}

.setting-item:last-child {
    border-bottom: none;
}

.status {
    font-size: 0.8125rem;
    font-weight: 500;
}

.status.disabled {
    color: var(--text-muted);
}

.status.connected {
    color: var(--accent-success);
}

.toggle-group {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.toggle {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    cursor: pointer;
    padding: var(--space-sm);
    border-radius: var(--radius-md);
    transition: background var(--transition-fast);
}

.toggle:hover {
    background: var(--bg-tertiary);
}

.toggle input {
    cursor: pointer;
}

/* Toast Notifications */
.toast-container {
    position: fixed;
    bottom: var(--space-xl);
    right: var(--space-xl);
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
    z-index: 200;
}

.toast {
    background: var(--bg-elevated);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-md);
    padding: var(--space-md) var(--space-lg);
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    box-shadow: var(--shadow-lg);
    animation: slideIn var(--transition-base);
}

.toast.success {
    border-left: 3px solid var(--accent-success);
}

.toast.error {
    border-left: 3px solid var(--accent-danger);
}

.toast.info {
    border-left: 3px solid var(--accent-secondary);
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(100%);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Charts */
.charts-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-lg);
    margin-top: var(--space-xl);
}

.chart-card {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
}

.chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-md);
}

.chart-header h4 {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.chart-container {
    height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chart-empty {
    color: var(--text-muted);
    font-size: 0.875rem;
}

.chart-svg {
    width: 100%;
}

.chart-grid {
    stroke: var(--border-subtle);
    stroke-dasharray: 4;
}

.chart-line {
    stroke-linecap: round;
    stroke-linejoin: round;
}

.chart-point {
    cursor: pointer;
    transition: r var(--transition-fast);
}

.chart-point:hover {
    r: 6;
}

.chart-label {
    fill: var(--text-muted);
    font-size: 10px;
}

.chart-bar {
    cursor: pointer;
    transition: opacity var(--transition-fast);
}

.chart-bar:hover {
    opacity: 0.8;
}

.chart-legend {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-sm);
    justify-content: center;
    margin-top: var(--space-sm);
}

.legend-item {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    font-size: 0.75rem;
}

.legend-color {
    width: 10px;
    height: 10px;
    border-radius: 2px;
}

.legend-label {
    color: var(--text-secondary);
}

.legend-value {
    color: var(--text-muted);
}

.chart-center-text {
    fill: var(--text-primary);
    font-size: 1.5rem;
    font-weight: 600;
}

/* Metrics */
.metrics-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--space-md);
}

.metric-card {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    transition: all var(--transition-fast);
}

.metric-card:hover {
    border-color: var(--border-default);
}

.metric-card.highlight {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.1) 0%, var(--bg-tertiary) 100%);
    border-color: rgba(245, 158, 11, 0.3);
}

.metric-card.danger {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.1) 0%, var(--bg-tertiary) 100%);
    border-color: rgba(239, 68, 68, 0.3);
}

.metric-card.success {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.1) 0%, var(--bg-tertiary) 100%);
    border-color: rgba(16, 185, 129, 0.3);
}

.metric-label {
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-tertiary);
    margin-bottom: var(--space-xs);
}

.metric-value {
    font-size: 1.75rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.metric-change {
    font-size: 0.8125rem;
    margin-top: var(--space-xs);
}

.metric-change.up {
    color: var(--accent-success);
}

.metric-change.down {
    color: var(--accent-danger);
}

.data-entry-prompt {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    text-align: center;
    margin-top: var(--space-xl);
}

.data-entry-prompt p {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.data-entry-prompt a {
    color: var(--accent-secondary);
    text-decoration: none;
    font-weight: 500;
}

.data-entry-prompt a:hover {
    text-decoration: underline;
}

/* Department Tabs */
.tab-content {
    display: none;
    animation: fadeIn var(--transition-base);
}

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

/* Data Page */
.data-page {
    max-width: 1000px;
}

.data-header {
    margin-bottom: var(--space-xl);
}

.data-header h2 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: var(--space-xs);
}

.data-header p {
    color: var(--text-secondary);
}

.data-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-lg);
    margin-bottom: var(--space-2xl);
}

.data-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: var(--space-xl);
    transition: all var(--transition-fast);
}

.data-card:hover {
    border-color: var(--border-default);
}

.data-card-header {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    margin-bottom: var(--space-md);
}

.data-icon {
    font-size: 1.5rem;
}

.data-card h3 {
    font-size: 1rem;
    font-weight: 600;
}

.data-card p {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: var(--space-lg);
}

.data-actions {
    display: flex;
    gap: var(--space-sm);
}

.data-section {
    margin-top: var(--space-2xl);
}

.data-section h3 {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: var(--space-lg);
}

.metrics-tabs {
    display: flex;
    gap: var(--space-xs);
    margin-bottom: var(--space-lg);
    border-bottom: 1px solid var(--border-subtle);
    padding-bottom: var(--space-sm);
}

.metrics-forms {
    background: var(--bg-secondary);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: var(--space-xl);
}

.metrics-form {
    display: none;
}

.metrics-form.active {
    display: block;
    animation: fadeIn var(--transition-base);
}

.btn-danger {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: var(--accent-danger);
}

.btn-danger:hover {
    background: rgba(239, 68, 68, 0.2);
}

/* API Status */
.api-status-indicator {
    display: inline-flex;
    align-items: center;
    gap: var(--space-xs);
    font-size: 0.75rem;
    padding: 2px 8px;
    border-radius: 12px;
    background: var(--bg-tertiary);
}

.api-status-indicator.connected {
    background: rgba(16, 185, 129, 0.1);
    color: var(--accent-success);
}

.api-status-indicator.disconnected {
    background: var(--bg-hover);
    color: var(--text-muted);
}

.status-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--text-muted);
}

.status-dot.connected {
    background: var(--accent-success);
    box-shadow: 0 0 4px var(--accent-success);
}

/* API Key Sections */
.api-key-section {
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    margin-bottom: var(--space-md);
    overflow: hidden;
}

.api-key-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-md);
    background: var(--bg-tertiary);
    cursor: pointer;
    transition: background var(--transition-fast);
    font-weight: 500;
    font-size: 0.875rem;
}

.api-key-header:hover {
    background: var(--bg-hover);
}

.toggle-icon {
    font-size: 0.75rem;
    transition: transform var(--transition-fast);
}

.api-key-section.collapsed .toggle-icon {
    transform: rotate(-90deg);
}

.api-key-content {
    padding: var(--space-lg);
    display: none;
}

.api-key-content.active {
    display: block;
}

.api-key-content .form-group {
    margin-bottom: var(--space-md);
}

.api-key-content .form-group:last-child {
    margin-bottom: 0;
}

.api-key-content label {
    display: block;
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: var(--space-xs);
}

.api-key-content input {
    width: 100%;
    background: var(--bg-elevated);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: var(--space-sm) var(--space-md);
    color: var(--text-primary);
    font-size: 0.875rem;
    font-family: monospace;
}

.api-key-content input:focus {
    outline: none;
    border-color: var(--accent-primary);
}

.help-text {
    display: block;
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: var(--space-xs);
}

.help-text a {
    color: var(--accent-secondary);
    text-decoration: none;
}

.help-text a:hover {
    text-decoration: underline;
}

.api-security-note {
    padding-top: var(--space-md);
    border-top: 1px solid var(--border-subtle);
}

/* Sync buttons */
.sync-btn {
    display: inline-flex;
    align-items: center;
    gap: var(--space-xs);
}

.sync-btn.spinning::before {
    content: '↻';
    animation: spin 1s linear infinite;
}

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

/* Priority List */
.priority-list h3 {
    font-size: 0.875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    margin: var(--space-xl) 0 var(--space-md);
}

.priority-list h3:first-child {
    margin-top: 0;
}

.priority-group {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}

.priority-item {
    background: var(--bg-secondary);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.priority-item:hover {
    border-color: var(--border-default);
    transform: translateX(4px);
}

.priority-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-sm);
}

.priority-title {
    font-size: 1rem;
    font-weight: 500;
    margin-bottom: var(--space-sm);
}

.priority-meta {
    display: flex;
    gap: var(--space-md);
    font-size: 0.8125rem;
    color: var(--text-secondary);
}

.priority-meta .due-date.overdue {
    color: var(--accent-danger);
}

/* Responsive */
@media (max-width: 1200px) {
    .kpi-row {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .kanban-board {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .split-row {
        grid-template-columns: 1fr;
    }
    
    .settings-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .sidebar {
        position: fixed;
        z-index: 90;
        transform: translateX(-100%);
    }
    
    .sidebar.open {
        transform: translateX(0);
    }
    
    .menu-toggle {
        display: block;
    }
    
    .search-box input {
        width: 200px;
    }
    
    .quick-filters {
        display: none;
    }
    
    .kanban-board {
        grid-template-columns: 1fr;
    }
    
    .kpi-row {
        grid-template-columns: 1fr;
    }
    
    .task-drawer {
        width: 100%;
    }
}

/* Instagram Profile Section */
.dept-profile {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-sm) var(--space-md);
    margin-bottom: var(--space-md);
    background: var(--bg-elevated);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-md);
}

.profile-label {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.9rem;
}

.profile-link {
    color: var(--dept-instagram);
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 500;
}

.profile-link:hover {
    text-decoration: underline;
}

/* Account Status Badge */
.account-status {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-sm) var(--space-md);
    margin-bottom: var(--space-lg);
    background: var(--bg-elevated);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-md);
}

.status-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-badge.rebuilding {
    background: rgba(245, 158, 11, 0.15);
    color: var(--accent-warning);
    border: 1px solid rgba(245, 158, 11, 0.3);
}

.status-badge.active {
    background: rgba(16, 185, 129, 0.15);
    color: var(--accent-success);
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.status-note {
    font-size: 0.8rem;
    color: var(--text-tertiary);
}

/* Small button variant */
.btn-small {
    padding: 6px 12px;
    font-size: 0.8rem;
}

/* Refresh button in top bar */
#refreshAllBtn {
    margin-right: var(--space-md);
    white-space: nowrap;
}

#refreshAllBtn.spinning {
    animation: spin 1s linear infinite;
    opacity: 0.7;
}

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

/* Last sync indicator */
.last-sync-info {
    font-size: 0.75rem;
    color: var(--text-tertiary);
    margin-right: var(--space-md);
    display: flex;
    align-items: center;
    gap: var(--space-xs);
}

.last-sync-info.syncing {
    color: var(--accent-primary);
}

.last-sync-info.success {
    color: var(--accent-success);
}

/* Progress Card - Clean & Cohesive */
.progress-card {
    background: var(--bg-elevated);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    margin-bottom: var(--space-xl);
}

.progress-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-md);
}

.progress-label {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
}

.progress-value {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--accent-primary);
}

.progress-bar-container {
    width: 100%;
    height: 12px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-sm);
    overflow: hidden;
    margin-bottom: var(--space-sm);
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--accent-primary) 0%, var(--accent-primary-hover) 100%);
    border-radius: var(--radius-sm);
    transition: width 0.5s ease;
    position: relative;
}

.progress-bar::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.1) 50%, transparent 100%);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.progress-stats {
    font-size: 0.8rem;
    color: var(--text-secondary);
    text-align: right;
}

.progress-stats span {
    color: var(--text-primary);
    font-weight: 600;
}

/* KPI Toggle Buttons */
.kpi-toggle {
    display: flex;
    gap: 2px;
    background: var(--bg-tertiary);
    padding: 2px;
    border-radius: var(--radius-sm);
}

.kpi-toggle .toggle-btn {
    padding: 2px 8px;
    font-size: 10px;
    border: none;
    background: transparent;
    color: var(--text-muted);
    border-radius: 3px;
    cursor: pointer;
    transition: all 0.15s ease;
    font-weight: 500;
}

.kpi-toggle .toggle-btn:hover {
    color: var(--text-secondary);
}

.kpi-toggle .toggle-btn.active {
    background: var(--accent-primary);
    color: white;
}
