:root {
  font-family: "Google Sans", "Product Sans", "Inter", "Arial", sans-serif;
  color: #202124;
  background: #f6f7f8;
  font-synthesis: none;
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; min-height: 100vh; }
button, input, select, textarea { font: inherit; }
button { border: 0; cursor: pointer; }

.app-shell { display: grid; grid-template-columns: 248px minmax(0, 1fr); min-height: 100vh; }
.sidebar { background: #fff; border-right: 1px solid #e6e7e9; padding: 18px 14px; position: sticky; top: 0; height: 100vh; overflow-y: auto; z-index: 30; }
.brand { display: flex; justify-content: center; width: 100%; padding: 2px 0 22px; }
.brand-lockup { width: 126px; display: grid; justify-items: center; gap: 2px; }
.brand-lockup img { display: block; width: 126px; height: 58px; object-fit: contain; }
.brand-lockup span { color: #8b8e92; font-size: 9px; font-weight: 500; letter-spacing: 2px; line-height: 1; }
nav { display: grid; gap: 3px; }
nav button { display: flex; align-items: center; gap: 11px; min-height: 42px; padding: 0 12px; border-radius: 7px; background: transparent; color: #555; text-align: left; }
nav button:hover { background: #f7f7f7; color: #111; }
nav button.active { background: #fff4bd; color: #191919; font-weight: 700; }

main { min-width: 0; }
.topbar { height: 76px; display: flex; align-items: center; justify-content: space-between; padding: 0 28px; background: #fff; border-bottom: 1px solid #e6e7e9; position: sticky; top: 0; z-index: 20; }
.topbar h1 { margin: 0; font-size: 20px; letter-spacing: 0; }
.topbar p { margin: 4px 0 0; color: #777; font-size: 12px; }
.topbar-title { min-width: 0; }
.topbar-actions { margin-left: auto; display: flex; align-items: center; justify-content: flex-end; gap: 10px; }
.topbar-action { min-width: 92px; }
.topbar-action i { color: #8a6800; font-size: 13px; }
.page { padding: 24px 28px 40px; max-width: 1540px; margin: 0 auto; }

button, .upload-btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 38px; padding: 0 14px; border-radius: 7px; background: #f3c910; color: #181818; font-weight: 700; transition: .15s ease; }
button:hover, .upload-btn:hover { filter: brightness(.96); transform: translateY(-1px); }
button.ghost { background: #fff; border: 1px solid #dedfe1; font-weight: 600; }
button.danger { background: #fff0f0; color: #a02828; border: 1px solid #f0c8c8; }
button:disabled { opacity: .55; cursor: not-allowed; transform: none; }
.loading-screen { min-height: 100vh; display: grid; place-items: center; color: #5f6368; font-size: 18px; font-weight: 700; }
.auth-page { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: #f6f7f8; }
.auth-card { width: min(420px, 100%); display: grid; gap: 14px; padding: 30px; background: #fff; border: 1px solid #e2e4e7; border-radius: 8px; box-shadow: 0 20px 55px rgba(20,20,20,.08); }
.auth-card img { width: 150px; height: 72px; object-fit: contain; justify-self: center; }
.auth-card > span { justify-self: center; color: #8a8f98; font-size: 13px; letter-spacing: 6px; }
.auth-card h1 { margin: 6px 0 0; font-size: 24px; text-align: center; }
.auth-card p { margin: 0 0 4px; color: #666b70; text-align: center; line-height: 1.5; }
.auth-card label { display: grid; gap: 6px; color: #555a60; font-size: 13px; font-weight: 700; }
.auth-links { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.auth-links button { min-height: 34px; font-size: 12px; }
.auth-message { padding: 10px 12px; border-radius: 7px; background: #fff8d9; color: #6f5300; font-size: 13px; }
.icon-btn { width: 34px; min-height: 34px; padding: 0; background: #f1f2f3; color: #484a4d; border-radius: 6px; }
.actions button { width: auto; min-height: 32px; padding: 0 10px; background: #f1f2f3; color: #35383b; font-size: 12px; white-space: nowrap; }
.actions button.danger { background: #fff0f0; color: #a02828; }
.mobile-only { display: none; }

.stat-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.stat { background: #fff; min-height: 130px; border: 1px solid #e7e8ea; border-radius: 8px; padding: 18px; box-shadow: 0 4px 14px rgba(25, 25, 25, .04); display: flex; flex-direction: column; align-items: flex-start; gap: 11px; }
.stat > svg { color: #a47c00; background: #fff4bd; padding: 8px; width: 38px; height: 38px; border-radius: 7px; }
.stat-card { position: relative; text-align: left; transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease; }
.stat-card:hover { border-color: #d6b324; box-shadow: 0 8px 22px rgba(25,25,25,.09); }
.stat-card > i { width: 40px; height: 40px; display: grid; place-items: center; color: #997300; background: #fff1a8; border-radius: 7px; font-size: 17px; }
.stat-card small { margin-top: auto; color: #8a6800; font-size: 10px; font-weight: 700; text-transform: uppercase; }
.stat span { color: #74777b; font-size: 13px; }
.stat strong { font-size: 22px; letter-spacing: 0; }
.quickbar { display: flex; flex-wrap: wrap; gap: 9px; margin: 18px 0; }
.revenue-chart { display: grid; grid-template-columns: minmax(0, 1fr) 220px; align-items: center; gap: 32px; margin-bottom: 16px; padding: 24px 30px; background: #fff; border: 1px solid #e3e5e7; border-radius: 8px; }
.chart-copy .eyebrow { color: #8a6800; font-size: 11px; font-weight: 800; text-transform: uppercase; }
.chart-copy h2 { margin: 6px 0 7px; font-size: 22px; }
.chart-copy > p { max-width: 570px; margin: 0; color: #6c7074; font-size: 13px; line-height: 1.6; }
.chart-legend { display: flex; flex-wrap: wrap; gap: 24px; margin-top: 22px; }
.chart-legend > div { display: flex; align-items: center; gap: 9px; }
.chart-legend i { width: 10px; height: 34px; border-radius: 3px; }
.legend-paid { background: #efb900; }
.legend-pending { background: #30363b; }
.chart-legend span { display: grid; gap: 3px; color: #777b7f; font-size: 11px; }
.chart-legend strong { color: #222629; font-size: 15px; }
.donut-wrap { position: relative; width: 190px; height: 190px; justify-self: center; }
.donut-chart { width: 100%; height: 100%; }
.donut-chart circle { fill: none; stroke-width: 5; }
.donut-base { stroke: #30363b; }
.donut-paid { stroke: #efb900; stroke-linecap: round; transition: stroke-dasharray .35s ease; }
.donut-label { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; }
.donut-label strong { font-size: 29px; line-height: 1; }
.donut-label span { margin-top: 5px; color: #73777b; font-size: 11px; text-transform: uppercase; }
.two-col { display: grid; grid-template-columns: 1.25fr 1fr; gap: 16px; margin-top: 18px; }
.panel { background: #fff; border: 1px solid #e5e7e9; border-radius: 8px; padding: 20px; box-shadow: 0 4px 16px rgba(25,25,25,.035); }
.panel > h2 { margin: 0 0 17px; font-size: 16px; letter-spacing: 0; }
.activity-list, .mini-list { display: grid; }
.activity-list > div, .mini-list > div { display: flex; justify-content: space-between; gap: 18px; padding: 12px 0; border-bottom: 1px solid #eceef0; }
.activity-list span { color: #85888b; font-size: 12px; min-width: 140px; }
.activity-list strong, .mini-list strong { font-size: 13px; }
.dashboard-activity { margin-top: 16px; }
.client-income-head { display: flex; justify-content: flex-end; gap: 16px; margin: -4px 0 14px; }
.client-income-head span { display: flex; align-items: center; gap: 6px; color: #74787c; font-size: 10px; }
.client-income-head i { width: 9px; height: 9px; border-radius: 2px; }
.income-received { background: #efbf00; }
.income-outstanding { background: #363b40; }
.client-income-chart { display: grid; gap: 14px; }
.client-income-row { display: grid; grid-template-columns: minmax(120px, 1fr) auto; gap: 7px 16px; }
.client-income-label, .client-income-value { display: grid; gap: 3px; }
.client-income-label span { display: flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 700; }
.client-income-label b { width: 20px; height: 20px; display: grid; place-items: center; background: #fff3b5; color: #876600; border-radius: 4px; font-size: 9px; }
.client-income-label small, .client-income-value small { color: #85898d; font-size: 9px; }
.client-income-value { text-align: right; }
.client-income-value strong { font-size: 12px; }
.client-income-track { grid-column: 1 / -1; height: 9px; overflow: hidden; background: #eceef0; border-radius: 3px; }
.client-income-bar { display: flex; height: 100%; min-width: 4%; overflow: hidden; border-radius: 3px; }
.income-paid-part { background: #efbf00; }
.income-due-part { background: #363b40; }
.empty { padding: 36px 18px; text-align: center; color: #85888b; font-size: 13px; }
.dashboard-preview { display: grid; gap: 18px; }
.preview-summary { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.preview-summary > span { min-height: 86px; padding: 15px; display: grid; align-content: center; gap: 7px; background: #f7f8f8; border-left: 4px solid #efbf00; color: #707478; font-size: 12px; }
.preview-summary strong { color: #202124; font-size: 20px; }
.preview-rows { display: grid; border-top: 1px solid #e5e7e9; }
.preview-rows > div { min-height: 58px; padding: 11px 4px; display: flex; align-items: center; justify-content: space-between; gap: 20px; border-bottom: 1px solid #e5e7e9; }
.preview-rows span { display: grid; gap: 4px; font-size: 13px; font-weight: 700; }
.preview-rows small { color: #777b7f; font-size: 11px; font-weight: 500; }
.preview-rows > div > strong { font-size: 13px; white-space: nowrap; }
.custom-report { display: grid; gap: 18px; }
.report-modes { display: inline-flex; width: max-content; padding: 4px; gap: 4px; background: #f0f1f2; border-radius: 7px; }
.report-modes button { min-height: 34px; background: transparent; color: #62666a; font-size: 12px; }
.report-modes button.active { background: #fff; color: #202124; box-shadow: 0 1px 5px rgba(0,0,0,.1); }
.report-period { display: grid; grid-template-columns: repeat(2, minmax(0, 240px)); gap: 12px; }
.report-heading { display: flex; justify-content: space-between; gap: 20px; padding: 12px 0; border-top: 1px solid #e3e5e7; border-bottom: 1px solid #e3e5e7; }
.report-heading span { color: #74787c; font-size: 12px; }
.report-heading strong { font-size: 13px; }
.report-metrics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.report-metrics > span { min-height: 82px; padding: 14px; display: grid; align-content: center; gap: 7px; background: #f7f8f8; color: #707478; font-size: 11px; }
.report-metrics strong { color: #202124; font-size: 18px; }
.report-metrics strong.negative { color: #a02828; }
.modern-date-field { position: relative; }
.compact-date { width: 180px; flex: 0 0 auto; }
.date-trigger { width: 100%; min-height: 46px; padding: 0 14px; justify-content: space-between; background: #fff; border: 1px solid #d9dbde; color: #202124; font-weight: 600; }
.date-trigger:hover { transform: none; border-color: #bd9600; }
.date-trigger i { color: #9a7500; }
.modern-calendar { position: absolute; top: calc(100% + 8px); left: 0; z-index: 250; width: min(320px, calc(100vw - 54px)); padding: 16px; background: #fff; border: 1px solid #e0e2e4; border-radius: 8px; box-shadow: 0 20px 50px rgba(25,27,29,.18); }
.calendar-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.calendar-head > div:first-child { display: flex; align-items: baseline; gap: 7px; }
.calendar-head strong { font-size: 17px; }
.calendar-head span { color: #777b7f; font-size: 12px; }
.calendar-head > div:last-child { display: flex; gap: 5px; }
.calendar-head button { width: 34px; min-height: 34px; padding: 0; background: #f2f3f4; color: #3f4347; }
.calendar-weekdays, .calendar-days { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.calendar-weekdays { margin-bottom: 7px; }
.calendar-weekdays span { text-align: center; color: #92969a; font-size: 10px; font-weight: 800; text-transform: uppercase; }
.calendar-days button { aspect-ratio: 1; min-height: 0; padding: 0; background: transparent; color: #34383c; border: 1px solid transparent; border-radius: 6px; font-size: 12px; font-weight: 600; }
.calendar-days button:hover { transform: none; background: #fff4bd; }
.calendar-days button.muted { color: #b7b9bc; }
.calendar-days button.today { border-color: #e4b700; color: #7f6100; }
.calendar-days button.selected { background: #efbf00; border-color: #efbf00; color: #171717; box-shadow: 0 4px 10px rgba(211,165,0,.25); }
.calendar-foot { display: flex; justify-content: space-between; margin-top: 12px; padding-top: 12px; border-top: 1px solid #eceef0; }
.calendar-foot button { min-height: 30px; padding: 0 8px; background: transparent; color: #8a6800; font-size: 11px; }
.month-calendar { width: 300px; }
.month-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; }
.month-grid button { min-height: 42px; padding: 0; background: #f6f7f8; color: #44484c; font-size: 12px; }
.month-grid button:hover { transform: none; background: #fff4bd; }
.month-grid button.selected { background: #efbf00; color: #171717; box-shadow: 0 4px 10px rgba(211,165,0,.22); }

.toolbar { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; }
.toolbar > button { margin-left: auto; }
.search { height: 40px; min-width: 280px; display: flex; align-items: center; gap: 8px; padding: 0 12px; background: #fff; border: 1px solid #dfe1e3; border-radius: 7px; }
.search input { border: 0; outline: 0; width: 100%; }
input, select, textarea { border: 1px solid #d9dbde; border-radius: 6px; background: #fff; color: #222; outline: 0; }
input, select { min-height: 40px; padding: 0 10px; }
textarea { min-height: 88px; padding: 10px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: #bd9600; box-shadow: 0 0 0 3px #fff5c8; }
input[readonly] { background: #f3f4f5; color: #666a6e; cursor: not-allowed; }

.table-wrap { overflow-x: auto; background: #fff; border: 1px solid #e4e6e8; border-radius: 8px; }
table { width: 100%; border-collapse: collapse; white-space: nowrap; }
th, td { text-align: left; padding: 13px 14px; border-bottom: 1px solid #eceef0; font-size: 13px; }
th { color: #686b70; background: #fafafa; font-size: 12px; text-transform: uppercase; font-weight: 700; }
tbody tr:hover { background: #fffdf3; }
.actions { display: flex; align-items: center; gap: 5px; }
.badge { display: inline-flex; align-items: center; min-height: 25px; padding: 0 8px; border-radius: 5px; font-size: 11px; font-weight: 700; background: #eff1f2; color: #4a4d50; }
.badge.paid, .badge.completed, .badge.approved { background: #e4f5e9; color: #24713a; }
.badge.overdue, .badge.rejected, .badge.cancelled { background: #ffe9e9; color: #a43737; }
.badge.sent, .badge.partially-paid, .badge.client-review { background: #fff2c4; color: #765a00; }

.modal-backdrop { position: fixed; inset: 0; background: rgba(17, 18, 19, .5); z-index: 100; padding: 24px; display: grid; place-items: center; }
.modal { width: min(600px, 100%); max-height: calc(100vh - 48px); overflow-y: auto; background: #fff; border-radius: 8px; padding: 20px; box-shadow: 0 24px 70px rgba(0,0,0,.22); }
.modal.wide { width: min(1100px, 100%); }
.modal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.modal-head h2 { margin: 0; font-size: 19px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 20px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.form-grid.single { grid-template-columns: 1fr; }
.field { display: grid; gap: 6px; color: #5d6064; font-size: 12px; font-weight: 700; }
.detail-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 16px; }
.info, .wide-field { padding: 14px; background: #f7f8f9; border-radius: 6px; }
.info span { display: block; color: #777; font-size: 11px; margin-bottom: 6px; }
.info strong { font-size: 13px; }
.wide-field { grid-column: 1 / -1; }
.wide-field > strong { font-size: 13px; }
.wide-field p { margin: 8px 0 0; color: #676a6d; font-size: 13px; }

.line-editor { margin: 18px 0; border: 1px solid #e1e3e5; border-radius: 7px; overflow: hidden; }
.line-head { display: flex; justify-content: space-between; align-items: center; padding: 12px; background: #fafafa; }
.line-head > div { display: grid; gap: 3px; }
.line-head small, .field-help { color: #73767a; font-size: 11px; font-weight: 500; }
.line-row { display: grid; grid-template-columns: 1.2fr 1.8fr 78px 105px 112px 82px 110px 74px; gap: 8px; align-items: end; padding: 12px 10px; border-top: 1px solid #eceef0; }
.line-field { display: grid; gap: 5px; min-width: 0; }
.line-field > span, .line-total > span { color: #62656a; font-size: 10px; font-weight: 700; text-transform: uppercase; }
.line-row input, .line-row select { min-width: 0; width: 100%; }
.line-total { display: grid; gap: 9px; padding-bottom: 11px; text-align: right; }
.line-total strong { font-size: 12px; }
.line-remove { margin-bottom: 1px; }
.totals { display: grid; justify-content: end; gap: 7px; border-top: 1px solid #e3e4e6; padding-top: 14px; }
.totals span { display: flex; justify-content: space-between; gap: 50px; font-size: 13px; }
.totals span:last-child { font-size: 16px; }
.summary-strip { display: flex; gap: 12px; margin-bottom: 16px; }
.summary-strip strong { padding: 10px 13px; background: #fff; border: 1px solid #e0e2e4; border-radius: 6px; font-size: 13px; }

.task-add { display: flex; gap: 8px; }
.task-add input { flex: 1; }
.task-list { display: grid; gap: 7px; margin-top: 12px; }
.task-list label { display: flex; align-items: center; gap: 9px; padding: 9px; background: #f7f8f9; border-radius: 6px; }
.task-list label input { min-height: auto; }
.task-list label span { flex: 1; font-size: 13px; }
.task-list label button { width: 27px; min-height: 27px; padding: 0; background: transparent; }
.calculator-results { margin-top: 20px; }
.calculator-actions { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-top: 18px; padding: 16px 18px; background: #fff8d9; border: 1px solid #efd36a; border-radius: 8px; }
.calculator-actions strong { display: block; margin-bottom: 4px; font-size: 15px; }
.calculator-actions p { margin: 0; color: #62666a; font-size: 13px; line-height: 1.5; }
.calculator-actions button { min-width: 230px; }
.calculator-actions button:disabled { opacity: .45; cursor: not-allowed; transform: none; filter: none; }
.export-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.export-grid button, .export-grid .upload-btn { min-height: 58px; background: #fff; border: 1px solid #dfe1e3; justify-content: flex-start; }
.upload-btn input, .logo-uploader input { display: none; }
.settings-layout { display: grid; grid-template-columns: 190px 1fr; gap: 24px; }
.logo-uploader { display: flex; flex-direction: column; gap: 10px; }
.logo-uploader > div, .logo-uploader img { width: 170px; height: 130px; object-fit: contain; border: 1px dashed #cfd1d3; display: grid; place-items: center; border-radius: 7px; color: #888; }
.logo-uploader label { width: 170px; display: flex; align-items: center; justify-content: center; gap: 6px; min-height: 38px; border: 1px solid #dfe1e3; border-radius: 6px; font-size: 12px; font-weight: 700; cursor: pointer; }

.print-sheet { max-width: 1040px; margin: 0 auto; padding: 24px 18px 12px; }
.print-head { display: grid; grid-template-columns: 1fr 1fr; align-items: center; gap: 60px; padding: 8px 8px 28px; }
.invoice-divider { position: relative; z-index: 5; clear: both; width: 100%; height: 0; margin: 8px 0 38px; border-top: 2px solid #efbf00; }
.print-meta { display: flex; justify-content: space-between; gap: 40px; margin: 0 8px 38px; }
.print-meta > div:last-child { min-width: 210px; text-align: right; }
.print-head h2 { margin: 0 0 12px; font-size: 27px; }
.print-meta p { margin: 4px 0; font-size: 12px; color: #5f6266; }
.logo-box { width: 210px; height: 125px; display: grid; place-items: center; justify-self: start; }
.logo-box img { width: 100%; height: 100%; object-fit: contain; }
.company-details { width: min(100%, 360px); min-width: 0; justify-self: end; }
.company-address { display: grid; gap: 3px; max-width: 650px; margin: 0; color: #5f6266; font-size: 13px; line-height: 1.45; }
.company-contact { display: grid; gap: 9px; margin-top: 15px; }
.company-contact span { display: grid; grid-template-columns: 16px 48px minmax(0, 1fr); align-items: center; gap: 7px; color: #3f4245; font-size: 12px; }
.company-contact i { color: #a27b00; font-size: 10px; text-align: center; }
.company-contact b { color: #8a6800; font-size: 9px; letter-spacing: .7px; text-transform: uppercase; }
.company-contact em { min-width: 0; overflow-wrap: anywhere; color: #3f4245; font-style: normal; }
.print-table { white-space: normal; margin: 0 8px; width: calc(100% - 16px); }
.print-table small { display: block; margin-top: 4px; color: #777; }
.print-total { text-align: right; margin: 20px 8px 18px; }
.print-total p { margin: 5px 0; }
.signature { min-width: 190px; border-top: 1px solid #222; align-self: flex-end; padding-top: 8px; text-align: center; font-size: 12px; }
.toast { position: fixed; right: 24px; bottom: 24px; z-index: 200; display: flex; align-items: center; gap: 8px; background: #1f2225; color: #fff; padding: 12px 16px; border-radius: 7px; box-shadow: 0 14px 30px rgba(0,0,0,.22); font-size: 13px; }
.scrim { display: none; }

@media (max-width: 1100px) {
  .stat-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .line-row { grid-template-columns: 1fr 1.5fr 60px 85px; }
  .line-row > :nth-child(5), .line-row > :nth-child(6), .line-row > :nth-child(7), .line-row > :nth-child(8) { display: block; }
  .export-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 800px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { position: fixed; left: 0; top: 0; transform: translateX(-105%); transition: transform .2s; width: 250px; }
  .sidebar.open { transform: translateX(0); }
  .scrim { display: block; position: fixed; inset: 0; z-index: 25; background: rgba(0,0,0,.35); border-radius: 0; padding: 0; }
  .mobile-only { display: inline-flex; }
  .topbar { padding: 0 16px; justify-content: flex-start; gap: 12px; }
  .topbar-title { flex: 1; }
  .topbar-actions { margin-left: auto; gap: 7px; }
  .topbar-action { min-width: auto; padding: 0 10px; font-size: 12px; }
  .page { padding: 18px 16px 34px; }
  .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .two-col, .settings-layout { grid-template-columns: 1fr; }
  .client-income-row { grid-template-columns: minmax(0, 1fr) auto; }
  .toolbar { flex-wrap: wrap; }
  .search { min-width: 100%; }
  .compact-date { width: 100%; }
  .toolbar > button { margin-left: 0; }
  .line-row { grid-template-columns: 1fr 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .revenue-chart { grid-template-columns: 1fr; padding: 22px; }
  .donut-wrap { width: 170px; height: 170px; }
  .preview-summary { grid-template-columns: 1fr; }
  .report-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .report-period { grid-template-columns: 1fr; }
  .calculator-actions { align-items: flex-start; flex-direction: column; }
  .calculator-actions button { width: 100%; }
  .print-head { grid-template-columns: 1fr; gap: 18px; }
  .logo-box { width: 160px; height: 100px; }
}

@media (max-width: 520px) {
  .topbar { height: 70px; gap: 8px; padding: 0 10px; }
  .topbar h1 { font-size: 16px; }
  .topbar p { font-size: 11px; }
  .topbar-actions { gap: 5px; }
  .topbar-action { min-height: 34px; padding: 0 8px; gap: 5px; border-radius: 6px; }
  .topbar-action span { font-size: 11px; }
  .page { padding: 12px 10px 28px; }
  .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
  .stat { min-height: 116px; padding: 12px; gap: 7px; }
  .stat-card > i { width: 34px; height: 34px; font-size: 14px; border-radius: 6px; }
  .stat span { font-size: 11px; line-height: 1.25; }
  .stat strong { font-size: 18px; line-height: 1.15; }
  .stat-card small { font-size: 9px; }
  .quickbar { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin: 12px 0; }
  .quickbar button { width: 100%; min-height: 38px; padding: 0 8px; font-size: 12px; }
  .quickbar button:last-child:nth-child(odd) { grid-column: 1 / -1; }
  .export-grid { grid-template-columns: 1fr; }
  .summary-strip { flex-direction: column; }
  .report-modes { width: 100%; }
  .report-modes button { flex: 1; padding: 0 8px; }
  .report-metrics { grid-template-columns: 1fr; }
  .modal-backdrop { padding: 8px; }
  .modal { max-height: calc(100vh - 16px); padding: 15px; }
  .print-head, .print-meta { flex-direction: column; }
}

@media print {
  .sidebar, .topbar, .toolbar, .modal-head, .modal-actions { display: none !important; }
}
