/* ==========================================================================
   Points Ledger — light fintech theme
   Palette: soft cool-white surfaces, deep navy text, growth-green progress,
   amber for rewards/points, warm red for alerts. Signature element: the
   circular goal-progress ring used throughout the Benefits view.
   ========================================================================== */
:root {
  --bg: #f4f7fb;
  --surface: #ffffff;
  --surface-alt: #eef3f9;
  --line: #dde6f0;
  --ink: #142334;
  --ink-soft: #5b6b80;
  --navy: #16324f;
  --navy-deep: #0e2138;
  --green: #1f8a5d;
  --green-soft: #e5f5ee;
  --amber: #e3a008;
  --amber-soft: #fdf3dd;
  --red: #c1443a;
  --red-soft: #fbeceb;
  --blue: #2f6fa8;

  --font-display: 'Sora', 'Arial', sans-serif;
  --font-body: 'Work Sans', system-ui, sans-serif;
  --font-mono: 'IBM Plex Mono', 'SFMono-Regular', monospace;

  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 1px 2px rgba(20,35,52,0.04), 0 10px 24px -14px rgba(20,35,52,0.16);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; background: var(--bg); color: var(--ink); font-family: var(--font-body); -webkit-font-smoothing: antialiased; }
body {
  min-height: 100vh;
  /* Layered ambient background: soft brand-colored glows over the base tint,
     plus a faint dot grid. All CSS/SVG data-URIs, so nothing external loads. */
  background-color: var(--bg);
  background-image:
    radial-gradient(1100px 520px at 12% -8%, rgba(47,111,168,0.14), rgba(47,111,168,0) 60%),
    radial-gradient(900px 480px at 105% 0%, rgba(31,138,93,0.13), rgba(31,138,93,0) 55%),
    radial-gradient(800px 600px at 50% 120%, rgba(22,50,79,0.08), rgba(22,50,79,0) 60%),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='28' height='28'%3E%3Ccircle cx='2' cy='2' r='1' fill='%2316324f' fill-opacity='0.05'/%3E%3C/svg%3E");
  background-attachment: fixed, fixed, fixed, fixed;
}
a { color: inherit; }
h1, h2, h3, h4 { font-family: var(--font-display); letter-spacing: 0.01em; margin: 0; color: var(--navy-deep); }
.mono { font-family: var(--font-mono); }
button, input, select, textarea { font-family: inherit; font-size: 1rem; }

button {
  cursor: pointer; border-radius: 10px; border: 1px solid transparent;
  padding: 0.6rem 1.1rem; font-weight: 600; transition: transform .08s ease, box-shadow .15s ease, background .15s ease;
}
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 3px solid var(--blue); outline-offset: 2px;
}
button:active { transform: translateY(1px); }

.btn-primary { background: var(--navy); color: #fff; }
.btn-primary:hover { background: var(--navy-deep); }
.btn-green { background: var(--green); color: #fff; }
.btn-green:hover { background: #17734c; }
.btn-ghost { background: transparent; border-color: var(--line); color: var(--ink); }
.btn-ghost:hover { border-color: var(--blue); }
.btn-danger { background: transparent; border-color: var(--red); color: var(--red); }
.btn-danger:hover { background: var(--red); color: #fff; }
.btn-small { padding: 0.35rem 0.7rem; font-size: 0.85rem; }
.btn-full { width: 100%; }

input[type=text], input[type=email], input[type=password], input[type=number],
input[type=date], select, textarea {
  width: 100%; padding: 0.6rem 0.7rem; border: 1px solid var(--line); border-radius: 9px;
  background: #fff; color: var(--ink);
}
label { display: block; font-size: 0.8rem; font-weight: 700; color: var(--ink-soft); margin-bottom: 0.3rem; text-transform: uppercase; letter-spacing: 0.05em; }
.field { margin-bottom: 1rem; }
.hint { font-size: 0.78rem; color: var(--ink-soft); margin-top: 0.25rem; text-transform: none; letter-spacing: 0; }

/* ---------- Alerts ---------- */
.alert { padding: 0.7rem 0.9rem; border-radius: var(--radius-sm); font-size: 0.9rem; margin-bottom: 1rem; border: 1px solid transparent; }
.alert-error { background: var(--red-soft); border-color: var(--red); color: var(--red); }
.alert-success { background: var(--green-soft); border-color: var(--green); color: #145c3d; }
.alert-info { background: #e8f0fb; border-color: var(--blue); color: #1c4a70; }

/* ---------- Auth pages ---------- */
.auth-shell {
  min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 1.5rem;
  background:
    radial-gradient(900px 500px at 15% 10%, rgba(31,138,93,0.28), rgba(31,138,93,0) 55%),
    radial-gradient(900px 500px at 90% 90%, rgba(47,111,168,0.30), rgba(47,111,168,0) 55%),
    linear-gradient(150deg, var(--navy-deep) 0%, var(--navy) 55%, #16344f 100%);
}
.auth-card { position: relative; background: var(--surface); border-radius: 20px; padding: 2.4rem 2.2rem; width: 100%; max-width: 420px; box-shadow: 0 30px 60px -20px rgba(0,0,0,0.5); overflow: hidden; }
.auth-card::before { content: ""; position: absolute; top: 0; left: 0; right: 0; height: 5px; background: linear-gradient(90deg, var(--green), var(--blue), var(--amber)); }
.auth-mark { width: 46px; height: 46px; margin-bottom: 1rem; filter: drop-shadow(0 3px 8px rgba(31,138,93,0.4)); }
.auth-eyebrow { font-family: var(--font-mono); font-size: 0.72rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--green); margin-bottom: 0.3rem; }
.auth-card h1 { font-size: 1.6rem; margin-bottom: 1.3rem; }
.auth-switch { margin-top: 1.2rem; font-size: 0.9rem; color: var(--ink-soft); text-align: center; }
.auth-switch a { color: var(--blue); font-weight: 700; text-decoration: none; }

/* ---------- App shell ---------- */
.app-header {
  background:
    radial-gradient(120% 200% at 0% 0%, rgba(31,138,93,0.22), rgba(31,138,93,0) 45%),
    linear-gradient(120deg, var(--navy-deep) 0%, var(--navy) 55%, #1c4c74 100%);
  border-bottom: 1px solid rgba(255,255,255,0.08);
  padding: 0.9rem 1.4rem; display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
  position: sticky; top: 0; z-index: 30;
  box-shadow: 0 6px 20px -8px rgba(14,33,56,0.5);
  overflow: hidden;
}
.app-header::after { /* diagonal sheen */
  content: ""; position: absolute; top: -50%; left: 55%; width: 40%; height: 200%;
  background: linear-gradient(100deg, rgba(255,255,255,0.10), rgba(255,255,255,0)); transform: rotate(12deg); pointer-events: none;
}
.brand { display: flex; align-items: center; gap: 0.7rem; position: relative; z-index: 1; }
.brand-mark { width: 38px; height: 38px; filter: drop-shadow(0 2px 6px rgba(31,138,93,0.5)); }
.brand-title { font-family: var(--font-display); font-weight: 700; font-size: 1.12rem; color: #fff; }
.brand-title small { display: block; font-family: var(--font-mono); font-size: 0.64rem; letter-spacing: 0.1em; color: #7fe3b4; text-transform: uppercase; font-weight: 600; }
.header-right { display: flex; align-items: center; gap: 0.8rem; font-size: 0.88rem; position: relative; z-index: 1; }
.header-right #whoami { color: rgba(255,255,255,0.8); }
.header-right .btn-ghost { border-color: rgba(255,255,255,0.25); color: #fff; }
.header-right .btn-ghost:hover { border-color: #fff; background: rgba(255,255,255,0.1); }
.role-badge { font-family: var(--font-mono); font-size: 0.65rem; text-transform: uppercase; letter-spacing: 0.07em; background: rgba(227,160,8,0.2); border: 1px solid var(--amber); border-radius: 999px; padding: 0.15rem 0.55rem; color: #ffd579; }
.hamburger { display: none; background: none; border: none; padding: 0.4rem; color: #fff; }
.hamburger svg { width: 24px; height: 24px; }

.tabs { display: flex; gap: 0.2rem; background: var(--surface); padding: 0 1.4rem; border-bottom: 1px solid var(--line); overflow-x: auto; position: sticky; top: 61px; z-index: 29; }
.tab-btn { background: transparent; color: var(--ink-soft); border: none; border-radius: 0; padding: 0.75rem 0.9rem; font-family: var(--font-display); font-size: 0.9rem; border-bottom: 3px solid transparent; white-space: nowrap; }
.tab-btn.active { color: var(--navy-deep); border-bottom-color: var(--green); }
.tab-btn:hover { color: var(--navy-deep); }

main { max-width: 1180px; margin: 0 auto; padding: 1.6rem 1.4rem 3rem; }

.section-heading { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 1rem; flex-wrap: wrap; gap: 0.6rem; }
.section-heading h2 { font-size: 1.35rem; position: relative; padding-left: 0.85rem; }
.section-heading h2::before { /* accent bar on every section title */
  content: ""; position: absolute; left: 0; top: 0.1em; bottom: 0.1em; width: 5px; border-radius: 3px;
  background: linear-gradient(var(--green), var(--blue));
}
.section-heading .sub { color: var(--ink-soft); font-size: 0.88rem; }

/* ---------- Stat strip ---------- */
.stat-strip { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 0.9rem; margin-bottom: 1.6rem; }
.stat-tile { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.1rem 1.2rem; box-shadow: var(--shadow); }
.stat-tile .icon { width: 26px; height: 26px; margin-bottom: 0.5rem; }
.stat-tile .label { font-family: var(--font-mono); font-size: 0.66rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--ink-soft); }
.stat-tile .value { font-family: var(--font-display); font-size: 1.7rem; color: var(--navy-deep); margin-top: 0.2rem; }

/* ---------- Card tiles (credit cards) ---------- */
/* Two-column layout grouping similar cards by rewards program */
.card-columns { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.4rem; align-items: start; }
.card-column { display: flex; flex-direction: column; gap: 1.2rem; }
.card-column-head { display: flex; align-items: baseline; gap: 0.6rem; padding-bottom: 0.4rem; border-bottom: 2px solid var(--line); }
.card-column-head h3 { font-size: 1.1rem; color: var(--navy-deep); }
.card-column-head .count { font-family: var(--font-mono); font-size: 0.72rem; color: var(--ink-soft); }
@media (max-width: 720px) { .card-columns { grid-template-columns: 1fr; } }

.pass-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 1.1rem; }
.pass { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); border: 1px solid var(--line); overflow: hidden; }

/* --- Realistic credit-card face --- */
.card-face {
  position: relative;
  aspect-ratio: 1.586 / 1;              /* real card proportions (85.6 x 54mm) */
  border-radius: 14px;
  padding: 1.1rem 1.2rem;
  color: #fff;
  background:
    radial-gradient(120% 140% at 85% -10%, rgba(255,255,255,0.28), rgba(255,255,255,0) 55%),
    linear-gradient(135deg, var(--brand) 0%, rgba(0,0,0,0.55) 135%);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.25), 0 10px 22px rgba(16,32,60,0.28);
  display: grid;
  grid-template-rows: auto auto 1fr auto;
  overflow: hidden;
}
.card-face::after {   /* subtle sheen band */
  content: ""; position: absolute; top: -40%; left: -20%; width: 60%; height: 180%;
  background: linear-gradient(100deg, rgba(255,255,255,0.16), rgba(255,255,255,0));
  transform: rotate(12deg); pointer-events: none;
}
.card-face .cf-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 0.6rem; z-index: 1; }
.card-face .cf-program { font-family: var(--font-mono); font-size: 0.66rem; text-transform: uppercase; letter-spacing: 0.12em; opacity: 0.92; padding-top: 0.15rem; }
.card-face .card-logo { height: 26px; border-radius: 5px; box-shadow: 0 1px 3px rgba(0,0,0,0.3); }
.card-face .cf-chip { margin: 0.5rem 0 0.2rem; z-index: 1; }
.card-face .cf-number { font-family: var(--font-mono); font-size: 1.05rem; letter-spacing: 0.06em; text-shadow: 0 1px 2px rgba(0,0,0,0.35); align-self: center; z-index: 1; }
.card-face .cf-bottom { display: flex; justify-content: space-between; align-items: flex-end; gap: 0.8rem; z-index: 1; }
.card-face .cf-field { display: flex; flex-direction: column; min-width: 0; }
.card-face .cf-field.cf-name { text-align: right; align-items: flex-end; }
.card-face .cf-lbl { font-family: var(--font-mono); font-size: 0.55rem; text-transform: uppercase; letter-spacing: 0.08em; opacity: 0.75; }
.card-face .cf-val { font-size: 0.9rem; font-weight: 600; letter-spacing: 0.04em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }

.pass-body { padding: 1rem 1.2rem; }
.pass-points { display: grid; grid-template-columns: 1fr 1fr; gap: 0.7rem; margin-bottom: 0.8rem; }
.pass-points .pt { background: var(--surface-alt); border-radius: var(--radius-sm); padding: 0.55rem 0.7rem; }
.pass-points .pt-label { font-family: var(--font-mono); font-size: 0.62rem; text-transform: uppercase; color: var(--ink-soft); letter-spacing: 0.06em; }
.pass-points .pt-value { font-family: var(--font-mono); font-weight: 600; font-size: 1.05rem; color: var(--navy-deep); }
.pass-body dl { display: grid; grid-template-columns: auto 1fr; gap: 0.15rem 0.6rem; font-size: 0.85rem; margin: 0 0 0.6rem; }
.pass-body dt { color: var(--ink-soft); }
.pass-body dd { margin: 0; white-space: pre-line; }
.pass-actions { padding: 0.7rem 1.2rem; border-top: 1px solid var(--line); display: flex; gap: 0.5rem; }

/* ---------- Goal progress rings (signature element) ---------- */
/* ---------- Goal progress cards (signature element) ---------- */
.goal-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 1.3rem 1.4rem;
  display: grid; grid-template-columns: 92px 1fr; gap: 1.2rem; align-items: start;
}
.goal-ring { position: relative; width: 92px; height: 92px; flex-shrink: 0; }
.goal-ring svg { transform: rotate(-90deg); width: 92px; height: 92px; }
.goal-ring circle { fill: none; stroke-width: 9; }
.goal-ring .track { stroke: var(--surface-alt); }
.goal-ring .progress { stroke: var(--green); stroke-linecap: round; transition: stroke-dashoffset 0.5s ease; }
.goal-ring.status-completed .progress { stroke: var(--green); }
.goal-ring.status-expired .progress { stroke: var(--red); }
.goal-ring.status-in_progress .progress { stroke: var(--amber); }
.goal-ring .pct { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-family: var(--font-mono); font-weight: 700; font-size: 1.15rem; color: var(--navy-deep); }
.goal-info { min-width: 0; }
.goal-info h4 { font-size: 1.18rem; line-height: 1.25; margin-bottom: 0.35rem; }
.goal-info .card-tag { font-family: var(--font-mono); font-size: 0.68rem; text-transform: uppercase; color: var(--ink-soft); letter-spacing: 0.05em; margin-bottom: 0.3rem; }
.goal-info .goal-desc { font-size: 0.9rem; color: var(--ink-soft); margin: 0.4rem 0 0.6rem; line-height: 1.4; }
/* horizontal completion bar under the title */
.goal-bar { height: 12px; background: var(--surface-alt); border-radius: 999px; overflow: hidden; margin: 0.6rem 0 0.5rem; }
.goal-bar .fill { height: 100%; border-radius: 999px; transition: width 0.5s ease; }
.goal-bar .fill.in_progress { background: var(--amber); }
.goal-bar .fill.completed { background: var(--green); }
.goal-bar .fill.expired { background: var(--red); }
.goal-info .progress-text { font-size: 0.95rem; color: var(--ink-soft); margin-top: 0.35rem; }
.goal-info .progress-text strong { color: var(--navy-deep); font-family: var(--font-mono); font-size: 1.02rem; }
.goal-meta { display: flex; flex-wrap: wrap; gap: 0.4rem 1rem; margin-top: 0.55rem; font-size: 0.85rem; color: var(--ink-soft); }
.goal-meta .use-by strong { font-family: var(--font-mono); }
.goal-actions { display: flex; gap: 0.5rem; margin-top: 0.9rem; flex-wrap: wrap; }
.goal-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.1rem; }

/* Provider grouping on the Benefits page */
.provider-group { margin-bottom: 2rem; }
.provider-header { display: flex; align-items: center; gap: 0.6rem; margin: 0 0 0.9rem; padding-bottom: 0.5rem; border-bottom: 2px solid var(--line); }
.provider-header .badge { width: 32px; height: 32px; border-radius: 8px; background: var(--navy); color: #fff; display: flex; align-items: center; justify-content: center; font-family: var(--font-display); font-weight: 700; font-size: 0.9rem; flex-shrink: 0; }
.provider-header h3 { font-size: 1.15rem; }
.provider-header .count { font-family: var(--font-mono); font-size: 0.75rem; color: var(--ink-soft); }
@media (max-width: 820px) { .goal-grid { grid-template-columns: 1fr; } }
@media (max-width: 560px) { .goal-card { grid-template-columns: 72px 1fr; gap: 0.9rem; padding: 1.1rem; } .goal-ring, .goal-ring svg { width: 72px; height: 72px; } }
.status-chip { font-family: var(--font-mono); font-size: 0.62rem; text-transform: uppercase; letter-spacing: 0.05em; padding: 0.15rem 0.5rem; border-radius: 999px; }
.status-chip.in_progress { background: var(--amber-soft); color: #8a6103; }
.status-chip.completed { background: var(--green-soft); color: #145c3d; }
.status-chip.expired { background: var(--red-soft); color: var(--red); }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; background: var(--surface); border-radius: var(--radius); border: 1px solid var(--line); box-shadow: var(--shadow); }
table { width: 100%; border-collapse: collapse; font-size: 0.89rem; }
th, td { text-align: left; padding: 0.65rem 0.8rem; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-family: var(--font-mono); font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--ink-soft); background: var(--surface-alt); }
tr:last-child td { border-bottom: none; }
.status-pill { font-family: var(--font-mono); font-size: 0.68rem; text-transform: uppercase; padding: 0.15rem 0.5rem; border-radius: 999px; letter-spacing: 0.03em; }
.status-pill.s-not-used { background: var(--green-soft); color: #145c3d; }
.status-pill.s-used { background: var(--surface-alt); color: var(--ink-soft); }
.status-pill.s-expired { background: var(--red-soft); color: var(--red); }
.expiring { color: var(--red); font-weight: 600; }

/* ---------- Panels ---------- */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 1.2rem; margin-bottom: 1.2rem; }
.panel h3 { font-size: 1rem; margin-bottom: 0.8rem; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0.9rem; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.9rem; }
@media (max-width: 720px) { .grid-2, .grid-3 { grid-template-columns: 1fr; } }

.chart-box { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 1rem; }
.chart-box h3 { display: flex; align-items: center; gap: 0.4rem; }

/* ---------- Dashboard hero banner ---------- */
.dash-hero {
  position: relative; overflow: hidden;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  border-radius: 20px; padding: 1.6rem 1.8rem; margin-bottom: 1.6rem;
  background:
    radial-gradient(120% 160% at 100% 0%, rgba(31,138,93,0.35), rgba(31,138,93,0) 55%),
    linear-gradient(120deg, var(--navy-deep) 0%, var(--navy) 60%, #1c4c74 100%);
  color: #fff; box-shadow: 0 18px 40px -18px rgba(14,33,56,0.6);
}
.dash-hero-text { position: relative; z-index: 1; }
.dash-hero-eyebrow { font-family: var(--font-mono); font-size: 0.66rem; text-transform: uppercase; letter-spacing: 0.16em; color: #7fe3b4; }
.dash-hero h2 { color: #fff; font-size: 1.7rem; margin: 0.25rem 0 0.3rem; }
.dash-hero p { margin: 0 0 0.5rem; color: rgba(255,255,255,0.85); font-size: 0.95rem; }
.dash-hero .sub { color: rgba(255,255,255,0.6); font-size: 0.8rem; font-family: var(--font-mono); }
.dash-hero-art { width: 240px; height: 160px; flex-shrink: 0; filter: drop-shadow(0 12px 20px rgba(0,0,0,0.3)); }
@media (max-width: 680px) { .dash-hero-art { display: none; } .dash-hero h2 { font-size: 1.4rem; } }
.chart-box-head { display: flex; align-items: center; justify-content: space-between; gap: 0.6rem; flex-wrap: wrap; margin-bottom: 0.5rem; }
.range-buttons { display: inline-flex; border: 1px solid var(--line); border-radius: 999px; overflow: hidden; background: var(--surface-alt); }
.range-btn { border: none; background: transparent; padding: 0.28rem 0.8rem; font-family: var(--font-display); font-size: 0.78rem; color: var(--ink-soft); cursor: pointer; transition: background 0.15s ease, color 0.15s ease; }
.range-btn + .range-btn { border-left: 1px solid var(--line); }
.range-btn:hover { color: var(--navy-deep); }
.range-btn.active { background: var(--navy); color: #fff; }

/* Dashboard: per-provider benefit charts */
.provider-charts { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 1.1rem; }
.points-breakdown { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 1.1rem; }

/* ---------- Flashy dashboard benefit cards ---------- */
.flashy-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 1rem; }
.flashy-card {
  position: relative; overflow: hidden;
  display: flex; align-items: center; gap: 1rem;
  padding: 1.1rem 1.2rem; border-radius: 16px; color: #fff;
  box-shadow: 0 10px 24px rgba(16,32,60,0.22);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
  text-decoration: none; cursor: pointer;
}
.flashy-card:hover { transform: translateY(-3px); box-shadow: 0 16px 32px rgba(16,32,60,0.3); }
.flashy-card:focus-visible { outline: 3px solid var(--navy-deep); outline-offset: 2px; }
.flashy-card::after { /* glossy sheen */
  content: ""; position: absolute; top: -60%; left: -30%; width: 55%; height: 220%;
  background: linear-gradient(100deg, rgba(255,255,255,0.22), rgba(255,255,255,0)); transform: rotate(14deg); pointer-events: none;
}
.flashy-body { min-width: 0; z-index: 1; }
.flashy-kind { font-family: var(--font-mono); font-size: 0.58rem; text-transform: uppercase; letter-spacing: 0.08em; opacity: 0.85; margin-bottom: 0.15rem; }
.flashy-title { font-family: var(--font-display); font-weight: 700; font-size: 1.02rem; line-height: 1.2; }
.flashy-sub { font-size: 0.8rem; opacity: 0.9; margin-top: 0.15rem; }
.flashy-meta { font-size: 0.82rem; opacity: 0.95; margin-top: 0.4rem; }
.flashy-meta strong { font-family: var(--font-mono); }

/* Expiring-soonest: big day counter badge, color by urgency */
.flashy-badge {
  flex-shrink: 0; width: 68px; height: 68px; border-radius: 14px;
  background: rgba(255,255,255,0.18); backdrop-filter: blur(2px);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  font-family: var(--font-display); font-weight: 800; font-size: 1.6rem; line-height: 1; z-index: 1;
}
.flashy-badge span { font-family: var(--font-mono); font-weight: 500; font-size: 0.52rem; text-transform: uppercase; letter-spacing: 0.06em; opacity: 0.9; margin-top: 0.2rem; }
.urgency-past     { background: linear-gradient(135deg, #7a1420 0%, #b4231f 100%); }
.urgency-critical { background: linear-gradient(135deg, #c1443a 0%, #e8623a 100%); animation: flashy-pulse 2s ease-in-out infinite; }
.urgency-soon     { background: linear-gradient(135deg, #d98a06 0%, #e3a008 100%); }
.urgency-ok       { background: linear-gradient(135deg, #1f8a5d 0%, #2fa876 100%); }
@keyframes flashy-pulse { 0%,100% { box-shadow: 0 10px 24px rgba(193,68,58,0.35); } 50% { box-shadow: 0 10px 30px rgba(232,98,58,0.7); } }

/* Closest-to-goal: gradient by how hot the progress is, with the ring */
.goal-flashy { justify-content: flex-start; }
.goal-flashy.hot  { background: linear-gradient(135deg, #1f8a5d 0%, #12b886 100%); }
.goal-flashy.warm { background: linear-gradient(135deg, #d98a06 0%, #f0a92b 100%); }
.goal-flashy.cool { background: linear-gradient(135deg, #2452a6 0%, #3f7ad1 100%); }
.goal-flashy .goal-ring { flex-shrink: 0; z-index: 1; }
.goal-flashy .goal-ring .track { stroke: rgba(255,255,255,0.28); }
.goal-flashy .goal-ring .progress { stroke: #fff; }
.goal-flashy .goal-ring .pct { color: #fff; }
@media (prefers-reduced-motion: reduce) { .urgency-critical { animation: none; } .flashy-card:hover { transform: none; } }
/* Per-card benefit tables on the Benefits page */
.card-benefits { margin-bottom: 2rem; }
.card-benefits-focus { animation: card-focus-flash 2.4s ease-out; border-radius: 12px; }
@keyframes card-focus-flash {
  0% { box-shadow: 0 0 0 3px var(--green), 0 0 0 8px rgba(31,138,93,0.25); background: rgba(31,138,93,0.06); }
  100% { box-shadow: 0 0 0 0 rgba(31,138,93,0); background: transparent; }
}
.card-benefits-head { display: flex; align-items: baseline; gap: 0.7rem; flex-wrap: wrap; margin-bottom: 0.7rem; padding-bottom: 0.45rem; border-bottom: 2px solid var(--line); }
.card-benefits-head h3 { font-size: 1.12rem; color: var(--navy-deep); }
.card-benefits-head .cb-program { font-family: var(--font-mono); font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.06em; color: #fff; background: var(--navy); padding: 0.12rem 0.5rem; border-radius: 6px; }
.card-benefits-head .count { font-family: var(--font-mono); font-size: 0.72rem; color: var(--ink-soft); margin-left: auto; }
.benefits-table { width: 100%; border-collapse: collapse; }
.benefits-table th { text-align: left; font-family: var(--font-mono); font-size: 0.66rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--ink-soft); padding: 0.5rem 0.7rem; border-bottom: 1px solid var(--line); }
.benefits-table td { padding: 0.7rem; border-bottom: 1px solid var(--line); vertical-align: middle; font-size: 0.9rem; }
.benefits-table .bt-title strong { color: var(--navy-deep); }
.benefits-table .bt-desc { font-size: 0.8rem; color: var(--ink-soft); margin-top: 0.15rem; }
.benefits-table .bt-bar { height: 8px; background: var(--surface-alt); border-radius: 999px; overflow: hidden; margin-bottom: 0.3rem; min-width: 90px; }
.benefits-table .bt-bar .fill { height: 100%; border-radius: 999px; }
.benefits-table .bt-bar .fill.in_progress { background: var(--amber); }
.benefits-table .bt-bar .fill.completed { background: var(--green); }
.benefits-table .bt-bar .fill.expired { background: var(--red); }
.benefits-table .bt-num { font-family: var(--font-mono); font-size: 0.78rem; color: var(--ink-soft); }
.benefits-table .bt-actions { white-space: nowrap; text-align: right; }
.benefits-table .bt-actions .btn-small { margin-left: 0.3rem; }
.benefits-table td.expiring, .benefits-table .expiring { color: var(--red); font-weight: 600; }
/* Highlight completed benefits */
.benefits-table tr.bt-completed td { background: rgba(31, 138, 93, 0.09); }
.benefits-table tr.bt-completed td:first-child { box-shadow: inset 3px 0 0 var(--green); }
.benefits-table tr.bt-completed .bt-title strong { color: var(--green); }
/* On small screens the action buttons stack and the table scrolls horizontally via .table-wrap */
@media (max-width: 640px) {
  .benefits-table .bt-actions { text-align: left; }
  .benefits-table .bt-actions .btn-small { margin: 0.15rem 0.3rem 0.15rem 0; }
}
.pb-rows { margin-top: 0.8rem; border-top: 1px solid var(--line); padding-top: 0.6rem; }
.pb-row { display: flex; align-items: center; gap: 0.5rem; padding: 0.28rem 0; font-size: 0.9rem; }
.pb-dot { width: 10px; height: 10px; border-radius: 3px; flex-shrink: 0; }
.pb-name { color: var(--ink); flex: 1; }
.pb-val { font-family: var(--font-mono); font-weight: 700; color: var(--navy-deep); }
.pb-total { border-top: 1px dashed var(--line); margin-top: 0.3rem; padding-top: 0.5rem; }
.pb-total .pb-name, .pb-total .pb-val { color: var(--navy-deep); }
.provider-chart-card { position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 1.1rem 1.2rem; overflow: hidden; transition: transform 0.18s ease, box-shadow 0.18s ease; }
.provider-chart-card::before { content: ""; position: absolute; top: 0; left: 0; right: 0; height: 4px; background: linear-gradient(90deg, var(--green), var(--blue), var(--amber)); }
.provider-chart-card:hover { transform: translateY(-3px); box-shadow: 0 16px 32px -16px rgba(20,35,52,0.4); }
.provider-chart-card .pc-head { display: flex; align-items: center; gap: 0.6rem; margin-bottom: 0.8rem; }
.provider-chart-card .pc-badge { width: 34px; height: 34px; border-radius: 9px; background: linear-gradient(135deg, var(--green), var(--navy)); color: #fff; display: flex; align-items: center; justify-content: center; font-family: var(--font-display); font-weight: 700; font-size: 0.85rem; box-shadow: 0 4px 10px -3px rgba(31,138,93,0.6); }
.provider-chart-card .pc-title { font-family: var(--font-display); font-weight: 600; color: var(--navy-deep); }
.provider-chart-card .pc-title small { display: block; font-family: var(--font-mono); font-size: 0.66rem; color: var(--ink-soft); text-transform: uppercase; letter-spacing: 0.05em; font-weight: 400; }
.provider-chart-card .pc-canvas-wrap { position: relative; height: 180px; }
.provider-chart-card .pc-stats { display: flex; justify-content: space-around; margin-top: 0.8rem; text-align: center; }
.provider-chart-card .pc-stats .n { font-family: var(--font-display); font-size: 1.2rem; color: var(--navy-deep); }
.provider-chart-card .pc-stats .l { font-family: var(--font-mono); font-size: 0.62rem; text-transform: uppercase; color: var(--ink-soft); letter-spacing: 0.05em; }

.toast { position: fixed; bottom: 1.2rem; right: 1.2rem; left: 1.2rem; max-width: 360px; margin-left: auto; background: var(--navy-deep); color: #fff; padding: 0.7rem 1.1rem; border-radius: 10px; font-size: 0.9rem; box-shadow: var(--shadow); opacity: 0; transform: translateY(8px); transition: opacity .2s ease, transform .2s ease; z-index: 50; }
.toast.show { opacity: 1; transform: translateY(0); }
.toast.error { background: var(--red); }

.modal-backdrop { position: fixed; inset: 0; background: rgba(20,35,52,0.45); display: none; align-items: center; justify-content: center; padding: 1rem; z-index: 40; }
.modal-backdrop.open { display: flex; }
.modal { background: var(--surface); border-radius: var(--radius); padding: 1.4rem; width: 100%; max-width: 480px; max-height: 90vh; overflow-y: auto; box-shadow: var(--shadow); }
.modal h3 { margin-bottom: 1rem; }
.modal-actions { display: flex; justify-content: flex-end; gap: 0.6rem; margin-top: 1rem; }

.empty-state { text-align: center; padding: 2.5rem 1rem; color: var(--ink-soft); }
.empty-state svg { width: 64px; height: 64px; margin-bottom: 0.8rem; opacity: 0.6; }

.page-footer { text-align: center; color: var(--ink-soft); font-size: 0.8rem; padding: 2rem 1rem; }

/* Desktop nav: icons hidden, text tabs in a row (default .tabs styling above) */
.tab-icon { display: none; }

/* ---------- Mobile: bottom navigation bar ---------- */
@media (max-width: 780px) {
  .header-right span#whoami { display: none; }
  .hamburger { display: none; }              /* no menu button needed anymore */
  .nav-backdrop { display: none !important; }

  /* Turn the tab bar into a fixed bottom bar with icons + labels */
  .tabs {
    position: fixed; top: auto; left: 0; right: 0; bottom: 0;
    display: flex; gap: 0; padding: 0; margin: 0;
    background: var(--surface); border-top: 1px solid var(--line);
    border-bottom: none; overflow-x: visible;
    box-shadow: 0 -4px 16px rgba(20,35,52,0.10);
    z-index: 40;
    padding-bottom: env(safe-area-inset-bottom, 0); /* iPhone home-bar gap */
  }
  .tab-btn {
    flex: 1 1 0; min-width: 0;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 2px; text-align: center; padding: 0.5rem 0.15rem 0.55rem;
    border: none; border-top: 3px solid transparent;
    font-size: 0.66rem; color: var(--ink-soft); line-height: 1.1;
  }
  .tab-btn span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
  .tab-btn.active { border-top-color: var(--green); background: var(--surface-alt); color: var(--navy-deep); }
  .tab-icon { display: block; width: 22px; height: 22px; }
  .tab-btn.active .tab-icon { color: var(--green); }

  /* Keep page content clear of the fixed bottom bar */
  main { padding-bottom: 5.5rem; }
}

@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
