/* ==========================================================================
   CSS SYSTEM - ĐẠI CÁT HOLDINGS CRM
   Styles: Modern Enterprise SaaS Dashboard (Glassmorphism, Light/Dark Modes)
   ========================================================================== */

/* 1. COLOR TOKENS & SYSTEM VARIABLES */
:root {
    /* Fonts */
    --font-primary: 'Inter', sans-serif;
    --font-secondary: 'Be Vietnam Pro', sans-serif;

    /* Transition times */
    --transition-fast: 0.2s ease;
    --transition-normal: 0.3s ease;
    --transition-slow: 0.4s ease;

    /* Radius */
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;
    --radius-xl: 20px;
    --radius-circle: 50%;

    /* Shadow system */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 10px 25px rgba(0, 0, 0, 0.05);
    --shadow-lg: 0 20px 40px rgba(0, 0, 0, 0.08);
    --shadow-glass: 0 8px 32px 0 rgba(15, 23, 42, 0.04);

    /* Light Theme Palette (Default) */
    --bg-main: #f8fafc;
    --bg-surface: rgba(255, 255, 255, 0.85);
    --bg-surface-opaque: #ffffff;
    --bg-sidebar: #0f172a;
    --bg-card: rgba(255, 255, 255, 0.8);
    --border-color: rgba(226, 232, 240, 0.8);
    --border-color-strong: #cbd5e1;
    
    --text-main: #1e293b;
    --text-muted: #64748b;
    --text-inverse: #ffffff;
    
    /* Core status colors */
    --primary: #0f172a;
    --primary-light: #1e293b;
    --accent: #06b6d4;
    --accent-hover: #0891b2;
    --accent-glow: rgba(6, 182, 212, 0.15);
    
    --success: #10b981;
    --success-light: rgba(16, 185, 129, 0.1);
    --danger: #ef4444;
    --danger-light: rgba(239, 68, 68, 0.1);
    --warning: #f59e0b;
    --warning-light: rgba(245, 158, 11, 0.1);
    --info: #3b82f6;
    --info-light: rgba(59, 130, 246, 0.1);
    
    /* Blur strength */
    --blur-strength: 12px;
}

[data-theme="dark"] {
    /* Dark Theme Palette */
    --bg-main: #090d16;
    --bg-surface: rgba(15, 23, 42, 0.7);
    --bg-surface-opaque: #0f172a;
    --bg-sidebar: #070a10;
    --bg-card: rgba(30, 41, 59, 0.45);
    --border-color: rgba(255, 255, 255, 0.05);
    --border-color-strong: rgba(255, 255, 255, 0.12);
    
    --text-main: #f1f5f9;
    --text-muted: #94a3b8;
    --text-inverse: #0f172a;
    
    --primary: #ffffff;
    --primary-light: #f1f5f9;
    --accent: #06b6d4;
    --accent-hover: #22d3ee;
    --accent-glow: rgba(34, 211, 238, 0.25);
    
    --shadow-md: 0 10px 25px rgba(0, 0, 0, 0.2);
    --shadow-lg: 0 20px 40px rgba(0, 0, 0, 0.35);
    --shadow-glass: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
}

/* 2. BASE RESET & GENERAL STYLES */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    outline: none;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: var(--font-secondary);
    background-color: var(--bg-main);
    color: var(--text-main);
    min-height: 100vh;
    overflow-x: hidden;
    transition: background-color var(--transition-normal), color var(--transition-normal);
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-primary);
    font-weight: 600;
    color: var(--text-main);
    letter-spacing: -0.02em;
}

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

/* Scrollbar Customization */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: var(--border-color-strong);
    border-radius: var(--radius-sm);
}
::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* Glassmorphism utility */
.glass {
    background: var(--bg-card);
    backdrop-filter: blur(var(--blur-strength)) saturate(180%);
    -webkit-backdrop-filter: blur(var(--blur-strength)) saturate(180%);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-glass);
}

.hidden {
    display: none !important;
}

/* 3. COMMON BUTTON & FORM ELEMENTS */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.65rem 1.25rem;
    font-family: var(--font-primary);
    font-size: 0.875rem;
    font-weight: 500;
    border-radius: var(--radius-md);
    border: 1px solid transparent;
    cursor: pointer;
    transition: all var(--transition-fast);
    gap: 0.5rem;
    user-select: none;
}

.btn-sm {
    padding: 0.4rem 0.85rem;
    font-size: 0.75rem;
    border-radius: var(--radius-sm);
}

.btn-primary {
    background-color: var(--accent);
    color: #ffffff;
    box-shadow: 0 4px 14px var(--accent-glow);
}
.btn-primary:hover {
    background-color: var(--accent-hover);
    transform: translateY(-1px);
    box-shadow: 0 6px 18px var(--accent-glow);
}
.btn-primary:active {
    transform: translateY(0);
}

.btn-secondary {
    background-color: var(--bg-surface-opaque);
    color: var(--text-main);
    border-color: var(--border-color-strong);
}
.btn-secondary:hover {
    background-color: var(--bg-main);
    border-color: var(--text-muted);
}

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

.btn-ghost i[data-lucide="x"],
.btn-ghost svg,
.btn-modal-close i[data-lucide="x"],
.btn-modal-close svg {
    color: #000000 !important;
    stroke: #000000 !important;
}

.btn-modal-close {
    overflow: visible;
    width: 60px !important;
    height: 60px !important;
}

.btn-modal-close svg {
    width: 50px !important;
    height: 50px !important;
    stroke-width: 2 !important;
}

#btn-modal-status-close {
    width: 50px !important;
    height: 50px !important;
}

#btn-modal-status-close svg {
    width: 40px !important;
    height: 40px !important;
    stroke-width: 2 !important;
}

.btn-danger {
    background-color: var(--danger);
    color: #ffffff;
    box-shadow: 0 4px 10px var(--danger-light);
}
.btn-danger:hover {
    background-color: #dc2626;
    transform: translateY(-1px);
}

.btn-block {
    display: flex;
    width: 100%;
}

.btn-circle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: var(--radius-circle);
    border: 1px solid var(--border-color);
    background-color: var(--bg-surface-opaque);
    color: var(--text-main);
    cursor: pointer;
    transition: all var(--transition-fast);
}
.btn-circle:hover {
    background-color: var(--border-color);
    transform: scale(1.05);
}

.btn-circle.btn-sm {
    width: 32px;
    height: 32px;
}

.btn-text {
    background: none;
    border: none;
    color: var(--accent);
    cursor: pointer;
    font-weight: 500;
    font-size: 0.85rem;
    transition: color var(--transition-fast);
}
.btn-text:hover {
    color: var(--accent-hover);
    text-decoration: underline;
}

.form-group {
    margin-bottom: 1.25rem;
}

.form-group label {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 0.45rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.required {
    color: var(--danger);
}

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

.input-icon {
    position: absolute;
    left: 12px;
    width: 18px;
    height: 18px;
    color: var(--text-muted);
    pointer-events: none;
}

.form-control, .form-select, .form-textarea {
    width: 100%;
    padding: 0.65rem 0.85rem;
    font-family: var(--font-secondary);
    font-size: 0.9rem;
    color: var(--text-main);
    background-color: var(--bg-surface-opaque);
    border: 1px solid var(--border-color-strong);
    border-radius: var(--radius-md);
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.input-wrapper .form-control {
    padding-left: 2.6rem;
}

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

/* Checkbox design styling */
.checkbox-container {
    display: flex;
    align-items: center;
    position: relative;
    padding-left: 28px;
    cursor: pointer;
    font-size: 0.85rem;
    user-select: none;
    color: var(--text-main);
}
.checkbox-container input {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 0;
    width: 0;
}
.checkmark {
    position: absolute;
    left: 0;
    height: 18px;
    width: 18px;
    background-color: var(--bg-surface-opaque);
    border: 1.5px solid var(--border-color-strong);
    border-radius: 4px;
    transition: all var(--transition-fast);
}
.checkbox-container:hover input ~ .checkmark {
    border-color: var(--accent);
}
.checkbox-container input:checked ~ .checkmark {
    background-color: var(--accent);
    border-color: var(--accent);
}
.checkmark:after {
    content: "";
    position: absolute;
    display: none;
}
.checkbox-container input:checked ~ .checkmark:after {
    display: block;
}
.checkbox-container .checkmark:after {
    left: 5px;
    top: 2px;
    width: 4px;
    height: 8px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

/* Badges system */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.6rem;
    font-size: 0.72rem;
    font-weight: 600;
    border-radius: 9999px;
    text-transform: uppercase;
}
.badge-role {
    font-size: 0.65rem;
    font-weight: 700;
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
    background-color: var(--border-color-strong);
    color: var(--text-main);
}
.role-super_admin {
    background-color: #ede9fe;
    color: #6d28d9;
}
.role-admin {
    background-color: var(--accent-glow);
    color: var(--accent-hover);
}
.role-staff {
    background-color: #d1fae5;
    color: #065f46;
}
.role-viewer {
    background-color: #f1f5f9;
    color: #475569;
}

/* CRM Status badges */
.status-badge {
    font-weight: 600;
    padding: 0.25rem 0.5rem;
    border-radius: 6px;
    font-size: 0.75rem;
}
.status-new { background-color: #e0f2fe; color: #0369a1; }
.status-contacted { background-color: #e0f7fa; color: #00838f; }
.status-qualified { background-color: #f3e5f5; color: #6a1b9a; }
.status-proposal { background-color: #fff8e1; color: #b7791f; }
.status-negotiating { background-color: #fff3e0; color: #e65100; }
.status-won { background-color: #d1fae5; color: #065f46; }
.status-lost { background-color: #ffebee; color: #c62828; }
/* CRM statuses */
.status-phat_sinh  { background-color: #e0f2fe; color: #0369a1; }
.status-di_xem     { background-color: #e0f7fa; color: #00838f; }
.status-da_giu_cho { background-color: #f3e5f5; color: #6a1b9a; }
.status-da_dat_coc { background-color: #fff3e0; color: #e65100; }
.status-thanh_cong { background-color: #d1fae5; color: #065f46; }

/* FILE UPLOAD */
.file-upload-zone {
    border: 2px dashed var(--border-color);
    border-radius: 12px;
    padding: 1.5rem 1rem;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
}
.file-upload-zone:hover, .file-upload-zone.dragover {
    border-color: #06b6d4;
    background: rgba(6,182,212,0.05);
}
.file-upload-icon { width: 32px; height: 32px; color: var(--text-muted); margin-bottom: 8px; }
.file-upload-text { font-size: 0.875rem; color: var(--text-main); margin: 0 0 4px; }
.file-upload-link { color: #06b6d4; font-weight: 600; text-decoration: underline; cursor: pointer; }
.file-upload-hint { font-size: 0.75rem; color: var(--text-muted); margin: 0; }
.file-preview-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    border-radius: 8px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    margin-top: 8px;
    font-size: 0.85rem;
}
.file-preview-item .file-preview-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-preview-item .file-preview-size { color: var(--text-muted); font-size: 0.75rem; white-space: nowrap; }
.file-preview-remove { background: none; border: none; cursor: pointer; color: #ef4444; padding: 2px; display: flex; align-items: center; }

/* 4. TOAST NOTIFICATIONS */
.toast-container {
    position: fixed;
    top: 24px;
    right: 24px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-width: 360px;
    width: 100%;
}

.toast {
    display: flex;
    align-items: flex-start;
    padding: 1rem;
    border-radius: var(--radius-lg);
    background: var(--bg-surface-opaque);
    box-shadow: var(--shadow-lg);
    border-left: 5px solid var(--accent);
    animation: toast-in 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55) forwards;
    transition: all var(--transition-normal);
}

@keyframes toast-in {
    from {
        transform: translateX(100%) scale(0.9);
        opacity: 0;
    }
    to {
        transform: translateX(0) scale(1);
        opacity: 1;
    }
}

.toast.toast-success { border-left-color: var(--success); }
.toast.toast-danger { border-left-color: var(--danger); }
.toast.toast-warning { border-left-color: var(--warning); }
.toast.toast-info { border-left-color: var(--info); }

.toast-icon-box {
    margin-right: 12px;
    flex-shrink: 0;
}
.toast.toast-success .toast-icon-box { color: var(--success); }
.toast.toast-danger .toast-icon-box { color: var(--danger); }
.toast.toast-warning .toast-icon-box { color: var(--warning); }
.toast.toast-info .toast-icon-box { color: var(--info); }

.toast-content {
    flex-grow: 1;
}
.toast-title {
    font-weight: 600;
    font-size: 0.875rem;
    margin-bottom: 0.15rem;
}
.toast-message {
    font-size: 0.8rem;
    color: var(--text-muted);
}
.toast-close {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 2px;
    margin-left: 8px;
}
.toast-close:hover {
    color: var(--text-main);
}

/* 5. AUTHENTICATION SCREENS LAYOUT */
.auth-container {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 24px;
    background: radial-gradient(circle at 10% 20%, rgba(6, 182, 212, 0.05) 0%, transparent 40%),
                radial-gradient(circle at 90% 80%, rgba(16, 185, 129, 0.03) 0%, transparent 40%),
                var(--bg-main);
}

.auth-card {
    max-width: 420px;
    width: 100%;
    padding: 2.5rem;
    border-radius: var(--radius-xl);
    animation: fade-up 0.5s ease;
}

@keyframes fade-up {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.auth-header {
    text-align: center;
    margin-bottom: 2rem;
}

.auth-logo-img {
    width: 110px;
    height: 110px;
    object-fit: contain;
    margin-bottom: 0.75rem;
    filter: drop-shadow(0 6px 20px rgba(212, 175, 55, 0.35));
    animation: logo-float 3s ease-in-out infinite;
}

@keyframes logo-float {
    0%, 100% { transform: translateY(0px); }
    50%       { transform: translateY(-5px); }
}

.logo-wrapper {
    display: inline-flex;
    align-items: center;
    gap: 0.65rem;
    margin-bottom: 1.5rem;
}

.logo-icon-box {
    width: 38px;
    height: 38px;
    background-color: var(--accent);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-primary);
    font-weight: 800;
    font-size: 1.1rem;
    border-radius: var(--radius-md);
    box-shadow: 0 4px 10px var(--accent-glow);
}

.logo-text {
    font-family: var(--font-primary);
    font-weight: 800;
    font-size: 1.15rem;
    color: var(--text-main);
    letter-spacing: 0.05em;
}

.logo-sub {
    color: var(--accent);
    font-weight: 500;
}

.auth-header h2 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

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

.auth-form {
    margin-bottom: 1.5rem;
}

.label-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.45rem;
}
.label-row label {
    margin-bottom: 0;
}

.password-toggle {
    position: absolute;
    right: 12px;
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
}
.password-toggle:hover {
    color: var(--text-main);
}

.remember-row {
    margin-bottom: 1.5rem;
}

.error-msg {
    display: block;
    color: var(--danger);
    font-size: 0.75rem;
    margin-top: 0.35rem;
}

.demo-accounts {
    border-top: 1px dashed var(--border-color-strong);
    padding-top: 1.25rem;
    margin-top: 1.25rem;
}
.demo-title {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 0.65rem;
    text-transform: uppercase;
}
.demo-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
.demo-badge {
    cursor: pointer;
    background-color: var(--border-color);
    color: var(--text-main);
    transition: all var(--transition-fast);
}
.demo-badge:hover {
    background-color: var(--accent);
    color: #ffffff;
}

/* ==========================================
   PREMIUM AUTH FLOATING LABEL INPUTS
   ========================================== */

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

.auth-input-wrap .input-icon {
    position: absolute;
    left: 15px;
    width: 18px;
    height: 18px;
    color: var(--text-muted);
    pointer-events: none;
    transition: color 0.22s ease;
    z-index: 1;
}

.auth-input-wrap input {
    width: 100%;
    height: 58px;
    padding: 1.35rem 1rem 0.45rem 3rem;
    font-family: var(--font-secondary);
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-main);
    background: var(--bg-surface-opaque);
    border: 1.5px solid var(--border-color-strong);
    border-radius: var(--radius-md);
    transition: border-color 0.25s ease, box-shadow 0.25s ease, background 0.25s ease;
    outline: none;
    letter-spacing: 0.01em;
}

.auth-input-wrap input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 4px var(--accent-glow), 0 2px 20px rgba(6, 182, 212, 0.13);
    background: rgba(6, 182, 212, 0.025);
}

/* Float label: default — vertically centered, full size */
.auth-input-wrap .float-label {
    position: absolute;
    left: 3rem;
    top: 50%;
    transform: translateY(-50%);
    font-family: var(--font-secondary);
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-muted);
    letter-spacing: 0.01em;
    text-transform: none;
    margin-bottom: 0;
    display: block;
    pointer-events: none;
    transition: top 0.22s cubic-bezier(0.4, 0, 0.2, 1),
                transform 0.22s cubic-bezier(0.4, 0, 0.2, 1),
                font-size 0.22s cubic-bezier(0.4, 0, 0.2, 1),
                color 0.22s ease,
                font-weight 0.22s ease;
    white-space: nowrap;
    z-index: 1;
}

/* Float label: floated up when filled or focused */
.auth-input-wrap input:not(:placeholder-shown) ~ .float-label,
.auth-input-wrap input:focus ~ .float-label {
    top: 10px;
    transform: none;
    font-size: 0.68rem;
    font-weight: 700;
    color: var(--text-muted);
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

/* Accent color when actively focused */
.auth-input-wrap input:focus ~ .float-label {
    color: var(--accent);
}

/* Icon turns accent on focus — :has() for modern browsers */
.auth-input-wrap:has(input:focus) .input-icon {
    color: var(--accent);
}

/* Password toggle button */
.auth-input-wrap .password-toggle {
    position: absolute;
    right: 12px;
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 6px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    transition: color 0.2s ease, background 0.2s ease;
    z-index: 1;
}

.auth-input-wrap .password-toggle:hover {
    color: var(--accent);
    background: var(--accent-glow);
}

/* Extra right padding for password input with toggle */
.auth-input-wrap input.has-toggle {
    padding-right: 3rem;
}

/* Error state */
.auth-input-wrap.input-error input {
    border-color: var(--danger);
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.12);
}

.auth-input-wrap.input-error .float-label {
    color: var(--danger) !important;
}

.auth-input-wrap.input-error .input-icon {
    color: var(--danger);
}

/* Forgot password link — anchored below the password wrapper */
.auth-forgot-link {
    display: block;
    text-align: right;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--accent);
    text-decoration: none;
    margin-top: 0.55rem;
    opacity: 0.85;
    transition: opacity 0.18s ease;
}

.auth-forgot-link:hover {
    opacity: 1;
}

/* 6. PRIMARY CRM APPLICATION LAYOUT */
.app-container {
    display: flex;
    min-height: 100vh;
}

/* Sidebar Styling */
.sidebar {
    width: 260px;
    height: 100vh;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 100;
    display: flex;
    flex-direction: column;
    background-color: var(--bg-sidebar);
    border-right: 1px solid var(--border-color);
    box-shadow: none;
    backdrop-filter: none;
    border-radius: 0;
    transition: width var(--transition-normal);
}

/* Force dark-mode texts in sidebar as it's always dark navy in specification */
.sidebar, .sidebar h4, .sidebar .logo-text, .sidebar span, .sidebar a {
    color: #f1f5f9;
}
.sidebar .logo-sub {
    color: var(--accent);
}
.sidebar .logo-icon-box {
    background-color: var(--accent);
}

.sidebar-logo-img {
    width: 36px;
    height: 36px;
    object-fit: contain;
    flex-shrink: 0;
    filter: drop-shadow(0 2px 6px rgba(212, 175, 55, 0.4));
}

.sidebar-header {
    padding: 1.5rem 1.25rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.btn-sidebar-toggle {
    background: none;
    border: none;
    color: #94a3b8;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4px;
    border-radius: 4px;
}
.btn-sidebar-toggle:hover {
    background-color: rgba(255, 255, 255, 0.08);
    color: #ffffff;
}

.user-profile-summary {
    padding: 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    overflow: hidden;
}

.avatar-container {
    position: relative;
    flex-shrink: 0;
}
.avatar-container img, .header-profile img {
    width: 42px;
    height: 42px;
    border-radius: var(--radius-circle);
    object-fit: cover;
    border: 2px solid var(--accent);
}
.status-indicator {
    position: absolute;
    bottom: 2px;
    right: 2px;
    width: 10px;
    height: 10px;
    border-radius: var(--radius-circle);
    border: 2px solid var(--bg-sidebar);
}
.status-indicator.online { background-color: var(--success); }

.user-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
}
.user-info h4 {
    font-size: 0.85rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.user-info .badge-role {
    align-self: flex-start;
    margin-top: 0.25rem;
    font-size: 0.6rem;
    color: #ffffff;
    background-color: rgba(255, 255, 255, 0.15);
}

.sidebar-nav {
    flex-grow: 1;
    padding: 1.25rem 0.75rem;
    overflow-y: auto;
}

.nav-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.nav-item a {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 0.85rem;
    border-radius: var(--radius-md);
    font-family: var(--font-primary);
    font-size: 0.875rem;
    font-weight: 500;
    color: #94a3b8;
    transition: all var(--transition-fast);
}

.nav-item i {
    width: 18px;
    height: 18px;
    color: #94a3b8;
    transition: color var(--transition-fast);
}

.nav-item:hover a {
    background-color: rgba(255, 255, 255, 0.04);
    color: #ffffff;
}
.nav-item:hover i {
    color: var(--accent);
}

.nav-item.active a {
    background-color: var(--accent);
    color: #ffffff;
}
.nav-item.active i {
    color: #ffffff;
}

.sidebar-footer {
    padding: 1.25rem 0.75rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}
.btn-logout {
    display: flex;
    width: 100%;
    background: transparent;
    border: none;
    color: #94a3b8;
    padding: 0.75rem 0.85rem;
    border-radius: var(--radius-md);
    cursor: pointer;
    font-family: var(--font-primary);
    font-size: 0.875rem;
    font-weight: 500;
    align-items: center;
    gap: 0.75rem;
    transition: all var(--transition-fast);
}
.btn-logout:hover {
    background-color: rgba(239, 68, 68, 0.1);
    color: #ef4444;
}

/* Collapsed Sidebar */
.sidebar.collapsed {
    width: 72px;
}
.sidebar.collapsed .logo-text,
.sidebar.collapsed .btn-sidebar-toggle i,
.sidebar.collapsed .user-info,
.sidebar.collapsed .nav-item span,
.sidebar.collapsed .btn-logout span {
    display: none;
}
.sidebar.collapsed .btn-sidebar-toggle {
    transform: rotate(180deg);
    margin: 0 auto;
}
.sidebar.collapsed .logo-wrapper {
    margin-bottom: 0;
}
.sidebar.collapsed .sidebar-header {
    justify-content: center;
}

/* Header & Main Area */
.main-content {
    margin-left: 260px;
    flex-grow: 1;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    transition: margin-left var(--transition-normal);
}

.sidebar.collapsed ~ .main-content {
    margin-left: 72px;
}

.main-header {
    height: 70px;
    position: sticky;
    top: 0;
    z-index: 90;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 2rem;
    border-bottom: 1px solid var(--border-color);
    border-radius: 0;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.btn-sidebar-mobile-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--text-main);
    cursor: pointer;
}

.breadcrumb {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-family: var(--font-primary);
    font-size: 0.85rem;
}
.breadcrumb-parent {
    color: var(--text-muted);
    font-weight: 500;
}
.breadcrumb-separator {
    width: 14px;
    height: 14px;
    color: var(--text-muted);
}
.breadcrumb-current {
    color: var(--text-main);
    font-weight: 600;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 1.25rem;
}

.relative { position: relative; }
.notification-badge {
    position: absolute;
    top: -2px;
    right: -2px;
    background-color: var(--danger);
    color: #ffffff;
    font-size: 0.65rem;
    font-weight: 700;
    min-width: 16px;
    height: 16px;
    border-radius: var(--radius-circle);
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--bg-surface-opaque);
}

.header-profile {
    display: flex;
    align-items: center;
    gap: 0.65rem;
}
.profile-meta {
    display: flex;
    flex-direction: column;
}
.profile-meta span {
    font-size: 0.85rem;
    font-weight: 600;
}
.header-role {
    font-size: 0.68rem;
    color: var(--text-muted);
}

.view-container {
    padding: 2rem;
    flex-grow: 1;
    animation: fade-in 0.4s ease;
}

@keyframes fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

.view-panel {
    animation: fade-up-short 0.4s ease;
}

@keyframes fade-up-short {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.view-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 2rem;
}

.title-area h1 {
    font-size: 1.75rem;
    margin-bottom: 0.25rem;
}
.title-area p {
    font-size: 0.875rem;
    color: var(--text-muted);
}

.action-area {
    display: flex;
    gap: 0.75rem;
}

/* 7. DASHBOARD VIEW PANELS */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    padding: 1.5rem;
    border-radius: var(--radius-lg);
    transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}
.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.stat-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1.25rem;
}

.stat-label {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.stat-value {
    font-size: 1.85rem;
    font-weight: 700;
    margin-top: 0.25rem;
}

.stat-icon-box {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
}
.stat-icon-box.primary { background-color: var(--accent-glow); color: var(--accent); }
.stat-icon-box.accent { background-color: rgba(59, 130, 246, 0.1); color: var(--info); }
.stat-icon-box.success { background-color: var(--success-light); color: var(--success); }
.stat-icon-box.danger { background-color: var(--danger-light); color: var(--danger); }

.stat-card-footer {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.78rem;
}

.trend {
    display: inline-flex;
    align-items: center;
    font-weight: 600;
    gap: 2px;
}
.trend i {
    width: 14px;
    height: 14px;
}
.trend-up { color: var(--success); }
.trend-down { color: var(--danger); }
.trend-desc { color: var(--text-muted); }

/* Charts */
.charts-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.chart-card {
    padding: 1.5rem;
    border-radius: var(--radius-lg);
}

.chart-card.full-width {
    grid-column: span 2;
}

.chart-card-header {
    margin-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.75rem;
}
.chart-card-header h3 {
    font-size: 1rem;
}

.chart-body {
    position: relative;
    width: 100%;
}

/* Dual Lists */
.dashboard-lists {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

.list-card {
    padding: 1.5rem;
    border-radius: var(--radius-lg);
}

.list-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.25rem;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.75rem;
}
.list-card-header h3 {
    font-size: 1rem;
}

.simple-table-wrapper {
    overflow-x: auto;
}
.simple-table {
    width: 100%;
    border-collapse: collapse;
}
.simple-table th {
    text-align: left;
    padding: 0.65rem 0.5rem;
    font-size: 0.75rem;
    text-transform: uppercase;
    color: var(--text-muted);
    font-weight: 600;
    border-bottom: 1.5px solid var(--border-color);
}
.simple-table td {
    padding: 0.85rem 0.5rem;
    font-size: 0.85rem;
    border-bottom: 1px solid var(--border-color);
}

/* Timeline */
.activity-timeline {
    position: relative;
    padding-left: 20px;
}
.activity-timeline::before {
    content: "";
    position: absolute;
    left: 4px;
    top: 6px;
    bottom: 6px;
    width: 2px;
    background-color: var(--border-color);
}
.timeline-item {
    position: relative;
    margin-bottom: 1rem;
}
.timeline-item:last-child {
    margin-bottom: 0;
}
.timeline-dot {
    position: absolute;
    left: -20px;
    top: 4px;
    width: 10px;
    height: 10px;
    border-radius: var(--radius-circle);
    background-color: var(--accent);
    border: 2px solid var(--bg-surface-opaque);
}
.timeline-dot.danger { background-color: var(--danger); }
.timeline-dot.success { background-color: var(--success); }
.timeline-dot.warning { background-color: var(--warning); }

.timeline-content {
    font-size: 0.8rem;
}
.timeline-desc {
    color: var(--text-main);
    line-height: 1.4;
}
.timeline-time {
    display: block;
    font-size: 0.72rem;
    color: var(--text-muted);
    margin-top: 0.15rem;
}

/* 8. DATA TABLES & FILTERS */
.filter-bar {
    padding: 1rem 1.5rem;
    border-radius: var(--radius-lg);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.search-box {
    position: relative;
    display: flex;
    align-items: center;
    flex-grow: 1;
    max-width: 400px;
}
.search-icon {
    position: absolute;
    left: 12px;
    width: 16px;
    height: 16px;
    color: var(--text-muted);
}
.search-box input {
    width: 100%;
    padding: 0.55rem 0.85rem 0.55rem 2.4rem;
    font-size: 0.875rem;
    border-radius: var(--radius-md);
    background-color: var(--bg-surface-opaque);
    border: 1px solid var(--border-color-strong);
    color: var(--text-main);
}

.filter-controls {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.filter-controls .form-select {
    padding: 0.55rem 1.5rem 0.55rem 0.75rem;
    font-size: 0.85rem;
    border-radius: var(--radius-md);
    width: auto;
    min-width: 160px;
}

.table-card {
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.table-container {
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}

.data-table th {
    background-color: var(--bg-surface-opaque);
    padding: 0.85rem 1.25rem;
    font-family: var(--font-primary);
    font-weight: 600;
    font-size: 0.78rem;
    color: var(--text-muted);
    text-transform: uppercase;
    text-align: left;
    border-bottom: 2px solid var(--border-color);
    letter-spacing: 0.02em;
}

.data-table th.sortable {
    cursor: pointer;
    user-select: none;
}
.data-table th.sortable:hover {
    color: var(--text-main);
    background-color: var(--border-color);
}
.sort-icon {
    display: inline-block;
    width: 12px;
    height: 12px;
    margin-left: 4px;
    vertical-align: middle;
}

.data-table td {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border-color);
    vertical-align: middle;
}

.data-table tbody tr {
    transition: background-color var(--transition-fast);
}

.data-table tbody tr:hover {
    background-color: rgba(6, 182, 212, 0.02);
}

.col-checkbox {
    width: 48px;
    text-align: center !important;
}

.col-actions {
    text-align: right !important;
    width: 120px;
}

.table-action-buttons {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
}
.table-action-buttons .btn-circle svg {
    width: 50px !important;
    height: 50px !important;
}
.table-action-buttons .btn-circle {
    width: 60px !important;
    height: 60px !important;
    overflow: visible;
}
.table-action-buttons .btn-record-edit {
    background-color: #e0f2fe;
    border-color: #06b6d4;
    color: #0369a1;
}
.table-action-buttons .btn-record-edit:hover {
    background-color: #06b6d4;
    color: #ffffff;
    transform: scale(1.08);
}
.table-action-buttons .btn-record-delete {
    background-color: #fee2e2;
    border-color: #ef4444;
    color: #dc2626;
}
.table-action-buttons .btn-record-delete:hover {
    background-color: #ef4444;
    color: #ffffff;
    transform: scale(1.08);
}

/* Pagination */
.table-pagination {
    padding: 1rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: var(--bg-surface-opaque);
    border-top: 1px solid var(--border-color);
}

.pagination-info {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.pagination-controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.pagination-pages {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.pagination-pages .btn-page {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color-strong);
    background: transparent;
    color: var(--text-main);
    cursor: pointer;
    font-weight: 600;
    font-size: 0.8rem;
    transition: all var(--transition-fast);
}
.pagination-pages .btn-page:hover {
    background-color: var(--border-color);
}
.pagination-pages .btn-page.active {
    background-color: var(--accent);
    color: #ffffff;
    border-color: var(--accent);
}

/* Bulk Actions Bar */
.bulk-actions-bar {
    background-color: var(--accent-glow);
    border: 1.5px solid var(--accent);
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.25rem;
    animation: slide-down 0.25s ease forwards;
}

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

.bulk-actions-bar span {
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--text-main);
}
.bulk-buttons {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.bulk-buttons .form-select-sm {
    padding-top: 0.3rem;
    padding-bottom: 0.3rem;
    font-size: 0.78rem;
    width: auto;
}

/* 9. USER CARDS GRID */
.users-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}

.user-card {
    padding: 1.5rem;
    border-radius: var(--radius-lg);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    position: relative;
    transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}
.user-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.user-card-status {
    position: absolute;
    top: 1rem;
    right: 1rem;
}

.user-card-avatar {
    width: 72px;
    height: 72px;
    border-radius: var(--radius-circle);
    object-fit: cover;
    border: 3px solid var(--accent);
    margin-bottom: 1rem;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

.user-card-name {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.15rem;
}

.user-card-email {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 0.75rem;
}

.user-card-role {
    margin-bottom: 1.25rem;
}

.user-card-actions {
    display: flex;
    gap: 0.5rem;
    width: 100%;
    border-top: 1px solid var(--border-color);
    padding-top: 1rem;
    margin-top: auto;
}

.user-card-actions button {
    flex: 1;
}

/* 10. ROLE PERMISSION MATRIX TABLE */
.permission-matrix-card {
    border-radius: var(--radius-lg);
    padding: 1.5rem;
}

.permission-tabs {
    display: flex;
    gap: 0.5rem;
    border-bottom: 1.5px solid var(--border-color);
    padding-bottom: 1rem;
    margin-bottom: 1.5rem;
}

.permission-tab-btn {
    padding: 0.5rem 1.25rem;
    font-family: var(--font-primary);
    font-size: 0.875rem;
    font-weight: 600;
    border: none;
    background: none;
    cursor: pointer;
    color: var(--text-muted);
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
}

.permission-tab-btn:hover {
    background-color: var(--border-color);
    color: var(--text-main);
}

.permission-tab-btn.active {
    background-color: var(--accent);
    color: #ffffff;
}

.matrix-description {
    background-color: var(--bg-main);
    padding: 1rem;
    border-radius: var(--radius-md);
    margin-bottom: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}
.warning-badge {
    color: var(--warning);
    font-size: 0.78rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.permission-table {
    width: 100%;
    border-collapse: collapse;
}

.permission-table th {
    background-color: var(--bg-surface-opaque);
    padding: 0.75rem 1rem;
    font-weight: 600;
    font-size: 0.8rem;
    color: var(--text-muted);
    border-bottom: 2px solid var(--border-color);
}

.permission-table td {
    padding: 0.85rem 1rem;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.85rem;
}

.permission-table tr:hover {
    background-color: rgba(6, 182, 212, 0.01);
}

.text-center {
    text-align: center !important;
}

/* 11. FILE MANAGER GRID */
.file-manager-layout {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.upload-sidebar {
    padding: 1.5rem;
    border-radius: var(--radius-lg);
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    height: fit-content;
}

.drop-zone {
    border: 2px dashed var(--border-color-strong);
    border-radius: var(--radius-lg);
    padding: 2rem 1rem;
    text-align: center;
    background-color: rgba(255,255,255,0.02);
    cursor: pointer;
    transition: all var(--transition-fast);
}
.drop-zone:hover, .drop-zone.dragover {
    border-color: var(--accent);
    background-color: var(--accent-glow);
}

.upload-icon {
    width: 40px;
    height: 40px;
    color: var(--text-muted);
    margin-bottom: 0.75rem;
}

.upload-text {
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-main);
}
.upload-or {
    display: block;
    font-size: 0.72rem;
    color: var(--text-muted);
    margin: 0.4rem 0;
}

.upload-limits ul {
    list-style: none;
    padding: 0;
    font-size: 0.72rem;
    color: var(--text-muted);
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.upload-limits li::before {
    content: "•";
    color: var(--accent);
    margin-right: 6px;
    font-weight: bold;
}

.upload-progress-list {
    border-top: 1px solid var(--border-color);
    padding-top: 1rem;
}
.upload-progress-list h4 {
    font-size: 0.8rem;
    margin-bottom: 0.75rem;
}

.progress-item {
    font-size: 0.75rem;
    margin-bottom: 0.75rem;
}
.progress-name-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.25rem;
    font-weight: 500;
}
.progress-bar-bg {
    height: 4px;
    background-color: var(--border-color);
    border-radius: var(--radius-sm);
    overflow: hidden;
}
.progress-bar-fill {
    height: 100%;
    background-color: var(--accent);
    width: 0%;
    transition: width 0.1s linear;
}

.files-content-area {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.files-filter-bar {
    padding: 0.75rem 1.25rem;
    border-radius: var(--radius-md);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

.file-type-filters {
    display: flex;
    gap: 4px;
}

.files-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 1.25rem;
}

.file-card {
    border-radius: var(--radius-md);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}
.file-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.file-card-preview {
    height: 110px;
    position: relative;
    background-color: var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}
.file-card-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.file-type-icon {
    width: 38px;
    height: 38px;
    color: var(--text-muted);
}

.file-card-overlay {
    position: absolute;
    inset: 0;
    background-color: rgba(15, 23, 42, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    opacity: 0;
    transition: opacity var(--transition-fast);
}
.file-card:hover .file-card-overlay {
    opacity: 1;
}

.file-card-info {
    padding: 0.75rem;
    background-color: var(--bg-surface-opaque);
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.file-card-title {
    font-size: 0.8rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.file-card-meta {
    font-size: 0.7rem;
    color: var(--text-muted);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 4px;
}
.file-card-customer {
    font-size: 0.72rem;
    color: #0891b2;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.file-size-tag {
    font-size: 0.68rem;
    color: var(--text-muted);
    background: var(--bg-secondary);
    border-radius: 4px;
    padding: 1px 5px;
    align-self: flex-start;
}

.files-empty {
    text-align: center;
    padding: 4rem 1rem;
    color: var(--text-muted);
}
.files-empty i {
    width: 48px;
    height: 48px;
    margin-bottom: 1rem;
}

/* 12. DIALOG MODAL LAYOUT */
.modal-overlay {
    position: fixed;
    inset: 0;
    background-color: rgba(15, 23, 42, 0.4);
    backdrop-filter: blur(4px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    animation: fade-in 0.25s ease forwards;
}

.modal-card {
    max-width: 580px;
    width: 100%;
    border-radius: var(--radius-xl);
    padding: 2rem;
    max-height: 90vh;
    overflow-y: auto;
    animation: slide-up 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.modal-card-lg {
    max-width: 800px;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 1rem;
    margin-bottom: 1.5rem;
}
.modal-header h2 {
    font-size: 1.25rem;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem;
}

.form-autosave-status {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.72rem;
    color: var(--success);
    margin-bottom: 1rem;
    font-weight: 500;
    opacity: 0;
    transition: opacity 0.3s ease;
}
.form-autosave-status.visible {
    opacity: 1;
}

.modal-footer {
    border-top: 1px solid var(--border-color);
    padding-top: 1.25rem;
    margin-top: 1.5rem;
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
}

.avatar-select-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.75rem;
    margin-top: 0.5rem;
}
.avatar-option {
    cursor: pointer;
    position: relative;
    border-radius: var(--radius-md);
    overflow: hidden;
    display: block;
    aspect-ratio: 1;
}
.avatar-option input {
    position: absolute;
    opacity: 0;
}
.avatar-option img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border: 2px solid transparent;
    border-radius: var(--radius-md);
    transition: border-color var(--transition-fast);
}
.avatar-option input:checked ~ img {
    border-color: var(--accent);
}

.file-preview-body {
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: #0b0f19;
    padding: 1.5rem;
    border-radius: var(--radius-lg);
    min-height: 350px;
}
.file-preview-body img {
    max-width: 100%;
    max-height: 500px;
    object-fit: contain;
}
.file-preview-pdf-mock {
    color: #ffffff;
    text-align: center;
}
.file-preview-pdf-mock i {
    width: 64px;
    height: 64px;
    color: var(--danger);
    margin-bottom: 1rem;
}

/* 13. SETTINGS & TAB PANES */
.settings-layout {
    display: grid;
    grid-template-columns: 240px 1fr;
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.settings-sidebar {
    padding: 1rem;
    border-radius: var(--radius-lg);
    display: flex;
    flex-direction: column;
    gap: 4px;
    height: fit-content;
}

.settings-nav-btn {
    padding: 0.7rem 1rem;
    border: none;
    background: none;
    cursor: pointer;
    font-family: var(--font-primary);
    font-weight: 500;
    font-size: 0.85rem;
    color: var(--text-muted);
    text-align: left;
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
}
.settings-nav-btn:hover {
    background-color: var(--border-color);
    color: var(--text-main);
}
.settings-nav-btn.active {
    background-color: var(--accent-glow);
    color: var(--accent);
}

.settings-tab-pane {
    animation: fade-in 0.25s ease;
}

.settings-card {
    padding: 1.5rem;
    border-radius: var(--radius-lg);
}

.card-divider {
    border: none;
    border-top: 1px solid var(--border-color);
    margin: 1.5rem 0;
}

.restore-zone {
    border: 2px dashed var(--border-color-strong);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    text-align: center;
}

/* 14. REALTIME NOTIFICATIONS SYSTEM DROPDOWN */
.notification-dropdown-wrapper {
    position: relative;
}
.notification-dropdown {
    position: absolute;
    top: 48px;
    right: 0;
    width: 320px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    z-index: 1000;
    overflow: hidden;
    animation: slide-down 0.25s ease forwards;
}

.notification-dropdown-header {
    padding: 0.85rem 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
    background-color: var(--bg-surface-opaque);
}
.notification-dropdown-header h3 {
    font-size: 0.85rem;
}

.notification-list {
    max-height: 320px;
    overflow-y: auto;
}

.notification-item {
    padding: 0.85rem 1rem;
    border-bottom: 1px solid var(--border-color);
    background-color: var(--bg-surface-opaque);
    cursor: pointer;
    transition: background-color var(--transition-fast);
}
.notification-item:hover {
    background-color: rgba(6, 182, 212, 0.02);
}
.notification-item.unread {
    background-color: rgba(6, 182, 212, 0.05);
}

.notification-item-title {
    font-size: 0.8rem;
    font-weight: 600;
    margin-bottom: 0.15rem;
}
.notification-item-msg {
    font-size: 0.75rem;
    color: var(--text-muted);
    line-height: 1.3;
}
.notification-item-time {
    display: block;
    font-size: 0.65rem;
    color: var(--text-muted);
    margin-top: 0.3rem;
}

/* 15. SKELETON LOADINGS & SPREADSHEETS */
.table-skeleton-wrapper {
    padding: 1rem 1.5rem;
}
.skeleton-row {
    height: 40px;
    background: linear-gradient(90deg, var(--border-color) 25%, var(--border-color-strong) 50%, var(--border-color) 75%);
    background-size: 200% 100%;
    animation: skeleton-shimmer 1.5s infinite linear;
    border-radius: var(--radius-sm);
    margin-bottom: 0.75rem;
}
.skeleton-row:last-child {
    margin-bottom: 0;
}
@keyframes skeleton-shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* 16. RESPONSIVE MEDIA QUERIES */

@media (max-width: 1024px) {
    /* Tablet layout shifts */
    .sidebar {
        width: 72px;
    }
    .sidebar .logo-text,
    .sidebar .btn-sidebar-toggle,
    .sidebar .user-info,
    .sidebar .nav-item span,
    .sidebar .btn-logout span {
        display: none;
    }
    .sidebar .logo-wrapper {
        margin-bottom: 0;
    }
    .sidebar .sidebar-header {
        justify-content: center;
    }
    .main-content {
        margin-left: 72px;
    }
    .sidebar.collapsed ~ .main-content {
        margin-left: 72px;
    }
    
    .charts-grid {
        grid-template-columns: 1fr;
    }
    .chart-card.full-width {
        grid-column: span 1;
    }
    .dashboard-lists {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    /* Mobile layouts */
    .btn-sidebar-mobile-toggle {
        display: block;
    }
    
    .sidebar {
        width: 260px;
        transform: translateX(-100%);
        transition: transform var(--transition-normal);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        background-color: rgba(15, 23, 42, 0.95);
    }
    
    .sidebar.mobile-open {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0 !important;
    }
    
    .main-header {
        padding: 0 1rem;
    }
    
    .breadcrumb-parent, .breadcrumb-separator {
        display: none;
    }
    
    .view-container {
        padding: 1rem;
    }
    
    .view-header {
        flex-direction: column;
        gap: 1rem;
    }
    .view-header .action-area {
        width: 100%;
    }
    .view-header .action-area button {
        flex: 1;
    }
    
    .filter-bar {
        flex-direction: column;
        align-items: stretch;
        gap: 0.75rem;
        padding: 1rem;
    }
    .search-box {
        max-width: 100%;
    }
    .filter-controls {
        flex-direction: column;
        align-items: stretch;
    }
    .filter-controls .form-select {
        min-width: 100%;
    }
    
    .form-row {
        grid-template-columns: 1fr;
        gap: 0;
    }
    
    .file-manager-layout {
        grid-template-columns: 1fr;
    }
    .settings-layout {
        grid-template-columns: 1fr;
    }
}
