/* Price Crawler admin — tokens from the design canvas */
:root {
  --bg: #F4F3EE;
  --surface: #FFFFFF;
  --surface-2: #ECEBE4;
  --border: #DDDBD2;
  --text: #1C1C1A;
  --text-muted: #5B5A55;
  --text-faint: #85837B;
  --primary: #0E6B65;
  --primary-strong: #0A4F4A;
  --primary-tint: #DDEEEC;
  --ok: #1F7A3F;
  --ok-tint: #DFF1E4;
  --ok-text: #14532D;
  --warn: #9A5B00;
  --warn-tint: #FBEBCB;
  --warn-text: #6B3F00;
  --danger: #B3261E;
  --danger-tint: #FADCDA;
  --danger-text: #7A1A14;
  --info: #2C5EAA;
  --info-tint: #DDE7F7;
  --info-text: #1E3F73;
  --font-sans: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "Cascadia Mono", Consolas, monospace;
  --r-sm: 6px;
  --r-md: 8px;
  --r-lg: 12px;
  --sidebar-w: 232px;
}
*, *::before, *::after { box-sizing: border-box; }
html { font-size: 14px; }
body { margin: 0; font-family: var(--font-sans); background: var(--bg); color: var(--text); line-height: 1.45; -webkit-font-smoothing: antialiased; }
a { color: var(--primary); }
a:hover { color: var(--primary-strong); }
h1, h2, h3 { margin: 0; font-weight: 600; letter-spacing: -0.01em; }
h1 { font-size: 26px; }
h2 { font-size: 16px; }
p { margin: 0; }
code, .mono { font-family: var(--font-mono); }
.muted { color: var(--text-muted); }
.faint { color: var(--text-faint); }
.small { font-size: 12.5px; }

/* layout */
.app { display: flex; min-height: 100vh; }
.sidebar { width: var(--sidebar-w); flex-shrink: 0; background: var(--surface); border-right: 1px solid var(--border); padding: 20px 14px; display: flex; flex-direction: column; gap: 6px; position: sticky; top: 0; height: 100vh; }
.brand { display: flex; align-items: center; gap: 10px; padding: 6px 8px 10px; font-weight: 600; }
.brand .logo { width: 32px; height: 32px; border-radius: 9px; background: var(--primary); color: #fff; display: grid; place-items: center; font-family: var(--font-mono); font-size: 14px; }
.shop-switch { position: relative; margin-bottom: 12px; }
.shop-switch select { appearance: none; -webkit-appearance: none; width: 100%; height: 48px; padding: 18px 34px 0 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--bg); font: inherit; font-weight: 600; font-size: 13.5px; color: var(--text); cursor: pointer; }
.shop-switch .label { position: absolute; left: 12px; top: 7px; font-family: var(--font-mono); font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--text-faint); pointer-events: none; }
.shop-switch svg { position: absolute; right: 10px; top: 16px; pointer-events: none; }
.nav a { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 9px 10px; border-radius: var(--r-md); color: var(--text); text-decoration: none; }
.nav a:hover { background: var(--surface-2); }
.nav a.active { background: var(--primary-tint); color: var(--primary-strong); font-weight: 600; }
.nav a .ico { display: inline-flex; width: 16px; }
.nav a .lbl { display: flex; align-items: center; gap: 10px; }
.nav .spacer { flex-grow: 1; }
.nav a.secondary { color: var(--text-muted); }
.main { flex-grow: 1; min-width: 0; padding: 28px 32px 48px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.page-head .sub { color: var(--text-muted); margin-top: 4px; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* components */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 20px 22px; }
.card h2 { margin-bottom: 14px; }
.card-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.card-head h2 { margin: 0; }
.grid { display: grid; gap: 16px; }
.grid-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.grid-2 { grid-template-columns: 1.45fr 1fr; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.kpi { padding: 18px; display: flex; flex-direction: column; gap: 4px; }
.kpi .k { font-size: 12px; color: var(--text-muted); }
.kpi .v { font-family: var(--font-mono); font-size: 26px; font-weight: 600; }
.kpi .n { font-size: 12px; color: var(--text-faint); }
.kpi.alert { border-color: var(--danger); }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 40px; padding: 0 16px; border-radius: var(--r-md); border: 1px solid var(--border); background: var(--surface); color: var(--text); font: inherit; font-weight: 500; text-decoration: none; cursor: pointer; }
.btn:hover { background: var(--surface-2); }
.btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; font-weight: 600; }
.btn-primary:hover { background: var(--primary-strong); }
.btn-ok { background: var(--ok); border-color: var(--ok); color: #fff; font-weight: 600; }
.btn-danger { background: var(--surface); border-color: var(--danger); color: var(--danger); font-weight: 600; }
.btn-sm { height: 34px; padding: 0 12px; font-size: 13px; }
.badge { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; border-radius: 999px; padding: 2px 9px; background: var(--surface-2); color: var(--text-muted); white-space: nowrap; }
.badge .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge-ok { background: var(--ok-tint); color: var(--ok-text); }
.badge-ok .dot { background: var(--ok); }
.badge-warn { background: var(--warn-tint); color: var(--warn-text); }
.badge-warn .dot { background: var(--warn); }
.badge-danger { background: var(--danger-tint); color: var(--danger-text); }
.badge-danger .dot { background: var(--danger); }
.badge-primary { background: var(--primary-tint); color: var(--primary-strong); }
.badge-primary .dot { background: var(--primary); }
.badge-info { background: var(--info-tint); color: var(--info-text); }
.chip { font-family: var(--font-mono); font-size: 12px; background: var(--surface-2); border-radius: 4px; padding: 1px 6px; }
table.data { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.data th { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--border); font-family: var(--font-mono); font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--text-faint); font-weight: 500; white-space: nowrap; }
table.data td { padding: 11px 10px; border-bottom: 1px solid var(--surface-2); vertical-align: middle; }
table.data td.num, table.data th.num { text-align: right; font-family: var(--font-mono); }
table.data tr:last-child td { border-bottom: 0; }
.empty { padding: 28px; text-align: center; color: var(--text-muted); }
.meter { height: 8px; border-radius: 4px; background: var(--surface-2); overflow: hidden; }
.meter > span { display: block; height: 8px; background: var(--primary); }
.meter.warn > span { background: var(--warn); }
.meter.danger > span { background: var(--danger); }
.alert-item { display: flex; gap: 12px; align-items: flex-start; padding: 10px; border-radius: var(--r-md); color: var(--text); text-decoration: none; }
.alert-item .dot { width: 8px; height: 8px; margin-top: 6px; border-radius: 50%; flex-shrink: 0; }
.alert-item.danger { background: var(--danger-tint); }
.alert-item.danger .dot { background: var(--danger); }
.alert-item.warn { background: var(--warn-tint); }
.alert-item.warn .dot { background: var(--warn); }
.alert-item strong { display: block; font-size: 13.5px; }
.alert-item span.d { font-size: 12.5px; color: var(--text-muted); }
.notice { padding: 12px 16px; border-radius: var(--r-md); margin-bottom: 18px; font-weight: 500; }
.notice-ok { background: var(--ok-tint); color: var(--ok-text); }
.notice-error { background: var(--danger-tint); color: var(--danger-text); }
.notice ul { margin: 6px 0 0; padding-left: 18px; font-weight: 400; }

/* forms */
.form { display: flex; flex-direction: column; gap: 16px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-family: var(--font-mono); font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--text-faint); }
.field .hint { font-size: 12.5px; color: var(--text-muted); }
.input, select.input, textarea.input { width: 100%; height: 40px; padding: 0 12px; border: 1px solid var(--border); border-radius: var(--r-md); background: var(--surface); font: inherit; color: var(--text); }
textarea.input { height: auto; min-height: 90px; padding: 10px 12px; }
.input:focus { outline: 2px solid var(--primary-tint); border-color: var(--primary); }
.check { display: flex; align-items: center; gap: 8px; font-size: 14px; cursor: pointer; }
.row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.row-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.form-actions { display: flex; justify-content: flex-end; gap: 12px; margin-top: 8px; }

/* login */
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.login-card { width: 100%; max-width: 400px; }

@media (max-width: 1100px) {
  .grid-5 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-2 { grid-template-columns: 1fr; }
  .row-3 { grid-template-columns: 1fr; }
}
@media (max-width: 800px) {
  .app { flex-direction: column; }
  .sidebar { width: auto; height: auto; position: static; }
  .main { padding: 16px; }
  .row-2 { grid-template-columns: 1fr; }
}
