:root {
  --bg: #F4F5F7; --card: #FFFFFF; --line: #E3E6EB; --line-2: #CDD2DA;
  --ink: #161A23; --ink-2: #5B6170; --ink-3: #8A90A0;
  --accent: #111111; --accent-ink: #FFFFFF; --hover: #F0F2F5;
  --good: #067647; --good-bg: #ECFDF3; --warn: #B54708; --warn-bg: #FFFAEB;
  --bad: #C01048; --bad-bg: #FFF1F3; --info: #2A78D6; --info-bg: #EAF1FB;
  --s1: #2A78D6; --s2: #EB6834; --s3: #1BAF7A; --s4: #EDA100; --s5: #E87BA4; --s6: #6250D6; --s-other: #A3A9B6;
  --r: 16px; --r-sm: 10px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .04);
  font-family: "Readex Pro", system-ui, -apple-system, "Segoe UI", sans-serif;
  color: var(--ink); background: var(--bg); font-feature-settings: "tnum" 1;
}
* { box-sizing: border-box; }
svg.i { width: 16px; height: 16px; flex: none; }
body { margin: 0; font-size: 14px; line-height: 1.45; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3, h4 { margin: 0; font-weight: 600; }
h1 { font-size: 22px; } h2 { font-size: 16px; } h3 { font-size: 14px; }
.muted { color: var(--ink-2); } .faint { color: var(--ink-3); }
.small { font-size: 12.5px; }
.num { font-variant-numeric: tabular-nums; }
.hidden { display: none !important; }
:focus-visible { outline: 2px solid var(--info); outline-offset: 2px; }

/* shell */
.shell { display: grid; grid-template-columns: 236px 1fr; min-height: 100vh; }
.side { background: var(--card); border-right: 1px solid var(--line); padding: 18px 14px; display: flex; flex-direction: column; gap: 4px; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 18px; }
.logo { width: 36px; height: 36px; border-radius: 10px; background: var(--accent); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 16px; }
.brand b { display: block; font-size: 15px; } .brand span { font-size: 12px; color: var(--ink-2); }
.nav-h { font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); padding: 14px 10px 6px; }
.nav a { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 9px; color: var(--ink-2); text-decoration: none; font-size: 14px; }
.nav a:hover { background: var(--hover); color: var(--ink); }
.nav a[aria-current="page"] { background: var(--accent); color: var(--accent-ink); }
.nav svg { width: 18px; height: 18px; flex: none; }
.nav .count { margin-left: auto; font-size: 11.5px; background: var(--bad-bg); color: var(--bad); border-radius: 999px; padding: 0 7px; }
.nav a[aria-current="page"] .count { background: rgba(255,255,255,.18); color: #fff; }
.side-foot { margin-top: auto; border-top: 1px solid var(--line); padding-top: 12px; display: flex; flex-direction: column; gap: 8px; }
.me { display: flex; align-items: center; gap: 10px; padding: 4px 6px; }
.me .avatar { background: var(--ink); }
.me b { display: block; font-size: 13px; } .me span { font-size: 12px; color: var(--ink-2); }

.main { min-width: 0; }
.top { display: flex; align-items: center; gap: 16px; padding: 18px 32px; flex-wrap: wrap; }
.top h1 { margin-right: auto; }
.content { padding: 4px 32px 56px; display: flex; flex-direction: column; gap: 20px; max-width: 1480px; }

/* parts */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 20px; box-shadow: var(--shadow); min-width: 0; }
.card-h { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.card-h h2 { margin-right: auto; }
.grid { display: grid; gap: 20px; }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g-main { grid-template-columns: minmax(0, 2fr) minmax(300px, 1fr); }
@media (max-width: 1180px) { .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .g-main, .g3 { grid-template-columns: 1fr; } }
@media (max-width: 760px) { .shell { grid-template-columns: 1fr; } .side { position: static; height: auto; } .g4, .g2 { grid-template-columns: 1fr; } .top, .content { padding-left: 16px; padding-right: 16px; } }

.kpi { display: flex; flex-direction: column; gap: 6px; }
.kpi .label { color: var(--ink-2); font-size: 13px; display: flex; align-items: center; gap: 6px; }
.kpi .value { font-size: 30px; font-weight: 600; letter-spacing: -.01em; line-height: 1.1; }
.kpi .value small { font-size: 14px; font-weight: 400; color: var(--ink-2); margin-left: 4px; }
.kpi .row { display: flex; align-items: flex-end; justify-content: space-between; gap: 10px; }
.delta { font-size: 12.5px; border-radius: 999px; padding: 1px 8px; font-weight: 500; white-space: nowrap; }
.delta.up { background: var(--good-bg); color: var(--good); } .delta.down { background: var(--bad-bg); color: var(--bad); } .delta.flat { background: var(--hover); color: var(--ink-2); }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 38px; padding: 0 14px; border-radius: var(--r-sm); border: 1px solid var(--line-2); background: var(--card); cursor: pointer; font-size: 13.5px; font-weight: 500; text-decoration: none; white-space: nowrap; }
.btn:hover { background: var(--hover); }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.btn.primary:hover { background: #2B2B2B; }
.btn.danger { color: var(--bad); }
.btn.sm { min-height: 30px; padding: 0 10px; font-size: 12.5px; }
.btn:disabled { opacity: .5; cursor: default; }
.btn svg { width: 16px; height: 16px; }
.icon-btn { border: 0; background: transparent; cursor: pointer; padding: 6px; border-radius: 8px; color: var(--ink-2); display: inline-grid; place-items: center; }
.icon-btn:hover { background: var(--hover); color: var(--ink); }

input[type=text], input[type=email], input[type=password], input[type=number], input[type=date], input[type=time], input[type=search], select, textarea {
  min-height: 38px; padding: 0 12px; border: 1px solid var(--line-2); border-radius: var(--r-sm); background: var(--card); font-size: 13.5px; min-width: 0;
}
textarea { padding: 10px 12px; min-height: 90px; width: 100%; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--info); outline-offset: 0; border-color: transparent; }
label.field { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--ink-2); }
label.field input, label.field select { color: var(--ink); }
.filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.seg { display: inline-flex; background: var(--hover); border-radius: var(--r-sm); padding: 3px; gap: 2px; }
.seg button { border: 0; background: transparent; padding: 6px 12px; border-radius: 8px; cursor: pointer; font-size: 13px; color: var(--ink-2); }
.seg button[aria-pressed="true"] { background: var(--card); color: var(--ink); box-shadow: 0 1px 2px rgba(0,0,0,.08); font-weight: 500; }

.pill { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; border-radius: 999px; padding: 2px 9px; background: var(--hover); color: var(--ink-2); white-space: nowrap; font-weight: 500; }
.pill .dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.pill.good { background: var(--good-bg); color: var(--good); } .pill.warn { background: var(--warn-bg); color: var(--warn); }
.pill.bad { background: var(--bad-bg); color: var(--bad); } .pill.info { background: var(--info-bg); color: var(--info); }
.pill.dark { background: var(--ink); color: #fff; }

.avatar { width: 30px; height: 30px; border-radius: 50%; display: inline-grid; place-items: center; color: #fff; font-size: 12px; font-weight: 600; flex: none; }
.avatar.lg { width: 56px; height: 56px; font-size: 20px; }
.who { display: inline-flex; align-items: center; gap: 8px; min-width: 0; }
.who span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

table.t { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.t th { text-align: left; font-weight: 500; color: var(--ink-2); font-size: 12.5px; padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.t td { padding: 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.t tr:last-child td { border-bottom: 0; }
.t tr.click { cursor: pointer; } .t tr.click:hover td { background: #FAFBFC; }
.t .r { text-align: right; }
.scroll-x { overflow-x: auto; }
.trunc { max-width: 340px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: block; }

.list { display: flex; flex-direction: column; }
.list > * { padding: 10px 0; border-bottom: 1px solid var(--line); }
.list > *:last-child { border-bottom: 0; }
.attn { display: flex; gap: 10px; align-items: flex-start; cursor: pointer; }
.attn:hover b { text-decoration: underline; }
.attn .ic { width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; flex: none; }
.attn .ic svg { width: 15px; height: 15px; }
.empty { color: var(--ink-2); padding: 18px 0; text-align: center; font-size: 13.5px; }

/* feed */
@keyframes feedIn { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
@keyframes glow { from { background: var(--info-bg); } to { background: transparent; } }
.feed-row { display: flex; gap: 10px; align-items: flex-start; font-size: 13px; cursor: pointer; border-radius: 8px; }
.feed-row.new { animation: feedIn 240ms ease-out both, glow 1600ms ease-out both; }
.feed-row .when { margin-left: auto; color: var(--ink-3); font-size: 12px; white-space: nowrap; }
@keyframes livePulse { 0% { box-shadow: 0 0 0 0 rgba(6,118,71,.45); } 70% { box-shadow: 0 0 0 8px rgba(6,118,71,0); } 100% { box-shadow: 0 0 0 0 rgba(6,118,71,0); } }
.live { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--good); font-weight: 500; }
.live i { width: 8px; height: 8px; border-radius: 50%; background: currentColor; animation: livePulse 2s ease-out infinite; }
.live.off { color: var(--ink-3); } .live.off i { animation: none; }
@media (prefers-reduced-motion: reduce) { .feed-row.new, .live i { animation: none; } }

/* studio day */
.day { display: grid; grid-template-columns: 170px 1fr; gap: 8px 14px; align-items: center; }
.day .hours { position: relative; height: 18px; font-size: 11.5px; color: var(--ink-3); }
.day .hours span { position: absolute; transform: translateX(-50%); }
.lane { position: relative; height: 34px; background: #F7F8FA; border-radius: 8px; }
.lane.off { background: repeating-linear-gradient(135deg, #F4F5F7 0 6px, #ECEEF2 6px 12px); }
.lane .mk { position: absolute; top: 50%; width: 12px; height: 12px; border-radius: 50%; transform: translate(-50%, -50%); border: 2px solid #fff; cursor: pointer; }
.lane .mk.deliv { width: 14px; height: 14px; border-radius: 4px; }
.lane .mk.q { background: #fff !important; border: 2px solid var(--warn); }
.now { position: absolute; top: -4px; bottom: -4px; width: 2px; background: var(--bad); border-radius: 2px; pointer-events: none; }
.now::before { content: "Now"; position: absolute; top: -16px; left: 50%; transform: translateX(-50%); font-size: 10.5px; color: var(--bad); font-weight: 600; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 12.5px; color: var(--ink-2); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }

/* bars */
.bar { height: 8px; background: #EEF0F3; border-radius: 999px; overflow: hidden; display: flex; gap: 2px; }
.bar > i { display: block; height: 100%; border-radius: 999px; }
.load-row { display: grid; grid-template-columns: 150px 1fr 74px; gap: 12px; align-items: center; font-size: 13px; }

/* board */
.board { display: grid; grid-template-columns: repeat(7, minmax(220px, 1fr)); gap: 14px; overflow-x: auto; padding-bottom: 8px; }
.col { background: #ECEEF2; border-radius: 14px; padding: 10px; display: flex; flex-direction: column; gap: 8px; min-height: 200px; }
.col-h { display: flex; align-items: center; justify-content: space-between; font-size: 13px; font-weight: 600; padding: 2px 4px 4px; }
.tcard { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 11px 12px; display: flex; flex-direction: column; gap: 8px; cursor: pointer; border-left: 3px solid var(--c, var(--line)); }
.tcard:hover { border-color: var(--line-2); border-left-color: var(--c); }
.tcard .nm { font-size: 13px; font-weight: 500; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.tcard .meta { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: 12px; color: var(--ink-2); }

/* drawer & modal */
.scrim { position: fixed; inset: 0; background: rgba(17, 17, 17, .32); z-index: 40; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(620px, 100vw); background: var(--card); z-index: 41; box-shadow: -8px 0 24px rgba(0,0,0,.08); display: flex; flex-direction: column; animation: slideIn 200ms ease-out; }
@keyframes slideIn { from { transform: translateX(24px); opacity: 0; } to { transform: none; opacity: 1; } }
.drawer-h { padding: 18px 22px; border-bottom: 1px solid var(--line); display: flex; gap: 12px; align-items: flex-start; }
.drawer-h h2 { font-size: 17px; margin-right: auto; }
.drawer-b { padding: 18px 22px 40px; overflow-y: auto; display: flex; flex-direction: column; gap: 18px; }
.facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 18px; }
.facts div { display: flex; flex-direction: column; gap: 2px; font-size: 13.5px; }
.facts dt, .facts .k { color: var(--ink-2); font-size: 12px; }
.brief { white-space: pre-wrap; font-size: 13.5px; background: #F7F8FA; border-radius: 12px; padding: 12px 14px; }
.brief.clamp { display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.tl { display: flex; flex-direction: column; gap: 0; position: relative; }
.tl-row { display: grid; grid-template-columns: 22px 1fr; gap: 10px; padding-bottom: 14px; position: relative; }
.tl-row::before { content: ""; position: absolute; left: 10px; top: 20px; bottom: 0; width: 2px; background: var(--line); }
.tl-row:last-child::before { display: none; }
.tl-dot { width: 22px; height: 22px; border-radius: 50%; background: var(--hover); display: grid; place-items: center; }
.tl-dot svg { width: 12px; height: 12px; }
.tl-row .txt { font-size: 13px; }
.tl-row .quote { margin-top: 6px; background: #F7F8FA; border-radius: 10px; padding: 8px 10px; white-space: pre-wrap; font-size: 13px; }
.modal { position: fixed; z-index: 51; top: 50%; left: 50%; transform: translate(-50%, -50%); width: min(460px, calc(100vw - 32px)); background: var(--card); border-radius: var(--r); padding: 22px; box-shadow: 0 20px 50px rgba(0,0,0,.18); display: flex; flex-direction: column; gap: 14px; max-height: 90vh; overflow-y: auto; }
.modal-scrim { z-index: 50; }
.modal .actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 6px; }
.toast { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 10px; z-index: 60; font-size: 13.5px; animation: feedIn 200ms ease-out; }
.toast.err { background: var(--bad); }

/* charts */
.chart { width: 100%; display: block; overflow: visible; }
.chart .grid-l { stroke: #EEF0F3; stroke-width: 1; }
.chart .axis { fill: var(--ink-3); font-size: 11px; }
.tip { position: fixed; pointer-events: none; z-index: 70; background: var(--ink); color: #fff; font-size: 12px; padding: 7px 10px; border-radius: 8px; max-width: 260px; line-height: 1.4; }
.tip b { font-weight: 600; }
.donut-wrap { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; }
.donut-legend { display: flex; flex-direction: column; gap: 7px; font-size: 13px; flex: 1; min-width: 150px; }
.donut-legend div { display: flex; align-items: center; gap: 8px; }
.donut-legend i { width: 10px; height: 10px; border-radius: 3px; flex: none; }
.donut-legend b { margin-left: auto; font-weight: 500; }

/* login */
.login { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.login .card { width: min(400px, 100%); padding: 30px; display: flex; flex-direction: column; gap: 16px; }
.login .err { color: var(--bad); font-size: 13px; min-height: 18px; }
.linkish { background: none; border: 0; padding: 0; color: var(--ink-2); text-decoration: underline; cursor: pointer; font-size: 13px; }
.banner { border-radius: 12px; padding: 10px 14px; font-size: 13px; display: flex; gap: 10px; align-items: center; }
.banner.warn { background: var(--warn-bg); color: var(--warn); } .banner.info { background: var(--info-bg); color: #1D5BA6; }
.loading { padding: 80px; text-align: center; color: var(--ink-2); }

/* profile */
.profile-h { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
.profile-h .grow { margin-right: auto; display: flex; flex-direction: column; gap: 4px; }
.days { display: flex; gap: 6px; flex-wrap: wrap; }
.days label { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; border: 1px solid var(--line-2); border-radius: 8px; padding: 4px 8px; cursor: pointer; }

/* report / print */
.report-doc { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 36px 40px; display: flex; flex-direction: column; gap: 22px; }
.report-doc h1 { font-size: 24px; }
.report-doc .sec { break-inside: avoid; }
@media print {
  @page { size: A4; margin: 14mm; }
  body { background: #fff; }
  .side, .top, .no-print, .scrim, .drawer, .toast { display: none !important; }
  .shell { display: block; } .content { padding: 0; max-width: none; }
  .report-doc { border: 0; padding: 0; }
  .card { box-shadow: none; break-inside: avoid; }
}
.tcard .meta svg { width: 13px; height: 13px; vertical-align: -2px; }
.tcard .avatar { width: 22px; height: 22px; font-size: 10px; }
.check { display: inline-flex; align-items: center; gap: 8px; font-size: 13.5px; cursor: pointer; }
.check input { width: 16px; height: 16px; accent-color: #111; }
.feed-row .avatar { width: 26px; height: 26px; font-size: 11px; }
.side .nav a svg { opacity: .9; }
.grid { align-items: start; }
.grid.g4 { align-items: stretch; }
.drawer-h a svg { width: 13px; height: 13px; vertical-align: -2px; }
.board { align-items: start; }
.banner svg { width: 18px; height: 18px; flex: none; }
.now.quiet::before { display: none; }
