:root {
  --navy: #002f4d;
  --navy-deep: #00253d;
  --blue: #005f9f;
  --blue-bright: #0879bd;
  --aqua: #63c9c4;
  --sage: #85c997;
  --violet: #8b72ad;
  --orange: #f4a145;
  --ink: #163f58;
  --muted: #698493;
  --line: #d7e5ea;
  --surface: #ffffff;
  --wash: #f3f8f9;
  --shadow: 0 18px 55px rgba(0, 55, 87, .12);
}

* { box-sizing: border-box; }
html { min-width: 320px; background: var(--wash); }
body { margin: 0; min-height: 100vh; color: var(--ink); background: linear-gradient(150deg, #f7fbfb 0%, #eef6f7 55%, #f6f4fa 100%); font-family: Inter, Aptos, "Segoe UI", Arial, sans-serif; }
button, input, select { font: inherit; }
button, select { cursor: pointer; }
button:disabled, select:disabled { cursor: not-allowed; opacity: .58; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

.background-orb { position: fixed; z-index: -1; border-radius: 50%; filter: blur(1px); pointer-events: none; }
.orb-one { top: -180px; right: -120px; width: 440px; height: 440px; background: radial-gradient(circle at 40% 45%, rgba(99,201,196,.22), rgba(0,95,159,.02) 70%); }
.orb-two { bottom: -260px; left: -180px; width: 600px; height: 600px; background: radial-gradient(circle at 50% 50%, rgba(139,114,173,.14), transparent 68%); }

.brand-logo { display: block; width: min(286px, 82%); height: auto; object-fit: contain; }
.brand-logo-color { width: min(252px, 76%); }
.topbar-logo { width: 218px; max-width: 44vw; }
.eyebrow { margin: 18px 0 10px; color: #86e3de; font-size: 11px; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; }
.eyebrow.blue { margin: 0 0 8px; color: var(--blue); }

.login-shell { display: grid; min-height: 100vh; place-items: center; padding: 34px; }
.login-panel { display: grid; width: min(1040px, 100%); min-height: 650px; grid-template-columns: 1.05fr .95fr; overflow: hidden; border: 1px solid rgba(205,224,230,.9); border-radius: 28px; background: var(--surface); box-shadow: 0 30px 90px rgba(0,50,82,.18); }
.login-brand-panel { position: relative; padding: 58px; overflow: hidden; color: #fff; background: radial-gradient(circle at 82% 18%, rgba(99,201,196,.3), transparent 28%), linear-gradient(145deg, #004d83 0%, #006aaa 52%, #003a62 100%); }
.login-brand-panel::after { position: absolute; right: -120px; bottom: -180px; width: 460px; height: 460px; border: 1px solid rgba(255,255,255,.13); border-radius: 50%; box-shadow: 0 0 0 55px rgba(255,255,255,.035), 0 0 0 110px rgba(255,255,255,.025); content: ""; }
.login-brand-panel h1 { max-width: 480px; margin: 28px 0 18px; font-size: clamp(40px, 5vw, 62px); line-height: 1.02; letter-spacing: -.045em; }
.login-brand-panel > p:not(.eyebrow) { max-width: 470px; margin-bottom: 45px; color: #d9eef5; font-size: 17px; line-height: 1.65; }
.login-promise { position: relative; z-index: 1; display: flex; align-items: center; gap: 14px; margin-top: 20px; }
.login-promise i { display: grid; width: 35px; height: 35px; flex: 0 0 35px; place-items: center; border: 1px solid rgba(255,255,255,.28); border-radius: 50%; background: rgba(255,255,255,.12); color: #8ce1dc; font-style: normal; font-weight: 900; }
.login-promise span { font-size: 14px; font-weight: 800; line-height: 1.4; }
.login-promise small { color: #bfdce6; font-weight: 500; }
.login-form-panel { display: flex; flex-direction: column; justify-content: center; padding: 64px; }
.login-form-panel h2 { margin: 16px 0 10px; color: var(--ink); font-size: 38px; letter-spacing: -.035em; }
.login-form-panel > p:not(.eyebrow):not(.security-note) { margin: 0 0 32px; color: var(--muted); font-size: 15px; line-height: 1.65; }
.login-form-panel label { display: block; margin-bottom: 8px; color: var(--ink); font-size: 13px; font-weight: 800; }
.login-form-panel input { width: 100%; height: 52px; padding: 0 16px; border: 1px solid #bfd4dc; border-radius: 10px; outline: none; color: var(--ink); background: #fbfdfd; transition: .2s ease; }
.login-form-panel input:focus { border-color: var(--blue); box-shadow: 0 0 0 4px rgba(0,95,159,.1); }
.login-form-panel form button { display: flex; width: 100%; height: 52px; align-items: center; justify-content: center; gap: 12px; margin-top: 14px; border: 0; border-radius: 10px; color: #fff; background: linear-gradient(135deg, var(--blue), #0075b9); box-shadow: 0 11px 24px rgba(0,95,159,.2); font-weight: 800; }
.login-form-panel form button:hover { transform: translateY(-1px); box-shadow: 0 14px 30px rgba(0,95,159,.27); }
.login-form-panel form button.secondary-login { border: 1px solid #b9d1da; color: var(--blue); background: #f8fbfc; box-shadow: none; }
.login-form-panel form button.secondary-login:hover { border-color: var(--blue); background: #eef6f8; box-shadow: none; }
.login-divider { display: flex; align-items: center; gap: 12px; margin: 5px 0 15px; color: #8aa0aa; font-size: 10px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; }
.login-divider::before, .login-divider::after { height: 1px; flex: 1; background: var(--line); content: ""; }
.form-message { min-height: 42px; padding-top: 14px; color: #367b50; font-size: 13px; line-height: 1.5; }
.security-note { margin: 12px 0 0; padding-top: 22px; border-top: 1px solid var(--line); color: var(--muted); font-size: 12px; line-height: 1.55; }
.security-note span { margin-right: 8px; color: var(--aqua); }

.topbar { display: flex; min-height: 84px; align-items: center; justify-content: space-between; padding: 0 clamp(24px, 5vw, 72px); color: #fff; background: linear-gradient(105deg, #003d68, #005e98 60%, #0069a3); box-shadow: 0 8px 28px rgba(0,52,86,.16); }
.topbar > div:first-child p { margin: 7px 0 0; color: #bfe2e8; font-size: 10px; font-weight: 800; letter-spacing: .13em; text-transform: uppercase; }
.topbar-actions { display: flex; align-items: center; gap: 11px; }
.live-pill { display: inline-flex; align-items: center; gap: 7px; padding: 7px 10px; border: 1px solid rgba(255,255,255,.17); border-radius: 999px; background: rgba(0,34,57,.24); font-size: 11px; font-weight: 800; }
.live-pill i { width: 7px; height: 7px; border-radius: 50%; background: #86dda0; box-shadow: 0 0 0 4px rgba(134,221,160,.14); }
.admin-label { color: #d4ebef; font-size: 12px; }
.icon-button, .ghost-button { height: 36px; border: 1px solid rgba(255,255,255,.2); border-radius: 8px; color: #fff; background: rgba(0,35,59,.18); }
.icon-button { width: 38px; font-size: 20px; }
.ghost-button { padding: 0 14px; font-size: 12px; font-weight: 700; }
.icon-button:hover, .ghost-button:hover { background: rgba(255,255,255,.13); }
.icon-button.is-spinning { animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.dashboard { width: min(1480px, calc(100% - 44px)); margin: 0 auto; padding: 42px 0 70px; }
.page-heading { display: flex; align-items: end; justify-content: space-between; gap: 24px; margin-bottom: 26px; }
.page-heading h1 { margin: 0; color: var(--ink); font-size: clamp(34px, 4vw, 48px); line-height: 1.08; letter-spacing: -.045em; }
.page-heading > div > span { display: block; margin-top: 10px; color: var(--muted); font-size: 15px; }
.guide-button { display: inline-flex; height: 44px; align-items: center; gap: 10px; padding: 0 17px; border: 1px solid #bcd5dd; border-radius: 10px; color: var(--blue); background: rgba(255,255,255,.8); text-decoration: none; font-size: 13px; font-weight: 800; box-shadow: 0 8px 22px rgba(0,68,106,.06); }
.guide-button:hover { border-color: var(--blue); background: #fff; }

.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 15px; }
.stat-card { position: relative; min-height: 145px; padding: 23px 24px; overflow: hidden; border: 1px solid var(--line); border-radius: 16px; background: rgba(255,255,255,.92); box-shadow: 0 10px 30px rgba(0,55,88,.06); }
.stat-card::before { position: absolute; inset: 0 auto 0 0; width: 5px; content: ""; }
.stat-card > span { display: block; color: var(--muted); font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.stat-card strong { display: block; margin: 10px 0 5px; color: var(--ink); font-size: 38px; letter-spacing: -.04em; }
.stat-card small { color: var(--muted); font-size: 12px; }
.stat-card > i { position: absolute; top: 20px; right: 20px; display: grid; width: 35px; height: 35px; place-items: center; border-radius: 10px; font-style: normal; font-weight: 900; }
.blue-card::before { background: var(--blue); } .blue-card > i { color: var(--blue); background: #e8f2f7; }
.green-card::before { background: var(--sage); } .green-card > i { color: #397b4b; background: #e8f5eb; }
.orange-card::before { background: var(--orange); } .orange-card > i { color: #a45b16; background: #fff0dd; }
.violet-card::before { background: var(--violet); } .violet-card > i { color: #694f8a; background: #f0eaf6; }

.progress-card { display: grid; grid-template-columns: minmax(220px, .8fr) minmax(300px, 2fr) auto; align-items: center; gap: 30px; margin: 16px 0; padding: 22px 25px; border: 1px solid #c7dce3; border-radius: 16px; background: linear-gradient(110deg, #fff, #f4fbfa); box-shadow: 0 10px 28px rgba(0,55,88,.05); }
.progress-card h2 { margin: 0; color: var(--ink); font-size: 18px; }
.progress-card .eyebrow { margin-bottom: 5px; }
.progress-track { height: 11px; overflow: hidden; border-radius: 999px; background: #dfebee; }
.progress-track i { display: block; width: 0; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--blue), var(--aqua)); transition: width .5s ease; }
.progress-card > strong { color: var(--blue); font-size: 24px; }

.directory-card { overflow: hidden; border: 1px solid var(--line); border-radius: 18px; background: rgba(255,255,255,.96); box-shadow: var(--shadow); }
.directory-header { display: flex; align-items: center; justify-content: space-between; gap: 22px; padding: 24px 26px; border-bottom: 1px solid var(--line); }
.directory-header h2 { margin: 0 0 4px; font-size: 23px; letter-spacing: -.025em; }
.directory-header > div > span { color: var(--muted); font-size: 12px; }
.controls { display: flex; align-items: center; gap: 10px; }
.search-box { display: flex; width: 260px; height: 40px; align-items: center; gap: 8px; padding: 0 12px; border: 1px solid #c9dce2; border-radius: 9px; background: #f9fcfc; }
.search-box span { color: var(--muted); font-size: 18px; }
.search-box input { min-width: 0; flex: 1; border: 0; outline: 0; color: var(--ink); background: transparent; font-size: 12px; }
.controls > select, .automation-select select { height: 40px; padding: 0 34px 0 12px; border: 1px solid #c9dce2; border-radius: 9px; outline: 0; color: var(--ink); background: #f9fcfc; font-size: 12px; font-weight: 700; }
.controls select:focus, .automation-select select:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(0,95,159,.08); }
.table-wrap { overflow-x: auto; }
table { width: 100%; min-width: 1160px; border-collapse: collapse; }
th { padding: 13px 16px; color: #77909c; background: #f4f8f9; font-size: 10px; font-weight: 800; letter-spacing: .09em; text-align: left; text-transform: uppercase; }
th:first-child, td:first-child { padding-left: 26px; }
th:last-child, td:last-child { padding-right: 26px; }
td { padding: 16px; border-top: 1px solid #e4edef; vertical-align: middle; }
tbody tr { transition: background .15s ease; }
tbody tr:hover { background: #f9fcfc; }
.traveler { display: flex; min-width: 250px; align-items: center; gap: 12px; }
.traveler > i { display: grid; width: 39px; height: 39px; flex: 0 0 39px; place-items: center; border-radius: 12px; color: #fff; background: linear-gradient(135deg, var(--blue), var(--aqua)); font-size: 11px; font-style: normal; font-weight: 900; }
.traveler b, .traveler span, .traveler small { display: block; }
.traveler b { color: var(--ink); font-size: 13px; }
.traveler span { max-width: 220px; margin-top: 3px; overflow: hidden; color: var(--muted); font-size: 11px; text-overflow: ellipsis; }
.traveler small { margin-top: 3px; color: #9aabb3; font-size: 9px; }
.points { display: block; color: var(--blue); font-size: 17px; }
.tier { display: block; margin-top: 5px; color: var(--muted); font-size: 10px; }
.journey { min-width: 225px; }
.journey-dots { display: flex; align-items: center; margin-bottom: 7px; }
.journey-step { display: flex; align-items: center; }
.journey-step:not(:last-child)::after { width: 16px; height: 2px; background: #dce7ea; content: ""; }
.journey-step.complete:not(:last-child)::after { background: #79c5c2; }
.journey-step i { display: grid; width: 20px; height: 20px; place-items: center; border: 1px solid #cadce2; border-radius: 50%; color: #94a6ae; background: #fff; font-size: 8px; font-style: normal; font-weight: 900; }
.journey-step.complete i { border-color: var(--aqua); color: #fff; background: var(--aqua); }
.journey b, .journey small { display: block; }
.journey b { font-size: 11px; }
.journey small { max-width: 235px; margin-top: 3px; color: var(--muted); font-size: 10px; line-height: 1.35; }
.reminder-history { min-width: 125px; }
.reminder-history b, .reminder-history span { display: block; }
.reminder-history b { font-size: 11px; }
.reminder-history span { margin-top: 4px; color: var(--muted); font-size: 10px; }
.automation-select { display: block; min-width: 150px; }
.automation-select select { width: 100%; height: 34px; padding-left: 9px; font-size: 10px; }
.automation-select small { display: block; margin-top: 5px; color: #4c8060; font-size: 9px; }
.automation-off { color: var(--muted); font-size: 10px; }
.remind-button { min-width: 93px; height: 34px; padding: 0 12px; border: 0; border-radius: 8px; color: #fff; background: var(--blue); box-shadow: 0 7px 15px rgba(0,95,159,.16); font-size: 10px; font-weight: 800; }
.remind-button:hover:not(:disabled) { background: #004f87; transform: translateY(-1px); }
.remind-button:disabled { color: #78909a; background: #e7eff1; box-shadow: none; }
.empty-state { padding: 70px; text-align: center; }
.empty-state > span { display: grid; width: 48px; height: 48px; margin: 0 auto 15px; place-items: center; border-radius: 50%; color: var(--blue); background: #eaf3f7; font-size: 23px; }
.empty-state h3 { margin: 0 0 6px; }
.empty-state p { margin: 0; color: var(--muted); font-size: 12px; }
.directory-footer { display: flex; justify-content: space-between; gap: 20px; padding: 15px 26px; border-top: 1px solid var(--line); color: var(--muted); background: #f8fbfb; font-size: 10px; }

.toast { position: fixed; right: 24px; bottom: 24px; z-index: 20; max-width: 420px; padding: 14px 18px; border-radius: 10px; color: #fff; background: #26764a; box-shadow: 0 16px 44px rgba(0,40,62,.24); font-size: 13px; font-weight: 700; opacity: 0; transform: translateY(18px); transition: .24s ease; pointer-events: none; }
.toast.error { background: #a8473f; }
.toast.is-visible { opacity: 1; transform: translateY(0); }

@media (max-width: 1050px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .login-brand-panel { padding: 45px; }
  .login-form-panel { padding: 48px; }
  .progress-card { grid-template-columns: 1fr auto; }
  .progress-track { grid-column: 1 / -1; grid-row: 2; }
}

@media (max-width: 760px) {
  .login-shell { padding: 14px; }
  .login-panel { grid-template-columns: 1fr; }
  .login-brand-panel { min-height: 320px; padding: 34px; }
  .login-brand-panel h1 { font-size: 40px; }
  .login-brand-panel .login-promise { display: none; }
  .login-form-panel { padding: 38px 30px; }
  .topbar { align-items: flex-start; gap: 18px; padding: 20px; }
  .topbar-actions { flex-wrap: wrap; justify-content: flex-end; }
  .admin-label { display: none; }
  .dashboard { width: min(100% - 24px, 1480px); padding-top: 28px; }
  .page-heading, .directory-header { align-items: flex-start; flex-direction: column; }
  .stats-grid { grid-template-columns: 1fr; }
  .progress-card { grid-template-columns: 1fr auto; gap: 15px; }
  .controls { width: 100%; align-items: stretch; flex-direction: column; }
  .search-box { width: 100%; }
  .directory-footer { flex-direction: column; }
}
