/* Tiuri Admin (ADR-027). Same palette as the website tokens. */
:root {
  --bg: #F7F3EA; --surface: #FFFDF8; --surface-2: #EFE9DD; --brand: #1E4638; --brand-2: #183A2E;
  --accent: #A8431F; --accent-2: #8E3818; --text: #15251F; --text-2: #58655F; --border: #E2DBCD;
  --border-strong: #848C85; --focus: #A8431F; --ok-bg: #E6F0E1; --ok: #2E6B2F; --warn-bg: #F7EEC6;
  --warn: #735A00; --crit-bg: #F9E3E7; --crit: #A3223B; --info-bg: #E3ECF5; --info: #2C567F;
  --on-accent: #FFFFFF; --code-bg: #EFE9DD;
  --radius: 10px; --font: "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
  --mono: ui-monospace, "Cascadia Code", Consolas, monospace;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0F1915; --surface: #16231E; --surface-2: #1B2A24; --brand: #9CC8B3; --brand-2: #B5D8C7;
    --accent: #E08A62; --accent-2: #EBA083; --text: #ECE7DC; --text-2: #B3BDB6; --border: #2A3A33;
    --border-strong: #6E7C75; --focus: #E08A62; --ok-bg: #1D3320; --ok: #9FD39F; --warn-bg: #3A3315;
    --warn: #E8D27A; --crit-bg: #3D1C24; --crit: #F2A7B6; --info-bg: #1B2B3B; --info: #A9C8E8;
    --on-accent: #15251F; --code-bg: #1B2A24;
  }
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--text); font: 15px/1.5 var(--font); }
[hidden] { display: none !important; }
a { color: var(--accent); }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 12px; top: 8px; background: var(--surface); padding: 8px 12px; z-index: 10; }
.top { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 24px; border-bottom: 1px solid var(--border); background: var(--surface); position: sticky; top: 0; z-index: 5; }
.brand { font-weight: 700; font-size: 20px; color: var(--text); text-decoration: none; }
.brand .mark { color: var(--accent); }
.brand-sub { font-weight: 500; color: var(--text-2); font-size: 15px; margin-left: 4px; }
.who { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; color: var(--text-2); font-size: 14px; }
.who-name { color: var(--text); }
.layout { display: grid; grid-template-columns: 220px 1fr; min-height: calc(100vh - 57px); }
.layout:has(> .side[hidden]) { grid-template-columns: 1fr; }
.side { border-right: 1px solid var(--border); padding: 16px 8px; background: var(--surface); }
.side a { display: block; padding: 8px 12px; border-radius: 8px; color: var(--text); text-decoration: none; }
.side a:hover { background: var(--surface-2); }
.side a[aria-current="page"] { background: var(--surface-2); font-weight: 600; box-shadow: inset 3px 0 0 var(--accent); }
main { padding: 28px 32px 64px; max-width: 1080px; width: 100%; }
main:focus { outline: none; }
h1 { font-size: 28px; margin: 0 0 6px; line-height: 1.2; }
h2 { font-size: 19px; margin: 28px 0 10px; }
h3 { font-size: 16px; margin: 18px 0 8px; }
.lead { color: var(--text-2); margin: 0 0 20px; max-width: 70ch; }
.muted { color: var(--text-2); }
.small { font-size: 13px; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; }
.card .big { font-size: 26px; font-weight: 650; line-height: 1.2; margin: 4px 0; }
.card .label { color: var(--text-2); font-size: 13px; text-transform: none; }
.narrow { max-width: 520px; }
.stack > * + * { margin-top: 14px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 40px; padding: 0 16px; border-radius: 8px; border: 1px solid transparent; font: 600 14px var(--font); cursor: pointer; text-decoration: none; }
.btn-primary { background: var(--accent); color: var(--on-accent); }
.btn-primary:hover { background: var(--accent-2); }
.btn-secondary { background: var(--surface); color: var(--text); border-color: var(--border-strong); }
.btn-secondary:hover { background: var(--surface-2); }
.btn-ghost { background: none; color: var(--text); border-color: var(--border); min-height: 32px; padding: 0 10px; }
.btn-danger { background: none; color: var(--crit); border-color: var(--crit); }
.btn[disabled] { opacity: 0.55; cursor: not-allowed; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
label.field { display: grid; gap: 4px; font-weight: 600; }
.field .hint { font-weight: 400; color: var(--text-2); font-size: 13px; }
input[type="text"], input[type="number"], select, textarea {
  font: 15px var(--font); color: var(--text); background: var(--surface); border: 1px solid var(--border-strong);
  border-radius: 8px; padding: 9px 11px; width: 100%; max-width: 520px;
}
textarea { font-family: var(--mono); font-size: 13px; min-height: 90px; max-width: 100%; }
[aria-invalid="true"] { border-color: var(--crit); }
.error { color: var(--crit); font-size: 13px; font-weight: 500; }
.notice { padding: 12px 14px; border-radius: 8px; background: var(--info-bg); color: var(--info); }
.notice.warn { background: var(--warn-bg); color: var(--warn); }
.notice.ok { background: var(--ok-bg); color: var(--ok); }
.notice.crit { background: var(--crit-bg); color: var(--crit); }
table { width: 100%; border-collapse: collapse; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--border); vertical-align: top; }
th { font-size: 13px; color: var(--text-2); font-weight: 600; background: var(--surface-2); }
tr:last-child td { border-bottom: none; }
.table-wrap { overflow-x: auto; }
code, pre { font-family: var(--mono); font-size: 13px; }
pre { background: var(--code-bg); border-radius: 8px; padding: 12px; overflow: auto; max-height: 360px; white-space: pre; }
.codes { display: grid; grid-template-columns: repeat(2, minmax(0, 160px)); gap: 6px 16px; font-family: var(--mono); font-size: 16px; padding: 14px; background: var(--code-bg); border-radius: 8px; width: max-content; }
.tabs { display: flex; gap: 6px; flex-wrap: wrap; border-bottom: 1px solid var(--border); margin-bottom: 12px; }
.tabs button { background: none; border: 0; border-bottom: 3px solid transparent; padding: 8px 10px; font: 600 14px var(--font); color: var(--text-2); cursor: pointer; }
.tabs button[aria-selected="true"] { color: var(--text); border-bottom-color: var(--accent); }
.policy-group { border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); padding: 6px 18px 18px; margin-bottom: 14px; }
.policy-grid { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.sticky { position: sticky; top: 76px; }
.confirm { margin-top: 10px; padding: 12px; border-radius: 8px; background: var(--warn-bg); }
.check { display: flex; gap: 10px; align-items: flex-start; }
.toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: var(--text); color: var(--bg); padding: 10px 16px; border-radius: 8px; opacity: 0; pointer-events: none; transition: opacity 160ms; max-width: 90vw; }
.toast.show { opacity: 1; }
.badge { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 12px; font-weight: 600; background: var(--surface-2); color: var(--text-2); }
.badge.ok { background: var(--ok-bg); color: var(--ok); }
.badge.warn { background: var(--warn-bg); color: var(--warn); }
ol.steps { padding-left: 20px; }
ol.steps li + li { margin-top: 6px; }
.checklist li { margin: 6px 0; }
.done { color: var(--ok); }
@media (max-width: 860px) {
  .layout { grid-template-columns: 1fr; }
  .side { border-right: 0; border-bottom: 1px solid var(--border); display: flex; overflow-x: auto; padding: 8px; gap: 4px; }
  .side a { white-space: nowrap; }
  main { padding: 20px 16px 48px; }
  .policy-grid { grid-template-columns: 1fr; }
  .sticky { position: static; }
}
@media (prefers-reduced-motion: reduce) { .toast { transition: none; } }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
