:root {
  --bg: #F2F3F1; --surface: #FFFFFF; --line: #DDE0DB; --line-strong: #B9BEB7;
  --ink: #15201C; --muted: #56615B; --accent: #1E5A48; --accent-ink: #123A2F; --accent-soft: #E3EEE9;
  --warn-bg: #FBF0DB; --warn-ink: #6E4506; --err-bg: #FBE7E4; --err-ink: #8A2518;
  --radius: 10px;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.5 'Figtree', 'Segoe UI', system-ui, sans-serif; }
a { color: var(--accent); }
h1 { font-size: 26px; margin: 0; letter-spacing: -0.01em; }
h2 { font-size: 17px; margin: 0; }
h3 { font-size: 15px; margin: 0; }
img { max-width: 100%; display: block; }
.app { display: flex; min-height: 100vh; }
.side { width: 240px; flex-shrink: 0; align-self: flex-start; background: var(--surface); border-right: 1px solid var(--line); padding: 22px 14px; display: flex; flex-direction: column; gap: 18px; position: sticky; top: 0; height: 100vh; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; padding: 0 8px; }
.brand span { width: 30px; height: 30px; border-radius: 8px; background: var(--accent); color: #fff; display: grid; place-items: center; font-size: 13px; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a { display: flex; justify-content: space-between; align-items: center; min-height: 40px; padding: 0 12px; border-radius: 8px; color: var(--ink); text-decoration: none; }
.nav a:hover { background: var(--bg); }
.nav a.on { background: var(--accent-soft); color: var(--accent-ink); font-weight: 700; }
.badge { background: var(--accent); color: #fff; border-radius: 999px; font-size: 12px; padding: 1px 8px; }
.side-foot { margin-top: auto; font-size: 13px; color: var(--muted); padding: 0 8px; display: flex; flex-direction: column; gap: 6px; }
.main { flex: 1; min-width: 0; padding: 28px 32px 48px; display: flex; flex-direction: column; gap: 20px; }
.head { display: flex; flex-wrap: wrap; gap: 12px; justify-content: space-between; align-items: flex-end; }
.muted { color: var(--muted); font-size: 13px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.cols { display: flex; flex-wrap: wrap; gap: 20px; align-items: flex-start; }
.grid { display: grid; gap: 14px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g5 { grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); }
.btn { font: inherit; font-weight: 600; font-size: 14px; min-height: 42px; padding: 0 16px; border-radius: 8px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink); cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.btn:hover { border-color: var(--ink); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { background: var(--accent-ink); }
.btn.danger { color: var(--err-ink); border-color: transparent; background: transparent; }
.btn.small { min-height: 32px; padding: 0 10px; font-size: 13px; }
.chip { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; padding: 4px 12px; border-radius: 999px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink); text-decoration: none; }
label.chip { cursor: pointer; }
.chip input { accent-color: var(--accent); margin: 0; }
.chip:has(input:checked), .chip.on { background: var(--accent-soft); border-color: var(--accent); color: var(--accent-ink); font-weight: 600; }
label.field { display: flex; flex-direction: column; gap: 6px; font-weight: 600; font-size: 13px; }
input[type=text], input[type=email], input[type=password], input[type=url], input[type=search], input[type=number], input[type=datetime-local], input[type=time], select, textarea {
  font: inherit; font-size: 14px; font-weight: 400; padding: 9px 12px; border: 1px solid var(--line-strong); border-radius: 8px; background: #fff; color: var(--ink); width: 100%; min-height: 40px; }
textarea { resize: vertical; line-height: 1.5; }
input:focus, select:focus, textarea:focus, .btn:focus-visible, a:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.check { display: flex; gap: 8px; align-items: center; font-size: 14px; }
.check input { width: 18px; height: 18px; accent-color: var(--accent); }
.flash { padding: 12px 16px; border-radius: 8px; background: var(--accent-soft); color: var(--accent-ink); }
.flash.error { background: var(--err-bg); color: var(--err-ink); }
.note { padding: 10px 14px; border-radius: 8px; background: var(--warn-bg); color: var(--warn-ink); font-size: 14px; }
.pill { font-size: 12px; font-weight: 600; padding: 2px 10px; border-radius: 999px; background: var(--bg); color: var(--muted); white-space: nowrap; }
.pill.ok { background: var(--accent-soft); color: var(--accent-ink); }
.pill.warn { background: var(--warn-bg); color: var(--warn-ink); }
.pill.err { background: var(--err-bg); color: var(--err-ink); }
.thumb { aspect-ratio: 4 / 5; background: var(--bg); border-radius: 8px; overflow: hidden; border: 1px solid var(--line); display: grid; place-items: center; color: var(--muted); font-size: 12px; }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.list { display: flex; flex-direction: column; gap: 2px; }
.list a { display: flex; gap: 12px; align-items: center; padding: 8px; border-radius: 8px; color: var(--ink); text-decoration: none; }
.list a:hover { background: var(--bg); }
.list a.on { background: var(--accent-soft); }
.list .mini { width: 44px; height: 55px; flex-shrink: 0; border-radius: 6px; overflow: hidden; background: var(--bg); }
.list .mini img { width: 100%; height: 100%; object-fit: cover; }
.tabs { display: flex; gap: 6px; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th, .table td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table th { font-size: 12px; color: var(--muted); font-weight: 600; }
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.cal .dow { font-size: 12px; color: var(--muted); padding: 0 4px; }
.cal .day { min-height: 118px; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 6px; display: flex; flex-direction: column; gap: 4px; }
.cal .day.out { background: transparent; }
.cal .day.out .num { color: var(--muted); }
.cal .day.today { border-color: var(--accent); }
.cal .num { font-size: 12px; font-weight: 700; }
.cal .ev { display: flex; gap: 6px; align-items: center; font-size: 12px; padding: 3px; border-radius: 6px; background: var(--bg); color: var(--ink); text-decoration: none; }
.cal .ev img { width: 24px; height: 30px; object-fit: cover; border-radius: 3px; }
.cal .ev.draft { background: transparent; border: 1px dashed var(--line-strong); }
.cal .ev.published { background: var(--accent-soft); }
.cal .ev.failed { background: var(--err-bg); }
.selectable { position: relative; display: flex; flex-direction: column; gap: 6px; }
.selectable input { position: absolute; top: 8px; left: 8px; width: 22px; height: 22px; accent-color: var(--accent); }
.selectable input:checked + .thumb { outline: 3px solid var(--accent); }
.bar { position: sticky; bottom: 12px; display: flex; flex-wrap: wrap; gap: 10px; align-items: center; background: var(--ink); color: #fff; border-radius: var(--radius); padding: 12px 16px; }
.bar .btn { border-color: #fff; }
.phone { border: 1px solid var(--line); border-radius: 16px; padding: 12px; display: flex; flex-direction: column; gap: 10px; }
.caption-preview { white-space: pre-line; font-size: 14px; }
.login { max-width: 380px; margin: 12vh auto; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
@media (max-width: 860px) {
  .app { flex-direction: column; }
  .side { width: auto; height: auto; position: static; }
  .main { padding: 20px 16px 40px; }
  .g2, .g3 { grid-template-columns: 1fr; }
  .cal { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cal .dow { display: none; }
}
.tenant-switch { padding: 0 4px; }
.tenant-switch select { width: 100%; font-weight: 600; }

/* Help */
.help { display: grid; gap: 14px; max-width: 820px; }
.help-toc { max-width: 820px; padding: 14px 16px; }
.help-toc .chips { display: flex; flex-wrap: wrap; gap: 8px; }
.help p, .help li { line-height: 1.55; margin: 0; }
.help ul, .help ol { margin: 0; padding-left: 20px; display: grid; gap: 6px; }
.help h3 { font-size: 15px; margin: 4px 0 0; }
.help section { scroll-margin-top: 16px; }
