:root {
  --brand: #047857; --brand-strong: #065f46; --brand-soft: #ecfdf5; --ink: #0f2a22; --text: #334155; --muted: #64748b;
  --line: #e2e8f0; --bg: #f6f8f6; --card: #fff; --warn: #b45309; --warn-soft: #fffbeb; --bad: #b91c1c; --bad-soft: #fef2f2;
  --busy: #1d4ed8; --busy-soft: #eff6ff; --radius: 14px;
}
* { box-sizing: border-box; }
body { margin: 0; font: 15px/1.55 ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; color: var(--text); background: var(--bg); }
a { color: var(--brand); }
h1, h2, h3 { color: var(--ink); line-height: 1.25; margin: 0 0 .6em; }
h1 { font-size: 26px; } h2 { font-size: 19px; } h3 { font-size: 16px; }
.topbar { position: sticky; top: 0; z-index: 10; background: #fff; border-bottom: 1px solid var(--line); }
.topbar-inner { max-width: 1240px; margin: 0 auto; padding: 10px 20px; display: flex; align-items: center; gap: 22px; flex-wrap: wrap; }
.logo { display: flex; align-items: center; gap: 8px; font-weight: 800; font-size: 18px; color: var(--ink); text-decoration: none; }
.logo b { color: var(--brand); }
.logo small { font-weight: 600; color: var(--muted); font-size: 13px; }
nav { display: flex; gap: 4px; flex-wrap: wrap; }
nav a { padding: 7px 12px; border-radius: 9px; color: var(--text); text-decoration: none; font-weight: 600; }
nav a:hover { background: var(--bg); }
nav a.on { background: var(--brand-soft); color: var(--brand-strong); }
.topbar .quota { margin-left: auto; }
main { max-width: 1240px; margin: 0 auto; padding: 24px 20px 60px; }
.grid { display: grid; gap: 18px; }
.grid.two { grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); }
.grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid.four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 900px) { .grid.two, .grid.three, .grid.four { grid-template-columns: 1fr; } }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; }
.card + .card { margin-top: 18px; }
.section { margin-top: 26px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.spread { justify-content: space-between; }
.muted { color: var(--muted); } .small { font-size: 13px; }
label { display: block; font-weight: 600; color: var(--ink); margin: 12px 0 6px; }
input[type=text], input[type=password], input[type=datetime-local], input[type=number], textarea, select {
  width: 100%; font: inherit; color: var(--ink); background: #fff; border: 1px solid #cbd5e1; border-radius: 10px; padding: 9px 11px; }
textarea { resize: vertical; min-height: 90px; }
textarea.big { min-height: 120px; font-size: 16px; }
textarea.caption { min-height: 260px; font-size: 14px; }
input:focus, textarea:focus, select:focus { outline: 2px solid var(--brand); outline-offset: 1px; border-color: var(--brand); }
.checks { display: flex; gap: 16px; flex-wrap: wrap; }
.checks label { display: flex; gap: 6px; align-items: center; font-weight: 500; margin: 0; }
details summary { cursor: pointer; font-weight: 600; color: var(--brand-strong); margin-top: 12px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 0; border-radius: 10px; padding: 10px 16px;
  font: inherit; font-weight: 700; cursor: pointer; text-decoration: none; background: var(--brand); color: #fff; }
.btn:hover { background: var(--brand-strong); }
.btn.ghost { background: #fff; color: var(--brand-strong); box-shadow: inset 0 0 0 1px #a7c4b5; }
.btn.ghost:hover { background: var(--brand-soft); }
.btn.small { padding: 6px 11px; font-size: 13px; border-radius: 8px; }
.btn.danger { background: #fff; color: var(--bad); box-shadow: inset 0 0 0 1px #fecaca; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: 12.5px; font-weight: 700; white-space: nowrap; }
.chip.ok { background: var(--brand-soft); color: var(--brand-strong); }
.chip.todo { background: #fef3c7; color: #92400e; }
.chip.busy { background: var(--busy-soft); color: var(--busy); }
.chip.wait { background: var(--warn-soft); color: var(--warn); }
.chip.bad { background: var(--bad-soft); color: var(--bad); }
.chip.muted { background: #f1f5f9; color: var(--muted); }
.chip.busy::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; animation: pulse 1.2s infinite; }
@keyframes pulse { 50% { opacity: .25; } }
.notice { border-radius: 12px; padding: 12px 14px; margin: 12px 0; }
.notice.warn { background: var(--warn-soft); color: #78350f; border: 1px solid #fde68a; }
.notice.bad { background: var(--bad-soft); color: #7f1d1d; border: 1px solid #fecaca; }
.notice.info { background: var(--busy-soft); color: #1e3a8a; border: 1px solid #bfdbfe; }
.quota-pill { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 999px; background: var(--bg); font-weight: 600; font-size: 13px; color: var(--ink); text-decoration: none; }
.bar { height: 8px; border-radius: 99px; background: #e2e8f0; overflow: hidden; min-width: 80px; }
.bar i { display: block; height: 100%; background: var(--brand); }
.kpi { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
.kpi .label { font-size: 13px; color: var(--muted); font-weight: 600; }
.kpi .value { font-size: 26px; font-weight: 800; color: var(--ink); margin-top: 2px; }
.kpi .delta { font-size: 12.5px; font-weight: 700; }
.delta.up { color: var(--brand); } .delta.down { color: var(--bad); }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; font-size: 12.5px; color: var(--muted); font-weight: 700; padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 10px; border-bottom: 1px solid #f1f5f9; vertical-align: top; }
td.num, th.num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
tr:hover td { background: #fafcfb; }
.table-wrap { overflow-x: auto; }
.thumb { width: 54px; height: 68px; object-fit: cover; border-radius: 8px; background: #e2e8f0; display: block; }
.clip { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; max-width: 520px; }
.variants { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 14px; }
.variant { position: relative; border: 2px solid var(--line); border-radius: 14px; overflow: hidden; background: #fff; }
.variant.on { border-color: var(--brand); box-shadow: 0 0 0 3px #a7f3d0; }
.variant img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; display: block; background: #e2e8f0; }
.variant .ph { width: 100%; aspect-ratio: 4 / 5; display: grid; place-items: center; background: repeating-linear-gradient(45deg, #f1f5f9, #f1f5f9 10px, #e9eef3 10px, #e9eef3 20px); color: var(--muted); font-weight: 600; text-align: center; padding: 10px; }
.variant .meta { padding: 10px 12px; font-size: 13px; }
.variant .pick { display: flex; align-items: center; gap: 8px; font-weight: 700; color: var(--ink); margin: 0; cursor: pointer; }
.variant .flaw { color: var(--warn); margin-top: 4px; }
.post-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 14px; }
.post-card { display: block; text-decoration: none; color: inherit; background: #fff; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.post-card img, .post-card .ph { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; display: block; background: #e2e8f0; }
.post-card .ph { display: grid; place-items: center; color: var(--muted); font-size: 13px; }
.post-card div { padding: 9px 11px; font-size: 13px; }
.day { margin-top: 18px; }
.day h3 { font-size: 15px; margin-bottom: 8px; }
.list { display: grid; gap: 8px; }
.item { display: flex; gap: 12px; align-items: flex-start; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 10px; }
.item .when { font-weight: 800; color: var(--ink); min-width: 52px; }
.empty { color: var(--muted); padding: 18px; text-align: center; border: 1px dashed #cbd5e1; border-radius: 12px; }
.counter { font-size: 12px; color: var(--muted); text-align: right; }
.chart-box { position: relative; height: 260px; }

/* sign-in */
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.login-card { width: 100%; max-width: 380px; }
.login-card h1 { font-size: 22px; margin: 4px 0 2px; color: var(--ink); }
.login-card .btn { width: 100%; margin-top: 18px; }
.login-card input[name=code] { letter-spacing: 6px; font-size: 20px; text-align: center; }
.logout { margin-left: 8px; }
.logout button { background: none; border: 0; color: var(--muted); cursor: pointer; font: inherit; font-size: 13px; }
.logout button:hover { color: var(--ink); }

/* social network icons */
.ni { width: 16px; height: 16px; flex: none; display: inline-block; vertical-align: -3px; }
.net { display: inline-flex; align-items: center; gap: 6px; }
.nets { display: inline-flex; gap: 5px; align-items: center; }
h3 .ni, .kpi .label .ni { width: 18px; height: 18px; }
