/* ═══════════════════════════════════════════════════════════════════════════
   BuildPro ERP — Premium Design System
   Construction ERP + CRM Platform
   ═══════════════════════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap');

/* ── CSS Variables ─────────────────────────────────────────────────────── */
:root {
    /* Backgrounds */
    --bg-base:        #080C14;
    --bg-primary:     #0D1117;
    --bg-secondary:   #161B26;
    --bg-tertiary:    #1C2333;
    --bg-card:        rgba(22, 27, 38, 0.8);
    --bg-card-hover:  rgba(28, 35, 51, 0.9);
    --bg-glass:       rgba(255, 255, 255, 0.04);
    --bg-glass-hover: rgba(255, 255, 255, 0.07);

    /* Borders */
    --border:         rgba(255, 255, 255, 0.08);
    --border-hover:   rgba(255, 255, 255, 0.15);
    --border-focus:   rgba(245, 158, 11, 0.6);

    /* Text */
    --text-primary:   #F1F5F9;
    --text-secondary: #94A3B8;
    --text-muted:     #475569;
    --text-disabled:  #334155;

    /* Brand — Amber/Construction */
    --accent:         #F59E0B;
    --accent-light:   #FCD34D;
    --accent-dark:    #D97706;
    --accent-glow:    rgba(245, 158, 11, 0.15);
    --accent-glow-md: rgba(245, 158, 11, 0.25);

    /* Status Colors */
    --blue:           #3B82F6;
    --blue-bg:        rgba(59, 130, 246, 0.12);
    --green:          #10B981;
    --green-bg:       rgba(16, 185, 129, 0.12);
    --red:            #EF4444;
    --red-bg:         rgba(239, 68, 68, 0.12);
    --amber:          #F59E0B;
    --amber-bg:       rgba(245, 158, 11, 0.12);
    --purple:         #8B5CF6;
    --purple-bg:      rgba(139, 92, 246, 0.12);
    --teal:           #14B8A6;
    --teal-bg:        rgba(20, 184, 166, 0.12);
    --pink:           #EC4899;
    --pink-bg:        rgba(236, 72, 153, 0.12);

    /* Sidebar */
    --sidebar-w:      264px;
    --sidebar-collapsed: 72px;

    /* Topbar */
    --topbar-h:       64px;

    /* Radius */
    --r-sm:           6px;
    --r-md:           10px;
    --r-lg:           14px;
    --r-xl:           20px;
    --r-full:         9999px;

    /* Shadows */
    --shadow-sm:      0 1px 3px rgba(0, 0, 0, 0.4);
    --shadow-md:      0 4px 16px rgba(0, 0, 0, 0.4);
    --shadow-lg:      0 8px 32px rgba(0, 0, 0, 0.5);
    --shadow-glow:    0 0 24px rgba(245, 158, 11, 0.15);

    /* Transitions */
    --transition:     all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow:all 0.35s cubic-bezier(0.4, 0, 0.2, 1);

    /* Font */
    --font:           'Inter', 'Plus Jakarta Sans', -apple-system, sans-serif;
    --font-heading:   'Plus Jakarta Sans', 'Inter', sans-serif;
}

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

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

body {
    font-family: var(--font);
    font-size: 14px;
    line-height: 1.6;
    color: var(--text-primary);
    background: var(--bg-base);
    overflow-x: hidden;
}

a { color: var(--accent); text-decoration: none; transition: var(--transition); }
a:hover { opacity: 0.85; }
img, svg { display: block; max-width: 100%; }
button { cursor: pointer; border: none; background: none; font-family: var(--font); }
input, textarea, select { font-family: var(--font); }
ul, ol { list-style: none; }

/* ── Scrollbar ────────────────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg-secondary); }
::-webkit-scrollbar-thumb { background: #334155; border-radius: var(--r-full); }
::-webkit-scrollbar-thumb:hover { background: #475569; }

/* ═══════════════════════════════════════════════════════════════════════════
   ADMIN LAYOUT
   ═══════════════════════════════════════════════════════════════════════════ */
.admin-body {
    display: flex;
    min-height: 100vh;
    background: var(--bg-base);
}

/* ── Sidebar ──────────────────────────────────────────────────────────── */
.sidebar {
    position: fixed;
    top: 0; left: 0; bottom: 0;
    width: var(--sidebar-w);
    background: var(--bg-secondary);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    z-index: 100;
    transition: var(--transition-slow);
    overflow: hidden;
}

.sidebar.collapsed {
    width: var(--sidebar-collapsed);
}

/* Brand */
.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 20px 16px;
    border-bottom: 1px solid var(--border);
    position: relative;
    flex-shrink: 0;
}

.brand-icon {
    width: 40px; height: 40px;
    background: linear-gradient(135deg, var(--accent), var(--accent-dark));
    border-radius: var(--r-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: #000;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3);
}

.brand-text { flex: 1; overflow: hidden; }
.brand-name {
    font-family: var(--font-heading);
    font-size: 16px;
    font-weight: 800;
    color: var(--text-primary);
    white-space: nowrap;
}
.brand-sub {
    font-size: 10px;
    color: var(--text-muted);
    white-space: nowrap;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.sidebar-toggle-btn {
    width: 24px; height: 24px;
    background: var(--bg-glass);
    border: 1px solid var(--border);
    border-radius: var(--r-sm);
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    flex-shrink: 0;
    transition: var(--transition);
}
.sidebar-toggle-btn:hover {
    background: var(--accent-glow);
    border-color: var(--accent);
    color: var(--accent);
}

/* Company Selector */
.company-selector {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    cursor: pointer;
    transition: var(--transition);
    flex-shrink: 0;
}
.company-selector:hover { background: var(--bg-glass); }

.company-avatar {
    width: 32px; height: 32px;
    background: var(--blue-bg);
    border-radius: var(--r-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--blue);
    font-size: 14px;
    flex-shrink: 0;
}

.company-info { flex: 1; overflow: hidden; }
.company-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.company-badge {
    font-size: 10px;
    color: var(--green);
    background: var(--green-bg);
    padding: 1px 6px;
    border-radius: var(--r-full);
}

.company-arrow {
    font-size: 11px;
    color: var(--text-muted);
    flex-shrink: 0;
}

/* Nav */
.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 8px 0 24px;
}

.nav-group { margin-bottom: 4px; }

.nav-label {
    display: block;
    font-size: 9px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    padding: 12px 20px 4px;
    white-space: nowrap;
    overflow: hidden;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 16px;
    margin: 1px 8px;
    border-radius: var(--r-md);
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
    white-space: nowrap;
}

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

.nav-item.active {
    background: var(--accent-glow-md);
    color: var(--accent);
    font-weight: 600;
}

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

.nav-icon {
    width: 20px; height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    flex-shrink: 0;
}

.nav-text { flex: 1; font-size: 13px; font-weight: 500; }

.nav-badge {
    background: var(--accent);
    color: #000;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: var(--r-full);
    flex-shrink: 0;
}

.nav-arrow {
    font-size: 11px;
    color: var(--text-muted);
    transition: var(--transition);
    flex-shrink: 0;
}

.nav-item.has-submenu:hover .nav-arrow,
.nav-item.has-submenu.open .nav-arrow {
    transform: rotate(90deg);
    color: var(--accent);
}

/* Submenu */
.submenu {
    display: none;
    overflow: hidden;
}

.nav-item.has-submenu.open + .submenu { display: block; }

.nav-item.sub {
    padding: 7px 16px 7px 44px;
    font-size: 12.5px;
}

/* Collapsed state */
.sidebar.collapsed .nav-label,
.sidebar.collapsed .brand-text,
.sidebar.collapsed .company-info,
.sidebar.collapsed .company-arrow,
.sidebar.collapsed .nav-text,
.sidebar.collapsed .nav-badge,
.sidebar.collapsed .nav-arrow,
.sidebar.collapsed .brand-sub {
    display: none;
}

.sidebar.collapsed .nav-item {
    justify-content: center;
    padding: 10px;
}

.sidebar.collapsed .nav-icon {
    width: 24px;
    height: 24px;
    font-size: 16px;
}

/* ── Main Wrapper ──────────────────────────────────────────────────────── */
.main-wrapper {
    margin-left: var(--sidebar-w);
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    transition: var(--transition-slow);
}

.sidebar.collapsed ~ .main-wrapper {
    margin-left: var(--sidebar-collapsed);
}

/* ── Topbar ────────────────────────────────────────────────────────────── */
.topbar {
    height: var(--topbar-h);
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    position: sticky;
    top: 0;
    z-index: 50;
    gap: 16px;
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 16px;
    flex: 1;
}

.menu-btn {
    width: 36px; height: 36px;
    display: none;
    align-items: center;
    justify-content: center;
    background: var(--bg-glass);
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    color: var(--text-secondary);
    font-size: 16px;
}

.breadcrumb-nav {
    display: flex;
    align-items: center;
    gap: 8px;
}

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

.breadcrumb-item a { color: var(--text-secondary); }
.breadcrumb-item a:hover { color: var(--accent); }

.topbar-right {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

/* Search */
.topbar-search {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    padding: 8px 12px;
    width: 280px;
    transition: var(--transition);
}

.topbar-search:focus-within {
    border-color: var(--border-focus);
    background: var(--bg-card);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.topbar-search i { color: var(--text-muted); font-size: 13px; }

.topbar-search input {
    flex: 1;
    background: none;
    border: none;
    outline: none;
    color: var(--text-primary);
    font-size: 13px;
}

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

.topbar-search kbd {
    font-size: 10px;
    color: var(--text-muted);
    background: var(--bg-glass);
    border: 1px solid var(--border);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: monospace;
}

/* Action buttons */
.topbar-actions {
    display: flex;
    align-items: center;
    gap: 6px;
}

.action-btn {
    width: 36px; height: 36px;
    background: var(--bg-glass);
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    color: var(--text-secondary);
    font-size: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    position: relative;
}

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

.action-badge {
    position: absolute;
    top: -4px; right: -4px;
    width: 16px; height: 16px;
    background: var(--red);
    color: white;
    font-size: 9px;
    font-weight: 700;
    border-radius: var(--r-full);
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--bg-secondary);
}

.quick-add-btn {
    background: var(--accent-glow);
    border-color: var(--accent);
    color: var(--accent);
}

/* User menu */
.user-menu {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 10px;
    background: var(--bg-glass);
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    cursor: pointer;
    transition: var(--transition);
    position: relative;
}

.user-menu:hover {
    background: var(--bg-glass-hover);
    border-color: var(--border-hover);
}

.user-avatar {
    width: 32px; height: 32px;
    background: linear-gradient(135deg, var(--accent), var(--accent-dark));
    border-radius: var(--r-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
    color: #000;
    flex-shrink: 0;
}

.user-info { line-height: 1.2; }
.user-name { font-size: 13px; font-weight: 600; display: block; }
.user-role { font-size: 11px; color: var(--text-muted); display: block; text-transform: capitalize; }
.user-arrow { font-size: 11px; color: var(--text-muted); }

/* User dropdown */
.user-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 200px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    box-shadow: var(--shadow-lg);
    padding: 8px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: var(--transition);
    z-index: 200;
}

.user-menu:hover .user-dropdown,
.user-menu.open .user-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-header {
    padding: 8px 10px 12px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 8px;
}
.dropdown-header strong { display: block; font-size: 13px; }
.dropdown-header small { font-size: 11px; color: var(--text-muted); }

.user-dropdown a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 10px;
    border-radius: var(--r-md);
    color: var(--text-secondary);
    font-size: 13px;
    transition: var(--transition);
}

.user-dropdown a i { width: 16px; text-align: center; }
.user-dropdown a:hover { background: var(--bg-glass); color: var(--text-primary); }
.user-dropdown a.text-danger { color: var(--red); }
.user-dropdown a.text-danger:hover { background: var(--red-bg); }

.dropdown-divider {
    height: 1px;
    background: var(--border);
    margin: 6px 0;
}

/* ── Flash Alerts ─────────────────────────────────────────────────────── */
.alert {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 20px;
    margin: 16px 24px 0;
    border-radius: var(--r-lg);
    font-size: 13px;
    font-weight: 500;
    animation: slideDown 0.3s ease;
}

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

.alert-success {
    background: var(--green-bg);
    border: 1px solid rgba(16, 185, 129, 0.3);
    color: var(--green);
}

.alert-danger {
    background: var(--red-bg);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: var(--red);
}

.alert-close {
    margin-left: auto;
    color: inherit;
    opacity: 0.6;
    padding: 2px;
    font-size: 12px;
}
.alert-close:hover { opacity: 1; }

/* Auth alerts */
.auth-alert {
    position: fixed;
    top: 16px;
    left: 50%;
    transform: translateX(-50%);
    padding: 12px 24px;
    border-radius: var(--r-lg);
    font-size: 14px;
    font-weight: 500;
    z-index: 9999;
    min-width: 300px;
    text-align: center;
    box-shadow: var(--shadow-lg);
    animation: slideDown 0.3s ease;
}

.auth-alert-danger  { background: var(--red-bg);   border: 1px solid rgba(239,68,68,.4);   color: var(--red); }
.auth-alert-success { background: var(--green-bg); border: 1px solid rgba(16,185,129,.4); color: var(--green); }

/* ── Page Content ─────────────────────────────────────────────────────── */
.page-content {
    flex: 1;
    padding: 24px;
    min-width: 0;
}

/* ── Page Footer ──────────────────────────────────────────────────────── */
.page-footer {
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    border-top: 1px solid var(--border);
    font-size: 12px;
    color: var(--text-muted);
}

/* ── Notification Panel ───────────────────────────────────────────────── */
.notif-panel {
    position: fixed;
    top: var(--topbar-h);
    right: 0;
    width: 360px;
    height: calc(100vh - var(--topbar-h));
    background: var(--bg-secondary);
    border-left: 1px solid var(--border);
    transform: translateX(100%);
    transition: var(--transition-slow);
    z-index: 90;
    display: flex;
    flex-direction: column;
}

.notif-panel.open { transform: translateX(0); }

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

.notif-header h4 { font-size: 15px; font-weight: 600; }
.btn-text { font-size: 12px; color: var(--accent); }
.btn-text:hover { opacity: 0.8; }

.notif-list { flex: 1; overflow-y: auto; padding: 8px; }

.notif-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px;
    border-radius: var(--r-lg);
    margin-bottom: 4px;
    transition: var(--transition);
}

.notif-item:hover { background: var(--bg-glass); }
.notif-item.unread { background: rgba(59, 130, 246, 0.04); }

.notif-icon {
    width: 36px; height: 36px;
    border-radius: var(--r-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    flex-shrink: 0;
}

.notif-icon.blue   { background: var(--blue-bg);   color: var(--blue);   }
.notif-icon.green  { background: var(--green-bg);  color: var(--green);  }
.notif-icon.amber  { background: var(--amber-bg);  color: var(--amber);  }
.notif-icon.red    { background: var(--red-bg);    color: var(--red);    }
.notif-icon.purple { background: var(--purple-bg); color: var(--purple); }

.notif-body p   { font-size: 13px; line-height: 1.4; }
.notif-body small { font-size: 11px; color: var(--text-muted); }

/* Overlay */
.overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 80;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
    backdrop-filter: blur(2px);
}

.overlay.visible { opacity: 1; visibility: visible; }

/* ═══════════════════════════════════════════════════════════════════════════
   AUTH PAGES
   ═══════════════════════════════════════════════════════════════════════════ */
.auth-body {
    min-height: 100vh;
    background: var(--bg-base);
    display: flex;
    align-items: stretch;
}

.auth-container {
    display: flex;
    width: 100%;
    min-height: 100vh;
}

/* Left Branding */
.auth-branding {
    flex: 1;
    background: linear-gradient(145deg, #0D1117 0%, #111827 40%, #1a2236 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 60px 40px;
    position: relative;
    overflow: hidden;
    border-right: 1px solid var(--border);
}

.auth-branding::before {
    content: '';
    position: absolute;
    top: -200px; right: -100px;
    width: 600px; height: 600px;
    background: radial-gradient(circle, rgba(245, 158, 11, 0.08) 0%, transparent 70%);
    pointer-events: none;
}

.auth-branding::after {
    content: '';
    position: absolute;
    bottom: -150px; left: -100px;
    width: 400px; height: 400px;
    background: radial-gradient(circle, rgba(59, 130, 246, 0.06) 0%, transparent 70%);
    pointer-events: none;
}

.auth-branding-inner {
    position: relative;
    z-index: 2;
    max-width: 480px;
}

.brand-logo-large {
    width: 72px; height: 72px;
    background: linear-gradient(135deg, var(--accent), var(--accent-dark));
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    color: #000;
    margin-bottom: 24px;
    box-shadow: 0 8px 24px rgba(245, 158, 11, 0.3);
}

.auth-brand-title {
    font-family: var(--font-heading);
    font-size: 42px;
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1.1;
    margin-bottom: 12px;
}

.auth-brand-tagline {
    font-size: 16px;
    color: var(--text-secondary);
    margin-bottom: 48px;
    line-height: 1.5;
}

.auth-features {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-bottom: 40px;
}

.auth-feature {
    display: flex;
    align-items: center;
    gap: 16px;
}

.auth-feature-icon {
    width: 44px; height: 44px;
    background: var(--bg-glass);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent);
    font-size: 18px;
    flex-shrink: 0;
}

.auth-feature strong {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 2px;
}

.auth-feature span {
    font-size: 12px;
    color: var(--text-muted);
}

.auth-stats {
    display: flex;
    gap: 32px;
    padding-top: 32px;
    border-top: 1px solid var(--border);
}

.auth-stat strong {
    display: block;
    font-size: 28px;
    font-weight: 800;
    font-family: var(--font-heading);
    color: var(--accent);
    line-height: 1;
}

.auth-stat span {
    font-size: 12px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Animated Particles */
.auth-particles {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 1;
}

.particle {
    position: absolute;
    width: 4px; height: 4px;
    background: var(--accent);
    border-radius: 50%;
    opacity: 0.4;
    animation: float 8s infinite;
}

.particle:nth-child(1) { top: 20%; left: 15%; animation-delay: 0s;   animation-duration: 9s;  }
.particle:nth-child(2) { top: 60%; left: 80%; animation-delay: 2s;   animation-duration: 11s; }
.particle:nth-child(3) { top: 80%; left: 25%; animation-delay: 4s;   animation-duration: 7s;  }
.particle:nth-child(4) { top: 35%; left: 70%; animation-delay: 1s;   animation-duration: 10s; }
.particle:nth-child(5) { top: 50%; left: 45%; animation-delay: 3s;   animation-duration: 8s;  }

@keyframes float {
    0%, 100% { transform: translateY(0px) scale(1); opacity: 0.4; }
    50%       { transform: translateY(-20px) scale(1.5); opacity: 0.8; }
}

/* Right Form */
.auth-form-wrapper {
    width: 480px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px;
    background: var(--bg-primary);
}

.auth-form-card {
    width: 100%;
    max-width: 400px;
}

.auth-form-header {
    text-align: center;
    margin-bottom: 36px;
}

.auth-form-header h2 {
    font-family: var(--font-heading);
    font-size: 28px;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.auth-form-header p {
    font-size: 14px;
    color: var(--text-secondary);
}

/* Form */
.auth-form { display: flex; flex-direction: column; gap: 20px; }

.form-group { display: flex; flex-direction: column; gap: 8px; }

.form-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    letter-spacing: 0.2px;
}

.form-label-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.form-label-link {
    font-size: 12px;
    color: var(--accent);
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-icon {
    position: absolute;
    left: 14px;
    color: var(--text-muted);
    font-size: 14px;
    z-index: 1;
}

.form-control {
    width: 100%;
    padding: 12px 14px 12px 42px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    color: var(--text-primary);
    font-size: 14px;
    outline: none;
    transition: var(--transition);
}

.form-control:focus {
    border-color: var(--border-focus);
    background: var(--bg-tertiary);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

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

.input-toggle {
    position: absolute;
    right: 12px;
    color: var(--text-muted);
    font-size: 14px;
    transition: var(--transition);
    padding: 4px;
}

.input-toggle:hover { color: var(--text-primary); }

/* Checkbox */
.form-group-inline { display: flex; align-items: center; }

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-size: 13px;
    color: var(--text-secondary);
}

.checkbox-label input { display: none; }

.checkbox-custom {
    width: 18px; height: 18px;
    background: var(--bg-secondary);
    border: 1.5px solid var(--border);
    border-radius: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    flex-shrink: 0;
}

.checkbox-label input:checked + .checkbox-custom {
    background: var(--accent);
    border-color: var(--accent);
}

.checkbox-label input:checked + .checkbox-custom::after {
    content: '✓';
    font-size: 12px;
    font-weight: 700;
    color: #000;
}

/* Login Button */
.btn-login {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, var(--accent), var(--accent-dark));
    color: #000;
    font-size: 15px;
    font-weight: 700;
    border-radius: var(--r-lg);
    transition: var(--transition);
    box-shadow: 0 4px 16px rgba(245, 158, 11, 0.3);
    position: relative;
    overflow: hidden;
}

.btn-login::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.1), transparent);
    opacity: 0;
    transition: var(--transition);
}

.btn-login:hover::before { opacity: 1; }
.btn-login:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(245, 158, 11, 0.4); }
.btn-login:active { transform: translateY(0); }
.btn-login:disabled { opacity: 0.7; transform: none; }

.btn-arrow { transition: var(--transition); }
.btn-login:hover .btn-arrow { transform: translateX(4px); }

/* Auth Divider */
.auth-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 12px;
    color: var(--text-muted);
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border);
}

/* Demo section */
.auth-demo { }

.demo-label {
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 10px;
    text-align: center;
}

.demo-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.demo-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 500;
    transition: var(--transition);
}

.demo-btn:hover {
    background: var(--accent-glow);
    border-color: var(--accent);
    color: var(--accent);
}

.demo-btn i { font-size: 13px; }

.auth-footer {
    margin-top: 40px;
    text-align: center;
}

.auth-footer p { font-size: 12px; color: var(--text-muted); }

/* ═══════════════════════════════════════════════════════════════════════════
   UTILITY CLASSES
   ═══════════════════════════════════════════════════════════════════════════ */
.text-primary   { color: var(--text-primary) !important; }
.text-secondary { color: var(--text-secondary) !important; }
.text-muted     { color: var(--text-muted) !important; }
.text-success   { color: var(--green) !important; }
.text-warning   { color: var(--amber) !important; }
.text-danger    { color: var(--red) !important; }
.text-info      { color: var(--blue) !important; }
.text-center    { text-align: center !important; }
.text-right     { text-align: right !important; }

.d-flex         { display: flex !important; }
.align-center   { align-items: center !important; }
.gap-8          { gap: 8px !important; }
.gap-12         { gap: 12px !important; }
.gap-16         { gap: 16px !important; }

.py-4           { padding-top: 16px; padding-bottom: 16px; }
.mb-0           { margin-bottom: 0 !important; }
.mt-auto        { margin-top: auto !important; }

/* Status Badges */
.status-badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: var(--r-full);
    font-size: 11px;
    font-weight: 600;
    text-transform: capitalize;
}

.status-active, .status-open { background: var(--green-bg); color: var(--green); }
.status-pending              { background: var(--amber-bg); color: var(--amber); }
.status-completed, .status-closed { background: var(--blue-bg); color: var(--blue); }
.status-delayed, .status-overdue  { background: var(--red-bg);  color: var(--red);  }
.status-hold, .status-on_hold     { background: var(--purple-bg); color: var(--purple); }
.status-draft                     { background: var(--bg-glass); color: var(--text-muted); border: 1px solid var(--border); }

/* Buttons */
.btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 18px;
    background: linear-gradient(135deg, var(--accent), var(--accent-dark));
    color: #000;
    font-size: 13px;
    font-weight: 600;
    border-radius: var(--r-md);
    transition: var(--transition);
    border: none;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(245, 158, 11, 0.2);
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(245, 158, 11, 0.35);
    opacity: 1;
    color: #000;
}

.btn-secondary {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 18px;
    background: var(--bg-glass);
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 500;
    border-radius: var(--r-md);
    border: 1px solid var(--border);
    cursor: pointer;
    transition: var(--transition);
}

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

/* ── Responsive ───────────────────────────────────────────────────────── */
@media (max-width: 1024px) {
    .auth-branding { display: none; }
    .auth-form-wrapper { width: 100%; }
    .topbar-search { width: 200px; }
}

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        width: var(--sidebar-w) !important;
    }

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

    .main-wrapper {
        margin-left: 0 !important;
    }

    .menu-btn { display: flex; }

    .topbar-search { display: none; }

    .page-content { padding: 16px; }
}
