/* =============================================
   RADIUS Voucher Management System
   Modern Dark Theme Stylesheet
   ============================================= */

:root {
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --primary-light: #818cf8;
    --secondary: #64748b;
    --success: #22c55e;
    --warning: #f59e0b;
    --danger: #ef4444;
    --info: #0ea5e9;

    --bg-dark: #0f172a;
    --bg-darker: #020617;
    --bg-card: #1e293b;
    --bg-card-hover: #334155;

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

    --border-color: #334155;
    --chart-grid-color: rgba(148, 163, 184, 0.1);
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3), 0 2px 4px -2px rgba(0, 0, 0, 0.2);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.4), 0 4px 6px -4px rgba(0, 0, 0, 0.3);

    --sidebar-width: 260px;
    --sidebar-collapsed: 70px;
    --header-height: 60px;

    /* ... (existing dark theme variables) ... */
    --radius: 12px;
    --radius-sm: 8px;
    --transition: all 0.3s ease;
}

@media (prefers-color-scheme: light) {
    :root {
        /* Light Theme Overrides */
        --bg-dark: #f8fafc;
        /* Slate 50 */
        --bg-darker: #f1f5f9;
        /* Slate 100 */
        --bg-card: #ffffff;
        /* White */
        --bg-card-hover: #e2e8f0;
        /* Slate 200 */

        --text-primary: #0f172a;
        /* Slate 900 */
        --text-secondary: #475569;
        /* Slate 600 */
        --text-muted: #64748b;
        /* Slate 500 */

        --border-color: #cbd5e1;
        /* Slate 300 */
        --chart-grid-color: rgba(15, 23, 42, 0.05);

        --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
        --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.05);
    }
}

/* Nav Logo Image */
.nav-logo-img {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    object-fit: cover;
}

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

body {
    font-family: 'Rubik', 'Open Sans', 'Segoe UI', sans-serif;
    background: var(--bg-dark);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    font-size: 12pt;
}

/* =============================================
   Login Page
   ============================================= */

.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: linear-gradient(135deg, var(--bg-darker) 0%, var(--bg-dark) 50%, #1a1a2e 100%);
    padding: 20px;
}

.login-container {
    width: 100%;
    max-width: 420px;
}

.login-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 40px;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-color);
}

.login-header {
    text-align: center;
    margin-bottom: 30px;
}

.login-logo {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    font-size: 32px;
    color: white;
    box-shadow: 0 8px 32px rgba(99, 102, 241, 0.3);
}

/* Base form control */
.form-control {
    display: block;
    width: 100%;
    padding: 0.375rem 0.75rem;
    font-size: 1rem;
    font-weight: 400;
    line-height: 1.5;
    color: #212529;
    background-color: #fff;
    background-clip: padding-box;
    border: 1px solid #ced4da;
    border-radius: 0.25rem;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

/* Focus state */
.form-control:focus {
    color: #212529;
    background-color: #fff;
    border-color: #86b7fe;
    outline: 0;
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
}

/* Disabled state */
.form-control:disabled {
    background-color: #e9ecef;
    opacity: 1;
}

/* Read-only state */
.form-control[readonly] {
    background-color: #e9ecef;
    opacity: 1;
}

/* Placeholder styles */
.form-control::placeholder {
    color: #6c757d;
    opacity: 1;
}

.login-header h1 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 8px;
}

.login-header p {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.login-form .form-group {
    margin-bottom: 20px;
}

.login-form label {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.login-form input {
    width: 100%;
    padding: 12px 16px;
    background: var(--bg-darker);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 1rem;
    transition: var(--transition);
}

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

.password-input {
    position: relative;
}

.password-input input {
    padding-right: 45px;
}

.toggle-password {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px;
    transition: var(--transition);
}

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

.login-footer {
    text-align: center;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
    color: var(--text-muted);
    font-size: 0.8rem;
}

/* =============================================
   App Layout
   ============================================= */

.app-container {
    display: flex;
    min-height: 100vh;
}

/* =============================================
   Sidebar
   ============================================= */

.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: var(--bg-card);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    z-index: 1000;
    transition: var(--transition);
}

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

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

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary-light);
}

.logo i {
    font-size: 1.5rem;
}

.sidebar.collapsed .logo span {
    display: none;
}

.sidebar-toggle {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 8px;
    border-radius: var(--radius-sm);
    transition: var(--transition);
}

.sidebar-toggle:hover {
    background: var(--bg-card-hover);
    color: var(--text-primary);
}

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

.nav-list {
    list-style: none;
}

.nav-item {
    margin: 4px 12px;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: var(--radius-sm);
    transition: var(--transition);
}

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

.nav-link.active {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
}

.nav-link i {
    width: 20px;
    text-align: center;
    font-size: 1.1rem;
}

.sidebar.collapsed .nav-link span {
    display: none;
}

.nav-divider {
    height: 1px;
    background: var(--border-color);
    margin: 16px 20px;
}

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

.user-info {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.user-avatar {
    width: 40px;
    height: 40px;
    background: var(--primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

.sidebar.collapsed .user-details {
    display: none;
}

.user-name {
    font-weight: 600;
    font-size: 0.9rem;
}

.user-role {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.user-balance {
    display: block;
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--success);
    margin-top: 2px;
}

.user-balance i {
    font-size: 0.75rem;
    margin-right: 4px;
}

.logout-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 10px 16px;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.2);
    border-radius: var(--radius-sm);
    color: var(--danger);
    text-decoration: none;
    transition: var(--transition);
}

.logout-btn:hover {
    background: var(--danger);
    color: white;
}

.sidebar.collapsed .logout-btn span {
    display: none;
}

/* =============================================
   Main Content
   ============================================= */

.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    padding: 30px;
    transition: var(--transition);
}

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

.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 30px;
}

.page-header h1 {
    font-size: 1.75rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 12px;
}

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

.page-header p {
    color: var(--text-secondary);
    margin-top: 4px;
}

/* =============================================
   Cards
   ============================================= */

.card {
    background: var(--bg-card);
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
    margin-bottom: 24px;
    overflow: hidden;
}

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

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

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

.card-body {
    padding: 24px;
}

/* =============================================
   Stats Grid
   ============================================= */

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 20px;
    transition: var(--transition);
}

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

.stat-icon {
    width: 56px;
    height: 56px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: white;
}

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

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

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

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

.stat-info h3 {
    font-size: 1.75rem;
    font-weight: 700;
    line-height: 1;
}

.stat-info p {
    color: var(--text-secondary);
    font-size: 0.875rem;
    margin-top: 4px;
}

/* =============================================
   Dashboard Grid
   ============================================= */

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 24px;
    margin-bottom: 24px;
}

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

.quick-action-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 20px 24px;
    background: var(--bg-darker);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    text-decoration: none;
    transition: var(--transition);
    flex: 1;
    min-width: 120px;
    text-align: center;
}

.quick-action-btn:hover {
    background: var(--primary);
    color: white;
    transform: translateY(-2px);
}

.quick-action-btn i {
    font-size: 1.5rem;
}

.today-stats {
    display: flex;
    gap: 30px;
}

.today-stat {
    text-align: center;
}

.today-stat .stat-number {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary);
    display: block;
}

.today-stat .stat-label {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

/* =============================================
   Charts Grid
   ============================================= */

.charts-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin-bottom: 24px;
}

.charts-grid .chart-card:last-child {
    grid-column: 1 / -1;
}

.chart-container {
    position: relative;
    height: 280px;
}

.chart-container-doughnut {
    height: 300px;
    max-width: 360px;
    margin: 0 auto;
}

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

/* =============================================
   Tables
   ============================================= */

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

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

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

.table th {
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: var(--bg-darker);
}

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

.table tbody tr:hover {
    background: var(--bg-card-hover);
}

.table code {
    background: var(--bg-darker);
    padding: 4px 8px;
    border-radius: 4px;
    font-family: 'Monaco', 'Consolas', monospace;
    font-size: 0.85rem;
    color: var(--primary-light);
}

.table-info {
    color: var(--text-secondary);
    font-size: 0.875rem;
    margin-bottom: 16px;
}

/* =============================================
   Buttons
   ============================================= */

.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: var(--bg-card-hover);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    transition: var(--transition);
}

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

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

.btn-primary:hover {
    background: linear-gradient(135deg, var(--primary-light) 0%, var(--primary) 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
}

.btn-secondary {
    background: transparent;
}

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

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

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

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

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

.btn-icon {
    padding: 8px;
    width: 34px;
    height: 34px;
    justify-content: center;
}

.btn-group {
    display: flex;
    gap: 6px;
}

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

/* =============================================
   Forms
   ============================================= */

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

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px 14px;
    background: var(--bg-darker);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 0.9rem;
    transition: var(--transition);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

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

.form-group small {
    display: block;
    margin-top: 6px;
    color: var(--text-muted);
    font-size: 0.75rem;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 20px;
}

.form-actions {
    margin-top: 24px;
    display: flex;
    gap: 12px;
}

/* =============================================
   Badges
   ============================================= */

.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 20px;
    text-transform: capitalize;
}

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

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

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

.badge-secondary {
    background: rgba(100, 116, 139, 0.15);
    color: var(--secondary);
}

/* =============================================
   Alerts
   ============================================= */

.alert {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 18px;
    border-radius: var(--radius-sm);
    margin-bottom: 20px;
    font-size: 0.9rem;
}

.alert-error {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.2);
    color: var(--danger);
}

.alert-warning {
    background: rgba(245, 158, 11, 0.1);
    border: 1px solid rgba(245, 158, 11, 0.2);
    color: var(--warning);
}

.alert-success {
    background: rgba(34, 197, 94, 0.1);
    border: 1px solid rgba(34, 197, 94, 0.2);
    color: var(--success);
}

.alert a {
    color: inherit;
    font-weight: 600;
}

/* =============================================
   Empty State
   ============================================= */

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-secondary);
}

.empty-state i {
    font-size: 4rem;
    color: var(--border-color);
    margin-bottom: 20px;
}

.empty-state p {
    margin-bottom: 20px;
}

.empty-state a {
    color: var(--primary);
}

/* =============================================
   Modal
   ============================================= */

.modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 2000;
    align-items: center;
    justify-content: center;
}

.modal.open {
    display: flex;
}

.modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
}

.modal-content {
    position: relative;
    background: var(--bg-card);
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow: hidden;
    box-shadow: var(--shadow-lg);
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }

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

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

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

.modal-close {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 4px 8px;
    line-height: 1;
    transition: var(--transition);
}

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

.modal-body {
    padding: 24px;
    max-height: 60vh;
    overflow-y: auto;
}

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

/* =============================================
   Filter Form
   ============================================= */

.filter-form {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
}

.filter-group input,
.filter-group select {
    padding: 8px 12px;
    background: var(--bg-darker);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 0.875rem;
}

.filter-group input {
    min-width: 200px;
}

/* =============================================
   Pagination
   ============================================= */

.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    margin-top: 24px;
}

.page-info {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* =============================================
   Generate Page
   ============================================= */

.generate-container {
    max-width: 900px;
}

.profile-preview {
    background: var(--bg-darker);
    border-radius: var(--radius-sm);
    padding: 20px;
    margin-top: 20px;
}

.profile-preview h4 {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.preview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 16px;
}

.preview-item .label {
    display: block;
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.preview-item span:last-child {
    font-weight: 600;
    color: var(--primary-light);
}

.result-summary {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 16px 20px;
    background: rgba(34, 197, 94, 0.1);
    border-radius: var(--radius-sm);
    margin-bottom: 20px;
}

.summary-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
}

.bulk-actions {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
}

/* =============================================
   Toast Notification
   ============================================= */

.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 3000;
}

.toast {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 20px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-lg);
    margin-bottom: 10px;
    animation: toastSlideIn 0.3s ease;
    min-width: 280px;
}

@keyframes toastSlideIn {
    from {
        opacity: 0;
        transform: translateX(100px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.toast.success {
    border-left: 3px solid var(--success);
}

.toast.error {
    border-left: 3px solid var(--danger);
}

.toast.warning {
    border-left: 3px solid var(--warning);
}

.toast i {
    font-size: 1.2rem;
}

.toast.success i {
    color: var(--success);
}

.toast.error i {
    color: var(--danger);
}

.toast.warning i {
    color: var(--warning);
}

/* =============================================
   Print Styles
   ============================================= */

.print-only {
    display: none;
}

@media print {
    body * {
        visibility: hidden;
    }

    .print-only,
    .print-only * {
        visibility: visible;
        display: block;
    }

    .print-only {
        position: absolute;
        left: 0;
        top: 0;
        width: 100%;
    }

    .voucher-print-grid {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
        padding: 20px;
    }

    .voucher-card-print {
        border: 2px dashed #333;
        padding: 15px;
        break-inside: avoid;
    }

    .voucher-header {
        font-weight: bold;
        font-size: 14px;
        margin-bottom: 10px;
        text-align: center;
    }

    .voucher-field {
        margin: 6px 0;
        font-size: 12px;
    }

    .voucher-field label {
        color: #666;
    }

    .voucher-field span {
        font-weight: bold;
        font-size: 14px;
    }
}

/* =============================================
   Utilities
   ============================================= */

.hidden {
    display: none !important;
}

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

.text-success {
    color: var(--success);
}

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

.text-warning {
    color: var(--warning);
}

/* =============================================
   Settings Page
   ============================================= */

.settings-container {
    max-width: 900px;
}

.logo-upload-area {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.current-logo {
    display: flex;
    align-items: center;
    gap: 16px;
}

.current-logo img {
    width: 100px;
    height: 100px;
    border-radius: var(--radius);
    object-fit: cover;
    border: 2px solid var(--border-color);
}

.no-logo {
    width: 100px;
    height: 100px;
    border-radius: var(--radius);
    background: var(--bg-darker);
    border: 2px dashed var(--border-color);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    gap: 8px;
}

.no-logo i {
    font-size: 2rem;
}

.no-logo span {
    font-size: 0.75rem;
}

.upload-controls {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.upload-controls input[type="file"] {
    display: none;
}

.upload-controls small {
    color: var(--text-muted);
    font-size: 0.75rem;
}

/* Login Preview */
.login-preview {
    display: flex;
    justify-content: center;
    padding: 20px;
    background: var(--bg-darker);
    border-radius: var(--radius);
}

.preview-frame {
    width: 280px;
    background: rgba(30, 41, 59, 0.95);
    border-radius: 16px;
    padding: 30px;
    border: 1px solid var(--border-color);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.preview-header {
    text-align: center;
    margin-bottom: 24px;
}

.preview-logo {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    object-fit: cover;
    margin-bottom: 12px;
}

.preview-logo-placeholder {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: white;
    margin: 0 auto 12px;
}

.preview-header h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.preview-header p {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.preview-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.preview-field {
    background: var(--bg-dark);
    padding: 10px 14px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.preview-button {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    padding: 10px;
    border-radius: 8px;
    text-align: center;
    color: white;
    font-weight: 600;
    font-size: 0.85rem;
    margin-top: 8px;
}

.mb-20 {
    margin-bottom: 20px;
}

/* =============================================
   Responsive
   ============================================= */

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

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

    .main-content {
        margin-left: 0;
        padding: 20px;
    }

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

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

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

    .filter-form {
        flex-direction: column;
        align-items: stretch;
    }

    .filter-group input {
        width: 100%;
        min-width: auto;
    }
}

/* =============================================
   Monitoring Page
   ============================================= */

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

.connection-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
    background: rgba(100, 116, 139, 0.15);
    color: var(--text-secondary);
    transition: var(--transition);
}

.connection-badge i {
    font-size: 0.55rem;
}

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

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

/* Monitor Grid */
.monitor-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 24px;
}

.monitor-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    transition: var(--transition);
}

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

.monitor-card-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    color: white;
    flex-shrink: 0;
}

.monitor-card-icon.bg-primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
}

.monitor-card-icon.bg-success {
    background: linear-gradient(135deg, var(--success) 0%, #16a34a 100%);
}

.monitor-card-icon.bg-info {
    background: linear-gradient(135deg, var(--info) 0%, #0284c7 100%);
}

.monitor-card-icon.bg-warning {
    background: linear-gradient(135deg, var(--warning) 0%, #d97706 100%);
}

.monitor-card-info {
    flex: 1;
    min-width: 0;
}

.monitor-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: block;
    margin-bottom: 4px;
}

.monitor-value {
    font-size: 1.1rem;
    font-weight: 700;
    display: block;
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.monitor-sub {
    font-size: 0.75rem;
    color: var(--text-secondary);
    display: block;
    margin-top: 2px;
}

/* Progress Bars */
.monitor-progress {
    width: 100%;
    height: 6px;
    background: var(--bg-darker);
    border-radius: 3px;
    margin-top: 8px;
    overflow: hidden;
}

.monitor-progress-bar {
    height: 100%;
    border-radius: 3px;
    transition: width 0.6s ease, background-color 0.3s ease;
}

.monitor-progress-bar.bg-info {
    background: var(--info);
}

.monitor-progress-bar.bg-success {
    background: var(--success);
}

.monitor-progress-bar.bg-warning {
    background: var(--warning);
}

.monitor-progress-bar.bg-danger {
    background: var(--danger);
}

/* Monitor Tables Grid */
.monitor-tables-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin-bottom: 24px;
}

.monitor-loading {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.monitor-loading i {
    margin-right: 8px;
}

/* Auto-refresh Bar */
.auto-refresh-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 20px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    margin-bottom: 24px;
}

.refresh-toggle {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.refresh-toggle input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--primary);
}

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

/* Router Test Result */
.router-test-result {
    margin-top: 16px;
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.router-test-result.loading {
    background: rgba(14, 165, 233, 0.1);
    color: var(--info);
    border: 1px solid rgba(14, 165, 233, 0.2);
}

.router-test-result.success {
    background: rgba(34, 197, 94, 0.1);
    color: var(--success);
    border: 1px solid rgba(34, 197, 94, 0.2);
}

.router-test-result.error {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
    border: 1px solid rgba(239, 68, 68, 0.2);
}

/* Monitoring Responsive */
@media (max-width: 1200px) {
    .monitor-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 900px) {
    .monitor-tables-grid {
        grid-template-columns: 1fr;
    }
}

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

    .auto-refresh-bar {
        flex-direction: column;
        gap: 8px;
    }

    .header-actions {
        flex-direction: column;
        align-items: flex-start;
    }
}

/* =============================================
   Modal Overlay (for router management)
   ============================================= */

.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 2000;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    align-items: center;
    justify-content: center;
}

.modal-overlay.active {
    display: flex;
}

.modal-overlay .modal {
    display: block !important;
    position: relative !important;
    inset: auto !important;
    z-index: auto !important;
    background: var(--bg-card);
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
    width: 90%;
    max-width: 560px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
    animation: modalSlideIn 0.3s ease;
}

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

.modal-overlay .modal-header h3 {
    font-size: 1.05rem;
    font-weight: 600;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.modal-overlay .modal-close {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 4px 8px;
    line-height: 1;
    transition: var(--transition);
}

.modal-overlay .modal-close:hover {
    color: var(--danger);
}

.modal-overlay form {
    padding: 24px;
}

.modal-overlay .form-actions {
    margin-top: 16px;
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

/* =============================================
   Router Management Page
   ============================================= */

.router-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
    gap: 20px;
    margin-bottom: 24px;
}

.router-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 20px;
    transition: var(--transition);
}

.router-card:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow);
}

.router-card.inactive {
    opacity: 0.6;
}

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

.router-card-title {
    display: flex;
    align-items: center;
    gap: 12px;
}

.router-card-title i {
    font-size: 1.3rem;
    color: var(--primary);
}

.router-card-title h3 {
    font-size: 1rem;
    font-weight: 600;
    margin: 0;
    line-height: 1.3;
}

.router-ip {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-family: 'Courier New', monospace;
}

.router-desc {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 12px;
    line-height: 1.4;
}

.router-card-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

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

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

.btn-info:hover {
    background: #0284c7;
}

/* =============================================
   Monitoring Overview Grid
   ============================================= */

.router-overview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 20px;
    margin-bottom: 24px;
}

.overview-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 20px;
    cursor: pointer;
    transition: var(--transition);
}

.overview-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
    border-color: var(--primary);
}

.overview-card.offline {
    opacity: 0.7;
    border-left: 3px solid var(--danger);
}

.overview-card.online {
    border-left: 3px solid var(--success);
}

.overview-card-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.overview-status {
    font-size: 0.5rem;
    line-height: 1;
}

.overview-status.online {
    color: var(--success);
}

.overview-status.offline {
    color: var(--danger);
}

.overview-title h3 {
    font-size: 1.05rem;
    font-weight: 700;
    margin: 0;
    line-height: 1.3;
}

.overview-title span {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-family: 'Courier New', monospace;
}

/* Mini progress bars for overview */
.overview-stats {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 14px;
}

.overview-stat {
    display: flex;
    align-items: center;
    gap: 10px;
}

.stat-label {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    width: 30px;
    flex-shrink: 0;
}

.stat-val {
    font-size: 0.75rem;
    font-weight: 600;
    width: 36px;
    text-align: right;
    flex-shrink: 0;
}

.mini-progress {
    flex: 1;
    height: 5px;
    background: var(--bg-darker);
    border-radius: 3px;
    overflow: hidden;
}

.mini-progress-bar {
    height: 100%;
    border-radius: 3px;
    transition: width 0.6s ease;
}

.mini-progress-bar.bg-info {
    background: var(--info);
}

.mini-progress-bar.bg-success {
    background: var(--success);
}

.mini-progress-bar.bg-warning {
    background: var(--warning);
}

.mini-progress-bar.bg-danger {
    background: var(--danger);
}

.overview-footer {
    display: flex;
    gap: 16px;
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.overview-footer i {
    margin-right: 4px;
    font-size: 0.7rem;
    color: var(--text-muted);
}

.overview-version {
    font-size: 0.72rem;
    color: var(--text-muted);
}

.overview-offline-msg {
    text-align: center;
    padding: 20px;
    color: var(--danger);
    font-size: 0.85rem;
}

.overview-offline-msg i {
    margin-right: 6px;
}

/* Detail back button bar */
.detail-back {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.detail-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0;
    flex: 1;
}

/* Responsive */
@media (max-width: 768px) {

    .router-grid,
    .router-overview-grid {
        grid-template-columns: 1fr;
    }

    .detail-back {
        flex-direction: column;
        align-items: flex-start;
    }
}

/* =============================================
   AP Monitoring
   ============================================= */

.ap-summary-bar {
    display: flex;
    gap: 16px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.ap-summary-item {
    display: flex;
    align-items: center;
    gap: 14px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 16px 24px;
    flex: 1;
    min-width: 160px;
    transition: var(--transition);
}

.ap-summary-item:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.ap-summary-item i {
    font-size: 1.6rem;
    color: var(--primary);
}

.ap-summary-item.online i {
    color: var(--success);
}

.ap-summary-item.offline i {
    color: var(--danger);
}

.ap-summary-item.routers i {
    color: var(--warning);
}

.ap-summary-value {
    display: block;
    font-size: 1.6rem;
    font-weight: 700;
    line-height: 1.1;
}

.ap-summary-label {
    display: block;
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-top: 2px;
}

/* Scanning Animation */
.ap-scanning {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 80px 20px;
}

.ap-scanning-inner {
    text-align: center;
}

.ap-scanning-icon {
    font-size: 4rem;
    color: var(--primary);
    margin-bottom: 20px;
}

.ap-scanning-inner h3 {
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 8px;
}

.ap-scanning-inner p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 24px;
}

.ap-scanning-progress {
    width: 300px;
    height: 4px;
    background: var(--bg-darker);
    border-radius: 4px;
    margin: 0 auto;
    overflow: hidden;
}

.ap-scanning-bar {
    height: 100%;
    width: 40%;
    background: linear-gradient(90deg, var(--primary), var(--primary-light));
    border-radius: 4px;
    animation: scanProgress 1.5s ease-in-out infinite;
}

@keyframes scanProgress {
    0% {
        transform: translateX(-100%);
    }

    100% {
        transform: translateX(350%);
    }
}

/* AP Section per Router */
.ap-section {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    margin-bottom: 24px;
    overflow: hidden;
}

.ap-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 24px;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-darker);
    flex-wrap: wrap;
    gap: 12px;
}

.ap-section-title {
    display: flex;
    align-items: center;
    gap: 12px;
}

.ap-section-title h3 {
    font-size: 1.05rem;
    font-weight: 600;
    margin: 0;
}

.ap-router-ip {
    display: block;
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-top: 2px;
}

.ap-router-status {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    flex-shrink: 0;
}

.ap-router-status.online {
    background: var(--success);
    box-shadow: 0 0 8px rgba(34, 197, 94, 0.5);
}

.ap-router-status.offline {
    background: var(--danger);
    box-shadow: 0 0 8px rgba(239, 68, 68, 0.5);
}

.ap-section-badges {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

/* AP Grid */
.ap-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
    gap: 16px;
    padding: 20px;
}

/* AP Card */
.ap-card {
    background: var(--bg-darker);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    transition: var(--transition);
    overflow: hidden;
}

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

.ap-card.ap-online {
    border-left: 3px solid var(--success);
}

.ap-card.ap-offline {
    border-left: 3px solid var(--danger);
    opacity: 0.8;
}

.ap-card.ap-offline:hover {
    opacity: 1;
}

.ap-card-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 16px;
    border-bottom: 1px solid var(--border-color);
}

.ap-status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

.ap-status-dot.online {
    background: var(--success);
    box-shadow: 0 0 6px rgba(34, 197, 94, 0.6);
    animation: apPulse 2s ease-in-out infinite;
}

.ap-status-dot.offline {
    background: var(--danger);
}

@keyframes apPulse {

    0%,
    100% {
        box-shadow: 0 0 6px rgba(34, 197, 94, 0.6);
    }

    50% {
        box-shadow: 0 0 12px rgba(34, 197, 94, 0.9);
    }
}

.ap-ip {
    font-weight: 600;
    font-size: 0.95rem;
    flex: 1;
    font-family: 'Monaco', 'Consolas', monospace;
}

.ap-ping-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
}

.ap-ping-badge.online {
    background: rgba(34, 197, 94, 0.15);
    color: var(--success);
}

.ap-ping-badge.offline {
    background: rgba(239, 68, 68, 0.15);
    color: var(--danger);
}

.ap-ping-badge.pinging {
    background: rgba(99, 102, 241, 0.15);
    color: var(--primary);
}

.ap-card-body {
    padding: 12px 16px;
}

.ap-detail {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.82rem;
    color: var(--text-secondary);
    padding: 4px 0;
}

.ap-detail i {
    width: 14px;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.75rem;
}

.ap-detail span {
    color: var(--text-muted);
    min-width: 60px;
}

.ap-detail code {
    background: rgba(99, 102, 241, 0.08);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'Monaco', 'Consolas', monospace;
    font-size: 0.8rem;
    color: var(--primary-light);
}

.ap-card-footer {
    padding: 10px 16px;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
}

/* AP Offline/Empty Messages */
.ap-offline-msg,
.ap-empty-msg {
    padding: 30px 24px;
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.ap-offline-msg {
    color: var(--danger);
}

.ap-offline-msg i,
.ap-empty-msg i {
    margin-right: 8px;
}

/* Responsive AP Grid */
@media (max-width: 768px) {
    .ap-summary-bar {
        flex-direction: column;
    }

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

    .ap-section-header {
        flex-direction: column;
        align-items: flex-start;
    }
}

/* Sidebar Dropdown */
.nav-parent>a {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-parent .arrow {
    font-size: 0.8rem;
    transition: transform 0.3s ease;
    margin-left: auto;
}

.nav-parent.open .arrow {
    transform: rotate(180deg);
}

.nav-submenu {
    list-style: none;
    padding: 4px 0;
    display: none;
    /* Removed dark background for cleaner look */
    margin: 0;
    position: relative;
}

.nav-submenu li {
    position: relative;
}

.nav-submenu li a {
    display: flex;
    align-items: center;
    gap: 12px;
    /* Adjusted padding to align with parent text (Icon ~20px + Pad 16px + Gap 12px = ~48px) */
    padding: 8px 16px 8px 50px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.9rem;
    transition: var(--transition);
}

.nav-submenu li a:hover {
    color: var(--text-primary);
}

.nav-submenu li a.active {
    color: var(--primary-light);
    font-weight: 500;
    background: rgba(99, 102, 241, 0.05);
    /* Very subtle active bg */
}

/* Vertical hierarchy line */
.nav-submenu::before {
    content: '';
    position: absolute;
    left: 26px;
    /* Aligned with parent icon center (16px pad + 20px/2) */
    top: 0;
    bottom: 0;
    width: 1px;
    background: var(--border-color);
    opacity: 0.4;
}

.nav-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--border-color);
    /* Subtle dot */
    transition: all 0.3s ease;
    z-index: 1;
    flex-shrink: 0;
}

.nav-submenu li a:hover .nav-dot {
    background: var(--text-primary);
    transform: scale(1.2);
}

.nav-submenu li a.active .nav-dot {
    background: var(--primary);
    box-shadow: 0 0 8px rgba(99, 102, 241, 0.6);
    transform: scale(1.2);
}

/* Collapsed Sidebar */
.sidebar.collapsed .nav-parent .arrow,
.sidebar.collapsed .nav-submenu {
    display: none !important;
}

.sidebar.collapsed .nav-parent:hover .nav-submenu {
    display: block !important;
    position: absolute;
    left: var(--sidebar-collapsed);
    top: 0;
    width: 220px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    margin: 0;
    padding: 8px 0;
    border-radius: 0 var(--radius) var(--radius) 0;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}

.sidebar.collapsed .nav-parent:hover .nav-submenu::before {
    display: none;
}

.sidebar.collapsed .nav-parent:hover .nav-submenu li a {
    padding-left: 20px;
}

/* =============================================
   Mobile Responsive
   ============================================= */

/* =============================================
   Mobile Responsive Refinements
   ============================================= */

@media (max-width: 768px) {

    /* Sidebar Mobile */
    .sidebar {
        transform: translateX(-100%);
        width: 280px !important;
        /* Slightly wider for better touch targets */
        box-shadow: none;
        z-index: 1001;
        /* Above overlay */
    }

    .sidebar.open {
        transform: translateX(0);
        box-shadow: 0 0 15px rgba(0, 0, 0, 0.2);
    }

    /* Overlay for mobile */
    .sidebar-overlay {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: 1000;
        /* Below sidebar */
        opacity: 0;
        visibility: hidden;
        transition: var(--transition);
        backdrop-filter: blur(2px);
    }

    .sidebar-overlay.show {
        opacity: 1;
        visibility: visible;
    }

    /* Main Content Adjustment */
    .main-content {
        margin-left: 0 !important;
        width: 100%;
        padding: 15px;
        /* Reduced padding */
        padding-top: 70px;
        /* Space for fixed header/button */
    }

    /* Header Adjustment */
    .page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
        margin-bottom: 20px;
    }

    .page-header h1 {
        font-size: 1.5rem;
        margin-left: 45px;
        /* Space for menu button */
    }

    .page-header p {
        font-size: 0.9rem;
        margin-left: 45px;
    }

    /* Mobile Header */
    .mobile-header {
        display: flex;
        align-items: center;
        gap: 15px;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        height: 60px;
        background: var(--bg-card);
        padding: 0 20px;
        z-index: 990;
        border-bottom: 1px solid var(--border-color);
        box-shadow: var(--shadow);
    }

    .mobile-header .mobile-logo {
        display: flex;
        align-items: center;
        gap: 10px;
        font-weight: 700;
        font-size: 1.1rem;
        color: var(--text-primary);
    }

    .mobile-header .mobile-logo img {
        width: 32px;
        height: 32px;
        border-radius: 6px;
        object-fit: cover;
    }

    /* Mobile Menu Button */
    .mobile-menu-btn {
        display: flex;
        align-items: center;
        justify-content: center;
        /* Position is now handled by flex container */
        width: 35px;
        height: 35px;
        border-radius: 8px;
        background: var(--bg-dark);
        /* Slightly different bg */
        color: var(--text-primary);
        border: 1px solid var(--border-color);
        cursor: pointer;
        font-size: 1rem;
    }

    /* Fixed Header Background (Optional, if we want a bar) */
    /* For now, keeping it simple but ensuring button is accessible */

    /* Grid Adjustments */
    .stats-grid,
    .dashboard-grid,
    .charts-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    /* Card & Table Adjustments */
    .card {
        margin-bottom: 15px;
        border-radius: 12px;
    }

    .card-header {
        padding: 15px;
    }

    .card-body {
        padding: 15px;
    }

    .stat-card {
        padding: 15px;
        border-radius: 12px;
    }

    .stat-icon {
        width: 48px;
        height: 48px;
        font-size: 1.2rem;
    }

    .stat-info h3 {
        font-size: 1.5rem;
    }

    .table-responsive {
        border: 0;
        margin: 0 -15px;
        /* Negative margin to let table span full width */
        width: calc(100% + 30px);
    }

    .table th,
    .table td {
        padding: 10px 15px;
        white-space: nowrap;
        font-size: 0.85rem;
    }

    /* Quick Actions */
    .quick-actions {
        gap: 10px;
    }

    .quick-action-btn {
        padding: 15px;
        min-width: 45%;
        /* 2 per row */
        flex: 1 1 auto;
    }
}