@import url('https://fonts.googleapis.com/css2?family=DM+Mono:wght@400;500&family=DM+Sans:wght@400;500;600;700&family=Manrope:wght@500;600;700;800&display=swap');

:root {
  color-scheme: light;
  --ink: #111827;
  --muted: #6b778b;
  --line: #e0e7f0;
  --paper: #ffffff;
  --canvas: #f2f5fa;
  --green: #dce8ff;
  --green-dark: #1748a0;
  --coral: #d95f63;
  --yellow: #c9dcff;
  --blue: #2864e8;
  --blue-deep: #0d1728;
  --blue-soft: #edf3ff;
  --serif: 'Manrope', sans-serif;
  --sans: 'DM Sans', sans-serif;
  --mono: 'DM Mono', monospace;
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--canvas); color: var(--ink); font-family: var(--sans); font-size: 14px; -webkit-font-smoothing: antialiased; }
button, input, select { font: inherit; }
button { color: inherit; }
.app-shell { min-height: 100vh; }
.sidebar { position: fixed; inset: 0 auto 0 0; z-index: 5; display: flex; width: 242px; flex-direction: column; padding: 29px 19px 22px; border-right: 1px solid #e3e5dd; background: #f8f9f5; }
.brand { display: flex; align-items: center; gap: 11px; margin: 0 0 55px 6px; color: inherit; text-decoration: none; }
.brand-mark { display: grid; width: 38px; height: 38px; place-items: center; border-radius: 11px; background: var(--green); }
.brand-mark img { width: 26px; height: 26px; }
.brand strong { display: block; font: 800 23px/1 var(--serif); letter-spacing: 0; }
.brand small { display: block; margin-top: 5px; color: #8a8e83; font: 9px/1 var(--mono); letter-spacing: 0; }
.side-caption, .eyebrow { color: #858b80; font: 500 10px/1.3 var(--mono); letter-spacing: 0; }
.side-caption { padding-left: 10px; }
.main-nav { display: grid; gap: 5px; margin-top: 13px; }
.nav-link { display: flex; min-height: 43px; align-items: center; gap: 12px; padding: 0 11px; border: 0; border-radius: 5px; background: transparent; color: #6f756d; cursor: pointer; text-align: left; transition: background .18s, color .18s; }
.nav-link:hover { background: #eef0e8; color: var(--ink); }
.nav-link.is-active { background: var(--green); color: #29352a; font-weight: 700; }
.nav-icon { display: grid; width: 19px; place-items: center; font-size: 19px; line-height: 1; }
.sidebar-bottom { margin-top: auto; padding: 16px 10px 0; border-top: 1px solid var(--line); }
.period-label { display: flex; align-items: center; gap: 8px; margin-top: 15px; font-weight: 600; text-transform: capitalize; }
.live-dot { display: inline-block; width: 7px; height: 7px; flex: 0 0 auto; border-radius: 50%; background: #62a466; box-shadow: 0 0 0 3px #e1f0df; }
.sidebar-note { margin-top: 10px; color: var(--muted); font-size: 12px; line-height: 1.55; }
.main-content { min-height: 100vh; margin-left: 242px; padding: 0 43px 48px; }
.topbar { display: flex; height: 69px; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); }
.breadcrumb { display: flex; align-items: center; gap: 10px; color: #858a80; font-size: 12px; }
.breadcrumb strong { color: #30352f; font-weight: 600; }
.crumb-divider { color: #c4c8be; }
.topbar-right { display: flex; align-items: center; gap: 17px; }
.today-label { color: #6e746a; font: 11px var(--mono); }
.refresh-button { display: grid; width: 30px; height: 30px; place-items: center; border: 1px solid #d7e0ec; border-radius: 50%; background: #fff; color: #2457bd; cursor: pointer; font-size: 18px; line-height: 1; transition: background .18s, transform .18s; }
.refresh-button:hover { background: #edf3ff; transform: rotate(18deg); }
.refresh-button:disabled { cursor: wait; opacity: .65; }
.refresh-button.is-spinning { animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.avatar { display: grid; width: 32px; height: 32px; place-items: center; border: 1px solid #dce1d5; border-radius: 50%; background: #eaf1d2; color: #3a5937; font: 500 10px var(--mono); }
.view { display: none; padding-top: 36px; animation: reveal .35s ease both; }
.view.is-visible { display: block; }
@keyframes reveal { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: translateY(0); } }
.page-heading { display: flex; min-height: 106px; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 22px; }
.page-heading h1 { margin: 8px 0 5px; font: 700 27px/1.2 var(--serif); letter-spacing: 0; }
.page-heading p { margin: 0; color: var(--muted); font-size: 13px; }
.button { display: inline-flex; min-height: 40px; align-items: center; justify-content: center; gap: 9px; padding: 0 15px; border: 1px solid transparent; border-radius: 4px; cursor: pointer; font-size: 12px; font-weight: 700; transition: transform .15s, background .15s, opacity .15s; }
.button:hover { transform: translateY(-1px); }
.button:disabled { cursor: wait; opacity: .62; }
.button-dark { background: #252d25; color: white; }
.button-dark:hover { background: #394739; }
.button-outline { border-color: #d9ddd3; background: white; color: #333a32; }
.button-outline:hover { background: #f7f8f4; }
.button-yellow { background: var(--yellow); color: #302c1c; }
.button-yellow:hover { background: #e7c151; }
.button-small { min-height: 34px; padding: 0 11px; }
.button-wide { width: 100%; margin-top: 3px; }
.metric-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 13px; margin-bottom: 18px; }
.metric { min-height: 145px; padding: 19px 20px 15px; border: 1px solid var(--line); border-radius: 5px; background: var(--paper); }
.metric-green { border-color: #d9ed76; background: var(--green); }
.metric-top { display: flex; align-items: center; justify-content: space-between; color: #4d5548; font-size: 12px; font-weight: 600; }
.metric-icon { display: grid; width: 26px; height: 26px; place-items: center; border-radius: 50%; background: #c6df58; color: #35462b; font-size: 15px; }
.icon-coral { background: #f8e3dd; color: #c75f49; }
.icon-yellow { background: #f8edc9; color: #94752a; }
.metric > strong { display: block; overflow: hidden; margin-top: 14px; font: 700 25px/1.1 var(--serif); letter-spacing: 0; text-overflow: ellipsis; white-space: nowrap; }
.metric-foot { display: flex; align-items: center; gap: 8px; margin-top: 11px; color: #747a70; font-size: 11px; }
.metric-green .metric-foot { color: #485c3c; }
.metric-dot { width: 6px; height: 6px; border-radius: 50%; background: #476e3d; }
.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.8fr) minmax(225px, .82fr); gap: 14px; align-items: stretch; }
.panel { border: 1px solid var(--line); border-radius: 5px; background: var(--paper); }
.due-panel { min-width: 0; padding: 21px 21px 8px; }
.panel-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.panel-heading h2, .note-panel h2 { margin: 7px 0 0; font: 700 17px/1.25 var(--serif); letter-spacing: 0; }
.text-button { padding: 5px 0; border: 0; background: none; color: #485a3d; cursor: pointer; font-size: 11px; font-weight: 700; white-space: nowrap; }
.text-button span { margin-left: 4px; }
.table-wrap { width: 100%; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; text-align: left; }
.due-panel table { min-width: 520px; margin-top: 20px; }
thead { color: #858b80; }
th { padding: 11px 8px; border-bottom: 1px solid var(--line); font: 500 9px var(--mono); letter-spacing: 0; white-space: nowrap; }
td { padding: 12px 8px; border-bottom: 1px solid #eff0ec; color: #555c52; font-size: 11px; }
tbody tr:last-child td { border-bottom: 0; }
td strong { display: block; color: #30362e; font-size: 11px; font-weight: 600; }
td small { display: block; margin-top: 4px; color: #969b91; font: 10px var(--mono); }
.status-pill { display: inline-flex; align-items: center; gap: 6px; padding: 5px 7px; border-radius: 3px; font-size: 10px; font-weight: 600; white-space: nowrap; }
.status-pill i { width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.status-active { background: #edf4e6; color: #527442; }
.status-late { background: #fbe8e3; color: #b75a46; }
.empty-cell { height: 88px; color: #858a80; text-align: center; }
.note-panel { position: relative; overflow: hidden; min-height: 244px; padding: 22px 21px; border-radius: 5px; background: #e9e4d2; }
.note-panel::after { position: absolute; right: -29px; bottom: -66px; width: 160px; height: 160px; border: 1px solid #d3cdb6; border-radius: 50%; content: ''; }
.note-mark { display: grid; width: 31px; height: 31px; margin-bottom: 23px; place-items: center; border-radius: 50%; background: #f5f2e7; color: #717050; font-size: 18px; }
.note-panel .eyebrow { color: #81806b; }
.note-panel h2 { max-width: 210px; margin-top: 8px; font-size: 18px; }
.note-panel p { max-width: 235px; margin: 10px 0 13px; color: #67685a; font-size: 11px; line-height: 1.6; }
.note-link { position: relative; z-index: 1; }
.transaction-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 14px; align-items: start; }
.form-panel { padding: 19px 19px 20px; }
.form-panel .panel-heading { margin-bottom: 19px; }
.step-mark { display: grid; width: 32px; height: 32px; place-items: center; border-radius: 50%; background: #eaf1d2; color: #53653c; font: 11px var(--mono); }
.step-coral { background: #f8e5df; color: #b65f4d; }
.step-yellow { background: #f8edcc; color: #967b32; }
.form-stack { display: grid; gap: 9px; }
.field-label { display: block; margin: 2px 0 -3px; color: #555c52; font-size: 11px; font-weight: 600; }
.field-hint { margin-top: -5px; color: #858b80; font-size: 10px; line-height: 1.45; }
.payment-summary { padding: 9px 10px; border: 1px solid #dfe7f2; border-radius: 3px; background: #f7f9fd; color: #4b5870; font-size: 10px; line-height: 1.5; }
.payment-summary[hidden] { display: none; }
.payment-quick-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: -4px; }
.payment-quick-button { min-height: 32px; padding: 0 8px; border: 1px solid #cfdaea; border-radius: 3px; background: #fff; color: #2457bd; cursor: pointer; font-size: 10px; font-weight: 600; }
.payment-quick-button:hover:not(:disabled) { background: #edf3ff; }
.payment-quick-button:disabled { cursor: not-allowed; opacity: .55; }
.detail-panel { display: grid; gap: 0; overflow: hidden; }
.detail-section { display: grid; gap: 12px; padding: 20px 22px; }
.detail-section + .detail-section { border-top: 1px solid var(--line); }
.detail-section > .table-wrap table { min-width: 620px; }
.detail-section > .table-wrap th, .detail-section > .table-wrap td { padding-right: 12px; padding-left: 12px; }
.report-filters { display: grid; grid-template-columns: minmax(150px, 1fr) minmax(150px, 1fr) auto; gap: 10px; align-items: end; }
.report-metrics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.report-metric { display: grid; min-width: 0; gap: 8px; padding: 14px; border: 1px solid var(--line); border-radius: 4px; background: #fbfcfe; }
.report-metric span { color: var(--muted); font-size: 11px; }
.report-metric strong { overflow: hidden; font: 700 17px var(--serif); text-overflow: ellipsis; white-space: nowrap; }
.detail-status { white-space: nowrap; }
.required { color: #cb6652; }
input, select { width: 100%; min-width: 0; height: 39px; padding: 0 10px; border: 1px solid #dfe2d9; border-radius: 3px; outline: none; background: #fff; color: #30362e; font-size: 12px; }
input:focus, select:focus { border-color: #87975c; box-shadow: 0 0 0 2px #e8efcf; }
input::placeholder { color: #9da197; }
input[type="date"] { color: #41473e; }
.inline-field { display: flex; gap: 7px; }
.square-button { width: 39px; height: 39px; flex: 0 0 auto; border: 1px solid #dfe2d9; border-radius: 3px; background: #f7f8f4; color: #526542; cursor: pointer; font-size: 19px; }
.square-button:hover { background: #edf2df; }
.field-pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
.field-pair > div { display: grid; gap: 8px; }
.customer-create { display: grid; gap: 8px; padding: 12px; border: 1px solid #e6e8e0; border-radius: 3px; background: #f8f9f5; }
.customer-create[hidden] { display: none; }
.equipment-label { margin: 3px 0 0; }
.equipment-list { display: grid; max-height: 228px; gap: 6px; overflow-y: auto; padding-right: 2px; }
.equipment-option { position: relative; display: flex; min-height: 53px; align-items: center; gap: 9px; padding: 8px 9px; border: 1px solid #e5e8df; border-radius: 3px; cursor: pointer; transition: border-color .15s, background .15s; }
.equipment-option:has(input:checked) { border-color: #a7b77d; background: #f5f8e9; }
.equipment-option input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.check-box { display: grid; width: 17px; height: 17px; flex: 0 0 auto; place-items: center; border: 1px solid #cfd4c8; border-radius: 3px; color: transparent; font-size: 11px; }
.equipment-option input:checked + .check-box { border-color: #657d49; background: #657d49; color: white; }
.equipment-name { flex: 1; color: #333a31; font-size: 11px; font-weight: 600; }
.equipment-option strong { color: #363e31; font: 500 10px var(--mono); white-space: nowrap; }
.equipment-name small, .equipment-option strong small { display: block; margin-top: 4px; color: #8a9084; font: 10px var(--sans); }
.equipment-option strong small { display: inline; margin-left: 2px; }
.quiet-message { padding: 17px 10px; border: 1px dashed #dfe2d9; color: #898f85; font-size: 11px; text-align: center; }
.estimate-row { display: flex; align-items: center; justify-content: space-between; padding: 11px 0 3px; border-top: 1px solid #eceee8; color: #62695f; font-size: 11px; }
.estimate-row strong { color: #29352a; font: 700 13px var(--mono); }
.right-forms { display: grid; gap: 14px; }
.fine-preview { align-content: end; min-height: 58px; padding: 7px 9px; border: 1px solid #f0e2dd; border-radius: 3px; background: #fdf7f5; }
.fine-preview span { color: #8b7771; font-size: 10px; }
.fine-preview strong { color: #b65b48; font: 600 13px var(--mono); }
.inline-notice { padding: 9px 10px; border-left: 2px solid #d7a092; background: #fbf5f2; color: #81746e; font-size: 10px; line-height: 1.45; }
.payment-panel { border-top: 2px solid var(--yellow); }
.journal-panel { overflow: hidden; }
.journal-summary { display: grid; grid-template-columns: 1fr 1fr 1fr; padding: 18px 21px; border-bottom: 1px solid var(--line); background: #fbfcf9; }
.journal-summary > div { display: grid; gap: 7px; }
.journal-summary > div + div { padding-left: 21px; border-left: 1px solid var(--line); }
.summary-label { color: #898f84; font: 10px var(--mono); }
.journal-summary strong { font: 700 17px var(--serif); }
.journal-count strong { font: 700 17px var(--mono); }
.journal-table { min-width: 720px; }
.journal-table th { padding: 13px 15px; }
.journal-table td { padding: 12px 15px; }
.amount-cell { text-align: right; white-space: nowrap; }
.journal-date { width: 115px; white-space: nowrap; }
.account-code { display: block; width: max-content; margin-bottom: 4px; padding: 3px 5px; border-radius: 2px; background: #f0f2eb; color: #747a6e; font: 10px var(--mono); }
.account-name { font-size: 11px; }
.journal-description { min-width: 230px; color: #70766c; }
.muted-dash { color: #b7bcb3; }
.journal-foot { display: flex; justify-content: space-between; padding: 13px 16px; border-top: 1px solid var(--line); color: #858b80; font-size: 10px; }
.journal-foot .live-dot { width: 6px; height: 6px; margin-right: 6px; }
.toast { position: fixed; right: 25px; bottom: 22px; z-index: 9; max-width: min(420px, calc(100vw - 32px)); padding: 12px 16px; border: 1px solid #cadbb1; border-radius: 4px; background: #29372b; box-shadow: 0 7px 26px #2224; color: #fff; font-size: 12px; line-height: 1.5; opacity: 0; pointer-events: none; transform: translateY(8px); transition: opacity .2s, transform .2s; }
.toast.is-visible { opacity: 1; transform: translateY(0); }
.toast.is-error { border-color: #e9b4a9; background: #8d4036; }

@media (max-width: 1080px) {
  .main-content { padding-right: 26px; padding-left: 26px; }
  .dashboard-grid { grid-template-columns: minmax(0, 1.5fr) minmax(205px, .85fr); }
  .metric { padding-right: 15px; padding-left: 15px; }
  .metric > strong { font-size: 22px; }
}
@media (max-width: 820px) {
  .sidebar { width: 72px; align-items: center; padding: 20px 9px 14px; }
  .brand { margin: 0 0 40px; }
  .brand > span:last-child, .side-caption, .nav-link:not(.is-active), .sidebar-bottom, .nav-link { font-size: 0; }
  .brand > span:last-child { display: none; }
  .main-nav { width: 100%; }
  .nav-link { justify-content: center; padding: 0; }
  .nav-link.is-active { font-size: 0; }
  .nav-icon { font-size: 20px; }
  .main-content { margin-left: 72px; padding-right: 20px; padding-left: 20px; }
  .dashboard-grid { grid-template-columns: 1fr; }
  .note-panel { min-height: 210px; }
  .transaction-grid { grid-template-columns: 1fr; }
  .detail-section { padding: 17px 14px; }
}
@media (max-width: 560px) {
  .sidebar { width: 57px; padding-right: 6px; padding-left: 6px; }
  .brand-mark { width: 35px; height: 35px; }
  .main-content { margin-left: 57px; padding: 0 13px 30px; }
  .topbar { height: 57px; }
  .breadcrumb { gap: 6px; font-size: 10px; }
  .topbar-right { gap: 8px; }
  .today-label { display: none; }
  .view { padding-top: 25px; }
  .page-heading { min-height: 100px; margin-bottom: 16px; }
  .page-heading h1 { font-size: 22px; }
  .page-heading p { max-width: 250px; font-size: 11px; line-height: 1.5; }
  .page-heading > .button { min-height: 35px; gap: 5px; padding: 0 9px; font-size: 10px; }
  .metric-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
  .report-filters { grid-template-columns: 1fr 1fr; }
  .report-filters > button { grid-column: 1 / -1; }
  .report-metrics { grid-template-columns: 1fr; }
  .metric { min-height: 126px; padding: 13px 12px; }
  .metric:first-child { grid-column: 1 / -1; }
  .metric-top { font-size: 10px; }
  .metric-icon { width: 23px; height: 23px; font-size: 13px; }
  .metric > strong { font-size: 20px; }
  .metric-foot { align-items: flex-start; font-size: 9px; line-height: 1.4; }
  .due-panel { padding: 17px 12px 7px; }
  .panel-heading h2 { font-size: 15px; }
  .text-button { font-size: 10px; }
  .form-panel { padding: 16px 13px; }
  .field-pair { gap: 7px; }
  .field-pair > div { min-width: 0; }
  input, select { padding-right: 6px; padding-left: 7px; font-size: 11px; }
  .journal-summary { padding: 14px 10px; }
  .journal-summary > div + div { padding-left: 9px; }
  .summary-label { font-size: 8px; }
  .journal-summary strong { font-size: 13px; }
  .journal-count strong { font-size: 14px; }
  #download-csv { font-size: 0; }
  #download-csv span { font-size: 17px; }
}

/* Ink and cobalt theme */
body { background: var(--canvas); color: var(--ink); }
.sidebar { border-right-color: #1e293b; background: #0d1524; color: #f4f7fc; }
.brand-mark { background: var(--blue); }
.brand small { color: #8b9ab1; }
.side-caption, .eyebrow { color: #8793a6; }
.nav-link { color: #a6b1c2; }
.nav-link:hover { background: #18253a; color: #fff; }
.nav-link.is-active { background: var(--blue); color: #fff; }
.sidebar-bottom { border-top-color: #263247; }
.sidebar-note { color: #99a5b8; }
.live-dot { background: #4d91ff; box-shadow: 0 0 0 3px #20385d; }
.topbar { border-bottom-color: var(--line); }
.breadcrumb { color: #738096; }
.breadcrumb strong { color: var(--ink); }
.crumb-divider { color: #aab5c5; }
.today-label { color: #647187; }
.avatar { border-color: #c7d5eb; background: #e6efff; color: #2454ad; }
.button-dark { background: #111827; color: #fff; }
.button-dark:hover { background: #26364e; }
.button-outline { border-color: #cfdaea; color: #1e2a3d; }
.button-outline:hover { background: #edf3ff; }
.button-yellow { background: var(--blue); color: #fff; }
.button-yellow:hover { background: #1e52c5; }
.metric-green { border-color: #2864e8; background: #2864e8; color: #fff; }
.metric-green .metric-top, .metric-green .metric-foot { color: #e5edff; }
.metric-green > strong { color: #fff; }
.metric-icon { background: #dce8ff; color: #2053b9; }
.metric-green .metric-icon { background: #ffffff24; color: #fff; }
.icon-coral { background: #fae8e9; color: #c45158; }
.icon-yellow { background: #e5edff; color: #315fae; }
.metric-foot { color: #6b778b; }
.metric-dot { background: #fff; }
.panel { border-color: var(--line); }
.text-button { color: #2457bd; }
th, .side-caption, .eyebrow { letter-spacing: 0; }
th { color: #78869b; }
td { border-bottom-color: #edf1f6; color: #566277; }
td strong { color: #182235; }
td small { color: #8d99aa; }
.status-active { background: #e8f0ff; color: #315fae; }
.status-late { background: #fbe9e9; color: #b54d53; }
.note-panel { background: #101a2b; color: #f5f8ff; }
.note-panel::after { border-color: #263958; }
.note-panel .eyebrow { color: #94afd9; }
.note-mark { background: #1c2b43; color: #80aaff; }
.note-panel p { color: #b7c3d5; }
.note-link { color: #9fc0ff; }
.step-mark { background: #e8f0ff; color: #315fae; }
.step-coral { background: #fae8e9; color: #b54d53; }
.step-yellow { background: #e8f0ff; color: #315fae; }
.field-label { color: #4e5b70; }
.required { color: #cf5d62; }
input, select { border-color: #d7e0ec; color: #1c293d; }
input:focus, select:focus { border-color: #4a7fe8; box-shadow: 0 0 0 2px #e5edff; }
input::placeholder { color: #9aa6b7; }
input[type="date"] { color: #344258; }
.square-button { border-color: #d7e0ec; background: #f6f8fc; color: #2457bd; }
.square-button:hover { background: #e8f0ff; }
.customer-create { border-color: #dfe7f2; background: #f7f9fd; }
.equipment-option { border-color: #e0e7f0; }
.equipment-option:has(input:checked) { border-color: #7ea3ed; background: #f0f5ff; }
.check-box { border-color: #bec9d9; }
.equipment-option input:checked + .check-box { border-color: var(--blue); background: var(--blue); }
.equipment-name, .equipment-option strong { color: #243148; }
.equipment-name small, .equipment-option strong small { color: #7c899d; }
.quiet-message { border-color: #d8e1ee; color: #78869b; }
.estimate-row { border-top-color: #e6ebf3; color: #637087; }
.estimate-row strong { color: #1748a0; }
.fine-preview { border-color: #dfe8f6; background: #f4f7fc; }
.fine-preview span { color: #738198; }
.fine-preview strong { color: #2457bd; }
.inline-notice { border-left-color: #5181dc; background: #f0f5ff; color: #53647d; }
.payment-panel { border-top-color: var(--blue); }
.journal-summary { border-bottom-color: var(--line); background: #f8faff; }
.summary-label { color: #7c899d; }
.account-code { background: #edf2fa; color: #64738a; }
.journal-description { color: #647187; }
.journal-foot { border-top-color: var(--line); color: #7c899d; }
.journal-foot .live-dot { background: #4d91ff; }
.toast { border-color: #243b60; background: #101a2b; }
.toast.is-error { border-color: #e1a3a6; background: #873c43; }

@media (max-width: 820px) {
  .sidebar { border-right-color: #1e293b; }
}

/* Seller dashboard polish */
body { background: radial-gradient(ellipse at 85% 0, #eaf1ff 0, var(--canvas) 42%); }
.view#view-dashboard .metric-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.view#view-dashboard .metric { min-height: 142px; border-radius: 12px; box-shadow: 0 8px 24px #172b4d0a; transition: transform .18s, box-shadow .18s; }
.view#view-dashboard .metric:hover { transform: translateY(-2px); box-shadow: 0 12px 28px #172b4d14; }
.view#view-dashboard .metric-green { border-color: #2864e8; background: linear-gradient(140deg, #2864e8, #1749bf); }
.view#view-dashboard .metric:not(.metric-green) { border-color: #e3eaf4; }
.view#view-dashboard .metric-foot { line-height: 1.4; }
.view#view-dashboard .dashboard-grid { gap: 16px; }
.view#view-dashboard .panel,
.view#view-dashboard .note-panel { border-radius: 12px; box-shadow: 0 8px 26px #172b4d0a; }
.view#view-dashboard .due-panel { padding: 21px 21px 13px; }
.view#view-dashboard .due-panel table { margin-top: 8px; }
.view#view-dashboard .panel-heading h2 { font-size: 18px; }
.dashboard-filters { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 17px; }
.dashboard-filter { display: inline-flex; min-height: 31px; align-items: center; gap: 7px; padding: 0 10px; border: 1px solid #e0e7f0; border-radius: 20px; background: #fff; color: #68768d; cursor: pointer; font-size: 10px; font-weight: 600; transition: background .15s, color .15s, border-color .15s; }
.dashboard-filter:hover { border-color: #a9c1f1; color: #2457bd; }
.dashboard-filter.is-active { border-color: #dce8ff; background: #edf3ff; color: #2457bd; }
.dashboard-filter > span { min-width: 17px; padding: 2px 4px; border-radius: 10px; background: #eef1f6; color: #67758b; text-align: center; }
.dashboard-filter.is-active > span { background: #dce8ff; color: #2457bd; }
.due-caption { padding: 9px 8px 2px; color: #8591a3; font-size: 10px; line-height: 1.5; }
.status-due { background: #fff3d9; color: #94620e; }
.view#view-dashboard .note-panel { min-height: 100%; padding: 21px 19px; }
.view#view-dashboard .note-mark { margin-bottom: 14px; background: #1c2b43; color: #83adff; }
.view#view-dashboard .note-panel .eyebrow { color: #94afd9; }
.view#view-dashboard .note-panel h2 { max-width: none; margin-bottom: 16px; font-size: 17px; }
.followup-list { position: relative; z-index: 1; display: grid; gap: 13px; }
.followup-item { display: flex; align-items: flex-start; gap: 9px; color: #f3f6fc; font-size: 11px; line-height: 1.4; }
.followup-item strong { display: block; font-size: 11px; font-weight: 600; }
.followup-item small { display: block; margin-top: 3px; color: #b7c3d5; font-size: 10px; line-height: 1.45; }
.followup-indicator { width: 8px; height: 8px; flex: 0 0 auto; margin-top: 3px; border-radius: 50%; background: #57c08c; box-shadow: 0 0 0 3px #57c08c24; }
.followup-indicator.is-urgent { background: #ff737b; box-shadow: 0 0 0 3px #ff737b28; }
.followup-indicator.is-soon { background: #ffc45a; box-shadow: 0 0 0 3px #ffc45a28; }
.followup-action { position: relative; z-index: 1; margin-top: 18px; border-color: #344761; background: #18263b; color: #dce8ff; }
.followup-action:hover { background: #233652; }
.button:focus-visible, .dashboard-filter:focus-visible, .text-button:focus-visible { outline: 3px solid #8db2ff; outline-offset: 2px; }

@media (max-width: 1080px) {
  .view#view-dashboard .metric-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 820px) {
  .view#view-dashboard .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 560px) {
  .view#view-dashboard .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .view#view-dashboard .metric:first-child { grid-column: auto; }
  .view#view-dashboard .metric { min-height: 125px; }
  .view#view-dashboard .metric-foot { font-size: 9px; }
  .view#view-dashboard .due-panel { padding: 17px 12px 10px; }
  .dashboard-filters { gap: 5px; }
  .dashboard-filter { min-height: 29px; gap: 5px; padding: 0 8px; font-size: 9px; }
  .view#view-dashboard .note-panel { min-height: 0; }
}

/* Unified visual refinement */
:root {
  --line: #e4eaf3;
  --canvas: #f5f7fb;
  --blue-soft: #edf3ff;
  --surface-shadow: 0 10px 30px #1a31500a;
}
body { background: radial-gradient(ellipse at 80% 0, #eaf1ff 0, #f5f7fb 48%, #f7f9fc 100%); }
.sidebar { background: linear-gradient(180deg, #111c30, #0d1524); box-shadow: 8px 0 28px #10213b0a; }
.brand-mark { border-radius: 12px; background: linear-gradient(145deg, #4f86ff, #2864e8); box-shadow: 0 6px 16px #2864e833; }
.nav-link { min-height: 45px; border-radius: 9px; transition: background .18s, color .18s, transform .18s; }
.nav-link:hover { transform: translateX(2px); }
.nav-link.is-active { box-shadow: 0 5px 15px #2864e833; }
.main-content { padding-right: clamp(22px, 3.2vw, 48px); padding-left: clamp(22px, 3.2vw, 48px); }
.topbar { background: #f5f7fbe8; backdrop-filter: blur(12px); }
.avatar { border-color: #cfdbef; background: linear-gradient(145deg, #f1f5ff, #dce8ff); font-weight: 700; }
.view { padding-top: clamp(25px, 3vw, 36px); }
.page-heading h1 { letter-spacing: -.6px; }
.page-heading p { color: #718097; line-height: 1.6; }
.button { min-height: 42px; border-radius: 8px; font-weight: 700; transition: transform .16s, box-shadow .16s, background .16s; }
.button:hover { transform: translateY(-1px); }
.button-dark { box-shadow: 0 5px 13px #16264120; }
.button-yellow { box-shadow: 0 5px 14px #2864e81f; }
.metric, .panel, .note-panel, .detail-panel, .journal-panel {
  border-color: var(--line);
  border-radius: 12px;
  box-shadow: var(--surface-shadow);
}
.metric { transition: transform .18s, box-shadow .18s, border-color .18s; }
.metric:hover { transform: translateY(-2px); border-color: #d1ddef; box-shadow: 0 13px 30px #172b4d12; }
.metric-green { box-shadow: 0 8px 20px #2864e824; }
.metric-icon { border-radius: 9px; }
.due-panel, .form-panel { padding: 21px; }
.panel-heading h2, .note-panel h2 { letter-spacing: -.25px; }
.right-forms { gap: 16px; }
.table-wrap { border-radius: 8px; }
th { background: #f7f9fc; color: #74839a; }
tbody tr { transition: background .15s; }
tbody tr:hover { background: #f8faff; }
td { padding-top: 13px; padding-bottom: 13px; }
td strong { font-size: 12px; }
td small { font-family: var(--sans); }
.status-pill { padding: 6px 9px; border-radius: 20px; }
.status-active { background: #e9f1ff; color: #315fae; }
.status-late { background: #fff0f0; color: #b54d53; }
.status-due { background: #fff4dc; color: #95620d; }
.note-panel:not(.seller-followup) { background: linear-gradient(150deg, #15243b, #0d1524); }
.note-panel:not(.seller-followup)::after { border-color: #ffffff16; }
input, select { min-height: 42px; border-radius: 8px; transition: border-color .15s, box-shadow .15s; }
input:hover, select:hover { border-color: #bdcbe0; }
input:focus, select:focus { box-shadow: 0 0 0 3px #2864e81a; }
.payment-quick-button, .square-button { border-radius: 8px; }
.equipment-option { border-radius: 9px; transition: border-color .15s, background .15s, transform .15s; }
.equipment-option:hover { transform: translateY(-1px); }
.payment-summary, .fine-preview, .inline-notice, .customer-create { border-radius: 8px; }
.report-metric { border-color: var(--line); border-radius: 10px; background: linear-gradient(145deg, #fff, #f9fbfe); }
.dashboard-filter { min-height: 33px; }
.button:focus-visible, .nav-link:focus-visible, .dashboard-filter:focus-visible, .text-button:focus-visible, .refresh-button:focus-visible {
  outline: 3px solid #8db2ff;
  outline-offset: 2px;
}

@media (max-width: 820px) {
  .due-panel, .form-panel { padding: 18px; }
  .nav-link:hover { transform: none; }
}
@media (max-width: 560px) {
  .sidebar-bottom { display: none; }
  .due-panel, .form-panel { padding: 16px 13px; }
  .view#view-dashboard .due-panel { padding: 17px 12px 10px; }
  .page-heading h1 { letter-spacing: -.35px; }
  .metric, .view#view-dashboard .metric { border-radius: 10px; }
  .view#view-dashboard .note-panel { padding: 19px 16px; }
  .dashboard-filter { min-height: 30px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

.nav-group-label { padding: 14px 10px 3px; color: #94a3b8; font: 500 9px var(--mono); letter-spacing: .06em; }
.dashboard-financial-grid { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(235px, .85fr); gap: 16px; margin: 0 0 16px; }
.trend-panel, .monthly-summary-panel { min-width: 0; padding: 20px; }
.chart-period { color: var(--muted); font-size: 11px; text-transform: capitalize; }
.chart-legend { display: flex; flex-wrap: wrap; gap: 15px; margin-top: 18px; color: var(--muted); font-size: 10px; }
.chart-legend span { display: inline-flex; align-items: center; gap: 6px; }
.chart-legend i { width: 8px; height: 8px; border-radius: 3px; }
.legend-rent { background: #2864e8; }
.legend-fine { background: #f0aa47; }
.revenue-chart { display: grid; height: 178px; grid-template-columns: repeat(31, minmax(3px, 1fr)); align-items: stretch; gap: 4px; margin-top: 13px; border-bottom: 1px solid var(--line); }
.chart-day { display: grid; min-width: 0; grid-template-rows: 1fr 17px; align-items: end; }
.chart-column { display: flex; height: 100%; flex-direction: column; justify-content: flex-end; gap: 2px; }
.chart-segment { display: block; min-height: 0; border-radius: 3px 3px 1px 1px; }
.chart-segment-rent { height: var(--rent-height); background: linear-gradient(180deg, #5e8ef2, #2864e8); }
.chart-segment-fine { height: var(--fine-height); background: linear-gradient(180deg, #ffd07d, #eda440); }
.chart-day-label { color: #8793a6; font: 9px var(--mono); text-align: center; }
.monthly-income-summary { display: grid; gap: 0; margin: 14px 0; }
.monthly-income-row { display: flex; justify-content: space-between; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); color: var(--muted); font-size: 11px; }
.monthly-income-row strong { color: var(--ink); font-size: 12px; text-align: right; }
.monthly-income-row.total { color: var(--ink); font-weight: 700; }
.monthly-income-row.total strong { color: #2457bd; font-size: 14px; }
.monthly-summary-panel .field-hint { display: block; line-height: 1.55; }
.ledger-panel, .income-panel { padding: 20px; }
.ledger-filters { display: grid; grid-template-columns: minmax(190px, 1.3fr) minmax(145px, 1fr) minmax(145px, 1fr) auto; align-items: end; gap: 12px; padding-bottom: 18px; }
.ledger-filters > div, .report-filters > div { min-width: 0; }
.ledger-summary { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin-bottom: 15px; border: 1px solid var(--line); border-radius: 10px; background: #f8faff; }
.ledger-summary > div { display: grid; gap: 6px; min-width: 0; padding: 14px 16px; }
.ledger-summary > div + div { border-left: 1px solid var(--line); }
.ledger-summary span { color: var(--muted); font-size: 10px; }
.ledger-summary strong { overflow: hidden; font-size: 15px; text-overflow: ellipsis; white-space: nowrap; }
.income-metrics { grid-template-columns: repeat(4, minmax(0, 1fr)); margin: 17px 0; }
.income-explanation { display: grid; gap: 5px; margin: 14px 0; padding: 13px 15px; border: 1px solid #d8e5fb; border-radius: 10px; background: #f2f7ff; color: #536680; font-size: 11px; line-height: 1.55; }
.income-explanation strong { color: #244a87; font-size: 11px; }
.income-month-heading td { background: #f4f7fc; color: #34445e; font-weight: 700; }
.income-table { min-width: 710px; }

@media (max-width: 1080px) {
  .dashboard-financial-grid { grid-template-columns: minmax(0, 1.4fr) minmax(210px, .9fr); }
  .ledger-filters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ledger-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .income-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 820px) {
  .nav-group-label { display: none; }
  .dashboard-financial-grid { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .trend-panel, .monthly-summary-panel, .ledger-panel, .income-panel { padding: 15px 12px; }
  .page-heading { flex-direction: column; gap: 10px; }
  .page-heading > .button { align-self: flex-start; }
  .chart-period { font-size: 9px; }
  .chart-legend { gap: 9px; font-size: 9px; }
  .revenue-chart { height: 150px; gap: 2px; }
  .ledger-filters, .income-metrics { grid-template-columns: 1fr 1fr; }
  .ledger-filters > div:first-child { grid-column: 1 / -1; }
  .ledger-filters > .button { grid-column: 1 / -1; }
  .ledger-summary > div { padding: 10px 8px; }
  .ledger-summary strong { font-size: 12px; }
  .ledger-summary span { font-size: 9px; }
}

.equipment-heading { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.equipment-heading .text-button { color: #2457bd; }
.equipment-create { display: grid; gap: 11px; padding: 14px; border: 1px solid #dfe8f6; border-radius: 10px; background: linear-gradient(145deg, #f8faff, #f1f5fc); }
.equipment-create[hidden] { display: none; }
.equipment-create .field-pair { gap: 12px; }
.equipment-save-wrap { align-content: end; }
.equipment-create .field-hint { margin: 0; line-height: 1.5; }
.equipment-list { max-height: 360px; gap: 8px; }
.equipment-option { min-height: 68px; gap: 10px; padding: 8px 10px; border-color: #e4eaf2; background: #fff; }
.equipment-option:has(input:checked) { border-color: #80a2e9; background: #f1f6ff; box-shadow: 0 0 0 2px #2864e80c; }
.equipment-option input:focus-visible + .check-box { outline: 3px solid #8db2ff; outline-offset: 2px; }
.equipment-option .check-box { border-color: #c3cddd; }
.equipment-option input:checked + .check-box { border-color: var(--blue); background: var(--blue); }
.equipment-name { color: #243148; font-size: 12px; }
.equipment-name small { color: #7c899d; font-size: 10px; }
.equipment-option strong { color: #2457bd; font-size: 10px; }
.instrument-art { display: grid; width: 43px; height: 43px; flex: 0 0 auto; place-items: center; border-radius: 12px; }
.instrument-art svg { width: 35px; height: 35px; fill: none; stroke: currentColor; stroke-width: 2.3; stroke-linecap: round; stroke-linejoin: round; }
.instrument-art .art-detail { stroke-width: 1.5; }
.art-strings { background: #fbece5; color: #b96b43; }
.art-keys { background: #eaf0ff; color: #4266b0; }
.art-drum { background: #f4eafa; color: #8754a0; }
.art-mic { background: #e4f4f1; color: #318475; }
.art-wind { background: #fff2dc; color: #b27a23; }
.art-default { background: #edf1f7; color: #596d8a; }

@media (max-width: 560px) {
  .equipment-create { padding: 11px; }
  .equipment-create .field-pair { grid-template-columns: 1fr; gap: 10px; }
  .equipment-list { max-height: 310px; }
  .equipment-option { min-height: 64px; gap: 7px; padding: 7px; }
  .instrument-art { width: 37px; height: 37px; border-radius: 10px; }
  .instrument-art svg { width: 31px; height: 31px; }
  .equipment-name { font-size: 11px; }
}

.instrument-hero {
  display: grid;
  grid-template-columns: minmax(0, .95fr) minmax(0, 1.05fr);
  gap: 26px;
  align-items: center;
  min-height: 238px;
  margin: 0 0 19px;
  padding: 24px;
  overflow: hidden;
  border: 1px solid #233b5a;
  border-radius: 14px;
  background: linear-gradient(120deg, #101e33, #1a3452);
  color: #fff;
}
.instrument-hero-copy { max-width: 440px; }
.instrument-hero .eyebrow { color: #a9c8f5; }
.instrument-hero h2 { margin: 10px 0 8px; font: 700 clamp(21px, 2.5vw, 30px)/1.16 var(--serif); letter-spacing: -.5px; }
.instrument-hero p { max-width: 385px; margin: 0 0 17px; color: #c1cde0; font-size: 12px; line-height: 1.65; }
.button-hero { min-height: 38px; border-radius: 8px; background: #dce8ff; color: #142744; }
.button-hero:hover { background: #fff; }
.instrument-hero-gallery { display: grid; min-width: 0; height: 188px; grid-template-columns: 1.15fr .85fr; grid-template-rows: repeat(2, minmax(0, 1fr)); gap: 8px; }
.instrument-hero-gallery img { width: 100%; height: 100%; min-height: 0; object-fit: cover; border-radius: 9px; }
.instrument-hero-gallery .hero-photo-main { grid-row: 1 / -1; }
.instrument-photo { overflow: hidden; border: 1px solid #e5eaf2; background: #edf2f8; }
.instrument-photo img { display: block; width: 100%; height: 100%; object-fit: cover; }
.instrument-art.instrument-photo { width: 76px; height: 56px; flex-basis: 76px; border-radius: 8px; }
.equipment-option { min-height: 70px; gap: 10px; padding: 7px 9px; border-color: #e1e7f0; background: linear-gradient(110deg, #fff, #fbfcff); }
.equipment-option:has(input:checked) { border-color: #80a2e9; background: #f1f6ff; box-shadow: 0 0 0 2px #2864e80c; }
.equipment-option input:focus-visible + .check-box { outline: 3px solid #8db2ff; outline-offset: 2px; }
.equipment-option .check-box { border-color: #c3cddd; }
.equipment-name { color: #243148; font-size: 12px; }
.equipment-name small { color: #7c899d; font-size: 10px; }
.equipment-option strong { color: #2457bd; font-size: 10px; }

@media (max-width: 820px) {
  .instrument-hero { grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); gap: 17px; padding: 20px; }
  .instrument-hero-gallery { height: 166px; }
}
@media (max-width: 560px) {
  .instrument-hero { grid-template-columns: 1fr; gap: 18px; padding: 20px 17px; }
  .instrument-hero-gallery { height: 155px; }
  .instrument-art.instrument-photo { width: 58px; height: 50px; flex-basis: 58px; }
  .equipment-option { gap: 7px; padding: 7px; }
}
