:root {
  font-family: Inter, 'Segoe UI', system-ui, sans-serif;
  color: #192744;
  background: #f4f7fc;
  font-size: 15px;
  --muted: #52627c;
  --line: #e1e8f2;
  --blue: #185be5;
  --radius: 16px;
}
* { box-sizing: border-box; }
body { margin: 0; }
button, input, select { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; opacity: .55; }
button:focus-visible, .button:focus-visible, input:focus-visible, select:focus-visible { outline: 2px solid #3271ef; outline-offset: 3px; }
[hidden] { display: none !important; }
body[data-view="pending"] [data-month-only], body:not([data-view="pending"]) [data-pending-only] { display: none; }
svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.icon-library { position: absolute; width: 0; height: 0; pointer-events: none; }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.shell { max-width: 1200px; width: calc(100% - 72px); margin-inline: auto; }
.topbar { background: #fff; border-bottom: 1px solid var(--line); }
.topbar-inner { min-height: 65px; display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.topbar-inner form { margin: 0; }
.topbar-inner:has(form) .workspace-label { margin-left: auto; }
.owner-body { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: #f3f6fc; }
.owner-card { width: min(100%, 430px); padding: 32px; background: #fff; border: 1px solid var(--line); border-radius: 20px; box-shadow: 0 12px 42px #14213b12; }
.owner-card h1 { margin: 24px 0 8px; font-size: clamp(24px, 5vw, 32px); line-height: 1.15; }
.owner-card p { color: #475569; margin: 0 0 20px; }
.owner-card form { display: grid; gap: 14px; }
.owner-card label { display: grid; gap: 6px; }
.owner-card input, .owner-card button { min-height: 44px; }
.owner-card a { display: inline-block; margin-top: 16px; color: #284bb0; }
.owner-card .owner-error { color: #9f1239; background: #fff1f2; padding: 10px 12px; border-radius: 8px; }
.install-control { margin-top: 16px; }
.install-control p { margin: 8px 0 0; color: var(--muted); font-size: 13px; }
.brand, .workspace-label { display: inline-flex; align-items: center; gap: 10px; }
.brand { font-size: 20px; font-weight: 750; letter-spacing: -.7px; }
.brand-icon { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; background: var(--blue); color: #fff; }
.brand-icon svg { stroke-width: 2; }
.workspace-label { color: var(--muted); font-size: 12px; font-weight: 650; gap: 6px; }
.workspace-label svg { width: 16px; height: 16px; }
.overview { position: relative; z-index: 1; isolation: isolate; margin-top: 18px; padding: 16px 22px; display: flex; align-items: center; justify-content: space-between; gap: 16px; border-radius: 15px; color: #fff; background: linear-gradient(111deg, #0e2044 15%, #152e5d 70%, #163a78); box-shadow: 0 8px 22px #1c40771a; }
.overview::before { content: ''; position: absolute; inset: 0; z-index: -1; border-radius: inherit; background: repeating-radial-gradient(ellipse at 93% 105%, transparent 0 24px, #87acff1c 25px 26px, transparent 27px 42px); mask-image: linear-gradient(90deg, transparent 42%, #000); pointer-events: none; }
.eyebrow { margin: 0; font-size: 10px; font-weight: 780; letter-spacing: 1.35px; color: #5c6f8d; }
.overview .eyebrow { color: #b0cbff; display: flex; align-items: center; gap: 7px; }
.overview .eyebrow span { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: #78acff; box-shadow: 0 0 0 3px #78acff24; }
h1, h2, h3 { margin: 0; }
h1 { margin-block: 5px 4px; font-size: clamp(26px, 3.5vw, 38px); font-weight: 740; line-height: 1.05; letter-spacing: -.052em; }
.overview-copy > p:last-child { margin: 0; color: #cfddf5; font-size: 13px; line-height: 1.4; }
.overview-actions { display: flex; flex-wrap: wrap; gap: 6px; flex: none; max-width: 100%; }
.button, .icon-button, .month-button, .text-button { border: 0; background: transparent; color: inherit; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 41px; padding: 8px 14px; border: 1px solid transparent; border-radius: 9px; white-space: nowrap; font-size: 13px; font-weight: 700; text-decoration: none; }
.button svg { width: 17px; height: 17px; }
.primary { background: var(--blue); color: white; }
.primary:hover:not(:disabled) { background: #124dc7; }
.hero-add { background: #2870ef; }
.secondary { background: #fff; color: #213759; border-color: #d9e3f1; }
.secondary:hover { background: #eff5ff; border-color: #c5d8f6; }
.icon-button { width: 33px; height: 33px; display: inline-grid; place-items: center; padding: 0; border-radius: 7px; }
.icon-button svg { width: 17px; height: 17px; }
.icon-button:hover:not(:disabled) { background: #e9f0fc; }
.month-control { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 8px; margin-top: 14px; padding: 7px; border: 1px solid var(--line); background: #fff; border-radius: 13px; }
.month-control .icon-button { width: 40px; height: 44px; color: #244878; }
.month-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 5px; }
.month-button { display: grid; place-content: center; gap: 2px; min-height: 46px; padding: 5px 3px; border-radius: 8px; color: #284465; font-size: 13px; font-weight: 720; }
.month-button span + span { font-size: 11px; font-weight: 550; }
.month-button:hover { background: #edf4ff; }
.month-button[aria-pressed='true'] { background: var(--blue); color: #fff; }
.summary { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 15px; margin-top: 17px; }
.stat, .coverage, .ledger { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 3px 10px #1d407008; }
.stat { position: relative; min-width: 0; padding: 16px 19px; }
.stat-label { display: flex; align-items: center; gap: 9px; font-size: 13px; font-weight: 720; color: #344562; }
.stat-icon { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 9px; }
.stat-icon svg { width: 17px; height: 17px; }
.blue { color: #1958cc; background: #ebf2ff; }
.green { color: #08754c; background: #e9f8ef; }
.violet { color: #6844b1; background: #f1ebff; }
.stat strong { display: block; margin-top: 10px; font-size: clamp(21px, 2.8vw, 32px); letter-spacing: -.035em; line-height: 1.1; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.stat p, .coverage p { margin: 5px 0 0; color: var(--muted); font-size: 12px; line-height: 1.35; }
.edit-target { position: absolute; top: 14px; right: 13px; color: #536887; }
.stat:has(.edit-target) .stat-label { padding-right: 25px; }
.coverage { margin-top: 12px; padding: 11px 18px 13px; display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.coverage-title { font-size: 13px; font-weight: 750; }
.coverage-title span { display: inline-block; margin-left: 5px; padding: 2px 6px; border-radius: 5px; color: #174aaf; background: #edf3ff; font-size: 11px; }
.progress { height: 7px; border-radius: 7px; background: #e7eef9; width: min(39%, 360px); overflow: hidden; flex: none; }
.progress span { display: block; height: 100%; width: 0; background: #2870ef; border-radius: inherit; transition: width .2s ease; }
.annual-goal { display: grid; grid-template-columns: minmax(0, 1fr) minmax(65px, 22%) auto; gap: 3px 9px; background: #f4f8ff; border-color: #d7e6ff; }
.goal-info { display: flex; align-items: baseline; flex-wrap: wrap; gap: 2px 8px; }
.goal-info > strong, .goal-meter > strong { font-weight: 850; line-height: 1.12; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.goal-info > strong { font-size: clamp(22px, 4vw, 29px); }
.goal-meter { text-align: right; color: #174aaf; }
.goal-meter > strong { font-size: clamp(19px, 3vw, 25px); }
.goal-meter .progress { width: 100%; height: 5px; margin-top: 4px; }
.annual-goal .icon-button { color: #385987; grid-column: 3; }
.goal-notes { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 2px 12px; }
.goal-notes p { margin: 0; }
.ledger { margin-top: 20px; overflow: hidden; }
.ledger-heading { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 14px; padding: 19px 20px 15px; }
h2 { font-size: 22px; letter-spacing: -.035em; line-height: 1.2; }
.ledger-heading h2, .dialog-head .eyebrow + h2 { margin-top: 4px; }
.record-count { margin: 0; color: var(--muted); font-size: 12px; flex: none; }
.empty-state { min-height: 207px; display: grid; justify-items: center; align-content: center; padding: 24px; text-align: center; }
.empty-icon { display: grid; place-items: center; width: 42px; height: 42px; margin-bottom: 9px; border-radius: 12px; color: #2865d1; background: #edf3ff; }
.empty-state h3 { font-size: 15px; }
.empty-state p { max-width: 36ch; margin: 5px 0 11px; color: var(--muted); font-size: 13px; }
.empty-state .button { min-height: 33px; padding: 5px 9px; }
.table-wrap { overflow: auto; }
table { width: 100%; border-collapse: collapse; text-align: left; }
th, td { padding: 11px 9px; vertical-align: middle; font-size: 13px; }
th { background: #f7f9fd; color: #4c5f7d; font-size: 11px; font-weight: 730; white-space: nowrap; }
th:first-child, td:first-child { padding-left: 20px; }
th:last-child, td:last-child { padding-right: 20px; }
td { border-top: 1px solid #ebeff6; }
tbody tr:hover { background: #fbfcff; }
td .badge { display: inline-flex; align-items: center; gap: 5px; padding: 4px 7px; border-radius: 6px; font-size: 11px; font-weight: 730; }
.badge::before { content: ''; flex: none; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.badge.active { background: #eaf2ff; color: #174aaf; }
.badge.draft { background: #eef2f8; color: #4b607d; }
.badge.issued { background: #fff1dc; color: #82500d; }
.badge.paid { background: #e5f6ec; color: #11623d; }
.date { white-space: nowrap; }
.record-year { display: block; color: var(--muted); font-size: 10px; }
.project-amount { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.record-name { max-width: 250px; overflow-wrap: anywhere; }
footer { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 15px; padding: 12px 1px 17px; font-size: 12px; color: var(--muted); }
footer > div { display: flex; gap: 9px; }
.text-button { min-height: 30px; padding: 4px 6px; border-radius: 6px; font-size: 12px; font-weight: 720; color: #2c5390; }
.text-button:hover:not(:disabled) { background: #eaf2ff; }
.client-button { margin-left: -6px; text-align: left; text-decoration: underline; text-underline-offset: 2px; overflow-wrap: anywhere; }
.notice { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px; margin-top: 12px; padding: 12px 15px; border-radius: 9px; background: #fff2de; color: #6f410d; font-size: 13px; }
dialog { width: min(540px, calc(100% - 24px)); max-height: calc(100% - 24px); padding: 0; border: 1px solid var(--line); border-radius: 17px; box-shadow: 0 24px 80px #08163755; color: #192744; }
dialog::backdrop { background: #0a1938a0; }
dialog form { padding: 21px; }
#target-dialog, #goal-dialog, #confirm-dialog { max-width: 405px; }
.dialog-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 16px; }
.dialog-head .icon-button { color: var(--muted); margin: -4px -5px 0 0; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 11px 12px; }
.wide { grid-column: 1 / -1; }
label { display: block; min-width: 0; font-size: 12px; font-weight: 720; color: #344661; }
input, select { display: block; width: 100%; height: 37px; margin-top: 5px; padding: 6px 8px; border: 1px solid #d7e1ef; border-radius: 7px; background: white; color: #192744; font-size: 13px; }
input::placeholder { color: #6c7a90; }
.optional { font-size: 10px; color: var(--muted); font-weight: 500; }
.amount-preview, .field-note { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.45; }
#target-dialog .field-note { margin-top: 8px; }
.invoice-fields { border-top: 1px solid var(--line); padding-top: 12px; margin-top: 11px; }
.dialog-actions { display: flex; align-items: center; gap: 8px; margin-top: 17px; }
.dialog-actions > div { margin-left: auto; display: flex; gap: 6px; }
.danger { color: #a62938; }
.form-error { color: #a62938; font-size: 12px; line-height: 1.45; margin: 9px 0 0; }
.toast { position: fixed; z-index: 9; bottom: 18px; right: 18px; padding: 10px 14px; max-width: calc(100% - 36px); border-radius: 9px; background: #162c50; box-shadow: 0 8px 22px #142b5044; color: white; font-size: 13px; }
@media (max-width: 890px) {
  .shell { width: calc(100% - 44px); }
}
@media (max-width: 620px) {
  .shell { width: calc(100% - 26px); }
  .topbar-inner { min-height: 53px; }
  .brand { font-size: 18px; }
  .brand-icon { width: 29px; height: 29px; }
  .overview { margin-top: 12px; padding: 12px 13px; flex-direction: column; align-items: flex-start; gap: 9px; }
  .overview-actions .button { min-height: 38px; padding: 6px 9px; font-size: 12px; }
  .month-control { gap: 3px; padding: 5px; }
  .month-control .icon-button { width: 32px; }
  .month-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .month-button { font-size: 12px; }
  .summary { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; margin-top: 10px; }
  .stat { padding: 8px 7px; border-radius: 11px; }
  .stat-label { font-size: 11px; gap: 4px; }
  .stat-icon { width: 21px; height: 21px; border-radius: 6px; }
  .stat-icon svg { width: 13px; height: 13px; }
  .stat strong { font-size: clamp(14px, 4.25vw, 24px); margin-top: 6px; }
  .stat p { font-size: 10px; }
  .stat:has(.edit-target) .stat-label { padding-right: 12px; }
  .edit-target { top: 2px; right: 1px; width: 23px; height: 23px; }
  .edit-target svg { width: 12px; height: 12px; }
  .coverage { padding: 9px 10px; gap: 10px; }
  .progress { width: 25%; }
  .ledger { margin-top: 13px; }
  .ledger-heading { gap: 9px; padding: 12px; }
  table { table-layout: fixed; }
  th, td { padding: 7px 4px; }
  th:first-child, td:first-child { padding-left: 8px; }
  th:last-child, td:last-child { padding-right: 7px; }
  td { font-size: 12px; }
  th.date { width: 43px; }
  th.project-amount { width: clamp(48px, 14vw, 76px); }
  th.record-currency { width: 48px; }
  th.record-status { width: 29%; }
  .project-amount { white-space: normal; overflow-wrap: anywhere; }
  .client-button { max-width: 100%; margin-left: 0; padding-inline: 0; }
  td .badge { display: inline-block; max-width: 100%; padding: 3px 4px; line-height: 1.25; overflow-wrap: anywhere; }
  .badge::before { display: none; }
}
@media (max-width: 370px) {
  .topbar-inner:has(form) .workspace-label { display: none; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; } }
