/* ========================================
   CSS Custom Properties (Theme Variables)
   ======================================== */
:root {
    /* Primary Colors - Indigo (Default) */
    --primary-color: #6366f1;
    --primary-dark: #4f46e5;
    --primary-light: #818cf8;
    --primary-rgb: 99, 102, 241;

    /* Accent Colors */
    --accent-color: #6366f1;
    --accent-rgb: 99, 102, 241;

    /* Light Theme Colors */
    --background-color: #f1f5f9;
    --surface-color: #ffffff;
    --surface-hover: #f8fafc;
    --text-color: #1e293b;
    --text-secondary: #64748b;
    --border-color: #e2e8f0;
    --shadow-color: rgba(0, 0, 0, 0.1);

    /* Status Colors */
    --success-color: #22c55e;
    --warning-color: #f59e0b;
    --danger-color: #ef4444;
    --info-color: #3b82f6;

    /* Dimensions */
    --sidebar-width: 280px;
    --sidebar-collapsed-width: 80px;
    --header-height: 64px;

    /* Transitions */
    --transition-fast: 0.2s ease;
    --transition-normal: 0.3s ease;
}

/* Teal Accent */
[data-accent="teal"] {
    --primary-color: #14b8a6;
    --primary-dark: #0d9488;
    --primary-light: #2dd4bf;
    --primary-rgb: 20, 184, 166;
    --accent-color: #14b8a6;
    --accent-rgb: 20, 184, 166;
}

/* Rose Accent */
[data-accent="rose"] {
    --primary-color: #f43f5e;
    --primary-dark: #e11d48;
    --primary-light: #fb7185;
    --primary-rgb: 244, 63, 94;
    --accent-color: #f43f5e;
    --accent-rgb: 244, 63, 94;
}

/* Orange Accent */
[data-accent="orange"] {
    --primary-color: #f97316;
    --primary-dark: #ea580c;
    --primary-light: #fb923c;
    --primary-rgb: 249, 115, 22;
    --accent-color: #f97316;
    --accent-rgb: 249, 115, 22;
}

/* Purple Accent */
[data-accent="purple"] {
    --primary-color: #a855f7;
    --primary-dark: #9333ea;
    --primary-light: #c084fc;
    --primary-rgb: 168, 85, 247;
    --accent-color: #a855f7;
    --accent-rgb: 168, 85, 247;
}

/* Blue Accent */
[data-accent="blue"] {
    --primary-color: #3b82f6;
    --primary-dark: #2563eb;
    --primary-light: #60a5fa;
    --primary-rgb: 59, 130, 246;
    --accent-color: #3b82f6;
    --accent-rgb: 59, 130, 246;
}

/* Cyan Accent */
[data-accent="cyan"] {
    --primary-color: #06b6d4;
    --primary-dark: #0891b2;
    --primary-light: #22d3ee;
    --primary-rgb: 6, 182, 212;
    --accent-color: #06b6d4;
    --accent-rgb: 6, 182, 212;
}

/* Emerald Accent */
[data-accent="emerald"] {
    --primary-color: #10b981;
    --primary-dark: #059669;
    --primary-light: #34d399;
    --primary-rgb: 16, 185, 129;
    --accent-color: #10b981;
    --accent-rgb: 16, 185, 129;
}

/* Lime Accent */
[data-accent="lime"] {
    --primary-color: #84cc16;
    --primary-dark: #65a30d;
    --primary-light: #a3e635;
    --primary-rgb: 132, 204, 22;
    --accent-color: #84cc16;
    --accent-rgb: 132, 204, 22;
}

/* Violet Accent */
[data-accent="violet"] {
    --primary-color: #8b5cf6;
    --primary-dark: #7c3aed;
    --primary-light: #a78bfa;
    --primary-rgb: 139, 92, 246;
    --accent-color: #8b5cf6;
    --accent-rgb: 139, 92, 246;
}

/* Dark Theme */
[data-theme="dark"] {
    --background-color: #0f172a;
    --surface-color: #1e293b;
    --surface-hover: #334155;
    --text-color: #f1f5f9;
    --text-secondary: #94a3b8;
    --border-color: #334155;
    --shadow-color: rgba(0, 0, 0, 0.3);
}

/* ========================================
   Base Styles
   ======================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

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

@media (min-width: 768px) {
    html {
        font-size: 16px;
    }
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: var(--background-color);
    color: var(--text-color);
    line-height: 1.6;
    min-height: 100vh;
}

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

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

/* ========================================
   App Layout
   ======================================== */
.app-container {
    display: flex;
    min-height: 100vh;
}

/* ========================================
   Sidebar
   ======================================== */
.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    width: var(--sidebar-width);
    background-color: var(--surface-color);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    z-index: 1000;
    transition: transform var(--transition-normal);
}

.sidebar.collapsed {
    transform: translateX(-100%);
}

.sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 18px;
    font-weight: 700;
    color: white;
}

.logo i {
    font-size: 28px;
}

.sidebar-toggle {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    cursor: pointer;
    padding: 6px;
    border-radius: 6px;
    color: white;
    transition: all var(--transition-fast);
    display: flex;
    align-items: center;
    justify-content: center;
}

.sidebar-toggle:hover {
    background: rgba(255, 255, 255, 0.2);
    color: white;
}

.sidebar-nav {
    flex: 1;
    padding: 16px 0;
    overflow-y: auto;
}

.nav-section {
    margin-bottom: 24px;
}

.nav-section-title {
    display: block;
    padding: 8px 20px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-secondary);
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    color: var(--text-secondary);
    font-weight: 500;
    transition: all var(--transition-fast);
    position: relative;
}

.nav-item:hover {
    background-color: var(--surface-hover);
    color: var(--text-color);
}

.nav-item.active {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
}

.nav-item i {
    font-size: 22px;
    width: 24px;
}

.sidebar-footer {
    padding: 16px;
    border-top: 1px solid var(--border-color);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background-color: var(--surface-hover);
    border-radius: 12px;
}

.user-avatar {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
}

.user-details {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.user-name {
    font-weight: 600;
    font-size: 14px;
    color: var(--text-color);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-role {
    font-size: 12px;
    color: var(--text-secondary);
}

/* ========================================
   Main Content
   ======================================== */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    transition: margin-left var(--transition-normal);
    width: calc(100% - var(--sidebar-width));
}

/* When sidebar is collapsed, expand main content to full width */
.sidebar.collapsed {
    transform: translateX(-100%);
}

.sidebar.collapsed + .main-content {
    margin-left: 0;
    width: 100%;
}

body.sidebar-collapsed .main-content {
    margin-left: 0;
    width: 100%;
}

/* ========================================
   Top Header
   ======================================== */
.top-header {
    position: sticky;
    top: 0;
    height: var(--header-height);
    background-color: var(--surface-color);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    z-index: 100;
}

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

.header-menu-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    border-radius: 8px;
    color: var(--text-secondary);
    transition: all var(--transition-fast);
}

.header-menu-btn:hover {
    background-color: var(--surface-hover);
    color: var(--text-color);
}

/* Menu icon rotation when sidebar is collapsed */
.sidebar.collapsed .sidebar-toggle i,
body.sidebar-collapsed .header-menu-btn i {
    transform: rotate(180deg);
}

.breadcrumb {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-color);
}

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

.header-icon-btn {
    position: relative;
    background: none;
    border: none;
    cursor: pointer;
    padding: 10px;
    border-radius: 10px;
    color: var(--text-secondary);
    transition: all var(--transition-fast);
}

.header-icon-btn:hover {
    background-color: var(--surface-hover);
    color: var(--text-color);
}

.header-icon-btn .badge {
    position: absolute;
    top: 6px;
    right: 6px;
    background-color: var(--danger-color);
    color: white;
    font-size: 10px;
    font-weight: 600;
    padding: 2px 5px;
    border-radius: 10px;
    min-width: 18px;
    text-align: center;
}

/* Theme Switcher */
.theme-switcher {
    position: relative;
}

.theme-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 10px;
    border-radius: 10px;
    color: var(--text-secondary);
    transition: all var(--transition-fast);
}

.theme-btn:hover {
    background-color: var(--surface-hover);
    color: var(--text-color);
}

.theme-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 8px;
    background-color: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    box-shadow: 0 10px 40px var(--shadow-color);
    padding: 8px;
    min-width: 180px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all var(--transition-fast);
}

.theme-dropdown.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.theme-section {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 8px 12px 4px;
    margin-top: 8px;
    border-top: 1px solid var(--border-color);
}

.theme-option {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.theme-option:hover {
    background-color: var(--surface-hover);
}

.theme-preview {
    width: 24px;
    height: 24px;
    border-radius: 6px;
    border: 2px solid var(--border-color);
}

.theme-preview.light {
    background: linear-gradient(135deg, #f1f5f9 50%, #6366f1 50%);
}

.theme-preview.dark {
    background: linear-gradient(135deg, #1e293b 50%, #6366f1 50%);
}

.theme-preview.teal {
    background: linear-gradient(135deg, #f1f5f9 50%, #14b8a6 50%);
}

.theme-preview.rose {
    background: linear-gradient(135deg, #f1f5f9 50%, #f43f5e 50%);
}

.theme-preview.orange {
    background: linear-gradient(135deg, #f1f5f9 50%, #f97316 50%);
}

.theme-preview.purple {
    background: linear-gradient(135deg, #f1f5f9 50%, #a855f7 50%);
}

.theme-preview.blue {
    background: linear-gradient(135deg, #f1f5f9 50%, #3b82f6 50%);
}

.theme-preview.cyan {
    background: linear-gradient(135deg, #f1f5f9 50%, #06b6d4 50%);
}

.theme-preview.emerald {
    background: linear-gradient(135deg, #f1f5f9 50%, #10b981 50%);
}

.theme-preview.lime {
    background: linear-gradient(135deg, #f1f5f9 50%, #84cc16 50%);
}

.theme-preview.violet {
    background: linear-gradient(135deg, #f1f5f9 50%, #8b5cf6 50%);
}

/* ========================================
   Page Content
   ======================================== */
.page-content {
    flex: 1;
    padding: 20px 24px;
    background-color: var(--background-color);
}

.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 2px solid var(--border-color);
}

.page-title {
    font-size: 22px;
    font-weight: 700;
    color: var(--text-color);
    display: flex;
    align-items: center;
    gap: 12px;
}

.page-title i {
    color: var(--primary-color);
}

.page-actions {
    display: flex;
    gap: 12px;
}

/* ========================================
   Cards
   ======================================== */
.card {
    background-color: var(--surface-color);
    border-radius: 12px;
    box-shadow: 0 1px 3px var(--shadow-color);
    border: 1px solid var(--border-color);
    overflow: hidden;
}

.card-header {
    padding: 16px 24px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background-color: var(--surface-hover);
}

.card-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-color);
    display: flex;
    align-items: center;
    gap: 10px;
}

.card-title i {
    color: var(--primary-color);
    font-size: 20px;
}

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

.card-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--border-color);
    background-color: var(--surface-hover);
}

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

.stat-card {
    background-color: var(--surface-color);
    border-radius: 16px;
    padding: 24px;
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 16px;
    transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px var(--shadow-color);
}

.stat-icon {
    width: 56px;
    height: 56px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.stat-icon i {
    font-size: 28px;
}

.stat-icon.primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
}

.stat-icon.success {
    background: linear-gradient(135deg, var(--success-color) 0%, #16a34a 100%);
    color: white;
}

.stat-icon.warning {
    background: linear-gradient(135deg, var(--warning-color) 0%, #d97706 100%);
    color: white;
}

.stat-icon.danger {
    background: linear-gradient(135deg, var(--danger-color) 0%, #dc2626 100%);
    color: white;
}

.stat-icon.info {
    background: linear-gradient(135deg, var(--info-color) 0%, #2563eb 100%);
    color: white;
}

.stat-content {
    flex: 1;
}

.stat-label {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.stat-value {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-color);
}

.stat-change {
    font-size: 12px;
    display: flex;
    align-items: center;
    gap: 4px;
    margin-top: 4px;
}

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

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

/* ========================================
   Tables
   ======================================== */
.table-container {
    background-color: var(--surface-color);
    border-radius: 16px;
    border: 1px solid var(--border-color);
    overflow: hidden;
}

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

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

.table thead {
    background-color: var(--surface-hover);
    border-bottom: 1px solid var(--border-color);
}

.table th {
    padding: 14px 16px;
    text-align: left;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-secondary);
}

.table td {
    padding: 16px;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-color);
}

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

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

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

.table-actions {
    display: flex;
    gap: 8px;
}

.btn-icon {
    padding: 8px;
    border: none;
    background: none;
    cursor: pointer;
    border-radius: 8px;
    color: var(--text-secondary);
    transition: all var(--transition-fast);
}

.btn-icon:hover {
    background-color: var(--surface-hover);
    color: var(--primary-color);
}

/* ========================================
   Buttons
   ======================================== */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 500;
    border-radius: 10px;
    border: none;
    cursor: pointer;
    transition: all var(--transition-fast);
    text-decoration: none;
}

.btn i {
    font-size: 18px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(var(--primary-rgb), 0.4);
}

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

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

.btn-success {
    background: linear-gradient(135deg, var(--success-color) 0%, #16a34a 100%);
    color: white;
}

.btn-danger {
    background: linear-gradient(135deg, var(--danger-color) 0%, #dc2626 100%);
    color: white;
}

.btn-warning {
    background: linear-gradient(135deg, var(--warning-color) 0%, #d97706 100%);
    color: white;
}

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

.btn-lg {
    padding: 14px 28px;
    font-size: 16px;
}

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

.form-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--text-color);
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.form-control {
    width: 100%;
    padding: 12px 16px;
    font-size: 14px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    background-color: var(--surface-color);
    color: var(--text-color);
    transition: all var(--transition-fast);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(var(--primary-rgb), 0.15);
}

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

select.form-control {
    cursor: pointer;
}

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

/* Form row layout */
.form-row {
    display: grid;
    gap: 20px;
}

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

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

@media (max-width: 768px) {
    .form-row.row-2,
    .form-row.row-3 {
        grid-template-columns: 1fr;
    }
}

/* ========================================
   Badges
   ======================================== */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    font-size: 12px;
    font-weight: 600;
    border-radius: 20px;
}

.badge-primary {
    background-color: rgba(var(--primary-rgb), 0.1);
    color: var(--primary-color);
}

.badge-success {
    background-color: rgba(34, 197, 94, 0.1);
    color: var(--success-color);
}

.badge-warning {
    background-color: rgba(245, 158, 11, 0.1);
    color: var(--warning-color);
}

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

.badge-info {
    background-color: rgba(59, 130, 246, 0.1);
    color: var(--info-color);
}

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

.page-title {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-color);
}

.page-actions {
    display: flex;
    gap: 12px;
}

/* ========================================
   Responsive Design
   ======================================== */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }

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

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

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

    .page-header {
        flex-direction: column;
        gap: 16px;
    }
}

/* ========================================
   Utility Classes
   ======================================== */
.text-primary { color: var(--primary-color) !important; }
.text-success { color: var(--success-color) !important; }
.text-warning { color: var(--warning-color) !important; }
.text-danger { color: var(--danger-color) !important; }
.text-muted { color: var(--text-secondary) !important; }

.mt-0 { margin-top: 0 !important; }
.mt-1 { margin-top: 0.25rem !important; }
.mt-2 { margin-top: 0.5rem !important; }
.mt-3 { margin-top: 1rem !important; }
.mt-4 { margin-top: 1.5rem !important; }
.mb-0 { margin-bottom: 0 !important; }
.mb-1 { margin-bottom: 0.25rem !important; }
.mb-2 { margin-bottom: 0.5rem !important; }
.mb-3 { margin-bottom: 1rem !important; }
.mb-4 { margin-bottom: 1.5rem !important; }

.d-flex { display: flex !important; }
.justify-content-between { justify-content: space-between !important; }
.align-items-center { align-items: center !important; }
.gap-1 { gap: 0.25rem !important; }
.gap-2 { gap: 0.5rem !important; }
.gap-3 { gap: 1rem !important; }

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

/* Loading Spinner */
.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border-color);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--surface-hover);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-secondary);
}

/* ========================================
   Pagination Styles
   ======================================== */
.pagination-container {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 20px;
    padding: 10px;
}

.pagination {
    display: flex;
    gap: 4px;
    list-style: none;
    padding: 0;
    margin: 0;
}

.pagination .page-item {
    display: flex;
}

.pagination .page-link {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 12px;
    border: 1px solid var(--border-color);
    background-color: var(--surface-color);
    color: var(--text-color);
    border-radius: 8px;
    text-decoration: none;
    font-weight: 500;
    transition: all var(--transition-fast);
    gap: 4px;
}

.pagination .page-link:hover {
    background-color: var(--surface-hover);
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.pagination .page-item.active .page-link {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    border-color: var(--primary-color);
    color: white;
}

.pagination .page-item.disabled .page-link {
    background-color: var(--surface-hover);
    color: var(--text-secondary);
    cursor: not-allowed;
}

/* ========================================
   Barcode Scanner Input Styling
   ======================================== */
.barcode-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.barcode-input-wrapper input {
    padding-left: 48px;
}

.barcode-input-wrapper i {
    position: absolute;
    left: 16px;
    color: var(--text-secondary);
    pointer-events: none;
}

.barcode-scanner-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
}

/* ========================================
   User Management & Form Cards
   ======================================== */
.form-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.form-section-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 8px;
}

.form-section-title i {
    color: var(--primary-color);
    font-size: 22px;
}

.form-group {
    margin-bottom: 16px;
}

.form-label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.form-control {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 14px;
    background: var(--background);
    color: var(--text-primary);
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.form-check {
    display: flex;
    align-items: center;
    gap: 8px;
}

.form-check-input {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: var(--primary-color);
}

.form-check-label {
    font-size: 14px;
    color: var(--text-primary);
    cursor: pointer;
}

.form-actions {
    display: flex;
    gap: 10px;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
}

.info-table {
    width: 100%;
}

.info-table tr {
    border-bottom: 1px solid var(--border);
}

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

.info-table td {
    padding: 10px 0;
    font-size: 14px;
}

.info-table td:first-child {
    color: var(--text-secondary);
    font-weight: 500;
}

.info-table td:last-child {
    text-align: right;
    color: var(--text-primary);
    font-weight: 600;
}

.row-inactive {
    opacity: 0.55;
    background: var(--surface-hover);
}

.action-buttons {
    display: inline-flex;
    gap: 6px;
    justify-content: flex-end;
}

.action-buttons .btn-sm {
    padding: 6px 10px;
    font-size: 13px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.action-buttons .material-icons-outlined {
    font-size: 18px;
}

.badge-sm {
    font-size: 10px;
    padding: 2px 6px;
    margin-left: 4px;
    vertical-align: middle;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 18px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-hover);
    color: white;
    text-decoration: none;
}

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

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

.btn-warning {
    background: #f59e0b;
    color: white;
}

.btn-warning:hover {
    background: #d97706;
    color: white;
}

.btn-success {
    background: #10b981;
    color: white;
}

.btn-success:hover {
    background: #059669;
    color: white;
}

.btn-danger {
    background: #ef4444;
    color: white;
}

.btn-danger:hover {
    background: #dc2626;
    color: white;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-secondary:disabled {
    background: var(--surface-hover);
    color: var(--text-secondary);
}

.alert {
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 16px;
    font-size: 14px;
}

.alert-success {
    background: #d1fae5;
    color: #065f46;
    border: 1px solid #6ee7b7;
}

.alert-danger {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fca5a5;
}

.badge-success {
    background: #d1fae5;
    color: #065f46;
}

.badge-danger {
    background: #fee2e2;
    color: #991b1b;
}

.badge-info {
    background: #dbeafe;
    color: #1e40af;
}


/* ========================================
   Page Header Actions
   ======================================== */
.page-header-actions {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
}

.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

/* ========================================
   Scanner Status Indicator
   ======================================== */
.scanner-status {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: var(--text-secondary);
    background: var(--surface-hover);
    padding: 6px 12px;
    border-radius: 20px;
    font-weight: 500;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--primary-color);
    box-shadow: 0 0 0 0 rgba(99, 102, 241, 0.4);
    animation: pulseDot 2s infinite;
    transition: background 0.2s;
}

.status-active {
    background: #10b981;
}

@@keyframes pulseDot {
    0% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.5); }
    70% { box-shadow: 0 0 0 8px rgba(16, 185, 129, 0); }
    100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

/* ========================================
   Generic Modal Overlay
   ======================================== */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100000;
    padding: 20px;
    animation: fadeInModal 0.2s ease-out;
}

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

.modal-content {
    background: var(--surface);
    border-radius: 12px;
    width: 100%;
    max-width: 600px;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    animation: slideUpModal 0.25s ease-out;
}

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

.modal-header {
    padding: 18px 24px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-hover, #4f46e5));
    color: white;
}

.modal-header h2 {
    font-size: 18px;
    font-weight: 600;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.modal-header h2 i {
    font-size: 24px;
}

.modal-close {
    background: none;
    border: none;
    color: white;
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
    padding: 0 4px;
    opacity: 0.85;
    transition: opacity 0.2s;
}

.modal-close:hover {
    opacity: 1;
}

.modal-body {
    padding: 20px 24px;
    overflow-y: auto;
    flex: 1;
}

.modal-footer {
    padding: 14px 24px;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    background: var(--surface-hover);
}

/* ========================================
   Scanner Guide (SweetAlert popup)
   ======================================== */
.guide-swal-popup {
    border-radius: 16px !important;
    overflow: hidden !important;
    background: var(--surface) !important;
    background-color: #ffffff !important;
    padding: 0 !important;
    max-height: 90vh !important;
}

.guide-swal-popup .swal2-content {
    padding: 0 !important;
    margin: 0 !important;
    overflow: hidden !important;
    background: var(--surface) !important;
    background-color: #ffffff !important;
}

.guide-swal-popup .swal2-actions {
    margin: 0 !important;
    padding: 14px 20px !important;
    background: var(--surface-hover) !important;
    border-top: 1px solid var(--border);
}

.guide-wrap {
    text-align: left;
    color: var(--text-primary);
    max-height: 70vh;
    overflow-y: auto;
    background: var(--surface);
    background-color: #ffffff;
}

.guide-hero {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 22px 26px;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark, #4f46e5));
    color: white;
}

.guide-hero-icon {
    width: 56px;
    height: 56px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.18);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.guide-hero-icon i {
    font-size: 30px;
    color: white;
}

.guide-hero-title {
    font-size: 20px;
    font-weight: 700;
    margin: 0 0 4px 0;
    color: white;
}

.guide-hero-sub {
    font-size: 13px;
    margin: 0;
    opacity: 0.9;
    color: white;
}

.guide-steps {
    padding: 18px 26px;
}

.guide-step {
    display: flex;
    gap: 14px;
    padding: 14px 0;
    border-bottom: 1px dashed var(--border);
}

.guide-step:last-child {
    border-bottom: none;
    padding-bottom: 4px;
}

.guide-step-num {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark, #4f46e5));
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    font-weight: 700;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.guide-step-body {
    flex: 1;
    min-width: 0;
}

.guide-step-body h4 {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 6px 0;
    display: flex;
    align-items: center;
    gap: 6px;
}

.guide-step-body h4 i {
    color: var(--primary-color);
    font-size: 18px;
}

.guide-step-body p {
    font-size: 13.5px;
    line-height: 1.6;
    color: var(--text-secondary);
    margin: 0 0 8px 0;
}

.guide-step-body p:last-child {
    margin-bottom: 0;
}

.guide-mute {
    color: var(--text-secondary) !important;
    font-size: 12.5px !important;
    font-style: italic;
    opacity: 0.85;
}

.guide-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 6px;
}

.guide-pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: var(--surface-hover);
    color: var(--text-primary);
    font-size: 12px;
    font-weight: 500;
    padding: 5px 10px;
    border-radius: 20px;
    border: 1px solid var(--border);
}

.guide-pill i {
    font-size: 14px;
    color: var(--primary-color);
}

.guide-list {
    font-size: 13.5px;
    line-height: 1.7;
    color: var(--text-secondary);
    margin: 4px 0 0 0;
    padding-left: 20px;
}

.guide-list li {
    margin-bottom: 3px;
}

.guide-list-numbered {
    list-style: decimal;
}

.guide-list code {
    background: var(--surface-hover);
    padding: 1px 6px;
    border-radius: 4px;
    font-size: 12px;
    color: var(--primary-color);
    font-family: 'Consolas', 'Monaco', monospace;
}

.guide-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 10px;
    padding: 0 26px 22px 26px;
}

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

.guide-card {
    border-radius: 10px;
    padding: 14px;
    border: 1px solid;
}

.guide-card h5 {
    font-size: 13px;
    font-weight: 600;
    margin: 0 0 10px 0;
    display: flex;
    align-items: center;
    gap: 6px;
}

.guide-card h5 i {
    font-size: 16px;
}

.guide-card-blue {
    background: #eff6ff;
    border-color: #bfdbfe;
    color: #1e3a8a;
}

.guide-card-blue h5 {
    color: #1e40af;
}

.guide-card-blue h5 i {
    color: #3b82f6;
}

.guide-card-amber {
    background: #fffbeb;
    border-color: #fde68a;
    color: #78350f;
}

.guide-card-amber h5 {
    color: #92400e;
}

.guide-card-amber h5 i {
    color: #f59e0b;
}

.guide-card-red {
    background: #fef2f2;
    border-color: #fecaca;
    color: #7f1d1d;
}

.guide-card-red h5 {
    color: #991b1b;
}

.guide-card-red h5 i {
    color: #dc2626;
}

.guide-kbd-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 4px 0;
    font-size: 12.5px;
}

.guide-kbd-row span {
    flex: 1;
    color: inherit;
    opacity: 0.85;
}

.guide-tips {
    list-style: none;
    padding: 0;
    margin: 0;
    font-size: 12.5px;
    line-height: 1.6;
}

.guide-tips li {
    padding: 4px 0;
    color: inherit;
}

.guide-tips li::before {
    content: "▸";
    margin-right: 6px;
    opacity: 0.6;
}

/* ========================================
   Keyboard kbd element
   ======================================== */
kbd {
    display: inline-block;
    padding: 2px 8px;
    font-size: 12px;
    font-family: 'Consolas', 'Monaco', monospace;
    color: var(--text-primary);
    background: var(--surface);
    border: 1px solid var(--border);
    border-bottom-width: 2px;
    border-radius: 4px;
    box-shadow: 0 1px 0 var(--border);
    line-height: 1.4;
    min-width: 22px;
    text-align: center;
}
