:root {
  --bg: #F4F3F1; --card: #FFFFFF; --ink: #141414; --muted: #6B6863; --line: #E4E1DC;
  --red: #C11F1F; --red-ink: #A01818; --red-soft: #FBEAEA; --top: #0B0B0B;
  --field: #FFFFFF; --hover: #F1EFEC; --shadow: 0 1px 2px rgba(0,0,0,.05), 0 2px 8px rgba(0,0,0,.04);
  --r: 14px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #101010; --card: #1A1A1A; --ink: #F1EFEC; --muted: #9C988F; --line: #2C2B29;
    --red: #E03A3A; --red-ink: #FF6B6B; --red-soft: #3A1717; --field: #141414; --hover: #232221;
    --shadow: none; color-scheme: dark;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink);
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
a { color: var(--red-ink); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 1.6rem; line-height: 1.2; margin: 0; letter-spacing: -.01em; }
h2 { font-size: 1.05rem; margin: 0 0 .6rem; }
h3 { margin: 0; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.sr { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; padding: 0; }
.ic { width: 20px; height: 20px; flex: none; }

/* top bar */
.top { position: sticky; top: 0; z-index: 20; background: var(--top); color: #fff;
  display: flex; align-items: center; gap: 16px; padding: 10px max(16px, env(safe-area-inset-left));
  padding-top: max(10px, env(safe-area-inset-top)); }
.brand { display: flex; align-items: center; gap: 10px; color: #fff; font-weight: 700; letter-spacing: .02em; }
.brand:hover { text-decoration: none; }
.logo { width: 46px; height: auto; display: block; }
.tabs { display: flex; gap: 4px; margin-left: 12px; flex: 1; }
.tabs a { display: flex; align-items: center; gap: 8px; color: #CFCBC4; padding: 8px 12px; border-radius: 10px; font-weight: 500; }
.tabs a:hover { background: #1F1F1F; color: #fff; text-decoration: none; }
.tabs a.on { background: #1F1F1F; color: #fff; box-shadow: inset 0 -2px 0 var(--red); }
.acct { color: #CFCBC4; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; margin-left: auto; }
.acct:hover { background: #1F1F1F; color: #fff; }

.wrap { max-width: 1120px; margin: 0 auto; padding: 22px 16px 40px; }

/* mobile: bottom tab bar */
@media (max-width: 760px) {
  .top { padding-bottom: 10px; }
  .brand span { display: none; }
  .tabs { position: fixed; left: 0; right: 0; bottom: 0; margin: 0; background: var(--top); border-top: 1px solid #222;
    justify-content: space-around; padding: 6px 4px max(6px, env(safe-area-inset-bottom)); z-index: 30; }
  .tabs a { flex-direction: column; gap: 2px; font-size: .7rem; padding: 6px 8px; flex: 1; text-align: center; }
  .tabs a.on { box-shadow: none; color: #fff; background: transparent; }
  .tabs a.on .ic { color: var(--red); color: #FF5A5A; }
  .wrap { padding-bottom: 96px; }
  .hide-sm { display: none; }
  h1 { font-size: 1.4rem; }
}
.show-touch { display: none; }
@media (hover: none) and (pointer: coarse) { .show-touch { display: block; } .hide-touch { display: none; } }

/* building blocks */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 16px; box-shadow: var(--shadow); }
.card + .card { margin-top: 16px; }
.stack { display: flex; flex-direction: column; gap: 14px; }
.stack > .card + .card { margin-top: 0; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.row3 { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 10px; }
.grid2 { display: grid; grid-template-columns: minmax(0,1.2fr) minmax(0,1fr); gap: 16px; align-items: start; }
@media (max-width: 860px) { .grid2 { grid-template-columns: minmax(0,1fr); } }
.grid2 > *, .cal-layout > *, .stack > * { min-width: 0; }
.narrow { max-width: 620px; }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.sec-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.sec-head a { font-size: .875rem; font-weight: 600; }
.empty { color: var(--muted); margin: .25rem 0; }
.empty-big { text-align: center; padding: 40px 16px; color: var(--muted); }
.empty-big .btn { margin-top: 8px; }

label { display: flex; flex-direction: column; gap: 6px; font-weight: 600; font-size: .9rem; }
label.check { flex-direction: row; align-items: center; gap: 8px; font-weight: 500; }
input, select, textarea { font: inherit; color: var(--ink); background: var(--field); border: 1px solid var(--line);
  border-radius: 10px; padding: 10px 12px; width: 100%; min-height: 44px; font-weight: 400; }
textarea { resize: vertical; }
input[type=checkbox], input[type=radio] { width: 18px; height: 18px; min-height: 0; accent-color: var(--red); }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--red); outline-offset: 0; border-color: transparent; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; font: inherit; font-weight: 600;
  font-size: .925rem; color: var(--ink); background: var(--card); border: 1px solid var(--line); border-radius: 10px;
  padding: 8px 14px; min-height: 40px; cursor: pointer; white-space: nowrap; }
.btn:hover { background: var(--hover); text-decoration: none; }
.btn .ic { width: 18px; height: 18px; }
.btn.primary { background: var(--red); border-color: var(--red); color: #fff; }
.btn.primary:hover { background: #A51A1A; }
.btn.big { min-height: 48px; padding: 10px 22px; font-size: 1rem; }
.btn.sm { min-height: 34px; padding: 5px 10px; font-size: .85rem; }
.btn.ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn.ghost:hover { background: var(--hover); color: var(--ink); }
.btn.ghost.on { color: var(--red); }
.btn.icon { padding: 8px; width: 40px; }
.btn.danger { color: var(--red-ink); border-color: var(--line); background: transparent; }
.btn.danger:hover { background: var(--red-soft); }
.danger-zone { margin-top: 14px; }
.tag { display: inline-block; font-size: .72rem; font-weight: 600; color: var(--muted); border: 1px solid var(--line); border-radius: 99px; padding: 0 8px; margin-top: 2px; align-self: flex-start; }

.flash { padding: 10px 14px; border-radius: 10px; margin-bottom: 14px; font-weight: 500; border: 1px solid; }
.flash.ok { background: #EAF6EE; border-color: #BFE3CB; color: #155D2D; }
.flash.error { background: var(--red-soft); border-color: #F0C2C2; color: var(--red-ink); }
@media (prefers-color-scheme: dark) { .flash.ok { background: #13281A; border-color: #22442C; color: #8FDCA6; } .flash.error { border-color: #5A2222; } }

/* login */
.login { max-width: 400px; margin: 6vh auto 0; text-align: center; }
.login .card { text-align: left; margin-top: 20px; }
.login-brand { background: var(--top); width: 92px; height: 92px; border-radius: 22px; display: grid; place-items: center; margin: 0 auto 18px; }
.login-brand .logo { width: 64px; }
.login .muted { margin: 6px 0 0; }
.foot { margin-top: 22px; font-size: .875rem; }

/* home */
.hello { margin-bottom: 14px; }
.hello p { margin: 4px 0 0; }
.quick { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 16px; }
.qbtn { display: flex; align-items: center; gap: 10px; background: var(--card); border: 1px solid var(--line); border-radius: var(--r);
  padding: 14px; color: var(--ink); font-weight: 600; box-shadow: var(--shadow); }
.qbtn .ic { color: var(--red); width: 22px; height: 22px; }
.qbtn:hover { text-decoration: none; background: var(--hover); }
@media (max-width: 560px) { .quick { gap: 8px; } .qbtn { flex-direction: column; text-align: center; font-size: .8rem; gap: 6px; padding: 12px 6px; } }

/* events */
.dayhead { font-size: .8rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin: 14px 0 6px; }
.dayhead:first-of-type { margin-top: 4px; }
.dayhead.is-today { color: var(--red-ink); }
.ev { display: flex; gap: 12px; align-items: flex-start; padding: 10px 10px 10px 12px; border-radius: 10px; color: var(--ink);
  border-left: 4px solid var(--c); background: var(--hover); margin-bottom: 6px; }
.ev:hover { text-decoration: none; filter: brightness(.98); }
.ev-time { display: flex; flex-direction: column; min-width: 50px; font-weight: 700; font-variant-numeric: tabular-nums; font-size: .95rem; }
.ev-time small { font-weight: 500; color: var(--muted); font-size: .78rem; }
.ev-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.ev-main strong { font-weight: 600; overflow-wrap: anywhere; }
.ev-loc { display: flex; gap: 4px; align-items: center; color: var(--muted); font-size: .85rem; }
.ev-loc .ic { width: 14px; height: 14px; }

/* calendar */
.month { text-transform: none; }
.cal-layout { display: grid; grid-template-columns: minmax(0,1.6fr) minmax(0,1fr); gap: 16px; align-items: start; }
@media (max-width: 980px) { .cal-layout { grid-template-columns: minmax(0,1fr); } }
.cal { padding: 10px; }
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.cal-dow span { text-align: center; font-size: .75rem; font-weight: 700; color: var(--muted); padding: 4px 0 6px; text-transform: uppercase; }
.cell { min-height: 96px; border-radius: 8px; padding: 6px; color: var(--ink); display: flex; flex-direction: column; gap: 3px; border: 1px solid transparent; min-width: 0; }
.cell:hover { background: var(--hover); text-decoration: none; }
.cell.out { color: var(--muted); opacity: .55; }
.cell .num { font-size: .85rem; font-weight: 600; width: 26px; height: 26px; display: grid; place-items: center; border-radius: 50%; }
.cell.today .num { background: var(--red); color: #fff; }
.cell.sel { border-color: var(--red); background: var(--red-soft); }
.cell-evs { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.chip { font-size: .72rem; line-height: 1.3; padding: 1px 5px; border-radius: 4px; background: color-mix(in srgb, var(--c) 16%, transparent);
  border-left: 3px solid var(--c); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chip b { font-weight: 700; }
.more { font-size: .7rem; color: var(--muted); padding-left: 4px; }
.dots { display: none; gap: 3px; justify-content: center; }
.dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--c); }
@media (max-width: 640px) {
  .cell { min-height: 52px; align-items: center; padding: 4px 2px; }
  .cell-evs { display: none; }
  .dots { display: flex; }
}

.colors { border: 0; padding: 0; margin: 0; display: flex; gap: 10px; flex-wrap: wrap; }
.colors legend { font-weight: 600; font-size: .9rem; margin-bottom: 6px; padding: 0; }
.swatch { position: relative; }
.swatch input { position: absolute; opacity: 0; }
.swatch span { display: block; width: 34px; height: 34px; border-radius: 50%; background: var(--c); border: 3px solid var(--card); box-shadow: 0 0 0 1px var(--line); cursor: pointer; }
.swatch input:checked + span { box-shadow: 0 0 0 2px var(--ink); }
.swatch input:focus-visible + span { outline: 2px solid var(--red); outline-offset: 3px; }
@media (max-width: 520px) { .row3 { grid-template-columns: 1fr 1fr; } .row3 label:first-child { grid-column: 1 / -1; } }

/* notes */
.searchbar { display: flex; align-items: center; gap: 8px; background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 0 12px; margin-bottom: 16px; }
.searchbar .ic { color: var(--muted); }
.searchbar input { border: 0; background: transparent; padding-left: 0; }
.searchbar input:focus { outline: none; }
.searchbar:focus-within { outline: 2px solid var(--red); }
.notes-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.note-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); display: flex; flex-direction: column; box-shadow: var(--shadow); }
.note-card.pinned { border-top: 3px solid var(--red); }
.note-link { color: var(--ink); padding: 14px 14px 6px; flex: 1; }
.note-link:hover { text-decoration: none; }
.note-link h2 { margin-bottom: 4px; overflow-wrap: anywhere; }
.note-link p { margin: 0; color: var(--muted); font-size: .9rem; white-space: pre-line; overflow-wrap: anywhere; max-height: 9em; overflow: hidden; }
.note-card footer { display: flex; justify-content: space-between; align-items: center; padding: 4px 8px 8px 14px; }
.nline { display: flex; gap: 8px; align-items: flex-start; padding: 8px; margin: 0 -8px; border-radius: 8px; color: var(--ink); }
.nline:hover { background: var(--hover); text-decoration: none; }
.nline .pin { color: var(--red); }
.nline .pin .ic { width: 16px; height: 16px; margin-top: 3px; }
.nl-main { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.nl-main strong { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nl-main small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.note-editor { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 16px; display: flex; flex-direction: column; gap: 12px; box-shadow: var(--shadow); }
.note-title { font-size: 1.35rem; font-weight: 700; border: 0; padding: 4px 0; background: transparent; }
.note-body { min-height: 55vh; border: 0; padding: 4px 0; background: transparent; line-height: 1.6; resize: none; }
.note-title:focus, .note-body:focus { outline: none; }

/* files */
.drop { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; text-align: center;
  border: 2px dashed var(--line); border-radius: 12px; padding: 30px 16px; cursor: pointer; font-weight: 400; transition: .15s; }
.drop:hover, .drop.over { border-color: var(--red); background: var(--red-soft); }
.drop .ic { width: 34px; height: 34px; color: var(--red); }
.drop input { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; height: 100%; }
.uploads:empty { display: none; }
.uploads { margin-top: 12px; display: flex; flex-direction: column; gap: 8px; }
.up { display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; font-size: .875rem; }
.up .bar { grid-column: 1 / -1; height: 6px; background: var(--hover); border-radius: 99px; overflow: hidden; }
.up .bar i { display: block; height: 100%; width: 0; background: var(--red); transition: width .2s; }
.up.done .bar i { background: #15803D; }
.up.err { color: var(--red-ink); }
.up .name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.flist { list-style: none; margin: 0; padding: 0; }
.fitem { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); }
.fitem:first-child { border-top: 0; }
.fsel { display: none; }
.selecting .fsel { display: flex; }
.fthumb { width: 52px; height: 52px; border-radius: 10px; background: var(--hover); display: grid; place-items: center; overflow: hidden; flex: none;
  font-size: .7rem; font-weight: 800; color: var(--muted); letter-spacing: .03em; }
.fthumb img { width: 100%; height: 100%; object-fit: cover; }
.fthumb.kind-pdf span { color: var(--red-ink); }
.finfo { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.fname { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.factions { display: flex; gap: 2px; }
.bulkbar { display: none; align-items: center; justify-content: space-between; padding: 8px 10px; background: var(--hover); border-radius: 10px; margin-bottom: 6px; font-size: .9rem; font-weight: 600; }
.selecting .bulkbar { display: flex; }
.fline { display: flex; gap: 8px; align-items: center; padding: 8px; margin: 0 -8px; border-radius: 8px; color: var(--ink); }
.fline:hover { background: var(--hover); text-decoration: none; }
.fline .ic { color: var(--muted); width: 18px; height: 18px; }
.fline .fname { flex: 1; font-weight: 500; }
.fline small { color: var(--muted); }

/* quick text */
.clip-form { display: flex; gap: 8px; align-items: stretch; margin: 8px 0 12px; }
.clip-form textarea { min-height: 44px; }
.clip { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; margin-top: 8px; }
.clip-text { white-space: pre-wrap; overflow-wrap: anywhere; max-height: 12em; overflow: auto; font-size: .95rem; }
.clip-bar { display: flex; align-items: center; gap: 4px; margin-top: 6px; }
.clip-bar small { margin-right: auto; }
.clip-bar form { margin: 0; }
.share-out { display: flex; gap: 8px; }
.share-out input { font-size: .85rem; }
.howto p { font-size: .875rem; margin: .5rem 0; font-weight: 400; }
.howto summary { cursor: pointer; font-weight: 600; font-size: .9rem; }

dialog.dlg { border: 1px solid var(--line); border-radius: var(--r); background: var(--card); color: var(--ink); padding: 20px; width: min(440px, calc(100vw - 32px)); }
dialog.dlg::backdrop { background: rgba(0,0,0,.45); }
dialog h2 { margin: 0; }

.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: #141414; color: #fff; padding: 10px 16px; border-radius: 10px; font-weight: 600; z-index: 50; font-size: .9rem; }
@media (max-width: 760px) { .toast { bottom: 90px; } }

/* work log */
.work-form { display: grid; grid-template-columns: 170px 1fr auto; gap: 10px; align-items: end; }
.work-form .btn { min-height: 44px; }
@media (max-width: 520px) { .work-form { grid-template-columns: 1fr 1fr; } .work-form .wf-client { grid-column: 1 / -1; grid-row: 1; } .work-form .btn { align-self: end; } }
.wtoday { display: flex; align-items: center; gap: 8px; padding: 8px 10px; background: var(--hover); border-radius: 10px; margin-bottom: 8px; border-left: 4px solid var(--red); }
.wtoday .ic { color: var(--red); width: 18px; height: 18px; }
.wday { display: grid; grid-template-columns: 120px 1fr; gap: 0 12px; padding: 10px 0; border-top: 1px solid var(--line); align-items: start; }
.wday:first-of-type { border-top: 0; }
.wday-head { grid-row: span 9; }
.wday > .witem + .witem { margin-top: 6px; }
.wday.is-today .wday-head strong { color: var(--red-ink); }
.wday > :not(.wday-head) { grid-column: 2; }
.witem summary { list-style: none; cursor: pointer; display: flex; align-items: baseline; gap: 4px; flex-wrap: wrap; }
.witem summary::-webkit-details-marker { display: none; }
.wclient { font-weight: 600; }
.wedit { margin-left: auto; font-size: .78rem; color: var(--muted); }
.witem[open] .wedit { visibility: hidden; }
.wedit-form { display: grid; gap: 8px; margin: 8px 0 4px; }
@media (max-width: 520px) { .wday { grid-template-columns: 1fr; } .wday > :not(.wday-head) { grid-column: 1; } .wday-head { grid-row: auto; } }
.report { font: 500 .95rem/1.6 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; background: var(--hover); resize: none; overflow: hidden; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.seg a { padding: 4px 12px; font-weight: 700; font-size: .8rem; color: var(--muted); }
.seg a.on { background: var(--ink); color: var(--card); }
.seg a:hover { text-decoration: none; }
@media (max-width: 760px) { .tabs a { padding: 6px 2px; font-size: .66rem; } }

/* expenses */
.flash.warn { background: #FFF6E5; border-color: #F3D9A4; color: #8A5A00; }
@media (prefers-color-scheme: dark) { .flash.warn { background: #2C2312; border-color: #5A4520; color: #F2C66D; } }
.quick { grid-template-columns: repeat(4, 1fr); }
.search-btn { margin-left: auto; }
.search-btn + .acct { margin-left: 0; }
.acct.on { background: #1F1F1F; color: #fff; }
.seg.big a { padding: 8px 14px; font-size: .875rem; }
.exp-form { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.exp-form .ef-desc, .exp-form .ef-client, .exp-form .ef-file, .exp-form .ef-save { grid-column: 1 / -1; }
@media (min-width: 1000px) { .exp-form .ef-amount { grid-column: 1; } .exp-form .ef-desc { grid-column: 2; } }
.money-in { display: flex; align-items: center; border: 1px solid var(--line); border-radius: 10px; background: var(--field); padding-left: 12px; }
.money-in b { color: var(--muted); font-size: 1.1rem; }
.money-in input { border: 0; font-size: 1.25rem; font-weight: 700; padding-left: 6px; background: transparent; }
.money-in:focus-within { outline: 2px solid var(--red); }
.money-in input:focus { outline: none; }
.ef-file { position: relative; }
.ef-file input { position: absolute; inset: 0; opacity: 0; width: 100%; height: 100%; cursor: pointer; }
.ef-btn { width: 100%; min-height: 48px; border-style: dashed; border-width: 2px; font-weight: 600; pointer-events: none; }
.ef-btn .ic { color: var(--red); }
.ef-file.has .ef-btn { border-style: solid; border-color: #15803D; color: #15803D; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.exp { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); }
.exp:first-of-type { border-top: 0; }
.exp-thumb { position: relative; width: 52px; height: 52px; border-radius: 10px; background: var(--hover); flex: none; display: grid; place-items: center; overflow: hidden; font-size: .68rem; font-weight: 800; color: var(--muted); text-align: center; line-height: 1.1; }
.exp-thumb img { width: 100%; height: 100%; object-fit: cover; }
.exp-thumb .norec { color: #B45309; }
.exp-thumb .cnt { position: absolute; right: 2px; bottom: 2px; background: #141414; color: #fff; font-style: normal; font-size: .65rem; border-radius: 6px; padding: 0 4px; }
.exp-main { flex: 1; min-width: 0; display: flex; flex-direction: column; color: var(--ink); }
.exp-main:hover { text-decoration: none; }
.exp-main strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.exp-main small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.exp-side { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.exp-side form { margin: 0; }
.amt { font-weight: 800; font-variant-numeric: tabular-nums; }
.pill { font: inherit; font-size: .7rem; font-weight: 700; border-radius: 99px; padding: 2px 9px; border: 1px solid; cursor: pointer; background: transparent; white-space: nowrap; }
.pill.due { color: #B45309; border-color: #F3D9A4; background: #FFF6E5; }
.pill.paid { color: #15803D; border-color: #BFE3CB; background: #EAF6EE; }
@media (prefers-color-scheme: dark) { .pill.due { background: #2C2312; border-color: #5A4520; color: #F2C66D; } .pill.paid { background: #13281A; border-color: #22442C; color: #8FDCA6; } }
.totals { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.totals div { display: flex; flex-direction: column; }
.totals strong { font-size: 1.6rem; font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.due-txt { color: #B45309; }
.cats { list-style: none; padding: 0; margin: 12px 0 0; border-top: 1px solid var(--line); }
.cats li { display: flex; justify-content: space-between; padding: 6px 0; font-size: .9rem; border-bottom: 1px solid var(--line); font-variant-numeric: tabular-nums; }
.rgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; }
.rcard { display: flex; flex-direction: column; gap: 4px; align-items: center; }
.rimg { width: 100%; aspect-ratio: 3/4; border-radius: 10px; overflow: hidden; background: var(--hover); display: grid; place-items: center; font-weight: 800; color: var(--muted); }
.rimg img { width: 100%; height: 100%; object-fit: cover; }
.howto .report { margin-top: 8px; }
@media (max-width: 560px) { .quick { grid-template-columns: repeat(2, 1fr); } .qbtn { flex-direction: row; text-align: left; font-size: .85rem; padding: 12px; } }

.exp-layout { display: grid; grid-template-columns: minmax(0,1.2fr) minmax(0,1fr); grid-template-areas: "new side" "list side"; gap: 16px; align-items: start; }
.exp-new { grid-area: new; } .exp-list { grid-area: list; } .exp-side-col { grid-area: side; }
.exp-layout > .card + .card { margin-top: 0; }
@media (max-width: 860px) { .exp-layout { grid-template-columns: minmax(0,1fr); grid-template-areas: "new" "side" "list"; } }

/* sub-tabs inside Trabalho */
.subtabs { display: flex; gap: 4px; background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 4px; margin-bottom: 18px; max-width: 420px; }
.subtabs a { flex: 1; display: flex; align-items: center; justify-content: center; gap: 8px; padding: 9px 10px; border-radius: 9px; color: var(--muted); font-weight: 600; font-size: .925rem; }
.subtabs a .ic { width: 18px; height: 18px; }
.subtabs a:hover { text-decoration: none; color: var(--ink); background: var(--hover); }
.subtabs a.on { background: var(--top); color: #fff; }
.subtabs a.on .ic { color: #FF5A5A; }
@media (max-width: 760px) { .subtabs { max-width: none; } }
.exp-mini { display: flex; align-items: center; gap: 12px; color: var(--ink); }
.exp-mini:hover { text-decoration: none; background: var(--hover); }
.exp-mini-ic { width: 40px; height: 40px; border-radius: 10px; background: var(--red-soft); color: var(--red); display: grid; place-items: center; flex: none; }
.exp-mini-txt { flex: 1; display: flex; flex-direction: column; min-width: 0; }
