/*
 * AlphaTech Integration Portal v3 — Design System
 * Inspired by alphatechsis.com dark palette
 * Theme: light/dark via CSS custom properties
 */

/* ══════════════════════════════════════════════
   Google Fonts
   ══════════════════════════════════════════════ */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap');

/* ══════════════════════════════════════════════
   CSS Custom Properties — Light Theme (default)
   ══════════════════════════════════════════════ */
:root {
    /* Palette */
    --color-primary:        #0066ff;
    --color-primary-light:  #3385ff;
    --color-primary-dark:   #0052cc;
    --color-accent:         #00d4ff;
    --color-accent-light:   #33ddff;
    --color-secondary:      #0f172a;
    --color-secondary-light:#334155;

    /* Surfaces */
    --bg-body:              #f8fafc;
    --bg-surface:           #ffffff;
    --bg-surface-raised:    #ffffff;
    --bg-sidebar:           #ffffff;
    --bg-sidebar-hover:     #f8fafc;
    --bg-sidebar-active:    #eff6ff;
    --bg-input:             #f1f5f9;
    --bg-input-focus:       #ffffff;
    --bg-card:              #ffffff;

    /* Text */
    --text-primary:         #0f172a;
    --text-secondary:       #334155;
    --text-muted:           #64748b;
    --text-inverse:         #ffffff;
    --text-sidebar:         #64748b;
    --text-sidebar-active:  #0066ff;

    /* Borders */
    --border-default:       rgba(0,0,0,0.08);
    --border-focus:         #0066ff;
    --border-glow:          rgba(0,102,255,0.15);
    --border-radius-sm:     6px;
    --border-radius-md:     10px;
    --border-radius-lg:     12px;
    --border-radius-full:   9999px;

    /* Shadows */
    --shadow-sm:            0 1px 2px rgba(0,0,0,0.05);
    --shadow-md:            0 4px 6px -1px rgba(0,0,0,0.07), 0 2px 4px -2px rgba(0,0,0,0.05);
    --shadow-lg:            0 10px 15px -3px rgba(0,0,0,0.08), 0 4px 6px -4px rgba(0,0,0,0.05);
    --shadow-glow:          0 0 20px rgba(0,102,255,0.15);

    /* Status Colors */
    --color-success:        #10b981;
    --color-success-bg:     #ecfdf5;
    --color-warning:        #f59e0b;
    --color-warning-bg:     #fffbeb;
    --color-error:          #ef4444;
    --color-error-bg:       #fef2f2;
    --color-info:           #3b82f6;
    --color-info-bg:        #eff6ff;

    /* Spacing */
    --space-xs:             4px;
    --space-sm:             8px;
    --space-md:             16px;
    --space-lg:             24px;
    --space-xl:             32px;
    --space-2xl:            48px;

    /* Typography */
    --font-sans:            'Poppins', 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-mono:            'JetBrains Mono', 'Fira Code', monospace;
    --text-xs:              0.75rem;
    --text-sm:              0.875rem;
    --text-base:            1rem;
    --text-lg:              1.125rem;
    --text-xl:              1.25rem;
    --text-2xl:             1.5rem;
    --text-3xl:             1.875rem;

    /* Transitions */
    --transition-fast:      150ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-base:      250ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow:      350ms cubic-bezier(0.4, 0, 0.2, 1);

    /* Sidebar */
    --sidebar-width:        260px;
    --sidebar-collapsed:    72px;
    --header-height:        72px;
}

/* ══════════════════════════════════════════════
   Dark Theme Override
   ══════════════════════════════════════════════ */
.dark-theme {
    --bg-body:              #060b18;
    --bg-surface:           #0d1425;
    --bg-surface-raised:    #111827;
    --bg-sidebar:           #0d1425;
    --bg-sidebar-hover:     #16213a;
    --bg-sidebar-active:    rgba(0,212,255,0.1);
    --bg-input:             #111827;
    --bg-input-focus:       #16213a;
    --bg-card:              #111827;

    --text-primary:         #f1f5f9;
    --text-secondary:       #94a3b8;
    --text-muted:           #475569;
    --text-sidebar:         #94a3b8;
    --text-sidebar-active:  #00d4ff;

    --border-default:       rgba(255,255,255,0.07);
    --border-focus:         #00d4ff;
    --border-glow:          rgba(0,212,255,0.25);

    --shadow-sm:            0 1px 2px rgba(0,0,0,0.3);
    --shadow-md:            0 4px 6px rgba(0,0,0,0.4);
    --shadow-lg:            0 10px 15px rgba(0,0,0,0.5);
    --shadow-glow:          0 0 30px rgba(0,212,255,0.35);

    --color-success-bg:     #064e3b;
    --color-warning-bg:     #78350f;
    --color-error-bg:       #7f1d1d;
    --color-info-bg:        #1e3a5f;
}

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

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

body {
    font-family: var(--font-sans);
    background-color: var(--bg-body);
    color: var(--text-primary);
    line-height: 1.6;
    transition: background-color var(--transition-base), color var(--transition-base);
}

a {
    color: var(--color-primary);
    text-decoration: none;
    transition: color var(--transition-fast);
}
a:hover { color: var(--color-accent); }

/* ══════════════════════════════════════════════
   Layout — Sidebar + Main Content
   ══════════════════════════════════════════════ */
.portal-layout {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background: var(--bg-sidebar);
    color: var(--text-sidebar);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    height: 100dvh;
    z-index: 100;
    transition: width var(--transition-base);
    overflow-y: auto;
    overflow-x: hidden;
}

.sidebar-brand {
    padding: var(--space-lg);
    display: flex;
    align-items: center;
    gap: var(--space-md);
    border-bottom: 1px solid rgba(255,255,255,0.08);
}

.sidebar-brand .brand-logo {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, var(--color-primary), var(--color-accent));
    border-radius: var(--border-radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: var(--text-lg);
    color: #fff;
    flex-shrink: 0;
}

.sidebar-brand .brand-text {
    font-size: var(--text-sm);
    font-weight: 600;
    color: var(--text-inverse);
    white-space: nowrap;
}

.sidebar-brand .brand-sub {
    font-size: var(--text-xs);
    color: var(--text-muted);
    display: block;
}

.logo-dark { display: none; }
.logo-light { display: block; }
.logo-icon { display: none; }

.dark-theme .logo-dark { display: block; }
.dark-theme .logo-light { display: none; }
.dark-theme .logo-icon { display: none; }

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

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

.nav-section-title {
    padding: var(--space-sm) var(--space-lg);
    font-size: var(--text-xs);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
}

.nav-link {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-sm) var(--space-lg);
    color: var(--text-sidebar);
    font-size: var(--text-sm);
    font-weight: 400;
    border-radius: 0;
    transition: all var(--transition-fast);
    cursor: pointer;
    text-decoration: none;
    position: relative;
}

.nav-link:hover {
    background: var(--bg-sidebar-hover);
    color: var(--text-sidebar-active);
}

.nav-link.active {
    background: var(--bg-sidebar-active);
    color: var(--text-sidebar-active);
    font-weight: 500;
}

.nav-link.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: var(--color-accent);
    border-radius: 0 2px 2px 0;
}

.nav-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    opacity: 0.7;
}
.nav-link:hover .nav-icon,
.nav-link.active .nav-icon {
    opacity: 1;
}

.nav-badge {
    margin-left: auto;
    background: var(--color-accent);
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 7px;
    border-radius: var(--border-radius-full);
    min-width: 20px;
    text-align: center;
}

/* Main content area */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    transition: margin-left var(--transition-base);
}

/* Top Header Bar */
.top-header {
    height: var(--header-height);
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border-default);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 var(--space-xl);
    position: sticky;
    top: 0;
    z-index: 50;
    transition: background-color var(--transition-base);
}

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

.page-title {
    font-size: var(--text-xl);
    font-weight: 600;
    color: var(--text-primary);
}

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

/* Theme Toggle */
.theme-toggle {
    width: 44px;
    height: 24px;
    background: var(--bg-input);
    border: 1px solid var(--border-default);
    border-radius: var(--border-radius-full);
    cursor: pointer;
    position: relative;
    transition: all var(--transition-fast);
}

.theme-toggle::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 18px;
    height: 18px;
    background: var(--color-primary);
    border-radius: 50%;
    transition: transform var(--transition-fast);
}

.dark-theme .theme-toggle::after {
    transform: translateX(20px);
    background: var(--color-accent);
}

/* Segmented Toggle Control */
.segmented-toggle {
    display: flex;
    background: rgba(100, 116, 139, 0.1);
    border: 1px solid var(--border-default);
    border-radius: 20px;
    padding: 2px;
    margin-right: var(--space-md);
}

/* Segmented Buttons */
.segmented-btn {
    border: none;
    background: transparent;
    color: var(--text-secondary);
    padding: 4px 10px;
    font-size: 11px;
    font-weight: 700;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: none;
    display: flex;
    align-items: center;
    justify-content: center;
}

.segmented-btn.active {
    background: var(--color-primary);
    color: #ffffff;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.dark-theme .segmented-btn.active {
    background: var(--color-primary);
}

/* Notification Bell */
.notif-bell {
    position: relative;
    cursor: pointer;
    padding: var(--space-sm);
    border-radius: var(--border-radius-sm);
    transition: background var(--transition-fast);
}
.notif-bell:hover { background: var(--bg-input); }

.notif-count {
    position: absolute;
    top: 2px;
    right: 2px;
    background: var(--color-accent);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Notification Panel */
.notif-panel {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: var(--space-sm);
    width: 320px;
    background: var(--bg-surface);
    border: 1px solid var(--border-default);
    border-radius: var(--border-radius-md);
    box-shadow: var(--shadow-lg);
    display: none;
    flex-direction: column;
    z-index: 1000;
    max-height: 400px;
    overflow-y: auto;
}

.notif-panel.open {
    display: flex;
}

.notif-item {
    padding: var(--space-md);
    border-bottom: 1px solid var(--border-default);
    cursor: pointer;
    transition: background var(--transition-fast);
}

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

.notif-item:hover {
    background: var(--bg-input);
}

.notif-item.unread {
    background: rgba(0, 102, 255, 0.05);
}

.dark-theme .notif-item.unread {
    background: rgba(0, 212, 255, 0.05);
}

.notif-title {
    font-size: var(--text-sm);
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--space-xs);
}

.notif-body {
    font-size: var(--text-xs);
    color: var(--text-secondary);
    margin-bottom: var(--space-xs);
}

.notif-time {
    font-size: 10px;
    color: var(--text-muted);
}

/* User Menu */
.user-menu {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    cursor: pointer;
    padding: var(--space-xs) var(--space-md);
    border-radius: var(--border-radius-md);
    transition: background var(--transition-fast);
}
.user-menu:hover { background: var(--bg-input); }

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--color-primary), var(--color-accent));
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 600;
    font-size: var(--text-sm);
}

.user-info {
    display: flex;
    flex-direction: column;
}
.user-name {
    font-size: var(--text-sm);
    font-weight: 500;
    color: var(--text-primary);
}
.user-role {
    font-size: var(--text-xs);
    color: var(--text-muted);
}

/* Content Area */
.content-area {
    padding: var(--space-xl);
    flex: 1;
}

/* ══════════════════════════════════════════════
   Components
   ══════════════════════════════════════════════ */

/* Cards */
.card {
    background: var(--bg-surface);
    border: 1px solid var(--border-default);
    border-radius: var(--border-radius-lg);
    padding: var(--space-lg);
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-base);
}
.card:hover {
    box-shadow: var(--shadow-md);
}

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

.card-title {
    font-size: var(--text-lg);
    font-weight: 600;
}

/* Metric Cards */
.metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: var(--space-lg);
    margin-bottom: var(--space-xl);
}

.metric-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-default);
    border-radius: var(--border-radius-lg);
    padding: var(--space-lg);
    display: flex;
    align-items: flex-start;
    gap: var(--space-md);
    transition: all var(--transition-base);
}
.metric-card:hover {
    box-shadow: var(--shadow-glow);
    transform: translateY(-2px);
}

.metric-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--border-radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.metric-icon.purple { background: rgba(83,52,131,0.12); color: var(--color-primary); }
.metric-icon.red    { background: rgba(233,69,96,0.12); color: var(--color-accent); }
.metric-icon.blue   { background: rgba(59,130,246,0.12); color: var(--color-info); }
.metric-icon.green  { background: rgba(16,185,129,0.12); color: var(--color-success); }

.metric-value {
    font-size: var(--text-3xl);
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.2;
}

.metric-label {
    font-size: var(--text-sm);
    color: var(--text-secondary);
    margin-top: var(--space-xs);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: var(--space-sm);
    padding: 10px 20px;
    font-family: var(--font-sans);
    font-size: var(--text-sm);
    font-weight: 500;
    border: none;
    border-radius: var(--border-radius-md);
    cursor: pointer;
    transition: all var(--transition-fast);
    text-decoration: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--color-primary), var(--color-primary-dark));
    color: #fff;
    box-shadow: 0 2px 8px rgba(83,52,131,0.3);
}
.btn-primary:hover {
    background: linear-gradient(135deg, var(--color-primary-light), var(--color-primary));
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(83,52,131,0.4);
    color: #fff;
}

.btn-accent {
    background: linear-gradient(135deg, var(--color-accent), #c73550);
    color: #fff;
}
.btn-accent:hover {
    background: linear-gradient(135deg, var(--color-accent-light), var(--color-accent));
    transform: translateY(-1px);
    color: #fff;
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--border-default);
    color: var(--text-primary);
}
.btn-outline:hover {
    border-color: var(--color-primary);
    color: var(--color-primary);
    background: rgba(83,52,131,0.05);
}

.btn-sm { padding: 6px 14px; font-size: var(--text-xs); }
.btn-lg { padding: 14px 28px; font-size: var(--text-base); }

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

.form-label {
    display: block;
    font-size: var(--text-sm);
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: var(--space-sm);
}

.form-input {
    width: 100%;
    padding: 10px 14px;
    font-family: var(--font-sans);
    font-size: var(--text-sm);
    color: var(--text-primary);
    background: var(--bg-input);
    border: 1px solid var(--border-default);
    border-radius: var(--border-radius-md);
    outline: none;
    transition: all var(--transition-fast);
}
.form-input:focus {
    border-color: var(--border-focus);
    background: var(--bg-input-focus);
    box-shadow: 0 0 0 3px rgba(83,52,131,0.12);
}

select.form-input {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='%236b7280'%3E%3Cpath d='M1 1l5 5 5-5'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 36px;
}

/* Tables */
.table-container {
    overflow-x: auto;
    border-radius: var(--border-radius-lg);
    border: 1px solid var(--border-default);
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: var(--text-sm);
}

.data-table th {
    background: var(--bg-input);
    color: var(--text-secondary);
    font-weight: 600;
    font-size: var(--text-xs);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid var(--border-default);
}

.data-table td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-default);
    color: var(--text-primary);
    transition: background var(--transition-fast);
}

.data-table tr:hover td {
    background: rgba(83,52,131,0.03);
}

.data-table tr:last-child td {
    border-bottom: none;
}

/* Status Badges */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    font-size: 11px;
    font-weight: 600;
    border-radius: var(--border-radius-full);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}
.badge-success  { background: var(--color-success-bg); color: var(--color-success); }
.badge-warning  { background: var(--color-warning-bg); color: var(--color-warning); }
.badge-error    { background: var(--color-error-bg); color: var(--color-error); }
.badge-info     { background: var(--color-info-bg); color: var(--color-info); }
.badge-neutral  { background: var(--bg-input); color: var(--text-secondary); }

/* Progress Bar */
.progress-bar {
    width: 100%;
    height: 8px;
    background: var(--bg-input);
    border-radius: var(--border-radius-full);
    overflow: hidden;
}
.progress-fill {
    height: 100%;
    border-radius: var(--border-radius-full);
    background: linear-gradient(90deg, var(--color-primary), var(--color-accent));
    transition: width var(--transition-slow);
}

/* Pagination */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    margin-top: var(--space-xl);
}

.pagination a, .pagination span {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: var(--border-radius-sm);
    font-size: var(--text-sm);
    font-weight: 500;
    color: var(--text-secondary);
    transition: all var(--transition-fast);
}
.pagination a:hover {
    background: var(--bg-input);
    color: var(--color-primary);
}
.pagination .current {
    background: var(--color-primary);
    color: #fff;
}

/* Alerts / Messages */
.alert {
    padding: var(--space-md) var(--space-lg);
    border-radius: var(--border-radius-md);
    font-size: var(--text-sm);
    margin-bottom: var(--space-lg);
    display: flex;
    align-items: center;
    gap: var(--space-md);
    animation: slideIn var(--transition-base) ease-out;
}
.alert-success { background: var(--color-success-bg); color: var(--color-success); border-left: 4px solid var(--color-success); }
.alert-error   { background: var(--color-error-bg); color: var(--color-error); border-left: 4px solid var(--color-error); }
.alert-warning { background: var(--color-warning-bg); color: var(--color-warning); border-left: 4px solid var(--color-warning); }
.alert-info    { background: var(--color-info-bg); color: var(--color-info); border-left: 4px solid var(--color-info); }

/* Empty States */
.empty-state {
    text-align: center;
    padding: var(--space-2xl);
    color: var(--text-muted);
}
.empty-state-icon {
    font-size: 48px;
    margin-bottom: var(--space-md);
    opacity: 0.3;
}

/* ══════════════════════════════════════════════
   Animations
   ══════════════════════════════════════════════ */
@keyframes slideIn {
    from { opacity: 0; transform: translateY(-8px); }
    to   { opacity: 1; transform: translateY(0); }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50%      { opacity: 0.5; }
}

.animate-fade-in { animation: fadeIn var(--transition-base) ease-out; }
.animate-pulse   { animation: pulse 2s infinite; }

/* ══════════════════════════════════════════════
   Responsive
   ══════════════════════════════════════════════ */
body.sidebar-collapsed .sidebar { width: var(--sidebar-collapsed); }
body.sidebar-collapsed .sidebar .brand-text,
body.sidebar-collapsed .sidebar .brand-sub,
body.sidebar-collapsed .sidebar .nav-section-title,
body.sidebar-collapsed .sidebar .nav-link span,
body.sidebar-collapsed .sidebar .nav-badge,
body.sidebar-collapsed .sidebar .logo-light,
body.sidebar-collapsed .sidebar .logo-dark { display: none !important; }

@media (max-width: 1024px) {
    .sidebar { width: var(--sidebar-collapsed); }
    .sidebar .brand-text,
    .sidebar .brand-sub,
    .sidebar .nav-section-title,
    .sidebar .nav-link span,
    .sidebar .nav-badge,
    .sidebar .logo-light,
    .sidebar .logo-dark { display: none !important; }
    
    .sidebar .logo-icon { display: block !important; margin: 0 auto; max-height: 32px !important; }
    
    .main-content { margin-left: var(--sidebar-collapsed); }
    .nav-link { justify-content: center; padding: var(--space-md); }
}

/* Because CSS doesn't allow @media grouping with classes like above in standard CSS without nesting (which might not be supported if not using PostCSS/Sass), I'll write it explicitly: */
body.sidebar-collapsed .sidebar { width: var(--sidebar-collapsed); }
body.sidebar-collapsed .sidebar .brand-text,
body.sidebar-collapsed .sidebar .brand-sub,
body.sidebar-collapsed .sidebar .nav-section-title,
body.sidebar-collapsed .sidebar .nav-link span,
body.sidebar-collapsed .sidebar .nav-badge,
body.sidebar-collapsed .sidebar .logo-light,
body.sidebar-collapsed .sidebar .logo-dark { display: none !important; }

body.sidebar-collapsed .sidebar .logo-icon { display: block !important; margin: 0 auto; max-height: 32px !important; }
body.sidebar-collapsed .main-content { margin-left: var(--sidebar-collapsed); }
body.sidebar-collapsed .nav-link { justify-content: center; padding: var(--space-md); }

@media (max-width: 1024px) {
    .sidebar { width: var(--sidebar-collapsed); }
    .sidebar .brand-text,
    .sidebar .brand-sub,
    .sidebar .nav-section-title,
    .sidebar .nav-link span,
    .sidebar .nav-badge,
    .sidebar .logo-light,
    .sidebar .logo-dark { display: none !important; }
    
    .sidebar .logo-icon { display: block !important; margin: 0 auto; max-height: 32px !important; }
    
    .main-content { margin-left: var(--sidebar-collapsed); }
    .nav-link { justify-content: center; padding: var(--space-md); }
}

@media (max-width: 768px) {
    .sidebar { transform: translateX(-100%); width: var(--sidebar-width); }
    .sidebar.open { transform: translateX(0); }
    .main-content { margin-left: 0; }
    .metrics-grid { grid-template-columns: 1fr 1fr; }
    .content-area { padding: var(--space-md); }
}

@media (max-width: 480px) {
    .metrics-grid { grid-template-columns: 1fr; }
}
