:root {
    --primary: #6366f1;
    --primary-hover: #4f46e5;
    --secondary: #ec4899;
    --bg-color: #0f172a;
    --surface: rgba(30, 41, 59, 0.7);
    --surface-border: rgba(255, 255, 255, 0.1);
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --danger: #ef4444;
    --success: #10b981;
    --font-family: 'Inter', system-ui, sans-serif;
}

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

body {
    font-family: var(--font-family);
    background: var(--bg-color);
    background-image: 
        radial-gradient(at 0% 0%, rgba(99, 102, 241, 0.15) 0px, transparent 50%),
        radial-gradient(at 100% 100%, rgba(236, 72, 153, 0.15) 0px, transparent 50%);
    background-attachment: fixed;
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

a { text-decoration: none; color: inherit; }

/* Glassmorphism Classes */
.glass {
    background: var(--surface);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--surface-border);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
}

.glass-card {
    border-radius: 16px;
    padding: 2rem;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.glass-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

/* Header & Nav */
.header {
    position: sticky;
    top: 0;
    z-index: 990;
    padding: 0.85rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}

.mobile-nav-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 950;
    opacity: 0;
    transition: opacity 0.25s ease;
}
.mobile-nav-overlay.active {
    display: block;
    opacity: 1;
}

.menu-toggle {
    display: none;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    cursor: pointer;
    text-decoration: none;
}

.logo .brand-logo {
    height: 32px;
    width: auto;
    transition: transform 0.3s ease;
}

.logo .brand-text {
    font-size: 1.4rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    white-space: nowrap;
}

.logo:hover .brand-logo {
    transform: scale(1.05);
}

.nav-menu {
    display: flex;
    gap: 0.75rem;
    list-style: none;
    align-items: center;
}

.nav-link {
    font-weight: 600;
    color: #94a3b8;
    transition: all 0.25s ease;
    padding: 0.6rem 1rem;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-height: 40px;
    font-size: 0.95rem;
}

.nav-link:hover {
    color: #f8fafc;
    background: rgba(255, 255, 255, 0.08);
    transform: translateY(-1px);
}

.nav-link.active {
    color: #ffffff;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.3), rgba(79, 70, 229, 0.3));
    border: 1px solid rgba(99, 102, 241, 0.4);
    box-shadow: 0 2px 10px rgba(99, 102, 241, 0.2);
}

.nav-item-dropdown {
    position: relative;
}

.nav-chevron {
    font-size: 0.75em;
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

[dir="ltr"] .nav-chevron {
    margin-left: 0.3rem;
}
[dir="rtl"] .nav-chevron {
    margin-right: 0.3rem;
}

.nav-item-dropdown.is-open .nav-chevron {
    transform: rotate(180deg);
}

.nav-dropdown-menu {
    position: absolute;
    top: 100%;
    margin-top: 0.5rem;
    padding: 0.5rem;
    list-style: none;
    z-index: 990;
    min-width: 180px;
    background: rgba(30, 41, 59, 0.95) !important;
    backdrop-filter: blur(12px) !important;
    -webkit-backdrop-filter: blur(12px) !important;
    border: 1px solid rgba(255, 255, 255, 0.15) !important;
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.7) !important;
    border-radius: 12px !important;
}

[dir="ltr"] .nav-dropdown-menu {
    left: 0;
    right: auto;
}
[dir="rtl"] .nav-dropdown-menu {
    right: 0;
    left: auto;
}
[dir="ltr"] .nav-dropdown-menu.profile-dropdown {
    right: 0;
    left: auto;
}
[dir="rtl"] .nav-dropdown-menu.profile-dropdown {
    left: 0;
    right: auto;
}

.nav-dropdown-menu .nav-link {
    color: #cbd5e1;
    min-height: 42px;
    padding: 0.6rem 0.9rem;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.nav-dropdown-menu .nav-link:hover {
    color: #ffffff;
    background: rgba(99, 102, 241, 0.2);
}

.nav-link-logout {
    color: var(--danger) !important;
}
.nav-link-logout:hover {
    background: rgba(239, 68, 68, 0.15) !important;
}

.dropdown-divider {
    border: none;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    margin: 0.5rem 0;
}

/* Sub-tree Navigation Menu */
.nav-submenu-item {
    position: relative;
    list-style: none;
}

.nav-submenu-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    cursor: pointer;
}

.submenu-chevron {
    font-size: 0.75em;
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

[dir="ltr"] .submenu-chevron {
    margin-left: 0.3rem;
}
[dir="rtl"] .submenu-chevron {
    margin-right: 0.3rem;
}

.nav-submenu-item.is-open > .nav-submenu-toggle .submenu-chevron {
    transform: rotate(180deg);
}

.nav-subtree-menu {
    list-style: none;
    padding: 0;
    margin: 0.3rem 0;
}

[dir="ltr"] .nav-subtree-menu {
    padding-left: 0.85rem;
    margin-left: 0.4rem;
    border-left: 2px solid rgba(99, 102, 241, 0.35);
}

[dir="rtl"] .nav-subtree-menu {
    padding-right: 0.85rem;
    margin-right: 0.4rem;
    border-right: 2px solid rgba(99, 102, 241, 0.35);
}

.nav-subtree-menu .nav-link {
    min-height: 38px;
    padding: 0.5rem 0.75rem;
    font-size: 0.88rem;
    border-radius: 6px;
    color: #cbd5e1;
}

.nav-subtree-menu .nav-link:hover,
.nav-subtree-menu .nav-link.active {
    background: rgba(99, 102, 241, 0.25) !important;
    color: #ffffff !important;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-family: var(--font-family);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-hover));
    color: white;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 8px 25px rgba(99, 102, 241, 0.4);
}

/* Forms */
.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    color: var(--text-muted);
    font-weight: 500;
}

.form-control {
    width: 100%;
    padding: 0.75rem 1rem;
    background: rgba(15, 23, 42, 0.5);
    border: 1px solid var(--surface-border);
    border-radius: 8px;
    color: var(--text-main);
    font-family: var(--font-family);
    transition: all 0.3s ease;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
    background: rgba(15, 23, 42, 0.8);
}

/* Auth Layout */
.auth-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.auth-box {
    width: 100%;
    max-width: 420px;
}

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

/* Main Content */
.main-content {
    flex: 1;
    padding: 2rem;
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
}

.page-title {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    color: var(--text-main);
}

/* Utilities */
.text-center { text-align: center; }
.mt-4 { margin-top: 1rem; }
.fade-in { animation: fadeIn 0.5s ease; }

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

/* Loading Spinner */
.spinner {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    display: none;
}

.btn.loading .spinner {
    display: block;
}

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

/* Dashboard Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: rgba(99, 102, 241, 0.1);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.stat-info h3 {
    color: var(--text-muted);
    font-size: 0.9rem;
    font-weight: 500;
}

.stat-info p {
    font-size: 1.5rem;
    font-weight: 700;
    margin-top: 0.25rem;
}

/* Responsive Grid Utilities (Better than inline styles) */
.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.responsive-tabs {
    display: flex;
    flex-direction: column;
    width: 100%;
    gap: 1.5rem;
}

.sidebar-nav {
    width: 100%;
    flex-shrink: 0;
}

.table-responsive {
    overflow-x: auto;
    width: 100%;
}

/* Modal Responsive */
.modal {
    max-height: 90vh;
    overflow-y: auto;
}

/* ========== TABLET AND MOBILE RESPONSIVENESS ========== */
/* ========== TABLET AND MOBILE RESPONSIVENESS ========== */
@media (max-width: 1024px) {
    /* Tablet layout adjustment */
    .responsive-tabs {
        flex-direction: column;
    }
    .sidebar-nav {
        width: 100%;
        margin-bottom: 1rem;
    }

    /* Header & Navigation Collapse for Mobile & Tablet */
    .menu-toggle {
        display: flex !important;
        background: rgba(255, 255, 255, 0.08);
        border: 1px solid rgba(255, 255, 255, 0.15);
        color: #f8fafc;
        font-size: 1.3rem;
        cursor: pointer;
        width: 44px;
        height: 44px;
        border-radius: 10px;
        align-items: center;
        justify-content: center;
        transition: all 0.2s ease;
        touch-action: manipulation;
    }
    .menu-toggle:active {
        transform: scale(0.92);
        background: rgba(99, 102, 241, 0.2);
    }
    .header {
        flex-direction: row !important;
        justify-content: space-between !important;
        padding: 0.75rem 1.25rem !important;
        position: sticky !important;
        top: 0 !important;
        z-index: 1000 !important;
        background: rgba(15, 23, 42, 0.92) !important;
        backdrop-filter: blur(16px) !important;
        -webkit-backdrop-filter: blur(16px) !important;
        border-bottom: 1px solid rgba(255, 255, 255, 0.15) !important;
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.6) !important;
    }
    .nav-menu {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: rgba(30, 41, 59, 0.96) !important;
        backdrop-filter: blur(16px) !important;
        -webkit-backdrop-filter: blur(16px) !important;
        border-bottom: 3px solid var(--primary) !important;
        border-top: 1px solid rgba(255, 255, 255, 0.1) !important;
        padding: 1rem 1.25rem;
        flex-direction: column !important;
        gap: 0.6rem !important;
        z-index: 1000;
        box-shadow: 0 20px 50px rgba(0, 0, 0, 0.9) !important;
        max-height: calc(100vh - 70px);
        overflow-y: auto;
        overscroll-behavior: contain;
        transform: translateY(-8px);
        opacity: 0;
        transition: opacity 0.25s ease, transform 0.25s ease;
    }
    .nav-menu.active {
        display: flex !important;
        transform: translateY(0);
        opacity: 1;
    }
    .nav-menu li {
        width: 100%;
    }
    .nav-link {
        width: 100%;
        justify-content: space-between;
        padding: 0.75rem 1rem !important;
        min-height: 44px;
        font-size: 0.95rem;
        background: rgba(255, 255, 255, 0.04);
        border: 1px solid rgba(255, 255, 255, 0.08);
        border-radius: 10px;
        color: #f1f5f9 !important;
    }
    .nav-link:hover, .nav-link.active {
        background: rgba(99, 102, 241, 0.25) !important;
        border-color: rgba(99, 102, 241, 0.4) !important;
        color: #ffffff !important;
    }
    .nav-item-dropdown .nav-dropdown-menu {
        position: static !important;
        width: 100% !important;
        margin-top: 0.4rem !important;
        box-shadow: none !important;
        background: rgba(15, 23, 42, 0.85) !important;
        border: 1px solid rgba(99, 102, 241, 0.35) !important;
        border-inline-start: 4px solid var(--primary) !important;
        border-radius: 10px !important;
        padding: 0.5rem !important;
    }
    [dir="rtl"] .nav-item-dropdown .nav-dropdown-menu {
        border-left: none !important;
        border-right: 4px solid var(--primary) !important;
    }
    [dir="ltr"] .nav-item-dropdown .nav-dropdown-menu {
        border-right: none !important;
        border-left: 4px solid var(--primary) !important;
    }
    .nav-item-dropdown .nav-dropdown-menu .nav-link {
        background: transparent !important;
        border: none !important;
        padding: 0.75rem 0.85rem !important;
        min-height: 44px !important;
        color: #cbd5e1 !important;
        display: flex !important;
        align-items: center !important;
    }
    .nav-item-dropdown .nav-dropdown-menu .nav-link:hover,
    .nav-item-dropdown .nav-dropdown-menu .nav-link.active {
        background: rgba(99, 102, 241, 0.2) !important;
        color: #ffffff !important;
    }
    .nav-subtree-menu .nav-link {
        padding: 0.65rem 0.75rem !important;
        min-height: 42px !important;
        font-size: 0.9rem !important;
    }
    
    /* Global Spacing */
    .main-content {
        padding: 1rem;
    }
    .page-title {
        font-size: 1.5rem;
    }
    
    /* Glass Cards */
    .glass-card {
        padding: 1rem;
    }
    
    /* Forms & Grids Collapse */
    .form-row {
        grid-template-columns: 1fr;
        gap: 1rem;
        margin-bottom: 1rem;
    }
    
    /* DataTables specific override */
    .top {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 1rem;
    }
    .dt-buttons {
        display: flex;
        flex-direction: column;
        gap: 0.5rem;
    }
    .dt-buttons .dt-btn {
        margin: 0 !important;
        width: 100%;
    }
    
    /* Stat Cards */
    .stats-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    /* Mobile specific fine-tuning */
    .page-title {
        font-size: 1.25rem;
    }
    .btn {
        width: 100%;
        margin-bottom: 0.5rem;
    }
    .logo .brand-logo {
        height: 28px;
    }
    .logo .brand-text {
        font-size: 1.2rem;
    }
}

/* Light Theme Overrides */
body.theme-light {
    --bg-color: #f1f5f9;
    --surface: rgba(255, 255, 255, 0.85);
    --surface-border: rgba(0, 0, 0, 0.1);
    --text-main: #0f172a;
    --text-muted: #475569;
}
body.theme-light .header {
    background: rgba(255, 255, 255, 0.88) !important;
    backdrop-filter: blur(16px) !important;
    -webkit-backdrop-filter: blur(16px) !important;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08) !important;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05) !important;
}
body.theme-light .nav-link {
    color: #475569;
}
body.theme-light .nav-link:hover, body.theme-light .nav-link.active {
    background: rgba(99, 102, 241, 0.1) !important;
    color: var(--primary) !important;
}
body.theme-light .nav-item-dropdown > ul {
    background: #ffffff !important;
    border: 1px solid rgba(0, 0, 0, 0.1) !important;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1) !important;
}
body.theme-light .nav-item-dropdown > ul .nav-link {
    color: #334155 !important;
}
body.theme-light .nav-item-dropdown > ul .nav-link:hover {
    background: rgba(99, 102, 241, 0.1) !important;
    color: var(--primary) !important;
}
@media (max-width: 1024px) {
    body.theme-light .menu-toggle {
        background: rgba(0, 0, 0, 0.05);
        border: 1px solid rgba(0, 0, 0, 0.1);
        color: #334155;
    }
    body.theme-light .nav-menu {
        background: rgba(255, 255, 255, 0.96) !important;
        backdrop-filter: blur(16px) !important;
        -webkit-backdrop-filter: blur(16px) !important;
        border-top: 1px solid rgba(0, 0, 0, 0.05) !important;
        box-shadow: 0 20px 50px rgba(0, 0, 0, 0.15) !important;
    }
    body.theme-light .nav-menu .nav-link {
        background: rgba(0, 0, 0, 0.03);
        border-color: rgba(0, 0, 0, 0.06);
        color: #334155 !important;
    }
    body.theme-light .nav-item-dropdown .nav-dropdown-menu {
        background: #f8fafc !important;
        border-color: rgba(0, 0, 0, 0.1) !important;
    }
}
body.theme-light .glass {
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.05);
}
body.theme-light .form-control {
    background: rgba(255,255,255,0.9);
    color: var(--text-main);
}
body.theme-light .form-control:focus {
    background: #fff;
    border-color: var(--primary);
}
body.theme-light tr {
    border-color: rgba(0,0,0,0.05) !important;
}
body.theme-light .badge {
    background: rgba(99, 102, 241, 0.1) !important;
}
body.theme-light .search-dropdown-results {
    background: #ffffff !important;
    border: 1px solid rgba(0, 0, 0, 0.18) !important;
    box-shadow: 0 12px 36px rgba(0, 0, 0, 0.15) !important;
    color: #0f172a !important;
}
body.theme-light .search-result-item {
    border-bottom: 1px solid rgba(0, 0, 0, 0.08) !important;
    color: #0f172a !important;
}
body.theme-light .search-result-item strong,
body.theme-light .search-result-item div,
body.theme-light .search-result-item p {
    color: #0f172a !important;
}
body.theme-light .search-result-item span,
body.theme-light .search-result-item small {
    color: #64748b !important;
}
body.theme-light .search-result-item:hover {
    background: rgba(99, 102, 241, 0.12) !important;
    color: #0f172a !important;
}

/* ========== PRINT GLOBAL QUERIES ========== */
@media print {
    * {
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
        color-adjust: exact !important;
    }
    .no-print, .header, .sidebar-nav, .dt-buttons {
        display: none !important;
    }
    body {
        background: white !important;
        color: black !important;
        background-image: none !important;
    }
    .main-content {
        margin: 0 !important;
        padding: 0 !important;
        max-width: 100% !important;
    }
    .glass, .glass-card {
        box-shadow: none !important;
        border: none !important;
        backdrop-filter: none !important;
        background: white !important;
        color: black !important;
        padding: 0 !important;
    }
}

/* Profile Layout Responsiveness */
.profile-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 2rem;
    gap: 1rem;
}

.profile-grid {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 2rem;
}

@media (max-width: 768px) {
    .profile-header {
        flex-direction: column;
        align-items: stretch;
    }
    .profile-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
}

/* Responsive outstanding balance card */
@media (max-width: 576px) {
    .total-outstanding-card {
        width: 100% !important;
        text-align: center !important;
    }
}

/* Supplier profile header actions responsiveness */
@media (max-width: 576px) {
    .supplier-header-actions {
        width: 100% !important;
        flex-direction: column !important;
        align-items: stretch !important;
    }
    .supplier-header-actions > div {
        width: 100% !important;
    }
}

/* ========== PRINT TEMPLATE MOBILE RESPONSIVENESS ========== */
@media screen and (max-width: 768px) {
    .document-wrapper {
        padding: 0.5rem !important;
        overflow-x: auto !important;
        justify-content: flex-start !important;
    }
    .print-document {
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
        padding: 1rem !important;
        border-radius: 8px !important;
    }
    .print-document .inv-header {
        margin-bottom: 1.5rem !important;
    }
    .print-document .inv-meta {
        flex-direction: column !important;
        gap: 0.5rem !important;
        margin-bottom: 1.5rem !important;
        padding-bottom: 0.5rem !important;
    }
    .print-document .inv-details {
        text-align: left !important;
    }
    .print-document .inv-table {
        display: block !important;
        width: 100% !important;
        overflow-x: auto !important;
        white-space: nowrap !important;
        margin-bottom: 1.5rem !important;
    }
    /* Toolbar controls wrapper stacking */
    .no-print.glass-card > div:last-child,
    .no-print.glass > div:last-child {
        display: flex !important;
        flex-wrap: wrap !important;
        gap: 0.5rem !important;
    }
    .no-print.glass-card > div:last-child > *,
    .no-print.glass > div:last-child > * {
        flex: 1 1 auto !important;
        width: 100% !important;
    }
    .no-print.glass-card > div:last-child > .btn,
    .no-print.glass-card > div:last-child > .form-control,
    .no-print.glass > div:last-child > .btn,
    .no-print.glass > div:last-child > .form-control {
        text-align: center !important;
        justify-content: center !important;
        margin: 0 !important;
    }
    /* Signature area stacking */
    .print-document div:has(> div > img),
    .print-document div:has(> div > hr),
    .print-document div:has(> div[onclick*="openSignatureModal"]),
    .print-document div[style*="justify-content"],
    .print-document div[style*="space-between"] {
        flex-direction: column !important;
        align-items: center !important;
        gap: 2rem !important;
        display: flex !important;
    }
    .print-document div:has(> div > img) > div,
    .print-document div:has(> div > hr) > div,
    .print-document div:has(> div[onclick*="openSignatureModal"]) > div,
    .print-document div[style*="justify-content"] > div,
    .print-document div[style*="space-between"] > div {
        width: 100% !important;
        text-align: center !important;
    }
    /* Modals responsive adjustments */
    .modal {
        width: 90% !important;
        max-width: 90% !important;
    }
    @media (max-width: 576px) {
        .modal div[style*="display: flex"][style*="justify-content"],
        .modal div[style*="display:flex"][style*="justify-content"] {
            flex-direction: column !important;
            align-items: stretch !important;
            gap: 0.5rem !important;
            width: 100% !important;
            display: flex !important;
        }
        .modal div[style*="display: flex"][style*="justify-content"] > div,
        .modal div[style*="display:flex"][style*="justify-content"] > div {
            flex-direction: column !important;
            align-items: stretch !important;
            gap: 0.5rem !important;
            width: 100% !important;
            display: flex !important;
        }
        .modal .btn {
            width: 100% !important;
            margin: 0 !important;
        }
    }
}

/* Premium Settings Checklist and Switches */
.print-settings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 250px), 1fr));
    gap: 1rem;
}
.print-setting-toggle {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    padding: 0.75rem 1rem;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--surface-border);
    border-radius: 8px;
    transition: all 0.2s ease;
    height: 44px;
}
.print-setting-toggle:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(99, 102, 241, 0.3);
}
.print-setting-toggle input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin: 0;
    cursor: pointer;
    accent-color: var(--primary);
}
.print-setting-toggle span {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-main);
}

