/* Sanjita Informatics licence portal. Mobile first (360 px up), then wider layouts.
   Shell: green top bar + slide-in menu on phones; fixed green side menu from 1024 px. */
:root {
  --brand: #4c6e5e; --brand-dark: #3a5649; --brand-deep: #2d4439; --brand-soft: #e9f1ed; --brand-ink: #2c4238; /* white on brand = 5.7:1 */
  --bg: #f3f5f4; --card: #fff; --text: #1d2733; --muted: #5a6672; --line: #dfe5e2; --line-strong: #c3ccc7;
  --ok: #1d7a46; --ok-soft: #e3f4ea; --warn: #8f5400; --warn-soft: #fff1d6;
  --bad: #b3261e; --bad-soft: #fde7e5; --grey: #4a5560; --grey-soft: #eceff1;
  --radius: 14px; --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(29, 39, 51, .04), 0 1px 3px rgba(29, 39, 51, .06);
  --shadow-lift: 0 8px 24px rgba(45, 68, 57, .12);
  --ring: 0 0 0 3px rgba(76, 110, 94, .35);
  --nav-w: 248px; --topbar-h: 56px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; color: var(--text); background: var(--bg);
  min-height: 100vh; display: flex; flex-direction: column; overflow-x: hidden; }
a { color: var(--brand-dark); }
h1 { font-size: 1.4rem; line-height: 1.25; margin: 0 0 4px; letter-spacing: -.2px; }
h2 { font-size: 1.02rem; margin: 22px 0 10px; }
h3 { font-size: .98rem; margin: 0 0 6px; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--brand); outline-offset: 2px; }
svg.ic { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- shell ---------- */
.shell { position: sticky; top: 0; z-index: 20; }
.topbar { height: var(--topbar-h); display: flex; align-items: center; gap: 10px; padding: 0 12px;
  background: var(--brand); color: #fff; box-shadow: 0 2px 8px rgba(45, 68, 57, .25); }
.brand { display: inline-flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; font-size: .82rem; min-width: 0; }
.brand img { height: 40px; width: auto; display: block; border-radius: 4px; }
.brand span { opacity: .9; border-left: 1px solid rgba(255,255,255,.4); padding-left: 10px; white-space: nowrap; }
.menu-btn { width: 42px; height: 42px; flex: none; display: inline-grid; place-content: center; gap: 4px; padding: 0; border-radius: 10px;
  background: transparent; border: 1px solid rgba(255,255,255,.45); cursor: pointer; }
.menu-btn span { display: block; width: 18px; height: 2px; border-radius: 2px; background: #fff; transition: transform .2s, opacity .2s; }
.menu-btn[aria-expanded="true"] span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.menu-btn[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.menu-btn[aria-expanded="true"] span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }
.menu-btn:focus-visible { outline-color: #fff; }

.drawer { position: fixed; z-index: 30; top: var(--topbar-h); left: 0; bottom: 0; width: var(--nav-w); max-width: 86vw; overflow-y: auto;
  background: var(--brand-dark); color: #fff; padding: 12px 10px calc(16px + env(safe-area-inset-bottom));
  display: flex; flex-direction: column; gap: 6px; transform: translateX(-102%); visibility: hidden;
  transition: transform .22s cubic-bezier(.2,.8,.2,1), visibility 0s linear .22s; }
.drawer.open { transform: none; visibility: visible; transition: transform .22s cubic-bezier(.2,.8,.2,1); box-shadow: 12px 0 40px rgba(16,24,20,.3); }
.drawer .drawer-brand { display: none; }
.nav-group { display: grid; gap: 2px; }
.nav-group + .nav-group { margin-top: 8px; padding-top: 8px; border-top: 1px solid rgba(255,255,255,.14); }
.nav-head { font-size: .7rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: rgba(255,255,255,.72); padding: 4px 12px; }
.drawer a { display: flex; align-items: center; gap: 12px; min-height: 44px; padding: 8px 12px; border-radius: 10px; color: #fff;
  text-decoration: none; font-weight: 500; }
.drawer a:hover { background: rgba(255,255,255,.1); }
.drawer a.active { background: #fff; color: var(--brand-ink); font-weight: 650; }
.drawer a:focus-visible { outline-color: #fff; outline-offset: -2px; }
.drawer svg.ic { opacity: .9; }
.nav-foot { margin-top: auto; }
.nav-who { font-size: .78rem; color: rgba(255,255,255,.75); padding: 6px 12px 0; overflow-wrap: anywhere; }
.scrim { position: fixed; inset: var(--topbar-h) 0 0 0; z-index: 25; background: rgba(16, 24, 20, .4); opacity: 0; pointer-events: none; transition: opacity .2s; }
.scrim.open { opacity: 1; pointer-events: auto; }

main { width: 100%; max-width: 1140px; margin: 0 auto; padding: 16px 16px 28px; flex: 1; min-width: 0; }
.app-foot { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 16px; padding: 18px 16px 24px; font-size: .84rem; color: var(--muted);
  border-top: 1px solid var(--line); }
.app-foot a { color: var(--muted); }
.app-foot a:hover { color: var(--brand-dark); }

@media (min-width: 1024px) {
  .topbar, .scrim { display: none; }
  .drawer { top: 0; transform: none; visibility: visible; transition: none; box-shadow: none; padding-top: 16px; }
  .drawer .drawer-brand { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; padding: 4px 10px 14px; margin-bottom: 4px;
    border-bottom: 1px solid rgba(255,255,255,.14); min-height: 0; }
  .drawer-brand:hover { background: none; }
  .drawer-brand img { width: 150px; height: auto; display: block; border-radius: 6px; }
  .drawer-brand span { font-size: .78rem; letter-spacing: .06em; text-transform: uppercase; color: rgba(255,255,255,.78); }
  .shell:not([hidden]) ~ main, .shell:not([hidden]) ~ .app-foot { margin-left: var(--nav-w); width: auto; }
  .shell:not([hidden]) ~ main { padding: 28px 32px 40px; max-width: none; }
}
@media (min-width: 1400px) { .shell:not([hidden]) ~ main { padding-right: calc((100vw - var(--nav-w) - 1140px) / 2); padding-left: calc((100vw - var(--nav-w) - 1140px) / 2); } }

/* ---------- page header ---------- */
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px; margin-bottom: 16px; }
.page-head > div:first-child { flex: 1 1 220px; min-width: 0; }
.page-head h1 { overflow-wrap: anywhere; }
.subtitle { color: var(--muted); margin: 0; font-size: .92rem; }
.back { display: inline-flex; align-items: center; gap: 4px; margin-bottom: 10px; text-decoration: none; font-weight: 600; font-size: .9rem; }
.back:hover { text-decoration: underline; }

/* ---------- cards, forms, buttons ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin-bottom: 14px; box-shadow: var(--shadow); }
.card > h2:first-child, .card-head h2 { margin-top: 0; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.card-head h2 { margin: 0; display: flex; align-items: center; gap: 8px; }
.card-head h2 svg.ic { color: var(--brand); }
.count { display: inline-grid; place-items: center; min-width: 22px; height: 22px; padding: 0 7px; border-radius: 999px; background: var(--brand-soft);
  color: var(--brand-ink); font-size: .75rem; font-weight: 700; }
label { display: block; font-weight: 600; font-size: .88rem; margin: 12px 0 5px; }
label .hint { font-weight: 400; color: var(--muted); }
.group-label { display: block; font-weight: 700; font-size: .78rem; letter-spacing: .06em; text-transform: uppercase; color: var(--muted);
  margin: 20px 0 0; padding-top: 14px; border-top: 1px solid var(--line); }
.group-label .hint { text-transform: none; letter-spacing: 0; font-weight: 400; }
input, select, textarea { width: 100%; font: inherit; padding: 10px 12px; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); background: #fff;
  color: var(--text); min-height: 44px; transition: border-color .15s, box-shadow .15s; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand); box-shadow: var(--ring); }
textarea { min-height: 88px; resize: vertical; }
.row2 { display: grid; grid-template-columns: 1fr; gap: 0 14px; }
.row3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 10px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; font: inherit; font-weight: 600; padding: 10px 16px;
  border-radius: var(--radius-sm); border: 1px solid var(--brand); background: var(--brand); color: #fff; cursor: pointer; text-decoration: none;
  min-height: 44px; transition: background .15s, box-shadow .15s, transform .05s; text-align: center; }
.btn:hover { background: var(--brand-dark); border-color: var(--brand-dark); }
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn svg.ic { width: 18px; height: 18px; }
.btn.secondary { background: #fff; color: var(--brand-dark); border-color: var(--line-strong); }
.btn.secondary:hover { background: var(--brand-soft); border-color: var(--brand); }
.btn.danger { background: #fff; color: var(--bad); border-color: #e3b4b0; }
.btn.danger:hover { background: var(--bad-soft); border-color: var(--bad); }
.btn.small { padding: 6px 12px; min-height: 36px; font-size: .86rem; }
.btn:disabled { opacity: .6; cursor: default; }
.btn.block { width: 100%; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.actions .btn { flex: 1 1 140px; }
.actions select { flex: 1 1 120px; width: auto; min-height: 36px; padding: 6px 10px; }
.err { color: var(--bad); background: var(--bad-soft); border-radius: var(--radius-sm); padding: 9px 12px; margin: 12px 0 0; border-left: 4px solid var(--bad); }
.ok-msg { color: var(--ok); background: var(--ok-soft); border-radius: var(--radius-sm); padding: 9px 12px; margin: 12px 0 0; border-left: 4px solid var(--ok); }
.note { color: var(--warn); background: var(--warn-soft); border-radius: var(--radius-sm); padding: 9px 12px; border-left: 4px solid var(--warn); }
.muted { color: var(--muted); }
.small { font-size: .86rem; }
.mono { font-family: ui-monospace, Consolas, monospace; overflow-wrap: anywhere; }
.center { text-align: center; }

/* ---------- status chips ---------- */
.badge { display: inline-flex; align-items: center; gap: 5px; font-size: .76rem; font-weight: 700; padding: 3px 9px; border-radius: 999px; white-space: nowrap;
  background: var(--grey-soft); color: var(--grey); line-height: 1.3; }
.badge::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; flex: none; }
.badge.Active { background: var(--ok-soft); color: var(--ok); }
.badge.Expired { background: var(--bad-soft); color: var(--bad); }
.badge.Suspended { background: var(--grey-soft); color: var(--grey); }
.badge.warn { background: var(--warn-soft); color: var(--warn); }
.badge.Blocked { background: var(--bad); color: #fff; }
.badges { display: inline-flex; flex-wrap: wrap; gap: 6px; align-items: center; }

/* ---------- stat cards (Clients dashboard) ---------- */
.stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-bottom: 16px; }
.stat { --tint: var(--brand); position: relative; overflow: hidden; display: flex; flex-direction: column; gap: 2px; padding: 12px 14px 14px;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); color: var(--text);
  text-decoration: none; min-width: 0; transition: transform .15s ease, box-shadow .15s ease, border-color .15s; }
.stat::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 3px; background: var(--tint); }
a.stat:hover { transform: translateY(-2px); box-shadow: var(--shadow-lift); border-color: var(--tint); }
.stat.on { border-color: var(--tint); box-shadow: 0 0 0 1px var(--tint), var(--shadow); }
.stat-top { display: flex; align-items: center; gap: 8px; }
.stat-ic { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; flex: none; background: var(--tint-soft, var(--brand-soft)); color: var(--tint); }
.stat-ic svg.ic { width: 17px; height: 17px; stroke-width: 2; }
.stat .label { font-size: .8rem; color: var(--muted); font-weight: 600; line-height: 1.25; }
.stat .value { font-size: 1.6rem; font-weight: 750; letter-spacing: -.5px; margin-top: 6px; font-variant-numeric: tabular-nums; line-height: 1.1; }
.stat .note2 { font-size: .76rem; color: var(--muted); }
.stat.ok { --tint: var(--ok); --tint-soft: var(--ok-soft); }
.stat.warn { --tint: var(--warn); --tint-soft: var(--warn-soft); }
.stat.grey { --tint: var(--grey); --tint-soft: var(--grey-soft); }
.stat.brand { --tint: var(--brand); --tint-soft: var(--brand-soft); }
@media (prefers-reduced-motion: no-preference) {
  .stat { animation: rise .4s cubic-bezier(.2,.8,.2,1) both; }
  .stat:nth-child(2) { animation-delay: 40ms; } .stat:nth-child(3) { animation-delay: 80ms; } .stat:nth-child(4) { animation-delay: 120ms; }
}
@keyframes rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ---------- filters ---------- */
.filter-bar { display: grid; gap: 10px; margin-bottom: 14px; }
.search { position: relative; }
.search svg.ic { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); width: 18px; height: 18px; pointer-events: none; }
.search input { padding-left: 38px; background: #fff; }
.chips { display: flex; gap: 6px; overflow-x: auto; margin: 0 -16px; padding: 2px 16px 4px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { display: inline-flex; align-items: center; gap: 6px; text-decoration: none; flex: 0 0 auto; border: 1px solid var(--line-strong); background: #fff;
  border-radius: 999px; padding: 6px 12px; font: inherit; font-size: .86rem; cursor: pointer; color: var(--text); min-height: 36px; }
.chip:hover { border-color: var(--brand); }
.chip b { font-size: .75rem; background: var(--grey-soft); color: var(--grey); border-radius: 999px; padding: 1px 7px; }
.chip.on { background: var(--brand); border-color: var(--brand); color: #fff; }
.chip.on b { background: rgba(255,255,255,.22); color: #fff; }
.result-line { font-size: .84rem; color: var(--muted); margin: 0 0 8px; }

/* ---------- lists (cards on phones) ---------- */
.list { display: grid; gap: 10px; }
.item { display: block; background: var(--card); border: 1px solid var(--line); border-left: 4px solid var(--line-strong); border-radius: 12px;
  padding: 12px 14px; color: inherit; text-decoration: none; box-shadow: var(--shadow); transition: border-color .15s, box-shadow .15s; min-width: 0; }
.item.s-Active { border-left-color: var(--ok); }
.item.s-Expired { border-left-color: var(--bad); }
.item.s-Suspended { border-left-color: var(--grey); }
.item.s-warn { border-left-color: var(--warn); }
a.item:hover { border-color: var(--brand); box-shadow: var(--shadow-lift); }
.item-top { display: flex; align-items: flex-start; gap: 10px; }
.item-name { font-weight: 650; flex: 1; min-width: 0; overflow-wrap: anywhere; }
.item-sub { color: var(--muted); font-size: .84rem; overflow-wrap: anywhere; }
.item-meta { color: var(--muted); font-size: .84rem; margin-top: 8px; display: flex; flex-wrap: wrap; gap: 4px 14px; }
.item-meta > span { display: inline-flex; align-items: center; gap: 5px; }
.item-meta svg.ic { width: 15px; height: 15px; }
.avatar { width: 38px; height: 38px; border-radius: 11px; flex: none; display: grid; place-items: center; background: var(--brand-soft);
  color: var(--brand-ink); font-weight: 750; font-size: .9rem; letter-spacing: .02em; }
.avatar.lg { width: 52px; height: 52px; border-radius: 14px; font-size: 1.1rem; }
.empty { text-align: center; color: var(--muted); padding: 28px 16px; background: var(--card); border: 1px dashed var(--line-strong); border-radius: var(--radius); }
.empty svg.ic { width: 34px; height: 34px; color: var(--brand); background: var(--brand-soft); border-radius: 50%; padding: 7px; box-sizing: content-box; }
.empty strong { display: block; color: var(--text); margin: 8px 0 2px; font-size: 1rem; }
.empty p { margin: 0 0 4px; }
.empty .btn { margin-top: 12px; }
.empty.compact { padding: 16px; }

/* tables only on wide screens */
.tbl-wrap { display: none; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.tbl { width: 100%; border-collapse: collapse; }
.tbl th, .tbl td { text-align: left; padding: 11px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; font-size: .9rem; }
.tbl tbody tr:last-child td { border-bottom: none; }
.tbl th { background: #f7f9f8; font-weight: 700; color: var(--muted); font-size: .74rem; text-transform: uppercase; letter-spacing: .05em; white-space: nowrap; }
.tbl tbody tr:hover td { background: #f6f9f7; }
.tbl tr.row-link { cursor: pointer; }
.tbl td.num, .tbl th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tbl td.nowrap { white-space: nowrap; }
.tbl .cell-name { display: flex; align-items: center; gap: 10px; min-width: 0; }
.tbl .cell-name a { font-weight: 650; text-decoration: none; color: var(--text); }
.tbl .cell-name a:hover { color: var(--brand-dark); text-decoration: underline; }
.tbl .avatar { width: 32px; height: 32px; border-radius: 9px; font-size: .8rem; }
.cards-only { display: grid; gap: 10px; }

/* ---------- client detail ---------- */
.hero-card { position: relative; overflow: hidden; border-radius: var(--radius); padding: 18px 16px; margin-bottom: 14px; color: #fff;
  background: radial-gradient(500px 220px at 0% 0%, #6a8d7c 0%, transparent 70%), linear-gradient(135deg, var(--brand-dark), var(--brand)); }
.hero-card::after { content: ""; position: absolute; right: -60px; top: -60px; width: 190px; height: 190px; border-radius: 50%;
  border: 28px solid rgba(255,255,255,.07); pointer-events: none; }
.hero-card > * { position: relative; z-index: 1; }
.hero-row { display: flex; gap: 12px; align-items: flex-start; }
.hero-row .avatar { background: rgba(255,255,255,.18); color: #fff; }
.hero-card h1 { margin: 0; overflow-wrap: anywhere; font-size: 1.35rem; }
.hero-card .hero-sub { margin: 2px 0 0; opacity: .9; font-size: .88rem; overflow-wrap: anywhere; }
.hero-card .badges { margin-top: 10px; }
.hero-card .badge { box-shadow: 0 0 0 1px rgba(255,255,255,.4); }
.hero-actions { display: none; }
.hero-actions .btn.secondary { background: rgba(255,255,255,.14); color: #fff; border-color: rgba(255,255,255,.45); }
.hero-actions .btn.secondary:hover { background: rgba(255,255,255,.24); border-color: #fff; }
.hero-actions .btn:focus-visible { outline-color: #fff; }
.term { margin-top: 14px; }
.term-bar { height: 8px; border-radius: 999px; background: rgba(255,255,255,.22); overflow: hidden; }
.term-bar span { display: block; height: 100%; border-radius: inherit; background: #fff; }
.term-bar span.w0 { width: 0; }
.term-text { display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; font-size: .8rem; margin-top: 6px; opacity: .92; }

.tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-bottom: 14px; }
.tile { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; box-shadow: var(--shadow); min-width: 0; }
.tile .label { font-size: .78rem; color: var(--muted); font-weight: 600; display: flex; align-items: center; gap: 6px; }
.tile .label svg.ic { width: 16px; height: 16px; color: var(--brand); }
.tile .value { font-size: 1.25rem; font-weight: 750; margin-top: 4px; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.tile .value small { font-size: .82rem; font-weight: 600; color: var(--muted); }
.tile .value.sm { font-size: .95rem; }
.tile .badge { margin-top: 6px; }
.meter { height: 5px; border-radius: 999px; background: var(--grey-soft); overflow: hidden; margin-top: 8px; }
.meter span { display: block; height: 100%; background: var(--brand); border-radius: inherit; }
.meter.full span { background: var(--warn); }

.detail-grid { display: grid; gap: 0 16px; }
.detail-grid > div { min-width: 0; }
.kv { display: grid; grid-template-columns: 1fr; gap: 0; margin: 0; }
.kv > div { min-width: 0; display: grid; grid-template-columns: minmax(96px, 38%) 1fr; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.kv > div:last-child { border-bottom: none; }
.kv dt { color: var(--muted); font-size: .84rem; }
.kv dd { margin: 0; overflow-wrap: anywhere; font-weight: 500; }
.notes { background: var(--brand-soft); border-radius: var(--radius-sm); padding: 10px 12px; margin: 10px 0 0; font-size: .9rem; white-space: pre-wrap; overflow-wrap: anywhere; }
.manage { display: grid; gap: 8px; margin-top: 4px; }
.manage .btn { width: 100%; justify-content: flex-start; }
.manage p { margin: 0; }

.rows { display: grid; gap: 10px; }
.line-item { border: 1px solid var(--line); border-radius: 12px; padding: 12px; background: #fff; min-width: 0; }
.line-item .t { display: flex; gap: 8px; align-items: flex-start; flex-wrap: wrap; }
.line-item .t > :first-child { flex: 1 1 160px; min-width: 0; overflow-wrap: anywhere; font-weight: 650; }
.line-item .small { overflow-wrap: anywhere; }
.line-item .actions { margin-top: 10px; }
.line-item .actions .btn { flex: 0 1 auto; }
.dev { display: flex; gap: 12px; align-items: flex-start; }
.dev-ic { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; flex: none; background: var(--brand-soft); color: var(--brand-dark); }
.dev-ic.blocked { background: var(--bad-soft); color: var(--bad); }
.dev-body { flex: 1; min-width: 0; }
.facts { display: flex; flex-wrap: wrap; gap: 2px 14px; font-size: .82rem; color: var(--muted); margin-top: 4px; }
.facts > span { overflow-wrap: anywhere; }

.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { position: relative; padding: 0 0 14px 22px; font-size: .88rem; overflow-wrap: anywhere; }
.timeline li::before { content: ""; position: absolute; left: 4px; top: 6px; width: 9px; height: 9px; border-radius: 50%; background: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.timeline li::after { content: ""; position: absolute; left: 8px; top: 18px; bottom: 0; width: 1px; background: var(--line); }
.timeline li:last-child { padding-bottom: 0; }
.timeline li:last-child::after { display: none; }
.timeline b { text-transform: capitalize; }

/* phone: Edit / Renew stay in reach at the bottom of the screen */
.action-bar { position: sticky; bottom: 0; z-index: 15; display: flex; gap: 8px; margin: 8px -16px -28px; padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
  background: rgba(255,255,255,.96); border-top: 1px solid var(--line); box-shadow: 0 -6px 18px rgba(29,39,51,.08); }
.action-bar .btn { flex: 1 1 0; }

/* ---------- dialogs ---------- */
.overlay { position: fixed; inset: 0; background: rgba(16, 24, 20, .5); display: flex; align-items: flex-end; justify-content: center; z-index: 50; }
.dialog { background: #fff; border-radius: 18px 18px 0 0; padding: 20px 16px calc(18px + env(safe-area-inset-bottom)); width: 100%; max-width: 480px;
  max-height: 90vh; overflow: auto; box-shadow: 0 -10px 40px rgba(0,0,0,.2); }
.dialog::before { content: ""; display: block; width: 40px; height: 4px; border-radius: 4px; background: var(--line-strong); margin: -8px auto 14px; }
.dialog h2 { margin-top: 0; font-size: 1.12rem; }
.dialog p { overflow-wrap: anywhere; }
@media (prefers-reduced-motion: no-preference) { .dialog { animation: sheet .22s cubic-bezier(.2,.8,.2,1); } }
@keyframes sheet { from { transform: translateY(24px); opacity: 0; } to { transform: none; opacity: 1; } }
.keybox { font-family: ui-monospace, Consolas, monospace; font-size: 1.05rem; background: var(--brand-soft); border: 2px dashed var(--brand);
  border-radius: var(--radius-sm); padding: 14px; text-align: center; overflow-wrap: anywhere; user-select: all; margin: 12px 0; }

/* ---------- sign in, forgot, reset, setup ---------- */
.auth-page { display: grid; min-height: calc(100vh - 62px); }
.auth-brand { position: relative; overflow: hidden; color: #fff; padding: 22px 20px 26px;
  background: radial-gradient(900px 500px at -10% -20%, #6f9282 0%, transparent 60%), linear-gradient(135deg, var(--brand-deep), var(--brand)); }
.auth-brand::after { content: ""; position: absolute; right: -80px; bottom: -90px; width: 220px; height: 220px; border-radius: 50%; border: 30px solid rgba(255,255,255,.07); }
.auth-brand > * { position: relative; z-index: 1; }
.auth-brand img { width: 100%; max-width: 200px; height: auto; display: block; border-radius: 8px; }
.auth-brand h2 { font-size: 1.25rem; line-height: 1.25; margin: 14px 0 0; max-width: 20ch; }
.auth-points { list-style: none; padding: 0; margin: 22px 0 0; display: none; gap: 12px; }
.auth-points li { display: flex; gap: 10px; align-items: flex-start; }
.auth-points li svg.ic { width: 22px; height: 22px; padding: 3px; border-radius: 50%; background: rgba(255,255,255,.18); }
.auth-foot { display: none; font-size: .8rem; opacity: .8; margin: 0; }
.auth-main { display: grid; place-items: start center; padding: 26px 16px 36px; background: var(--card); }
.auth-card { width: 100%; max-width: 380px; }
.auth-card h1 { font-size: 1.45rem; }
.auth-card .lead { color: var(--muted); margin: 0 0 18px; }
.auth-card form .actions .btn { flex: 1 1 100%; }
.auth-links { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin: 16px 0 0; font-size: .9rem; }
.auth-secure { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: .8rem; margin-top: 22px; }
.auth-secure svg.ic { width: 16px; height: 16px; }
.steps { list-style: none; padding: 0; margin: 14px 0; display: grid; gap: 10px; counter-reset: s; }
.steps li { counter-increment: s; display: grid; grid-template-columns: 28px 1fr; gap: 10px; align-items: start; font-size: .92rem; }
.steps li::before { content: counter(s); display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%;
  background: var(--brand-soft); color: var(--brand-ink); font-weight: 700; font-size: .8rem; }
@media (min-width: 900px) {
  .auth-page { grid-template-columns: minmax(320px, 1fr) minmax(380px, 520px); }
  .auth-brand { padding: 48px 52px; display: flex; flex-direction: column; justify-content: space-between; gap: 24px; }
  .auth-brand img { max-width: 260px; }
  .auth-brand h2 { font-size: 2rem; margin-top: 36px; }
  .auth-points { display: grid; }
  .auth-foot { display: block; }
  .auth-main { place-items: center; padding: 40px 32px; }
}

/* ---------- standalone pages (setup link, privacy) ---------- */
.plain-top { background: var(--brand); color: #fff; }
.plain-top-in { max-width: 860px; margin: 0 auto; padding: 8px 16px; display: flex; align-items: center; gap: 10px; }
.plain-top-in .spacer { flex: 1; }
.plain-top a.home-link { color: #fff; font-weight: 600; font-size: .9rem; }
.doc { max-width: 860px; margin: 0 auto; }
.doc .card { padding: 20px 18px; }
.doc h1 { font-size: 1.6rem; }
.doc h2 { margin-top: 26px; padding-top: 16px; border-top: 1px solid var(--line); }
.doc h2:first-of-type { border-top: none; padding-top: 0; }
.doc li { margin-bottom: 6px; }
.doc p, .doc li { line-height: 1.6; }
.doc .lead-box { background: var(--brand-soft); border-left: 4px solid var(--brand); border-radius: var(--radius-sm); padding: 12px 14px; }
.setup-wrap { max-width: 460px; margin: 0 auto; padding-top: 8px; }
.setup-wrap h1 { font-size: 1.3rem; }

/* ---------- public home page ---------- */
body.public main { max-width: none; padding: 0; }
.home { width: 100%; }
.home-top { display: flex; align-items: center; gap: 10px; padding: 10px 16px; background: var(--brand-deep); }
.home-top img { height: 48px; width: auto; border-radius: 4px; display: block; }
.home-top .spacer { flex: 1; }
.home-top .btn { min-height: 38px; padding: 6px 14px; }
.hero { position: relative; overflow: hidden; color: #fff; text-align: center; padding: 34px 20px 40px;
  background: radial-gradient(900px 420px at 85% -10%, rgba(255,255,255,.16), transparent 60%), linear-gradient(160deg, var(--brand-deep), var(--brand) 65%, #6a8b7c); }
.hero::after { content: ""; position: absolute; left: -90px; bottom: -110px; width: 260px; height: 260px; border-radius: 50%; border: 36px solid rgba(255,255,255,.06); }
.hero > * { position: relative; z-index: 1; }
.hero-logo { width: 100%; max-width: 220px; height: auto; display: block; margin: 0 auto 18px; border-radius: 10px; box-shadow: 0 10px 30px rgba(0,0,0,.18); }
.eyebrow { display: inline-block; padding: 4px 12px; border-radius: 999px; background: rgba(255,255,255,.16); font-size: .8rem; font-weight: 600; letter-spacing: .02em; }
.hero h1 { font-size: 1.75rem; line-height: 1.2; margin: 12px auto 12px; max-width: 18ch; }
.hero-sub { max-width: 560px; margin: 0 auto 22px; opacity: .93; line-height: 1.55; }
.cta { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.cta .btn { flex: 1 1 140px; max-width: 220px; }
.btn.light { background: #fff; color: var(--brand-ink); border-color: #fff; }
.btn.light:hover { background: var(--brand-soft); border-color: var(--brand-soft); }
.btn.ghost { background: transparent; color: #fff; border-color: rgba(255,255,255,.7); }
.btn.ghost:hover { background: rgba(255,255,255,.12); }
.btn.light:focus-visible, .btn.ghost:focus-visible { outline-color: #fff; }
.home-section { max-width: 1000px; margin: 0 auto; padding: 28px 16px 8px; }
.home-section > h2 { font-size: 1.3rem; margin: 0 0 4px; text-align: center; }
.home-section > .section-lead { color: var(--muted); text-align: center; margin: 0 auto 18px; max-width: 560px; }
.feats { display: grid; grid-template-columns: 1fr; gap: 12px; }
.feat { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 18px; box-shadow: var(--shadow); transition: transform .15s, box-shadow .15s; }
.feat:hover { transform: translateY(-2px); box-shadow: var(--shadow-lift); }
.feat-ic { width: 42px; height: 42px; border-radius: 12px; background: var(--brand-soft); color: var(--brand-dark); display: grid; place-items: center; }
.feat h3 { margin: 12px 0 4px; font-size: 1.04rem; }
.feat p { margin: 0; color: var(--muted); line-height: 1.5; }
.how { display: grid; gap: 12px; counter-reset: h; list-style: none; padding: 0; margin: 0; }
.how li { counter-increment: h; display: flex; gap: 14px; align-items: flex-start; background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 16px; }
.how li::before { content: counter(h); flex: none; width: 34px; height: 34px; border-radius: 50%; background: var(--brand); color: #fff; display: grid; place-items: center; font-weight: 750; }
.how b { display: block; margin-bottom: 2px; }
.how span { color: var(--muted); font-size: .92rem; }
.home-cta { max-width: 1000px; margin: 22px auto 8px; padding: 0 16px; }
.home-cta > div { background: var(--brand-soft); border: 1px solid #cfe0d7; border-radius: 18px; padding: 20px; text-align: center; }
.home-cta h2 { margin: 0 0 6px; font-size: 1.15rem; }
.home-cta p { margin: 0 0 14px; color: var(--muted); }
.home-legal { max-width: 760px; margin: 0 auto; padding: 14px 16px 0; text-align: center; font-size: .8rem; color: var(--muted); }

/* ---------- wider screens ---------- */
@media (min-width: 600px) {
  .row2 { grid-template-columns: 1fr 1fr; }
  .actions .btn { flex: 0 0 auto; }
  .chips { margin: 0; padding: 2px 0 4px; flex-wrap: wrap; overflow: visible; }
  .tiles { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .overlay { align-items: center; padding: 16px; }
  .dialog { border-radius: 16px; padding: 22px; }
  .dialog::before { display: none; }
  .hero h1 { font-size: 2.3rem; }
  .hero { padding: 52px 24px 58px; }
  .feats { grid-template-columns: 1fr 1fr; }
  .how { grid-template-columns: repeat(3, 1fr); }
  .how li { flex-direction: column; }
  .hero-card { padding: 22px 24px; }
}
@media (min-width: 760px) {
  .stats { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
  .filter-bar { grid-template-columns: 1fr minmax(240px, 320px); align-items: center; }
  .filter-bar .search { order: 2; }
  .split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 0 16px; align-items: start; }
}
@media (min-width: 900px) {
  .action-bar { display: none; }
  .hero-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
  .hero-actions .btn { flex: 0 0 auto; }
  .tbl-wrap { display: block; }
  .cards-only { display: none; }
  .list.cards-only { display: none; }
  .detail-grid { grid-template-columns: minmax(0, 1.55fr) minmax(280px, 1fr); align-items: start; }
  .split.wide-side { grid-template-columns: minmax(0, 1.4fr) minmax(300px, 1fr); }
  h1 { font-size: 1.6rem; }
}
@media (min-width: 1024px) {
  .feats { grid-template-columns: repeat(4, 1fr); }
}

/* small extras */
.group-label.first { margin-top: 0; padding-top: 0; border-top: none; }
.profile-name { margin: 4px 0 6px; overflow-wrap: anywhere; }
.form-wrap { max-width: 780px; }
.card > .dev { margin-bottom: 8px; }
.item-badges { margin-top: 6px; }
.actions.stack .btn { flex: 1 1 100%; }
@media (min-width: 600px) { .actions.stack .btn { flex: 0 1 auto; } }
.tbl .cell-name { min-width: 220px; }
