:root {
  color-scheme: light;
  --ink: #1d2926;
  --muted: #71807a;
  --line: #dce6e0;
  --surface: #ffffff;
  --canvas: #f4f7f4;
  --accent: #087f5b;
  --accent-dark: #066147;
  --danger: #b93832;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--canvas); color: var(--ink); }
button, input { font: inherit; }
.app-shell { width: min(1400px, calc(100% - 40px)); margin: 0 auto; padding: 34px 0 64px; }
.topbar, .toolbar, .section-heading, .toolbar-actions, .frequency-form { display: flex; align-items: center; }
.topbar, .section-heading { justify-content: space-between; }
.topbar { padding-bottom: 28px; }
h1, h2, p { margin: 0; }
h1 { font-size: 30px; letter-spacing: .01em; }
h2 { font-size: 20px; }
.eyebrow { color: var(--accent); font-size: 11px; font-weight: 800; letter-spacing: .16em; margin-bottom: 8px; }
.muted { color: var(--muted); }
.small { font-size: 12px; margin-top: 5px; }
.toolbar { justify-content: space-between; gap: 20px; padding: 14px 18px; border: 1px solid var(--line); background: var(--surface); border-radius: 8px; margin-bottom: 20px; }
.toolbar-actions { gap: 18px; flex-wrap: wrap; justify-content: flex-end; }
.status-line { font-size: 13px; display: flex; gap: 8px; align-items: center; }
.status-dot { width: 8px; height: 8px; display: inline-block; border-radius: 50%; background: #aab5af; }
.status-dot.ok { background: #19a974; }
.status-dot.bad { background: var(--danger); }
.frequency-form { gap: 7px; color: var(--muted); font-size: 13px; }
.frequency-form input { width: 82px; }
input { border: 1px solid var(--line); border-radius: 6px; padding: 9px 10px; background: #fff; color: var(--ink); }
.button { border: 0; border-radius: 6px; padding: 9px 13px; font-weight: 700; cursor: pointer; white-space: nowrap; }
.button.primary { background: var(--accent); color: white; width: 100%; padding: 12px; }
.button.primary:hover { background: var(--accent-dark); }
.button.secondary { background: #e7f2ed; color: var(--accent-dark); }
.button.ghost { background: transparent; color: var(--muted); border: 1px solid var(--line); }
.button.danger { background: #fff0ee; color: var(--danger); }
.table-section { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.section-heading { padding: 20px 22px; border-bottom: 1px solid var(--line); }
.section-heading p { font-size: 13px; margin-top: 5px; }
.count { color: var(--accent); font-size: 13px; font-weight: 800; }
.table-wrap { overflow-x: auto; }
.drag-handle { color: #9aa8a1; cursor: grab; font-size: 18px; line-height: 1; user-select: none; }
.dragging { opacity: .45; }
.sort-status { min-height: 22px; padding: 9px 22px 13px; color: var(--muted); font-size: 12px; }
.sort-status.pending { color: #9a6814; }
.sort-status.saved { color: var(--accent-dark); }
.sort-status.error { color: var(--danger); }
table { width: 100%; border-collapse: collapse; min-width: 980px; }
th, td { padding: 15px 22px; text-align: left; border-bottom: 1px solid #edf1ee; vertical-align: middle; }
th { color: var(--muted); background: #fbfcfb; font-size: 12px; font-weight: 700; }
td { font-size: 14px; }
tr:last-child td { border-bottom: 0; }
.product-name { max-width: 360px; font-weight: 700; line-height: 1.45; }
.source-tag { display: inline-block; padding: 5px 8px; border-radius: 5px; color: var(--accent-dark); background: #e7f2ed; font-size: 12px; font-weight: 700; }
.stock { font-size: 18px; }
.stock.empty { color: var(--danger); }
.source-list { display: grid; gap: 5px; }
.source-list a { color: var(--muted); font-size: 12px; text-decoration: none; }
.source-list a:hover { color: var(--accent); text-decoration: underline; }
.blocked-row { opacity: .6; background: #fafafa; }
.notice { padding: 11px 14px; margin-bottom: 16px; border-radius: 6px; font-size: 13px; }
.notice.success { color: var(--accent-dark); background: #e7f2ed; }
.notice.error { color: var(--danger); background: #fff0ee; }
.empty-state { text-align: center; color: var(--muted); padding: 56px; }
.login-shell { min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.login-panel { width: min(100%, 420px); background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 38px; box-shadow: 0 16px 50px rgba(29, 41, 38, .06); }
.brand-mark { color: var(--accent); font-weight: 900; font-size: 18px; margin-bottom: 42px; }
.login-panel h1 { margin-bottom: 9px; }
.login-panel .muted { font-size: 13px; line-height: 1.6; }
.login-form { display: grid; gap: 10px; margin-top: 28px; }
.login-form label { color: var(--muted); font-size: 13px; font-weight: 700; }
.login-form input { padding: 12px; }
@media (max-width: 760px) {
  .app-shell { width: min(100% - 24px, 1400px); padding-top: 22px; }
  .topbar, .toolbar { align-items: flex-start; flex-direction: column; }
  .toolbar, .toolbar-actions { width: 100%; }
  .toolbar-actions { justify-content: space-between; }
  .login-panel { padding: 28px; }
}
