/**
 * Coyote Conference Call — Blue Design System
 * Clean, precision-built admin interface
 * Blue · Gray · White  |  Fully Responsive
 */

/* ============================================================================
   GOOGLE FONTS
   ============================================================================ */
@import url('https://fonts.googleapis.com/css2?family=Figtree:wght@400;500;600;700;800&family=IBM+Plex+Mono:wght@400;600&display=swap');

/* ============================================================================
   1. DESIGN TOKENS
   ============================================================================ */

:root {
    /* --- Blue Palette --- */
    --blue-950:  #0a1628;
    --blue-900:  #0f2040;
    --blue-800:  #1a3a6b;
    --blue-700:  #1d4ed8;
    --blue-600:  #2563eb;
    --blue-500:  #3b82f6;
    --blue-400:  #60a5fa;
    --blue-300:  #93c5fd;
    --blue-200:  #bfdbfe;
    --blue-100:  #dbeafe;
    --blue-50:   #eff6ff;

    /* --- Gray Palette --- */
    --gray-950:  #0a0f1a;
    --gray-900:  #111827;
    --gray-800:  #1f2937;
    --gray-700:  #374151;
    --gray-600:  #4b5563;
    --gray-500:  #6b7280;
    --gray-400:  #9ca3af;
    --gray-300:  #d1d5db;
    --gray-200:  #e5e7eb;
    --gray-100:  #f3f4f6;
    --gray-50:   #f9fafb;

    /* --- Semantic Colors --- */
    --color-primary:        var(--blue-600);
    --color-primary-light:  var(--blue-500);
    --color-primary-lighter: var(--blue-400);
    --color-primary-dark:   var(--blue-700);
    --color-primary-darker: var(--blue-800);
    --color-primary-rgb:    37, 99, 235;

    --color-accent:         #f59e0b;
    --color-accent-light:   #fbbf24;
    --color-accent-dark:    #d97706;

    --color-success:        #10b981;
    --color-success-light:  #34d399;
    --color-warning:        #f97316;
    --color-danger:         #ef4444;
    --color-info:           var(--blue-500);

    /* --- Gray Aliases (for compatibility) --- */
    --color-gray-50:    var(--gray-50);
    --color-gray-100:   var(--gray-100);
    --color-gray-200:   var(--gray-200);
    --color-gray-300:   var(--gray-300);
    --color-gray-400:   var(--gray-400);
    --color-gray-500:   var(--gray-500);
    --color-gray-600:   var(--gray-600);
    --color-gray-700:   var(--gray-700);
    --color-gray-800:   var(--gray-800);
    --color-gray-900:   var(--gray-900);

    /* --- Neutral aliases --- */
    --color-neutral-500: var(--gray-500);

    /* --- Surfaces --- */
    --surface-primary:          #ffffff;
    --surface-secondary:        var(--gray-50);
    --surface-tertiary:         var(--gray-100);
    --surface-overlay:          rgba(10, 22, 40, 0.6);
    --surface-overlay-strong:   rgba(10, 22, 40, 0.85);
    --surface-glass:            rgba(255, 255, 255, 0.7);

    /* Dark surface aliases (kept for inline style compatibility) */
    --surface-dark-primary:     var(--surface-primary);
    --surface-dark-secondary:   var(--surface-primary);
    --surface-dark-tertiary:    var(--surface-tertiary);
    --surface-dark-glass:       var(--surface-glass);

    /* --- Sidebar --- */
    --sidebar-bg:               var(--blue-900);
    --sidebar-hover-bg:         var(--blue-800);
    --sidebar-active-bg:        var(--blue-600);
    --sidebar-text:             var(--blue-200);
    --sidebar-text-muted:       var(--blue-300);
    --sidebar-border:           rgba(255, 255, 255, 0.08);

    /* --- Typography --- */
    --font-display:  'Figtree', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-body:     'Figtree', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-mono:     'IBM Plex Mono', 'Roboto Mono', 'SF Mono', 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;
    --text-4xl:     2.25rem;
    --text-5xl:     3rem;

    --line-height-tight:    1.2;
    --line-height-normal:   1.5;
    --line-height-relaxed:  1.75;

    /* --- Spacing --- */
    --space-0:  0;
    --space-1:  0.25rem;
    --space-2:  0.5rem;
    --space-3:  0.75rem;
    --space-4:  1rem;
    --space-5:  1.25rem;
    --space-6:  1.5rem;
    --space-7:  1.75rem;
    --space-8:  2rem;
    --space-10: 2.5rem;
    --space-12: 3rem;
    --space-16: 4rem;
    --space-20: 5rem;
    --space-24: 6rem;

    /* --- Shadows --- */
    --shadow-xs:    0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-sm:    0 1px 3px rgba(0, 0, 0, 0.08), 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-base:  0 4px 6px rgba(0, 0, 0, 0.07), 0 2px 4px rgba(0, 0, 0, 0.05);
    --shadow-md:    0 8px 16px rgba(0, 0, 0, 0.08), 0 4px 6px rgba(0, 0, 0, 0.05);
    --shadow-lg:    0 16px 32px rgba(0, 0, 0, 0.1), 0 8px 12px rgba(0, 0, 0, 0.06);
    --shadow-xl:    0 24px 48px rgba(0, 0, 0, 0.12);
    --shadow-2xl:   0 32px 64px rgba(0, 0, 0, 0.15);
    --shadow-inner: inset 0 2px 4px rgba(0, 0, 0, 0.05);
    --shadow-glass: 0 8px 32px rgba(0, 0, 0, 0.06);
    --shadow-glass-hover: 0 12px 48px rgba(0, 0, 0, 0.1);

    /* Blue-tinted focus shadow */
    --shadow-focus: 0 0 0 3px rgba(37, 99, 235, 0.18);

    /* --- Borders & Radius --- */
    --radius-none:  0;
    --radius-xs:    0.25rem;
    --radius-sm:    0.375rem;
    --radius-base:  0.5rem;
    --radius-md:    0.625rem;
    --radius-lg:    0.875rem;
    --radius-xl:    1.25rem;
    --radius-2xl:   1.75rem;
    --radius-full:  9999px;

    --border-thin:    1px;
    --border-default: 2px;
    --border-thick:   3px;

    /* --- Transitions --- */
    --duration-fast:        150ms;
    --duration-base:        250ms;
    --duration-slow:        400ms;
    --easing-ease-in:       cubic-bezier(0.4, 0, 1, 1);
    --easing-ease-out:      cubic-bezier(0, 0, 0.2, 1);
    --easing-ease-in-out:   cubic-bezier(0.4, 0, 0.2, 1);
    --easing-bounce:        cubic-bezier(0.34, 1.56, 0.64, 1);

    /* --- Z-Index --- */
    --z-dropdown:  1000;
    --z-sticky:    1020;
    --z-fixed:     1030;
    --z-modal:     1050;
    --z-tooltip:   1070;

    /* --- Layout --- */
    --sidebar-width:            260px;
    --sidebar-width-collapsed:  72px;
    --header-height:            60px;
    --mobile-nav-height:        68px;
    --content-max-width:        1440px;
}

/* ============================================================================
   2. RESET & BASE
   ============================================================================ */

*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--font-body);
    font-size: var(--text-base);
    line-height: var(--line-height-normal);
    color: var(--gray-800);
    background-color: var(--surface-secondary);
    min-height: 100vh;
}

img, video, canvas, svg {
    max-width: 100%;
    display: block;
}

/* ============================================================================
   3. TYPOGRAPHY
   ============================================================================ */

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-display);
    font-weight: 700;
    line-height: var(--line-height-tight);
    color: var(--gray-900);
    margin-bottom: var(--space-4);
}

h1 { font-size: var(--text-4xl); }
h2 { font-size: var(--text-3xl); }
h3 { font-size: var(--text-2xl); font-weight: 600; color: var(--gray-900) !important; }
h4 { font-size: var(--text-xl); font-weight: 600; }
h5 { font-size: var(--text-lg); font-weight: 600; }
h6 { font-size: var(--text-base); font-weight: 600; }

p {
    margin-bottom: var(--space-4);
    color: var(--gray-600);
    line-height: var(--line-height-relaxed);
}

a {
    color: var(--color-primary);
    text-decoration: none;
    transition: color var(--duration-fast) var(--easing-ease-out);
}

a:hover {
    color: var(--color-primary-dark);
}

strong { font-weight: 700; }
small  { font-size: var(--text-sm); }

/* ============================================================================
   4. LAYOUT — SIDEBAR + MAIN
   ============================================================================ */

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background: var(--sidebar-bg);
    border-right: 1px solid var(--sidebar-border);
    overflow-y: auto;
    overflow-x: hidden;
    padding: var(--space-5) var(--space-4);
    position: fixed;
    left: 0;
    top: 0;
    height: 100vh;
    z-index: var(--z-fixed);
    display: flex;
    flex-direction: column;
}

/* Thin scrollbar inside sidebar */
.sidebar::-webkit-scrollbar { width: 4px; }
.sidebar::-webkit-scrollbar-track { background: transparent; }
.sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.12); border-radius: var(--radius-full); }

/* Brand */
.sidebar-brand {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    font-family: var(--font-display);
    font-size: var(--text-lg);
    font-weight: 800;
    color: #ffffff;
    letter-spacing: -0.02em;
    padding: var(--space-3) var(--space-2);
    margin-bottom: var(--space-6);
    border-bottom: 1px solid var(--sidebar-border);
    padding-bottom: var(--space-5);
}

.sidebar-brand i {
    font-size: var(--text-2xl);
    color: var(--blue-400);
    flex-shrink: 0;
}

/* Nav list */
.sidebar-nav {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: var(--space-1);
    flex: 1;
}

.sidebar-nav li {
    position: relative;
}

.sidebar-nav li.sidebar-divider {
    border-top: 1px solid var(--sidebar-border);
    padding-top: var(--space-3);
    margin-top: var(--space-3);
}

.sidebar-nav a {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-3) var(--space-4);
    border-radius: var(--radius-md);
    color: var(--sidebar-text);
    font-size: var(--text-sm);
    font-weight: 500;
    transition: all var(--duration-fast) var(--easing-ease-out);
    position: relative;
    text-decoration: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-nav a i {
    font-size: 1.1rem;
    flex-shrink: 0;
    width: 1.25rem;
    text-align: center;
    opacity: 0.8;
}

.sidebar-nav a:hover {
    background-color: rgba(255, 255, 255, 0.08);
    color: #ffffff;
    transform: translateX(3px);
}

.sidebar-nav a:hover i {
    opacity: 1;
}

.sidebar-nav a.active {
    background: var(--sidebar-active-bg);
    color: #ffffff;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.4);
}

.sidebar-nav a.active i {
    opacity: 1;
}

.sidebar-nav a.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 25%;
    height: 50%;
    width: 3px;
    background: var(--blue-300);
    border-radius: 0 var(--radius-full) var(--radius-full) 0;
}

.sidebar-spacer {
    flex-grow: 1;
    min-height: var(--space-6);
}

/* ============================================================================
   5. MOBILE NAVIGATION
   ============================================================================ */

.mobile-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--sidebar-bg);
    border-top: 1px solid var(--sidebar-border);
    height: var(--mobile-nav-height);
    z-index: var(--z-sticky);
    box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.15);
}

.mobile-nav-list {
    list-style: none;
    display: flex;
    height: 100%;
    padding: 0;
}

.mobile-nav-item {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mobile-nav-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    padding: var(--space-2) var(--space-3);
    color: var(--blue-300);
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    text-decoration: none;
    transition: all var(--duration-fast) var(--easing-ease-out);
    border-radius: var(--radius-md);
    min-width: 52px;
    text-align: center;
}

.mobile-nav-link:hover {
    color: #ffffff;
    background: rgba(255,255,255,0.08);
}

.mobile-nav-link.active {
    color: var(--blue-300);
}

.mobile-nav-link.active i {
    color: var(--blue-400);
}

.mobile-nav-link i {
    font-size: 1.35rem;
    display: block;
}

/* ============================================================================
   6. MAIN CONTENT WRAPPER
   ============================================================================ */

.main-wrapper {
    margin-left: var(--sidebar-width);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    transition: margin-left var(--duration-base) var(--easing-ease-out);
}

/* Page header bar */
.main-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-4) var(--space-6);
    background: var(--surface-primary);
    border-bottom: 1px solid var(--gray-200);
    min-height: var(--header-height);
    position: sticky;
    top: 0;
    z-index: var(--z-sticky);
    box-shadow: var(--shadow-xs);
}

.page-title {
    font-size: var(--text-2xl);
    font-weight: 800;
    color: var(--gray-900);
    margin: 0;
    letter-spacing: -0.02em;
}

/* Main scrollable content */
.main-content {
    flex: 1;
    padding: var(--space-6);
    overflow-y: auto;
}

/* Footer */
.app-footer {
    padding: var(--space-5) var(--space-6);
    text-align: center;
    color: var(--gray-400);
    border-top: 1px solid var(--gray-200);
    font-size: var(--text-sm);
    background: var(--surface-primary);
}

/* ============================================================================
   7. CARDS
   ============================================================================ */

.card {
    background: var(--surface-primary);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-lg);
    padding: var(--space-6);
    transition: box-shadow var(--duration-base) var(--easing-ease-out),
                transform var(--duration-base) var(--easing-ease-out);
    box-shadow: var(--shadow-sm);
    margin-bottom: var(--space-6);
}

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

.card.glass {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(37, 99, 235, 0.12);
    box-shadow: var(--shadow-glass);
}

.card.glass:hover {
    box-shadow: var(--shadow-glass-hover);
}

/* ============================================================================
   8. STAT CARDS
   ============================================================================ */

.stat-card {
    background: var(--surface-primary);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-lg);
    padding: var(--space-6);
    position: relative;
    overflow: hidden;
    transition: all var(--duration-base) var(--easing-ease-out);
    box-shadow: var(--shadow-sm);
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 120px;
    height: 120px;
    background: radial-gradient(circle at top right, var(--stat-color, var(--color-primary)) 0%, transparent 65%);
    opacity: 0.07;
    pointer-events: none;
}

.stat-card::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    width: 100%;
    background: linear-gradient(90deg, var(--stat-color, var(--color-primary)), transparent);
    opacity: 0.5;
}

.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
    border-color: var(--stat-color, var(--color-primary));
    border-opacity: 0.3;
}

.stat-card-icon {
    font-size: 1.75rem;
    color: var(--stat-color, var(--color-primary));
    margin-bottom: var(--space-4);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.75rem;
    height: 2.75rem;
    background: color-mix(in srgb, var(--stat-color, var(--color-primary)) 10%, transparent);
    border-radius: var(--radius-md);
}

.stat-card-label {
    font-size: var(--text-xs);
    color: var(--gray-500);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: var(--space-2);
    font-weight: 700;
}

.stat-card-value {
    font-size: var(--text-4xl);
    font-weight: 800;
    color: var(--gray-900);
    font-family: var(--font-mono);
    margin-bottom: var(--space-3);
    letter-spacing: -0.03em;
}

.stat-card-change {
    font-size: var(--text-sm);
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: var(--space-1);
    color: var(--gray-500);
}

.stat-card-change.positive { color: var(--color-success); }
.stat-card-change.negative { color: var(--color-danger); }

/* ============================================================================
   9. DATA TABLES
   ============================================================================ */

.table-responsive-wrapper {
    overflow-x: auto;
    border-radius: var(--radius-lg);
    border: 1px solid var(--gray-200);
}

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

.table thead {
    background: var(--blue-50);
    border-bottom: 2px solid var(--blue-200);
}

.table th {
    padding: var(--space-3) var(--space-5);
    text-align: left;
    font-weight: 700;
    color: var(--blue-800);
    font-size: var(--text-xs);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    white-space: nowrap;
}

.table td {
    padding: var(--space-3) var(--space-5);
    border-bottom: 1px solid var(--gray-100);
    color: var(--gray-700);
    vertical-align: middle;
}

.table tbody tr {
    transition: background-color var(--duration-fast) var(--easing-ease-out);
}

.table tbody tr:hover {
    background-color: var(--blue-50);
}

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

/* ============================================================================
   10. BUTTONS
   ============================================================================ */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    padding: var(--space-3) var(--space-5);
    border: none;
    border-radius: var(--radius-md);
    font-family: var(--font-body);
    font-size: var(--text-sm);
    font-weight: 600;
    line-height: 1;
    cursor: pointer;
    transition: all var(--duration-fast) var(--easing-ease-out);
    text-decoration: none;
    white-space: nowrap;
    user-select: none;
    -webkit-user-select: none;
    position: relative;
    overflow: hidden;
}

/* Ripple effect */
.btn::after {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0);
    transition: background var(--duration-fast);
}

.btn:active::after {
    background: rgba(255, 255, 255, 0.15);
}

/* Primary */
.btn-primary {
    background: var(--color-primary);
    color: #ffffff;
    box-shadow: 0 2px 8px rgba(var(--color-primary-rgb), 0.35);
}

.btn-primary:hover {
    background: var(--color-primary-dark);
    color: #ffffff;
    box-shadow: 0 4px 16px rgba(var(--color-primary-rgb), 0.45);
    transform: translateY(-1px);
}

.btn-primary:active {
    transform: translateY(0);
    box-shadow: 0 1px 4px rgba(var(--color-primary-rgb), 0.3);
}

/* Secondary */
.btn-secondary {
    background: var(--surface-primary);
    color: var(--gray-700);
    border: 1px solid var(--gray-300);
    box-shadow: var(--shadow-xs);
}

.btn-secondary:hover {
    background: var(--gray-50);
    color: var(--gray-900);
    border-color: var(--gray-400);
}

/* Outline */
.btn-outline {
    background: transparent;
    color: var(--color-primary);
    border: 1.5px solid var(--color-primary);
}

.btn-outline:hover {
    background: var(--blue-50);
    color: var(--color-primary-dark);
}

/* Danger */
.btn-danger {
    background: var(--color-danger);
    color: #ffffff;
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.3);
}

.btn-danger:hover {
    background: #dc2626;
    color: #ffffff;
    transform: translateY(-1px);
}

/* Sizes */
.btn-sm {
    padding: var(--space-2) var(--space-3);
    font-size: var(--text-xs);
    border-radius: var(--radius-sm);
}

.btn-lg {
    padding: var(--space-4) var(--space-7);
    font-size: var(--text-base);
    border-radius: var(--radius-lg);
}

.btn-block {
    width: 100%;
}

.flex-1 {
    flex: 1;
}

/* ============================================================================
   11. FORMS
   ============================================================================ */

.form-group {
    margin-bottom: var(--space-5);
}

.form-label {
    display: block;
    margin-bottom: var(--space-2);
    font-weight: 600;
    color: var(--gray-700);
    font-size: var(--text-sm);
}

.form-control {
    width: 100%;
    padding: var(--space-3) var(--space-4);
    border: 1.5px solid var(--gray-300);
    border-radius: var(--radius-md);
    font-family: var(--font-body);
    font-size: var(--text-base);
    background: var(--surface-primary);
    color: var(--gray-900);
    transition: border-color var(--duration-fast) var(--easing-ease-out),
                box-shadow var(--duration-fast) var(--easing-ease-out);
    appearance: none;
    -webkit-appearance: none;
}

.form-control:hover {
    border-color: var(--gray-400);
}

.form-control:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: var(--shadow-focus);
}

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

.form-control.error {
    border-color: var(--color-danger);
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.12);
}

.form-text {
    display: block;
    margin-top: var(--space-2);
    font-size: var(--text-sm);
    color: var(--gray-500);
}

.form-text.error {
    color: var(--color-danger);
}

/* Select */
select.form-control {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%236b7280' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 2.5rem;
}

/* ============================================================================
   12. BADGES
   ============================================================================ */

.badge {
    display: inline-flex;
    align-items: center;
    gap: var(--space-1);
    padding: 3px var(--space-3);
    border-radius: var(--radius-full);
    font-size: var(--text-xs);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    white-space: nowrap;
}

.badge-primary {
    background: var(--blue-100);
    color: var(--blue-700);
}

.badge-success {
    background: rgba(16, 185, 129, 0.1);
    color: #059669;
}

.badge-warning {
    background: rgba(249, 115, 22, 0.1);
    color: #c2410c;
}

.badge-danger {
    background: rgba(239, 68, 68, 0.1);
    color: #b91c1c;
}

.badge-info {
    background: var(--blue-100);
    color: var(--blue-700);
}

/* Role badges */
.role-badge {
    padding: 2px var(--space-3);
    border-radius: var(--radius-full);
    font-size: var(--text-xs);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* ============================================================================
   13. ALERTS
   ============================================================================ */

.alert {
    display: flex;
    align-items: flex-start;
    gap: var(--space-3);
    padding: var(--space-4) var(--space-5);
    border-radius: var(--radius-md);
    margin-bottom: var(--space-5);
    font-size: var(--text-sm);
    font-weight: 500;
    border: 1px solid transparent;
}

.alert i {
    font-size: 1.1rem;
    flex-shrink: 0;
    margin-top: 1px;
}

.alert-danger {
    background: rgba(239, 68, 68, 0.06);
    color: #991b1b;
    border-color: rgba(239, 68, 68, 0.2);
}

.alert-success {
    background: rgba(16, 185, 129, 0.06);
    color: #065f46;
    border-color: rgba(16, 185, 129, 0.2);
}

.alert-warning {
    background: rgba(249, 115, 22, 0.06);
    color: #9a3412;
    border-color: rgba(249, 115, 22, 0.2);
}

.alert-info {
    background: var(--blue-50);
    color: var(--blue-800);
    border-color: var(--blue-200);
}

/* ============================================================================
   14. ANIMATIONS
   ============================================================================ */

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

@keyframes slideInLeft {
    from { opacity: 0; transform: translateX(-12px); }
    to   { opacity: 1; transform: translateX(0); }
}

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

@keyframes scaleIn {
    from { opacity: 0; transform: scale(0.96); }
    to   { opacity: 1; transform: scale(1); }
}

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

@keyframes shimmer {
    0%   { background-position: -800px 0; }
    100% { background-position: 800px 0; }
}

.animate-fade-in   { animation: fadeIn var(--duration-base) var(--easing-ease-out) both; }
.animate-slide-left  { animation: slideInLeft var(--duration-base) var(--easing-ease-out) both; }
.animate-slide-right { animation: slideInRight var(--duration-base) var(--easing-ease-out) both; }
.animate-scale-in    { animation: scaleIn var(--duration-base) var(--easing-ease-out) both; }
.animate-pulse       { animation: pulse 2s var(--easing-ease-in-out) infinite; }

/* Staggered children */
.animate-stagger > * {
    animation: fadeIn var(--duration-base) var(--easing-ease-out) both;
}
.animate-stagger > :nth-child(1) { animation-delay: 0ms; }
.animate-stagger > :nth-child(2) { animation-delay: 60ms; }
.animate-stagger > :nth-child(3) { animation-delay: 120ms; }
.animate-stagger > :nth-child(4) { animation-delay: 180ms; }
.animate-stagger > :nth-child(5) { animation-delay: 240ms; }
.animate-stagger > :nth-child(n+6) { animation-delay: 300ms; }

/* ============================================================================
   15. GRID & LAYOUT UTILITIES
   ============================================================================ */

.grid {
    display: grid;
    gap: var(--space-5);
}

.grid-cols-1 { grid-template-columns: 1fr; }
.grid-cols-2 { grid-template-columns: repeat(2, 1fr); }
.grid-cols-3 { grid-template-columns: repeat(3, 1fr); }
.grid-cols-4 { grid-template-columns: repeat(4, 1fr); }

.flex         { display: flex; }
.flex-center  { display: flex; align-items: center; justify-content: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.flex-col     { flex-direction: column; }

.gap-2 { gap: var(--space-2); }
.gap-3 { gap: var(--space-3); }
.gap-4 { gap: var(--space-4); }
.gap-6 { gap: var(--space-6); }
.gap-8 { gap: var(--space-8); }

.p-4  { padding: var(--space-4); }
.p-6  { padding: var(--space-6); }
.p-8  { padding: var(--space-8); }
.mb-2 { margin-bottom: var(--space-2); }
.mb-4 { margin-bottom: var(--space-4); }
.mb-6 { margin-bottom: var(--space-6); }
.mb-8 { margin-bottom: var(--space-8); }
.mt-4 { margin-top: var(--space-4); }
.mt-6 { margin-top: var(--space-6); }

/* ============================================================================
   16. UTILITIES
   ============================================================================ */

.hidden           { display: none !important; }
.visible          { display: block !important; }
.text-center      { text-align: center; }
.text-right       { text-align: right; }
.text-muted       { color: var(--gray-500); }
.text-sm          { font-size: var(--text-sm); }
.text-xs          { font-size: var(--text-xs); }
.font-mono        { font-family: var(--font-mono); }
.font-bold        { font-weight: 700; }
.font-semibold    { font-weight: 600; }
.rounded          { border-radius: var(--radius-lg); }
.rounded-full     { border-radius: var(--radius-full); }
.shadow           { box-shadow: var(--shadow-md); }
.opacity-50       { opacity: 0.5; }
.opacity-75       { opacity: 0.75; }
.cursor-pointer   { cursor: pointer; }
.max-w-full       { max-width: 100%; }
.w-full           { width: 100%; }
.h-auto           { height: auto; }

.desktop-only { display: block !important; }
.mobile-only  { display: none !important; }

/* ============================================================================
   17. SCROLLBAR
   ============================================================================ */

::-webkit-scrollbar {
    width: 7px;
    height: 7px;
}

::-webkit-scrollbar-track {
    background: var(--gray-100);
}

::-webkit-scrollbar-thumb {
    background: var(--gray-300);
    border-radius: var(--radius-full);
}

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

/* ============================================================================
   18. LOGIN PAGE
   ============================================================================ */

.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
    background: linear-gradient(135deg, var(--blue-950) 0%, var(--blue-900) 50%, var(--blue-800) 100%);
    position: relative;
    overflow: hidden;
}

/* Subtle background pattern */
.login-page::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: radial-gradient(circle at 20% 50%, rgba(37, 99, 235, 0.15) 0%, transparent 50%),
                      radial-gradient(circle at 80% 20%, rgba(96, 165, 250, 0.1) 0%, transparent 40%),
                      radial-gradient(circle at 60% 90%, rgba(59, 130, 246, 0.08) 0%, transparent 40%);
    pointer-events: none;
}

.login-card {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 420px;
    background: #ffffff;
    border-radius: var(--radius-xl);
    padding: 2.5rem 2rem;
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.35), 0 4px 16px rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.login-brand {
    text-align: center;
    margin-bottom: var(--space-8);
}

.login-brand-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 64px;
    height: 64px;
    background: linear-gradient(135deg, var(--blue-600), var(--blue-800));
    border-radius: var(--radius-xl);
    color: #ffffff;
    font-size: 1.75rem;
    margin: 0 auto var(--space-4);
    box-shadow: 0 8px 24px rgba(37, 99, 235, 0.4);
}

.login-brand h1 {
    font-size: var(--text-2xl);
    font-weight: 800;
    color: var(--gray-900);
    margin-bottom: var(--space-1);
    letter-spacing: -0.03em;
}

.login-brand p {
    font-size: var(--text-sm);
    color: var(--gray-500);
    margin: 0;
}

.login-footer {
    text-align: center;
    margin-top: var(--space-5);
    font-size: var(--text-sm);
    color: var(--gray-500);
}

.login-footer a {
    color: var(--color-primary);
    font-weight: 600;
}

.login-footer a:hover {
    color: var(--color-primary-dark);
    text-decoration: underline;
}

/* Submit button full-width in login */
.login-card .btn-primary[type="submit"],
.login-card button[name="Submit"] {
    width: 100%;
    padding: var(--space-4);
    font-size: var(--text-base);
    margin-top: var(--space-2);
    border-radius: var(--radius-md);
}

/* ============================================================================
   19. RESPONSIVE BREAKPOINTS
   ============================================================================ */

/* Tablet */
@media (max-width: 1024px) {
    .grid-cols-4 {
        grid-template-columns: repeat(2, 1fr);
    }

    .grid-cols-3 {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Mobile */
@media (max-width: 768px) {
    /* Hide sidebar, show mobile nav */
    .sidebar {
        display: none;
    }

    .mobile-nav {
        display: flex;
    }

    /* Full width main */
    .main-wrapper {
        margin-left: 0;
        padding-bottom: var(--mobile-nav-height);
    }

    /* Compact header */
    .main-header {
        padding: var(--space-3) var(--space-4);
    }

    .page-title {
        font-size: var(--text-xl);
    }

    /* Compact content */
    .main-content {
        padding: var(--space-4);
    }

    /* Single-column grids */
    .grid-cols-2,
    .grid-cols-3,
    .grid-cols-4 {
        grid-template-columns: 1fr;
    }

    /* Compact cards */
    .card {
        padding: var(--space-4);
    }

    /* Smaller stat values on mobile */
    .stat-card-value {
        font-size: var(--text-3xl);
    }

    /* Table horizontal scroll */
    .table-responsive-wrapper {
        margin: 0 calc(-1 * var(--space-4));
        border-radius: 0;
        border-left: none;
        border-right: none;
    }

    /* Utility visibility */
    .desktop-only { display: none !important; }
    .mobile-only  { display: block !important; }
}

/* Small mobile */
@media (max-width: 480px) {
    .page-title {
        font-size: var(--text-lg);
    }

    .btn {
        font-size: var(--text-xs);
        padding: var(--space-2) var(--space-4);
    }

    .btn-lg {
        font-size: var(--text-sm);
        padding: var(--space-3) var(--space-5);
    }
}

/* ============================================================================
   20. REDUCED MOTION
   ============================================================================ */

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}
