:root {
  --bg: #f5f5f7; --surface: #ffffff; --surface-2: #fafafa; --text: #1d1d1f; --text-2: #6e6e73; --text-3: #8e8e93;
  --line: #e5e5ea; --line-2: #d2d2d7; --accent: #2f5f8f; --accent-soft: #e8eef5; --accent-text: #ffffff;
  --green: #3a7d5c; --green-soft: #e7f2ec; --amber: #9a6a1f; --amber-soft: #f8efe0; --red: #a8433f; --red-soft: #f7e6e5;
  --grey-soft: #f0f0f2; --shadow: 0 1px 2px rgba(0,0,0,.04), 0 4px 16px rgba(0,0,0,.04); --radius: 14px;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Inter, Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #111113; --surface: #1c1c1e; --surface-2: #232326; --text: #f5f5f7; --text-2: #a1a1a6; --text-3: #7c7c80;
    --line: #2c2c2f; --line-2: #3a3a3d; --accent: #7aa2cc; --accent-soft: #1f2a36; --accent-text: #0e1620;
    --green: #7cc19d; --green-soft: #17271f; --amber: #d8a857; --amber-soft: #2a2215; --red: #e08b86; --red-soft: #2d1918; --grey-soft: #26262a;
    --shadow: none; color-scheme: dark; }
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.45 var(--font); -webkit-font-smoothing: antialiased; }
a { color: var(--accent); text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
h1 { font-size: 28px; font-weight: 700; letter-spacing: -.02em; margin: 0; }
h2 { font-size: 17px; font-weight: 600; margin: 0 0 12px; letter-spacing: -.01em; }
h3 { font-size: 13px; font-weight: 600; color: var(--text-2); text-transform: uppercase; letter-spacing: .04em; margin: 0 0 10px; }
.boot { display: grid; place-items: center; height: 100vh; color: var(--text-3); font-weight: 600; letter-spacing: .1em; }
.muted { color: var(--text-2); } .small { font-size: 13px; } .tiny { font-size: 12px; } .num { font-variant-numeric: tabular-nums; }
.right { text-align: right; } .row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; } .grow { flex: 1; }
.stack > * + * { margin-top: 16px; } .hidden { display: none !important; }

/* Layout */
.shell { display: grid; grid-template-columns: 232px 1fr; min-height: 100vh; }
.side { position: sticky; top: 0; height: 100vh; padding: 22px 14px; border-right: 1px solid var(--line); background: var(--surface-2); display: flex; flex-direction: column; }
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 10px 22px; font-weight: 700; font-size: 19px; letter-spacing: -.01em; }
.brand img { width: 28px; height: 28px; }
.brand small { display: block; font-size: 11px; font-weight: 500; color: var(--text-3); letter-spacing: 0; }
.nav a { display: flex; align-items: center; justify-content: space-between; padding: 8px 10px; border-radius: 9px; color: var(--text); margin-bottom: 2px; font-size: 14px; }
.nav a:hover { background: var(--grey-soft); }
.nav a.on { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.nav .count { font-size: 12px; background: var(--accent); color: var(--accent-text); border-radius: 10px; padding: 0 7px; font-weight: 600; }
.nav .sep { height: 1px; background: var(--line); margin: 12px 8px; }
.side .me { margin-top: auto; padding: 12px 10px 0; border-top: 1px solid var(--line); font-size: 13px; }
.side .me .roles { color: var(--text-3); font-size: 12px; margin: 2px 0 8px; }
.main { min-width: 0; }
.topbar { display: flex; align-items: center; gap: 12px; padding: 16px 32px; border-bottom: 1px solid var(--line); background: color-mix(in srgb, var(--bg) 85%, transparent); position: sticky; top: 0; z-index: 5; backdrop-filter: saturate(180%) blur(16px); }
.topbar .title { font-weight: 600; flex: 1; }
.content { padding: 28px 32px 64px; max-width: 1180px; }
.menu-btn { display: none; }

/* Surfaces */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); }
.card.flush { padding: 0; overflow: hidden; }
.grid { display: grid; gap: 16px; } .g2 { grid-template-columns: repeat(2, minmax(0,1fr)); } .g3 { grid-template-columns: repeat(3, minmax(0,1fr)); } .g4 { grid-template-columns: repeat(4, minmax(0,1fr)); }
.kpi { padding: 16px 18px; } .kpi .v { font-size: 26px; font-weight: 650; letter-spacing: -.02em; font-variant-numeric: tabular-nums; } .kpi .l { font-size: 13px; color: var(--text-2); }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.page-head p { margin: 6px 0 0; color: var(--text-2); }

/* Buttons & inputs */
.btn { appearance: none; border: 1px solid var(--line-2); background: var(--surface); padding: 8px 14px; border-radius: 10px; cursor: pointer; font-weight: 500; font-size: 14px; white-space: nowrap; }
.btn:hover { background: var(--grey-soft); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-text); }
.btn.primary:hover { filter: brightness(1.07); }
.btn.danger { color: var(--red); } .btn.warn { color: var(--amber); }
.btn.quiet { border-color: transparent; background: transparent; color: var(--accent); padding: 6px 8px; }
.btn.big { padding: 11px 20px; font-size: 15px; border-radius: 12px; }
.btn:disabled { opacity: .5; cursor: default; }
label.f { display: block; font-size: 13px; color: var(--text-2); margin-bottom: 12px; }
label.f > span { display: block; margin-bottom: 5px; font-weight: 500; }
label.f .req { color: var(--red); }
input.i, select.i, textarea.i { width: 100%; border: 1px solid var(--line-2); background: var(--surface); border-radius: 10px; padding: 9px 11px; font-size: 15px; color: var(--text); outline: none; }
input.i:focus, select.i:focus, textarea.i:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
textarea.i { min-height: 76px; resize: vertical; }
.i[readonly] { background: var(--surface-2); color: var(--text-2); }
.fields { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 0 18px; }
.fields .wide { grid-column: 1 / -1; }
.kv { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px 22px; }
.kv div span { display: block; font-size: 12px; color: var(--text-3); margin-bottom: 2px; }
.kv div b { font-weight: 500; word-break: break-word; }
.check { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--accent); }

/* Pills */
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 2px 9px; border-radius: 20px; font-size: 12px; font-weight: 600; background: var(--grey-soft); color: var(--text-2); white-space: nowrap; }
.pill.blue { background: var(--accent-soft); color: var(--accent); } .pill.green { background: var(--green-soft); color: var(--green); }
.pill.amber { background: var(--amber-soft); color: var(--amber); } .pill.red { background: var(--red-soft); color: var(--red); }
.dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; display: inline-block; }

/* Tables */
table.t { width: 100%; border-collapse: collapse; font-size: 14px; }
.t th { text-align: left; font-weight: 600; font-size: 12px; color: var(--text-3); text-transform: uppercase; letter-spacing: .04em; padding: 10px 14px; border-bottom: 1px solid var(--line); background: var(--surface-2); }
.t td { padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
.t tr:last-child td { border-bottom: 0; }
.t tr.link { cursor: pointer; } .t tr.link:hover td { background: var(--surface-2); }
.table-wrap { overflow-x: auto; }
.empty { padding: 40px 20px; text-align: center; color: var(--text-3); }

/* Tabs */
.tabs { display: inline-flex; background: var(--grey-soft); border-radius: 10px; padding: 3px; gap: 2px; }
.tabs a { padding: 6px 14px; border-radius: 8px; color: var(--text-2); font-size: 14px; font-weight: 500; }
.tabs a.on { background: var(--surface); color: var(--text); box-shadow: 0 1px 2px rgba(0,0,0,.08); }

/* Queue items */
.qitem { display: flex; gap: 16px; align-items: center; padding: 16px 20px; border-bottom: 1px solid var(--line); cursor: pointer; }
.qitem:last-child { border-bottom: 0; } .qitem:hover { background: var(--surface-2); }
.qitem .ref { font-size: 12px; color: var(--text-3); font-weight: 600; letter-spacing: .02em; }
.qitem .what { font-weight: 600; margin: 2px 0; }
.qitem .amt { font-weight: 600; font-variant-numeric: tabular-nums; }

/* Overdue box */
.alertbox { border: 1px solid color-mix(in srgb, var(--red) 30%, var(--line)); background: var(--red-soft); border-radius: var(--radius); padding: 14px 18px; }
.alertbox h2 { color: var(--red); display: flex; align-items: center; gap: 8px; margin-bottom: 8px; font-size: 15px; }
.alertbox a.od { display: flex; justify-content: space-between; gap: 12px; padding: 7px 0; border-top: 1px solid color-mix(in srgb, var(--red) 15%, transparent); color: var(--text); font-size: 14px; }
.alertbox a.od:first-of-type { border-top: 0; }
.alertbox.calm { background: var(--green-soft); border-color: color-mix(in srgb, var(--green) 25%, var(--line)); }
.alertbox.calm h2 { color: var(--green); margin: 0; }
.bell { position: relative; display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; border-radius: 10px; color: var(--text-2); font-size: 13px; font-weight: 600; }
.bell.hot { background: var(--red-soft); color: var(--red); }

/* Detail */
.detail-head { display: flex; gap: 16px; justify-content: space-between; align-items: flex-start; flex-wrap: wrap; margin-bottom: 20px; }
.detail-head .ref { font-size: 13px; color: var(--text-3); font-weight: 600; letter-spacing: .03em; }
.detail-head h1 { margin: 4px 0 8px; }
.amount-big { font-size: 28px; font-weight: 650; letter-spacing: -.02em; font-variant-numeric: tabular-nums; text-align: right; }
.stepper { display: flex; gap: 0; overflow-x: auto; padding: 4px 2px 10px; margin-bottom: 18px; }
.step { flex: 1; min-width: 92px; position: relative; text-align: center; font-size: 11.5px; color: var(--text-3); padding-top: 24px; }
.step::before { content: ""; position: absolute; top: 7px; left: 50%; width: 100%; height: 2px; background: var(--line-2); }
.step:last-child::before { display: none; }
.step i { position: absolute; top: 0; left: calc(50% - 8px); width: 16px; height: 16px; border-radius: 50%; background: var(--surface); border: 2px solid var(--line-2); z-index: 1; }
.step.done { color: var(--text-2); } .step.done i { background: var(--green); border-color: var(--green); } .step.done::before { background: var(--green); }
.step.now { color: var(--text); font-weight: 650; } .step.now i { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); background: var(--accent); }
.nowcard { display: grid; grid-template-columns: 1fr auto; gap: 18px; align-items: center; border-left: 4px solid var(--accent); }
.nowcard .who { font-size: 20px; font-weight: 650; letter-spacing: -.01em; margin: 2px 0; }
.nowcard .actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.flag { background: var(--amber-soft); color: var(--amber); border-radius: 10px; padding: 9px 12px; font-size: 14px; margin-bottom: 8px; }
.blocker { background: var(--grey-soft); color: var(--text-2); border-radius: 10px; padding: 9px 12px; font-size: 14px; }
.cols { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 20px; align-items: start; }
.section-title { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.section-title h2 { margin: 0; }
.editing { outline: 2px solid var(--accent-soft); }
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { position: relative; padding: 0 0 16px 20px; font-size: 13.5px; }
.timeline li::before { content: ""; position: absolute; left: 4px; top: 6px; width: 7px; height: 7px; border-radius: 50%; background: var(--line-2); }
.timeline li::after { content: ""; position: absolute; left: 7px; top: 16px; bottom: 0; width: 1px; background: var(--line); }
.timeline li:last-child::after { display: none; }
.timeline .a { font-weight: 600; } .timeline .m { color: var(--text-3); font-size: 12px; }
.timeline .d { color: var(--text-2); margin-top: 2px; }
.doc { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.doc:last-child { border-bottom: 0; }
.doc .n { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chkrow { display: grid; grid-template-columns: 1.1fr 1.4fr 1fr 1fr auto; gap: 8px; align-items: end; margin-bottom: 8px; }

/* Matrix */
.matrix { width: 100%; }
.matrix th, .matrix td { text-align: center; padding: 7px 2px; } .matrix th:first-child, .matrix td:first-child { text-align: left; padding-left: 12px; }
.matrix th { font-size: 11px; text-transform: none; font-weight: 600; white-space: normal; overflow-wrap: normal; word-break: normal; min-width: 50px; max-width: 72px; line-height: 1.2; vertical-align: bottom; letter-spacing: 0; color: var(--text-2); }
.matrix .sticky { position: sticky; left: 0; background: var(--surface); z-index: 2; width: 170px; min-width: 170px; max-width: 190px; box-shadow: 1px 0 0 var(--line); }
.matrix td.sticky b { font-size: 13px; } .matrix td.sticky .tiny { font-size: 11px; line-height: 1.3; }
.matrix thead .sticky { background: var(--surface-2); }
.matrix input[type=checkbox] { width: 16px; height: 16px; accent-color: var(--accent); cursor: pointer; }

/* Auth */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.auth .card { width: 100%; max-width: 400px; padding: 32px; }
.auth .brand { justify-content: center; padding: 0 0 8px; font-size: 24px; }
.auth p.lead { text-align: center; color: var(--text-2); margin: 0 0 24px; }
.auth .qr { display: block; margin: 12px auto; border-radius: 12px; background: #fff; padding: 8px; }
.err { color: var(--red); font-size: 14px; min-height: 20px; margin: 4px 0 8px; }

/* Modal & toast */
.modal-bg { position: fixed; inset: 0; background: rgba(0,0,0,.28); display: grid; place-items: center; padding: 20px; z-index: 50; backdrop-filter: blur(3px); }
.modal { background: var(--surface); border-radius: 18px; width: 100%; max-width: 480px; padding: 24px; box-shadow: 0 20px 60px rgba(0,0,0,.2); max-height: 90vh; overflow: auto; }
.modal h2 { font-size: 19px; } .modal .row.end { justify-content: flex-end; margin-top: 18px; }
#toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(20px); background: var(--text); color: var(--bg); padding: 10px 18px; border-radius: 12px; font-size: 14px; opacity: 0; transition: .25s; pointer-events: none; z-index: 60; max-width: 90vw; }
#toast.show { opacity: 1; transform: translateX(-50%); }
#toast.bad { background: var(--red); color: #fff; }
.bar { height: 8px; border-radius: 4px; background: var(--grey-soft); overflow: hidden; } .bar > i { display: block; height: 100%; background: var(--accent); border-radius: 4px; }
.stage-row { display: grid; grid-template-columns: 1fr 44px; gap: 10px; align-items: center; padding: 6px 0; font-size: 14px; }
.stage-row .bar { grid-column: 1 / -1; height: 5px; margin-top: -2px; }

@media (max-width: 960px) {
  .cols { grid-template-columns: 1fr; } .g4 { grid-template-columns: repeat(2, 1fr); } .g3 { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: fixed; z-index: 30; width: 260px; left: -270px; transition: left .2s; box-shadow: 0 0 40px rgba(0,0,0,.15); }
  .side.open { left: 0; }
  .menu-btn { display: inline-flex; }
  .topbar { padding: 12px 16px; } .content { padding: 20px 16px 48px; }
  .g2 { grid-template-columns: 1fr; } .nowcard { grid-template-columns: 1fr; } .nowcard .actions { justify-content: flex-start; }
  .chkrow { grid-template-columns: 1fr 1fr; } h1 { font-size: 23px; } .amount-big { text-align: left; }
}

/* v2.1 — sortable tables, filters, roles editor */
.t th.sort { cursor: pointer; user-select: none; }
.t th.sort:hover { color: var(--text); }
.t th.sort i { font-style: normal; font-size: 9px; margin-left: 4px; color: var(--accent); }
.tools { margin: 0 2px 8px; }
.filters { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; align-items: end; margin-bottom: 16px; }
.filters .f { margin: 0; }
.modal.wide { max-width: 760px; }
.rights { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 12px; margin: 6px 0 12px; }
.rights fieldset { border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; margin: 0; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.rights legend { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--text-3); padding: 0 6px; }
.rights .check { font-size: 14px; }
.rights input:disabled + * , .rights .check:has(input:disabled) { opacity: .5; cursor: not-allowed; }
.flag.red { background: var(--red-soft, #fdecec); color: var(--red); border-color: color-mix(in srgb, var(--red) 30%, var(--line)); }
a.btn { text-decoration: none; display: inline-flex; align-items: center; }

/* v2.2 — items, purchase orders */
.t.items td { vertical-align: top; padding: 8px 10px; }
.t.items th { padding: 8px 10px; white-space: nowrap; }
.t.items .i { min-width: 0; width: 100%; }
.t.items th.narrow, .t.items td.narrow { width: 92px; min-width: 92px; }
.t.items td.narrow .i, .t.items td.narrow2 .i { padding-left: 8px; padding-right: 6px; }
.t.items th.narrow2, .t.items td.narrow2 { width: 128px; min-width: 128px; }
.t.items td:first-child .i { min-width: 150px; }
#items-edit td:last-child { width: 36px; padding-left: 0; padding-right: 0; }
#items-edit [data-line-total] { white-space: nowrap; padding-top: 18px; }
.items-foot { padding: 10px 4px 0; align-items: center; }
.t.items select.i { min-width: 150px; }
.t.items .num-in { width: 110px; text-align: right; display: inline-block; }
.t.items tfoot td { border-top: 1px solid var(--line); border-bottom: 0; background: var(--surface-2); }
.t.items tr.flagged td { background: color-mix(in srgb, var(--amber-soft) 60%, transparent); }
.ret-row { padding: 6px 0; border-top: 1px solid var(--line); }
.ret-row:first-of-type { border-top: 0; }
#po-pick .check input { flex: none; }

.t.items tr.dropped td { color: var(--text-3); text-decoration: line-through; }
.t.items tr.dropped td .tiny { text-decoration: none; }

.ewtbox { border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; margin: 6px 0 12px; background: var(--card, transparent); }
.ewtbox h3 { margin-top: 0; }

a.kpi-link { color: inherit; text-decoration: none; display: block; transition: border-color .15s, transform .15s; }
a.kpi-link:hover { border-color: var(--accent); transform: translateY(-1px); }
a.kpi-link .l { color: var(--accent); }

/* lists fit a laptop screen: tighter cells, two-line text, and a visible sideways scrollbar only when a table is still wider than the screen */
.t th { padding: 9px 10px; } .t td { padding: 10px 10px; }
.nowrap { white-space: nowrap; }
.clamp2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.table-wrap { overflow-x: auto; scrollbar-width: thin; scrollbar-color: var(--line-strong, #b9bcc4) transparent; }
.table-wrap::-webkit-scrollbar { height: 10px; } .table-wrap::-webkit-scrollbar-thumb { background: var(--line-strong, #b9bcc4); border-radius: 6px; } .table-wrap::-webkit-scrollbar-track { background: transparent; }
.t.matrix th, .t.matrix td { padding: 7px 2px; } .t.matrix th:first-child, .t.matrix td:first-child { padding-left: 12px; }

/* v2.8 Profit & Loss */
.pl { border-collapse: collapse; width: 100%; font-variant-numeric: tabular-nums; font-size: clamp(10.7px, 0.74vw, 13px); } /* never below 8 pt */
.pl th, .pl td { padding: 5px 5px; border-bottom: 1px solid var(--line); white-space: nowrap; font-size: inherit; }
.pl th { font-size: 0.85em; letter-spacing: .02em; }
.pl th { background: var(--surface-2); color: var(--text-3); font-size: 11px; text-transform: uppercase; letter-spacing: .04em; text-align: right; }
.pl th:first-child, .pl td:first-child { text-align: left; position: sticky; left: 0; background: var(--surface); z-index: 1; min-width: 150px; width: 15%; max-width: 220px; white-space: normal; line-height: 1.25; box-shadow: 1px 0 0 var(--line); }
.pl td.later, .pl th.later { color: var(--text-3); opacity: .55; }
.pl th:first-child { background: var(--surface-2); }
.pl td { text-align: right; }
.pl tr.section td { font-weight: 650; background: color-mix(in srgb, var(--accent) 7%, var(--surface)); }
.pl tr.section td:first-child { background: color-mix(in srgb, var(--accent) 7%, var(--surface)); }
.pl tr.group td { font-weight: 600; }
.pl tr.result td { font-weight: 700; border-top: 1px solid var(--line-strong, #b9bcc4); }
.pl tr.pct td { color: var(--text-3); font-style: italic; font-size: 12px; }
.pl tr.gap td { height: 8px; padding: 0; border-bottom: 0; }
.pl td.cell { cursor: pointer; } .pl td.cell:hover { background: var(--grey-soft); color: var(--accent); }
.pl td.ytd, .pl th.ytd { background: color-mix(in srgb, var(--accent) 5%, var(--surface)); font-weight: 600; }
.pl td.prev, .pl th.prev { color: var(--text-3); }
.pl .neg { color: var(--red); }
.pl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px 14px; }

/* ---------- v2.11 planner ---------- */
.remind { margin-left: auto; margin-right: 8px; display: inline-flex; align-items: center; gap: 4px; }
.remind .count { display: inline-block; background: var(--red); color: #fff; border-radius: 10px; padding: 0 7px; font-size: 12px; font-weight: 600; }
.plan-wrap { display: grid; grid-template-columns: minmax(0, 2.3fr) minmax(280px, 1fr); gap: 16px; align-items: start; }
.plan-row { display: grid; grid-template-columns: 26px minmax(0, 1fr) 118px 118px 92px 170px; gap: 10px; padding: 10px 16px; border-top: 1px solid var(--line); align-items: center; }
.plan-headrow { background: var(--surface-2, #fafafa); font-size: 11px; color: var(--text-3); text-transform: uppercase; letter-spacing: .04em; border-top: 0; }
.plan-group { padding: 10px 16px 4px; font-size: 12px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; border-top: 1px solid var(--line); }
.plan-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-left: 4px; background: var(--accent); }
.plan-dot.red { background: var(--red); } .plan-dot.amber { background: var(--amber); } .plan-dot.green { background: var(--green); }
.plan-day { display: block; border-radius: 10px; padding: 6px 0; background: var(--surface-2, #fafafa); color: inherit; text-decoration: none; }
.plan-day.on { background: var(--accent); color: #fff; } .plan-day.late { background: var(--red-soft); color: var(--red); }
.plan-bar { position: relative; height: 8px; background: var(--line); border-radius: 4px; margin-top: 5px; }
.plan-bar i { display: block; height: 8px; border-radius: 4px; } .plan-bar em { position: absolute; top: -3px; width: 2px; height: 14px; background: var(--text); }
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.cal-head div { padding: 8px 10px; font-size: 11px; color: var(--text-3); text-transform: uppercase; letter-spacing: .04em; background: var(--surface-2, #fafafa); }
.cal-cell { min-height: 104px; border-top: 1px solid var(--line); border-left: 1px solid var(--line); padding: 6px; display: flex; flex-direction: column; gap: 3px; color: inherit; text-decoration: none; overflow: hidden; }
.cal-cell:hover { background: var(--surface-2, #fafafa); text-decoration: none; } .cal-cell.blank { background: var(--surface-2, #fafafa); }
.cal-cell.off { background: var(--grey-soft); } .cal-cell.today b { color: var(--accent); } .cal-cell.sel { box-shadow: inset 0 0 0 2px var(--accent); }
.cal-ev { border-radius: 6px; padding: 2px 6px; font-size: 11.5px; line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal-ev.red { background: var(--red-soft); color: var(--red); } .cal-ev.amber { background: var(--amber-soft); color: #7a5418; } .cal-ev.teal { background: #dcf3f3; color: #0f6466; }
.cal-ev.violet { background: #ece8fb; color: #4a3a99; } .cal-ev.green { background: var(--green-soft); color: var(--green); }
.cal-item { border-left: 3px solid var(--accent); padding: 4px 10px; margin-bottom: 10px; font-size: 13px; }
.cal-item.red { border-color: var(--red); } .cal-item.amber { border-color: var(--amber); } .cal-item.teal { border-color: #137c7e; } .cal-item.violet { border-color: #5b47b0; } .cal-item.green { border-color: var(--green); }
.tl-row { display: flex; border-top: 1px solid var(--line); } .tl-row.head { background: var(--surface-2, #fafafa); } .tl-head { border-top: 0; background: var(--surface-2, #fafafa); }
.tl-label { flex: 0 0 280px; padding: 8px 14px; box-sizing: border-box; min-width: 0; }
.tl-row:not(.head):not(.tl-head) .tl-label { padding-left: 26px; }
.tl-track { flex: 1 1 auto; display: grid; align-items: center; position: relative; padding: 5px 0; background-image: linear-gradient(to right, var(--line) 1px, transparent 1px); }
.tl-head .tl-track { background: none; }
.tl-day { text-align: center; font-size: 11px; border-left: 1px solid var(--line); padding: 4px 0; } .tl-day.on { background: var(--accent-soft); color: var(--accent); }
.tl-today { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--accent); opacity: .7; }
.tl-bar { grid-row: 1; height: 22px; border-radius: 6px; font-size: 11px; font-weight: 600; display: flex; align-items: center; padding: 0 8px; white-space: nowrap; overflow: hidden; margin: 0 2px; position: relative; }
.tl-bar.done { background: #9fd8b0; color: #0f4d22; } .tl-bar.progress { background: var(--accent); color: #fff; } .tl-bar.late { background: #d9534f; color: #fff; }
.tl-bar.plan { border: 1.5px dashed var(--accent); color: var(--accent); background: transparent; } .tl-bar.own { background: #ece8fb; color: #4a3a99; }
.rem-item { display: block; border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; color: inherit; } .rem-item.new { border-color: var(--accent); background: var(--accent-soft); }
@media (max-width: 900px) {
  .plan-wrap { grid-template-columns: 1fr; }
  .plan-row { grid-template-columns: 26px minmax(0, 1fr) 110px; } .plan-row > :nth-child(3), .plan-row > :nth-child(4), .plan-row > :nth-child(5) { display: none; }
  .cal-cell { min-height: 64px; } .cal-ev { font-size: 10px; } .remind { margin-left: 0; }
}
