/* OfferGen design system — precise, warm, professional internal tool.
   Signature: colour-keyed folder groups. One brand accent (indigo), quiet
   everything else. Light theme, tabular dates, strong type hierarchy. */
:root {
  --paper: #f4f5f9;
  --ink: #182034;
  --muted: #667085;
  --faint: #98a2b3;
  --line: #e6e8f0;
  --card: #ffffff;
  --brand: #4f46e5;
  --brand-ink: #4338ca;
  --brand-soft: #eceefe;
  --danger: #d92d20;
  --danger-soft: #fdecea;
  --ok: #0f9d6b;
  --ok-soft: #e6f6ef;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(16,24,40,.05), 0 6px 20px rgba(16,24,40,.05);
  --mono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, monospace;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
}
* { box-sizing: border-box; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font-family: var(--sans); line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--brand-ink); text-decoration: none; }
a:hover { text-decoration: underline; }
.eyebrow {
  font-size: 11px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase;
  color: var(--faint);
}
.mono { font-family: var(--mono); }
.muted { color: var(--muted); }

/* ---- top bar ---- */
.topbar {
  background: var(--card); border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 10;
}
.topbar-inner {
  max-width: 940px; margin: 0 auto; padding: 14px 24px;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.brand { display: flex; align-items: baseline; gap: 10px; font-weight: 700; font-size: 18px; letter-spacing: -.01em; }
.brand .dot { width: 9px; height: 9px; border-radius: 3px; background: var(--brand); display: inline-block; }
.nav { display: flex; align-items: center; gap: 18px; font-size: 14px; }
.who { color: var(--muted); font-size: 13px; }

/* ---- layout ---- */
.wrap { max-width: 940px; margin: 0 auto; padding: 28px 24px 64px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 22px; }
.page-head h1 { margin: 4px 0 0; font-size: 26px; letter-spacing: -.02em; font-weight: 700; }
.section-label { margin: 30px 0 12px; font-size: 13px; font-weight: 700; color: var(--muted); }

/* ---- buttons ---- */
.btn {
  display: inline-flex; align-items: center; gap: 7px; cursor: pointer;
  background: var(--brand); color: #fff; border: 0; border-radius: 10px;
  padding: 9px 15px; font-size: 14px; font-weight: 600; font-family: inherit;
  transition: background .15s, transform .05s;
}
.btn:hover { background: var(--brand-ink); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn.ghost { background: transparent; color: var(--brand-ink); border: 1px solid var(--line); }
.btn.ghost:hover { background: var(--brand-soft); }
.btn.sm { padding: 6px 11px; font-size: 13px; border-radius: 8px; }

/* ---- cards / templates ---- */
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.tpl-row {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  padding: 16px 18px;
}
.tpl-row + .tpl-row { border-top: 1px solid var(--line); }
.tpl-name { font-weight: 600; }
.tpl-meta { color: var(--muted); font-size: 13px; margin-top: 2px; }
.row-actions { display: flex; align-items: center; gap: 14px; white-space: nowrap; }

/* ---- folder groups (the signature) ---- */
.folder { margin: 16px 0 22px; }
.folder-head {
  display: flex; align-items: center; gap: 10px; margin: 0 2px 10px;
}
.folder-chip {
  display: inline-flex; align-items: center; gap: 7px; font-weight: 600; font-size: 14px;
  padding: 5px 12px 5px 10px; border-radius: 999px;
  color: hsl(var(--h) 55% 32%); background: hsl(var(--h) 70% 95%);
  border: 1px solid hsl(var(--h) 55% 86%);
}
.folder-chip .swatch { width: 9px; height: 9px; border-radius: 50%; background: hsl(var(--h) 65% 52%); }
.folder-count { color: var(--faint); font-size: 12px; font-variant-numeric: tabular-nums; }

.offer {
  display: flex; align-items: center; gap: 14px; padding: 13px 16px;
  border-left: 3px solid hsl(var(--h) 65% 60%);
}
.offer + .offer { border-top: 1px solid var(--line); }
.offer-main { min-width: 0; flex: 1; }
.offer-link { font-weight: 600; font-size: 15px; }
.offer-sub { color: var(--muted); font-size: 12.5px; margin-top: 2px; display: flex; gap: 10px; flex-wrap: wrap; }
.offer-sub .date { font-variant-numeric: tabular-nums; }
.offer-url { font-family: var(--mono); font-size: 12px; color: var(--faint); }
.offer-actions { display: flex; align-items: center; gap: 12px; }
.del {
  background: none; border: 0; cursor: pointer; color: var(--faint); font-size: 13px;
  padding: 4px 6px; border-radius: 7px;
}
.del:hover { color: var(--danger); background: var(--danger-soft); }
.del[disabled] { color: #cbd0da; cursor: not-allowed; }

/* ---- forms ---- */
.form-card { max-width: 640px; }
label.f { display: block; margin: 16px 0 6px; font-size: 13px; font-weight: 600; }
label.f .hint { font-weight: 400; color: var(--muted); }
input[type=text], input[type=date], input[type=password], textarea, select {
  width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px;
  font-family: inherit; font-size: 14px; background: #fff; color: var(--ink);
}
input:focus, textarea:focus, select:focus {
  outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft);
}
textarea { min-height: 280px; font-family: var(--mono); font-size: 13px; line-height: 1.55; }
.err { color: var(--danger); background: var(--danger-soft); padding: 10px 12px; border-radius: 10px; font-size: 13.5px; }
.tags { margin: 8px 0; padding: 11px 13px; background: var(--brand-soft); border-radius: 10px; font-size: 13px; min-height: 20px; }
.tag { display: inline-block; background: #fff; color: var(--brand-ink); border: 1px solid hsl(244 60% 88%);
  padding: 3px 9px; border-radius: 7px; margin: 3px 3px 0 0; font-size: 12.5px; }

/* ---- empty states ---- */
.empty { color: var(--muted); font-size: 14px; padding: 22px 2px; }

/* ---- login ---- */
.login-shell { min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.login-card { width: 320px; padding: 30px; }
.login-card h1 { margin: 0 0 4px; font-size: 22px; letter-spacing: -.01em; }
.login-card .sub { color: var(--muted); font-size: 13px; margin-bottom: 20px; }
.login-card input { margin-bottom: 10px; }
.login-card .btn { width: 100%; justify-content: center; margin-top: 8px; }

@media (max-width: 560px) {
  .page-head { flex-direction: column; align-items: flex-start; }
  .offer { flex-wrap: wrap; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
