:root {
    color-scheme: light;
    --ink: #171717;
    --muted: #68707a;
    --line: #e6e8eb;
    --gold: #c79a43;
    --gold-dark: #8d6722;
    --paper: #ffffff;
    --canvas: #f5f6f8;
    --green: #217a53;
    --red: #a33e35;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    color: var(--ink);
    background: var(--canvas);
    font: 15px/1.55 Arial, Helvetica, sans-serif;
}

a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }

.eyebrow {
    margin: 0 0 7px;
    color: var(--gold-dark);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 2px;
    text-transform: uppercase;
}

.muted { color: var(--muted); }

.auth-page {
    display: grid;
    min-height: 100vh;
    padding: 24px;
    place-items: center;
    background: #171717;
}

.auth-card {
    width: min(100%, 430px);
    padding: 38px;
    border: 1px solid #ece8df;
    border-radius: 14px;
    background: var(--paper);
    box-shadow: 0 25px 70px #0004;
}

.auth-card h1 { margin: 0 0 8px; font-size: 30px; letter-spacing: -1px; }
.auth-card > .muted { margin: 0 0 24px; }
.auth-footnote { margin: 22px 0 0; text-align: center; font-size: 13px; }
.auth-footnote a, .text-link, .table-link { color: var(--gold-dark); font-weight: 700; }

.stack-form { display: grid; gap: 15px; }
label { display: grid; gap: 6px; color: #34383d; font-size: 13px; font-weight: 700; }
input, select, textarea {
    width: 100%;
    min-width: 0;
    padding: 10px 11px;
    border: 1px solid #d9dde2;
    border-radius: 6px;
    color: var(--ink);
    background: #fff;
}
input:focus, select:focus, textarea:focus { outline: 2px solid #c79a4350; border-color: var(--gold); }
textarea { resize: vertical; }

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    padding: 9px 15px;
    border: 1px solid transparent;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 750;
    cursor: pointer;
}
.button.primary { color: white; background: #1c1c1c; }
.button.primary:hover { background: var(--gold-dark); }
.button.secondary { border-color: var(--line); color: #25282c; background: white; }
.button.secondary:hover { border-color: var(--gold); }
.button.danger { border-color: #f0c9c5; color: #8d3028; background: #fff; }
.button.danger:hover { border-color: #b84238; color: #fff; background: #b84238; }
.button.small { min-height: 32px; padding: 5px 10px; font-size: 12px; }
.button.full-width { width: 100%; margin-top: 5px; }
.inline-delete-form { display: inline-flex; margin-left: 5px; }

.notice {
    margin: 0 0 18px;
    padding: 12px 14px;
    border: 1px solid #e3d4ad;
    border-radius: 7px;
    color: #604613;
    background: #fff9e9;
    font-size: 13px;
}
.notice.success { border-color: #b9dfca; color: #1c6845; background: #effaf3; }
.notice.error { border-color: #efc1bd; color: #8d3028; background: #fff2f0; }

.app-page { min-height: 100vh; }
.sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 3;
    display: flex;
    width: 248px;
    flex-direction: column;
    padding: 7px 17px 18px;
    color: #fff;
    background: #171717;
}
.brand { display: flex; align-items: center; margin: -2px 0 0 -4px; padding: 0 7px 46px; }
.brand img { display: block; width: 166px; max-width: 100%; height: auto; border-radius: 4px; background: #fff; }
.side-nav { display: grid; gap: 5px; }
.side-nav a { padding: 11px 12px; border-radius: 6px; color: #d8d8d8; font-size: 13px; }
.side-nav a:hover, .side-nav a.active { color: white; background: #34312b; }
.side-nav a.active { box-shadow: inset 3px 0 var(--gold); }
.sidebar-bottom { display: grid; gap: 11px; margin-top: auto; padding: 15px 8px 0; border-top: 1px solid #373737; color: #bcbcbc; font-size: 11px; }
.sidebar-bottom form { margin: 0; }
.sidebar-bottom a, .logout-button { color: #e7c77f; font-size: 12px; }
.logout-button { padding: 0; border: 0; background: none; cursor: pointer; }

.main-content { max-width: 1600px; min-height: 100vh; margin-left: 248px; padding: 30px clamp(22px, 4vw, 58px) 20px; }
.topbar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 27px; }
.topbar h1 { margin: 0; font-size: clamp(27px, 3vw, 35px); letter-spacing: -1.2px; }
.today { color: var(--muted); font-size: 13px; }
.stat-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 14px; margin-bottom: 20px; }
.expense-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.stat-card { display: grid; gap: 12px; min-height: 116px; padding: 19px; border: 1px solid var(--line); border-radius: 9px; background: var(--paper); }
.stat-card span { color: var(--muted); font-size: 12px; }
.stat-card strong { font-size: clamp(17px, 2vw, 23px); letter-spacing: -.5px; }
.stat-card.highlight { border-color: #d6bd89; background: #fffaf0; }
.quick-actions { display: flex; flex-wrap: wrap; gap: 9px; margin: 0 0 23px; }
.panel { min-width: 0; margin-bottom: 20px; padding: 22px; border: 1px solid var(--line); border-radius: 9px; background: var(--paper); }
.panel-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 19px; }
.panel-heading h2 { margin: 0; font-size: 19px; letter-spacing: -.4px; }
.panel-heading .eyebrow { margin-bottom: 3px; }
.two-column { display: grid; grid-template-columns: minmax(270px, .8fr) minmax(0, 1.4fr); align-items: start; gap: 18px; }
.empty-state { padding: 28px 10px; color: var(--muted); text-align: center; }
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; overscroll-behavior-inline: contain; }
table { width: 100%; border-collapse: collapse; text-align: left; }
th { padding: 10px 12px; color: #737981; font-size: 10px; letter-spacing: .7px; text-transform: uppercase; white-space: nowrap; }
td { padding: 13px 12px; border-top: 1px solid #eceef0; font-size: 13px; vertical-align: middle; }
td small.table-sub { display: block; margin-top: 3px; color: var(--muted); font-size: 11px; }
.pill { display: inline-block; padding: 3px 7px; border-radius: 99px; color: #655022; background: #f5edda; font-size: 10px; font-weight: 800; white-space: nowrap; }
.pill-in { color: #1f6c49; background: #e8f6ee; }
.pill-out { color: #963e37; background: #fff0ee; }
.table-link { font-size: 12px; white-space: nowrap; }
.project-report-note { margin: -7px 0 16px; font-size: 13px; }
.project-finance-table { min-width: 1200px; }
.project-finance-table th:not(:first-child), .project-finance-table td:not(:first-child) { white-space: nowrap; }
.project-finance-table tfoot th { border-top: 2px solid #d8dce0; font-size: 11px; text-transform: none; }
.project-filter-form { display: flex; align-items: end; flex-wrap: wrap; gap: 12px; }
.project-filter-form label { width: min(100%, 420px); }
.project-filter-form select { min-width: 260px; }
.financial-report { margin-bottom: 18px; }
.report-date-range { color: var(--muted); font-size: 12px; white-space: nowrap; }
.report-toolbar { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; margin: 14px 0; }
.period-tabs { display: flex; flex-wrap: wrap; gap: 7px; }
.period-tabs .active { border-color: var(--gold); color: var(--gold-dark); background: #fbf7ed; }
.custom-date-form { display: flex; align-items: end; flex-wrap: wrap; gap: 10px; padding: 12px; border: 1px solid var(--line); border-radius: 7px; background: #fafafa; }
.custom-date-form label { width: min(100%, 190px); }
.custom-date-form input { min-height: 40px; }
.report-stat-grid { margin-top: 10px; }
.export-button { white-space: nowrap; }
.profit-positive { color: var(--green); font-weight: 700; }
.profit-negative { color: var(--red); font-weight: 700; }
.profit-positive small, .profit-negative small { display: block; font-size: 10px; }
.form-panel { max-width: 100%; }
.document-form { display: grid; gap: 19px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.items-heading { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: -9px; }
.items-heading h3 { margin: 0; font-size: 15px; }
.line-items { display: grid; gap: 9px; }
.line-item-row { display: grid; grid-template-columns: minmax(170px, 2.6fr) minmax(80px, .8fr) minmax(80px, .8fr) minmax(115px, 1fr) 32px; align-items: end; gap: 9px; }
.line-item-row label { font-size: 11px; }
.budget-items { display: grid; gap: 10px; overflow-x: auto; padding-bottom: 5px; }
.budget-item-row { display: grid; min-width: 1120px; grid-template-columns: minmax(155px, 1.2fr) minmax(180px, 1.5fr) minmax(115px, .8fr) 90px 100px 130px 140px 32px; align-items: end; gap: 9px; padding: 12px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.budget-item-row label { font-size: 11px; }
.budget-item-row .budget-custom-stage { margin-top: 7px; }
.budget-line-total { padding: 10px 0; font-size: 12px; white-space: nowrap; }
.budget-total { display: flex; justify-content: flex-end; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); font-size: 14px; }
.budget-tools { display: grid; gap: 12px; margin: 14px 0 20px; padding: 14px; border: 1px solid var(--line); border-radius: 8px; background: #fafafa; }
.budget-export-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.budget-import-form { display: flex; align-items: end; flex-wrap: wrap; gap: 10px; margin: 0; }
.budget-import-form label { flex: 1 1 280px; }
.budget-tools > .muted { margin: 0; font-size: 12px; }
.budget-autosave-status { margin: 0; color: var(--muted); font-size: 12px; }
.budget-autosave-status.error { color: var(--red); }
.budget-row-actions { min-width: 270px; white-space: nowrap; }
.budget-row-actions .inline-delete-form { margin-left: 5px; }
.budget-row-actions .document-row-share { margin-left: 5px; }
.budget-expense-status { margin: -5px 0 4px; color: var(--muted); font-size: 13px; }
.budget-expense-status[hidden] { display: none; }
.budget-expense-status.over-budget { color: var(--red); font-weight: 700; }
.budget-summary { margin-bottom: 18px; }
.quotation-form { font-family: "Nirmala UI", "Noto Sans Bengali", "Vrinda", Arial, sans-serif; }
.quotation-page { font-family: "Nirmala UI", "Noto Sans Bengali", "Vrinda", Arial, sans-serif; }
.quotation-line-items { overflow-x: auto; padding-bottom: 5px; }
.quotation-line-item-row { grid-template-columns: 34px minmax(145px, 1fr) minmax(170px, 1.5fr) 85px minmax(145px, 1fr) minmax(125px, .9fr) 32px; min-width: 1130px; }
.invoice-line-items { overflow-x: auto; padding-bottom: 5px; }
.invoice-line-item-row { grid-template-columns: minmax(140px, 1fr) minmax(170px, 1.5fr) 70px 75px minmax(115px, .9fr) 32px; min-width: 830px; }
.quotation-line-number { display: grid; width: 30px; height: 38px; align-items: center; justify-items: center; border: 1px solid var(--line); border-radius: 6px; color: var(--muted); font-size: 13px; font-weight: 700; }
.quotation-form .inline-status select { font-family: inherit; }
.remove-line { width: 32px; height: 38px; border: 1px solid var(--line); border-radius: 6px; color: #8d3028; background: #fff; font-size: 22px; cursor: pointer; }
.inline-status { display: flex; align-items: center; gap: 7px; }
.inline-status select { width: auto; padding: 5px 7px; font-size: 11px; }
.agreement-status-form { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 6px; }
.agreement-status-form select { max-width: 125px; }
.app-footer { padding: 15px 0 4px; color: #838991; font-size: 11px; }
.agreement-form-note { margin: -8px 0 18px; font-size: 13px; }
.form-panel > .agreement-form-note { margin-top: 8px; }

.print-page { min-height: 100vh; padding: 25px; background: #eceef0; }
.quotation-translation-missing .paper { display: none !important; }
.print-toolbar { display: flex; width: min(100%, 794px); align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 9px; margin: 0 auto 14px; }
.preview-zoom-controls { display: flex; align-items: center; justify-content: center; gap: 8px; }
.preview-zoom-controls [data-zoom-level] { min-width: 48px; color: var(--muted); font-size: 12px; font-weight: 700; text-align: center; }
.inline-send-email { margin: 0; }
.document-share { position: relative; }
.document-row-share { position: relative; display: inline-block; margin-left: 5px; vertical-align: middle; }
.document-share > summary { list-style: none; }
.document-row-share > summary { list-style: none; }
.document-share > summary::-webkit-details-marker { display: none; }
.document-row-share > summary::-webkit-details-marker { display: none; }
.document-share-options { position: absolute; z-index: 10; top: calc(100% + 6px); left: 0; display: grid; min-width: 255px; gap: 8px; padding: 10px; border: 1px solid var(--line); border-radius: 8px; background: #fff; box-shadow: 0 8px 24px #1b1b1b20; }
.document-share-options .button, .document-share-options .inline-send-email { width: 100%; }
.document-share-options.is-floating-share-menu { position: fixed; z-index: 20; top: 8px; left: 8px; min-width: 190px; max-width: min(255px, calc(100vw - 16px)); max-height: calc(100vh - 16px); max-height: calc(100dvh - 16px); overflow-y: auto; }
.document-share-options .muted { padding: 4px 2px; font-size: 12px; line-height: 1.5; }
.document-share-status { width: 100%; color: #46565c; font-size: 12px; line-height: 1.5; }
.print-preview-notice { width: min(100%, 794px); margin: 0 auto 14px; color: #46565c; font-size: 12px; line-height: 1.5; }
.quotation-translation-warning { padding: 12px 14px; border: 1px solid #efc1bd; border-radius: 7px; color: #8d3028; background: #fff2f0; }
.print-mode-options, .document-language-options { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 6px; }
.print-mode-options .active, .document-language-options .active { border-color: #168bb0; color: #116b86; background: #edf8fb; }
.document-language-bn .paper { font-family: "Nirmala UI", "Noto Sans Bengali", "Vrinda", Arial, sans-serif; }
.paper { position: relative; width: min(100%, 794px); min-height: 1122px; margin: auto; overflow: visible; background: #fff; box-shadow: 0 8px 35px #1b1b1b16; }
.stationery-art { position: absolute; z-index: 0; inset: 0 auto auto 0; width: 100%; height: 1122px; object-fit: fill; }
.stationery-meta { position: absolute; z-index: 2; top: 10.2%; left: 0; width: 100%; color: #202020; font-size: 10px; line-height: 1.2; }
.stationery-meta span { position: absolute; top: 0; white-space: nowrap; }
.stationery-meta span:first-child { left: 10.8%; }
.stationery-meta span:last-child { left: 66%; }
.stationery-content { position: relative; z-index: 1; padding: 145px 9% 190px; }
.continuous-document .stationery-art { clip-path: inset(0 0 8%); }
.document-preview-pages { display: none; gap: 20px; padding-bottom: 24px; }
.document-preview-pages.is-building { position: absolute; inset: 0 0 auto; display: grid; visibility: hidden; }
.print-page.has-paged-preview > .paper { display: none; }
.print-page.has-paged-preview .document-preview-pages { display: grid; }
.document-preview-sheet { height: 1122px; min-height: 1122px; overflow: hidden; }
.paper-mode-legal .document-preview-sheet { height: 1344px; min-height: 1344px; }
.agreement-document.paper-mode-pad .document-preview-sheet .stationery-content { padding-bottom: 140px; }
.document-preview-sheet .stationery-art { clip-path: none; }
.document-preview-sheet .stationery-content { height: 100%; overflow: hidden; }
.budget-report-page .document-preview-sheet .stationery-content { padding-bottom: 145px; }
.preview-page-number { position: absolute; z-index: 3; right: 55px; bottom: 105px; color: #50565d; font-size: 9px; }
.document-heading { margin: 26px 0 18px; color: #147e9e; font-size: 21px; letter-spacing: 1px; text-align: center; }
.document-heading span { font-size: 12px; letter-spacing: 1.5px; }
.paper-party { margin: 20px 0 26px; padding: 13px 16px; border-left: 3px solid #158caf; background: transparent; }
.paper-party h2 { margin: 0 0 4px; font-size: 17px; }
.paper-party p { margin: 3px 0; color: #50565d; font-size: 12px; }
.quotation-address, .quotation-subject, .quotation-intro, .quotation-table-title { font-family: "Nirmala UI", "Noto Sans Bengali", "Vrinda", sans-serif; }
.quotation-address { margin: 21px 0 13px; color: #242a2c; font-size: 13px; line-height: 1.7; }
.quotation-address p, .quotation-address h2 { margin: 0; }
.quotation-address h2 { font-size: 14px; }
.quotation-subject { margin: 14px 0; padding: 10px 13px; border-left: 3px solid #168bb0; background: transparent; font-size: 13px; line-height: 1.7; }
.quotation-subject > span { display: block; padding-left: 44px; }
.quotation-subject p { margin: 7px 0 2px; }
.quotation-intro { margin: 12px 0; font-size: 13px; line-height: 1.75; }
.quotation-table-title { margin: 17px 0 7px; font-size: 14px; text-align: center; }
.agreement-intro, .agreement-section, .agreement-amount, .agreement-dates, .agreement-sign-date { font-family: "Nirmala UI", "Noto Sans Bengali", "Vrinda", sans-serif; }
.agreement-intro { margin: 12px 0 16px; font-size: 13px; line-height: 1.75; }
.agreement-section { margin: 12px 0; font-size: 12px; line-height: 1.65; break-inside: avoid; page-break-inside: avoid; }
.agreement-section h2 { margin: 0 0 4px; color: #166d86; font-size: 13px; }
.agreement-section p { margin: 0; }
.agreement-amount, .agreement-dates { margin: 10px 0; font-size: 12px; }
.agreement-signatures { margin-top: 58px; }
.agreement-signatures span, .quotation-signatures span { min-height: 46px; color: #343a3d; line-height: 1.7; }
.agreement-signature-table { display: none; }
.pdf-render .agreement-signatures { display: none; }
.pdf-render .agreement-signature-table { display: table; width: 100%; margin-top: 80px; border-collapse: collapse; table-layout: fixed; }
.pdf-render .agreement-signature-table td { width: 50%; padding: 0 14px; border: 0; color: #59666b; font-size: 11px; line-height: 1.6; text-align: center; vertical-align: top; }
.pdf-render .agreement-signature-table p { margin: 0; }
.pdf-render .agreement-signature-rule { height: 1px; margin-bottom: 7px; border-top: 1px solid #7e8288; }
.pdf-render .agreement-signature-table .agreement-signatory-name,
.pdf-render .agreement-signature-table .agreement-signatory-title { display: block; }
.pdf-render .agreement-signature-table .agreement-signatory-name { margin-top: 7px; }
.pdf-render .quotation-signatures { display: table; width: 100%; margin: 90px 0 26px; border-collapse: collapse; table-layout: fixed; page-break-inside: avoid; }
.pdf-render .quotation-signatures > span { display: table-cell; width: 50%; padding: 9px 14px 0; border: 0; border-top: 1px solid #7e8288; vertical-align: top; }
.pdf-render .quotation-signatures .agreement-signatory-name,
.pdf-render .quotation-signatures .agreement-signatory-title { display: block; }
.pdf-render.quotation-document .document-heading { margin: 10px 0 5px; }
.pdf-render.quotation-document .quotation-address { margin: 5px 0 4px; }
.pdf-render.quotation-document .quotation-subject { margin: 5px 0; padding: 4px 8px; }
.pdf-render.quotation-document .quotation-intro { margin: 4px 0; }
.pdf-render.quotation-document .quotation-table-title { margin: 6px 0 2px; }
.pdf-render.quotation-document .quotation-total-summary { margin: 4px 0 5px; padding: 4px 6px; }
.pdf-render.quotation-document .paper-table th,
.pdf-render.quotation-document .paper-table td { padding: 4px 3px; }
.pdf-render.quotation-document .quotation-signatures { margin-top: 70px; }
.agreement-signatures .agreement-signatory-name, .agreement-signatures .agreement-signatory-title,
.quotation-signatures .agreement-signatory-name, .quotation-signatures .agreement-signatory-title { display: block; }
.agreement-signatures .agreement-signatory-name, .quotation-signatures .agreement-signatory-name { margin-top: 5px; color: #202628; }
.agreement-signatures .agreement-signatory-title, .quotation-signatures .agreement-signatory-title { color: #59666b; font-size: 10px; }
.agreement-sign-date { margin-top: 12px; font-size: 11px; text-align: center; }
.paper-table { width: 100%; border-collapse: collapse; color: #202628; font-size: 11px; }
.paper-table th, .paper-table td { padding: 9px 8px; border: 1px solid #788c93; }
.paper-table th { color: #166d86; background: transparent; font-size: 10px; }
.paper-table td { vertical-align: top; }
.paper-table tbody tr:nth-child(even) { background: transparent; }
.paper-table tfoot th { color: #18343c; background: transparent; font-size: 11px; }
.budget-report { padding: 0; color: #25343b; font-family: Arial, Helvetica, sans-serif; }
.budget-report-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin: 28px 0 20px; }
.budget-report-heading .eyebrow { margin-bottom: 5px; }
.budget-report-heading h1 { margin: 0; color: #172b35; font-size: 21px; line-height: 1.25; }
.budget-report-heading p:not(.eyebrow) { margin: 6px 0 0; color: #64727a; font-size: 10px; }
.budget-report-reference { display: grid; gap: 5px; text-align: right; }
.budget-report-reference span, .budget-report-summary span { color: #64727a; font-size: 8px; text-transform: uppercase; letter-spacing: .5px; }
.budget-report-reference strong { color: #1687a3; font-size: 12px; }
.budget-report-summary { width: 100%; margin: 0 0 18px; border-collapse: collapse; table-layout: fixed; }
.budget-report-summary td { width: 33.33%; padding: 10px 11px; border: 1px solid #d5e1e5; background: #f3f8fa; }
.budget-report-summary strong { display: block; margin-top: 4px; color: #18343c; font-size: 12px; }
.budget-report-table-title { margin: 0 0 7px; color: #18343c; font-size: 13px; }
.budget-report-table { table-layout: fixed; font-size: 8px; }
.budget-report-table th, .budget-report-table td { padding: 4px 3px; border-color: #d5e1e5; line-height: 1.25; }
.budget-report-table th:not(:nth-child(2)), .budget-report-table td:not(:nth-child(2)) { white-space: nowrap; overflow-wrap: normal; }
.budget-report-table thead th { color: #fff; background: #176f87; font-size: 7px; text-align: left; }
.budget-report-table thead th:first-child { width: 5%; }
.budget-report-table thead th:nth-child(2) { width: 37%; }
.budget-report-table thead th:nth-child(3) { width: 10%; }
.budget-report-table thead th:nth-child(4) { width: 7%; }
.budget-report-table thead th:nth-child(5) { width: 7%; }
.budget-report-table thead th:nth-child(6) { width: 16%; }
.budget-report-table thead th:nth-child(7) { width: 18%; }
.budget-report-table td:nth-child(2) { overflow-wrap: anywhere; }
.budget-report-table .budget-report-stage th { padding: 5px 4px; color: #176f87; background: #edf5f7; font-size: 8px; text-align: left; }
.budget-report-table .budget-report-subtotal td { color: #33454c; background: #f6f8f9; font-size: 7px; font-weight: 700; }
.budget-report-table tfoot th { padding: 7px 4px; border-top: 2px solid #176f87; color: #173d49; background: #eaf3f5; font-size: 8px; }
.budget-report-note { margin-top: 12px; padding: 8px 10px; border-left: 3px solid #c79a43; color: #58666c; background: #fbf8f1; font-size: 8px; line-height: 1.4; }
.amount-in-words { margin: 8px 0 12px; color: #30383b; font-size: 12px; line-height: 1.6; }
.quotation-table { font-family: "Nirmala UI", "Noto Sans Bengali", "Vrinda", sans-serif; font-size: 11px; }
.quotation-table th { font-size: 11px; }
.quotation-table th:first-child, .quotation-table td:first-child { width: 8%; text-align: center; }
.quotation-table th:nth-child(2), .quotation-table td:nth-child(2) { width: 16%; }
.quotation-table th:nth-child(3), .quotation-table td:nth-child(3) { width: 28%; }
.quotation-table th:nth-child(4), .quotation-table td:nth-child(4) { width: 9%; }
.quotation-table th:nth-child(5), .quotation-table td:nth-child(5) { width: 13%; }
.quotation-table th:nth-child(6), .quotation-table td:nth-child(6) { width: 13%; }
.quotation-table th:nth-child(7), .quotation-table td:nth-child(7) { width: 13%; }
.quotation-total-summary { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: start; gap: 18px; margin: 12px 0 18px; padding: 11px 13px; border: 1px solid #b5c9cf; color: #202628; font-size: 12px; break-inside: avoid; page-break-inside: avoid; }
.quotation-total-summary p { display: flex; flex-wrap: wrap; gap: 8px 14px; margin: 5px 0 0; }
.quotation-total-summary > p { display: grid; gap: 5px; margin: 0; text-align: right; }
.quotation-total-summary > p span { color: #116b86; font-size: 15px; font-weight: 800; white-space: nowrap; }
.right { text-align: right; }
.paper-balance { display: grid; justify-content: end; min-width: 245px; margin: 17px 0 0 auto; padding: 10px 13px; border: 1px solid #bad2da; background: transparent; }
.paper-balance p { display: flex; justify-content: space-between; gap: 24px; margin: 3px 0; font-size: 12px; }
.paper-balance p:last-child { color: #116d89; font-size: 14px; }
.receipt-copy { margin: 55px 0 10px; color: #414b50; font-size: 15px; text-align: center; }
.receipt-amount { width: fit-content; min-width: 260px; margin: 12px auto 25px; padding: 14px 24px; border: 1px solid #93bdca; border-radius: 5px; color: #116b86; background: transparent; font-size: 24px; font-weight: 800; text-align: center; }
.receipt-details { width: min(100%, 500px); margin: 0 auto; border: 1px solid #b5c9cf; }
.receipt-details div { display: grid; grid-template-columns: 150px 1fr; gap: 12px; padding: 9px 12px; border-bottom: 1px solid #dce6e9; font-size: 12px; }
.receipt-details div:last-child { border-bottom: 0; }
.receipt-details span { color: #5d6b70; }
.paper-notes { margin-top: 21px; padding: 12px 14px; border-left: 3px solid #138bb2; color: #3e494d; background: transparent; font-size: 12px; }
.signature-row { display: flex; justify-content: space-between; gap: 50px; margin: 82px 0 26px; }
.signature-row span { width: 220px; padding-top: 9px; border-top: 1px solid #7e8288; color: #59666b; font-size: 11px; text-align: center; }
.paper-mode-legal .paper { width: min(100%, 816px); min-height: 1344px; }
.paper-mode-legal .stationery-meta { top: 390px; left: 0; display: flex; justify-content: space-between; padding: 0 76px; }
.paper-mode-legal .stationery-meta span { position: static; }
.paper-mode-legal .stationery-content { padding: 432px 72px 85px; }
.paper-mode-legal .stationery-content > :first-child { margin-top: 0; }
.paper-mode-legal .document-heading, .paper-mode-legal .agreement-section h2 { color: #171717; }
.paper-mode-legal .quotation-subject, .paper-mode-legal .paper-party, .paper-mode-legal .paper-notes { border-color: #777; background: transparent; }
.preview-picker { display: flex; width: min(100%, 850px); align-items: flex-start; flex-direction: column; gap: 12px; margin: 0 auto 16px; padding: 15px 18px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.preview-picker h1 { margin: 0; font-size: 17px; }
.preview-picker .eyebrow { margin: 0 0 3px; }
.preview-actions { display: flex; align-items: center; flex-wrap: wrap; justify-content: flex-start; gap: 7px; }
.preview-actions .active { border-color: #168bb0; color: #116b86; background: #edf8fb; }

@media (max-width: 1100px) {
    .sidebar { width: 205px; }
    .main-content { margin-left: 205px; }
    .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .two-column { grid-template-columns: 1fr; }
}

@media (max-width: 700px) {
    .sidebar { position: static; width: auto; padding: 12px 16px; }
    .brand { padding: 0 5px 12px; }
    .side-nav { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; }
    .side-nav a { min-height: 40px; padding: 8px 5px; font-size: 11px; text-align: center; }
    .sidebar-bottom { grid-template-columns: 1fr auto auto; align-items: center; gap: 10px; margin-top: 12px; padding: 10px 5px 0; }
    .main-content { margin-left: 0; padding: 22px 14px; }
    .topbar { margin-bottom: 18px; }
    .stat-grid { gap: 9px; }
    .stat-card { min-height: 96px; padding: 13px; }
    .quick-actions .button { flex: 1 1 auto; }
    .panel { padding: 16px 12px; }
    .report-toolbar { align-items: stretch; flex-direction: column; }
    .period-tabs .button, .export-button { flex: 1 1 auto; }
    .report-date-range { white-space: normal; }
    .custom-date-form { align-items: stretch; flex-direction: column; }
    .custom-date-form label { width: 100%; }
    .form-grid { grid-template-columns: 1fr; }
    .line-item-row { grid-template-columns: minmax(0, 1fr) 72px 72px 98px 28px; gap: 5px; }
    .line-item-row label { font-size: 12px; }
    input, select, textarea { font-size: 16px; }
    .line-item-row input { padding: 8px 9px; font-size: 16px; }
    .remove-line { width: 40px; height: 40px; }
    .quotation-line-items, .invoice-line-items { overflow: visible; }
    .quotation-line-item-row, .invoice-line-item-row {
        min-width: 0;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        align-items: start;
        gap: 12px 10px;
        padding: 12px;
        border: 1px solid var(--line);
        border-radius: 8px;
        background: #fff;
    }
    .quotation-line-item-row .quotation-line-number { grid-column: 1; grid-row: 1; }
    .quotation-line-item-row > .remove-line { grid-column: 2; grid-row: 1; justify-self: end; }
    .quotation-line-item-row > label:nth-of-type(1),
    .quotation-line-item-row > label:nth-of-type(2),
    .invoice-line-item-row > label:nth-of-type(1),
    .invoice-line-item-row > label:nth-of-type(2) { grid-column: 1 / -1; }
    .quotation-line-item-row > label:nth-of-type(3),
    .quotation-line-item-row > label:nth-of-type(4),
    .invoice-line-item-row > label:nth-of-type(3) { grid-column: 1; }
    .quotation-line-item-row > label:nth-of-type(4),
    .invoice-line-item-row > label:nth-of-type(4) { grid-column: 2; }
    .quotation-line-item-row > label:nth-of-type(5) { grid-column: 1 / -1; }
    .invoice-line-item-row > label:nth-of-type(5) { grid-column: 1 / -1; }
    .invoice-line-item-row > label:nth-of-type(1) { grid-row: 2; }
    .invoice-line-item-row > label:nth-of-type(2) { grid-row: 3; }
    .invoice-line-item-row > label:nth-of-type(3),
    .invoice-line-item-row > label:nth-of-type(4) { grid-row: 4; }
    .invoice-line-item-row > label:nth-of-type(5) { grid-row: 5; }
    .invoice-line-item-row > .remove-line { grid-column: 2; grid-row: 1; justify-self: end; }
    .paper { min-height: 1122px; }
    .print-toolbar { align-items: flex-start; }
    .preview-zoom-controls { width: 100%; }
    .preview-zoom-controls .button { min-width: 48px; min-height: 44px; padding: 8px 12px; }
    .print-mode-options { justify-content: flex-start; }
    .paper-mode-legal .stationery-content { padding-right: 36px; padding-left: 36px; }
    .stationery-content { padding: 145px 8% 190px; }
    .preview-picker { align-items: flex-start; flex-direction: column; }
    .preview-actions { justify-content: flex-start; }
    .paper-table th, .paper-table td { padding: 6px 4px; font-size: 9px; }
    .quotation-table th { font-size: 9px; }
    .budget-report-heading h1 { font-size: 19px; }
    .budget-report-table th, .budget-report-table td { padding: 4px 3px; font-size: 8px; }
    .signature-row { gap: 20px; margin-top: 60px; }
}

@media print {
    @page { size: A4 portrait; margin: 0; }
    @page legalPaper { size: legal portrait; margin: 0; }
    body.print-page { min-height: 0; padding: 0; background: #fff; }
    .paper { width: 210mm; min-height: 297mm; margin: 0; overflow: visible; box-shadow: none; -webkit-box-decoration-break: clone; box-decoration-break: clone; }
    .budget-report { width: 210mm; padding: 0; }
    .stationery-art { position: fixed; z-index: 0; inset: 0 auto auto 0; width: 210mm; height: 297mm; max-width: none; }
    .stationery-meta { position: fixed; z-index: 2; top: 30mm; left: 0; width: 210mm; font-size: 9pt; }
    .stationery-content { position: relative; z-index: 1; padding: 43mm 17mm 60mm; -webkit-box-decoration-break: clone; box-decoration-break: clone; }
    .print-toolbar, .print-preview-notice, .preview-picker, .budget-print-notice { display: none !important; }
    .paper { transform: none !important; margin-bottom: 0 !important; }
    body.quotation-translation-missing .quotation-translation-warning { position: fixed; top: 20mm; left: 15mm; display: block !important; width: 180mm; }
    .stationery-art { clip-path: none; }
    body.continuous-document .stationery-art { clip-path: none; }
    .quotation-address, .quotation-subject, .paper-table tr, .paper-table th, .paper-table td, .paper-balance, .receipt-details, .amount-in-words { break-inside: avoid; page-break-inside: avoid; }
    .agreement-section { break-inside: auto; page-break-inside: auto; }
    .agreement-section h2 { break-after: avoid; page-break-after: avoid; }
    .agreement-signatures, .agreement-sign-date { break-inside: avoid; page-break-inside: avoid; }
    .paper-table thead { display: table-header-group; }
    .budget-report-table tbody { page-break-inside: auto; }
    .budget-report-table tr { break-inside: avoid; page-break-inside: avoid; }
    body.paper-mode-plain .stationery-art { display: none; }
    body.paper-mode-legal .paper { page: legalPaper; width: 215.9mm; min-height: 355.6mm; }
    body.paper-mode-legal .stationery-art { display: none; }
    body.paper-mode-legal .stationery-meta { position: fixed; top: 101.6mm; left: 0; display: flex; width: 100%; justify-content: space-between; padding: 0 20mm; font-size: 9pt; }
    body.paper-mode-legal .stationery-meta span { position: static; }
    body.paper-mode-legal .stationery-content { padding: 114.3mm 20mm 24mm; }
    body.paper-mode-legal .document-heading, body.paper-mode-legal .agreement-section h2 { color: #171717; }
    body.paper-mode-legal .quotation-subject, body.paper-mode-legal .paper-party, body.paper-mode-legal .paper-notes { border-color: #777; background: transparent; }
    .preview-sheet[hidden] { display: none !important; }
    .print-page.has-paged-preview > .paper { display: none !important; }
    .print-page.has-paged-preview .document-preview-pages { display: grid !important; gap: 0; padding: 0; }
    .print-page.has-paged-preview .document-preview-sheet {
        width: 210mm;
        height: 297mm;
        min-height: 297mm;
        overflow: hidden;
        margin: 0;
        page-break-after: always;
        break-after: page;
        box-shadow: none;
    }
    .print-page.has-paged-preview .document-preview-sheet:last-child { page-break-after: auto; break-after: auto; }
    .print-page.paper-mode-legal.has-paged-preview .document-preview-sheet {
        page: legalPaper;
        width: 215.9mm;
        height: 355.6mm;
        min-height: 355.6mm;
    }
    .print-page.has-paged-preview .preview-page-number { right: 15mm; bottom: 28mm; font-size: 7pt; }
    body.printing .preview-sheet:not(.active) { display: none !important; }
}
