/* ==========================================================================
   DESIGN SYSTEM & CUSTOM VARIABLES (Modern Minimal Enterprise)
   ========================================================================== */
   :root {
    /* Colors - Light Theme (Default) */
    --bg-base: #F8FAFC; /* Slate 50 */
    --bg-surface: #FFFFFF;
    --bg-surface-hover: #F1F5F9;
    
    --border-color: #E2E8F0; /* Slate 200 */
    --border-color-focus: #CBD5E1;
    
    --primary: #10B981; /* Emerald 500 */
    --primary-hover: #059669; /* Emerald 600 */
    --primary-light: #D1FAE5; /* Emerald 100 */
    --primary-dark: #047857; /* Emerald 700 */
    
    --secondary: #0F172A; /* Slate 900 */
    
    --accent: #F59E0B; /* Amber 500 */
    --accent-light: #FEF3C7;
    
    --info: #3B82F6; /* Blue 500 */
    --info-light: #DBEAFE;
    
    --danger: #EF4444; /* Red 500 */
    --danger-light: #FEE2E2;

    --text-main: #0F172A; /* Slate 900 */
    --text-muted: #64748B; /* Slate 500 */
    --text-inverse: #FFFFFF;

    /* Metrics & Spacing */
    --sidebar-width: 260px;
    --header-height: 70px;
    
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --radius-full: 9999px;

    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -2px rgba(0, 0, 0, 0.04);
    
    --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    
    --font-main: 'Vazirmatn', system-ui, -apple-system, sans-serif;
}

/* Dark Theme overrides */
html[data-theme="dark"] {
    --bg-base: #0F172A; /* Slate 900 */
    --bg-surface: #1E293B; /* Slate 800 */
    --bg-surface-hover: #334155; /* Slate 700 */
    
    --border-color: #334155; /* Slate 700 */
    --border-color-focus: #475569;

    --text-main: #F8FAFC; /* Slate 50 */
    --text-muted: #94A3B8; /* Slate 400 */

    --primary-light: rgba(16, 185, 129, 0.2);
    --primary-dark: #34D399; /* Emerald 400 */
    
    --accent-light: rgba(245, 158, 11, 0.2);
    --info-light: rgba(59, 130, 246, 0.2);
    --danger-light: rgba(239, 68, 68, 0.2);

    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.5);
}

/* ==========================================================================
   RESET & BASE
   ========================================================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: var(--font-main);
}

body {
    background-color: var(--bg-base);
    color: var(--text-main);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* Utility Classes */
.hidden { display: none !important; }
.text-muted { color: var(--text-muted); }
.text-sm { font-size: 0.875rem; }
.text-red { color: var(--danger); }
.text-emerald { color: var(--primary); }
.text-amber { color: var(--accent); }
.text-blue { color: var(--info); }
.bg-emerald-light { background-color: var(--primary-light); }
.bg-amber-light { background-color: var(--accent-light); }
.bg-blue-light { background-color: var(--info-light); }
.bg-indigo-light { background-color: #E0E7FF; color: #4F46E5; }
.mt-4 { margin-top: 1rem; }
.mt-6 { margin-top: 1.5rem; }
.mt-8 { margin-top: 2rem; }
.mb-6 { margin-bottom: 1.5rem; }
.w-full { width: 100%; }
.max-w-3xl { max-width: 48rem; margin-left: auto; margin-right: auto; }
.flex { display: flex; }
.flex-1 { flex: 1; }
.gap-4 { gap: 1rem; }
.gap-6 { gap: 1.5rem; }
.space-y-6 > * + * { margin-top: 1.5rem; }

.grid { display: grid; }
.grid-cols-1 { grid-template-columns: repeat(1, minmax(0, 1fr)); }
.grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.align-end { align-items: flex-end; }

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

/* Custom Scrollbar */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-color); border-radius: var(--radius-full); }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ==========================================================================
   COMPONENTS
   ========================================================================== */

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 0.625rem 1.25rem;
    font-size: 0.875rem;
    font-weight: 600;
    border-radius: var(--radius-md);
    border: none;
    cursor: pointer;
    transition: var(--transition);
}

.btn svg { width: 18px; height: 18px; }

.btn-primary {
    background-color: var(--primary);
    color: white;
    box-shadow: 0 2px 4px rgba(16, 185, 129, 0.2);
}
.btn-primary:hover {
    background-color: var(--primary-hover);
    box-shadow: 0 4px 6px rgba(16, 185, 129, 0.3);
    transform: translateY(-1px);
}

.btn-outline {
    background-color: transparent;
    color: var(--text-main);
    border: 1px solid var(--border-color);
}
.btn-outline:hover {
    background-color: var(--bg-surface-hover);
    border-color: var(--border-color-focus);
}

.btn-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: var(--radius-full);
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    transition: var(--transition);
    position: relative;
}
.btn-icon:hover {
    background-color: var(--bg-surface-hover);
    color: var(--text-main);
}
.btn-icon svg { width: 20px; height: 20px; }

/* Forms */
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-group label { font-size: 0.875rem; font-weight: 500; color: var(--text-main); }

.form-input, .form-select {
    width: 100%;
    padding: 0.625rem 1rem;
    font-size: 0.875rem;
    background-color: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-main);
    transition: var(--transition);
    outline: none;
}
.form-input::placeholder { color: var(--text-muted); }
.form-input:focus, .form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

.input-sm { padding: 0.5rem 0.75rem; border-radius: var(--radius-full); }

/* Checkbox */
.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.875rem;
    color: var(--text-muted);
    cursor: pointer;
}
.checkbox-label input { display: none; }
.checkbox-custom {
    width: 18px;
    height: 18px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}
.checkbox-label input:checked + .checkbox-custom {
    background-color: var(--primary);
    border-color: var(--primary);
}
.checkbox-label input:checked + .checkbox-custom::after {
    content: '';
    width: 4px;
    height: 8px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
    margin-bottom: 2px;
}

/* Cards */
.card {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    transition: box-shadow 0.3s ease;
}
.card:hover {
    box-shadow: var(--shadow-md);
}

.card-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
}
.card-title {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--text-main);
}
.card-body {
    padding: 1.5rem;
}

/* Tables */
.table-responsive { overflow-x: auto; }
.table {
    width: 100%;
    border-collapse: collapse;
    text-align: right;
}
.table th, .table td {
    padding: 1rem 1.5rem;
    font-size: 0.875rem;
    border-bottom: 1px solid var(--border-color);
}
.table th {
    font-weight: 600;
    color: var(--text-muted);
    background-color: var(--bg-surface-hover);
    white-space: nowrap;
}
.table td { color: var(--text-main); }
.table tbody tr:hover { background-color: var(--bg-base); }

/* Badges */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.625rem;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 600;
}
.badge-primary { background-color: var(--primary-light); color: var(--primary-dark); }
.badge-success { background-color: var(--primary-light); color: var(--primary-dark); }
.badge-warning { background-color: var(--accent-light); color: #B45309; }

/* Status Indicators */
.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
    margin-left: 6px;
}
.status-dot.green { background-color: var(--primary); box-shadow: 0 0 8px var(--primary); }
.status-dot.amber { background-color: var(--accent); }
.status-dot.blue { background-color: var(--info); }

/* Links */
.link { color: var(--primary); text-decoration: none; font-size: 0.875rem; font-weight: 500; }
.link:hover { text-decoration: underline; }

/* ==========================================================================
   LAYOUTS
   ========================================================================== */

.screen {
    width: 100vw;
    height: 100vh;
    display: flex;
}

/* --- LOGIN SCREEN --- */
.login-layout {
    display: flex;
    width: 100%;
    height: 100%;
}
.login-visual {
    flex: 1.2;
    background-color: var(--secondary);
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 4rem;
    color: white;
}
.visual-pattern {
    position: absolute;
    inset: 0;
    opacity: 0.05;
    background-image: radial-gradient(var(--primary) 2px, transparent 2px);
    background-size: 30px 30px;
}
.visual-content { position: relative; z-index: 10; max-width: 480px; }
.logo-mark {
    width: 48px;
    height: 48px;
    background-color: var(--primary);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    margin-bottom: 2rem;
}
.logo-mark.sm { width: 32px; height: 32px; border-radius: 8px; margin-bottom: 0; }
.logo-mark svg { width: 24px; height: 24px; }
.logo-mark.sm svg { width: 18px; height: 18px; }

.visual-content h1 { font-size: 2.5rem; font-weight: 800; margin-bottom: 1rem; line-height: 1.2; }
.visual-content p { font-size: 1.125rem; color: #94A3B8; line-height: 1.6; }

.login-form-container {
    flex: 1;
    background-color: var(--bg-surface);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}
.login-box {
    width: 100%;
    max-width: 400px;
}
.login-header { margin-bottom: 2.5rem; }
.login-header h2 { font-size: 1.5rem; font-weight: 700; color: var(--text-main); margin-bottom: 0.5rem; }
.login-header p { color: var(--text-muted); font-size: 0.95rem; }

.form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 1.5rem 0 2rem 0;
}

/* --- DASHBOARD SCREEN --- */
.mobile-header {
    display: none;
    height: 60px;
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border-color);
    padding: 0 1rem;
    align-items: center;
    justify-content: space-between;
}

.sidebar {
    width: var(--sidebar-width);
    background-color: var(--bg-surface);
    border-left: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    height: 100vh;
    flex-shrink: 0;
    transition: transform 0.3s ease;
    z-index: 50;
}

.sidebar-header {
    height: var(--header-height);
    padding: 0 1.5rem;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid var(--border-color);
}
.brand-text-container { display: flex; flex-direction: column; }
.brand-text { font-weight: 800; font-size: 1.125rem; color: var(--text-main); }
.brand-sub { font-size: 0.75rem; color: var(--text-muted); }

.sidebar-nav {
    flex: 1;
    padding: 1.5rem 1rem;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.nav-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    padding: 0 0.75rem;
    margin-bottom: 0.5rem;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0.75rem 1rem;
    border-radius: var(--radius-md);
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 500;
    transition: var(--transition);
}
.nav-item svg { width: 20px; height: 20px; }
.nav-item:hover {
    background-color: var(--bg-surface-hover);
    color: var(--text-main);
}
.nav-item.active {
    background-color: var(--primary-light);
    color: var(--primary-dark);
}
.nav-item .badge { margin-right: auto; }

.sidebar-footer {
    padding: 1.5rem;
    border-top: 1px solid var(--border-color);
}
.user-profile {
    display: flex;
    align-items: center;
    gap: 12px;
}
.avatar {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-full);
    overflow: hidden;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.user-details { display: flex; flex-direction: column; flex: 1; }
.user-name { font-size: 0.875rem; font-weight: 600; color: var(--text-main); }
.user-role { font-size: 0.75rem; color: var(--text-muted); }
.btn-logout { color: var(--danger); }
.btn-logout:hover { background-color: var(--danger-light); color: var(--danger); }

/* Main Workspace */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    height: 100vh;
    min-width: 0;
}

.topbar {
    height: var(--header-height);
    background-color: var(--bg-surface);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 2rem;
}

.search-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    width: 250px;
}
.search-input-wrapper svg {
    position: absolute;
    right: 12px;
    width: 16px;
    height: 16px;
    color: var(--text-muted);
}
.search-input-wrapper input { padding-right: 2.2rem; background: var(--bg-base); border: none; }

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

.notification-dot {
    position: absolute;
    top: 6px;
    right: 8px;
    width: 8px;
    height: 8px;
    background-color: var(--danger);
    border-radius: 50%;
    border: 2px solid var(--bg-surface);
}

.content-area {
    flex: 1;
    overflow-y: auto;
    padding: 2rem;
}

.tab-content { display: none; animation: fadeIn 0.4s ease; }
.tab-content.active { display: block; }

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

/* Page Headers */
.page-header { display: flex; justify-content: space-between; align-items: flex-end; }
.page-title { font-size: 1.5rem; font-weight: 800; color: var(--text-main); margin-bottom: 4px; }
.page-subtitle { color: var(--text-muted); font-size: 0.95rem; }

/* Dashboard Specifics */
.metric-card {
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}
.metric-icon {
    width: 56px;
    height: 56px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
}
.metric-icon svg { width: 28px; height: 28px; }
.metric-info { display: flex; flex-direction: column; }
.metric-label { font-size: 0.875rem; color: var(--text-muted); font-weight: 500; margin-bottom: 4px; }
.metric-value { font-size: 1.5rem; font-weight: 800; color: var(--text-main); }

/* Table filters */
.table-filters { display: flex; gap: 4px; background: var(--bg-base); padding: 4px; border-radius: var(--radius-md); border: 1px solid var(--border-color); }
.btn-filter {
    padding: 4px 12px;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 6px;
    border: none;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    transition: var(--transition);
}
.btn-filter.active { background: var(--bg-surface); color: var(--text-main); box-shadow: var(--shadow-sm); }

/* Halls List */
.halls-list { display: flex; flex-direction: column; gap: 1rem; }
.hall-item {
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1rem 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.hall-header { display: flex; justify-content: space-between; align-items: center; }
.hall-name { font-weight: 700; color: var(--text-main); }
.hall-badges { display: flex; gap: 8px; }
.hall-badge {
    padding: 4px 10px;
    background: var(--bg-base);
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--text-secondary);
}
.hall-progress-wrapper { width: 100%; height: 8px; background: var(--bg-base); border-radius: 4px; overflow: hidden; margin-top: 4px;}
.hall-progress { height: 100%; border-radius: 4px; transition: width 1s ease; }

/* Lists for Settings */
.list-group { list-style: none; display: flex; flex-direction: column; gap: 8px; }
.list-item {
    display: flex; justify-content: space-between; align-items: center;
    padding: 12px 16px;
    background: var(--bg-base);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    color: var(--text-main);
}

/* Toasts */
.toast-container { position: fixed; bottom: 20px; left: 20px; z-index: 9999; display: flex; flex-direction: column; gap: 10px; }
.toast {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-lg);
    padding: 12px 20px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 500;
    font-size: 0.875rem;
    animation: slideIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
.toast.success { border-right: 4px solid var(--primary); color: var(--text-main); }
.toast.error { border-right: 4px solid var(--danger); color: var(--text-main); }
@keyframes slideIn { from { transform: translateX(-20px); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

/* Modals */
.modal-overlay {
    position: fixed; inset: 0; background: rgba(15, 23, 42, 0.6); z-index: 9999;
    display: none; align-items: center; justify-content: center;
    backdrop-filter: blur(4px);
    animation: fadeIn 0.3s ease;
}
.modal-overlay.active { display: flex; }
.modal-content {
    background: var(--bg-surface); width: 100%; max-width: 600px;
    border-radius: var(--radius-lg); padding: 1.5rem;
    box-shadow: var(--shadow-lg); position: relative;
    border: 1px solid var(--border-color);
}
.modal-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1.5rem; }
.modal-title { font-size: 1.125rem; font-weight: 700; color: var(--text-main); }
.modal-close { background: transparent; border: none; color: var(--text-muted); cursor: pointer; }
.modal-close:hover { color: var(--danger); }

/* RESPONSIVE DESIGN */

/* Mobile Sidebar Overlay */
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 49;
    backdrop-filter: blur(2px);
}
.sidebar-overlay.active { display: block; }

/* Mobile Menu Button */
.btn-mobile-menu {
    display: none;
    background: transparent;
    border: none;
    cursor: pointer;
    color: var(--text-main);
    padding: 4px;
}
.btn-mobile-menu svg { width: 24px; height: 24px; }

/* === TABLET: max-width 1024px === */
@media (max-width: 1024px) {
    .grid-cols-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .grid-cols-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .card.col-span-2 { grid-column: span 1; }

    /* Sidebar becomes a drawer */
    .sidebar {
        position: fixed;
        right: -100%;
        top: 0;
        height: 100vh;
        box-shadow: var(--shadow-lg);
        z-index: 50;
    }
    .sidebar.open { right: 0; }

    /* Show mobile header, hide desktop topbar */
    .mobile-header { display: flex; }
    .topbar { display: none; }
    .btn-mobile-menu { display: flex; }

    /* Login page stacked */
    .login-layout { flex-direction: column; }
    .login-visual { padding: 2rem; flex: 0.5; }
}

/* === MOBILE: max-width 768px === */
@media (max-width: 768px) {
    :root {
        --header-height: 60px;
        --sidebar-width: 280px;
    }

    /* Grid adjustments */
    .grid-cols-2,
    .grid-cols-3,
    .grid-cols-4 { grid-template-columns: repeat(1, minmax(0, 1fr)); }

    /* Content area */
    .content-area { padding: 1rem; }

    /* Page header */
    .page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }
    .page-header .btn, .page-header .flex { width: 100%; justify-content: flex-start; flex-wrap: wrap; }

    /* Cards */
    .card-body { padding: 1rem; }
    .card-header { padding: 1rem; }

    /* Tables - make them scrollable on mobile */
    .table-responsive {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        border-radius: var(--radius-md);
    }
    .table th, .table td {
        padding: 0.75rem 1rem;
        font-size: 0.8rem;
        white-space: nowrap;
    }

    /* Topbar / Mobile header */
    .mobile-header {
        padding: 0 1rem;
        gap: 10px;
    }
    .topbar-actions .search-input-wrapper { display: none; }

    /* Modals - full screen on mobile */
    .modal-content {
        width: 95vw;
        max-width: 95vw;
        max-height: 90vh;
        overflow-y: auto;
        padding: 1rem;
        border-radius: var(--radius-md);
    }
    .modal-content.print-invoice {
        width: 98vw;
        max-width: 98vw;
    }

    /* Forms */
    .form-actions {
        flex-direction: column;
        gap: 0.75rem;
    }
    .form-actions .btn { width: 100%; justify-content: center; }

    /* Metric cards */
    .metric-card { padding: 1rem; gap: 0.75rem; }
    .metric-value { font-size: 1.25rem; }
    .metric-icon { width: 44px; height: 44px; }

    /* Hall items */
    .hall-header { flex-direction: column; align-items: flex-start; gap: 8px; }
    .hall-badges { flex-wrap: wrap; }

    /* List items */
    .list-item { flex-direction: column; align-items: flex-start; gap: 8px; }

    /* Tabs / Filters */
    .table-filters { flex-wrap: wrap; gap: 4px; }
    .btn-filter { font-size: 0.7rem; padding: 4px 8px; }

    /* Login page */
    .login-visual { display: none; }
    .login-form-container { padding: 1.5rem 1rem; }
    .login-box { max-width: 100%; }
    .visual-content h1 { font-size: 1.8rem; }

    /* Invoice meta - single column on mobile */
    .invoice-bill-meta {
        grid-template-columns: 1fr;
        gap: 0.5rem;
        font-size: 0.8rem;
    }
    .invoice-signature-section {
        grid-template-columns: 1fr;
        gap: 1rem;
        margin-top: 1.5rem;
    }

    /* Sidebar footer watermark */
    .sidebar-footer { padding: 1rem; }

    /* Toast on mobile - bottom right */
    .toast-container {
        left: 10px;
        right: 10px;
        bottom: 10px;
    }
    .toast { font-size: 0.8rem; }

    /* Financial year selector in breadcrumb */
    .breadcrumb { gap: 8px !important; }
    .breadcrumb select { font-size: 0.75rem !important; }
}

/* === SMALL MOBILE: max-width 480px === */
@media (max-width: 480px) {
    .content-area { padding: 0.75rem; }
    .page-title { font-size: 1.2rem; }
    .card-body { padding: 0.75rem; }

    /* Hide brand sub on very small screens */
    .brand-sub { display: none; }

    /* Buttons smaller */
    .btn { padding: 0.5rem 1rem; font-size: 0.8rem; }

    /* Table font size */
    .table th, .table td { font-size: 0.75rem; padding: 0.6rem 0.75rem; }
}

/* ==========================================================================
   PRINT STYLES & INVOICE RECEIPT
   ========================================================================== */
@media print {
    body * {
        visibility: hidden;
    }
    #modal-print-invoice, #modal-print-invoice * {
        visibility: visible;
    }
    #modal-print-invoice {
        position: absolute;
        inset: 0 !important;
        background: white !important;
        color: black !important;
        display: block !important;
        box-shadow: none !important;
        border: none !important;
        z-index: 99999 !important;
    }
    .modal-content.print-invoice {
        width: 100% !important;
        max-width: 100% !important;
        box-shadow: none !important;
        border: none !important;
        background: white !important;
        padding: 0 !important;
        margin: 0 !important;
    }
    .no-print {
        display: none !important;
    }
}

.modal-content.print-invoice {
    max-width: 750px;
    background: var(--bg-surface);
}
.invoice-bill-header {
    border-bottom: 2px double var(--border-color);
    padding-bottom: 1rem;
    margin-bottom: 1rem;
}
.invoice-bill-title {
    font-size: 1.35rem;
    font-weight: 800;
    text-align: center;
    color: var(--primary-dark);
}
.invoice-bill-meta {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
    background: var(--bg-base);
    padding: 0.85rem 1.25rem;
    border-radius: var(--radius-md);
    margin-bottom: 1rem;
    font-size: 0.85rem;
}
.invoice-bill-meta div {
    display: flex;
    justify-content: space-between;
}
.invoice-signature-section {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin-top: 3rem;
    text-align: center;
    font-size: 0.85rem;
}
.invoice-signature-box {
    border-top: 1px dashed var(--border-color);
    padding-top: 0.5rem;
    height: 100px;
}

