/* RWS Tasks design system.  Mobile-first; desktop layout kicks in at 900px.
   One brand blue, neutral greys, hairline borders, 8/12px radii, no decorative gradients. */
:root {
  --brand: #0b4fc4; --brand-hover: #0941a3; --brand-50: #eff5ff; --brand-100: #dbe8ff;
  --bg: #f6f7f9; --surface: #fff; --line: #e6e8ec; --line-strong: #d3d7de;
  --ink: #0f172a; --ink-2: #475569; --ink-3: #8592a6;
  --st-pending: #8b95a7; --st-progress: #2a78d6; --st-done: #0ca30c; --st-late: #d03b3b;
  --p-low: #94a3b8; --p-medium: #2a78d6; --p-high: #d97706; --p-urgent: #dc2626;
  --good: #15803d; --good-bg: #f0fdf4; --bad: #b91c1c; --bad-bg: #fef2f2; --warn: #b45309; --warn-bg: #fffbeb;
  --topbar-h: 56px; --nav-h: 64px; --sidebar-w: 240px;
  --safe-t: env(safe-area-inset-top, 0px); --safe-b: env(safe-area-inset-bottom, 0px);
  --r: 8px; --r-lg: 12px;
  --sh-1: 0 1px 2px rgba(15, 23, 42, .05); --sh-2: 0 4px 14px rgba(15, 23, 42, .08); --sh-3: 0 12px 32px rgba(15, 23, 42, .16);
  --ease: cubic-bezier(.2, .8, .2, 1);
  --font: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; overscroll-behavior-y: none; }
body {
  margin: 0; background: var(--bg); color: var(--ink); font: 400 15px/1.5 var(--font); letter-spacing: -.005em;
  -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent; overscroll-behavior-y: contain;
}
body.no-scroll { overflow: hidden; }
a { color: var(--brand); text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; letter-spacing: inherit; }
button { cursor: pointer; touch-action: manipulation; }
h1, h2, h3, h4 { margin: 0; line-height: 1.25; letter-spacing: -.015em; }
p { margin: 0; }
img { max-width: 100%; }
.hidden, [hidden] { display: none !important; }
.muted { color: var(--ink-2); } .subtle { color: var(--ink-3); } .small { font-size: 12.5px; }
.nowrap { white-space: nowrap; } .tnum { font-variant-numeric: tabular-nums; }

.i { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
.i.sm { width: 16px; height: 16px; } .i.xs { width: 14px; height: 14px; } .i.lg { width: 24px; height: 24px; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
input:focus-visible, select:focus-visible, textarea:focus-visible { outline: none; }

/* ---- avatar ------------------------------------------------------------------------------------ */
.avatar {
  --s: 32px; width: var(--s); height: var(--s); flex: none; border-radius: 50%; position: relative; display: inline-grid; place-items: center;
  background: hsl(var(--h, 215) 70% 93%); color: hsl(var(--h, 215) 60% 28%); font-size: calc(var(--s) * .4); font-weight: 650; user-select: none;
}
.avatar.xs { --s: 20px; } .avatar.sm { --s: 24px; } .avatar.lg { --s: 44px; } .avatar.xl { --s: 64px; }
.avatar .dot { position: absolute; right: -1px; bottom: -1px; width: 25%; height: 25%; min-width: 8px; min-height: 8px; border-radius: 50%; background: #22c55e; border: 2px solid #fff; }
.avatar .dot.off { display: none; }

/* ---- buttons -------------------------------------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 40px; padding: 0 16px; border-radius: var(--r);
  border: 1px solid var(--brand); background: var(--brand); color: #fff; font-weight: 600; font-size: 14px; white-space: nowrap; transition: background .15s, border-color .15s, transform .1s;
}
.btn:hover { background: var(--brand-hover); border-color: var(--brand-hover); }
.btn:active { transform: scale(.98); }
.btn[disabled] { opacity: .55; pointer-events: none; }
.btn.secondary { background: var(--surface); color: var(--ink); border-color: var(--line-strong); }
.btn.secondary:hover { background: var(--bg); border-color: var(--ink-3); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--ink-2); }
.btn.ghost:hover { background: rgba(15, 23, 42, .06); }
.btn.danger { background: #dc2626; border-color: #dc2626; } .btn.danger:hover { background: #b91c1c; border-color: #b91c1c; }
.btn.danger-ghost { background: transparent; border-color: transparent; color: #dc2626; } .btn.danger-ghost:hover { background: var(--bad-bg); }
.btn.success { background: #15803d; border-color: #15803d; }
.btn.sm { min-height: 32px; padding: 0 12px; font-size: 13px; }
.btn.block { width: 100%; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; } .btn-row > .btn { flex: 1; }
.icon-btn { width: 40px; height: 40px; border: 0; border-radius: var(--r); background: transparent; color: var(--ink-2); display: inline-grid; place-items: center; transition: background .15s, color .15s; position: relative; }
.icon-btn:hover { background: rgba(15, 23, 42, .06); color: var(--ink); }
.icon-btn:active { background: rgba(15, 23, 42, .1); }
.icon-btn .badge-dot { position: absolute; top: 8px; right: 9px; width: 9px; height: 9px; border-radius: 50%; background: #dc2626; border: 2px solid #fff; }
.spin { width: 15px; height: 15px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, .4); border-top-color: #fff; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---- shell ------------------------------------------------------------------------------------------ */
.sidebar { display: none; }
.topbar {
  position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 12px; background: rgba(255, 255, 255, .92); backdrop-filter: saturate(1.4) blur(10px);
  height: calc(var(--topbar-h) + var(--safe-t)); padding: var(--safe-t) 16px 0; border-bottom: 1px solid var(--line);
}
.topbar .mark { width: 30px; height: 30px; border-radius: 8px; object-fit: cover; }
.topbar h1 { font-size: 17px; font-weight: 650; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tb-search { display: none; }
.tb-actions { display: flex; align-items: center; gap: 4px; }
.tb-actions .btn { display: none; }
.tb-user { display: none; }

.page { padding: 16px 16px calc(var(--nav-h) + var(--safe-b) + 88px); max-width: 1180px; margin: 0 auto; animation: pageIn .28s var(--ease); }
@keyframes pageIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.page-head { margin-bottom: 16px; display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.page-head h2 { font-size: 22px; font-weight: 700; } .page-head p { color: var(--ink-2); margin-top: 2px; }

.bottom-nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; display: flex; height: calc(var(--nav-h) + var(--safe-b)); padding-bottom: var(--safe-b);
  background: #fff; box-shadow: 0 -1px 0 var(--line), 0 -6px 18px rgba(15, 23, 42, .06);
}
.bottom-nav a { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; color: var(--ink-3); font-size: 11px; font-weight: 600; position: relative; user-select: none; -webkit-user-select: none; }
.bottom-nav .ico { width: 52px; height: 28px; border-radius: 14px; display: grid; place-items: center; transition: background .2s var(--ease), color .2s; }
.bottom-nav a:active .ico { transform: scale(.92); }
.bottom-nav a.active { color: var(--brand); }
.bottom-nav a.active .ico { background: var(--brand-100); }
.nav-badge { position: absolute; top: 6px; left: calc(50% + 6px); min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: #dc2626; color: #fff; font-size: 11px; font-weight: 700; display: grid; place-items: center; border: 2px solid #fff; box-sizing: content-box; }

.fab {
  position: fixed; right: 16px; bottom: calc(var(--nav-h) + var(--safe-b) + 16px); z-index: 35; width: 56px; height: 56px; border-radius: 50%; border: 0; background: var(--brand); color: #fff;
  display: grid; place-items: center; box-shadow: 0 6px 18px rgba(11, 79, 196, .4); transition: transform .3s var(--ease), background .15s;
}
.fab .i { width: 26px; height: 26px; stroke-width: 2; }
.fab:active { transform: scale(.92); } .fab.hide { transform: translateY(140px); }

/* ---- surfaces & atoms ------------------------------------------------------------------------------------ */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--sh-1); }
.card-pad { padding: 16px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 14px 16px 0; }
.card-head h3 { font-size: 14px; font-weight: 650; } .card-head a, .card-head .link { font-size: 13px; font-weight: 600; }
.card-body { padding: 12px 16px 16px; }
.section-title { display: flex; align-items: center; justify-content: space-between; margin: 24px 2px 10px; }
.section-title h3 { font-size: 15px; font-weight: 650; } .section-title a { font-size: 13px; font-weight: 600; }

.pill { display: inline-flex; align-items: center; gap: 6px; padding: 2px 10px 2px 8px; border-radius: 999px; font-size: 12px; font-weight: 600; line-height: 18px; white-space: nowrap; }
.pill .d { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.pill.pending { background: #f1f5f9; color: #475569; } .pill.pending .d { background: var(--st-pending); }
.pill.in_progress { background: var(--brand-50); color: #1d4ed8; } .pill.in_progress .d { background: var(--st-progress); }
.pill.done { background: var(--good-bg); color: var(--good); } .pill.done .d { background: var(--st-done); }
.pill.overdue { background: var(--bad-bg); color: var(--bad); } .pill.overdue .d { background: var(--st-late); }
.pill.role { background: #f1f5f9; color: var(--ink-2); }
.prio { display: inline-flex; align-items: center; gap: 5px; font-size: 13px; color: var(--ink-2); white-space: nowrap; }
.prio .i { width: 15px; height: 15px; } .prio.low .i { color: var(--p-low); } .prio.medium .i { color: var(--p-medium); } .prio.high .i { color: var(--p-high); } .prio.urgent .i { color: var(--p-urgent); }
.prio.urgent { color: var(--bad); font-weight: 600; }
.due { display: inline-flex; align-items: center; gap: 5px; font-size: 13px; color: var(--ink-2); white-space: nowrap; }
.due .i { width: 15px; height: 15px; color: var(--ink-3); } .due.late { color: var(--bad); font-weight: 600; } .due.late .i { color: var(--st-late); }
.st-ico { display: inline-grid; place-items: center; } .st-ico.pending { color: var(--st-pending); } .st-ico.in_progress { color: var(--st-progress); } .st-ico.done { color: var(--st-done); }

.chips { display: flex; gap: 6px; overflow-x: auto; padding: 2px 16px 4px; margin: 0 -16px; scrollbar-width: none; scroll-snap-type: x proximity; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none; display: inline-flex; align-items: center; gap: 6px; padding: 0 13px; height: 34px; border-radius: 999px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink-2);
  font-weight: 600; font-size: 13px; transition: all .15s; scroll-snap-align: start;
}
.chip .n { font-size: 11.5px; padding: 0 6px; border-radius: 999px; background: #eef0f4; color: var(--ink-2); min-width: 20px; text-align: center; line-height: 18px; }
.chip:hover { border-color: var(--ink-3); color: var(--ink); }
.chip.active { background: var(--ink); border-color: var(--ink); color: #fff; } .chip.active .n { background: rgba(255, 255, 255, .2); color: #fff; }
.chip.sm { height: 28px; padding: 0 11px; font-size: 12.5px; }
.chip.sm.active { background: var(--brand); border-color: var(--brand); }

.empty { text-align: center; padding: 56px 20px; color: var(--ink-2); }
.empty .ico { width: 52px; height: 52px; border-radius: 14px; background: #eef0f4; color: var(--ink-3); display: grid; place-items: center; margin: 0 auto 12px; }
.empty .ico .i { width: 26px; height: 26px; } .empty h3 { font-size: 15px; color: var(--ink); margin-bottom: 4px; }

.skeleton { position: relative; overflow: hidden; background: #e9ecf1; border-radius: 8px; }
.skeleton::after { content: ""; position: absolute; inset: 0; transform: translateX(-100%); background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .7), transparent); animation: shimmer 1.3s infinite; }
@keyframes shimmer { to { transform: translateX(100%); } }
.sk-card { height: 84px; border-radius: var(--r-lg); } .sk-kpi { flex: none; width: 150px; height: 88px; border-radius: var(--r-lg); }

/* ---- forms --------------------------------------------------------------------------------------------------- */
.field { display: block; margin-bottom: 16px; }
.field > span { display: block; font-size: 13px; font-weight: 600; color: var(--ink); margin-bottom: 6px; }
.field > span em { color: #dc2626; font-style: normal; } .field > span .opt { font-weight: 400; font-style: normal; color: var(--ink-3); margin-left: 4px; }
.field input, .field select, .field textarea, .input, .select {
  width: 100%; min-height: 44px; padding: 9px 12px; border: 1px solid var(--line-strong); border-radius: var(--r); background: #fff; font-size: 16px; outline: none; transition: border-color .15s, box-shadow .15s;
}
.field textarea { min-height: 92px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus, .input:focus, .select:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(11, 79, 196, .15); }
select, .field select {
  appearance: none; -webkit-appearance: none; padding-right: 34px;
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='none' stroke='%238592a6' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M1 1.5l5 5 5-5'/%3E%3C/svg%3E") no-repeat right 12px center;
}
.field-foot { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; min-height: 18px; margin-top: 4px; }
.field-error { color: #dc2626; font-size: 12.5px; flex: 1; } .counter { font-size: 12px; color: var(--ink-3); margin-left: auto; }
.hint { font-size: 12.5px; color: var(--ink-2); flex: 1; } .hint.warn { color: var(--warn); font-weight: 600; }
.field.invalid input, .field.invalid textarea { border-color: #dc2626; box-shadow: 0 0 0 3px rgba(220, 38, 38, .12); animation: shake .3s; }
@keyframes shake { 25% { transform: translateX(-4px); } 75% { transform: translateX(4px); } }
.error-text { color: #dc2626; font-size: 13.5px; margin: 0 0 12px; }
.seg { display: grid; grid-template-columns: repeat(4, 1fr); gap: 2px; padding: 3px; background: #eef0f4; border-radius: 10px; }
.seg label { position: relative; } .seg input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.seg span { display: flex; align-items: center; justify-content: center; gap: 5px; height: 36px; border-radius: 8px; font-size: 13px; font-weight: 600; color: var(--ink-2); transition: all .15s; }
.seg input:checked + span { background: #fff; color: var(--ink); box-shadow: var(--sh-1), 0 0 0 1px var(--line); }
.seg input:focus-visible + span { outline: 2px solid var(--brand); }
.seg .i { width: 14px; height: 14px; } .seg-low .i { color: var(--p-low); } .seg-medium .i { color: var(--p-medium); } .seg-high .i { color: var(--p-high); } .seg-urgent .i { color: var(--p-urgent); }
.quick { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 8px; }

/* ---- tasks: rows (cards on mobile, table rows on desktop) --------------------------------------------------------- */
.toolbar { display: grid; gap: 10px; margin-bottom: 12px; }
.tool-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.search { position: relative; flex: 1; min-width: 200px; }
.search .i { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--ink-3); width: 18px; height: 18px; pointer-events: none; }
.search input { width: 100%; height: 44px; padding: 0 12px 0 38px; border: 1px solid var(--line-strong); border-radius: var(--r); background: #fff; font-size: 16px; outline: none; }
.search input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(11, 79, 196, .15); }
.select { width: auto; min-height: 36px; padding: 0 30px 0 12px; font-size: 13.5px; font-weight: 500; }
.tool-row .select, .view-toggle { display: none; }
.view-toggle { padding: 2px; background: #eef0f4; border-radius: 9px; gap: 2px; }
.view-toggle button { width: 34px; height: 30px; border: 0; border-radius: 7px; background: transparent; color: var(--ink-2); display: grid; place-items: center; }
.view-toggle button.active { background: #fff; color: var(--ink); box-shadow: var(--sh-1); }

.task-list { display: grid; gap: 10px; }
.task-head { display: none; }
.swipe-item { position: relative; border-radius: var(--r-lg); overflow: hidden; background: var(--bg); animation: rowIn .28s var(--ease) both; }
@keyframes rowIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.swipe-actions { position: absolute; inset: 0 0 0 auto; display: flex; visibility: hidden; }
.swipe-item.swiping .swipe-actions { visibility: visible; }
.swipe-actions button { width: 76px; border: 0; color: #fff; font-size: 12px; font-weight: 600; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; }
.swipe-actions .a-done { background: #15803d; } .swipe-actions .a-move { background: var(--brand); } .swipe-actions .a-del { background: #dc2626; }
.task-row {
  position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 12px 14px 12px 18px;
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; transition: transform .28s var(--ease), background .12s; touch-action: pan-y; cursor: pointer; will-change: transform;
}
.task-row.dragging { transition: none; }
.task-row::before { content: ""; position: absolute; left: 0; top: 10px; bottom: 10px; width: 3px; border-radius: 0 3px 3px 0; background: var(--p-low); }
.task-row.p-medium::before { background: var(--p-medium); } .task-row.p-high::before { background: var(--p-high); } .task-row.p-urgent::before { background: var(--p-urgent); }
.c-check, .c-more { display: none; }
.c-title { order: 1; flex: 1 1 0; min-width: 0; }
.c-status { order: 2; } .c-break { order: 3; flex-basis: 100%; height: 0; }
.c-assignee { order: 4; flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ink-2); }
.c-assignee span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.c-prio { order: 5; } .c-due { order: 6; }
.t-title { display: block; font-weight: 600; font-size: 15px; overflow-wrap: anywhere; } .t-code { font-size: 12px; color: var(--ink-3); font-weight: 500; }
.task-row.is-done .t-title { color: var(--ink-3); text-decoration: line-through; text-decoration-color: #c5cad3; }

/* board */
.board { display: flex; gap: 12px; overflow-x: auto; scroll-snap-type: x mandatory; margin: 0 -16px; padding: 0 16px 8px; }
.b-col { flex: none; width: 84vw; max-width: 340px; scroll-snap-align: start; background: #eef0f4; border-radius: var(--r-lg); padding: 10px; display: flex; flex-direction: column; gap: 8px; min-height: 160px; transition: background .15s, box-shadow .15s; }
.b-col.drop { background: var(--brand-50); box-shadow: inset 0 0 0 2px var(--brand-100), inset 0 0 0 3px var(--brand); }
.b-head { display: flex; align-items: center; gap: 8px; padding: 2px 4px 4px; font-weight: 650; font-size: 13.5px; } .b-head .n { color: var(--ink-3); font-weight: 600; font-size: 12.5px; }
.b-card { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 12px; box-shadow: var(--sh-1); cursor: pointer; transition: box-shadow .15s, transform .15s; display: grid; gap: 10px; animation: rowIn .25s var(--ease) both; }
.b-card:hover { box-shadow: var(--sh-2); } .b-card.is-dragging { opacity: .45; transform: rotate(1.5deg); }
.b-card .t-title { font-size: 14px; } .b-card .foot { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; } .b-card .foot .grow { flex: 1; }
.b-empty { border: 1.5px dashed var(--line-strong); border-radius: 10px; padding: 18px; text-align: center; color: var(--ink-3); font-size: 13px; }
.sentinel { height: 56px; display: grid; place-items: center; color: var(--ink-3); font-size: 13px; }

/* ---- dashboard ------------------------------------------------------------------------------------------------- */
.stat-row { display: flex; gap: 10px; overflow-x: auto; margin: 0 -16px; padding: 2px 16px 10px; scroll-snap-type: x mandatory; scrollbar-width: none; }
.stat-row::-webkit-scrollbar { display: none; }
.stat { flex: none; width: 152px; scroll-snap-align: start; padding: 14px; color: inherit; display: block; transition: border-color .15s, box-shadow .15s, transform .12s; }
.stat:hover { border-color: var(--line-strong); box-shadow: var(--sh-2); } .stat:active { transform: scale(.98); }
.stat .top { display: flex; align-items: center; justify-content: space-between; color: var(--ink-2); font-size: 13px; font-weight: 500; }
.stat .top .chipico { width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; background: #eef0f4; color: var(--ink-2); }
.stat .top .chipico .i { width: 16px; height: 16px; }
.stat.late .chipico { background: var(--bad-bg); color: var(--st-late); } .stat.prog .chipico { background: var(--brand-50); color: var(--st-progress); } .stat.done .chipico { background: var(--good-bg); color: var(--st-done); }
.stat .n { font-size: 30px; font-weight: 700; letter-spacing: -.02em; margin-top: 8px; line-height: 1.1; }
.stat.late .n.nonzero { color: var(--bad); }
.dash-grid { display: grid; gap: 12px; margin-top: 4px; }
.stackbar { display: flex; gap: 2px; height: 12px; margin: 4px 0 14px; }
.stackbar span { border-radius: 4px; min-width: 4px; transition: opacity .15s; } .stackbar span:hover { opacity: .8; }
.legend { display: grid; gap: 8px; }
.legend .row { display: flex; align-items: center; gap: 10px; font-size: 13.5px; } .legend .sw { width: 10px; height: 10px; border-radius: 3px; flex: none; }
.legend .row b { margin-left: auto; font-weight: 650; } .legend .row .pct { width: 44px; text-align: right; color: var(--ink-3); font-size: 12.5px; }
.bars { display: flex; align-items: flex-end; gap: 8px; height: 132px; border-bottom: 1px solid var(--line); padding-top: 22px; }
.bar-col { flex: 1; height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 4px; position: relative; cursor: default; }
.bar-col .bar { width: min(100%, 24px); background: var(--st-progress); border-radius: 4px 4px 0 0; min-height: 2px; transition: height .5s var(--ease), opacity .15s; }
.bar-col.zero .bar { background: var(--line-strong); } .bar-col:hover .bar { opacity: .82; }
.bar-col .val { font-size: 12px; font-weight: 650; color: var(--ink); line-height: 1; }
.bar-axis { display: flex; gap: 8px; margin-top: 6px; } .bar-axis span { flex: 1; text-align: center; font-size: 12px; color: var(--ink-3); } .bar-axis .today { color: var(--ink); font-weight: 650; }
.meter-row { display: grid; grid-template-columns: 90px 1fr 28px; align-items: center; gap: 10px; font-size: 13.5px; } .meter-row + .meter-row { margin-top: 10px; }
.meter { height: 8px; background: #eef0f4; border-radius: 4px; overflow: hidden; } .meter span { display: block; height: 100%; border-radius: 4px; min-width: 0; transition: width .5s var(--ease); }
.meter-row b { text-align: right; font-weight: 650; }
.work-row { display: grid; grid-template-columns: 24px minmax(0, 120px) 1fr auto; align-items: center; gap: 10px; font-size: 13.5px; } .work-row + .work-row { margin-top: 10px; }
.work-row .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.work-row .meter span { background: var(--st-progress); } .work-row .late-note { color: var(--bad); font-size: 12px; font-weight: 600; }
.tip { position: fixed; z-index: 400; background: #0f172a; color: #fff; font-size: 12px; padding: 6px 9px; border-radius: 6px; pointer-events: none; max-width: 240px; box-shadow: var(--sh-2); }
.notify-card { display: flex; gap: 12px; align-items: center; margin-bottom: 14px; padding: 12px 14px; background: var(--brand-50); border-color: var(--brand-100); box-shadow: none; }
.notify-card p { flex: 1; font-size: 13.5px; }

/* ---- employees ------------------------------------------------------------------------------------------------------ */
.emp-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.emp-card { text-align: center; padding: 18px 10px 14px; position: relative; width: 100%; transition: border-color .15s, box-shadow .15s, transform .12s; animation: rowIn .28s var(--ease) both; display: block; color: inherit; }
.emp-card:hover { border-color: var(--line-strong); box-shadow: var(--sh-2); } .emp-card:active { transform: scale(.98); }
.emp-card .avatar { margin: 0 auto 10px; } .emp-card .name { font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.emp-card .dept { font-size: 12.5px; color: var(--ink-2); min-height: 18px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.emp-card .badge-count { position: absolute; top: 10px; right: 10px; min-width: 22px; height: 22px; padding: 0 7px; border-radius: 11px; background: var(--brand-50); color: var(--brand); font-size: 12px; font-weight: 700; display: grid; place-items: center; }
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 16px 0; text-align: center; }
.stat-grid div { background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 10px 4px; }
.stat-grid b { display: block; font-size: 20px; font-weight: 700; } .stat-grid span { font-size: 11.5px; color: var(--ink-2); }
.profile-head { text-align: center; } .profile-head .avatar { margin: 0 auto 10px; } .profile-head h3 { font-size: 19px; }
.contact-list { display: grid; gap: 8px; margin-bottom: 14px; }
.contact-list a { display: flex; align-items: center; gap: 10px; padding: 10px 12px; background: var(--bg); border: 1px solid var(--line); border-radius: 10px; color: var(--ink); font-size: 14px; }
.contact-list a .i { color: var(--ink-3); }

/* ---- settings ----------------------------------------------------------------------------------------------------------- */
.settings { display: grid; gap: 16px; max-width: 760px; }
.settings .card-body p.desc { color: var(--ink-2); font-size: 13.5px; margin-bottom: 14px; }
.notif { display: block; padding: 10px 0; border-bottom: 1px solid var(--line); color: inherit; } .notif:last-child { border: 0; }
.notif b { display: block; font-size: 14px; font-weight: 600; } .notif.unread b::before { content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--brand); margin-right: 7px; vertical-align: 1px; }
.props { display: grid; gap: 2px; margin: 14px 0; }
.prop { display: grid; grid-template-columns: 104px 1fr; align-items: center; gap: 8px; min-height: 40px; }
.prop > label, .prop > .k { display: flex; align-items: center; gap: 8px; color: var(--ink-2); font-size: 13px; }
.prop .select, .prop input { width: 100%; max-width: 260px; min-height: 36px; border: 1px solid transparent; background: transparent; padding: 0 30px 0 8px; font-size: 14px; border-radius: 8px; }
.prop input { padding-right: 8px; } .prop .select:hover, .prop input:hover:not(:disabled) { background: #eef0f4; } .prop .select:focus, .prop input:focus { background: #fff; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(11, 79, 196, .15); }
.prop .select:disabled, .prop input:disabled { background-image: none; padding-right: 8px; opacity: 1; color: var(--ink); -webkit-text-fill-color: var(--ink); }
.detail-title { font-size: 20px; font-weight: 700; overflow-wrap: anywhere; margin: 4px 0 2px; }
.detail-desc { white-space: pre-wrap; overflow-wrap: anywhere; color: var(--ink); padding: 12px 14px; background: var(--bg); border: 1px solid var(--line); border-radius: 10px; margin-bottom: 14px; }
.detail-meta { font-size: 12.5px; color: var(--ink-3); margin-top: 14px; }

/* ---- sheets, drawer, toasts, banners -------------------------------------------------------------------------------------- */
.sheet-backdrop { position: fixed; inset: 0; z-index: 100; background: rgba(15, 23, 42, 0); display: flex; align-items: flex-end; justify-content: center; transition: background .22s; }
.sheet-backdrop.open { background: rgba(15, 23, 42, .45); }
.sheet { width: 100%; max-width: 580px; max-height: 92dvh; display: flex; flex-direction: column; background: #fff; border-radius: 16px 16px 0 0; transform: translateY(100%); transition: transform .3s var(--ease); padding-bottom: var(--safe-b); box-shadow: var(--sh-3); }
.sheet-backdrop.open .sheet { transform: none; } .sheet.dragging { transition: none; }
.sheet-handle { width: 36px; height: 4px; border-radius: 2px; background: #cbd1da; margin: 8px auto 0; flex: none; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; padding: 6px 8px 4px 20px; flex: none; touch-action: none; }
.sheet-head h2 { font-size: 17px; font-weight: 650; }
.sheet-body { padding: 10px 20px 22px; overflow-y: auto; overscroll-behavior: contain; }

#toasts { position: fixed; left: 0; right: 0; top: calc(var(--safe-t) + 12px); z-index: 200; display: grid; justify-items: center; gap: 8px; pointer-events: none; padding: 0 14px; }
.toast { display: flex; align-items: center; gap: 10px; background: #0f172a; color: #fff; padding: 10px 16px; border-radius: 10px; font-size: 14px; font-weight: 500; box-shadow: var(--sh-3); max-width: 100%; animation: toastIn .28s var(--ease); }
.toast .i { width: 18px; height: 18px; } .toast.ok .i { color: #4ade80; } .toast.error .i { color: #fca5a5; }
.toast.out { opacity: 0; transform: translateY(-8px); transition: all .28s; }
@keyframes toastIn { from { opacity: 0; transform: translateY(-10px) scale(.98); } to { opacity: 1; transform: none; } }
#offline-bar { position: fixed; left: 0; right: 0; top: 0; z-index: 150; padding: calc(var(--safe-t) + 5px) 10px 5px; text-align: center; background: #334155; color: #fff; font-size: 12.5px; transform: translateY(-100%); transition: transform .3s var(--ease); }
body.is-offline #offline-bar { transform: none; }
.ptr { position: fixed; left: 50%; top: calc(var(--topbar-h) + var(--safe-t) + 6px); z-index: 25; width: 36px; height: 36px; margin-left: -18px; border-radius: 50%; background: #fff; box-shadow: var(--sh-2); border: 1px solid var(--line); display: grid; place-items: center; opacity: 0; transform: translateY(-60px); pointer-events: none; }
.ptr-spin { width: 18px; height: 18px; border-radius: 50%; border: 2.5px solid var(--brand-100); border-top-color: var(--brand); } .ptr.loading .ptr-spin { animation: spin .7s linear infinite; }
.tip-row { display: flex; gap: 8px; align-items: center; }
.install-banner { position: fixed; left: 12px; right: 12px; bottom: calc(var(--nav-h) + var(--safe-b) + 12px); z-index: 90; display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 14px; background: #fff; border: 1px solid var(--line); box-shadow: var(--sh-3); animation: bannerIn .4s var(--ease); max-width: 520px; margin: 0 auto; }
.install-banner img { width: 44px; height: 44px; border-radius: 10px; } .install-banner .txt { flex: 1; min-width: 0; font-weight: 650; font-size: 14px; line-height: 1.3; } .install-banner .txt small { display: block; font-weight: 400; color: var(--ink-2); }
@keyframes bannerIn { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: none; } }
.ios-steps { padding-left: 20px; line-height: 1.9; }

/* ---- auth ------------------------------------------------------------------------------------------------------------------------- */
.auth { min-height: 100dvh; display: grid; grid-template-columns: 1fr; background: #fff; }
.auth-aside { display: none; }
.auth-main { display: grid; place-items: center; padding: 28px 20px; }
.auth-card { width: 100%; max-width: 380px; }
.auth-card .logo { width: 48px; height: 48px; border-radius: 12px; margin-bottom: 20px; }
.auth-card h1 { font-size: 24px; font-weight: 700; margin-bottom: 4px; } .auth-card > p { color: var(--ink-2); margin-bottom: 24px; }
.auth-foot { margin-top: 20px; font-size: 12.5px; color: var(--ink-3); text-align: center; }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; } }

/* ---- desktop ---------------------------------------------------------------------------------------------------------------------------- */
@media (min-width: 900px) {
  body { font-size: 14px; }
  .bottom-nav, .fab { display: none; }
  .sidebar { display: flex; flex-direction: column; position: fixed; inset: 0 auto 0 0; width: var(--sidebar-w); background: #fff; border-right: 1px solid var(--line); padding: 14px 12px; z-index: 50; }
  .sidebar .brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 16px; font-weight: 700; font-size: 14px; line-height: 1.25; letter-spacing: -.01em; }
  .sidebar .brand img { width: 32px; height: 32px; border-radius: 8px; }
  .sidebar .grp { font-size: 11px; font-weight: 650; color: var(--ink-3); text-transform: uppercase; letter-spacing: .06em; padding: 8px 10px 6px; }
  .sidebar nav { display: grid; gap: 2px; align-content: start; flex: 1; }
  .sidebar nav a { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: var(--r); color: var(--ink-2); font-weight: 550; font-size: 14px; position: relative; transition: background .12s, color .12s; }
  .sidebar nav a:hover { background: #f1f3f6; color: var(--ink); }
  .sidebar nav a.active { background: var(--brand-50); color: var(--brand); } .sidebar nav a.active .i { stroke-width: 2; }
  .sidebar .nav-badge { position: static; margin-left: auto; height: 20px; min-width: 20px; border: 0; box-sizing: border-box; }
  .sidebar .me { display: flex; align-items: center; gap: 10px; padding: 10px 8px 2px; border-top: 1px solid var(--line); margin-top: 10px; }
  .sidebar .me .who { flex: 1; min-width: 0; line-height: 1.25; } .sidebar .me .who b { display: block; font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .sidebar .me .who span { font-size: 12px; color: var(--ink-3); text-transform: capitalize; }
  .sidebar .me .icon-btn { width: 34px; height: 34px; }
  .app { margin-left: var(--sidebar-w); }
  .topbar { padding-left: 28px; padding-right: 24px; gap: 16px; }
  .topbar .mark { display: none; } .topbar h1 { flex: none; font-size: 16px; }
  .tb-search { display: block; position: relative; flex: 1; max-width: 420px; }
  .tb-search .i { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--ink-3); width: 17px; height: 17px; }
  .tb-search input { width: 100%; height: 36px; padding: 0 12px 0 34px; border: 1px solid var(--line); background: #f3f4f7; border-radius: var(--r); font-size: 14px; outline: none; transition: all .15s; }
  .tb-search input:focus { background: #fff; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(11, 79, 196, .15); }
  .tb-actions { margin-left: auto; gap: 8px; } .tb-actions .btn { display: inline-flex; }
  .page { padding: 28px 32px 64px; }
  .page-head h2 { font-size: 24px; }
  .toolbar { grid-template-columns: 1fr; }
  .tool-row .select, .view-toggle { display: inline-flex; }
  .search input { height: 36px; font-size: 14px; } .search .i { width: 17px; height: 17px; }
  .chips { margin: 0; padding: 2px 0 4px; }
  .chip { height: 32px; }
  .field input, .field select, .field textarea { min-height: 38px; font-size: 14px; } .field textarea { min-height: 88px; }
  .task-list { gap: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--sh-1); overflow: hidden; }
  .task-head, .task-row { display: grid; grid-template-columns: 34px minmax(220px, 1fr) 190px 110px 128px 96px 36px; grid-template-areas: "check title assignee prio status due more"; align-items: center; gap: 12px; }
  .task-head { padding: 9px 14px 9px 14px; background: #fafbfc; border-bottom: 1px solid var(--line); font-size: 12px; font-weight: 600; color: var(--ink-3); }
  .task-head span:nth-child(1) { grid-area: check; } .task-head span:nth-child(2) { grid-area: title; } .task-head span:nth-child(3) { grid-area: assignee; } .task-head span:nth-child(4) { grid-area: prio; } .task-head span:nth-child(5) { grid-area: status; } .task-head span:nth-child(6) { grid-area: due; }
  .swipe-item { border-radius: 0; background: transparent; animation: none; } .swipe-item + .swipe-item, .task-head + .swipe-item { border-top: 1px solid var(--line); }
  .swipe-item:first-child { border-top: 0; } .swipe-actions { display: none; }
  .task-row { border: 0; border-radius: 0; padding: 10px 14px; will-change: auto; }
  .task-row:hover { background: #f8f9fb; } .task-row::before { display: none; }
  .c-check, .c-more { display: inline-grid; } .c-break { display: none; }
  .c-check { grid-area: check; width: 28px; height: 28px; border: 0; background: none; border-radius: 50%; place-items: center; padding: 0; color: var(--st-pending); }
  .c-check:hover { background: #eef0f4; } .c-check.done { color: var(--st-done); } .c-check .i { width: 20px; height: 20px; }
  .c-title { grid-area: title; } .c-assignee { grid-area: assignee; } .c-prio { grid-area: prio; } .c-status { grid-area: status; justify-self: start; } .c-due { grid-area: due; } .c-more { grid-area: more; width: 32px; height: 32px; opacity: 0; }
  .task-row:hover .c-more, .c-more:focus-visible { opacity: 1; }
  .t-title { font-size: 14px; } .t-code { display: inline; margin-left: 0; }
  .board { margin: 0; padding: 0 0 8px; scroll-snap-type: none; overflow: visible; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: start; }
  .b-col { width: auto; max-width: none; }
  .stat-row { display: grid; grid-template-columns: repeat(5, 1fr); overflow: visible; margin: 0; padding: 2px 0 0; gap: 12px; }
  .stat { width: auto; }
  .dash-grid { grid-template-columns: repeat(12, 1fr); gap: 16px; margin-top: 16px; }
  .dash-grid > .span-4 { grid-column: span 4; } .dash-grid > .span-5 { grid-column: span 5; } .dash-grid > .span-6 { grid-column: span 6; } .dash-grid > .span-7 { grid-column: span 7; } .dash-grid > .span-8 { grid-column: span 8; } .dash-grid > .span-12 { grid-column: span 12; }
  .emp-grid { grid-template-columns: repeat(4, 1fr); gap: 14px; }
  .settings { grid-template-columns: 1fr; }
  .install-banner { bottom: 20px; left: auto; right: 20px; }
  .ptr { display: none; }
  .sheet-backdrop { align-items: center; }
  .sheet { border-radius: 14px; max-height: 88vh; transform: translateY(16px) scale(.98); opacity: 0; transition: transform .24s var(--ease), opacity .18s; }
  .sheet-backdrop.open .sheet { opacity: 1; transform: none; } .sheet-handle { display: none; } .sheet-head { padding-top: 12px; }
  .sheet-backdrop.drawer-wrap { align-items: stretch; justify-content: flex-end; }
  .sheet.drawer { max-width: 520px; width: 520px; max-height: none; height: 100%; border-radius: 0; transform: translateX(40px); }
  .sheet-backdrop.open .sheet.drawer { transform: none; }
  .sheet.drawer .sheet-body { padding: 8px 24px 24px; }
  .auth { grid-template-columns: 1.05fr 1fr; }
  .auth-aside { display: flex; flex-direction: column; justify-content: space-between; padding: 44px 52px; color: #fff; background: #0a2e75; position: relative; overflow: hidden; }
  .auth-aside::after { content: ""; position: absolute; right: -120px; bottom: -120px; width: 420px; height: 420px; border-radius: 50%; background: rgba(255, 255, 255, .05); }
  .auth-aside .brand { display: flex; align-items: center; gap: 12px; font-weight: 700; font-size: 16px; } .auth-aside .brand img { width: 38px; height: 38px; border-radius: 10px; }
  .auth-aside h2 { font-size: 32px; line-height: 1.2; font-weight: 700; max-width: 420px; margin-bottom: 26px; }
  .auth-aside ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 14px; max-width: 420px; position: relative; z-index: 1; }
  .auth-aside li { display: flex; gap: 12px; color: rgba(255, 255, 255, .86); align-items: flex-start; } .auth-aside li .i { margin-top: 2px; color: #9cc0ff; }
  .auth-aside small { color: rgba(255, 255, 255, .55); }
}

/* dashboard ordering + compact rows (appended) */
.dash-grid .section-title { margin-top: 0; }
.dash-grid > .o1 { order: 1; } .dash-grid > .o2 { order: 2; } .dash-grid > .o3 { order: 3; } .dash-grid > .o4 { order: 4; } .dash-grid > .o5 { order: 5; } .dash-grid > .o6 { order: 6; }
.t-code { display: block; }
@media (min-width: 900px) {
  .dash-grid > * { order: 0 !important; }
  .task-list.compact .task-row { grid-template-columns: 34px minmax(0, 1fr) auto; grid-template-areas: "check title due"; }
  .task-list.compact .c-assignee, .task-list.compact .c-prio, .task-list.compact .c-status, .task-list.compact .c-more { display: none; }
  .task-list.compact .t-code { display: inline; margin-left: 8px; }
}

@media (max-width: 899px) { .page-head.hide-m { display: none; } .page { padding-top: 14px; } }

/* ---- settings (tabbed, modelled on the school system's Site Settings) ---------------------------------------------- */
.crumbs { display: flex; gap: 8px; font-size: 13px; color: var(--ink-3); margin-top: 2px; } .crumbs a { color: var(--ink-2); } .crumbs a:hover { color: var(--brand); }
.tabs { display: flex; gap: 2px; overflow-x: auto; border-bottom: 1px solid var(--line); margin: 0 -16px 18px; padding: 0 12px; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab { flex: none; display: inline-flex; align-items: center; gap: 8px; height: 44px; padding: 0 14px; border: 0; background: none; color: var(--ink-2); font-weight: 600; font-size: 14px; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; transition: color .15s; }
.tab:hover { color: var(--ink); } .tab.active { color: var(--brand); border-bottom-color: var(--brand); }
.panel[hidden] { display: none; } .panel { animation: pageIn .22s var(--ease); }
.settings-grid { display: grid; gap: 16px; max-width: 1080px; align-items: start; }
.two-col { display: grid; gap: 0 14px; }
.desc { color: var(--ink-2); font-size: 13.5px; margin-bottom: 14px; }
.section-rule { font-size: 12px; font-weight: 650; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-3); border-top: 1px solid var(--line); padding-top: 14px; margin: 4px 0 14px; }
.kv { margin: 0; } .kv > div { display: flex; justify-content: space-between; gap: 14px; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 13.5px; } .kv > div:last-child { border: 0; }
.kv dt { color: var(--ink-2); } .kv dd { margin: 0; font-weight: 600; text-align: right; overflow-wrap: anywhere; }
.muted-title { display: flex; align-items: center; gap: 8px; color: var(--ink-2); }
.upload-grid { display: grid; gap: 14px; margin-bottom: 18px; max-width: 1080px; }
.upload-card { border: 2px dashed var(--line-strong); border-radius: var(--r-lg); padding: 16px; background: #fff; display: grid; gap: 12px; align-content: start; transition: border-color .15s, background .15s; }
.upload-card:hover, .upload-card.has-file { border-color: var(--brand); } .upload-card.has-file { background: var(--brand-50); }
.asset-label { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 12px; font-weight: 650; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-2); }
.tag { font-size: 11px; font-weight: 500; text-transform: none; letter-spacing: 0; padding: 1px 8px; border-radius: 999px; background: #eef0f4; color: var(--ink-2); }
.preview { height: 112px; border: 1px solid var(--line); border-radius: 10px; background: #f6f7f9; display: grid; place-items: center; overflow: hidden; text-align: center; }
.preview img { max-width: 100%; max-height: 100%; object-fit: contain; } .preview .none { font-size: 13px; color: var(--ink-3); } .preview img[hidden] + .none { display: block; } .preview:has(img:not([hidden])) .none { display: none; }
.file-btn { position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 40px; border: 1px solid var(--line-strong); border-radius: var(--r); background: #fff; font-weight: 600; font-size: 14px; cursor: pointer; overflow: hidden; }
.file-btn:hover { background: var(--bg); } .file-btn input { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; }
.file-btn span { max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.inline-add { display: flex; gap: 8px; margin-bottom: 12px; }
.inline-add input { flex: 1; min-width: 0; min-height: 44px; padding: 0 12px; border: 1px solid var(--line-strong); border-radius: var(--r); font-size: 16px; outline: none; }
.inline-add input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(11, 79, 196, .15); }
.rows .row-item { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); } .rows .row-item:last-child { border: 0; }
.rows .row-item .nm { flex: 1; min-width: 0; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rows .row-item .icon-btn { width: 34px; height: 34px; } .rows .row-item .icon-btn[disabled] { opacity: .35; pointer-events: none; }
.switch { display: flex; gap: 12px; align-items: flex-start; cursor: pointer; position: relative; }
.switch > input { position: absolute; opacity: 0; width: 40px; height: 24px; margin: 0; cursor: pointer; }
.switch .track { width: 40px; height: 24px; border-radius: 12px; background: #cbd1da; flex: none; position: relative; transition: background .2s; margin-top: 1px; }
.switch .track::after { content: ""; position: absolute; left: 2px; top: 2px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(15, 23, 42, .3); transition: transform .2s var(--ease); }
.switch input:checked + .track { background: var(--brand); } .switch input:checked + .track::after { transform: translateX(16px); }
.switch input:focus-visible + .track { outline: 2px solid var(--brand); outline-offset: 2px; }
.switch b { display: block; font-size: 14px; } .switch small { display: block; color: var(--ink-2); font-size: 12.5px; margin-top: 2px; }
@media (min-width: 900px) {
  .tabs { margin: 0 0 20px; padding: 0; }
  .settings-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .two-col { grid-template-columns: 1fr 1fr; }
  .upload-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

.row-item .sub { display: block; font-size: 12.5px; color: var(--ink-3); font-weight: 400; }
.row-item .grow { flex: 1; min-width: 0; } .row-item.inactive .nm { color: var(--ink-3); }
.pill.off { background: #f1f5f9; color: var(--ink-3); } .pill.on { background: var(--good-bg); color: var(--good); } .pill.sys { background: var(--brand-50); color: var(--brand); }
.perm-group { border: 1px solid var(--line); border-radius: 10px; margin-bottom: 12px; overflow: hidden; }
.perm-group > header { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 9px 12px; background: #fafbfc; border-bottom: 1px solid var(--line); font-weight: 650; font-size: 13.5px; }
.perm-group > header button { border: 0; background: none; color: var(--brand); font-weight: 600; font-size: 12.5px; padding: 4px 6px; border-radius: 6px; } .perm-group > header button:hover { background: var(--brand-50); }
.perm-row { display: flex; gap: 12px; align-items: flex-start; padding: 10px 12px; border-bottom: 1px solid var(--line); cursor: pointer; } .perm-row:last-child { border: 0; }
.perm-row input { width: 18px; height: 18px; margin-top: 2px; accent-color: var(--brand); flex: none; }
.perm-row b { display: block; font-size: 14px; font-weight: 600; } .perm-row small { color: var(--ink-2); font-size: 12.5px; }
.perm-row.locked { opacity: .7; cursor: default; }

.pill.bad { background: var(--bad-bg); color: var(--bad); } .pill.warn { background: var(--warn-bg); color: var(--warn); }
.tpl-grid { display: grid; gap: 16px; align-items: start; }
.tpl textarea { width: 100%; min-height: 96px; padding: 10px 12px; border: 1px solid var(--line-strong); border-radius: var(--r); font-size: 16px; line-height: 1.4; resize: vertical; outline: none; }
.tpl textarea:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(11, 79, 196, .15); }
.tpl .chips-row { display: flex; gap: 6px; flex-wrap: wrap; margin: 8px 0; }
.tpl .chips-row button { border: 1px solid var(--line-strong); background: #fff; border-radius: 999px; padding: 2px 10px; font-size: 12.5px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; color: var(--brand); }
.tpl .chips-row button:hover { background: var(--brand-50); border-color: var(--brand); }
.tpl .preview-box { background: var(--bg); border: 1px dashed var(--line-strong); border-radius: 10px; padding: 10px 12px; font-size: 13.5px; white-space: pre-wrap; overflow-wrap: anywhere; }
.tpl .meta-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 6px 0 12px; font-size: 12.5px; color: var(--ink-3); }
.log-msg { display: block; font-size: 12.5px; color: var(--ink-2); font-weight: 400; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
@media (min-width: 900px) { .tpl-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
