:root {
  color-scheme: light;
  --ink: #211e19;
  --muted: #6d6255;
  --paper: #faf6ef;
  --sheet: #fffdf8;
  --line: #e9decc;
  --gold: #e6b669;
  --gold-dark: #8a581d;
  font-family: system-ui, -apple-system, sans-serif;
  color: var(--ink);
  background: var(--paper);
}
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; }
h1, h2, p { margin: 0; }
button, input, textarea, select { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: wait; opacity: .65; }
:focus-visible { outline: 3px solid #9b6628; outline-offset: 3px; }
.symbols { display: none; }
.icon { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.topbar { background: var(--ink); color: #fff8ea; border-bottom: 3px solid var(--gold); }
.top-inner { max-width: 1152px; margin: auto; padding: 16px 38px; display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.brand { display: block; width: 132px; height: auto; flex: none; }
.eyebrow { display: block; font-weight: 750; font-size: 10px; letter-spacing: .18em; color: var(--gold); margin-top: 4px; }
.tab { display: flex; align-items: center; gap: 8px; color: #f8dfb8; font-weight: 650; font-size: 14px; padding: 10px 15px; border: 1px solid #594835; border-radius: 12px; }
main { max-width: 1152px; margin: auto; padding: 36px 38px 125px; }
.intro { isolation: isolate; overflow: hidden; position: relative; background: #efe1c8; background-image: radial-gradient(ellipse at 95% 18%, #f8ebd6 0, transparent 55%); padding: 42px 40px 43px; border: 1px solid #e6d5b8; border-radius: 22px; }
.kicker { display: flex; align-items: center; gap: 9px; color: #774b19; font-size: 11px; font-weight: 800; letter-spacing: .18em; }
.kicker span { width: 24px; height: 2px; background: #a56e2d; }
h1 { font: bold clamp(46px, 7.2vw, 83px)/1.05 Georgia, serif; letter-spacing: -.065em; margin: 12px 0 9px; }
h1 span { color: #a36b2b; }
.intro p { color: #5e5040; font-size: 16px; }
.hero-paw { position: absolute; z-index: -1; width: 240px; height: 240px; right: 25px; top: 0; color: #b3813f; opacity: .19; transform: rotate(-17deg); }
.journal { margin-top: 31px; }
.journal-head { display: flex; justify-content: space-between; align-items: end; gap: 16px; margin-bottom: 15px; }
.journal-head h2 { display: flex; align-items: center; gap: 9px; font: bold 28px Georgia, serif; }
.journal-head h2 svg { color: var(--gold-dark); }
#count { color: var(--muted); font-size: 13px; margin-top: 4px; min-height: 17px; }
.search { display: flex; align-items: center; gap: 9px; background: var(--sheet); border: 1px solid var(--line); border-radius: 11px; padding: 0 12px; width: min(100%, 325px); color: var(--muted); }
.search input { flex: 1; min-width: 0; min-height: 46px; padding: 6px 0; background: transparent; border: 0; color: var(--ink); }
.search:focus-within { outline: 2px solid #a36b2b; }
.search input:focus-visible { outline: none; }
.entries-card { border: 1px solid var(--line); border-radius: 16px; overflow: hidden; background: var(--sheet); }
.row { width: 100%; min-height: 74px; display: grid; grid-template-columns: minmax(130px, 1fr) minmax(145px, 1.25fr) minmax(140px, 1.5fr) minmax(68px, auto) 20px; gap: 16px; align-items: center; padding: 12px 19px; text-align: left; }
.row-head { min-height: 39px; background: #f4ecdf; color: #6a5340; font-size: 10px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
button.row { background: none; border: 0; border-top: 1px solid var(--line); color: inherit; }
button.row:hover { background: #faf2e4; }
button.row:focus-visible { outline-offset: -4px; }
.row strong, .row small { display: block; overflow-wrap: anywhere; }
.row strong { font-size: 14px; }
.row small { color: var(--muted); font-size: 12px; margin-top: 4px; }
.row .work { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.amount { text-align: right; font-variant-numeric: tabular-nums; }
.row > svg { color: var(--gold-dark); }
.empty, .loading { text-align: center; padding: 38px 18px; background: var(--sheet); border: 1px dashed #d7c5a8; border-radius: 16px; color: var(--muted); }
.empty h3 { color: var(--ink); font: bold 25px Georgia, serif; margin: 13px 0 7px; }
.empty p { max-width: 360px; margin: auto; line-height: 1.5; }
.empty-icon { background: #f4e6cf; color: var(--gold-dark); margin: auto; width: 55px; height: 55px; border-radius: 16px; display: grid; place-items: center; }
.empty-icon svg { width: 32px; height: 32px; }
.primary, .secondary, .icon-button { min-height: 48px; border-radius: 11px; font-weight: 740; padding: 0 16px; }
.primary { background: var(--gold); color: var(--ink); border: 1px solid #c38e41; }
.primary:hover { background: #efc47e; }
.secondary, .icon-button { background: var(--sheet); color: var(--ink); border: 1px solid var(--line); }
.secondary:hover, .icon-button:hover { background: #f4ecdf; }
.floating { position: fixed; z-index: 1; right: max(24px, calc((100vw - 1076px)/2), env(safe-area-inset-right)); bottom: max(24px, env(safe-area-inset-bottom)); display: flex; gap: 9px; align-items: center; min-height: 57px; padding: 0 21px; box-shadow: 0 7px 23px #5e3d2230; }
dialog { color: inherit; border: 1px solid var(--line); border-radius: 19px; background: var(--sheet); box-shadow: 0 22px 80px #211e1955; width: min(600px, calc(100% - 28px)); max-height: calc(100dvh - 28px); padding: 0; }
dialog::backdrop { background: #25201ab0; }
.dialog-head, .dialog-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 23px; background: var(--sheet); }
.dialog-head { position: sticky; top: 0; z-index: 1; border-bottom: 1px solid var(--line); }
.dialog-head h2 { font: bold 31px Georgia, serif; margin-top: 4px; overflow-wrap: anywhere; }
.eyebrow { color: var(--gold-dark); }
.dialog-foot { position: sticky; bottom: 0; z-index: 1; justify-content: flex-end; border-top: 1px solid var(--line); }
.icon-button { display: grid; place-items: center; width: 45px; min-height: 45px; padding: 0; flex: none; }
.form-body { padding: 20px 23px 24px; }
fieldset { border: 0; padding: 0; margin: 0 0 22px; min-width: 0; }
fieldset:last-of-type { margin-bottom: 0; }
legend { font: bold 21px Georgia, serif; margin-bottom: 12px; padding: 0; }
.fields { display: grid; gap: 12px; }
.pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.form-body label { display: block; font-weight: 650; font-size: 14px; min-width: 0; }
.form-body label small { color: var(--muted); font-weight: 400; }
.form-body input, select, textarea { width: 100%; max-width: 100%; min-width: 0; min-height: 46px; margin-top: 5px; padding: 8px 10px; border: 1px solid #d9cbb6; border-radius: 9px; background: #fff; color: var(--ink); font-size: 16px; }
textarea { resize: vertical; }
.segmented { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; background: #f1e9dc; border-radius: 11px; margin-bottom: 13px; }
.segmented button { border: 0; border-radius: 8px; background: transparent; color: var(--muted); font-weight: 700; min-height: 44px; }
.segmented button[aria-pressed=true] { background: var(--sheet); color: var(--ink); box-shadow: 0 1px 4px #59483522; }
.hint, .customer-note { color: var(--muted); font-size: 13px; }
.error { color: #962e24; margin-top: 15px; }
.details { margin: 0; display: grid; gap: 13px; }
.details > div { border-bottom: 1px solid var(--line); padding-bottom: 11px; }
.details dt { font-size: 12px; font-weight: 750; color: var(--gold-dark); margin-bottom: 4px; }
.details dd { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.toast { position: fixed; z-index: 2; left: 50%; bottom: 93px; transform: translateX(-50%); background: var(--ink); color: white; border-radius: 12px; padding: 11px 17px; max-width: calc(100vw - 32px); text-align: center; }
.toast:empty { display: none; }
@media (max-width: 740px) {
  .top-inner, main { padding-left: 20px; padding-right: 20px; }
  .intro { padding: 31px 24px; }
  .hero-paw { right: -39px; top: 5px; width: 190px; height: 190px; }
  .row { grid-template-columns: minmax(90px, 1fr) minmax(80px, 1.15fr) minmax(55px, auto) 16px; gap: 9px; padding: 10px 12px; }
  .row .treatment { display: none; }
}
@media (max-width: 490px) {
  .top-inner { padding: 12px 14px; }
  main { padding: 20px 14px 108px; }
  .journal-head { align-items: stretch; flex-direction: column; gap: 11px; }
  .search { width: 100%; }
  .intro { padding: 29px 19px; }
  .intro p { font-size: 14px; }
  .dialog-head, .dialog-foot, .form-body { padding-left: 15px; padding-right: 15px; }
  .row small { font-size: 11px; }
}

.top-nav { display: flex; gap: 7px; }
.tab { background: transparent; min-height: 44px; }
.tab[aria-pressed=true] { background: #453626; border-color: #89653a; }
.tab:hover { background: #453626; }
.tab:focus-visible { outline-color: var(--gold); }
.dog-section { margin-top: 12px; }
.dog-section > button { justify-self: start; }
.customer-row { grid-template-columns: minmax(105px, 1fr) minmax(125px, 1fr) minmax(130px, 1fr) 20px; }
#customer-address { white-space: pre-line; }
.dog-list { list-style: none; padding: 0; margin: 0; }
.dog-list li { padding: 10px 0; border-bottom: 1px solid var(--line); overflow-wrap: anywhere; }
.dog-list small, legend small { font: 400 13px system-ui, sans-serif; color: var(--muted); }
@media (max-width: 600px) {
  .customer-row { grid-template-columns: minmax(100px, 1fr) minmax(105px, 1fr) 20px; }
  .customer-row .customer-city { display: none; }
}
@media (max-width: 490px) {
  .top-inner { flex-wrap: wrap; }
  .top-nav { width: 100%; }
  .tab { flex: 1; justify-content: center; padding: 8px 6px; gap: 4px; font-size: 13px; }
  .tab .icon { width: 15px; height: 15px; }
  .brand { width: 106px; }
}

.analytics-head { align-items: end; }
#period-label { color: var(--muted); font-size: 13px; margin-top: 4px; }
.period-control, .period-range label { font-size: 13px; font-weight: 700; color: var(--muted); }
.period-control select, .period-range input { display: block; min-height: 46px; padding: 8px 12px; margin-top: 5px; border: 1px solid var(--line); border-radius: 10px; color: var(--ink); background: var(--sheet); font-size: 16px; }
.period-range { max-width: 410px; margin: 0 0 15px auto; }
.period-range input { width: 100%; min-width: 0; }
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin: 0 0 26px; }
.kpis div { border: 1px solid var(--line); border-radius: 14px; padding: 16px; background: var(--sheet); min-width: 0; }
.kpis div:first-child { border-color: #e1c799; background: #f5e8d2; }
.kpis dt { font-size: 13px; font-weight: 700; color: var(--muted); }
.kpis dd { margin: 7px 0 0; font: bold clamp(19px, 3vw, 30px)/1.12 Georgia, serif; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.analytics-ranking h3 { font: bold 24px Georgia, serif; margin: 0 0 5px; }
.analytics-ranking > p { font-size: 13px; color: var(--muted); margin: 0 0 12px; }
.ranking { width: 100%; border-collapse: collapse; }
.ranking th, .ranking td { padding: 12px 15px; text-align: left; }
.ranking thead { background: #f4ecdf; color: #6a5340; font-size: 12px; }
.ranking td { border-top: 1px solid var(--line); overflow-wrap: anywhere; }
.ranking .amount { text-align: right; }
.ranking td.amount { font-weight: 750; }
.ranking td:first-child { width: 47px; color: var(--gold-dark); font-weight: 750; }
.ranking small { display: block; font-size: 12px; color: var(--muted); margin-top: 3px; }
@media (max-width: 650px) {
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 490px) {
  .analytics-head { align-items: stretch; }
  .period-control select { width: 100%; }
  .ranking th, .ranking td { padding: 10px 8px; }
  .ranking td:first-child { width: 27px; }
}

.revenue-chart { padding: 15px 17px; margin-bottom: 15px; border: 1px solid var(--line); border-radius: 14px; background: var(--sheet); }
.revenue-chart h3 { margin: 0 0 4px; font: bold 23px Georgia, serif; }
.revenue-chart > p { color: var(--muted); font-size: 13px; }
.revenue-axes { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 8px; margin: 10px 0 7px; }
.revenue-scale, .revenue-ticks { font-size: 11px; font-variant-numeric: tabular-nums; color: var(--muted); }
.revenue-scale { height: 124px; display: flex; flex-direction: column; justify-content: space-between; align-items: end; white-space: nowrap; }
.revenue-plot svg { display: block; width: 100%; height: 124px; overflow: visible; }
.revenue-grid { stroke: var(--line); vector-effect: non-scaling-stroke; }
.revenue-area { fill: #f4e4ca; }
.revenue-line { fill: none; stroke: var(--gold-dark); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.revenue-ticks { display: flex; justify-content: space-between; gap: 4px; }
.revenue-ticks span:only-child { margin: auto; }
.revenue-values { font-size: 13px; color: var(--muted); }
.revenue-values summary { cursor: pointer; padding: 6px 0; }
.revenue-values dl { display: grid; grid-template-columns: repeat(auto-fit, minmax(145px, 1fr)); gap: 3px 16px; margin: 4px 0 0; }
.revenue-values dl > div { display: flex; justify-content: space-between; gap: 8px; border-top: 1px solid var(--line); padding: 5px 0; }
.revenue-values dd { margin: 0; color: var(--ink); font-weight: 650; white-space: nowrap; }
