:root {
  color-scheme: light;
  --ink: #26352b;
  --muted: #6d796f;
  --leaf: #3e7653;
  --leaf-dark: #28553a;
  --cream: #fbf7ec;
  --paper: #fffdf7;
  --line: #e5ddca;
  --gold: #d9a83f;
  --danger: #b44e46;
  --shadow: 0 12px 36px rgb(50 57 43 / 10%);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html, body { min-height: 100%; margin: 0; }
body { color: var(--ink); background: var(--cream); }
a { color: inherit; }
button, input, select, textarea { font: inherit; }
.public-shell { background: radial-gradient(circle at 20% 10%, #eef3df, var(--cream) 44%); }
.public-main { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.auth-card { width: min(100%, 430px); padding: 36px; border: 1px solid var(--line); border-radius: 24px; background: var(--paper); box-shadow: var(--shadow); }
.auth-card.wide { width: min(100%, 650px); }
.auth-card h1 { margin: 14px 0 6px; }
.brand-mark { width: 48px; height: 48px; display: inline-grid; place-items: center; border-radius: 15px; color: white; background: var(--leaf); font-weight: 800; }
.muted { color: var(--muted); }
form label:not(.check) { display: block; margin: 18px 0 7px; font-size: .88rem; font-weight: 700; }
input, select, textarea { width: 100%; min-height: 44px; padding: 10px 12px; border: 1px solid #cfc7b7; border-radius: 10px; background: white; color: var(--ink); }
textarea { min-height: 96px; resize: vertical; }
input:focus, select:focus, textarea:focus, button:focus-visible, a:focus-visible { outline: 3px solid rgb(217 168 63 / 35%); outline-offset: 2px; }
.check { display: flex; gap: 9px; align-items: center; margin: 18px 0; }
.check input { width: 18px; min-height: 18px; }
button, .button { min-height: 42px; padding: 10px 16px; border: 0; border-radius: 10px; cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; justify-content: center; gap: 8px; font-weight: 750; }
.primary { width: 100%; color: white; background: var(--leaf); }
.primary:hover { background: var(--leaf-dark); }
.secondary { color: var(--leaf-dark); background: #e5eee5; }
.danger { color: white; background: var(--danger); }
.validation { display: block; color: var(--danger); margin-top: 5px; }
.secret-block { padding: 16px; border-radius: 12px; background: #f2eee2; }
.secret-block dt { color: var(--muted); font-size: .8rem; font-weight: 800; text-transform: uppercase; }
.secret-block dd { margin: 4px 0 14px; }
.break { word-break: break-all; }
.admin-shell { min-height: 100vh; display: grid; grid-template-columns: 250px minmax(0, 1fr); }
.sidebar { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; padding: 20px 14px; color: #f7f3e9; background: #244632; }
.brand { display: flex; align-items: center; gap: 12px; padding: 5px 8px 26px; text-decoration: none; }
.brand small { display: block; opacity: .66; margin-top: 2px; }
.sidebar nav { display: grid; gap: 5px; }
.sidebar nav a { min-height: 44px; display: flex; align-items: center; gap: 11px; padding: 10px 12px; border-radius: 10px; text-decoration: none; color: #f7f3e9; }
.sidebar nav a:hover { background: rgb(255 255 255 / 10%); }
.sidebar nav span { width: 22px; text-align: center; color: #e0bf69; }
.sidebar-footer { margin-top: auto; padding: 14px 10px 2px; border-top: 1px solid rgb(255 255 255 / 13%); }
.sidebar-footer span { display: block; overflow: hidden; text-overflow: ellipsis; }
.link-button { min-height: 0; padding: 8px 0 0; color: #f0ce77; background: transparent; }
.content-shell { min-width: 0; }
.topbar { height: 66px; display: flex; align-items: center; justify-content: space-between; padding: 0 30px; border-bottom: 1px solid var(--line); background: rgb(255 253 247 / 87%); }
.status-dot { display: inline-block; width: 9px; height: 9px; margin-right: 8px; border-radius: 50%; background: #5f9e72; }
.privacy-badge, .pill { display: inline-flex; align-items: center; min-height: 28px; padding: 4px 9px; border-radius: 999px; font-size: .78rem; font-weight: 800; background: #e4eee4; color: var(--leaf-dark); }
.content { max-width: 1500px; margin: 0 auto; padding: 30px; }
.page-head { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin-bottom: 24px; }
.page-head h1 { margin: 0; font-size: clamp(1.65rem, 3vw, 2.25rem); }
.page-head p { margin: 7px 0 0; color: var(--muted); }
.metric-grid { display: grid; grid-template-columns: repeat(4, minmax(150px, 1fr)); gap: 16px; }
.card { padding: 20px; border: 1px solid var(--line); border-radius: 16px; background: var(--paper); box-shadow: 0 4px 18px rgb(50 57 43 / 5%); }
.metric .label { display: block; color: var(--muted); font-size: .82rem; }
.metric strong { display: block; margin-top: 8px; font-size: 1.75rem; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-top: 16px; }
.card h2 { margin: 0 0 16px; font-size: 1.05rem; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 12px 10px; text-align: left; border-bottom: 1px solid #ece5d7; }
th { color: var(--muted); font-size: .75rem; text-transform: uppercase; letter-spacing: .04em; }
.empty { padding: 28px; text-align: center; color: var(--muted); }
.toolbar { display: flex; flex-wrap: wrap; align-items: end; gap: 10px; margin-bottom: 16px; }
.toolbar > div { min-width: 160px; flex: 1; }
.toolbar label { display: block; margin-bottom: 5px; font-size: .78rem; font-weight: 800; color: var(--muted); }
.notice { padding: 13px 15px; border-left: 4px solid var(--gold); border-radius: 8px; background: #fff7df; }
.ok { color: #277242; }
.bad { color: var(--danger); }
@media (max-width: 1000px) {
  .metric-grid { grid-template-columns: repeat(2, minmax(140px, 1fr)); }
  .admin-shell { grid-template-columns: 78px minmax(0, 1fr); }
  .sidebar { padding-inline: 9px; }
  .brand > span:last-child, .sidebar nav a { font-size: 0; }
  .sidebar nav a span { width: 100%; font-size: 1.2rem; }
  .sidebar-footer span { display: none; }
}
@media (max-width: 680px) {
  .content { padding: 20px 14px; }
  .topbar { padding: 0 16px; }
  .metric-grid, .grid-2 { grid-template-columns: 1fr; }
  .page-head { align-items: start; flex-direction: column; }
  .admin-shell { grid-template-columns: 64px minmax(0, 1fr); }
}
