:root {
    --navy: #0b1220;
    --navy-2: #152238;
    --blue: #2563eb;
    --blue-dark: #1d4ed8;
    --cyan: #06b6d4;
    --bg: #f4f7fb;
    --card: #ffffff;
    --text: #172033;
    --muted: #667085;
    --line: #e3e8ef;
    --success: #087a55;
    --success-bg: #e9f8f1;
    --danger: #c52b3b;
    --danger-bg: #fff0f2;
    --warning: #a15c00;
    --radius: 16px;
    --shadow: 0 14px 35px rgba(15, 23, 42, .08);
}

* { box-sizing: border-box; }
html { color-scheme: light; }
body { margin: 0; background: var(--bg); color: var(--text); font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; font-size: 14px; line-height: 1.5; }
a { color: var(--blue-dark); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 5px; font-size: clamp(1.65rem, 3vw, 2.25rem); line-height: 1.15; letter-spacing: -.025em; }
h2 { margin-bottom: 5px; font-size: 1.14rem; }
small { color: var(--muted); display: block; }
code { background: #eef2ff; border-radius: 5px; color: #3730a3; padding: 2px 5px; }

.app-shell { display: grid; grid-template-columns: 250px minmax(0, 1fr); min-height: 100vh; }
.sidebar { position: sticky; top: 0; height: 100vh; background: var(--navy); color: #d9e2f2; display: flex; flex-direction: column; padding: 22px 16px; z-index: 20; }
.sidebar-brand { align-items: center; color: white; display: flex; gap: 12px; padding: 0 7px 24px; }
.sidebar-brand:hover { text-decoration: none; }
.sidebar-brand strong, .sidebar-brand small { display: block; }
.sidebar-brand small { color: #8fa3c4; max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.brand-mark { align-items: center; background: linear-gradient(135deg, var(--blue), var(--cyan)); border-radius: 18px; box-shadow: 0 10px 25px rgba(37, 99, 235, .35); color: white; display: inline-flex; font-size: 1.5rem; font-weight: 900; height: 62px; justify-content: center; letter-spacing: -.08em; width: 62px; }
.brand-mark.small { border-radius: 11px; font-size: .9rem; height: 38px; width: 38px; }
.nav-list { display: grid; gap: 6px; }
.nav-list a { border-radius: 10px; color: #b8c5da; display: block; font-weight: 650; padding: 11px 13px; }
.nav-list a:hover, .nav-list a.active { background: rgba(255, 255, 255, .09); color: white; text-decoration: none; }
.sidebar-footer { border-top: 1px solid rgba(255, 255, 255, .1); display: grid; gap: 6px; margin-top: auto; padding: 18px 10px 0; }
.sidebar-footer a, .link-button { color: #aebdd4; font-weight: 600; }
.link-button { background: transparent; border: 0; padding: 0; }
.main-panel { min-width: 0; }
.topbar { align-items: center; background: rgba(255, 255, 255, .92); border-bottom: 1px solid var(--line); display: flex; gap: 14px; justify-content: flex-end; min-height: 76px; padding: 14px clamp(18px, 4vw, 42px); position: sticky; top: 0; z-index: 10; backdrop-filter: blur(12px); }
.topbar p { margin-bottom: 0; }
.menu-button { background: white; border: 1px solid var(--line); border-radius: 9px; display: none; font-size: 1.2rem; height: 40px; margin-right: auto; width: 40px; }
.role-pill { background: #eaf0ff; border-radius: 999px; color: var(--blue-dark); font-size: .75rem; font-weight: 800; padding: 7px 11px; text-transform: capitalize; }
.content { margin: 0 auto; max-width: 1500px; padding: clamp(22px, 4vw, 42px); }
.page-heading { align-items: flex-end; display: flex; gap: 18px; justify-content: space-between; margin-bottom: 24px; }
.page-heading p { color: var(--muted); margin-bottom: 0; }
.eyebrow { color: var(--blue); font-size: .72rem; font-weight: 850; letter-spacing: .12em; margin-bottom: 7px; text-transform: uppercase; }
.muted { color: var(--muted); }

.card { background: var(--card); border: 1px solid rgba(210, 219, 232, .8); border-radius: var(--radius); box-shadow: var(--shadow); margin-bottom: 24px; padding: clamp(18px, 3vw, 28px); }
.card-heading { align-items: center; display: flex; gap: 20px; justify-content: space-between; margin-bottom: 20px; }
.card-heading p { color: var(--muted); margin-bottom: 0; }
.narrow-card { max-width: 650px; }
.stat-grid { display: grid; gap: 18px; grid-template-columns: repeat(4, minmax(0, 1fr)); margin-bottom: 24px; }
.stat-card { background: white; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); min-height: 132px; padding: 23px; position: relative; overflow: hidden; }
.stat-card::after { background: linear-gradient(135deg, rgba(37, 99, 235, .22), rgba(6, 182, 212, .06)); border-radius: 50%; content: ""; height: 100px; position: absolute; right: -45px; top: -40px; width: 100px; }
.stat-card span { color: var(--muted); display: block; font-weight: 650; }
.stat-card strong { display: block; font-size: clamp(1.45rem, 2.4vw, 2rem); margin-top: 16px; }

.button { align-items: center; border: 1px solid transparent; border-radius: 9px; display: inline-flex; font-weight: 750; justify-content: center; min-height: 41px; padding: 9px 15px; text-decoration: none; }
.button:hover { text-decoration: none; transform: translateY(-1px); }
.button.primary { background: var(--blue); box-shadow: 0 8px 18px rgba(37, 99, 235, .22); color: white; }
.button.primary:hover { background: var(--blue-dark); }
.button.secondary { background: white; border-color: var(--line); color: var(--text); }
.button.danger { background: var(--danger); color: white; }
.button.danger-outline { background: white; border-color: #f4bbc2; color: var(--danger); }
.button.tiny { font-size: .78rem; min-height: 32px; padding: 5px 9px; }
.button.large { min-height: 50px; padding-inline: 23px; }
.button.wide { width: 100%; }
.actions { align-items: center; display: flex; flex-wrap: wrap; gap: 7px; }
.actions form { margin: 0; }

.alert { border: 1px solid; border-radius: 11px; margin-bottom: 20px; padding: 13px 16px; }
.alert.success { background: var(--success-bg); border-color: #b7ebd2; color: var(--success); }
.alert.danger { background: var(--danger-bg); border-color: #f5c4ca; color: #9e2030; }
.alert.info { background: #eef5ff; border-color: #c8dcff; color: #17468a; }
.badge { border-radius: 999px; display: inline-block; font-size: .7rem; font-weight: 850; letter-spacing: .04em; padding: 5px 9px; text-transform: uppercase; }
.badge.active, .badge.finalized { background: var(--success-bg); color: var(--success); }
.badge.inactive, .badge.suspended, .badge.cancelled { background: var(--danger-bg); color: var(--danger); }
.badge.stock-available { background: var(--success-bg); color: var(--success); }
.badge.stock-low { background: #fff5df; color: var(--warning); }
.badge.stock-out { background: var(--danger-bg); color: var(--danger); }

.stack-form { display: grid; gap: 20px; }
.form-grid { display: grid; gap: 17px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.form-grid label, .stack-form > label { color: #344054; display: grid; font-size: .84rem; font-weight: 700; gap: 7px; }
.form-grid .span-2 { grid-column: span 2; }
.form-section { border-bottom: 1px solid var(--line); padding-bottom: 24px; }
.form-section:last-of-type { border-bottom: 0; }
.form-section h2 { margin-bottom: 17px; }
input, select, textarea { background: white; border: 1px solid #ccd5e2; border-radius: 9px; color: var(--text); min-height: 43px; outline: none; padding: 9px 11px; width: 100%; }
textarea { resize: vertical; }
textarea[lang="hi"] { font-family: "Nirmala UI", Mangal, "Noto Sans Devanagari", sans-serif; line-height: 1.55; }
input:focus, select:focus, textarea:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(37, 99, 235, .12); }
.form-actions { display: flex; justify-content: flex-end; }
.checkbox-field { align-items: flex-start; display: flex !important; grid-template-columns: none !important; }
.checkbox-field input { flex: 0 0 auto; height: 19px; margin: 3px 2px 0 0; min-height: 0; width: 19px; }
.checkbox-field span { display: block; }.checkbox-field strong { display: block; }.checkbox-field small { margin-top: 3px; }
.form-note { background: #eef5ff; border: 1px solid #c8dcff; border-radius: 9px; color: #17468a; padding: 12px 14px; }
.invoice-theme-field { border: 0; margin: 0; min-width: 0; padding: 0; }
.invoice-theme-field legend { color: #344054; font-size: .84rem; font-weight: 700; margin-bottom: 9px; }
.invoice-theme-options { display: grid; gap: 9px; grid-template-columns: repeat(5, minmax(0, 1fr)); }
.invoice-theme-option { align-items: center; background: white; border: 1px solid #ccd5e2; border-radius: 10px; cursor: pointer; display: grid !important; gap: 8px !important; grid-template-columns: auto 22px minmax(0, 1fr); min-height: 48px; padding: 8px 10px; }
.invoice-theme-option:has(input:checked) { border-color: var(--blue); box-shadow: 0 0 0 2px rgba(37, 99, 235, .12); }
.invoice-theme-option input { min-height: auto; width: auto; }
.invoice-theme-option strong { font-size: .78rem; line-height: 1.2; }
.invoice-theme-swatch { background: #123568; border-radius: 6px; display: block; height: 22px; width: 22px; }
.invoice-theme-swatch--royal-blue { background: #173f8a; }.invoice-theme-swatch--teal { background: #115e59; }.invoice-theme-swatch--emerald { background: #14532d; }.invoice-theme-swatch--maroon { background: #701a2f; }.invoice-theme-swatch--burgundy { background: #581c32; }.invoice-theme-swatch--purple { background: #4c1d75; }.invoice-theme-swatch--slate { background: #334155; }.invoice-theme-swatch--charcoal { background: #27272a; }.invoice-theme-swatch--brown { background: #5c3317; }
.filter-bar { align-items: center; display: flex; flex: 1; gap: 10px; margin-bottom: 18px; }
.filter-bar input { max-width: 390px; }
.filter-bar select { max-width: 190px; }
.split-toolbar { align-items: flex-start; display: flex; gap: 14px; justify-content: space-between; }

.table-wrap { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; }
th, td { border-bottom: 1px solid var(--line); padding: 13px 12px; text-align: left; vertical-align: top; }
th { color: #596579; font-size: .72rem; letter-spacing: .05em; text-transform: uppercase; }
td small { margin-top: 3px; }
tbody tr:hover { background: #f9fbff; }
.empty { color: var(--muted); padding: 32px; text-align: center; }

.auth-body { background: radial-gradient(circle at 15% 15%, #1c3c75, transparent 35%), var(--navy); min-height: 100vh; }
.auth-shell { align-items: center; display: grid; gap: clamp(30px, 7vw, 100px); grid-template-columns: minmax(0, 1.1fr) minmax(360px, 500px); margin: auto; min-height: 100vh; max-width: 1200px; padding: 40px; }
.auth-brand { color: white; max-width: 650px; }
.auth-brand .brand-mark { margin-bottom: 35px; }
.auth-brand h1 { font-size: clamp(2.5rem, 6vw, 4.8rem); }
.auth-brand > p:last-child { color: #b7c5da; font-size: 1.1rem; max-width: 570px; }
.auth-card { background: white; border-radius: 22px; box-shadow: 0 25px 80px rgba(0, 0, 0, .3); padding: clamp(25px, 5vw, 48px); }
.auth-card h2 { font-size: 1.8rem; }

.invoice-item { background: #f8faff; border: 1px solid #dbe4f1; border-radius: 13px; margin-bottom: 16px; padding: 18px; }
.item-row-heading { align-items: center; display: flex; justify-content: space-between; margin-bottom: 14px; }
.icon-button { background: white; border: 1px solid var(--line); border-radius: 8px; color: var(--danger); font-size: 1.25rem; height: 32px; line-height: 1; width: 32px; }
.item-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.item-grid .span-2 { grid-column: span 2; }
.line-total { align-self: end; background: var(--navy); border-radius: 9px; color: white; min-height: 67px; padding: 10px 13px; }
.line-total span, .line-total strong { display: block; }
.line-total span { color: #aebdd4; font-size: .74rem; }
.line-total strong { font-size: 1.15rem; }
.invoice-submit { align-items: center; bottom: 16px; display: flex; gap: 25px; justify-content: space-between; position: sticky; z-index: 5; }
.live-totals { align-items: center; display: flex; flex-wrap: wrap; gap: 10px 22px; }
.live-totals span { color: var(--muted); }
.live-totals strong { color: var(--text); display: block; }
.live-totals .grand strong { font-size: 1.45rem; color: var(--blue-dark); }

.product-picker { position: relative; }
.product-picker > label { color: #344054; display: grid; font-size: .84rem; font-weight: 700; gap: 7px; }
.product-search-results { background: white; border: 1px solid #cbd6e5; border-radius: 11px; box-shadow: 0 18px 45px rgba(15, 23, 42, .18); left: 0; max-height: 330px; overflow-y: auto; position: absolute; right: 0; top: 69px; z-index: 30; }
.product-search-result { background: white; border: 0; border-bottom: 1px solid var(--line); color: var(--text); display: grid; gap: 2px; padding: 12px 14px; text-align: left; width: 100%; }
.product-search-result:last-child { border-bottom: 0; }
.product-search-result:hover, .product-search-result:focus { background: #eef5ff; outline: 0; }
.product-search-result:disabled { background: #fff7f7; color: #8d6970; cursor: not-allowed; }
.product-search-result span, .product-search-result small { color: var(--muted); }
.product-search-message { color: var(--muted); margin: 0; padding: 16px; }
.selected-product { align-items: center; background: #eef5ff; border: 1px solid #c8dcff; border-radius: 9px; display: flex; gap: 10px; margin-top: 7px; padding: 8px 10px; }
.selected-product[hidden] { display: none; }
.selected-product span { color: #17468a; font-weight: 750; }
.selected-product small { margin-left: auto; }
.selected-product button { background: transparent; border: 0; color: var(--blue-dark); font-size: .77rem; font-weight: 750; padding: 3px; }
.stock-validation { min-height: 17px; }
.danger-text { color: var(--danger) !important; }.warning-text { color: var(--warning) !important; }.stock-positive { color: var(--success); font-weight: 750; }.stock-negative { color: var(--danger); font-weight: 750; }

.stock-adjust-row td { background: #f7f9fc; }
.stock-adjust-form { align-items: end; display: grid; gap: 12px; grid-template-columns: 1fr 1fr 1fr 1fr minmax(220px, 1.5fr) auto; }
.stock-adjust-form label { color: #344054; display: grid; font-size: .8rem; font-weight: 700; gap: 5px; }
.stock-adjust-form .form-actions { align-items: end; }

.dashboard-stats { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.stat-card-featured { background: linear-gradient(135deg, #123568, #1d4ed8); border-color: transparent; color: white; }
.stat-card-featured span, .stat-card-featured small { color: #cfddf4; }.stat-card-featured strong { color: white; }
.stat-card small { margin-top: 8px; position: relative; z-index: 1; }
.stat-product { font-size: clamp(1rem, 1.7vw, 1.35rem) !important; line-height: 1.3; }
.dashboard-grid { display: grid; gap: 24px; grid-template-columns: minmax(0, 1.6fr) minmax(300px, .8fr); }
.sales-chart { display: grid; gap: 14px; }
.sales-chart-row { align-items: center; display: grid; gap: 12px; grid-template-columns: 68px minmax(100px, 1fr) 110px; }
.sales-chart-row span { color: var(--muted); font-size: .78rem; }.sales-chart-row strong { text-align: right; }
.sales-chart progress { appearance: none; border: 0; border-radius: 999px; height: 12px; overflow: hidden; width: 100%; }
.sales-chart progress::-webkit-progress-bar { background: #e8eef8; }.sales-chart progress::-webkit-progress-value { background: linear-gradient(90deg, var(--blue), var(--cyan)); }.sales-chart progress::-moz-progress-bar { background: var(--blue); }
.alert-list { display: grid; }
.alert-list > a { align-items: center; border-bottom: 1px solid var(--line); display: flex; gap: 12px; justify-content: space-between; padding: 11px 0; }
.alert-list > a:last-child { border-bottom: 0; }.alert-list > a:hover { text-decoration: none; }.alert-list b { white-space: nowrap; }
.empty-state { color: var(--muted); margin: 15px 0; text-align: center; }.summary-value { color: var(--blue-dark); font-size: 2rem; font-weight: 850; margin: 22px 0 10px; }

.report-filter { align-items: end; display: grid; gap: 14px; grid-template-columns: minmax(170px, 220px) minmax(170px, 220px) auto minmax(240px, 1fr); }
.report-filter label { color: #344054; display: grid; font-size: .84rem; font-weight: 700; gap: 7px; }
.report-filter small { padding-bottom: 10px; }
.report-stat-grid { margin-bottom: 24px; }
.tax-summary-grid { display: grid; gap: 12px; grid-template-columns: repeat(3, minmax(0, 1fr)); margin: 18px 0 22px; }
.tax-summary-grid > div { background: #f7f9fc; border: 1px solid var(--line); border-radius: 12px; padding: 16px; }
.tax-summary-grid span { color: var(--muted); display: block; font-size: .78rem; font-weight: 750; text-transform: uppercase; }
.tax-summary-grid strong { display: block; font-size: 1.2rem; margin-top: 5px; }
td.number, th.number { text-align: right; }

.invoice-preview { padding: 0; overflow: hidden; }
.invoice-preview-head { align-items: flex-start; background: var(--navy); color: white; display: flex; justify-content: space-between; padding: 30px; }
.invoice-preview-head p { color: #c2cede; margin-bottom: 5px; }
.invoice-preview-head .eyebrow { color: #70dded; }
.invoice-meta { align-items: flex-end; display: flex; flex-direction: column; gap: 6px; }
.invoice-meta strong { font-size: 1.2rem; }
.customer-box { background: #f7f9fc; display: grid; gap: 20px; grid-template-columns: 1fr 1fr; padding: 20px 30px; }
.customer-box p { margin: 0; }
.customer-box span { color: var(--muted); display: block; font-size: .75rem; text-transform: uppercase; }
.invoice-table td:first-child, .invoice-table th:first-child { padding-left: 30px; }
.invoice-table td:last-child, .invoice-table th:last-child { padding-right: 30px; text-align: right; }
.invoice-bottom { display: grid; gap: 30px; grid-template-columns: 1fr minmax(300px, .6fr); padding: 25px 30px 30px; }
.invoice-bottom > div > span { color: var(--muted); display: block; font-size: .75rem; margin-bottom: 4px; text-transform: uppercase; }
.invoice-bottom > div > p { color: var(--muted); margin-top: 25px; }
.invoice-bottom dl { margin: 0; }
.invoice-bottom dl div { display: flex; justify-content: space-between; padding: 7px 0; }
.invoice-bottom dl .grand { border-top: 2px solid var(--navy); font-size: 1.15rem; font-weight: 850; margin-top: 5px; padding-top: 12px; }
.danger-zone { border-color: #efb8bf; }

.minimal-body { align-items: center; background: var(--navy); display: flex; justify-content: center; min-height: 100vh; padding: 25px; }
.error-card { background: white; border-radius: 20px; max-width: 560px; padding: 45px; text-align: center; width: 100%; }
.error-code { color: var(--blue); font-size: 3rem; font-weight: 900; margin-bottom: 0; }

.print-body { background: #e5e7eb; }
.print-toolbar { display: flex; gap: 10px; justify-content: center; padding: 20px; }
.a4-invoice { background: white; box-shadow: 0 8px 35px rgba(0, 0, 0, .18); margin: 0 auto 30px; min-height: 297mm; page: invoice-sheet; position: relative; width: 210mm; }
.modern-invoice { --invoice-primary: #123568; --invoice-accent: #2f6fed; --invoice-highlight: #17a6b6; --invoice-soft: #edf3ff; --invoice-theme-line: #d4e1f7; --invoice-notice: #eaf1fd; color: #172033; display: flex; flex-direction: column; overflow: hidden; padding: 0 12mm 5mm; }
.invoice-theme--royal-blue { --invoice-primary: #173f8a; --invoice-accent: #2563eb; --invoice-highlight: #38bdf8; --invoice-soft: #eff6ff; --invoice-theme-line: #bfdbfe; --invoice-notice: #eff6ff; }
.invoice-theme--teal { --invoice-primary: #115e59; --invoice-accent: #0f766e; --invoice-highlight: #2dd4bf; --invoice-soft: #f0fdfa; --invoice-theme-line: #99f6e4; --invoice-notice: #f0fdfa; }
.invoice-theme--emerald { --invoice-primary: #14532d; --invoice-accent: #15803d; --invoice-highlight: #4ade80; --invoice-soft: #f0fdf4; --invoice-theme-line: #bbf7d0; --invoice-notice: #f0fdf4; }
.invoice-theme--maroon { --invoice-primary: #701a2f; --invoice-accent: #9f1239; --invoice-highlight: #fb7185; --invoice-soft: #fff1f2; --invoice-theme-line: #fecdd3; --invoice-notice: #fff1f2; }
.invoice-theme--burgundy { --invoice-primary: #581c32; --invoice-accent: #7f1d3f; --invoice-highlight: #d94675; --invoice-soft: #fdf2f8; --invoice-theme-line: #fbcfe8; --invoice-notice: #fdf2f8; }
.invoice-theme--purple { --invoice-primary: #4c1d75; --invoice-accent: #7e22ce; --invoice-highlight: #c084fc; --invoice-soft: #faf5ff; --invoice-theme-line: #e9d5ff; --invoice-notice: #faf5ff; }
.invoice-theme--slate { --invoice-primary: #334155; --invoice-accent: #475569; --invoice-highlight: #94a3b8; --invoice-soft: #f8fafc; --invoice-theme-line: #cbd5e1; --invoice-notice: #f1f5f9; }
.invoice-theme--charcoal { --invoice-primary: #27272a; --invoice-accent: #3f3f46; --invoice-highlight: #a1a1aa; --invoice-soft: #fafafa; --invoice-theme-line: #d4d4d8; --invoice-notice: #f4f4f5; }
.invoice-theme--brown { --invoice-primary: #5c3317; --invoice-accent: #92400e; --invoice-highlight: #d97706; --invoice-soft: #fffbeb; --invoice-theme-line: #fde68a; --invoice-notice: #fffbeb; }
.invoice-accent { background: linear-gradient(90deg, var(--invoice-primary) 0 68%, var(--invoice-accent) 68% 91%, var(--invoice-highlight) 91% 100%); flex: 0 0 5mm; height: 5mm; margin: 0 -12mm 5mm; }
.invoice-page--has-next { break-after: page; page-break-after: always; }
.modern-header { align-items: stretch; display: grid; gap: 8mm; grid-template-columns: minmax(0, 1fr) 59mm; }
.seller-brand { align-items: flex-start; display: flex; gap: 5mm; min-width: 0; }
.seller-mark { align-items: center; background: var(--invoice-soft); border: .4mm solid var(--invoice-theme-line); border-radius: 4mm; color: var(--invoice-primary); display: flex; flex: 0 0 18mm; font-size: 17pt; font-weight: 900; height: 18mm; justify-content: center; overflow: hidden; }
.seller-mark img { height: 100%; object-fit: contain; padding: 1.5mm; width: 100%; }
.seller-copy { min-width: 0; }
.document-kicker, .section-label { color: var(--invoice-accent); display: block; font-size: 7.2pt; font-weight: 850; letter-spacing: .12em; text-transform: uppercase; }
.seller-copy h1 { color: var(--invoice-primary); font-family: Georgia, "Times New Roman", serif; font-size: 20.5pt; letter-spacing: -.025em; line-height: 1.05; margin: 1mm 0 1.4mm; }
.seller-copy > p { color: #596579; font-size: 8.5pt; line-height: 1.45; margin: 0; }
.seller-meta { display: flex; flex-wrap: wrap; gap: 1mm 5mm; margin-top: 2.3mm; }
.seller-meta span { color: #344054; font-size: 8.2pt; }
.seller-meta b { color: var(--invoice-primary); margin-right: 1mm; }
.invoice-identity { background: var(--invoice-primary); border-radius: 4mm; color: white; display: flex; flex-direction: column; padding: 4mm 5mm; }
.invoice-identity > span { color: #aebfda; font-size: 7pt; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.invoice-identity > strong { font-size: 15pt; letter-spacing: -.02em; margin-top: 1.2mm; }
.invoice-identity dl { border-top: .25mm solid rgba(255, 255, 255, .2); margin: 2mm 0 0; padding-top: 2mm; }
.invoice-identity dl div { display: flex; font-size: 7.8pt; justify-content: space-between; padding: .6mm 0; }
.invoice-identity dt { color: #b9c7dc; }.invoice-identity dd { font-weight: 750; margin: 0; }
.invoice-context { display: grid; gap: 4mm; grid-template-columns: minmax(0, 1.55fr) minmax(0, .85fr); margin-top: 4mm; }
.bill-to-card, .supply-card { background: #f7f9fc; border: .3mm solid #dfe6f0; border-radius: 3.5mm; min-height: 22mm; padding: 2.4mm 4mm; }
.bill-to-card h2 { color: #172033; font-size: 12pt; margin: .8mm 0 .4mm; }
.bill-to-card p, .supply-card p { color: #667085; font-size: 8.2pt; line-height: 1.4; margin: 0; }
.customer-meta { display: flex; flex-wrap: wrap; gap: .5mm 5mm; margin-top: 1mm; }
.customer-meta span { color: #475467; font-size: 8pt; }.customer-meta b { color: #172033; margin-right: 1mm; }
.supply-card > strong { color: var(--invoice-primary); display: block; font-size: 10pt; margin: 1mm 0 .6mm; }
.modern-items-table { border-collapse: separate; border-spacing: 0; font-size: 7.9pt; margin-top: 3.3mm; table-layout: fixed; }
.modern-items-table th { background: var(--invoice-primary); border: 0; color: white; font-size: 6.8pt; letter-spacing: .055em; padding: 2mm; text-transform: uppercase; }
.modern-items-table th:first-child { border-radius: 2.5mm 0 0 0; }.modern-items-table th:last-child { border-radius: 0 2.5mm 0 0; }
.modern-items-table th:nth-child(1) { width: 8mm; }.modern-items-table th:nth-child(2) { width: 69mm; }.modern-items-table th:nth-child(3) { width: 15mm; }.modern-items-table th:nth-child(4) { width: 10mm; }.modern-items-table th:nth-child(5) { width: 10mm; }.modern-items-table th:nth-child(6) { width: 21mm; }.modern-items-table th:nth-child(7) { width: 14mm; }.modern-items-table th:nth-child(8) { width: 27mm; }
.modern-items-table td { border: 0; border-bottom: .3mm solid #dfe6f0; color: #344054; padding: 1.8mm 2mm; vertical-align: top; }
.modern-items-table tbody tr:nth-child(even) td { background: #fafbfc; }
.modern-items-table .col-number { color: #667085; text-align: center; }
.modern-items-table .number { text-align: right; }
.modern-items-table .line-amount { color: var(--invoice-primary); font-weight: 850; }
.item-description strong { color: #172033; display: block; font-size: 8.4pt; line-height: 1.35; }
.item-description div { display: block; margin-top: .7mm; }
.item-description span { color: #667085; display: inline-block; font-size: 7.1pt; white-space: nowrap; }
.item-description span + span { margin-left: 2mm; }
.modern-financials { break-inside: avoid; display: grid; gap: 8mm; grid-template-columns: minmax(0, 1fr) 67mm; margin-top: 3mm; }
.invoice-narrative > strong { color: var(--invoice-primary); display: block; font-size: 9.3pt; line-height: 1.5; margin-top: 1.5mm; }
.totals-card { border: .35mm solid #d4deeb; border-radius: 3.5mm; overflow: hidden; }
.totals-card > div { align-items: center; display: flex; justify-content: space-between; padding: 1.6mm 3.5mm; }
.totals-card > div + div { border-top: .25mm solid #e4e9f1; }
.totals-card span { color: #667085; font-size: 7.7pt; }.totals-card strong { color: #172033; font-size: 8.7pt; }
.totals-card .grand-total { background: var(--invoice-primary); border-top: 0; color: white; padding: 2.4mm 3.5mm; }
.totals-card .grand-total span { color: #c8d4e7; font-size: 8pt; font-weight: 800; text-transform: uppercase; }.totals-card .grand-total strong { color: white; font-size: 14pt; }
.modern-terms { background: #f7f9fc; border: .3mm solid #d7e1ef; border-radius: 3.5mm; break-inside: avoid; font-family: "Nirmala UI", Mangal, "Noto Sans Devanagari", sans-serif; margin-top: 2.5mm; padding: 2.7mm 3.5mm; page-break-inside: avoid; }
.modern-terms-heading { align-items: baseline; border-bottom: .25mm solid #d7e1ef; display: flex; gap: 3mm; justify-content: space-between; margin-bottom: 1.6mm; padding-bottom: 1.2mm; }
.modern-terms-heading strong { color: var(--invoice-primary); font-size: 9pt; }
.modern-terms-columns { display: grid; gap: 6mm; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.modern-terms ol { color: #3f4b5f; font-size: 6.8pt; line-height: 1.35; margin: 0; padding-left: 4.5mm; }
.modern-terms li { padding-left: .7mm; }
.modern-terms li + li { margin-top: .75mm; }
.modern-terms-plain { color: #3f4b5f; font-size: 7pt; line-height: 1.4; margin: 0; }
.modern-terms-notices { background: var(--invoice-notice); border-left: .9mm solid var(--invoice-accent); border-radius: 1.5mm; margin-top: 1.5mm; padding: 1.2mm 2.5mm; }
.modern-terms-notices p { color: #344054; font-size: 6.6pt; line-height: 1.35; margin: 0; }
.modern-terms-notices p + p { margin-top: .4mm; }
.modern-footer { align-items: flex-end; border-top: .35mm solid #dfe6f0; display: grid; gap: 6mm; grid-template-columns: 1fr 1.2fr 1fr; margin-top: auto; padding-top: 3.5mm; }
.signature-block { color: #475467; font-size: 7.5pt; }.signature-block i { border-top: .3mm solid #98a2b3; display: block; margin-top: 5mm; width: 42mm; }.signature-block b { color: #172033; display: block; margin-top: 1mm; }
.signature-block.authorised { text-align: right; }.signature-block.authorised i { margin-left: auto; }
.invoice-note { text-align: center; }.invoice-note strong { color: var(--invoice-primary); display: block; font-size: 8.5pt; }.invoice-note span { color: #98a2b3; display: block; font-size: 6.8pt; margin-top: .8mm; }
.cancel-watermark { color: rgba(190, 24, 43, .12); font-size: 55pt; font-weight: 900; left: 28mm; position: absolute; top: 118mm; transform: rotate(-30deg); z-index: 3; }
.continuation-header { align-items: center; border-bottom: .35mm solid #d7e1ef; display: grid; gap: 8mm; grid-template-columns: minmax(0, 1fr) 73mm; padding: 1mm 0 4mm; }
.continuation-header > div > strong { color: var(--invoice-primary); display: block; font-family: Georgia, "Times New Roman", serif; font-size: 17pt; line-height: 1.1; margin-top: 1mm; }
.continuation-header small { color: #667085; font-size: 7.5pt; margin-top: 1mm; }
.continuation-header dl { background: #f7f9fc; border: .3mm solid #d7e1ef; border-radius: 2.5mm; margin: 0; padding: 2mm 3mm; }
.continuation-header dl div { display: flex; font-size: 7.5pt; justify-content: space-between; }
.continuation-header dl div + div { margin-top: .6mm; }
.continuation-header dt { color: #667085; }.continuation-header dd { color: var(--invoice-primary); font-weight: 800; margin: 0; }
.continuation-note { align-items: center; border-top: .3mm solid #d7e1ef; color: #667085; display: flex; font-size: 7.5pt; justify-content: space-between; margin-top: auto; padding-top: 3mm; }
.continuation-note strong { color: var(--invoice-primary); }

.gst-report-print { background: white; box-shadow: 0 8px 35px rgba(0, 0, 0, .18); box-sizing: border-box; color: #172033; margin: 0 auto 30px; min-height: 297mm; page: gst-report-sheet; padding: 12mm; width: 210mm; }
.gst-report-header { border-bottom: 1.2mm solid #123568; display: grid; gap: 10mm; grid-template-columns: minmax(0, 1fr) 65mm; padding-bottom: 5mm; }
.gst-report-header > div:first-child > span { color: #2f6fed; font-size: 8pt; font-weight: 850; letter-spacing: .12em; }
.gst-report-header h1 { color: #123568; font-family: Georgia, "Times New Roman", serif; font-size: 22pt; margin: 1mm 0; }
.gst-report-header p { color: #596579; font-size: 8.5pt; margin: 0; }
.gst-report-header > div:last-child { display: grid; font-size: 8pt; gap: 1mm; grid-template-columns: 18mm 1fr; }
.gst-report-header > div:last-child strong { color: #123568; }
.gst-print-summary { display: grid; gap: 3mm; grid-template-columns: repeat(4, minmax(0, 1fr)); margin: 5mm 0; }
.gst-print-summary > div { background: #f7f9fc; border: .3mm solid #dfe6f0; border-radius: 2mm; padding: 3mm; }
.gst-print-summary span { color: #667085; display: block; font-size: 7pt; text-transform: uppercase; }
.gst-print-summary strong { color: #123568; display: block; font-size: 11pt; margin-top: 1mm; }
.gst-report-print h2 { color: #123568; font-size: 11pt; margin: 5mm 0 2mm; }
.gst-print-table { border-collapse: collapse; font-size: 6.8pt; table-layout: auto; width: 100%; }
.gst-print-table th { background: #123568; border: .2mm solid #dfe6f0; color: white; font-size: 6.2pt; padding: 1.6mm 1.2mm; }
.gst-print-table td { border: .2mm solid #dfe6f0; padding: 1.5mm 1.2mm; }
.gst-print-table tbody tr:nth-child(even) td { background: #fafbfc; }
.gst-report-footer { border-top: .3mm solid #dfe6f0; color: #667085; font-size: 6.7pt; margin-top: 7mm; padding-top: 3mm; }
.gst-report-footer p { margin: 0 0 1mm; }

@media (max-width: 1100px) {
    .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .item-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .stock-adjust-form { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .dashboard-grid { grid-template-columns: 1fr; }
    .report-filter { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .invoice-theme-options { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 780px) {
    .app-shell { display: block; }
    .sidebar { box-shadow: 15px 0 40px rgba(0, 0, 0, .3); left: -270px; position: fixed; transition: left .2s ease; width: 250px; }
    .sidebar.open { left: 0; }
    .menu-button { display: block; }
    .topbar { justify-content: flex-start; }
    .content { padding: 20px 15px; }
    .page-heading, .card-heading, .split-toolbar, .invoice-submit { align-items: stretch; flex-direction: column; }
    .page-heading { align-items: flex-start; }
    .form-grid, .item-grid, .customer-box, .invoice-bottom { grid-template-columns: 1fr; }
    .form-grid .span-2, .item-grid .span-2, .customer-box > *, .invoice-bottom > * { grid-column: span 1; }
    .filter-bar { align-items: stretch; flex-direction: column; }
    .filter-bar input, .filter-bar select { max-width: none; }
    .auth-shell { display: block; padding: 20px; }
    .auth-brand { display: none; }
    .auth-card { margin: 30px auto; max-width: 500px; }
    .invoice-submit { position: static; }
    .selected-product { align-items: flex-start; flex-direction: column; }.selected-product small { margin-left: 0; }
    .stock-adjust-form { grid-template-columns: 1fr; }
    .sales-chart-row { grid-template-columns: 62px minmax(80px, 1fr); }.sales-chart-row strong { grid-column: 2; text-align: left; }
    .report-filter, .tax-summary-grid { grid-template-columns: 1fr; }
    .invoice-theme-options { grid-template-columns: 1fr; }
}

@page invoice-sheet { margin: 0; size: A4 portrait; }
@page gst-report-sheet { margin: 10mm; size: A4 portrait; }

@media print {
    @page { margin: 0; size: A4 portrait; }
    * { -webkit-print-color-adjust: exact !important; print-color-adjust: exact !important; }
    .print-toolbar { display: none !important; }
    .print-body { background: white; }
    .a4-invoice { box-shadow: none; margin: 0; min-height: 297mm; width: 210mm; }
    .modern-invoice { display: block; }
    .invoice-page--final .modern-footer { margin-top: 3.5mm; }
    .invoice-page--has-next .continuation-note { margin-top: 3mm; }
    .modern-items-table thead { display: table-header-group; }
    .modern-items-table tr, .modern-financials, .modern-terms, .modern-footer { break-inside: avoid; page-break-inside: avoid; }
    .gst-report-print { box-shadow: none; margin: 0; min-height: 0; padding: 0; width: auto; }
    .gst-print-table thead { display: table-header-group; }
    .gst-print-table tr, .gst-print-summary, .gst-report-header, .gst-report-footer { break-inside: avoid; page-break-inside: avoid; }
}
