/* Invoice Chaser — v1 styles (vanilla, no framework) */
:root {
  --bg: #f7f8fa;
  --card: #ffffff;
  --ink: #1a2332;
  --muted: #64748b;
  --line: #e5e9f0;
  --brand: #2563eb;
  --brand-dark: #1d4ed8;
  --ok: #15803d;
  --warn: #b45309;
  --bad: #b91c1c;
  --radius: 10px;
}
* { box-sizing: border-box; }
body {
  margin: 0; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
  background: var(--bg); color: var(--ink); line-height: 1.55;
}
a { color: var(--brand); }
.wrap { max-width: 1080px; margin: 0 auto; padding: 0 20px; }

/* top bar */
.topbar {
  background: var(--card); border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 10;
}
.topbar .wrap { display: flex; align-items: center; justify-content: space-between; height: 60px; }
.logo { font-weight: 800; font-size: 19px; text-decoration: none; color: var(--ink); }
.logo span { color: var(--brand); }
.nav a { margin-left: 18px; text-decoration: none; color: var(--muted); font-size: 15px; }
.nav a:hover { color: var(--ink); }
.plan-badge {
  display: inline-block; font-size: 12px; font-weight: 700; padding: 3px 10px;
  border-radius: 999px; background: #eef2ff; color: var(--brand); margin-left: 10px;
  vertical-align: middle;
}
.plan-badge.paid { background: #dcfce7; color: var(--ok); }

/* cards / layout */
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 22px; margin: 18px 0; box-shadow: 0 1px 2px rgba(16,24,40,.04);
}
.card h2 { margin: 0 0 12px; font-size: 18px; }
.muted { color: var(--muted); font-size: 14px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
@media (max-width: 720px) { .grid2 { grid-template-columns: 1fr; } }

/* tables */
table { width: 100%; border-collapse: collapse; font-size: 14.5px; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); }
th { color: var(--muted); font-weight: 600; font-size: 13px; text-transform: uppercase; letter-spacing: .04em; }
tr:hover td { background: #fafbff; }
.pill {
  display: inline-block; font-size: 12px; font-weight: 700; padding: 2px 10px; border-radius: 999px;
}
.pill.upcoming { background: #eef2ff; color: var(--brand); }
.pill.overdue { background: #fef3c7; color: var(--warn); }
.pill.paid { background: #dcfce7; color: var(--ok); }
.pill.dropped { background: #f1f5f9; color: var(--muted); }
.money { font-variant-numeric: tabular-nums; font-weight: 600; }

/* forms */
label { display: block; font-size: 13.5px; font-weight: 600; margin: 12px 0 4px; }
input, select, textarea {
  width: 100%; padding: 10px 12px; font-size: 15px; border: 1px solid var(--line);
  border-radius: 8px; background: #fff; color: var(--ink);
}
input:focus, select:focus, textarea:focus { outline: 2px solid #bfdbfe; border-color: var(--brand); }
textarea { min-height: 120px; font-family: inherit; resize: vertical; }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 720px) { .row { grid-template-columns: 1fr; } }

/* buttons */
.btn {
  display: inline-block; border: 0; cursor: pointer; font-size: 15px; font-weight: 700;
  padding: 10px 20px; border-radius: 8px; background: var(--brand); color: #fff; text-decoration: none;
}
.btn:hover { background: var(--brand-dark); }
.btn.secondary { background: #eef2ff; color: var(--brand); }
.btn.secondary:hover { background: #dbeafe; }
.btn.ghost { background: transparent; color: var(--muted); border: 1px solid var(--line); }
.btn.ghost:hover { color: var(--ink); border-color: #cbd5e1; }
.btn.small { font-size: 13px; padding: 6px 12px; }
.btn.danger { background: #fee2e2; color: var(--bad); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.actions { display: flex; gap: 8px; margin-top: 16px; flex-wrap: wrap; }

/* tabs */
.tabs { display: flex; gap: 6px; margin: 18px 0 0; border-bottom: 2px solid var(--line); }
.tab {
  border: 0; background: none; cursor: pointer; font-size: 15px; font-weight: 600;
  padding: 10px 16px; color: var(--muted); border-bottom: 3px solid transparent; margin-bottom: -2px;
}
.tab.active { color: var(--brand); border-bottom-color: var(--brand); }
.tabpane { display: none; }
.tabpane.active { display: block; }

/* attention banner (anti-misfire: pinned overdue invoices) */
.attention {
  border: 1.5px solid #fcd34d; background: #fffbeb; border-radius: var(--radius);
  padding: 16px 20px; margin: 18px 0;
}
.attention h3 { margin: 0 0 6px; font-size: 15.5px; color: #92400e; }
.attention ul { margin: 6px 0 0; padding-left: 20px; font-size: 14.5px; }

/* auth */
.authbox { max-width: 420px; margin: 60px auto; }
.alert {
  border-radius: 8px; padding: 10px 14px; font-size: 14px; margin: 12px 0;
}
.alert.error { background: #fee2e2; color: #991b1b; }
.alert.ok { background: #dcfce7; color: #166534; }
.alert.info { background: #e0f2fe; color: #075985; }

/* hero (landing) */
.hero { text-align: center; padding: 70px 20px 40px; }
.hero h1 { font-size: 42px; margin: 0 0 14px; letter-spacing: -0.02em; }
.hero p { font-size: 18px; color: var(--muted); max-width: 640px; margin: 0 auto 26px; }
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin: 30px 0; }
@media (max-width: 720px) { .steps { grid-template-columns: 1fr; } .hero h1 { font-size: 30px; } }
.step { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.step .n { font-size: 26px; }
.step h3 { margin: 8px 0 6px; font-size: 16px; }
.step p { font-size: 14px; color: var(--muted); margin: 0; }
footer { text-align: center; color: var(--muted); font-size: 13px; padding: 34px 0; }
footer a { color: var(--muted); margin: 0 8px; }

/* modal */
.modal-back {
  position: fixed; inset: 0; background: rgba(15,23,42,.45); display: none;
  align-items: flex-start; justify-content: center; padding: 40px 16px; z-index: 50;
}
.modal-back.open { display: flex; }
.modal { background: #fff; border-radius: 12px; padding: 24px; width: 100%; max-width: 560px; max-height: 90vh; overflow: auto; }
.modal h3 { margin-top: 0; }
.empty { text-align: center; color: var(--muted); padding: 34px 10px; }
.kv { font-size: 14px; color: var(--muted); }
.kv b { color: var(--ink); }

/* Day 4: template editor + sender verification */
.tpl { border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; margin: 12px 0; background: #fff; }
.tpl h4 { margin: 0 0 6px; font-size: 15px; }
.tpl label { display: block; font-size: 13px; color: var(--muted); margin: 10px 0 4px; }
.tpl input, .tpl textarea { width: 100%; box-sizing: border-box; font-family: inherit; }
.tpl textarea { font-size: 13.5px; line-height: 1.55; }
code { background: #f1f5f9; border: 1px solid var(--line); padding: 1px 6px; border-radius: 4px; font-size: 13px; }
ol.muted li { margin-bottom: 6px; }
