:root {
  /* brand / accent */
  --brand: #4f46e5;
  --brand-600: #4338ca;
  --brand-500: #6366f1;
  --brand-glow: rgba(79, 70, 229, .35);

  /* aliases kept so the admin page keeps working */
  --navy: #1e293b;
  --navy-700: #334155;
  --blue: #4f46e5;
  --blue-600: #4338ca;

  --ink: #0f172a;
  --muted: #64748b;
  --line: #e7eaf1;
  --bg: #f5f6fb;
  --card: #ffffff;

  --green: #16794c;
  --green-bg: #e7f6ee;
  --amber: #9a6700;
  --amber-bg: #fdf3da;
  --red: #b42318;
  --red-bg: #fde7e4;
  --gray: #475467;
  --gray-bg: #eef1f5;

  --radius: 16px;
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, .05);
  --shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 22px 48px -20px rgba(30, 41, 59, .25);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: "Inter", -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--ink);
  background:
    radial-gradient(880px 520px at 12% -8%, rgba(99, 102, 241, .16), transparent 60%),
    radial-gradient(760px 520px at 100% 0%, rgba(56, 189, 248, .13), transparent 55%),
    radial-gradient(700px 600px at 50% 120%, rgba(129, 140, 248, .12), transparent 60%),
    var(--bg);
  background-attachment: fixed;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* ---------- layout ---------- */
.container { max-width: 560px; margin: 0 auto; padding: 56px 20px 72px; }

.hero { text-align: center; margin-bottom: 28px; }
.hero-badge {
  width: 60px; height: 60px; margin: 0 auto 18px;
  border-radius: 18px; display: grid; place-items: center;
  color: #fff;
  background: linear-gradient(135deg, var(--brand-500), var(--brand-600));
  box-shadow: 0 12px 26px -8px var(--brand-glow), inset 0 1px 0 rgba(255, 255, 255, .25);
}
.hero-badge svg { width: 30px; height: 30px; }
.hero h1 {
  font-size: 31px; line-height: 1.15; margin: 0 0 10px;
  font-weight: 800; letter-spacing: -.6px; color: var(--ink);
}
.lead { color: var(--muted); font-size: 16px; margin: 0 auto; max-width: 440px; }

/* ---------- card ---------- */
.card {
  position: relative;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 30px;
  animation: rise .5s cubic-bezier(.22, 1, .36, 1) both;
}
.lookup-card::before {
  content: "";
  position: absolute; inset: 0 0 auto 0; height: 4px;
  border-radius: var(--radius) var(--radius) 0 0;
  background: linear-gradient(90deg, var(--brand-500), #38bdf8);
}
@keyframes rise {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ---------- form tabs ---------- */
.form-tabs { display: flex; gap: 4px; margin: -6px 0 22px; border-bottom: 1px solid var(--line); }
.form-tab {
  background: none; color: var(--muted); border-radius: 0;
  padding: 10px 16px; font-weight: 650; font-size: 14px;
  border-bottom: 2px solid transparent; box-shadow: none;
}
.form-tab:hover { background: none; color: var(--ink); transform: none; filter: none; box-shadow: none; }
.form-tab.active { color: var(--brand); border-bottom-color: var(--brand); }
.tab-panel[hidden] { display: none; }

/* admin: step tabs sit above the stats row */
.admin-step-tabs { margin: 0 0 18px; }
.tab-count {
  display: inline-block; min-width: 22px; padding: 1px 8px; margin-left: 6px;
  border-radius: 999px; font-size: 12px; font-weight: 700; line-height: 18px;
  background: rgba(79, 70, 229, 0.10); color: var(--brand);
  vertical-align: middle;
}
.form-tab:not(.active) .tab-count { background: rgba(15, 23, 42, 0.06); color: var(--muted); }

/* ---------- form ---------- */
.lookup-card label {
  display: block; font-weight: 600; font-size: 13px;
  margin-bottom: 7px; color: var(--navy-700); letter-spacing: .1px;
}
.field-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.lookup-card .field { margin-bottom: 18px; }

.lookup-card input {
  width: 100%; min-width: 0;
  padding: 13px 15px; font-size: 15.5px; font-family: inherit;
  border: 1.5px solid #e3e8f0; border-radius: 11px;
  background: #fbfcfe; color: var(--ink);
  transition: border-color .15s, box-shadow .15s, background .15s;
}
.lookup-card input::placeholder { color: #9aa6b6; }
.lookup-card input:hover { border-color: #cdd5e2; }
.lookup-card input:focus {
  outline: none; background: #fff;
  border-color: var(--brand);
  box-shadow: 0 0 0 4px rgba(79, 70, 229, .14);
}

button {
  font-family: inherit; font-size: 15px; font-weight: 650;
  border: 0; border-radius: 11px; cursor: pointer;
  padding: 14px 20px; color: #fff;
  background: linear-gradient(135deg, var(--brand-500), var(--brand));
  box-shadow: 0 10px 22px -8px var(--brand-glow);
  transition: transform .12s ease, box-shadow .15s ease, filter .15s ease, opacity .15s;
  white-space: nowrap;
}
button:hover { transform: translateY(-1px); filter: brightness(1.04); box-shadow: 0 14px 28px -8px var(--brand-glow); }
button:active { transform: translateY(0); box-shadow: 0 6px 16px -8px var(--brand-glow); }
button:disabled { opacity: .65; cursor: default; transform: none; filter: none; }

.hint { font-size: 13px; color: var(--muted); margin: 12px 0 0; }
.hint strong { color: var(--navy-700); }

.submit-row { margin-top: 22px; }
.submit-row button { width: 100%; }

.secure-line {
  display: flex; align-items: center; justify-content: center; gap: 7px;
  margin: 16px 0 0; font-size: 12.5px; font-weight: 500; color: var(--muted);
}
.secure-line svg { width: 13px; height: 13px; color: var(--green); }

@media (max-width: 540px) { .field-grid { grid-template-columns: 1fr; } }

/* ---------- result ---------- */
.result { margin-top: 24px; border-top: 1px solid var(--line); padding-top: 22px; }
.result.success .ok {
  display: flex; gap: 12px; align-items: flex-start;
  background: var(--green-bg); border: 1px solid #b6e3c8;
  border-radius: 12px; padding: 16px; color: #14502f; font-size: 14px;
}
.result.success .ok svg { flex-shrink: 0; color: var(--green); margin-top: 1px; }
.result .status-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.result .req-no { font-size: 13px; color: var(--muted); }
.result .req-no strong { color: var(--ink); font-size: 16px; }
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 13px; font-weight: 700; padding: 6px 12px; border-radius: 999px;
}
.badge.received { color: var(--gray); background: var(--gray-bg); }
.badge.in-review { color: var(--amber); background: var(--amber-bg); }
.badge.approved { color: var(--green); background: var(--green-bg); }
.badge.action-needed { color: var(--red); background: var(--red-bg); }
.badge.closed { color: var(--gray); background: var(--gray-bg); }
.result .meta { margin-top: 14px; font-size: 14px; color: var(--muted); }
.result .note {
  margin-top: 14px; padding: 14px 16px; background: #f7f9fc;
  border: 1px solid var(--line); border-radius: 10px; font-size: 14px; color: var(--ink);
}
.result .carrier { font-size: 14px; color: var(--muted); margin-top: 4px; }
.result.notfound .nf, .result.error .nf {
  display: flex; gap: 12px; align-items: flex-start;
  background: var(--amber-bg); border: 1px solid #f0dca6;
  border-radius: 12px; padding: 14px 16px; color: #6b4e00; font-size: 14px;
}
.result.error .nf { background: var(--red-bg); border-color: #f3c6c1; color: #7a1c14; }

/* ---------- partners ---------- */
.partners { text-align: center; margin-top: 40px; }
.partners-title { font-size: 11.5px; letter-spacing: .8px; text-transform: uppercase; color: var(--muted); font-weight: 600; margin: 0 0 16px; }
.partner-list {
  list-style: none; padding: 0; margin: 0;
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px;
}
.partner {
  display: flex; align-items: center; justify-content: center;
  height: 80px; padding: 10px 14px; overflow: hidden;
  background: #fff; border: 1px solid rgba(15, 23, 42, .08); border-radius: 14px;
  box-shadow: var(--shadow-sm);
  transition: transform .12s ease, box-shadow .15s ease;
}
.partner:hover { transform: translateY(-3px); box-shadow: 0 14px 24px -12px rgba(30, 41, 59, .4); }
.partner-logo { width: 100%; height: 100%; object-fit: contain; display: block; }
.partner-logo--zoom { transform: scale(1.45); }
.partner-name { font-size: 13.5px; font-weight: 600; color: var(--navy-700); text-align: center; }
.partner:not(.no-logo) .partner-name { display: none; }
.partner.no-logo .partner-logo { display: none; }

@media (max-width: 560px) { .partner-list { grid-template-columns: repeat(2, 1fr); } }

/* ---------- footer (legacy / shared) ---------- */
.footer { border-top: 1px solid var(--line); background: #fff; }
.footer-inner { max-width: 720px; margin: 0 auto; padding: 24px 20px 36px; text-align: center; }
.footer-inner p { margin: 4px 0; font-size: 14px; }
.muted { color: var(--muted); }
.small { font-size: 12px; line-height: 1.5; max-width: 560px; margin: 12px auto 0; }

/* ---------- admin top bar ---------- */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 28px;
  background: linear-gradient(120deg, #1e293b, #312e81);
  color: #fff;
}
.brand { display: flex; align-items: center; gap: 12px; }
.logo-mark {
  width: 40px; height: 40px; border-radius: 11px;
  display: grid; place-items: center;
  background: linear-gradient(135deg, var(--brand-500), var(--brand-600));
  font-weight: 700; letter-spacing: .5px; font-size: 15px;
  border: 1px solid rgba(255, 255, 255, .18);
}
.brand-name { font-weight: 650; font-size: 17px; letter-spacing: .2px; }
.brand-sub { font-size: 12px; color: #c0c6f5; margin-top: -2px; }

/* ---------- admin ---------- */
.admin-wrap { max-width: 1040px; margin: 0 auto; padding: 32px 20px 64px; }
.login-card { max-width: 380px; margin: 64px auto; }
.login-card h1 { font-size: 20px; color: var(--navy); margin: 0 0 6px; }
.login-card p { color: var(--muted); font-size: 14px; margin: 0 0 20px; }
.field { margin-bottom: 16px; }
.field label { display: block; font-weight: 600; font-size: 13px; margin-bottom: 6px; }
.field input, .field select, .field textarea {
  width: 100%; padding: 11px 12px; font-size: 15px; font-family: inherit;
  border: 1px solid #cfd6e0; border-radius: 8px; background: #fcfdff; color: var(--ink);
}
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(79, 70, 229, .15); }
.field textarea { resize: vertical; min-height: 64px; }
.btn-full { width: 100%; }
.err { color: var(--red); font-size: 14px; margin: 8px 0 0; }

.admin-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; flex-wrap: wrap; gap: 12px; }
.admin-head h1 { font-size: 22px; color: var(--navy); margin: 0; }
.tabs { display: flex; gap: 6px; margin: 18px 0; border-bottom: 1px solid var(--line); }
.tab { background: none; color: var(--muted); border-radius: 0; padding: 10px 14px; font-weight: 600; border-bottom: 2px solid transparent; box-shadow: none; }
.tab:hover { background: none; color: var(--ink); transform: none; filter: none; box-shadow: none; }
.tab.active { color: var(--blue); border-bottom-color: var(--blue); }

.toolbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; gap: 12px; flex-wrap: wrap; }
.btn-ghost { background: #fff; color: var(--blue); border: 1px solid #c7d0ee; box-shadow: none; }
.btn-ghost:hover { background: #f3f4fd; }
.btn-danger { background: #fff; color: var(--red); border: 1px solid #f0c8c3; padding: 7px 12px; font-size: 13px; box-shadow: none; }
.btn-danger:hover { background: #fcefee; }
.btn-sm { padding: 7px 12px; font-size: 13px; }

table { width: 100%; border-collapse: collapse; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
th, td { text-align: left; padding: 12px 14px; font-size: 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { background: #f7f9fc; color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .4px; }
tr:last-child td { border-bottom: 0; }
.row-actions { display: flex; gap: 8px; }
.empty { text-align: center; color: var(--muted); padding: 32px; }

.modal-backdrop { position: fixed; inset: 0; background: rgba(15, 23, 42, .5); display: none; align-items: center; justify-content: center; padding: 20px; z-index: 20; }
.modal-backdrop.open { display: flex; }
.modal { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); width: 100%; max-width: 460px; padding: 24px; }
.modal h2 { margin: 0 0 18px; font-size: 18px; color: var(--navy); }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 8px; }

.mono { font-variant-numeric: tabular-nums; font-family: "SFMono-Regular", Consolas, monospace; font-size: 13px; }
.pill { display: inline-block; font-size: 12px; font-weight: 700; padding: 3px 9px; border-radius: 999px; }
.pill.yes { color: var(--green); background: var(--green-bg); }
.pill.no { color: var(--gray); background: var(--gray-bg); }
.pill.new { color: var(--blue); background: #e8e9fb; }

/* stat cards */
.stats { display: flex; gap: 14px; margin: 18px 0 22px; flex-wrap: wrap; }
.stat { flex: 1; min-width: 120px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow-sm); }
.stat-num { font-size: 26px; font-weight: 700; color: var(--navy); line-height: 1; }
.stat-label { font-size: 12px; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); margin-top: 6px; }

/* filter chips + toolbar links */
.filters { display: flex; gap: 8px; }
.chip { background: #fff; color: var(--muted); border: 1px solid var(--line); border-radius: 999px; padding: 7px 14px; font-size: 13px; font-weight: 600; box-shadow: none; }
.chip:hover { background: #f3f4fd; color: var(--ink); }
.chip.active { background: var(--blue); color: #fff; border-color: var(--blue); }
.toolbar-right { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
a.btn-ghost { text-decoration: none; display: inline-flex; align-items: center; }

/* search box */
.search-input {
  font-family: inherit; font-size: 14px; color: var(--ink);
  padding: 8px 13px; min-width: 220px;
  border: 1px solid #cfd6e0; border-radius: 999px; background: #fff;
  transition: border-color .15s, box-shadow .15s;
}
.search-input::placeholder { color: #94a0b0; }
.search-input:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(79, 70, 229, .15); }

/* pagination */
.pagination { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-top: 16px; flex-wrap: wrap; }
.page-info { font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.page-buttons { display: flex; gap: 8px; }
.pagination button:disabled { opacity: .45; cursor: default; }

@media (max-width: 540px) {
  .container { padding: 40px 16px 56px; }
  .card { padding: 24px 20px; }
  .hero h1 { font-size: 27px; }
}
