/* -------------------------------------------------------------
 * FUTUREBLOOM SCIENTIFIC - Backend GST Billing Software CSS
 * High-Density Compact 80% Zoom Standard at 100% Viewport
 * ------------------------------------------------------------- */

:root {
    --bg-main: #F8FAFC;
    --bg-sidebar: #FFFFFF;
    --bg-card: #FFFFFF;
    --bg-card-alt: #F1F5F9;
    --primary: #0284C7;
    --primary-hover: #0369A1;
    --primary-glow: rgba(2, 132, 199, 0.18);
    --accent-emerald: #059669;
    --accent-purple: #6366F1;
    --accent-orange: #D97706;
    --accent-red: #DC2626;
    --text-bright: #0F172A;
    --text-muted: #475569;
    --text-dim: #64748B;
    --border-color: #E2E8F0;
    --border-highlight: rgba(2, 132, 199, 0.35);
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;
    --font-main: 'Plus Jakarta Sans', sans-serif;
    --font-heading: 'Space Grotesk', sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
}

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

/* 80% Compact Zoom Scale Standard */
html {
    font-size: 13px; /* Scales down all rem elements smoothly for clean 80% zoom look */
}

body {
    font-family: var(--font-main);
    background-color: var(--bg-main);
    color: var(--text-bright);
    line-height: 1.45;
    overflow-x: hidden;
}

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

/* Sidebar - Sleek Deep Ocean Navy */
.sidebar {
    width: 235px;
    background: linear-gradient(180deg, #0B172A 0%, #0F253E 100%);
    border-right: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    flex-direction: column;
    padding: 1.1rem 0.85rem;
    position: fixed;
    height: 100vh;
    z-index: 100;
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.2);
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    margin-bottom: 1.1rem;
    padding-bottom: 0.85rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.brand-info h2 {
    font-family: var(--font-heading);
    font-size: 0.98rem;
    font-weight: 800;
    color: #FFFFFF;
    letter-spacing: 0.04em;
    line-height: 1.2;
}

.brand-info p {
    font-size: 0.62rem;
    font-weight: 800;
    color: #38BDF8;
    letter-spacing: 0.12em;
}

/* Luminous Slate GSTIN Badge */
.client-gst-badge {
    background: rgba(255, 255, 255, 0.07);
    border: 1px solid rgba(56, 189, 248, 0.25);
    border-radius: 12px;
    padding: 0.65rem 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.65rem;
    margin-bottom: 1.1rem;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(8px);
}

.client-gst-badge i {
    font-size: 1.1rem;
    color: #38BDF8;
    background: rgba(56, 189, 248, 0.15);
    border: 1px solid rgba(56, 189, 248, 0.3);
    width: 34px;
    height: 34px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.client-gst-badge strong {
    display: block;
    font-size: 0.74rem;
    font-weight: 800;
    color: #FFFFFF;
    font-family: var(--font-mono);
}

.client-gst-badge span {
    font-size: 0.65rem;
    color: #34D399;
    font-weight: 700;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    flex: 1;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.5rem 0.7rem;
    color: #94A3B8;
    text-decoration: none;
    font-size: 0.84rem;
    font-weight: 600;
    border-radius: 8px;
    transition: all 0.18s ease;
}

.nav-icon-box {
    width: 30px;
    height: 30px;
    border-radius: 7px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    flex-shrink: 0;
    transition: all 0.18s ease;
}

.nav-icon-box.blue { background: rgba(56, 189, 248, 0.15); color: #38BDF8; }
.nav-icon-box.emerald { background: rgba(52, 211, 153, 0.15); color: #34D399; }
.nav-icon-box.purple { background: rgba(165, 180, 252, 0.15); color: #A5B4FC; }
.nav-icon-box.amber { background: rgba(251, 191, 36, 0.15); color: #FBBF24; }
.nav-icon-box.teal { background: rgba(45, 212, 191, 0.15); color: #2DD4BF; }
.nav-icon-box.rose { background: rgba(251, 113, 133, 0.15); color: #FB7185; }

.nav-item:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #FFFFFF;
}

.nav-item:hover .nav-icon-box {
    transform: scale(1.08);
}

.nav-item.active {
    background: linear-gradient(135deg, #0284C7 0%, #0369A1 100%);
    color: #FFFFFF;
    font-weight: 700;
    box-shadow: 0 4px 16px rgba(2, 132, 199, 0.4);
}

.nav-item.active .nav-icon-box {
    background: rgba(255, 255, 255, 0.25);
    color: #FFFFFF;
}

.sidebar-footer {
    padding-top: 0.75rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.vybill-tag {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 20px;
    padding: 0.45rem 0.75rem;
    color: #CBD5E1;
    font-size: 0.75rem;
    font-weight: 600;
}

.vybill-tag strong {
    color: #38BDF8;
    font-weight: 800;
}

/* Main Content Area */
.main-content {
    margin-left: 230px;
    flex: 1;
    padding: 1.25rem 1.5rem;
    min-height: 100vh;
}

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

.topbar-title h1 {
    font-family: var(--font-heading);
    font-size: 1.45rem;
    font-weight: 700;
}

.topbar-title p {
    font-size: 0.82rem;
    color: var(--text-muted);
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.user-pill {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.4rem 0.85rem;
    background: #FFFFFF;
    border: 1px solid #E2E8F0;
    border-radius: 50px;
    font-size: 0.8rem;
    color: #0F172A;
    box-shadow: 0 2px 6px rgba(15, 23, 42, 0.04);
}

/* Tab Pages */
.tab-page {
    display: none;
}

.tab-page.active {
    display: block;
    animation: fadeIn 0.25s ease;
}

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

/* Metrics Grid */
.metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: 1rem;
    margin-bottom: 1.25rem;
}

.metric-card {
    background: #FFFFFF;
    border: 1px solid #E2E8F0;
    border-radius: var(--radius-md);
    padding: 1rem 1.15rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.05);
    transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.metric-card:hover {
    transform: translateY(-2px);
    border-color: rgba(2, 132, 199, 0.4);
    box-shadow: 0 8px 24px rgba(2, 132, 199, 0.12);
}

.metric-icon {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    flex-shrink: 0;
}

.metric-card.gold .metric-icon { background: rgba(217, 119, 6, 0.12); color: var(--accent-orange); border: 1px solid rgba(217, 119, 6, 0.25); }
.metric-card.blue .metric-icon { background: rgba(2, 132, 199, 0.12); color: var(--primary); border: 1px solid rgba(2, 132, 199, 0.25); }
.metric-card.purple .metric-icon { background: rgba(99, 102, 241, 0.12); color: var(--accent-purple); border: 1px solid rgba(99, 102, 241, 0.25); }
.metric-card.red .metric-icon { background: rgba(220, 38, 38, 0.12); color: var(--accent-red); border: 1px solid rgba(220, 38, 38, 0.25); }

.metric-info .label {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 600;
}

.metric-info .value {
    font-size: 1.35rem;
    font-weight: 800;
    margin: 0.1rem 0;
    color: var(--text-bright);
}

.metric-info .sub {
    font-size: 0.7rem;
    font-weight: 600;
}

/* Cards */
.content-card {
    background: #FFFFFF;
    border: 1px solid #E2E8F0;
    border-radius: var(--radius-md);
    padding: 1.25rem 1.4rem;
    box-shadow: 0 4px 20px rgba(15, 23, 42, 0.05);
    position: relative;
}

.mb-3 { margin-bottom: 1rem; }
.mb-4 { margin-bottom: 1.25rem; }
.mt-3 { margin-top: 1rem; }
.my-3 { margin-top: 1rem; margin-bottom: 1rem; }

.card-header {
    margin-bottom: 0.75rem;
}

.card-header-title {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.step-badge {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--accent-emerald));
    color: #fff;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.82rem;
    flex-shrink: 0;
}

.border-bottom-subtle {
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.6rem;
}

.flex-between {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.card-header h2, .card-header h3 {
    font-size: 1.1rem;
}

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

/* Edit Mode Banner */
.edit-banner-strip {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.2), rgba(239, 68, 68, 0.2));
    border: 1px solid var(--accent-orange);
    border-radius: var(--radius-md);
    padding: 0.65rem 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.edit-banner-text {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    color: var(--accent-orange);
    font-size: 0.88rem;
    font-weight: 700;
}

.edit-banner-text strong {
    font-family: var(--font-mono);
    font-size: 1rem;
    color: #fff;
}

/* BUILDER SPLIT LAYOUT */
.builder-layout {
    display: grid;
    grid-template-columns: 1fr 310px;
    gap: 1.25rem;
    align-items: start;
}

.builder-main {
    display: flex;
    flex-direction: column;
}

.quick-client-picker {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.small-label {
    font-size: 0.75rem;
    color: var(--primary);
    margin-bottom: 0;
    white-space: nowrap;
}

#quick-client-select {
    padding: 0.4rem 0.75rem;
    font-size: 0.82rem;
    background: #FFFFFF;
    border: 1.5px solid #0284C7;
    border-radius: var(--radius-sm);
    color: #0F172A;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(2, 132, 199, 0.1);
}

select option {
    background-color: #FFFFFF !important;
    color: #0F172A !important;
    font-weight: 600;
    padding: 8px 12px;
}

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

.input-icon-wrap i {
    position: absolute;
    left: 10px;
    color: var(--text-dim);
    font-size: 0.85rem;
}

.input-icon-wrap input {
    padding-left: 32px;
}

/* Form Controls */
.form-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

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

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

label {
    display: block;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 0.3rem;
}

input, select, textarea {
    width: 100%;
    padding: 0.55rem 0.75rem;
    background: #FFFFFF;
    border: 1px solid #CBD5E1;
    border-radius: var(--radius-sm);
    color: var(--text-bright);
    font-family: inherit;
    font-size: 0.85rem;
    transition: all 0.2s ease;
}

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.15);
}

/* Line Items Table */
.pretty-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0 0.4rem;
}

.pretty-table th {
    font-size: 0.72rem;
    color: var(--text-muted);
    text-transform: uppercase;
    text-align: left;
    padding: 0.5rem 0.65rem;
}

.pretty-table tbody tr {
    background: #FFFFFF;
    border: 1px solid #E2E8F0;
    border-radius: var(--radius-sm);
    transition: background 0.2s ease;
}

.pretty-table tbody tr:hover {
    background: #F8FAFC;
}

.pretty-table td {
    padding: 0.5rem 0.65rem;
}

.btn-remove-row {
    background: rgba(239, 68, 68, 0.15);
    color: var(--accent-red);
    border: 1px solid rgba(239, 68, 68, 0.3);
    width: 28px;
    height: 28px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-remove-row:hover {
    background: var(--accent-red);
    color: #fff;
}

/* Sticky Summary Card */
.sticky-summary-card {
    position: sticky;
    top: 80px;
    background: #FFFFFF;
    border: 1px solid #E2E8F0;
    box-shadow: 0 8px 30px rgba(15, 23, 42, 0.08);
}

.invoice-summary-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border-color);
}

.inv-badge-pill {
    padding: 0.25rem 0.6rem;
    background: rgba(0, 180, 216, 0.15);
    border: 1px solid rgba(0, 180, 216, 0.3);
    color: var(--primary);
    border-radius: 50px;
    font-size: 0.72rem;
    font-weight: 700;
}

.inv-number-display {
    text-align: right;
}

.inv-number-display small {
    display: block;
    font-size: 0.6rem;
    color: var(--text-dim);
    text-transform: uppercase;
}

.inv-number-display strong {
    font-family: var(--font-mono);
    font-size: 1.1rem;
    color: var(--accent-emerald);
}

.date-picker-styled {
    background: #FFFFFF;
    color: #0F172A;
    border-color: #CBD5E1;
}

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

.live-calc-box {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.calc-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.calc-item strong {
    color: var(--text-bright);
    font-size: 0.88rem;
}

.border-top-dashed {
    border-top: 1px dashed var(--border-color);
    padding-top: 0.6rem;
}

.grand-total-highlight {
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.3);
    border-radius: var(--radius-sm);
    padding: 0.75rem;
    margin: 0.4rem 0;
}

.grand-total-highlight h2 {
    font-family: var(--font-mono);
    font-size: 1.45rem;
    color: var(--accent-emerald);
}

.status-select-styled {
    font-weight: 700;
    color: var(--accent-orange);
    border-color: rgba(245, 158, 11, 0.4);
}

.btn-generate-bill {
    background: linear-gradient(135deg, var(--accent-emerald), #059669);
    font-size: 0.92rem;
    font-weight: 800;
    padding: 0.8rem;
    box-shadow: 0 6px 16px rgba(16, 185, 129, 0.3);
}

.btn-generate-bill:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(16, 185, 129, 0.4);
}

/* GST Summary Row */
.gst-summary-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
    margin-top: 0.75rem;
}

.gst-box {
    background: #F8FAFC;
    border: 1px solid #E2E8F0;
    border-radius: var(--radius-sm);
    padding: 0.9rem;
}

.gst-box.highlight {
    background: #F0FDF4;
    border-color: #059669;
}

.gst-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 600;
}

.gst-val {
    font-size: 1.3rem;
    font-weight: 800;
    margin: 0.2rem 0;
}

.gst-box small {
    font-size: 0.65rem;
    color: var(--text-dim);
}

/* Tables */
.table-responsive {
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 0.4rem;
    font-size: 0.85rem;
}

.data-table th {
    background: #F8FAFC;
    color: #475569;
    text-align: left;
    padding: 0.65rem 0.85rem;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    border-bottom: 1.5px solid #E2E8F0;
}

.data-table td {
    padding: 0.65rem 0.85rem;
    border-bottom: 1px solid #E2E8F0;
    color: #0F172A;
}

.data-table tbody tr:hover {
    background: #F8FAFC;
}

/* Status Badges */
.badge-status {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.2rem 0.6rem;
    border-radius: 50px;
    font-size: 0.72rem;
    font-weight: 700;
}

.badge-status.paid {
    background: rgba(16, 185, 129, 0.15);
    color: var(--accent-emerald);
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.badge-status.pending {
    background: rgba(245, 158, 11, 0.15);
    color: var(--accent-orange);
    border: 1px solid rgba(245, 158, 11, 0.3);
}

.badge-status.low-stock {
    background: rgba(239, 68, 68, 0.15);
    color: var(--accent-red);
    border: 1px solid rgba(239, 68, 68, 0.3);
}

/* Filters Bar */
.filters-bar {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.search-input-wrap {
    flex: 1;
    position: relative;
}

.search-input-wrap i {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-dim);
}

.search-input-wrap input {
    padding-left: 32px;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.5rem 1rem;
    font-size: 0.82rem;
    font-weight: 600;
    border-radius: var(--radius-sm);
    cursor: pointer;
    border: none;
    transition: all 0.2s ease;
}

.btn-primary {
    background: linear-gradient(135deg, #0284C7 0%, #0369A1 100%);
    color: #FFFFFF;
    font-weight: 700;
    box-shadow: 0 4px 16px rgba(2, 132, 199, 0.3);
}

.btn-primary:hover {
    background: linear-gradient(135deg, #38BDF8 0%, #0284C7 100%);
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(2, 132, 199, 0.4);
}

/* Dedicated High-Impact New GST Invoice Button */
#btn-quick-invoice {
    background: linear-gradient(135deg, #059669 0%, #10B981 100%);
    color: #FFFFFF;
    font-weight: 800;
    padding: 0.6rem 1.2rem;
    border-radius: 50px;
    box-shadow: 0 4px 16px rgba(16, 185, 129, 0.35);
    border: none;
}

#btn-quick-invoice:hover {
    background: linear-gradient(135deg, #047857 0%, #34D399 100%);
    transform: translateY(-1px) scale(1.02);
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.45);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: var(--text-bright);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.14);
    border-color: rgba(255, 255, 255, 0.28);
}

.btn-sm {
    padding: 0.3rem 0.65rem;
    font-size: 0.75rem;
}

.btn-lg {
    padding: 0.7rem 1.4rem;
    font-size: 0.92rem;
}

.full-width { width: 100%; }

/* Modals */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.55);
    backdrop-filter: blur(6px);
    z-index: 2000;
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
}

.modal-card {
    background: #FFFFFF;
    border: 1px solid #E2E8F0;
    border-radius: var(--radius-md);
    padding: 1.5rem;
    width: 90%;
    max-width: 480px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(15, 23, 42, 0.2);
    color: #0F172A;
}

.btn-whatsapp {
    background: linear-gradient(135deg, #10B981 0%, #059669 100%);
    color: #FFFFFF !important;
    font-weight: 800;
    box-shadow: 0 4px 14px rgba(16, 185, 129, 0.35);
    border: none;
}

.btn-whatsapp:hover {
    background: linear-gradient(135deg, #34D399 0%, #059669 100%);
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(16, 185, 129, 0.45);
}

/* Large Clean Invoice Preview Modal */
.modal-card.modal-lg.print-modal-card {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
    max-width: 920px !important;
    width: 95% !important;
}

.print-modal-card .modal-header {
    background: linear-gradient(135deg, #0F172A 0%, #1E293B 100%);
    color: #FFFFFF;
    padding: 0.85rem 1.2rem;
    border-radius: var(--radius-md) var(--radius-md) 0 0;
    border: 1px solid #334155;
    border-bottom: 2px solid #0284C7;
    margin-bottom: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.print-modal-card .modal-header h3 {
    font-size: 1.05rem;
    font-weight: 800;
    color: #FFFFFF;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.print-modal-card .modal-header h3 i {
    color: #38BDF8;
}

.print-modal-actions {
    display: flex;
    align-items: center;
    gap: 0.65rem;
}

.print-modal-actions .btn-secondary {
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.25);
    color: #FFFFFF !important;
    font-weight: 700;
}

.print-modal-actions .btn-secondary:hover {
    background: rgba(255, 255, 255, 0.22);
    border-color: rgba(255, 255, 255, 0.4);
}

.print-modal-actions .close-modal {
    color: #94A3B8;
    font-size: 1.5rem;
    cursor: pointer;
    margin-left: 0.4rem;
    transition: color 0.2s ease;
}

.print-modal-actions .close-modal:hover {
    color: #FF4D4D;
}

/* -------------------------------------------------------------
 * VIBRANT COLORFUL OFFICIAL TAX INVOICE STYLES (PRINT ENFORCED)
 * ------------------------------------------------------------- */

.printable-invoice {
    background: #ffffff !important;
    color: #0F172A !important;
    padding: 1.5rem 1.75rem !important;
    font-family: 'Plus Jakarta Sans', sans-serif !important;
    font-size: 11px;
    line-height: 1.45;
    border: 1px solid #E2E8F0 !important;
    box-sizing: border-box;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
    color-adjust: exact !important;
    border-radius: 12px !important;
    box-shadow: 0 12px 36px rgba(0,0,0,0.12) !important;
}

.top-tagline {
    text-align: right;
    font-size: 9.5px;
    color: #0284C7 !important;
    margin-bottom: 8px;
    font-weight: 700;
    letter-spacing: 0.05em;
}

.exact-company-header {
    border: 1px solid #0F172A !important;
    padding: 14px 18px !important;
    text-align: left;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 16px;
    background: linear-gradient(135deg, #0F172A 0%, #1E293B 100%) !important;
    border-radius: 10px 10px 0 0 !important;
}

.header-logo-wrap {
    margin-bottom: 0;
}

.inv-logo-img {
    height: 48px !important;
    max-width: 200px;
    object-fit: contain;
    background: #FFFFFF;
    padding: 4px 10px;
    border-radius: 8px;
}

.header-company-info {
    flex: 1;
}

.comp-title {
    font-family: 'Space Grotesk', sans-serif !important;
    font-size: 19px !important;
    font-weight: 800 !important;
    letter-spacing: 0.05em !important;
    color: #FFFFFF !important;
    margin: 0 0 2px 0 !important;
}

.comp-addr {
    font-size: 10.5px !important;
    color: #94A3B8 !important;
    margin: 2px 0 !important;
}

.comp-gst {
    font-size: 11px !important;
    font-weight: 700;
    color: #38BDF8 !important;
    font-family: 'JetBrains Mono', monospace !important;
}

.state-code-pill {
    display: inline-block;
    background: rgba(56, 189, 248, 0.15) !important;
    color: #38BDF8 !important;
    border: 1px solid rgba(56, 189, 248, 0.3) !important;
    border-radius: 12px;
    padding: 1px 8px;
    font-size: 9.5px !important;
    margin-left: 6px;
    font-weight: bold;
}

/* Tax Bar */
.exact-tax-bar {
    background: #0284C7 !important;
    color: #ffffff !important;
    border-left: 1px solid #0284C7 !important;
    border-right: 1px solid #0284C7 !important;
    padding: 7px 16px !important;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.tax-inv-heading {
    font-family: 'Space Grotesk', sans-serif !important;
    font-size: 14px !important;
    font-weight: 800;
    letter-spacing: 0.1em;
    color: #ffffff !important;
}

.orig-recipient {
    font-size: 10px !important;
    color: #FFFFFF !important;
    background: rgba(255, 255, 255, 0.2) !important;
    padding: 2px 10px;
    border-radius: 20px;
    font-weight: 700;
    letter-spacing: 0.04em;
}

/* Meta Table */
.exact-meta-table {
    width: 100%;
    border-collapse: collapse;
    border-left: 1px solid #CBD5E1 !important;
    border-right: 1px solid #CBD5E1 !important;
    background: #F8FAFC !important;
}

.exact-meta-table td {
    padding: 5px 14px !important;
    font-size: 11px !important;
    border-bottom: 1px solid #E2E8F0 !important;
    color: #334155 !important;
}

.exact-meta-table td strong {
    color: #0F172A !important;
    font-family: 'JetBrains Mono', monospace !important;
}

/* Dispatch Box */
.dispatch-header {
    background: #F1F5F9 !important;
    color: #0284C7 !important;
    border-left: 1px solid #CBD5E1 !important;
    border-right: 1px solid #CBD5E1 !important;
    border-top: 1px solid #CBD5E1 !important;
    padding: 5px 14px !important;
    font-weight: 700;
    font-size: 10.5px !important;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.dispatch-box {
    border-left: 1px solid #CBD5E1 !important;
    border-right: 1px solid #CBD5E1 !important;
    border-bottom: 1px solid #CBD5E1 !important;
    padding: 7px 14px !important;
    font-size: 10.5px !important;
    background: #ffffff !important;
    color: #475569 !important;
}

/* Party Details Grid */
.exact-party-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    border-left: 1px solid #CBD5E1 !important;
    border-right: 1px solid #CBD5E1 !important;
    border-bottom: 1px solid #CBD5E1 !important;
    background: #ffffff !important;
}

.party-box:first-child {
    border-right: 1px solid #CBD5E1 !important;
}

.party-head {
    background: #F1F5F9 !important;
    color: #0284C7 !important;
    padding: 5px 14px !important;
    font-weight: 800;
    font-size: 10.5px !important;
    border-bottom: 1px solid #CBD5E1 !important;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.party-body {
    padding: 8px 14px !important;
    font-size: 10.5px !important;
}

.party-body p {
    margin-bottom: 3px !important;
    color: #334155 !important;
}

.party-body strong {
    color: #0F172A !important;
}

/* Itemized Table */
.exact-items-table {
    width: 100%;
    border-collapse: collapse;
    border-left: 1px solid #CBD5E1 !important;
    border-right: 1px solid #CBD5E1 !important;
    border-bottom: 1px solid #CBD5E1 !important;
}

.exact-items-table th {
    background: #0F172A !important;
    color: #ffffff !important;
    font-weight: 700;
    font-size: 10px !important;
    padding: 7px 6px !important;
    text-align: center;
    border: 1px solid #334155 !important;
    letter-spacing: 0.03em;
}

.exact-items-table td {
    border: 1px solid #E2E8F0 !important;
    padding: 7px 8px !important;
    font-size: 10.5px !important;
    color: #1E293B !important;
}

.exact-items-table tbody tr:nth-child(even) {
    background-color: #F8FAFC !important;
}

.totals-row td {
    background-color: #F0F9FF !important;
    color: #0284C7 !important;
    font-weight: 800 !important;
    font-size: 11px !important;
    border-top: 2px solid #0284C7 !important;
}

/* Summary Grid */
.exact-summary-grid {
    display: grid;
    grid-template-columns: 1.25fr 1fr;
    border-left: 1px solid #CBD5E1 !important;
    border-right: 1px solid #CBD5E1 !important;
    border-bottom: 1px solid #CBD5E1 !important;
    background: #ffffff !important;
}

.left-summary {
    border-right: 1px solid #CBD5E1 !important;
    padding: 10px 14px !important;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.amount-words-box {
    background: #F8FAFC;
    padding: 7px 10px;
    border-radius: 6px;
    border: 1px solid #E2E8F0;
}

.amount-words-box span {
    font-size: 9px !important;
    color: #64748B !important;
    text-transform: uppercase;
    font-weight: 700;
    letter-spacing: 0.05em;
}

.amount-words-box h4 {
    font-size: 11.5px !important;
    font-weight: 800 !important;
    margin-top: 2px !important;
    color: #0284C7 !important;
}

.bank-details-box {
    margin-top: 8px;
    border: 1px solid #BAE6FD !important;
    background: #F0F9FF !important;
    padding: 8px 10px !important;
    border-radius: 6px;
}

.bank-header {
    font-weight: 800 !important;
    color: #0369A1 !important;
    margin-bottom: 4px !important;
    font-size: 10.5px !important;
    letter-spacing: 0.03em;
}

.bank-table td {
    padding: 2px 0 !important;
    font-size: 10px !important;
    color: #334155 !important;
}

.bank-table td strong {
    color: #0F172A !important;
    font-family: 'JetBrains Mono', monospace !important;
}

.right-summary {
    padding: 0 !important;
    background: #ffffff !important;
}

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

.calc-table td {
    border-bottom: 1px solid #E2E8F0 !important;
    border-right: none !important;
    border-left: none !important;
    padding: 6px 12px !important;
    font-size: 10.5px !important;
    color: #334155 !important;
}

.calc-table .bold-row td {
    font-weight: 800 !important;
    background: #FFFBEB !important;
    color: #D97706 !important;
}

.calc-table .highlight-row td {
    font-weight: 800 !important;
    background: #ECFDF5 !important;
    color: #059669 !important;
    font-size: 11.5px !important;
}

/* Footer */
.exact-footer {
    border-left: 1px solid #CBD5E1 !important;
    border-right: 1px solid #CBD5E1 !important;
    border-bottom: 1px solid #CBD5E1 !important;
    padding: 10px 14px !important;
    text-align: center;
    position: relative;
    background: #F8FAFC !important;
    border-radius: 0 0 10px 10px !important;
}

.certified-text {
    font-size: 9.5px !important;
    margin-bottom: 4px !important;
    color: #64748B !important;
    font-style: italic;
}

.company-sig-head {
    font-size: 11.5px !important;
    font-weight: 800 !important;
    color: #0F172A !important;
    letter-spacing: 0.04em;
}

.sig-space-exact {
    height: 28px;
}

.auth-sig-title {
    font-weight: 700 !important;
    font-size: 10.5px !important;
    color: #475569 !important;
    border-top: 1px dashed #CBD5E1;
    display: inline-block;
    padding-top: 4px;
    min-width: 140px;
}

.thank-you-footer {
    font-size: 10px !important;
    margin-top: 5px !important;
    color: #0284C7 !important;
    font-weight: 600;
}

.watermark-pill {
    display: inline-block;
    color: #0284C7 !important;
    background: rgba(2, 132, 199, 0.06) !important;
    border: 1px solid rgba(2, 132, 199, 0.2) !important;
    border-radius: 12px;
    padding: 2px 10px;
    font-size: 8.5px !important;
    margin-top: 5px;
    font-weight: 600 !important;
    letter-spacing: 0.03em;
}

/* -------------------------------------------------------------
 * MANDATORY PRINT COLOR ENFORCEMENT RULES FOR BROWSERS & PDF
 * ------------------------------------------------------------- */

@media print {
    *, html, body, div, span, table, th, td, p, h1, h2, h3, h4, img {
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
        color-adjust: exact !important;
    }
    
    body * {
        visibility: hidden;
    }
    
    .modal-card.modal-lg, .printable-invoice, .printable-invoice * {
        visibility: visible;
    }
    
    .modal {
        position: absolute;
        left: 0;
        top: 0;
        width: 100%;
        background: #fff;
    }
    .modal-card {
        box-shadow: none;
        border: none;
        max-width: 100% !important;
        width: 100% !important;
        padding: 0 !important;
    }
    
    .no-print {
        display: none !important;
    }
}

/* ─────────────────────────────────────────────────────────────
 * PRODUCT SEARCH + CATALOG TILES (Card 3 Redesign)
 * ───────────────────────────────────────────────────────────── */

/* Search bar wrapper */
.product-search-bar {
    padding: 0 0 4px 0;
}

.prod-search-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(0, 180, 216, 0.06);
    border: 1.5px solid rgba(0, 180, 216, 0.25);
    border-radius: 10px;
    padding: 0 14px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.prod-search-wrap:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(0, 180, 216, 0.12);
}

.prod-search-wrap i {
    color: var(--primary);
    font-size: 1rem;
    flex-shrink: 0;
}

.prod-search-wrap input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    padding: 11px 0;
    font-size: 0.88rem;
    color: var(--text-bright);
    font-family: var(--font-main);
}

.prod-search-wrap input::placeholder {
    color: var(--text-dim);
}

.prod-search-count {
    font-size: 0.72rem;
    color: var(--primary);
    font-weight: 700;
    white-space: nowrap;
    background: rgba(0, 180, 216, 0.12);
    padding: 2px 8px;
    border-radius: 20px;
    min-width: 52px;
    text-align: center;
}

/* Catalog tiles grid */
.product-catalog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(175px, 1fr));
    gap: 8px;
    margin: 10px 0 4px 0;
    max-height: 260px;
    overflow-y: auto;
    padding-right: 4px;
    scrollbar-width: thin;
    scrollbar-color: var(--primary) transparent;
}

.product-catalog-grid::-webkit-scrollbar { width: 4px; }
.product-catalog-grid::-webkit-scrollbar-thumb { background: var(--primary); border-radius: 4px; }

/* Individual tile */
.prod-tile {
    background: #FFFFFF;
    border: 1px solid #E2E8F0;
    border-radius: 10px;
    padding: 10px 12px;
    cursor: pointer;
    transition: all 0.18s ease;
    position: relative;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04);
}

.prod-tile::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 2.5px;
    background: linear-gradient(90deg, var(--primary), var(--accent-emerald));
    opacity: 0;
    transition: opacity 0.18s ease;
}

.prod-tile:hover {
    border-color: var(--primary);
    background: #F0F9FF;
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(2, 132, 199, 0.12);
}

.prod-tile:hover::before { opacity: 1; }

.prod-tile:active { transform: scale(0.97); }

.prod-tile-name {
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--text-bright);
    line-height: 1.3;
    margin-bottom: 6px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.prod-tile-meta {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.prod-tile-price {
    font-size: 0.92rem;
    font-weight: 800;
    color: var(--accent-emerald);
    letter-spacing: -0.3px;
}

.prod-tile-price small {
    font-size: 0.65rem;
    font-weight: 500;
    color: var(--text-dim);
    margin-left: 2px;
}

.prod-tile-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 5px;
}

.prod-tile-stock {
    font-size: 0.67rem;
    color: var(--text-muted);
}

.prod-tile-stock.low { color: var(--accent-orange); }

.prod-tile-gst {
    font-size: 0.65rem;
    font-weight: 700;
    background: rgba(0, 180, 216, 0.12);
    color: var(--primary);
    padding: 1px 6px;
    border-radius: 10px;
}

.prod-tile-add-hint {
    font-size: 0.62rem;
    color: var(--text-dim);
    margin-top: 5px;
    display: flex;
    align-items: center;
    gap: 3px;
    opacity: 0;
    transition: opacity 0.15s ease;
}

.prod-tile:hover .prod-tile-add-hint { opacity: 1; }

/* No results state */
.prod-no-results {
    grid-column: 1/-1;
    text-align: center;
    padding: 20px;
    color: var(--text-dim);
    font-size: 0.82rem;
}

/* Divider between catalog and table */
.items-divider {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 14px 0 10px;
}

.items-divider::before,
.items-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.08), transparent);
}

.items-divider span {
    font-size: 0.73rem;
    font-weight: 700;
    color: var(--text-muted);
    letter-spacing: 0.4px;
    text-transform: uppercase;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 5px;
}

.items-divider span i { color: var(--accent-emerald); }

/* Enhanced table row with line total */
.enhanced-items-table .item-line-total {
    font-weight: 800;
    color: var(--accent-emerald);
    font-size: 0.85rem;
    text-align: right;
}

.enhanced-items-table .item-line-tax {
    font-weight: 600;
    color: var(--accent-orange);
    font-size: 0.82rem;
    text-align: right;
}

/* Table footer subtotals */
.items-tfoot-row td {
    background: rgba(0, 180, 216, 0.05) !important;
    border-top: 1.5px solid rgba(0, 180, 216, 0.2) !important;
    padding: 8px 6px !important;
}

/* Empty items message */
.empty-items-msg {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 28px 20px;
    color: var(--text-dim);
    gap: 8px;
}

.empty-items-msg i {
    font-size: 2rem;
    color: rgba(0, 180, 216, 0.25);
}

.empty-items-msg p {
    font-size: 0.8rem;
    text-align: center;
}

/* ─────────────────────────────────────────────────────────────
 * TOP-LEVEL TOAST CONTAINER (100% UNCLIP / TOP Z-INDEX FIX)
 * ───────────────────────────────────────────────────────────── */
#toast-container {
    position: fixed !important;
    bottom: 28px !important;
    right: 28px !important;
    left: auto !important;
    top: auto !important;
    z-index: 999999 !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 10px !important;
    pointer-events: none !important;
}

.toast-msg {
    pointer-events: auto !important;
    background: #0F172A !important;
    color: #FFFFFF !important;
    border-radius: 10px !important;
    padding: 12px 18px !important;
    font-family: 'Plus Jakarta Sans', sans-serif !important;
    font-size: 0.85rem !important;
    font-weight: 700 !important;
    box-shadow: 0 12px 36px rgba(0, 0, 0, 0.25) !important;
    border-left: 4.5px solid #0284C7 !important;
    max-width: 380px !important;
    animation: toastSlideIn 0.3s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

@keyframes toastSlideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* ─────────────────────────────────────────────────────────────
 * AIRTIGHT SECURITY LOCK SHIELD (ANTI-INSPECT BYPASS)
 * ───────────────────────────────────────────────────────────── */
body.app-is-locked .admin-app {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
    filter: blur(40px) !important;
}

body.app-is-locked #modal-pin-lock {
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
    z-index: 9999999 !important;
}

/* ─────────────────────────────────────────────────────────────
 * MOBILE HAMBURGER NAVIGATION & SLIDE-OUT DRAWER MENU
 * ───────────────────────────────────────────────────────────── */
.mobile-menu-toggle {
    display: none;
    background: #FFFFFF;
    border: 1px solid #CBD5E1;
    color: #0F172A;
    font-size: 1.1rem;
    padding: 0.45rem 0.75rem;
    border-radius: 8px;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(15, 23, 42, 0.08);
    transition: all 0.2s ease;
}

.mobile-menu-toggle:hover {
    background: #F1F5F9;
    color: #0284C7;
}

.mobile-sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(15, 23, 42, 0.65);
    backdrop-filter: blur(4px);
    z-index: 1050;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.mobile-sidebar-overlay.active {
    display: block;
    opacity: 1;
}

.mobile-sidebar-close {
    display: none;
    color: #94A3B8;
    font-size: 1.4rem;
    cursor: pointer;
    padding: 0.2rem 0.5rem;
    margin-left: auto;
}

.mobile-sidebar-close:hover {
    color: #FFFFFF;
}

.topbar-header-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

/* ═══════════════════════════════════════════════════════════════
 * MOBILE RESPONSIVE DESIGN — All Breakpoints
 * ═══════════════════════════════════════════════════════════════ */

/* ── Tablet (≤ 1024px) ── */
@media (max-width: 1024px) {
    .sidebar {
        width: 200px;
    }
    .main-content {
        margin-left: 200px;
    }
    .dashboard-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .form-grid-3 {
        grid-template-columns: 1fr 1fr;
    }
}

/* ── Mobile & Small Tablet (≤ 768px) ── */
@media (max-width: 768px) {

    html { font-size: 14px; }

    .mobile-menu-toggle {
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    .mobile-sidebar-close {
        display: block;
    }

    /* — Sidebar off-canvas slide-out drawer — */
    .sidebar {
        position: fixed !important;
        top: 0 !important;
        left: -280px !important;
        width: 260px !important;
        height: 100vh !important;
        z-index: 1100 !important;
        transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1) !important;
        flex-direction: column !important;
        flex-wrap: nowrap !important;
        padding: 1.1rem 0.85rem !important;
        background: linear-gradient(180deg, #0B172A 0%, #0F253E 100%) !important;
        box-shadow: 6px 0 30px rgba(0,0,0,0.4) !important;
    }

    .sidebar.mobile-open {
        transform: translateX(280px) !important;
    }

    .sidebar nav {
        flex-direction: column !important;
        flex-wrap: nowrap !important;
    }

    .nav-item {
        justify-content: flex-start !important;
        padding: 0.65rem 0.85rem !important;
        font-size: 0.85rem !important;
    }

    .nav-item span:last-child {
        display: inline-block !important;
    }

    .sidebar-footer {
        display: block !important;
        margin-top: auto !important;
    }

    /* — Main content full width — */
    .main-content {
        margin-left: 0;
        padding: 0.75rem 0.85rem;
        min-height: calc(100vh - 120px);
    }

    .admin-app {
        flex-direction: column;
    }

    /* — Topbar stacking — */
    .topbar {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.6rem;
        margin-bottom: 0.75rem;
    }

    .topbar-right {
        width: 100%;
        flex-wrap: wrap;
        gap: 0.4rem;
    }

    .topbar-title h1 {
        font-size: 1.15rem;
    }

    .topbar-title p {
        font-size: 0.75rem;
    }

    .user-pill {
        display: none;
    }

    /* — Dashboard Cards — */
    .dashboard-grid {
        grid-template-columns: 1fr 1fr;
        gap: 0.65rem;
    }

    .stat-card {
        padding: 0.85rem;
    }

    .stat-value {
        font-size: 1.2rem;
    }

    /* — Section Headers — */
    .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .section-header-right {
        width: 100%;
        flex-wrap: wrap;
    }

    /* — Tables: Horizontal scroll — */
    .table-wrap, .table-responsive {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    table {
        min-width: 600px;
    }

    /* — Invoice Builder — */
    .invoice-builder-grid {
        flex-direction: column;
    }

    .invoice-left-panel,
    .invoice-right-panel {
        width: 100%;
        max-width: 100%;
        border-right: none;
        border-bottom: 1px solid var(--border-color);
    }

    /* — Form Grids collapse to 1 col — */
    .form-grid-2,
    .form-grid-3 {
        grid-template-columns: 1fr;
    }

    /* — Items table builder — */
    #invoice-items-table-wrap {
        overflow-x: auto;
    }

    #invoice-items-table {
        min-width: 620px;
        font-size: 0.75rem;
    }

    /* — Content Cards — */
    .content-card {
        padding: 0.85rem;
        border-radius: 8px;
    }

    /* — Modals full-screen — */
    .modal-card {
        width: 96% !important;
        max-width: 96% !important;
        padding: 1rem !important;
        margin: 0.5rem;
    }

    .modal-card.modal-lg.print-modal-card {
        width: 98% !important;
        max-width: 98% !important;
    }

    .print-modal-actions {
        flex-wrap: wrap;
        gap: 0.4rem;
    }

    /* — Print modal invoice preview — */
    .printable-invoice {
        font-size: 0.75rem;
    }

    .exact-company-header {
        flex-direction: column;
        gap: 0.5rem;
    }

    /* — Recent Invoices table — */
    .recent-invoices-table-wrap {
        overflow-x: auto;
    }

    /* — Advance payment box — */
    #advance-payment-box {
        padding: 0.65rem;
    }

    /* — Buttons compact — */
    .btn-lg {
        padding: 0.55rem 1rem;
        font-size: 0.85rem;
    }

    #btn-quick-invoice {
        padding: 0.5rem 0.9rem;
        font-size: 0.8rem;
    }

    /* — PIN Lock Modal — */
    #modal-pin-lock .modal-card {
        max-width: 92% !important;
        padding: 20px 18px !important;
    }
}

/* ── Small Mobile (≤ 480px) ── */
@media (max-width: 480px) {
    html { font-size: 13px; }

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

    .nav-item {
        padding: 0.4rem 0.35rem;
        font-size: 0.7rem;
    }

    .stat-card {
        padding: 0.7rem;
    }

    .stat-value {
        font-size: 1.05rem;
    }

    .topbar-right {
        gap: 0.3rem;
    }

    .topbar-right .btn {
        font-size: 0.72rem;
        padding: 0.38rem 0.65rem;
    }

    .content-card {
        padding: 0.65rem;
    }

    table {
        font-size: 0.73rem;
    }

    .modal-card {
        width: 98% !important;
        padding: 0.8rem !important;
        max-height: 95vh;
        overflow-y: auto;
    }

    .print-modal-actions .btn {
        font-size: 0.72rem;
        padding: 0.35rem 0.6rem;
    }
}
