/* Kirtara Sales — gaya "Terang netral" (sama dengan Drive & Teams arah A) */
:root {
  --font: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --bg: #f6f6f7; --surface: #ffffff;
  --side: #ffffff; --side-tx: #3b3b41; --side-mut: #8b8b93; --side-hover: #f1f1f3; --side-act: #f1f1f3; --side-act-tx: #111114; --side-line: #e7e7ea;
  --tx: #16161a; --tx2: #4a4a52; --mut: #85858e; --line: #e7e7ea; --line-2: #dcdce0;
  --acc: #ff6b45; --acc-hover: #f25a33; --acc-tx: #fff; --acc-soft: #fff0eb; --acc-ink: #c4441f;
  --sel: #fff3ef; --sel-line: #ffcdbd;
  --bad: #c23a4a; --bad-soft: #fcebed;
  --radius: 10px;
  --shadow: 0 10px 30px -12px rgba(22, 22, 26, .28), 0 2px 6px rgba(22, 22, 26, .06);
  color-scheme: light;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font: 14px/1.5 var(--font); color: var(--tx); background: var(--bg); -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
.sprite { display: none; }
.ic { width: 18px; height: 18px; flex: none; display: inline-block; vertical-align: middle; }
[hidden] { display: none !important; }

/* ---------- boot ---------- */
.boot { min-height: 100vh; display: grid; place-items: center; color: var(--mut); }

/* ---------- brand ---------- */
.brand { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 17px; letter-spacing: -.02em; color: var(--tx); }
.brand i { font-style: normal; font-size: 11px; font-weight: 600; letter-spacing: .02em; padding: 2px 7px; border-radius: 99px; background: var(--acc); color: var(--acc-tx); }

/* ---------- login ---------- */
.login { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; background: var(--bg); }
.login-card { width: 100%; max-width: 380px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 28px 28px 24px; }
.login h1 { font-size: 20px; font-weight: 600; letter-spacing: -.015em; margin: 22px 0 4px; }
.login p.sub { margin: 0 0 20px; color: var(--mut); font-size: 13.5px; }
.field { display: block; margin-bottom: 14px; }
.field span { display: block; font-weight: 500; font-size: 13px; margin-bottom: 6px; color: var(--tx2); }
.input { width: 100%; height: 40px; border-radius: 8px; border: 1px solid var(--line-2); background: #fff; padding: 0 12px; outline: none; transition: border-color .12s, box-shadow .12s; }
.input:focus { border-color: var(--acc); box-shadow: 0 0 0 3px rgba(255, 107, 69, .16); }
.input::placeholder { color: #b0b0b7; }
.login .btn { width: 100%; height: 40px; margin-top: 4px; }
.login .err { min-height: 18px; color: var(--bad); font-size: 13px; margin: 0 0 8px; }
.login .foot { margin: 18px 0 0; padding-top: 16px; border-top: 1px solid var(--line); color: var(--mut); font-size: 12.5px; }

/* ---------- tombol ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 34px; padding: 0 12px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); color: var(--tx); font: 600 13px/1 var(--font); white-space: nowrap; transition: background .12s, border-color .12s; }
.btn:hover { background: var(--side-hover); }
.btn .ic { width: 16px; height: 16px; }
.btn.pri { background: var(--acc); border-color: var(--acc); color: var(--acc-tx); }
.btn.pri:hover { background: var(--acc-hover); border-color: var(--acc-hover); }
.btn.danger { background: var(--bad); border-color: var(--bad); color: #fff; }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost:hover { background: var(--side-hover); }
.btn:disabled { opacity: .55; cursor: default; }
.icon-btn { width: 32px; height: 32px; border-radius: 8px; border: 0; background: transparent; color: var(--tx2); display: inline-grid; place-items: center; }
.icon-btn:hover { background: var(--side-hover); color: var(--tx); }

/* ---------- kerangka ---------- */
.app { display: grid; grid-template-columns: 232px minmax(0, 1fr); height: 100vh; }
.side { background: var(--side); color: var(--side-tx); border-right: 1px solid var(--side-line); padding: 18px 12px 12px; display: flex; flex-direction: column; gap: 2px; overflow-y: auto; }
.side .brand { padding: 2px 10px 18px; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a { display: flex; align-items: center; gap: 11px; padding: 8px 10px; border-radius: 8px; font-weight: 500; color: var(--side-tx); }
.nav a:hover { background: var(--side-hover); }
.nav a.on { background: var(--side-act); color: var(--side-act-tx); font-weight: 600; }
.nav a span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav .ic { opacity: .8; }
.nav hr { border: 0; border-top: 1px solid var(--side-line); margin: 10px 6px; }
.nav-label { font-size: 11.5px; font-weight: 600; color: var(--side-mut); padding: 14px 10px 4px; }
.nav-group { display: flex; flex-direction: column; gap: 2px; }
.nav-empty { font-size: 12.5px; color: var(--side-mut); padding: 4px 10px; }

/* kelola divisi */
.dv-intro { margin: 0 0 16px; color: var(--tx2); font-size: 13.5px; max-width: 760px; }
.dv-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; align-items: start; }
.dv header { padding: 12px 14px; border-bottom: 1px solid var(--line); }
.dv header b { display: block; font-weight: 600; }
.dv header small { color: var(--mut); font-size: 12.5px; }
.dv ul { list-style: none; margin: 0; padding: 4px 0; }
.dv li { display: flex; align-items: center; gap: 10px; padding: 6px 8px 6px 14px; }
.dv li.none { color: var(--mut); font-size: 13px; padding: 10px 14px; }
.dv li .av { width: 26px; height: 26px; border-radius: 99px; display: grid; place-items: center; background: var(--side-act); color: var(--tx2); font-weight: 600; font-size: 11px; flex: none; }
.dv li .who { flex: 1; min-width: 0; font-size: 13px; }
.dv li .who b { display: block; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dv li .who small { display: block; color: var(--mut); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dv-add { display: flex; gap: 8px; padding: 10px 14px 14px; border-top: 1px solid var(--line); }
.dv-add .input { height: 34px; font-size: 13px; }
.quota { margin: 14px 10px 0; font-size: 12px; color: var(--side-mut); }
.quota .bar { height: 3px; border-radius: 3px; background: var(--line); overflow: hidden; margin-bottom: 7px; }
.quota .bar i { display: block; height: 100%; width: 0; background: var(--tx2); }
.side-help { margin: 14px 10px 0; font-size: 12px; color: var(--side-mut); line-height: 1.45; }
.side-help a { color: var(--tx2); text-decoration: underline; text-underline-offset: 2px; }
.me { margin-top: auto; display: flex; align-items: center; gap: 10px; padding: 10px; border: 0; border-top: 1px solid var(--side-line); background: transparent; text-align: left; font-size: 13px; border-radius: 0; width: 100%; }
.me:hover { background: var(--side-hover); }
.me .av { width: 30px; height: 30px; border-radius: 99px; display: grid; place-items: center; background: var(--acc-soft); color: var(--acc-ink); font-weight: 700; font-size: 12px; flex: none; }
.me .who { min-width: 0; }
.me .who b { display: block; font-weight: 600; color: var(--tx); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.me .who small { display: block; color: var(--side-mut); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.main { display: flex; flex-direction: column; min-width: 0; min-height: 0; position: relative; }
.top { background: var(--bg); border-bottom: 1px solid var(--line); padding: 16px 32px 14px; display: flex; align-items: flex-end; gap: 16px; flex-wrap: wrap; }
.top .titles { flex: 1; min-width: 200px; }
.crumbs { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; color: var(--mut); font-size: 13px; min-height: 20px; }
.crumbs a { color: var(--mut); padding: 1px 4px; margin: 0 -4px; border-radius: 5px; max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.crumbs a:hover { color: var(--tx); background: var(--side-hover); }
.crumbs .sep { color: #c4c4ca; }
.top h1 { margin: 2px 0 0; font-size: 22px; font-weight: 600; letter-spacing: -.02em; line-height: 1.3; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.top h1 button { all: unset; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; border-radius: 6px; padding: 0 4px; margin-left: -4px; }
.top h1 button:hover { background: var(--side-hover); }
.top h1 .ic { width: 16px; height: 16px; color: var(--mut); }
.actions, .tools { display: flex; align-items: center; gap: 8px; }
.search { display: flex; align-items: center; gap: 8px; height: 34px; width: 260px; border: 1px solid var(--line); background: var(--surface); border-radius: 8px; padding: 0 10px; }
.search:focus-within { border-color: var(--acc); box-shadow: 0 0 0 3px rgba(255, 107, 69, .14); }
.search .ic { width: 16px; height: 16px; color: var(--mut); }
.search input { flex: 1; border: 0; outline: none; background: transparent; min-width: 0; height: 100%; font-size: 13.5px; }
.search input::-webkit-search-cancel-button { display: none; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: var(--surface); }
.seg button { border: 0; background: transparent; width: 34px; height: 32px; display: grid; place-items: center; color: var(--mut); }
.seg button + button { border-left: 1px solid var(--line); }
.seg button.on { color: var(--tx); background: var(--side-act); }
.seg .ic { width: 16px; height: 16px; }
.menu-btn { display: none; }

.selbar { display: flex; align-items: center; gap: 4px; padding: 6px 24px 6px 26px; border-bottom: 1px solid var(--sel-line); background: var(--sel); font-size: 13px; }
.selbar .count { font-weight: 600; margin-right: 8px; }
.selbar .sp { flex: 1; }
.selbar .btn { height: 30px; background: transparent; border-color: transparent; }
.selbar .btn:hover { background: rgba(255, 255, 255, .7); }

.filters { display: flex; gap: 6px; padding: 12px 32px 0; flex-wrap: wrap; }
.chip { height: 28px; padding: 0 10px; border-radius: 7px; border: 1px solid var(--line); background: var(--surface); font-weight: 500; font-size: 12.5px; color: var(--tx2); }
.chip:hover { background: var(--side-hover); }
.chip.on { border-color: var(--tx); color: var(--tx); font-weight: 600; }

.content { flex: 1; overflow-y: auto; padding: 16px 32px 48px; outline: none; position: relative; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }

/* ---------- tabel (tampilan bawaan) ---------- */
.table { width: 100%; border-collapse: separate; border-spacing: 0; }
.table th { text-align: left; font-weight: 500; color: var(--mut); font-size: 12.5px; height: 38px; padding: 0 14px; border-bottom: 1px solid var(--line); white-space: nowrap; user-select: none; background: var(--surface); position: sticky; top: 0; z-index: 1; }
.table th:first-child { border-top-left-radius: var(--radius); }
.table th:last-child { border-top-right-radius: var(--radius); }
.table th.sortable { cursor: pointer; }
.table th.sortable:hover { color: var(--tx); }
.table th .arrow { margin-left: 4px; color: var(--tx); }
.table td { height: 44px; padding: 0 14px; border-bottom: 1px solid var(--line); white-space: nowrap; color: var(--tx2); user-select: none; font-size: 13.5px; font-variant-numeric: tabular-nums; }
.table tr:last-child td { border-bottom: 0; }
.table tr.row:hover td { background: #fafafb; }
.table tr.row.sel td { background: var(--sel); }
.table td.n { color: var(--tx); font-weight: 500; max-width: 0; width: 60%; }
.table td.n .wrap { display: flex; align-items: center; gap: 12px; min-width: 0; }
.table td.n .t { overflow: hidden; text-overflow: ellipsis; }
.table td.act { width: 44px; padding: 0 6px; text-align: right; }
.table td.act .icon-btn { opacity: 0; }
.table tr.row:hover td.act .icon-btn, .table tr.row.sel td.act .icon-btn { opacity: 1; }
.col-sm { width: 1%; }
.ext { font-size: 11px; font-weight: 600; color: var(--mut); letter-spacing: .03em; }

/* ikon file: monokrom */
.fi { width: 20px; height: 20px; color: #9a9aa2; flex: none; }
.fi.folder { color: #6e6e76; }
.fi.team { color: var(--acc-ink); }
.star-mini { width: 13px; height: 13px; color: #d9930d; flex: none; }

/* ---------- petak ---------- */
.sec { font-size: 12.5px; font-weight: 500; color: var(--mut); margin: 4px 0 10px; }
.sec + .grid, .grid + .sec { margin-top: 0; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; margin-bottom: 22px; }
.tile { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); user-select: none; cursor: default; min-width: 0; transition: border-color .12s; }
.tile:hover { border-color: var(--line-2); background: #fcfcfd; }
.tile.sel { background: var(--sel); border-color: var(--sel-line); }
.tile .row1 { display: flex; align-items: center; gap: 10px; height: 46px; padding: 0 4px 0 12px; }
.tile .nm { flex: 1; min-width: 0; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tile .icon-btn { opacity: 0; }
.tile:hover .icon-btn, .tile.sel .icon-btn { opacity: 1; }
.tile .meta { padding: 0 12px 10px; margin-top: -6px; font-size: 12px; color: var(--mut); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tile .thumb { margin: 0 8px 8px; height: 128px; border-radius: 6px; overflow: hidden; background: var(--bg); }
.tile .thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }

.drop-hover { outline: 2px solid var(--acc); outline-offset: -2px; }

/* ---------- kosong ---------- */
.empty { text-align: center; padding: 64px 16px; color: var(--mut); }
.empty h3 { color: var(--tx); font-size: 15px; font-weight: 600; margin: 0 0 4px; }
.empty p { margin: 0 auto 16px; max-width: 360px; font-size: 13.5px; }
.skeleton i { display: block; height: 44px; border-bottom: 1px solid var(--line); background: linear-gradient(90deg, #fff 0, #f4f4f5 50%, #fff 100%); background-size: 200% 100%; animation: sh 1.2s linear infinite; }
.skeleton i:last-child { border-bottom: 0; }
@keyframes sh { to { background-position: -200% 0; } }

.dropzone { position: absolute; inset: 0; background: rgba(246, 246, 247, .9); border: 2px dashed var(--acc); display: grid; place-items: center; z-index: 20; pointer-events: none; font-weight: 600; color: var(--acc-ink); }

/* ---------- menu & dialog ---------- */
.menu { position: fixed; z-index: 100; min-width: 220px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow); padding: 4px; }
.menu button { display: flex; align-items: center; gap: 10px; width: 100%; height: 34px; padding: 0 10px; border: 0; background: transparent; text-align: left; font-size: 13.5px; border-radius: 6px; }
.menu button:hover, .menu button:focus-visible { background: var(--side-hover); outline: none; }
.menu button .ic { color: var(--mut); width: 16px; height: 16px; }
.menu button.danger { color: var(--bad); }
.menu button.danger .ic { color: var(--bad); }
.menu .sep { height: 1px; background: var(--line); margin: 4px 0; }
.menu .hdr { padding: 8px 10px 10px; border-bottom: 1px solid var(--line); margin: 0 -4px 4px; }
.menu .hdr b { display: block; font-weight: 600; }
.menu .hdr small { color: var(--mut); }

.scrim { position: fixed; inset: 0; background: rgba(22, 22, 26, .36); z-index: 200; display: grid; place-items: center; padding: 16px; }
.dialog { background: var(--surface); border-radius: 12px; width: 100%; max-width: 420px; padding: 20px; box-shadow: var(--shadow); max-height: calc(100vh - 32px); display: flex; flex-direction: column; }
.dialog.wide { max-width: 540px; }
.dialog h2 { margin: 0 0 14px; font-size: 16px; font-weight: 600; }
.dialog p { margin: 0 0 14px; color: var(--tx2); }
.dialog .foot { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }
.note { font-size: 12.5px; color: var(--mut); margin: 6px 0 0; }
.steps { margin: 0; padding-left: 20px; color: var(--tx2); }
.steps li { margin-bottom: 8px; }
.steps a { color: var(--acc-ink); text-decoration: underline; text-underline-offset: 2px; }
.picker { border: 1px solid var(--line); border-radius: 8px; overflow-y: auto; min-height: 220px; max-height: 320px; }
.picker .prow { display: flex; align-items: center; gap: 10px; padding: 0 12px; height: 40px; cursor: pointer; border-bottom: 1px solid var(--line); }
.picker .prow:hover { background: var(--side-hover); }
.picker .prow span { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.picker .prow .ic.chev { color: var(--mut); width: 16px; height: 16px; }
.picker .none { padding: 28px; text-align: center; color: var(--mut); }
.picker-head { display: flex; align-items: center; gap: 6px; margin-bottom: 8px; min-height: 32px; font-weight: 600; }
.picker-head span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.share-row { display: flex; gap: 8px; align-items: center; margin-bottom: 8px; }
.share-row .input { height: 34px; font-size: 13px; }

/* ---------- pratinjau ---------- */
.viewer { position: fixed; inset: 0; z-index: 300; background: #1b1b1f; display: flex; flex-direction: column; }
.viewer-top { height: 56px; display: flex; align-items: center; gap: 10px; padding: 0 12px; color: #fff; border-bottom: 1px solid #2c2c31; flex: none; }
.viewer-top .name { flex: 1; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.viewer-top .icon-btn { color: #d8d8dd; }
.viewer-top .icon-btn:hover { background: #2c2c31; color: #fff; }
.viewer-top .fi { color: #9a9aa2; }
.viewer-body { flex: 1; display: grid; place-items: center; padding: 16px; min-height: 0; }
.viewer-body img, .viewer-body video { max-width: 100%; max-height: 100%; }
.viewer-body iframe { width: min(1000px, 100%); height: 100%; border: 0; background: #fff; }
.viewer-body pre { width: min(860px, 100%); max-height: 100%; overflow: auto; margin: 0; background: #fff; border-radius: 6px; padding: 22px; white-space: pre-wrap; font: 13px/1.6 ui-monospace, Consolas, monospace; color: var(--tx); }
.viewer-body .nopreview { color: #d8d8dd; text-align: center; }
.viewer-body .nopreview p { margin: 0 0 14px; }

/* ---------- unggahan & toast ---------- */
.uploads { position: fixed; right: 20px; bottom: 20px; width: 340px; max-width: calc(100vw - 32px); background: var(--surface); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow); z-index: 150; overflow: hidden; }
.uploads .uh { display: flex; align-items: center; height: 44px; padding: 0 6px 0 14px; border-bottom: 1px solid var(--line); font-weight: 600; font-size: 13px; }
.uploads .uh span { flex: 1; }
.uploads .ul { max-height: 240px; overflow-y: auto; }
.uploads .ui { display: flex; align-items: center; gap: 10px; padding: 9px 14px; border-bottom: 1px solid var(--line); font-size: 13px; }
.uploads .ui:last-child { border-bottom: 0; }
.uploads .ui .nm { flex: 1; min-width: 0; }
.uploads .ui .nm div { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.uploads .ui .pb { height: 3px; background: var(--line); border-radius: 3px; margin-top: 5px; overflow: hidden; }
.uploads .ui .pb i { display: block; height: 100%; width: 0; background: var(--acc); transition: width .2s; }
.uploads .ui .st { width: 16px; height: 16px; color: #1e8a4f; }
.uploads .ui .st.err { color: var(--bad); }
.uploads .ui small { color: var(--bad); }
.toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: 20px; z-index: 400; background: #16161a; color: #fff; padding: 10px 14px; border-radius: 8px; box-shadow: var(--shadow); display: flex; align-items: center; gap: 14px; max-width: calc(100vw - 32px); font-size: 13.5px; }
.toast button { border: 0; background: transparent; color: #ffb199; font-weight: 600; padding: 2px 4px; }

.backdrop { display: none; }

/* ---------- HP ---------- */
@media (max-width: 860px) {
  .app { grid-template-columns: 1fr; }
  .side { position: fixed; top: 0; bottom: 0; left: 0; width: 272px; z-index: 120; transform: translateX(-100%); transition: transform .2s ease; }
  .app.drawer .side { transform: none; box-shadow: var(--shadow); }
  .app.drawer .backdrop { display: block; position: fixed; inset: 0; background: rgba(22, 22, 26, .3); z-index: 110; }
  .menu-btn { display: inline-grid; }
  .top { padding: 10px 14px 12px; gap: 10px; align-items: center; }
  .top .titles { order: 1; flex: 1; min-width: 0; }
  .top .menu-btn { order: 0; }
  .actions { order: 2; width: 100%; }
  .search { flex: 1; width: auto; }
  .actions .btn .lbl { display: none; }
  .actions .btn { width: 34px; padding: 0; }
  .top h1 { font-size: 18px; }
  .filters { padding: 10px 14px 0; }
  .content { padding: 12px 14px 40px; }
  .table .hide-sm { display: none; }
  .table td.n { width: auto; }
  .table td.act .icon-btn { opacity: 1; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
  .tile .icon-btn { opacity: 1; }
  .selbar { padding: 6px 10px; }
  .selbar .btn .lbl { display: none; }
}

/* ================================================================ Sales */
.stat-row { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 18px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; min-width: 0; }
.stat small { display: block; color: var(--mut); font-size: 12.5px; }
.stat b { display: block; font-size: 20px; font-weight: 600; letter-spacing: -.02em; margin-top: 2px; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stat em { font-style: normal; font-size: 12px; color: var(--mut); }

/* papan pipeline */
.board { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(250px, 1fr); gap: 12px; overflow-x: auto; padding-bottom: 8px; align-items: start; }
.col { background: #ededef; border-radius: var(--radius); padding: 8px; min-height: 160px; display: flex; flex-direction: column; gap: 8px; }
.col.drop { outline: 2px solid var(--acc); outline-offset: -2px; background: var(--acc-soft); }
.col-head { display: flex; align-items: baseline; gap: 6px; padding: 4px 6px 2px; }
.col-head b { font-weight: 600; font-size: 13px; }
.col-head .n { font-size: 12px; color: var(--mut); }
.col-head .sum { margin-left: auto; font-size: 12px; color: var(--tx2); font-variant-numeric: tabular-nums; }
.dcard { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; cursor: grab; user-select: none; }
.dcard:hover { border-color: var(--line-2); }
.dcard.dragging { opacity: .5; }
.dcard .t { font-weight: 600; font-size: 13.5px; line-height: 1.35; }
.dcard .o { color: var(--tx2); font-size: 12.5px; margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dcard .m { display: flex; gap: 8px; align-items: center; margin-top: 8px; font-size: 12px; color: var(--mut); font-variant-numeric: tabular-nums; }
.dcard .m .amt { color: var(--tx); font-weight: 600; }
.dcard .m .due { margin-left: auto; }
.dcard .m .late { color: var(--bad); font-weight: 600; }
.closezone { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 12px; }
.closezone div { border: 2px dashed var(--line-2); border-radius: var(--radius); padding: 14px; text-align: center; color: var(--mut); font-weight: 600; font-size: 13px; }
.closezone .won.drop { border-color: #1e8a4f; color: #1e8a4f; background: #e8f5ee; }
.closezone .lost.drop { border-color: var(--bad); color: var(--bad); background: var(--bad-soft); }
.closezone[hidden] { display: none; }

/* detail */
.split { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.card > header { display: flex; align-items: center; gap: 8px; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.card > header b { font-weight: 600; }
.card > header .sp { flex: 1; }
.card .body { padding: 14px; }
.card + .card { margin-top: 16px; }
.kv { display: grid; grid-template-columns: 130px minmax(0, 1fr); gap: 8px 12px; margin: 0; font-size: 13.5px; }
.kv dt { color: var(--mut); }
.kv dd { margin: 0; color: var(--tx); overflow-wrap: anywhere; }
.rows { list-style: none; margin: 0; padding: 0; }
.rows li { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-bottom: 1px solid var(--line); font-size: 13.5px; }
.rows li:last-child { border-bottom: 0; }
.rows li .grow { flex: 1; min-width: 0; }
.rows li .grow b { display: block; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rows li .grow small { display: block; color: var(--mut); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rows li.click { cursor: pointer; }
.rows li.click:hover { background: #fafafb; }
.rows .none { color: var(--mut); }
.pill { display: inline-block; font-size: 11.5px; font-weight: 600; padding: 2px 8px; border-radius: 6px; background: var(--side-act); color: var(--tx2); white-space: nowrap; }
.pill.acc { background: var(--acc-soft); color: var(--acc-ink); }
.pill.ok { background: #e8f5ee; color: #1e8a4f; }
.pill.bad { background: var(--bad-soft); color: var(--bad); }
.pill.warn { background: #fdf3e1; color: #a86400; }
.timeline { list-style: none; margin: 0; padding: 6px 14px 10px; }
.timeline li { position: relative; padding: 8px 0 8px 18px; border-left: 1px solid var(--line); margin-left: 4px; font-size: 13.5px; }
.timeline li::before { content: ""; position: absolute; left: -4px; top: 13px; width: 7px; height: 7px; border-radius: 99px; background: var(--line-2); }
.timeline li.open::before { background: var(--acc); }
.timeline li small { display: block; color: var(--mut); font-size: 12px; }
.timeline li p { margin: 4px 0 0; color: var(--tx2); white-space: pre-wrap; }

/* form */
.form { display: grid; gap: 12px; }
.form .row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form label { display: block; }
.form label > span { display: block; font-size: 12.5px; font-weight: 500; color: var(--tx2); margin-bottom: 5px; }
.form textarea.input { height: auto; min-height: 76px; padding: 8px 12px; resize: vertical; font: inherit; }
.form select.input { padding-right: 8px; }
.form .err { color: var(--bad); font-size: 13px; min-height: 0; }
.check { display: flex !important; align-items: center; gap: 8px; font-size: 13.5px; }
.toolbar { display: flex; gap: 8px; align-items: center; margin-bottom: 12px; flex-wrap: wrap; }
.toolbar .search { width: 300px; }
.toolbar .sp { flex: 1; }
.agenda-sec { font-size: 12.5px; font-weight: 600; color: var(--mut); margin: 18px 0 8px; }
.agenda-sec:first-child { margin-top: 0; }
.agenda-sec.late { color: var(--bad); }

@media (max-width: 860px) {
  .stat-row { grid-template-columns: 1fr 1fr; }
  .split { grid-template-columns: 1fr; }
  .board { grid-auto-columns: 82%; }
  .form .row2 { grid-template-columns: 1fr; }
  .kv { grid-template-columns: 110px minmax(0, 1fr); }
  .toolbar .search { width: auto; flex: 1; }
}
.spacer { height: 16px; }
.dcard:focus-visible, .table tr.row:focus-visible { outline: 2px solid var(--acc); outline-offset: 1px; }
@media (max-width: 860px) { .hide-sm { display: none !important; } }
.split > div:last-child .kv { grid-template-columns: 84px minmax(0, 1fr); }
