/* ==========================================================================
   Global Registration System — Unified Stylesheet
   Used by: public/*, public/admin/*, public/ops/*
   ========================================================================== */

:root {
  --brand-50: #eff6ff;
  --brand-100: #dbeafe;
  --brand-500: #3b82f6;
  --brand-600: #2563eb;
  --brand-700: #1d4ed8;
  --brand-800: #1e40af;
  --teal-500: #14b8a6;
  --teal-600: #0d9488;
  --yellow-400: #facc15;
  --yellow-500: #eab308;
  --success-500: #22c55e;
  --success-600: #16a34a;
  --danger-500: #ef4444;
  --danger-600: #dc2626;
  --warning-500: #f59e0b;
  --gray-50: #f8fafc;
  --gray-100: #f1f5f9;
  --gray-200: #e2e8f0;
  --gray-300: #cbd5e1;
  --gray-400: #94a3b8;
  --gray-500: #64748b;
  --gray-600: #475569;
  --gray-700: #334155;
  --gray-800: #1e293b;
  --gray-900: #0f172a;
  --white: #ffffff;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.06);
  --shadow: 0 4px 20px rgba(15, 23, 42, 0.08);
  --shadow-lg: 0 20px 40px rgba(15, 23, 42, 0.12);
  --radius-sm: 8px;
  --radius: 14px;
  --radius-lg: 20px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: "Noto Sans TC", "Segoe UI", system-ui, -apple-system, sans-serif;
  background: linear-gradient(180deg, #f8fafc 0%, #eef2ff 100%);
  color: var(--gray-800);
  min-height: 100vh;
  line-height: 1.55;
}
a { color: var(--brand-600); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; }
.hidden { display: none !important; }
code { background: var(--gray-100); padding: 1px 6px; border-radius: 6px; font-size: 0.92em; }

/* ---------- Navigation ---------- */
.site-nav {
  background: rgba(255,255,255,0.94);
  backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--gray-200);
  position: sticky; top: 0; z-index: 40;
}
.site-nav-inner {
  max-width: 1240px; margin: 0 auto; padding: 14px 24px;
  display: flex; align-items: center; gap: 18px; flex-wrap: wrap;
}
.brand-wrap { display: flex; align-items: center; gap: 12px; color: var(--gray-900); }
.brand-wrap:hover { text-decoration: none; }
.brand-logo {
  width: 44px; height: 44px; border-radius: 12px;
  background: linear-gradient(135deg, var(--brand-600), var(--teal-500));
  color: #fff; display: grid; place-items: center; font-size: 1.15rem;
  box-shadow: var(--shadow);
}
.brand-title { font-weight: 900; font-size: 1.02rem; line-height: 1.15; }
.brand-sub { font-size: 0.78rem; color: var(--gray-500); }
.nav-links { display: flex; gap: 4px; margin-left: 12px; flex-wrap: wrap; }
.nav-link {
  padding: 8px 14px; border-radius: 999px; color: var(--gray-600); font-weight: 600; font-size: 0.92rem;
}
.nav-link:hover { background: var(--gray-100); text-decoration: none; }
.nav-link.active { background: var(--brand-50); color: var(--brand-700); }
.nav-tools { display: flex; align-items: center; gap: 10px; margin-left: auto; flex-wrap: wrap; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 18px; border-radius: 12px; border: 1px solid transparent;
  font-weight: 700; font-size: 0.95rem; cursor: pointer;
  transition: transform 0.05s ease, box-shadow 0.15s ease, background 0.15s ease;
  background: var(--gray-100); color: var(--gray-800);
}
.btn:hover { text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.65; cursor: not-allowed; }
.btn-primary { background: linear-gradient(135deg, var(--brand-600), var(--brand-700)); color: #fff; box-shadow: var(--shadow); }
.btn-primary:hover { box-shadow: var(--shadow-lg); color: #fff; }
.btn-secondary { background: var(--white); color: var(--gray-700); border-color: var(--gray-200); }
.btn-secondary:hover { background: var(--gray-50); }
.btn-danger { background: linear-gradient(135deg, var(--danger-500), var(--danger-600)); color: #fff; }
.btn-ghost { background: transparent; color: var(--gray-600); }

/* ---------- Selects & Inputs ---------- */
.select-shell {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--white); border: 1px solid var(--gray-200); border-radius: 12px; padding: 6px 10px;
  font-size: 0.9rem;
}
.select-shell select { border: none; background: transparent; outline: none; font-family: inherit; font-size: 0.9rem; }
.select-shell .leading, .select-shell .trailing { color: var(--gray-400); font-size: 0.85rem; }

/* ---------- Layout ---------- */
.page-shell, .admin-shell { max-width: 1240px; margin: 0 auto; padding: 32px 24px 64px; }
.page-section { margin-top: 28px; }

/* ---------- Hero ---------- */
.hero-grid {
  display: grid; grid-template-columns: 1.4fr 1fr; gap: 28px; margin-top: 20px;
}
.hero-panel {
  position: relative; overflow: hidden;
  background: linear-gradient(135deg, #1e3a8a 0%, #1d4ed8 45%, #0d9488 100%);
  color: #fff; border-radius: var(--radius-lg); padding: 44px 44px 50px;
  box-shadow: var(--shadow-lg); min-height: 320px;
}
.hero-panel.compact { padding: 34px 34px 38px; min-height: unset; }
.hero-content { position: relative; z-index: 2; }
.pill {
  display: inline-flex; align-items: center; gap: 8px;
  background: rgba(255,255,255,0.16); padding: 6px 12px; border-radius: 999px;
  font-size: 0.82rem; letter-spacing: 0.02em; margin-bottom: 14px;
}
.hero-title-1 { font-size: 2rem; font-weight: 900; margin: 0 0 4px; }
.hero-title-2 { font-size: 2.4rem; font-weight: 900; margin: 0 0 14px; color: var(--yellow-400); }
.hero-desc { font-size: 1rem; opacity: 0.92; margin: 0 0 26px; max-width: 46ch; }
.hero-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.hero-stat { display: flex; align-items: center; gap: 10px; background: rgba(255,255,255,0.10); padding: 12px 14px; border-radius: 14px; }
.hero-stat-icon { width: 36px; height: 36px; display: grid; place-items: center; background: rgba(255,255,255,0.18); border-radius: 10px; }
.hero-stat-title { font-size: 0.78rem; opacity: 0.75; }
.hero-stat-value { font-weight: 800; font-size: 1rem; }
.hero-floating-icon { position: absolute; right: -12px; bottom: -12px; font-size: 12rem; opacity: 0.06; transform: rotate(-14deg); }
.page-title { font-size: 1.9rem; font-weight: 900; margin: 0 0 8px; }
.page-desc { opacity: 0.92; margin: 0 0 20px; max-width: 60ch; }
.page-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 10px; }

/* ---------- Cards ---------- */
.card {
  background: #fff; border-radius: var(--radius-lg); padding: 22px 22px 24px;
  box-shadow: var(--shadow); border: 1px solid var(--gray-100);
}
.small-card { padding: 20px; border-radius: var(--radius); }
.card-header { margin-bottom: 12px; }
.card-title { font-size: 1.1rem; font-weight: 800; margin: 0; }
.card-subtitle { color: var(--gray-500); margin: 4px 0 0; }
.card-body { padding-top: 4px; }
.section-title { font-size: 1.05rem; font-weight: 800; margin: 0 0 6px; color: var(--gray-800); }
.section-desc { color: var(--gray-500); margin: 0 0 16px; }
.helper-card { background: var(--gray-50); border-radius: 14px; padding: 16px; }
.helper-list { margin: 8px 0 0; padding-left: 18px; color: var(--gray-600); line-height: 1.8; }
.subtle-note { color: var(--gray-500); font-size: 0.85rem; }
.empty-panel {
  padding: 24px; text-align: center; color: var(--gray-500);
  background: var(--gray-50); border-radius: 12px; border: 1px dashed var(--gray-200);
}

/* ---------- Login card / auth ---------- */
.login-card { display: flex; flex-direction: column; }
.auth-mode-switch {
  display: inline-flex; gap: 4px; background: var(--gray-100); padding: 4px; border-radius: 999px;
}
.auth-mode-switch button {
  border: none; background: transparent; padding: 8px 16px; border-radius: 999px;
  cursor: pointer; font-weight: 700; color: var(--gray-500); font-family: inherit;
}
.auth-mode-switch button.active { background: #fff; color: var(--brand-700); box-shadow: var(--shadow-sm); }
.divider { display: flex; align-items: center; gap: 12px; margin: 18px 0; color: var(--gray-400); font-size: 0.85rem; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--gray-200); }
.info-alert { background: #f0f9ff; border: 1px solid #bae6fd; color: #075985; padding: 10px 14px; border-radius: 10px; font-size: 0.88rem; }
.success-alert { background: #ecfdf5; border: 1px solid #a7f3d0; color: #065f46; padding: 12px 14px; border-radius: 10px; }
.warning-alert { background: #fffbeb; border: 1px solid #fde68a; color: #92400e; padding: 12px 14px; border-radius: 10px; }
.error-alert { background: #fef2f2; border: 1px solid #fecaca; color: #991b1b; padding: 12px 14px; border-radius: 10px; }
.auth-inline-links { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.link-text { color: var(--brand-600); font-weight: 600; font-size: 0.9rem; }
.muted-text { color: var(--gray-500); font-size: 0.85rem; }
.auth-card-footer { margin-top: 14px; color: var(--gray-500); font-size: 0.82rem; text-align: center; }
.auth-shell { max-width: 520px; margin: 24px auto 0; }
.auth-gate {
  background: #fff; border-radius: var(--radius-lg); padding: 28px; box-shadow: var(--shadow);
  text-align: center; border: 1px solid var(--gray-100);
}

/* ---------- Forms ---------- */
.form-grid { display: grid; gap: 14px; }
.form-grid.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.form-inline-grid { display: grid; gap: 14px; }
.form-inline-grid.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.form-field { display: grid; gap: 6px; }
.form-field label { font-weight: 700; color: var(--gray-700); font-size: 0.9rem; }
.form-field label.field-required::after { content: " *"; color: var(--danger-500); }
.form-field input,
.form-field select,
.form-field textarea {
  background: #fff; border: 1px solid var(--gray-200); border-radius: 12px;
  padding: 12px 14px; font-size: 0.95rem; font-family: inherit; color: var(--gray-800);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.form-field input:focus,
.form-field select:focus,
.form-field textarea:focus {
  outline: none; border-color: var(--brand-500); box-shadow: 0 0 0 4px rgba(59,130,246,0.15);
}
.form-field textarea { resize: vertical; min-height: 90px; }
.form-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 8px; }
.field-row-note { font-size: 0.82rem; color: var(--gray-500); }
.choice-switch { display: inline-flex; background: var(--gray-100); border-radius: 999px; padding: 4px; gap: 4px; }
.choice-switch button {
  border: none; background: transparent; padding: 8px 16px; border-radius: 999px;
  cursor: pointer; font-weight: 700; color: var(--gray-500); font-family: inherit;
}
.choice-switch button.active { background: #fff; color: var(--brand-700); box-shadow: var(--shadow-sm); }
.upload-shell { background: var(--gray-50); border: 1px dashed var(--gray-300); padding: 14px; border-radius: 14px; }

/* ---------- Feature cards ---------- */
.quick-links { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin-top: 32px; }
.feature-card { background: #fff; border-radius: var(--radius-lg); padding: 22px; box-shadow: var(--shadow); border: 1px solid var(--gray-100); }
.feature-icon { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; font-size: 1.1rem; margin-bottom: 12px; }
.feature-title { font-size: 1.05rem; font-weight: 800; margin: 0 0 6px; color: var(--gray-800); }
.feature-desc { color: var(--gray-600); margin: 0 0 12px; }

/* ---------- Marquee ---------- */
.marquee-card { margin-top: 28px; padding: 14px 20px; }
.marquee-row { display: flex; align-items: center; gap: 16px; }
.marquee-tag { display: inline-flex; align-items: center; gap: 8px; background: var(--yellow-500); color: #1e293b; padding: 6px 12px; border-radius: 999px; font-weight: 800; font-size: 0.82rem; }
.marquee-items { display: flex; gap: 26px; color: var(--gray-600); overflow: hidden; }

/* ---------- Process card ---------- */
.process-card { margin-top: 28px; }
.process-grid { display: grid; grid-template-columns: 220px 1fr 220px; gap: 24px; align-items: start; }
.process-steps { display: grid; gap: 12px; }
.process-step { display: flex; gap: 12px; align-items: center; padding: 12px 14px; border-radius: 14px; background: var(--gray-50); }
.process-step i { width: 34px; height: 34px; background: var(--brand-100); color: var(--brand-700); border-radius: 10px; display: grid; place-items: center; }
.process-step-title { font-weight: 800; }
.process-step-desc { color: var(--gray-500); font-size: 0.9rem; }
.process-side { background: linear-gradient(135deg, var(--brand-50), #ecfeff); padding: 18px; border-radius: 14px; text-align: center; }

/* ---------- Footer ---------- */
.footer-strip { background: #0f172a; color: #cbd5e1; margin-top: 48px; }
.footer-inner { max-width: 1240px; margin: 0 auto; padding: 20px 24px; display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.footer-points { display: flex; gap: 20px; flex-wrap: wrap; font-size: 0.9rem; }
.footer-copy { font-size: 0.85rem; opacity: 0.7; }

/* ---------- Profile layout ---------- */
.profile-layout { display: grid; grid-template-columns: minmax(260px, 300px) minmax(0, 1fr); gap: 24px; }
.sidebar-card { position: sticky; top: 88px; align-self: start; min-width: 0; overflow: hidden; }
.sidebar-card .helper-card { min-width: 0; overflow-wrap: anywhere; word-break: break-all; }
.kv-list { display: grid; gap: 10px; min-width: 0; }
.kv-item { display: grid; grid-template-columns: 110px minmax(0, 1fr); gap: 10px; align-items: start; min-width: 0; }
.kv-key { color: var(--gray-500); font-size: 0.85rem; }
.kv-value {
  font-weight: 700;
  min-width: 0;
  overflow-wrap: anywhere;
  word-break: break-all;
  white-space: normal;
  line-height: 1.5;
  font-size: 0.9rem;
}
.kv-value.text-mono { font-family: ui-monospace, "SFMono-Regular", Menlo, monospace; font-size: 0.78rem; color: var(--gray-600); font-weight: 600; }
.kv-value code { display: inline-block; max-width: 100%; overflow-wrap: anywhere; word-break: break-all; padding: 2px 6px; background: var(--gray-100); border-radius: 6px; font-size: 0.78rem; }
.action-stack { display: grid; gap: 16px; }

/* ---------- Status / table ---------- */
.status-banner { display: flex; align-items: center; gap: 12px; justify-content: space-between; flex-wrap: wrap; margin-bottom: 18px; }
.user-chip { display: inline-flex; align-items: center; gap: 8px; background: var(--gray-100); padding: 8px 12px; border-radius: 999px; font-weight: 700; font-size: 0.9rem; }
.user-chip small { color: var(--gray-500); font-weight: 500; }
.table-responsive { overflow-x: auto; border-radius: 14px; border: 1px solid var(--gray-200); }
.data-table { width: 100%; border-collapse: collapse; }
.data-table th, .data-table td { padding: 12px 14px; text-align: left; font-size: 0.92rem; border-bottom: 1px solid var(--gray-100); }
.data-table th { background: var(--gray-50); color: var(--gray-600); font-weight: 700; }
.data-table tbody tr:hover { background: var(--gray-50); }
.empty-state { padding: 40px; text-align: center; color: var(--gray-500); }
.badge {
  display: inline-flex; align-items: center; gap: 4px; padding: 4px 10px; border-radius: 999px;
  font-size: 0.78rem; font-weight: 700; background: var(--gray-100); color: var(--gray-600);
}
.badge-pending { background: #fef3c7; color: #92400e; }
.badge-approved { background: #dcfce7; color: #166534; }
.badge-waitlisted, .badge-waitlist { background: #e0e7ff; color: #3730a3; }
.badge-rejected { background: #fee2e2; color: #991b1b; }
.badge-tw { background: #dbeafe; color: #1d4ed8; }
.badge-international { background: #ccfbf1; color: #0f766e; }
.text-mono { font-family: ui-monospace, "SFMono-Regular", Menlo, monospace; font-size: 0.82rem; color: var(--gray-500); }

/* ---------- Modals / Toasts ---------- */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(15,23,42,0.55);
  display: grid; place-items: center; z-index: 90; padding: 20px;
}
.modal-card { background: #fff; border-radius: var(--radius-lg); padding: 24px; max-width: 480px; width: 100%; box-shadow: var(--shadow-lg); }
.toast-wrap { position: fixed; top: 20px; right: 20px; z-index: 120; display: grid; gap: 10px; max-width: 320px; }
.toast {
  padding: 12px 16px; border-radius: 12px; background: var(--gray-800); color: #fff;
  box-shadow: var(--shadow-lg); font-size: 0.9rem; animation: slideIn 0.2s ease;
}
.toast.success { background: var(--success-600); }
.toast.error { background: var(--danger-600); }
.toast.warning { background: var(--warning-500); color: #1e293b; }
.toast.info { background: var(--brand-700); }
@keyframes slideIn { from { transform: translateY(-6px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

/* ---------- Admin console ---------- */
.admin-hero {
  display: grid; grid-template-columns: 1.55fr 1fr; gap: 24px; align-items: stretch;
}
.admin-hero-card { min-height: 220px; }
.admin-aside-card { padding: 20px; }
.admin-user-panel { display: grid; gap: 12px; }
.user-summary { display: flex; align-items: center; gap: 12px; }
.user-avatar {
  width: 46px; height: 46px; background: linear-gradient(135deg, var(--brand-600), var(--teal-500));
  color: #fff; display: grid; place-items: center; border-radius: 14px; font-weight: 900;
}
.user-meta strong { display: block; font-size: 1rem; }
.user-meta span { color: var(--gray-500); font-size: 0.85rem; }
.role-chip {
  display: inline-flex; align-items: center; gap: 6px; background: var(--brand-50); color: var(--brand-700);
  padding: 6px 12px; border-radius: 999px; font-weight: 700; font-size: 0.85rem; width: fit-content;
}
.notice-card { background: var(--gray-50); border-radius: 14px; padding: 14px 16px; font-size: 0.88rem; color: var(--gray-600); }
.metrics-row { display: grid; grid-template-columns: repeat(5, 1fr); gap: 14px; }
.metric-card { background: #fff; border-radius: 14px; padding: 16px 18px; box-shadow: var(--shadow-sm); border: 1px solid var(--gray-100); }
.metric-label { font-size: 0.82rem; color: var(--gray-500); }
.metric-value { font-size: 1.7rem; font-weight: 900; color: var(--gray-900); margin: 4px 0; }
.metric-trend { font-size: 0.78rem; color: var(--gray-500); }
.admin-grid { display: grid; grid-template-columns: 1.55fr 1fr; gap: 24px; margin-top: 28px; }
.admin-section-card { padding: 20px; }
.admin-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.toolbar-group { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.toolbar-pill { background: var(--brand-50); color: var(--brand-700); padding: 6px 12px; border-radius: 999px; font-size: 0.85rem; }
.admin-list { display: grid; gap: 12px; }
.admin-list-item { background: var(--white); border: 1px solid var(--gray-100); border-radius: 14px; padding: 14px 16px; box-shadow: var(--shadow-sm); }
.admin-list-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }
.admin-list-title { font-weight: 800; font-size: 1rem; }
.admin-list-meta { display: flex; gap: 8px; color: var(--gray-500); font-size: 0.85rem; flex-wrap: wrap; margin-top: 4px; }
.admin-list-meta span::before { content: "•"; margin-right: 8px; color: var(--gray-300); }
.admin-list-meta span:first-child::before { content: ""; margin: 0; }
.review-grid { display: grid; gap: 14px; }
.action-bar { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.audit-feed { display: grid; gap: 10px; }
.audit-row { background: var(--gray-50); border-radius: 12px; padding: 12px 14px; }
.audit-row-top { display: flex; justify-content: space-between; align-items: center; }
.audit-title { font-weight: 800; }
.audit-time { color: var(--gray-500); font-size: 0.82rem; }
.account-list { display: grid; gap: 10px; }
.account-row { background: var(--gray-50); border-radius: 12px; padding: 12px 14px; }
.account-row-head { display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.permission-gate {
  max-width: 560px; margin: 60px auto 0; text-align: center; padding: 32px;
}
.country-bars { display: grid; gap: 10px; }
.country-bar-row { display: grid; gap: 6px; }
.country-bar-head { display: flex; justify-content: space-between; font-size: 0.9rem; }
.country-bar-track { background: var(--gray-100); border-radius: 999px; height: 8px; overflow: hidden; }
.country-bar-fill { background: linear-gradient(90deg, var(--brand-600), var(--teal-500)); height: 100%; border-radius: 999px; }

/* ---------- Ops donut ---------- */
.ops-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 24px; margin-top: 24px; }
.chart-card { padding: 20px; }
.donut-wrap { display: grid; grid-template-columns: 220px 1fr; gap: 20px; align-items: center; margin-top: 12px; }
.donut-chart {
  position: relative; width: 200px; height: 200px; border-radius: 50%;
  background: conic-gradient(#cbd5e1 0 100%);
}
.donut-chart::after {
  content: ""; position: absolute; inset: 26px; background: #fff; border-radius: 50%;
}
.donut-center { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; z-index: 2; }
.donut-center strong { display: block; font-size: 1.6rem; font-weight: 900; }
.legend-list { display: grid; gap: 8px; }
.legend-item { display: flex; align-items: center; justify-content: space-between; padding: 6px 10px; background: var(--gray-50); border-radius: 10px; }
.legend-label { display: flex; align-items: center; gap: 8px; }
.legend-dot { width: 12px; height: 12px; border-radius: 4px; }
.live-feed-table th { position: sticky; top: 0; background: var(--gray-50); }

/* ---------- Responsive ---------- */
@media (max-width: 1180px) {
  .hero-grid { grid-template-columns: 1fr; }
  .admin-hero { grid-template-columns: 1fr; }
  .admin-grid { grid-template-columns: 1fr; }
  .ops-grid { grid-template-columns: 1fr; }
  .metrics-row { grid-template-columns: repeat(3, 1fr); }
  .quick-links { grid-template-columns: repeat(2, 1fr); }
  .process-grid { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
  .profile-layout { grid-template-columns: 1fr; }
  .sidebar-card { position: static; }
  .form-grid.cols-2, .form-inline-grid.cols-4 { grid-template-columns: 1fr; }
  .metrics-row { grid-template-columns: repeat(2, 1fr); }
  .quick-links { grid-template-columns: 1fr; }
  .hero-title-1 { font-size: 1.7rem; }
  .hero-title-2 { font-size: 2rem; }
  .donut-wrap { grid-template-columns: 1fr; justify-items: center; }
}
@media (max-width: 640px) {
  .site-nav-inner { padding: 12px 16px; }
  .page-shell, .admin-shell { padding: 20px 16px 40px; }
  .hero-panel { padding: 28px 22px 32px; }
  .metrics-row { grid-template-columns: 1fr; }
  .hero-stats { grid-template-columns: 1fr; }
}

/* ---------- Responsive hardening: mobile + tablet ---------- */
html { -webkit-text-size-adjust: 100%; }
body { overflow-x: hidden; }

.row-full {
  grid-column: 1 / -1;
}

.eligibility-callout {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}
.eligibility-card {
  background: #fff;
  border: 1px solid var(--gray-100);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 20px 22px;
  min-width: 0;
}
.eligibility-card.tw {
  background: linear-gradient(135deg, #eff6ff 0%, #ffffff 100%);
}
.eligibility-card.intl {
  background: linear-gradient(135deg, #ecfeff 0%, #ffffff 100%);
}
.eligibility-head {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  margin-bottom: 12px;
  color: var(--gray-800);
}
.eligibility-head i {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: var(--brand-100);
  color: var(--brand-700);
}
.eligibility-list {
  margin: 0;
  padding-left: 18px;
  color: var(--gray-600);
  line-height: 1.8;
}

.nav-links,
.nav-tools,
.brand-wrap,
.card,
.feature-card,
.hero-panel,
.hero-stat,
.process-step,
.select-shell,
.choice-switch,
.auth-mode-switch,
.user-chip,
.helper-card,
.kv-item,
.kv-value,
.form-field,
.form-field input,
.form-field select,
.form-field textarea,
.data-table th,
.data-table td {
  min-width: 0;
}

.select-shell {
  max-width: 100%;
}
.select-shell select {
  min-width: 0;
  width: 100%;
}

.form-field input,
.form-field select,
.form-field textarea {
  width: 100%;
}

.auth-shell,
.login-card,
.feature-card,
.card,
.sidebar-card,
.admin-section-card,
.chart-card {
  overflow: hidden;
}

.table-responsive {
  -webkit-overflow-scrolling: touch;
}

@media (max-width: 1024px) {
  .site-nav-inner {
    gap: 14px;
  }
  .nav-links {
    margin-left: 0;
    flex: 1 1 100%;
    order: 3;
  }
  .nav-tools {
    flex: 1 1 auto;
  }
  .eligibility-callout {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 768px) {
  .brand-wrap {
    width: 100%;
    align-items: flex-start;
  }
  .brand-sub {
    line-height: 1.4;
  }
  .nav-links {
    width: 100%;
    justify-content: flex-start;
    overflow-x: auto;
    flex-wrap: nowrap;
    padding-bottom: 2px;
    scrollbar-width: none;
  }
  .nav-links::-webkit-scrollbar {
    display: none;
  }
  .nav-link {
    white-space: nowrap;
    flex: 0 0 auto;
  }
  .nav-tools {
    width: 100%;
    margin-left: 0;
    justify-content: stretch;
  }
  .nav-tools > * {
    flex: 1 1 calc(50% - 10px);
  }
  .nav-tools > .select-shell {
    flex-basis: 100%;
  }
  .btn {
    min-height: 44px;
    white-space: normal;
    text-align: center;
  }
  .auth-mode-switch,
  .choice-switch {
    width: 100%;
  }
  .auth-mode-switch button,
  .choice-switch button {
    flex: 1 1 0;
  }
  .marquee-row {
    align-items: flex-start;
    flex-direction: column;
  }
  .marquee-items {
    display: grid;
    gap: 8px;
  }
  .eligibility-callout {
    grid-template-columns: 1fr;
  }
  .kv-item {
    grid-template-columns: 1fr;
    gap: 4px;
  }
  .status-banner {
    align-items: flex-start;
    flex-direction: column;
  }
  .toast-wrap {
    left: 16px;
    right: 16px;
    top: 14px;
    max-width: none;
  }
  .footer-inner {
    flex-direction: column;
  }
}

@media (max-width: 640px) {
  .site-nav {
    position: sticky;
  }
  .brand-wrap img {
    height: 48px !important;
  }
  .brand-title {
    font-size: 0.95rem;
  }
  .brand-sub {
    font-size: 0.72rem;
  }
  .page-shell,
  .admin-shell {
    padding-bottom: 56px;
  }
  .hero-grid {
    gap: 18px;
  }
  .hero-panel,
  .card,
  .feature-card,
  .eligibility-card {
    border-radius: 18px;
  }
  .hero-title-1 {
    font-size: 1.5rem;
  }
  .hero-title-2 {
    font-size: 1.75rem;
    line-height: 1.15;
  }
  .page-title {
    font-size: 1.55rem;
    line-height: 1.2;
  }
  .hero-desc,
  .page-desc,
  .feature-desc,
  .section-desc {
    font-size: 0.95rem;
  }
  .hero-stat {
    align-items: flex-start;
  }
  .process-step {
    align-items: flex-start;
  }
  .process-step i {
    flex: 0 0 34px;
    margin-top: 2px;
  }
  .auth-inline-links,
  .form-actions,
  .page-actions {
    flex-direction: column;
    align-items: stretch;
  }
  .login-card .btn,
  .auth-shell .btn,
  .action-stack .btn,
  .form-actions .btn,
  .auth-gate .btn {
    width: 100%;
  }
  .user-chip {
    width: 100%;
    justify-content: center;
    text-align: center;
    flex-wrap: wrap;
  }
  .data-table th,
  .data-table td {
    padding: 10px 12px;
    font-size: 0.86rem;
  }
}

@media (min-width: 641px) and (max-width: 900px) {
  .eligibility-callout {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .nav-tools > * {
    flex: 0 1 auto;
  }
}
