/* MM Studio — internal dashboard. Style: MM Brand Studio proposal deck
   (ink / sun / bone, Big Shoulders Display + Instrument Sans + JetBrains Mono, blueprint grid, square edges) */
:root {
  --ink: #181818; --ink2: #262522; --ink3: #3A3833;
  --sun: #F5C518; --sun-soft: #FBE7A0;
  --bone: #F5F3ED; --bone2: #ECE8DD; --paper: #FFFFFF;
  --mute: #57534A; --mute2: #8A857A; --line: #D8D3C7;
  --red: #C8321E; --red-soft: #F8DCD6; --green: #1F7A3A; --green-soft: #DCEFE1; --blue: #2C5DA8; --blue-soft: #DCE6F5;
  --display: 'Big Shoulders Display', 'Oswald', 'Arial Narrow', sans-serif;
  --body: 'Instrument Sans', system-ui, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, monospace;
  --grid-cream: linear-gradient(rgba(24,24,24,.05) 1px, transparent 1px), linear-gradient(90deg, rgba(24,24,24,.05) 1px, transparent 1px);
  --grid-dark: linear-gradient(rgba(245,243,237,.035) 1px, transparent 1px), linear-gradient(90deg, rgba(245,243,237,.035) 1px, transparent 1px);
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bone); color: var(--ink); font-family: var(--body); font-size: 15px; }
body { background-image: var(--grid-cream); background-size: 48px 48px; min-height: 100vh; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .45; }
:focus-visible { outline: 2px solid var(--sun); outline-offset: 2px; }
h1, h2, h3 { font-family: var(--display); text-transform: uppercase; margin: 0; letter-spacing: .005em; }
h1 { font-weight: 900; font-size: clamp(40px, 5vw, 64px); line-height: .88; }
h2 { font-weight: 800; font-size: 28px; line-height: .95; }
h3 { font-weight: 800; font-size: 20px; line-height: 1; }
.boot { display: grid; place-items: center; min-height: 100vh; }

/* eyebrow / mono labels */
.eb { font-family: var(--mono); font-size: 11px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; color: var(--mute); display: inline-flex; align-items: center; gap: 10px; }
.eb b { background: var(--sun); color: var(--ink); padding: 3px 7px; letter-spacing: .1em; }
.lbl { font-family: var(--mono); font-size: 11px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--mute); }
.mono { font-family: var(--mono); }
.muted { color: var(--mute); }
.small { font-size: 13px; }
.num { font-family: var(--display); font-weight: 900; line-height: .9; }
.hl { box-shadow: inset 0 -.38em 0 var(--sun); }

/* ---------------------------------------------------------------- layout */
.shell { display: flex; min-height: 100vh; }
.nav { width: 236px; flex-shrink: 0; background: var(--ink); background-image: var(--grid-dark); background-size: 48px 48px; color: var(--bone); padding: 22px 14px; display: flex; flex-direction: column; gap: 4px; position: sticky; top: 0; height: 100vh; overflow-y: auto; z-index: 30; }
.brand { display: flex; align-items: center; gap: 12px; padding: 0 8px 22px; text-decoration: none; }
.brand svg { color: var(--sun); flex-shrink: 0; }
.brand .w { display: flex; flex-direction: column; gap: 3px; border-left: 1px solid var(--ink3); padding-left: 12px; }
.brand .w1 { font-family: var(--mono); font-weight: 700; font-size: 12px; letter-spacing: .18em; }
.brand .w2 { font-family: var(--mono); font-size: 10px; letter-spacing: .14em; color: var(--mute2); }
.nav a.item { display: flex; align-items: center; gap: 12px; min-height: 44px; padding: 0 12px; color: var(--bone); text-decoration: none; font-family: var(--mono); font-size: 12.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; border-left: 3px solid transparent; }
.nav a.item:hover { background: var(--ink2); border-left-color: var(--sun); }
.nav a.item.on { background: var(--sun); color: var(--ink); }
.nav a.item .badge { margin-left: auto; background: var(--sun); color: var(--ink); font-size: 11px; padding: 2px 7px; }
.nav a.item.on .badge { background: var(--ink); color: var(--sun); }
.nav .foot { margin-top: auto; padding: 14px 8px 0; border-top: 1px solid var(--ink3); display: flex; flex-direction: column; gap: 10px; }
.nav .me { display: flex; align-items: center; gap: 10px; }
.avatar { width: 34px; height: 34px; background: var(--ink3); color: var(--bone); display: grid; place-items: center; font-weight: 700; flex-shrink: 0; font-family: var(--mono); font-size: 13px; }
.avatar.sun { background: var(--sun); color: var(--ink); }
.nav .row { display: flex; gap: 6px; align-items: center; }
.nav .ghost { background: transparent; border: 1px solid var(--ink3); color: var(--bone); font-family: var(--mono); font-size: 11px; letter-spacing: .1em; text-transform: uppercase; min-height: 32px; padding: 0 10px; }
.nav .ghost.on { background: var(--bone); color: var(--ink); border-color: var(--bone); }
.nav .ghost:hover { border-color: var(--sun); }
.live { font-family: var(--mono); font-size: 10.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--mute2); display: flex; align-items: center; gap: 8px; }
.live i { width: 8px; height: 8px; background: var(--green); transform: rotate(45deg); display: inline-block; }
.live.off i { background: var(--red); animation: blink 1s infinite; }
@keyframes blink { 50% { opacity: .2; } }

.main { flex: 1; min-width: 0; padding: 28px 34px 60px; display: flex; flex-direction: column; gap: 22px; }
.top { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 14px; }
.top .title { display: flex; flex-direction: column; gap: 10px; margin-right: auto; }
.top .sub { color: var(--mute); font-size: 15px; }
.mobilebar { display: none; }

/* ---------------------------------------------------------------- cards */
.card { background: var(--paper); border: 1px solid var(--ink); padding: 18px 20px; display: flex; flex-direction: column; gap: 12px; transition: box-shadow .15s; min-width: 0; }
.card:hover { box-shadow: inset 0 4px 0 var(--sun); }
.card.flat:hover { box-shadow: none; }
.card .head { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.card .head .more { margin-left: auto; }
.grid { display: grid; gap: 16px; }
.g2 { grid-template-columns: repeat(auto-fit, minmax(380px, 1fr)); }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px; }
.kpi { background: var(--paper); border: 1px solid var(--ink); padding: 16px 18px; display: flex; flex-direction: column; gap: 8px; }
.kpi.hot { background: var(--sun); }
.kpi.dark { background: var(--ink); color: var(--bone); }
.kpi.dark .lbl { color: var(--mute2); }
.kpi .num { font-size: 50px; }
.kpi .note { font-size: 13px; font-weight: 600; }
.up { color: var(--green); } .down { color: var(--red); }
.kpi.hot .up, .kpi.hot .down { color: var(--ink); }
.empty { padding: 26px 10px; text-align: center; color: var(--mute); font-size: 14px; }
.empty .diamond { width: 10px; height: 10px; background: var(--sun); transform: rotate(45deg); display: inline-block; margin-right: 8px; }

/* ---------------------------------------------------------------- controls */
.btn { min-height: 42px; padding: 0 18px; border: 1.5px solid var(--ink); background: var(--paper); font-weight: 700; display: inline-flex; align-items: center; justify-content: center; gap: 8px; text-decoration: none; white-space: nowrap; }
.btn:hover:not(:disabled) { background: var(--bone2); }
.btn.sun { background: var(--sun); }
.btn.sun:hover:not(:disabled) { background: #E9B908; }
.btn.ink { background: var(--ink); color: var(--bone); }
.btn.ink:hover:not(:disabled) { background: var(--ink3); }
.btn.red { border-color: var(--red); color: var(--red); }
.btn.red:hover:not(:disabled) { background: var(--red-soft); }
.btn.sm { min-height: 34px; padding: 0 12px; font-size: 13.5px; }
.btn.xs { min-height: 28px; padding: 0 9px; font-size: 12.5px; border-width: 1px; }
.btn.block { width: 100%; }
.linkbtn { background: none; border: 0; padding: 0; font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }
.seg { display: inline-flex; border: 1.5px solid var(--ink); background: var(--paper); }
.seg button { min-height: 36px; padding: 0 13px; border: 0; background: transparent; font-weight: 600; font-size: 14px; border-right: 1px solid var(--line); }
.seg button:last-child { border-right: 0; }
.seg button.on { background: var(--ink); color: var(--bone); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { min-height: 38px; padding: 0 12px; border: 1px solid var(--line); background: var(--paper); font-weight: 600; font-size: 14px; display: inline-flex; align-items: center; gap: 6px; }
.chip:hover:not(:disabled) { border-color: var(--ink); }
.chip.on { background: var(--sun); border: 2px solid var(--ink); font-weight: 700; }
.chip.taken { text-decoration: line-through; color: var(--mute2); background: var(--bone); }
.chip .sub { font-family: var(--mono); font-size: 11px; color: var(--mute); }
.chip.on .sub { color: var(--ink); }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.input, .select, textarea.input { min-height: 42px; border: 1px solid var(--line); background: var(--paper); padding: 0 12px; width: 100%; outline: none; }
textarea.input { padding: 10px 12px; min-height: 80px; resize: vertical; }
.input:focus, .select:focus { border-color: var(--ink); box-shadow: inset 0 -3px 0 var(--sun); }
.input.money { font-family: var(--mono); }
.search { display: flex; align-items: center; gap: 8px; background: var(--paper); border: 1px solid var(--line); padding: 0 12px; min-height: 42px; min-width: 240px; }
.search input { border: 0; outline: none; background: transparent; flex: 1; min-width: 0; }
.form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 14px; }
.form .wide { grid-column: 1 / -1; }
.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.check { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; font-size: 14px; cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--ink); }

/* pills */
.pill { display: inline-flex; align-items: center; gap: 6px; font-family: var(--mono); font-size: 10.5px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; padding: 4px 8px; border: 1px solid var(--ink); white-space: nowrap; background: var(--paper); }
.pill i { width: 7px; height: 7px; transform: rotate(45deg); display: inline-block; background: currentColor; }
.pill.Lead { background: var(--blue-soft); } .pill.Scheduled { background: var(--paper); } .pill.In.Progress, .pill.InProgress { background: var(--sun); }
.pill.Completed { background: var(--green-soft); } .pill.Cancelled { background: var(--bone2); color: var(--mute); border-color: var(--mute2); }
.pill.paid { background: var(--green-soft); border-color: var(--green); color: var(--green); }
.pill.unpaid { background: var(--red-soft); border-color: var(--red); color: var(--red); }
.pill.stage-new { background: var(--sun); } .pill.stage-no_answer { background: var(--red-soft); } .pill.stage-contacted { background: var(--blue-soft); }
.pill.stage-fake, .pill.stage-lost { background: var(--bone2); color: var(--mute); }

/* checks & bullets from the deck */
.yes { width: 14px; height: 12px; background: var(--green); clip-path: polygon(0 50%,40% 100%,100% 0,100% 22%,40% 78%,0 32%); display: inline-block; }
.dia { width: 8px; height: 8px; background: var(--sun); transform: rotate(45deg); display: inline-block; flex-shrink: 0; }

/* ---------------------------------------------------------------- tables */
.table { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.table th { text-align: left; font-family: var(--mono); font-size: 10.5px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--mute); padding: 8px 10px; border-bottom: 1.5px solid var(--ink); white-space: nowrap; }
.table td { padding: 11px 10px; border-bottom: 1px solid var(--bone2); vertical-align: middle; }
.table tr.click { cursor: pointer; }
.table tr.click:hover td { background: #FFFBEA; }
.table .r { text-align: right; } .table .c { text-align: center; }
.table tfoot td { font-weight: 700; border-top: 1.5px solid var(--ink); border-bottom: 0; }
.scrollx { overflow-x: auto; }

/* ---------------------------------------------------------------- banners */
.banner { display: flex; align-items: flex-start; gap: 12px; padding: 13px 16px; border: 1.5px solid var(--ink); background: var(--paper); }
.banner.red { border-color: var(--red); background: var(--red-soft); }
.banner.sun { background: var(--sun); }
.banner .x { margin-left: auto; background: none; border: 0; font-size: 20px; line-height: 1; padding: 0 4px; }
.banner .body { display: flex; flex-direction: column; gap: 8px; flex: 1; min-width: 0; }

/* ---------------------------------------------------------------- drawer & modal */
.scrim { position: fixed; inset: 0; background: rgba(24,24,24,.42); z-index: 40; animation: fade .15s; }
@keyframes fade { from { opacity: 0; } }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(520px, 100vw); background: var(--paper); border-left: 1.5px solid var(--ink); z-index: 41; display: flex; flex-direction: column; animation: slide .18s ease-out; }
@keyframes slide { from { transform: translateX(30px); opacity: 0; } }
.drawer-head { padding: 18px 22px 14px; border-bottom: 1px solid var(--bone2); display: flex; gap: 10px; align-items: flex-start; background: var(--bone); background-image: var(--grid-cream); background-size: 48px 48px; }
.drawer-head .t { display: flex; flex-direction: column; gap: 8px; flex: 1; min-width: 0; }
.drawer-head h2 { font-size: 34px; overflow-wrap: anywhere; }
.iconbtn { width: 40px; height: 40px; border: 1.5px solid var(--ink); background: var(--paper); display: grid; place-items: center; flex-shrink: 0; }
.iconbtn:hover { background: var(--sun); }
.drawer-body { flex: 1; overflow-y: auto; padding: 18px 22px 30px; display: flex; flex-direction: column; gap: 20px; }
.drawer-foot { border-top: 1px solid var(--bone2); padding: 12px 22px; display: flex; gap: 8px; flex-wrap: wrap; background: var(--paper); }
.sec { display: flex; flex-direction: column; gap: 12px; }
.sec + .sec { border-top: 1px solid var(--bone2); padding-top: 18px; }
.sec-h { display: flex; align-items: center; gap: 10px; }
.sec-h h3 { margin-right: auto; }
.contact { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.kv { display: grid; grid-template-columns: 112px minmax(0, 1fr); gap: 9px 12px; font-size: 14.5px; }
.kv dt { font-family: var(--mono); font-size: 10.5px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--mute); padding-top: 3px; }
.kv dd { margin: 0; overflow-wrap: anywhere; }
.money-lines { display: flex; flex-direction: column; font-size: 14.5px; }
.money-lines div { display: flex; justify-content: space-between; padding: 7px 0; border-bottom: 1px dashed var(--bone2); }
.money-lines div.total { border-bottom: 0; border-top: 1.5px solid var(--ink); font-weight: 700; font-size: 16px; }
.money-lines span:last-child { font-family: var(--mono); }
.notes { white-space: pre-line; background: var(--bone); padding: 10px 12px; font-size: 14px; border-left: 3px solid var(--sun); }
.modal { position: fixed; z-index: 51; top: 50%; left: 50%; transform: translate(-50%, -50%); width: min(640px, calc(100vw - 24px)); max-height: calc(100vh - 40px); overflow-y: auto; background: var(--paper); border: 1.5px solid var(--ink); box-shadow: 10px 10px 0 var(--ink); display: flex; flex-direction: column; }
.modal .drawer-head { position: sticky; top: 0; z-index: 1; }
.scrim.top { z-index: 50; }

/* toasts */
.toasts { position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%); z-index: 60; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast { background: var(--ink); color: var(--bone); padding: 11px 16px; font-weight: 600; font-size: 14px; border-left: 4px solid var(--sun); box-shadow: 4px 4px 0 rgba(24,24,24,.25); animation: fade .2s; pointer-events: auto; max-width: 90vw; }
.toast.err { border-left-color: var(--red); }

/* login */
.login { min-height: 100vh; display: grid; place-items: center; padding: 20px; background: var(--ink); background-image: var(--grid-dark); background-size: 48px 48px; color: var(--bone); }
.login-card { max-width: 520px; display: flex; flex-direction: column; gap: 22px; }
.login-card h1 { font-size: clamp(48px, 9vw, 84px); }
.login-card h1 .s { color: var(--sun); }
.login-card p { font-size: 17px; line-height: 1.5; color: #CFCabd; margin: 0; }
.login-card ol { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 12px; counter-reset: s; }
.login-card li { display: flex; gap: 14px; align-items: center; font-size: 16px; counter-increment: s; }
.login-card li::before { content: counter(s, decimal-leading-zero); font-family: var(--display); font-weight: 900; font-size: 34px; color: transparent; -webkit-text-stroke: 1.2px var(--sun); width: 44px; }
.login-card code { font-family: var(--mono); background: var(--sun); color: var(--ink); padding: 2px 7px; font-weight: 700; }

/* ---------------------------------------------------------------- responsive */
@media (max-width: 1100px) {
  .sched-wrap { grid-template-columns: 1fr; }
  .tray { position: static; max-height: 360px; }
}
@media (max-width: 860px) {
  .bars { gap: 4px; } .bars .v { font-size: 8.5px; } .bars .k { font-size: 9px; }
  .nav { position: fixed; left: 0; transform: translateX(-100%); transition: transform .2s; }
  .nav.open { transform: none; box-shadow: 0 0 0 100vmax rgba(24,24,24,.4); }
  .mobilebar { display: flex; align-items: center; gap: 12px; padding: 12px 16px; background: var(--ink); color: var(--bone); position: sticky; top: 0; z-index: 25; }
  .mobilebar svg { color: var(--sun); }
  .shell { flex-direction: column; }
  .main { padding: 18px 16px 60px; }
  .g2 { grid-template-columns: 1fr; }
  .form { grid-template-columns: 1fr; }
  .search { min-width: 0; flex: 1; }
  .kpi .num { font-size: 40px; }
}

/* ================================================================ MM Studio additions */
.legend { display: flex; flex-wrap: wrap; gap: 16px; font-size: 13px; color: var(--mute); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 14px; height: 14px; display: inline-block; border: 1px solid var(--ink); }
.meter { height: 10px; background: var(--bone2); position: relative; min-width: 60px; }
.meter > i { position: absolute; left: 0; top: 0; bottom: 0; background: var(--ink); }
.meter.sun > i { background: var(--sun); border-right: 2px solid var(--ink); }
.g3 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.nowrap { white-space: nowrap; }
.r { text-align: right; }
.lnk { text-decoration: none; border-bottom: 1px solid var(--line); }
.lnk:hover { border-bottom-color: var(--ink); }

/* period */
.period { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.period .range { display: inline-flex; gap: 8px; align-items: center; }
.input.sm, .select.sm { min-height: 34px; padding: 0 10px; font-size: 14px; }
.select.auto { width: auto; max-width: 220px; min-height: 42px; }
.input.r { text-align: right; }

/* kpis */
.kpi.click { cursor: pointer; }
.kpi.click:hover { box-shadow: inset 0 -4px 0 var(--sun); }
.kpi.dark.click:hover { box-shadow: inset 0 -4px 0 var(--sun); }
.kpi.neg { background: var(--red-soft); border-color: var(--red); }
.kpis.k2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.kpis.k2 .num { font-size: 38px; }

/* forms */
.field .hint { font-size: 12.5px; color: var(--mute); }
.field .ferr { font-size: 12.5px; color: var(--red); font-weight: 600; }
.field.bad .input, .field.bad .select { border-color: var(--red); }
.moneyin { display: flex; flex-direction: column; gap: 4px; }
.btn.armed { background: var(--red); color: #fff; }
.btn.armed:hover:not(:disabled) { background: #A82814; }
.cb { width: 18px; height: 18px; accent-color: var(--ink); }

/* client combobox */
.combo { position: relative; }
.combo-in { position: relative; display: flex; align-items: center; }
.combo-in .tag { position: absolute; right: 8px; pointer-events: none; }
.combo-list { position: absolute; z-index: 60; left: 0; right: 0; top: calc(100% + 2px); background: var(--paper); border: 1.5px solid var(--ink); box-shadow: 6px 6px 0 rgba(24,24,24,.18); max-height: 300px; overflow-y: auto; }
.combo-opt { display: flex; justify-content: space-between; gap: 10px; width: 100%; text-align: left; padding: 10px 12px; background: none; border: 0; border-bottom: 1px solid var(--bone2); font-size: 14.5px; }
.combo-opt:last-child { border-bottom: 0; }
.combo-opt.hi, .combo-opt:hover { background: var(--sun-soft); }
.combo-opt .sub { font-family: var(--mono); font-size: 11px; color: var(--mute); white-space: nowrap; }
.combo-opt i { color: var(--mute); }

/* month bars */
.mbars { display: flex; align-items: flex-end; gap: 8px; height: 200px; padding-top: 20px; }
.mcol { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; justify-content: flex-end; min-width: 0; }
.mcol .pair { flex: 1; width: 100%; display: flex; align-items: flex-end; justify-content: center; gap: 2px; }
.mcol .pair i { width: 42%; max-width: 18px; min-height: 1px; display: block; }
.mcol .pair i.inc { background: var(--ink); }
.mcol .pair i.exp { background: var(--sun); border: 1px solid var(--ink); border-bottom: 0; }
.mcol.cur .k { background: var(--ink); color: var(--sun); padding: 0 4px; }
.mcol .v { font-family: var(--mono); font-size: 10px; font-weight: 700; white-space: nowrap; min-height: 12px; }
.mcol .k { font-family: var(--mono); font-size: 10.5px; color: var(--mute); white-space: nowrap; }

/* meter lists */
.mlist { display: flex; flex-direction: column; gap: 2px; }
.mrow { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(60px, 1fr) auto; gap: 10px; align-items: center; padding: 6px 0; border-bottom: 1px dashed var(--bone2); font-size: 14px; }
.mrow:last-child { border-bottom: 0; }
.mrow.click { cursor: pointer; }
.mrow.click:hover { background: #FFFBEA; }
.mrow .k { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mrow .v { font-family: var(--mono); font-weight: 700; font-size: 13px; text-align: right; white-space: nowrap; }
.mrow .v small { color: var(--mute); font-weight: 500; }

/* settlement */
.settle-line { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; padding: 8px 0; }
.settle-line span { font-weight: 700; font-size: 16px; }
.settle-line .num { font-size: 36px; margin-right: auto; }
.even { display: flex; align-items: center; gap: 10px; font-weight: 700; padding: 8px 0; }
.banner .big { font-size: 20px; }
.card.person.company { background: var(--bone); }

/* pills */
.pill.k-income { background: var(--green-soft); border-color: var(--green); color: var(--green); }
.pill.k-expense { background: var(--red-soft); border-color: var(--red); color: var(--red); }
.pill.k-transfer { background: var(--blue-soft); border-color: var(--blue); color: var(--blue); }
.pill.s-active { background: var(--green-soft); }
.pill.s-paused { background: var(--sun-soft); }
.pill.s-cancelled { background: var(--bone2); color: var(--mute); border-color: var(--mute2); }
.tag.red { background: var(--red); color: #fff; }
.st-paused { color: var(--mute); } .st-cancelled { color: var(--red); }

/* tables */
.table th.sortable { cursor: pointer; user-select: none; }
.table th.sortable.on { color: var(--ink); }
.table td.note-cell { max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.table tr.duerow td { background: #FFF6E0; }
.table.compact td { padding: 8px 6px; }
.table.edit td { padding: 4px 4px; border-bottom: 0; }
.subline { display: flex; align-items: center; gap: 8px; padding: 8px 0; border-bottom: 1px dashed var(--bone2); }
.subline .t { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; }
.duecard { border-color: var(--sun); box-shadow: inset 6px 0 0 var(--sun); }

/* nav quick add */
.nav .quick { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; padding: 0 4px 14px; }
.nav .quick .btn:not(.sun) { background: transparent; color: var(--bone); border-color: var(--ink3); }
.nav .quick .btn:not(.sun):hover { border-color: var(--sun); background: var(--ink2); }
.banner.sticky { position: sticky; top: 8px; z-index: 20; align-items: center; }

@media (max-width: 860px) {
  .mbars { gap: 3px; } .mcol .v { font-size: 8px; } .mcol .k { font-size: 9px; }
  .select.auto { max-width: none; flex: 1 1 140px; }
  .period .seg { flex-wrap: wrap; }
  .table td.note-cell { display: none; }
}
.totals { display: inline-flex; gap: 14px; flex-wrap: wrap; justify-content: flex-end; }
td .tag { margin-left: 6px; }
.mbars { overflow: hidden; }
.card { overflow-wrap: anywhere; }
@media (max-width: 860px) { .settle-line .num { font-size: 28px; } .kpis.k2 .num { font-size: 30px; } }

.steps { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 10px; font-size: 14.5px; }
.codeline { display: flex; gap: 8px; align-items: center; margin-top: 6px; flex-wrap: wrap; }
.codeline code { font-family: var(--mono); background: var(--bone); padding: 6px 8px; font-size: 13px; overflow-wrap: anywhere; }
pre.code { background: var(--ink); color: var(--bone); padding: 14px; font-family: var(--mono); font-size: 12px; overflow-x: auto; white-space: pre; max-height: 320px; margin: 0; }
