/* ===================================
   Signal — Performance Eval
   Precise. Measured. Trustworthy.
   =================================== */

/* ===================================
   CSS Variables & Theme Configuration
   =================================== */
:root {
    /* Core palette — emerald on cool neutral */
    --surface: #ffffff;
    --background: #f4f5f7;
    --primary: #0d1117;
    --primary-light: #1a1f2b;

    --accent: #059669;
    --accent-hover: #047857;
    --accent-subtle: #ecfdf5;
    --accent-text: #065f46;

    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --info: #3b82f6;

    --success-subtle: #f0fdf4;
    --warning-subtle: #fffbeb;
    --danger-subtle: #fef2f2;
    --info-subtle: #eff6ff;

    --text: #0d1117;
    --text-secondary: #4b5563;
    --text-muted: #6b7280;
    --text-placeholder: #9ca3af;

    --border: #e5e7eb;
    --border-light: #f3f4f6;
    --border-focus: #059669;

    --radius: 6px;
    --radius-sm: 3px;
    --radius-lg: 10px;
    --radius-full: 999px;

    --shadow-xs: 0 1px 2px rgba(0,0,0,0.04);
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.06);
    --shadow: 0 1px 4px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
    --shadow-lg: 0 8px 25px rgba(0,0,0,0.08), 0 2px 6px rgba(0,0,0,0.04);
    --shadow-xl: 0 16px 40px rgba(0,0,0,0.1);

    --navbar-height: 56px;
    --sidebar-width: 220px;

    /* Typography */
    --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, Roboto, Helvetica, Arial, sans-serif;
    --font-mono: "SF Mono", "Fira Code", "Fira Mono", "Roboto Mono", Consolas, monospace;

    /* Transitions */
    --ease: cubic-bezier(0.25, 0.1, 0.25, 1);
    --ease-out: cubic-bezier(0, 0, 0.2, 1);
    --duration-fast: 150ms;
    --duration: 200ms;
    --duration-slow: 300ms;
}

[data-theme="dark"] {
    --surface: #161b22;
    --background: #0d1117;
    --primary: #f0f2f5;
    --primary-light: #e4e7eb;
    --accent: #34d399;
    --accent-hover: #6ee7b7;
    --accent-subtle: rgba(52, 211, 153, 0.12);
    --accent-text: #6ee7b7;

    --text: #e4e7eb;
    --text-secondary: #b0b7c3;
    --text-muted: #8b949e;
    --text-placeholder: #6b7280;

    --border: #30363d;
    --border-light: #21262d;
    --border-focus: #34d399;

    --shadow-xs: 0 1px 2px rgba(0,0,0,0.2);
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.25);
    --shadow: 0 1px 4px rgba(0,0,0,0.3), 0 1px 2px rgba(0,0,0,0.2);
    --shadow-lg: 0 8px 25px rgba(0,0,0,0.35), 0 2px 6px rgba(0,0,0,0.2);
    --shadow-xl: 0 16px 40px rgba(0,0,0,0.4);

    --success-subtle: rgba(16, 185, 129, 0.12);
    --warning-subtle: rgba(245, 158, 11, 0.12);
    --danger-subtle: rgba(239, 68, 68, 0.12);
    --info-subtle: rgba(59, 130, 246, 0.12);
}

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

html {
    -webkit-text-size-adjust: 100%;
    -moz-text-size-adjust: 100%;
}

body {
    font-family: var(--font-sans);
    font-size: 14px;
    line-height: 1.6;
    color: var(--text);
    background: var(--background);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    transition: background var(--duration-slow) var(--ease), color var(--duration-slow) var(--ease);
}

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

button {
    border: none;
    background: none;
    cursor: pointer;
    font: inherit;
    color: inherit;
}

ul { list-style: none; }
code, pre { font-family: var(--font-mono); }
img { max-width: 100%; display: block; }

/* ===================================
   Typography
   =================================== */
h1 {
    font-size: 24px;
    font-weight: 650;
    letter-spacing: -0.02em;
    line-height: 1.25;
    color: var(--primary);
    margin-bottom: 4px;
}

h2 {
    font-size: 18px;
    font-weight: 600;
    letter-spacing: -0.01em;
    line-height: 1.3;
    color: var(--primary);
    margin-bottom: 6px;
}

h3 {
    font-size: 15px;
    font-weight: 600;
    line-height: 1.35;
    color: var(--primary);
    margin-bottom: 4px;
}

p {
    color: var(--text-secondary);
    margin-bottom: 12px;
    line-height: 1.6;
}

small, .text-small {
    font-size: 12px;
    line-height: 1.5;
}

/* ===================================
   Container
   =================================== */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 24px;
}

/* ===================================
   Animation
   =================================== */
@keyframes fadeSlideIn {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: translateY(0); }
}

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

main > * {
    animation: fadeSlideIn 0.25s var(--ease-out);
}

/* ===================================
   Navigation Bar
   =================================== */
.navbar {
    position: fixed;
    top: 0; left: 0; right: 0;
    height: var(--navbar-height);
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    z-index: 1000;
    transition: background var(--duration-slow) var(--ease),
                border-color var(--duration-slow) var(--ease);
}

.navbar-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
    padding: 0 20px;
    max-width: 100%;
}

.navbar-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.navbar-brand {
    display: flex;
    align-items: center;
    gap: 10px;
}

.navbar-brand a {
    font-size: 15px;
    font-weight: 650;
    color: var(--primary);
    letter-spacing: -0.01em;
}

.navbar-brand a:hover { color: var(--accent); }

.navbar-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Logo mark */
.logo-icon {
    width: 30px;
    height: 30px;
    background: var(--accent);
    color: #fff;
    font-weight: 650;
    font-size: 13px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    flex-shrink: 0;
}

[data-theme="dark"] .logo-icon {
    color: var(--background);
}

/* Theme Toggle */
.theme-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: var(--radius);
    background: transparent;
    color: var(--text-muted);
    font-size: 15px;
    transition: background var(--duration-fast) var(--ease),
                color var(--duration-fast) var(--ease);
}
.theme-toggle:hover {
    background: var(--border-light);
    color: var(--text);
}
.theme-toggle .theme-icon { display: none; line-height: 1; }
[data-theme="dark"] .theme-toggle .moon-icon { display: block; }
[data-theme="dark"] .theme-toggle .sun-icon { display: none; }
.theme-toggle .sun-icon { display: block; }

/* ===================================
   User Dropdown
   =================================== */
.user-dropdown {
    position: relative;
}

.user-avatar {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 3px 10px 3px 3px;
    border-radius: var(--radius-full);
    background: var(--border-light);
    cursor: pointer;
    transition: background var(--duration-fast) var(--ease);
}
.user-avatar:hover { background: var(--border); }

.user-avatar-circle {
    width: 26px;
    height: 26px;
    background: var(--accent);
    color: #fff;
    border-radius: 50%;
    font-weight: 600;
    font-size: 11px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

[data-theme="dark"] .user-avatar-circle {
    color: var(--background);
}

.user-avatar-name {
    font-size: 13px;
    font-weight: 500;
    color: var(--text);
}

.user-dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 6px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    min-width: 180px;
    overflow: hidden;
    z-index: 1001;
}

.user-dropdown.active .user-dropdown-menu { display: block; animation: fadeIn 0.12s var(--ease-out); }

.user-dropdown-item {
    display: block;
    padding: 9px 14px;
    color: var(--text);
    font-size: 13px;
    transition: background var(--duration-fast) var(--ease);
}
.user-dropdown-item:hover { background: var(--border-light); color: var(--text); }

.user-dropdown-divider { border-top: 1px solid var(--border); margin: 4px 0; }

.role-badge {
    background: var(--accent-subtle);
    color: var(--accent-text);
    padding: 2px 7px;
    border-radius: var(--radius-full);
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    white-space: nowrap;
}

/* ===================================
   Sidebar
   =================================== */
.sidebar {
    position: fixed;
    top: var(--navbar-height);
    left: 0;
    width: var(--sidebar-width);
    height: calc(100vh - var(--navbar-height));
    background: var(--surface);
    border-right: 1px solid var(--border);
    overflow-y: auto;
    z-index: 100;
    transition: background var(--duration-slow) var(--ease),
                border-color var(--duration-slow) var(--ease);
}

.sidebar-links { padding: 12px 0; }

.sidebar-group-label {
    display: block;
    padding: 16px 16px 6px;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 16px;
    margin: 1px 8px;
    border-radius: var(--radius);
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 450;
    transition: background var(--duration-fast) var(--ease),
                color var(--duration-fast) var(--ease);
    text-decoration: none;
    position: relative;
}

.sidebar-link:hover {
    background: var(--border-light);
    color: var(--text);
}

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

.sidebar-link.active::before {
    content: '';
    position: absolute;
    left: -8px;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 18px;
    background: var(--accent);
    border-radius: 0 2px 2px 0;
}

.sidebar-icon {
    font-size: 16px;
    flex-shrink: 0;
    line-height: 1;
    width: 20px;
    text-align: center;
}

.sidebar-text { font-size: 13px; }

/* ===================================
   Main Content Area
   =================================== */
.main-content {
    margin-left: var(--sidebar-width);
    margin-top: var(--navbar-height);
    min-height: calc(100vh - var(--navbar-height));
    padding: 28px 0;
    transition: margin-left var(--duration-slow) var(--ease);
}

.content-wrapper {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 24px;
}

/* ===================================
   Page Header
   =================================== */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 24px;
    gap: 16px;
}

.page-header-content h1 { margin: 0; }
.page-header-content p {
    margin: 2px 0 0;
    font-size: 14px;
    color: var(--text-muted);
}

/* ===================================
   Buttons
   =================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: var(--radius);
    font-size: 13px;
    font-weight: 500;
    line-height: 1;
    text-decoration: none;
    cursor: pointer;
    transition: background var(--duration-fast) var(--ease),
                color var(--duration-fast) var(--ease),
                border-color var(--duration-fast) var(--ease),
                box-shadow var(--duration-fast) var(--ease);
    border: 1px solid transparent;
}

.btn-primary {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
}
.btn-primary:hover {
    background: var(--accent-hover);
    border-color: var(--accent-hover);
    color: #fff;
}

.btn-secondary {
    background: transparent;
    color: var(--text-secondary);
    border-color: var(--border);
}
.btn-secondary:hover {
    background: var(--border-light);
    color: var(--text);
    border-color: var(--border);
}

.btn-danger {
    background: var(--danger);
    color: #fff;
    border-color: var(--danger);
}
.btn-danger:hover {
    background: #dc2626;
    border-color: #dc2626;
    color: #fff;
}

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
    border-color: transparent;
}
.btn-ghost:hover {
    background: var(--border-light);
    color: var(--text);
}

.btn-sm { padding: 5px 10px; font-size: 12px; }
.btn-block { display: flex; width: 100%; }

/* ===================================
   Form Controls
   =================================== */
.form-group { margin-bottom: 18px; }

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    letter-spacing: 0.01em;
}

.form-control {
    width: 100%;
    padding: 9px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 14px;
    font-family: inherit;
    background: var(--surface);
    color: var(--text);
    transition: border-color var(--duration-fast) var(--ease),
                box-shadow var(--duration-fast) var(--ease);
}

.form-control:focus {
    outline: none;
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px var(--accent-subtle);
}

.form-control::placeholder { color: var(--text-placeholder); }

select.form-control {
    appearance: auto;
    padding-right: 28px;
}

.form-error {
    color: var(--danger);
    font-size: 12px;
    margin-top: 4px;
}

.form-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.form-group input[type="checkbox"] {
    margin-right: 6px;
    accent-color: var(--accent);
}

/* ===================================
   Cards
   =================================== */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    transition: background var(--duration-slow) var(--ease),
                border-color var(--duration-slow) var(--ease);
}

.card + .card { margin-top: 12px; }

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

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

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

table.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

table.data-table thead { background: var(--border-light); }

table.data-table th {
    padding: 10px 14px;
    text-align: left;
    font-weight: 600;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}

table.data-table td {
    padding: 10px 14px;
    border-bottom: 1px solid var(--border-light);
    color: var(--text);
}

table.data-table tbody tr:hover { background: var(--border-light); }
table.data-table tbody tr:last-child td { border-bottom: none; }

/* ===================================
   Badges
   =================================== */
.badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: var(--radius-full);
    font-size: 11px;
    font-weight: 600;
    line-height: 1.4;
}

.badge-admin { background: var(--info-subtle); color: #1e40af; }
.badge-user { background: var(--border-light); color: var(--text-secondary); }

.badge-success,
.badge-active,
.badge-approved { background: var(--success-subtle); color: #065f46; }

.badge-danger,
.badge-inactive,
.badge-declined { background: var(--danger-subtle); color: #991b1b; }

.badge-pending { background: var(--warning-subtle); color: #92400e; }
.badge-released { background: var(--info-subtle); color: #1e40af; }

[data-theme="dark"] .badge-admin { color: #93c5fd; }
[data-theme="dark"] .badge-success,
[data-theme="dark"] .badge-active,
[data-theme="dark"] .badge-approved { color: #6ee7b7; }
[data-theme="dark"] .badge-danger,
[data-theme="dark"] .badge-inactive,
[data-theme="dark"] .badge-declined { color: #fca5a5; }
[data-theme="dark"] .badge-pending { color: #fcd34d; }
[data-theme="dark"] .badge-released { color: #93c5fd; }

/* ===================================
   Alerts
   =================================== */
.alert {
    padding: 12px 16px;
    border-radius: var(--radius);
    border-left: 3px solid;
    margin-bottom: 16px;
    font-size: 13px;
    line-height: 1.5;
}

.alert-success { background: var(--success-subtle); border-color: var(--success); color: var(--text); }
.alert-danger { background: var(--danger-subtle); border-color: var(--danger); color: var(--text); }
.alert-warning { background: var(--warning-subtle); border-color: var(--warning); color: var(--text); }
.alert-info { background: var(--info-subtle); border-color: var(--info); color: var(--text); }

/* ===================================
   Flash Messages
   =================================== */
.flash-messages {
    position: fixed;
    top: calc(var(--navbar-height) + 8px);
    right: 16px;
    z-index: 10000;
    max-width: 340px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.flash-message {
    padding: 10px 14px;
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    font-size: 13px;
    border-left: 3px solid transparent;
    animation: slideIn 0.25s var(--ease-out);
}

.flash-message.success {
    background: var(--success-subtle);
    border-color: var(--success);
    color: var(--text);
}
.flash-message.danger {
    background: var(--danger-subtle);
    border-color: var(--danger);
    color: var(--text);
}
.flash-message.info {
    background: var(--info-subtle);
    border-color: var(--info);
    color: var(--text);
}
.flash-message.warning {
    background: var(--warning-subtle);
    border-color: var(--warning);
    color: var(--text);
}

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

/* ===================================
   Stats Grid
   =================================== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
    margin-bottom: 24px;
}

.stat-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    transition: border-color var(--duration-fast) var(--ease),
                box-shadow var(--duration-fast) var(--ease);
}

.stat-card:hover {
    border-color: var(--border-focus);
    box-shadow: var(--shadow-sm);
}

.stat-value {
    font-size: 32px;
    font-weight: 650;
    letter-spacing: -0.03em;
    line-height: 1.1;
    color: var(--primary);
}

.stat-label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    margin-top: 4px;
}

/* ===================================
   Empty State
   =================================== */
.empty-state {
    text-align: center;
    padding: 48px 24px;
    color: var(--text-muted);
}
.empty-state p { font-size: 14px; margin: 0; }
.empty-state a { font-weight: 500; }

/* ===================================
   Pagination
   =================================== */
.pagination {
    display: flex;
    gap: 4px;
    align-items: center;
    justify-content: center;
    margin-top: 20px;
}

.pagination a,
.pagination span {
    padding: 6px 11px;
    border-radius: var(--radius);
    font-size: 13px;
    color: var(--text-secondary);
    transition: background var(--duration-fast) var(--ease),
                color var(--duration-fast) var(--ease);
}

.pagination a:hover {
    background: var(--border-light);
    color: var(--text);
}

.pagination .active {
    background: var(--accent);
    color: #fff;
}

[data-theme="dark"] .pagination .active { color: var(--background); }

/* ===================================
   Mobile Sidebar
   =================================== */
.mobile-sidebar {
    display: none;
    position: fixed;
    left: 0; top: 0;
    width: 280px;
    height: 100vh;
    background: var(--surface);
    transform: translateX(-100%);
    transition: transform var(--duration-slow) var(--ease);
    z-index: 1001;
    padding-top: var(--navbar-height);
    box-shadow: var(--shadow-xl);
    overflow-y: auto;
}

.mobile-sidebar.active { transform: translateX(0); }

.mobile-sidebar .sidebar {
    display: block;
    position: static;
    width: 100%;
    height: auto;
    border-right: none;
    overflow-y: visible;
}

.mobile-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    opacity: 0;
    visibility: hidden;
    transition: opacity var(--duration-slow) var(--ease),
                visibility var(--duration-slow) var(--ease);
    z-index: 1000;
}

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

.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    gap: 4px;
    padding: 6px;
    cursor: pointer;
}

.mobile-menu-toggle span {
    display: block;
    width: 20px;
    height: 2px;
    background: var(--text);
    border-radius: 1px;
    transition: transform 0.25s var(--ease), opacity 0.2s var(--ease);
}

.mobile-menu-toggle.active span:nth-child(1) { transform: rotate(45deg) translate(4px, 4px); }
.mobile-menu-toggle.active span:nth-child(2) { opacity: 0; }
.mobile-menu-toggle.active span:nth-child(3) { transform: rotate(-45deg) translate(4px, -4px); }

/* ===================================
   Login Page
   =================================== */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: var(--background);
}

.login-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 36px;
    width: 100%;
    max-width: 380px;
    box-shadow: var(--shadow-lg);
}

.login-header {
    text-align: center;
    margin-bottom: 28px;
}

.login-logo {
    width: 52px;
    height: 52px;
    background: var(--accent);
    color: #fff;
    border-radius: var(--radius);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    font-weight: 650;
    margin-bottom: 14px;
}

[data-theme="dark"] .login-logo { color: var(--background); }

.login-title {
    font-size: 20px;
    font-weight: 650;
    color: var(--text);
    margin-bottom: 4px;
    letter-spacing: -0.01em;
}

.login-subtitle {
    font-size: 13px;
    color: var(--text-muted);
}

/* ===================================
   Utilities
   =================================== */
.hidden { display: none !important; }
.no-scroll { overflow: hidden !important; }

.text-center { text-align: center; }
.text-muted { color: var(--text-muted); }
.text-small { font-size: 12px; }

.mt-4 { margin-top: 16px; }
.mb-4 { margin-bottom: 16px; }
.mr-2 { margin-right: 8px; }
.ml-2 { margin-left: 8px; }

.gap-2 { gap: 8px; }
.gap-4 { gap: 16px; }

.flex { display: flex; }
.flex-wrap { flex-wrap: wrap; }
.flex-between { justify-content: space-between; }
.items-center { align-items: center; }

/* ===================================
   Responsive — Mobile (< 768px)
   =================================== */
@media (max-width: 767px) {
    .navbar-container { padding: 0 16px; }
    .navbar-right .user-avatar-name { display: none; }

    .sidebar { display: none; }

    .mobile-menu-toggle { display: flex; }
    .mobile-sidebar { display: block; }
    .mobile-overlay { display: block; }

    .main-content {
        margin-left: 0;
        padding: 20px 0;
    }

    .content-wrapper { padding: 0 16px; }

    h1 { font-size: 20px; }
    h2 { font-size: 16px; }

    .page-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .stats-grid {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }

    .stat-value { font-size: 26px; }

    .card { padding: 16px; }

    table.data-table {
        display: block;
        overflow-x: auto;
    }

    .login-card { padding: 24px; }
}

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

/* ===================================
   Responsive — Tablet (768px–1024px)
   =================================== */
@media (min-width: 768px) and (max-width: 1024px) {
    .sidebar { width: 180px; }
    .main-content { margin-left: 180px; }
    .sidebar-link { padding: 7px 12px; margin: 1px 6px; }
    .sidebar-link.active::before { left: -6px; }
    .sidebar-group-label { padding: 14px 12px 5px; }
}
