/* ============================================================
   KZZH-CRASH DASHBOARD — Premium Design System
   ============================================================ */

/* ===== RESET & BASE ===== */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

:root {
    /* Core Colors */
    --bg-primary: #06060e;
    --bg-secondary: #0c0c1d;
    --bg-tertiary: #12122a;
    --bg-card: rgba(15, 15, 35, 0.85);
    --bg-card-hover: rgba(20, 20, 45, 0.95);

    /* Accent */
    --accent-primary: #7c3aed;
    --accent-secondary: #a78bfa;
    --accent-glow: rgba(124, 58, 237, 0.4);
    --accent-cyan: #06b6d4;
    --accent-emerald: #10b981;
    --accent-rose: #f43f5e;
    --accent-amber: #f59e0b;
    --accent-blue: #3b82f6;

    /* Text */
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;

    /* Borders */
    --border: rgba(148, 163, 184, 0.1);
    --border-hover: rgba(124, 58, 237, 0.3);

    /* Glass */
    --glass-bg: rgba(15, 15, 40, 0.6);
    --glass-border: rgba(148, 163, 184, 0.08);

    /* Shadows */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 20px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 30px var(--accent-glow);

    /* Radius */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;

    /* Font */
    --font: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;

    /* Sidebar */
    --sidebar-width: 280px;
    --sidebar-collapsed: 70px;
}

html {
    font-size: 14px;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font);
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

a { text-decoration: none; color: inherit; }
button { cursor: pointer; border: none; outline: none; font-family: var(--font); }
input, select, textarea { font-family: var(--font); outline: none; }

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg-secondary); }
::-webkit-scrollbar-thumb { background: var(--accent-primary); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--accent-secondary); }

/* ===== ANIMATED BACKGROUND ===== */
.bg-animation {
    position: fixed;
    inset: 0;
    z-index: 0;
    overflow: hidden;
    pointer-events: none;
}

.bg-glow {
    position: absolute;
    border-radius: 50%;
    filter: blur(120px);
    opacity: 0.15;
    animation: float 20s ease-in-out infinite;
}

.bg-glow-1 {
    width: 600px; height: 600px;
    background: var(--accent-primary);
    top: -200px; left: -200px;
    animation-delay: 0s;
}

.bg-glow-2 {
    width: 500px; height: 500px;
    background: var(--accent-cyan);
    bottom: -150px; right: -150px;
    animation-delay: -7s;
}

.bg-glow-3 {
    width: 400px; height: 400px;
    background: var(--accent-rose);
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    animation-delay: -14s;
}

@keyframes float {
    0%, 100% { transform: translate(0, 0) scale(1); }
    25% { transform: translate(50px, -80px) scale(1.1); }
    50% { transform: translate(-30px, 60px) scale(0.9); }
    75% { transform: translate(80px, 30px) scale(1.05); }
}

.particles {
    position: absolute;
    inset: 0;
}

.particle {
    position: absolute;
    width: 2px;
    height: 2px;
    background: var(--accent-secondary);
    border-radius: 50%;
    opacity: 0;
    animation: particleFloat 6s ease-in-out infinite;
}

@keyframes particleFloat {
    0% { opacity: 0; transform: translateY(100vh); }
    10% { opacity: 0.6; }
    90% { opacity: 0.6; }
    100% { opacity: 0; transform: translateY(-10vh); }
}

/* ============================================================
   LOGIN PAGE
   ============================================================ */
.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    overflow: hidden;
}

.login-wrapper {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 24px;
    width: 100%;
    padding: 20px;
}

.login-card {
    background: var(--glass-bg);
    backdrop-filter: blur(40px);
    -webkit-backdrop-filter: blur(40px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-xl);
    padding: 48px 40px;
    width: 100%;
    max-width: 440px;
    box-shadow: var(--shadow-lg), 0 0 60px rgba(124, 58, 237, 0.08);
    animation: cardAppear 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    opacity: 0;
    transform: translateY(30px);
}

@keyframes cardAppear {
    to { opacity: 1; transform: translateY(0); }
}

.login-logo {
    text-align: center;
    margin-bottom: 36px;
}

.logo-icon {
    width: 72px;
    height: 72px;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-cyan));
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
    font-size: 28px;
    color: white;
    box-shadow: 0 8px 32px rgba(124, 58, 237, 0.3);
    animation: iconPulse 3s ease-in-out infinite;
}

@keyframes iconPulse {
    0%, 100% { box-shadow: 0 8px 32px rgba(124, 58, 237, 0.3); }
    50% { box-shadow: 0 8px 48px rgba(124, 58, 237, 0.5); }
}

.logo-text {
    font-size: 2rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    color: var(--text-primary);
}

.logo-text span {
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-cyan));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.logo-version {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 4px;
    letter-spacing: 2px;
    text-transform: uppercase;
}

/* Role Selector */
.role-selector {
    display: flex;
    position: relative;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    padding: 4px;
    margin-bottom: 28px;
    border: 1px solid var(--border);
}

.role-btn {
    flex: 1;
    padding: 12px 20px;
    background: transparent;
    color: var(--text-muted);
    font-size: 0.9rem;
    font-weight: 600;
    border-radius: var(--radius-sm);
    transition: all 0.3s ease;
    z-index: 1;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.role-btn.active {
    color: white;
}

.role-indicator {
    position: absolute;
    top: 4px;
    left: 4px;
    width: calc(50% - 4px);
    height: calc(100% - 8px);
    background: linear-gradient(135deg, var(--accent-primary), #5b21b6);
    border-radius: var(--radius-sm);
    transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 4px 12px rgba(124, 58, 237, 0.3);
}

.role-indicator.reseller {
    transform: translateX(100%);
}

/* Input Groups */
.input-group {
    position: relative;
    margin-bottom: 20px;
}

.input-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 0.9rem;
    transition: color 0.3s;
    z-index: 1;
}

.input-group input {
    width: 100%;
    padding: 16px 16px 16px 48px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 0.95rem;
    transition: all 0.3s ease;
}

.input-group input:focus {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.15);
    background: var(--bg-tertiary);
}

.input-group input:focus ~ .input-icon,
.input-group input:focus + .input-icon {
    color: var(--accent-primary);
}

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

.toggle-pass {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    color: var(--text-muted);
    font-size: 0.9rem;
    transition: color 0.3s;
    z-index: 1;
}

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

/* Error Message */
.error-message {
    display: none;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    background: rgba(244, 63, 94, 0.1);
    border: 1px solid rgba(244, 63, 94, 0.2);
    border-radius: var(--radius-sm);
    color: var(--accent-rose);
    font-size: 0.85rem;
    margin-bottom: 20px;
    animation: shakeX 0.5s ease;
}

.error-message.show { display: flex; }

@keyframes shakeX {
    0%, 100% { transform: translateX(0); }
    20% { transform: translateX(-8px); }
    40% { transform: translateX(8px); }
    60% { transform: translateX(-4px); }
    80% { transform: translateX(4px); }
}

/* Login Button */
.login-btn {
    width: 100%;
    padding: 16px;
    background: linear-gradient(135deg, var(--accent-primary), #5b21b6);
    color: white;
    font-size: 1rem;
    font-weight: 700;
    border-radius: var(--radius-md);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    letter-spacing: 0.5px;
}

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

.login-btn:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(124, 58, 237, 0.4); }
.login-btn:hover::before { opacity: 1; }
.login-btn:active { transform: translateY(0); }

.login-btn.loading .btn-text { opacity: 0; }
.login-btn.loading .btn-loader { opacity: 1; }
.btn-loader { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; opacity: 0; transition: opacity 0.3s; font-size: 1.2rem; }

/* Footer */
.login-footer {
    text-align: center;
    margin-top: 28px;
    padding-top: 24px;
    border-top: 1px solid var(--border);
}

.login-footer p {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 12px;
}

.security-badges {
    display: flex;
    justify-content: center;
    gap: 16px;
}

.security-badges span {
    font-size: 0.75rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 4px;
}

.security-badges span i { color: var(--accent-emerald); font-size: 0.7rem; }

.login-branding {
    text-align: center;
}

.login-branding p {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* ============================================================
   DASHBOARD LAYOUT
   ============================================================ */
.dashboard-layout {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background: var(--glass-bg);
    backdrop-filter: blur(40px);
    border-right: 1px solid var(--glass-border);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 100;
    transition: width 0.3s ease, transform 0.3s ease;
    overflow-y: auto;
    overflow-x: hidden;
}

.sidebar-header {
    padding: 24px 20px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

.sidebar-logo {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-cyan));
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    color: white;
    flex-shrink: 0;
}

.sidebar-title {
    display: flex;
    flex-direction: column;
}

.sidebar-title h2 {
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.sidebar-title span {
    font-size: 0.7rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.sidebar-nav {
    flex: 1;
    padding: 16px 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.nav-section-label {
    font-size: 0.65rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    padding: 16px 12px 8px;
    font-weight: 700;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.2s ease;
    cursor: pointer;
    position: relative;
    white-space: nowrap;
}

.nav-item:hover {
    background: rgba(124, 58, 237, 0.08);
    color: var(--text-primary);
}

.nav-item.active {
    background: linear-gradient(135deg, rgba(124, 58, 237, 0.15), rgba(124, 58, 237, 0.05));
    color: var(--accent-secondary);
    border-left: 3px solid var(--accent-primary);
}

.nav-item.active i {
    color: var(--accent-primary);
}

.nav-item i {
    width: 20px;
    text-align: center;
    font-size: 0.95rem;
    flex-shrink: 0;
}

.nav-badge {
    margin-left: auto;
    background: var(--accent-primary);
    color: white;
    font-size: 0.65rem;
    padding: 2px 8px;
    border-radius: 10px;
    font-weight: 700;
}

.sidebar-footer {
    padding: 16px 12px;
    border-top: 1px solid var(--border);
    flex-shrink: 0;
}

.sidebar-user {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: background 0.2s;
}

.sidebar-user:hover { background: rgba(255,255,255,0.03); }

.user-avatar {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-cyan));
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    color: white;
    font-weight: 700;
    flex-shrink: 0;
}

.user-info { flex: 1; min-width: 0; }
.user-info h4 { font-size: 0.85rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-info span { font-size: 0.7rem; color: var(--text-muted); }

.logout-btn {
    background: none;
    color: var(--text-muted);
    font-size: 1rem;
    transition: color 0.2s;
    flex-shrink: 0;
}

.logout-btn:hover { color: var(--accent-rose); }

/* Main Content Area */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    transition: margin-left 0.3s ease;
}

.content-header {
    padding: 24px 32px;
    border-bottom: 1px solid var(--border);
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    position: sticky;
    top: 0;
    z-index: 50;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.content-header h1 {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.content-header h1 i {
    margin-right: 10px;
    color: var(--accent-primary);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.content-body {
    padding: 28px 32px;
}

/* Mobile menu toggle */
.mobile-toggle {
    display: none;
    background: none;
    color: var(--text-primary);
    font-size: 1.3rem;
    padding: 8px;
}

/* ============================================================
   STAT CARDS
   ============================================================ */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 20px;
    margin-bottom: 28px;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--card-accent, var(--accent-primary)), transparent);
}

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

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

.stat-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    background: rgba(124, 58, 237, 0.12);
    color: var(--accent-primary);
}

.stat-icon.cyan { background: rgba(6, 182, 212, 0.12); color: var(--accent-cyan); }
.stat-icon.emerald { background: rgba(16, 185, 129, 0.12); color: var(--accent-emerald); }
.stat-icon.rose { background: rgba(244, 63, 94, 0.12); color: var(--accent-rose); }
.stat-icon.amber { background: rgba(245, 158, 11, 0.12); color: var(--accent-amber); }
.stat-icon.blue { background: rgba(59, 130, 246, 0.12); color: var(--accent-blue); }

.stat-trend {
    font-size: 0.75rem;
    font-weight: 600;
    padding: 4px 8px;
    border-radius: 6px;
}

.stat-trend.up { background: rgba(16, 185, 129, 0.12); color: var(--accent-emerald); }
.stat-trend.down { background: rgba(244, 63, 94, 0.12); color: var(--accent-rose); }

.stat-value {
    font-size: 2rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    margin-bottom: 4px;
}

.stat-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 500;
}

/* Card accent colors */
.stat-card.purple { --card-accent: var(--accent-primary); }
.stat-card.cyan { --card-accent: var(--accent-cyan); }
.stat-card.emerald { --card-accent: var(--accent-emerald); }
.stat-card.rose { --card-accent: var(--accent-rose); }
.stat-card.amber { --card-accent: var(--accent-amber); }
.stat-card.blue { --card-accent: var(--accent-blue); }

/* ============================================================
   CONTENT PANELS / SECTIONS
   ============================================================ */
.panel {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    margin-bottom: 24px;
    overflow: hidden;
}

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

.panel-header h2 {
    font-size: 1.1rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
}

.panel-header h2 i { color: var(--accent-primary); }

.panel-body { padding: 20px 24px; }

.panel-body.no-pad { padding: 0; }

/* ============================================================
   TABLES
   ============================================================ */
.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th {
    text-align: left;
    padding: 14px 16px;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.8px;
    background: rgba(15, 15, 35, 0.5);
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}

.data-table td {
    padding: 14px 16px;
    font-size: 0.88rem;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}

.data-table tbody tr {
    transition: background 0.2s;
}

.data-table tbody tr:hover {
    background: rgba(124, 58, 237, 0.04);
}

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

/* ============================================================
   BADGES / STATUS
   ============================================================ */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    white-space: nowrap;
}

.badge.success { background: rgba(16, 185, 129, 0.12); color: var(--accent-emerald); }
.badge.danger { background: rgba(244, 63, 94, 0.12); color: var(--accent-rose); }
.badge.warning { background: rgba(245, 158, 11, 0.12); color: var(--accent-amber); }
.badge.info { background: rgba(59, 130, 246, 0.12); color: var(--accent-blue); }
.badge.purple { background: rgba(124, 58, 237, 0.12); color: var(--accent-secondary); }

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
}

.status-dot.online { background: var(--accent-emerald); box-shadow: 0 0 8px var(--accent-emerald); }
.status-dot.offline { background: var(--text-muted); }
.status-dot.warning { background: var(--accent-amber); box-shadow: 0 0 8px var(--accent-amber); }

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    font-weight: 600;
    transition: all 0.25s ease;
    white-space: nowrap;
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent-primary), #5b21b6);
    color: white;
}

.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 4px 16px rgba(124, 58, 237, 0.35); }

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

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

.btn-danger {
    background: rgba(244, 63, 94, 0.12);
    color: var(--accent-rose);
    border: 1px solid rgba(244, 63, 94, 0.2);
}

.btn-danger:hover { background: rgba(244, 63, 94, 0.2); }

.btn-success {
    background: rgba(16, 185, 129, 0.12);
    color: var(--accent-emerald);
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.btn-success:hover { background: rgba(16, 185, 129, 0.2); }

.btn-sm { padding: 6px 12px; font-size: 0.78rem; }

.btn-icon {
    width: 36px;
    height: 36px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    background: var(--bg-secondary);
    color: var(--text-secondary);
    border: 1px solid var(--border);
    font-size: 0.85rem;
    transition: all 0.2s;
}

.btn-icon:hover { border-color: var(--border-hover); color: var(--text-primary); }
.btn-icon.danger:hover { color: var(--accent-rose); border-color: rgba(244, 63, 94, 0.3); }

/* ============================================================
   FORMS / INPUTS
   ============================================================ */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 8px;
    letter-spacing: 0.3px;
}

.form-control {
    width: 100%;
    padding: 12px 16px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.form-control:focus {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.12);
}

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

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

select.form-control {
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 16px;
    padding-right: 40px;
}

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

/* ============================================================
   MODAL
   ============================================================ */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal-overlay.show {
    display: flex;
    animation: fadeIn 0.2s ease;
}

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

.modal {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 520px;
    max-height: 80vh;
    overflow-y: auto;
    animation: modalSlideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalSlideUp {
    from { opacity: 0; transform: translateY(20px) scale(0.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

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

.modal-header h3 {
    font-size: 1.1rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
}

.modal-header h3 i { color: var(--accent-primary); }

.modal-close {
    background: none;
    color: var(--text-muted);
    font-size: 1.2rem;
    transition: color 0.2s;
}

.modal-close:hover { color: var(--text-primary); }

.modal-body { padding: 24px; }

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 16px 24px;
    border-top: 1px solid var(--border);
}

/* ============================================================
   CHART CONTAINER
   ============================================================ */
.chart-container {
    position: relative;
    height: 320px;
    padding: 12px;
}

/* ============================================================
   NOTIFICATIONS / TOAST
   ============================================================ */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.toast {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 16px 20px;
    min-width: 320px;
    max-width: 420px;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: var(--shadow-lg);
    animation: toastIn 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
    overflow: hidden;
}

.toast::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
}

.toast.success::before { background: var(--accent-emerald); }
.toast.error::before { background: var(--accent-rose); }
.toast.info::before { background: var(--accent-blue); }
.toast.warning::before { background: var(--accent-amber); }

.toast-icon {
    font-size: 1.1rem;
    flex-shrink: 0;
}

.toast.success .toast-icon { color: var(--accent-emerald); }
.toast.error .toast-icon { color: var(--accent-rose); }
.toast.info .toast-icon { color: var(--accent-blue); }
.toast.warning .toast-icon { color: var(--accent-amber); }

.toast-content { flex: 1; }
.toast-title { font-size: 0.85rem; font-weight: 700; margin-bottom: 2px; }
.toast-message { font-size: 0.8rem; color: var(--text-muted); }

.toast-close {
    background: none;
    color: var(--text-muted);
    font-size: 0.9rem;
    flex-shrink: 0;
    transition: color 0.2s;
}

.toast-close:hover { color: var(--text-primary); }

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

.toast.removing {
    animation: toastOut 0.3s ease forwards;
}

@keyframes toastOut {
    to { opacity: 0; transform: translateX(50px); height: 0; padding: 0; margin: 0; }
}

/* ============================================================
   SECTION (dashboard page toggling)
   ============================================================ */
.page-section {
    display: none;
}

.page-section.active {
    display: block;
    animation: sectionIn 0.3s ease;
}

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

/* ============================================================
   EMPTY STATE
   ============================================================ */
.empty-state {
    text-align: center;
    padding: 48px 24px;
}

.empty-state i {
    font-size: 3rem;
    color: var(--text-muted);
    margin-bottom: 16px;
    opacity: 0.4;
}

.empty-state h3 {
    font-size: 1.1rem;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.empty-state p {
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* ============================================================
   TOGGLE SWITCH
   ============================================================ */
.toggle-switch {
    position: relative;
    width: 44px;
    height: 24px;
    cursor: pointer;
}

.toggle-switch input { display: none; }

.toggle-slider {
    position: absolute;
    inset: 0;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 12px;
    transition: all 0.3s ease;
}

.toggle-slider::before {
    content: '';
    position: absolute;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--text-muted);
    top: 2px;
    left: 2px;
    transition: all 0.3s ease;
}

.toggle-switch input:checked + .toggle-slider {
    background: rgba(16, 185, 129, 0.2);
    border-color: rgba(16, 185, 129, 0.3);
}

.toggle-switch input:checked + .toggle-slider::before {
    transform: translateX(20px);
    background: var(--accent-emerald);
    box-shadow: 0 0 8px rgba(16, 185, 129, 0.4);
}

/* ============================================================
   ACTIVITY LOG ITEM
   ============================================================ */
.log-item {
    display: flex;
    gap: 14px;
    padding: 14px 0;
    border-bottom: 1px solid var(--border);
}

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

.log-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 0.85rem;
}

.log-content { flex: 1; }
.log-action { font-size: 0.85rem; font-weight: 600; margin-bottom: 2px; }
.log-details { font-size: 0.78rem; color: var(--text-muted); }
.log-time { font-size: 0.7rem; color: var(--text-muted); white-space: nowrap; }

/* ============================================================
   SEARCH & FILTER
   ============================================================ */
.search-bar {
    position: relative;
    max-width: 300px;
}

.search-bar input {
    width: 100%;
    padding: 10px 16px 10px 40px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 0.85rem;
    transition: all 0.3s;
}

.search-bar input:focus {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.12);
}

.search-bar i {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 0.85rem;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1024px) {
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .form-row { grid-template-columns: 1fr; }
}

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

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

    .main-content { margin-left: 0; }

    .mobile-toggle { display: block; }

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

    .content-header { padding: 16px 20px; }
    .content-body { padding: 20px; }

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

    .data-table { font-size: 0.8rem; }
    .data-table th, .data-table td { padding: 10px 12px; }

    .toast { min-width: auto; max-width: calc(100vw - 40px); }
}

/* ============================================================
   SKELETON LOADING
   ============================================================ */
.skeleton {
    background: linear-gradient(90deg, var(--bg-secondary) 25%, var(--bg-tertiary) 50%, var(--bg-secondary) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s ease-in-out infinite;
    border-radius: var(--radius-sm);
}

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

.skeleton-text { height: 14px; margin-bottom: 8px; }
.skeleton-title { height: 24px; width: 60%; margin-bottom: 12px; }
.skeleton-card { height: 120px; border-radius: var(--radius-lg); }

/* ============================================================
   ANNOUNCEMENT CARD
   ============================================================ */
.announcement-card {
    padding: 16px 20px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    margin-bottom: 12px;
    position: relative;
}

.announcement-card.info { border-left: 4px solid var(--accent-blue); }
.announcement-card.warning { border-left: 4px solid var(--accent-amber); }
.announcement-card.success { border-left: 4px solid var(--accent-emerald); }
.announcement-card.danger { border-left: 4px solid var(--accent-rose); }

.announcement-card h4 { font-size: 0.9rem; font-weight: 700; margin-bottom: 6px; }
.announcement-card p { font-size: 0.82rem; color: var(--text-secondary); }
.announcement-card .ann-time { font-size: 0.7rem; color: var(--text-muted); margin-top: 8px; }

/* ============================================================
   SETTING ITEM
   ============================================================ */
.setting-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 0;
    border-bottom: 1px solid var(--border);
}

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

.setting-info h4 { font-size: 0.9rem; font-weight: 600; }
.setting-info p { font-size: 0.78rem; color: var(--text-muted); margin-top: 2px; }
