/* AttendWise: frosted glass over the PSIT campus photo, horizontal top header (matches approved mockup) */

:root {
  --glass: rgba(18, 28, 60, 0.34);
  --glass-strong: rgba(18, 28, 60, 0.46);
  --glass-line: rgba(255, 255, 255, 0.38);
  --glass-line-soft: rgba(255, 255, 255, 0.22);
  --shadow: 0 10px 34px rgba(10, 20, 50, 0.28);

  --text: #ffffff;
  --text-soft: #eef3ff;
  --muted: #d5ddf2;

  --orange: #ff9a3c;
  --orange-2: #ff7a1a;
  --yellow: #ffc04d;
  --blue: #3b82f6;
  --red: #ef4444;
  --green: #22c55e;
  --purple: #8b5cf6;
  --amber: #f59e0b;

  --grad-orange: linear-gradient(135deg, #ffb347 0%, #ff7a1a 100%);
  --radius: 22px;
  --radius-sm: 16px;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html, body {
  margin: 0;
  padding: 0;
  max-width: 100%;
  overflow-x: hidden;
}

body {
  font-family: "Plus Jakarta Sans", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--text);
  line-height: 1.5;
  font-size: 15px;
  min-height: 100vh;
  background-color: #7fb6e6;
  background-image:
    linear-gradient(180deg, rgba(150, 205, 250, 0.55) 0%, rgba(150, 205, 250, 0.12) 28%, rgba(150, 205, 250, 0) 45%),
    url("../assets/campus-bg.jpg");
  background-size: 100% 100%, cover;
  background-position: top center, center bottom;
  background-repeat: no-repeat;
  background-attachment: fixed, fixed;
}

h1, h2, h3, p { margin: 0 0 0.6rem; }
h1 { font-size: 1.6rem; font-weight: 800; color: var(--text); letter-spacing: -0.01em; }
h2 { font-size: 1.05rem; font-weight: 700; color: var(--text); }
a { color: var(--text-soft); }

.sr-only {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap; border: 0;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--orange-2);
  color: #fff;
  padding: 8px 12px;
  z-index: 100;
  border-radius: 8px;
}
.skip-link:focus { left: 8px; top: 8px; }

:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 2px;
}

/* glass helper */
.glass, .card {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.2) 0%, rgba(255, 255, 255, 0.08) 100%), var(--glass);
  -webkit-backdrop-filter: blur(16px) saturate(140%);
  backdrop-filter: blur(16px) saturate(140%);
  border: 1px solid var(--glass-line);
  border-radius: var(--radius);
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, 0.25);
  color: var(--text);
}

/* ---------- app shell: horizontal header over content ---------- */

.app {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.topbar {
  position: sticky;
  top: 12px;
  z-index: 30;
  width: calc(100% - 64px);
  max-width: 1120px;
  margin: 12px auto 0;
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 10px 14px 10px 14px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.26) 0%, rgba(255, 255, 255, 0.1) 100%), rgba(20, 30, 65, 0.4);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  backdrop-filter: blur(18px) saturate(140%);
  border: 1px solid var(--glass-line);
  border-radius: 20px;
  box-shadow: var(--shadow);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--text);
  text-decoration: none;
  flex-shrink: 0;
}
.brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px; height: 42px;
  border-radius: 12px;
  background: var(--grad-orange);
  color: #fff;
  font-weight: 800;
  font-size: 1.2rem;
  box-shadow: 0 8px 22px rgba(255, 122, 26, 0.45);
  flex-shrink: 0;
}
.brand-text { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; }
.brand-name { font-weight: 800; font-size: 1.05rem; color: var(--text); }
.brand-tagline { font-size: 0.72rem; color: var(--muted); }

.site-nav { flex: 1; min-width: 0; display: flex; justify-content: center; }
.site-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: nowrap;
  gap: 4px;
  align-items: center;
}
.site-nav a {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--text);
  text-decoration: none;
  padding: 8px 12px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.86rem;
  white-space: nowrap;
  transition: background 0.15s, color 0.15s;
  border: 1px solid transparent;
}
.site-nav .nav-icon { flex-shrink: 0; }
.site-nav a:hover { background: rgba(255, 255, 255, 0.16); }
.site-nav a[aria-current="page"] {
  background: var(--grad-orange);
  color: #fff;
  box-shadow: 0 8px 20px rgba(255, 122, 26, 0.4);
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}
.theme-pill {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  width: 62px;
  height: 30px;
  padding: 0 7px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.22);
  border: 1px solid var(--glass-line);
  color: #fff;
}
.theme-pill svg { position: relative; z-index: 1; opacity: 0.85; }
.theme-knob {
  position: absolute;
  left: 3px; top: 3px;
  width: 22px; height: 22px;
  border-radius: 50%;
  background: var(--grad-orange);
  box-shadow: 0 4px 10px rgba(255, 122, 26, 0.45);
}
.avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px; height: 36px;
  border-radius: 50%;
  background: #14142b;
  color: #fff;
  font-weight: 800;
  font-size: 0.95rem;
  border: 2px solid rgba(255, 255, 255, 0.6);
}
.menu-toggle { display: none; }

/* ---------- content ---------- */

.content {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.container {
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  padding: 28px 32px 24px;
  flex: 1;
}
main:focus { outline: none; }

.dash-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 20px;
}
.dash-main, .dash-side { min-width: 0; display: flex; flex-direction: column; gap: 16px; }
@media (min-width: 900px) {
  .dash-grid { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); align-items: start; }
}

.card {
  padding: 22px;
  min-width: 0;
}
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }

/* ---------- home hero ---------- */

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 18px;
  margin-bottom: 30px;
}
@media (min-width: 900px) {
  .hero { grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); align-items: stretch; }
}

.welcome-card {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 34px 36px;
  min-height: 300px;
}
.welcome-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #dfe6f7;
  margin: 0;
}
.eyebrow::before {
  content: "";
  display: inline-block;
  width: 18px;
  height: 2px;
  border-radius: 2px;
  background: #dfe6f7;
}
.portal-pill {
  display: inline-flex;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
  border: 1px solid var(--glass-line);
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #fff;
  white-space: nowrap;
}
.welcome-text { position: relative; z-index: 1; min-width: 0; }
.welcome-card h1 {
  font-size: clamp(2rem, 4.2vw, 3rem);
  line-height: 1.1;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 14px;
  color: var(--text);
  text-shadow: 0 2px 14px rgba(10, 20, 50, 0.25);
}
.hero-line { display: block; }
.grad-text {
  background: linear-gradient(90deg, #ffc04d, #ff7a1a);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.welcome-sub { color: var(--text-soft); font-size: 1rem; max-width: 52ch; margin-bottom: 20px; }
.chip-pills { display: flex; flex-wrap: wrap; gap: 10px; }
.pill-chip {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 7px 16px 7px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
  border: 1px solid var(--glass-line);
  color: var(--text-soft);
  font-size: 0.86rem;
  font-weight: 600;
}
.pill-chip strong { color: #fff; font-weight: 800; }
.chip-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px; height: 26px;
  border-radius: 50%;
  flex-shrink: 0;
  color: #fff;
}
.chip-target { background: #ef4444; }
.chip-people { background: #3b82f6; }

.current-card {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 6px;
  text-align: left;
}
.current-title { font-size: 1.15rem; font-weight: 800; color: #fff; margin: 0; }
.ring-wrap { display: flex; justify-content: center; margin: 10px 0 6px; }

/* orange/purple conic progress ring with a graduation-cap icon inside; --pct set from app.js */
.ring {
  --pct: 0;
  position: relative;
  width: 118px;
  height: 118px;
  border-radius: 50%;
  flex-shrink: 0;
  background: conic-gradient(#ff9a3c calc(var(--pct) * 1%), #8b5cf6 0, rgba(255, 255, 255, 0.18) 0);
  box-shadow: 0 8px 22px rgba(10, 20, 50, 0.25);
}
.ring-inner {
  position: absolute;
  inset: 10px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(20, 30, 65, 0.7);
  border: 1px solid var(--glass-line-soft);
}
.ring-inner svg { width: 44px; height: 44px; }

.icon-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 46px; height: 46px;
  border-radius: 50%;
  background: var(--blue);
  color: #fff;
  flex-shrink: 0;
  box-shadow: 0 6px 16px rgba(59, 130, 246, 0.45);
}

.big-number {
  font-size: 1.9rem;
  font-weight: 800;
  color: #fff;
  margin: 4px 0;
  overflow-wrap: anywhere;
  text-align: left;
}
.big-number.warn-text, .warn-text {
  color: var(--orange) !important;
  font-size: 1.6rem;
  text-align: center;
  margin: 6px 0 6px;
}
.current-card .progress { margin: 10px 0 12px; }
.current-card .small { margin: 0; text-align: center; color: var(--text-soft); }
.current-card .btn-cta { margin-top: 14px; width: 100%; }

.section-title {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 4px 0 14px;
  font-size: 1.15rem;
  font-weight: 800;
  color: #fff;
  text-shadow: 0 2px 10px rgba(10, 20, 50, 0.25);
}
.section-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px; height: 28px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.2);
  border: 1px solid var(--glass-line);
  color: #fff;
}
.muted { color: var(--muted); }
.small { font-size: 0.87rem; }

/* ---------- quick links ---------- */

.quick-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 26px;
}
@media (min-width: 640px) {
  .quick-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (min-width: 1000px) {
  .quick-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); }
}
.quick-tile {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
  min-height: 170px;
  padding: 18px 16px 52px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.2) 0%, rgba(255, 255, 255, 0.08) 100%), var(--glass);
  -webkit-backdrop-filter: blur(16px) saturate(140%);
  backdrop-filter: blur(16px) saturate(140%);
  border: 1px solid var(--glass-line);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, 0.25);
  color: #fff;
  text-decoration: none;
  min-width: 0;
  transition: transform 0.12s, box-shadow 0.12s;
}
.quick-tile:hover { transform: translateY(-2px); }
.tile-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 46px; height: 46px;
  border-radius: 14px;
  flex-shrink: 0;
  color: #fff;
  background: var(--tile-color, #ff7a1a);
  box-shadow: 0 6px 16px color-mix(in srgb, var(--tile-color, #ff7a1a) 45%, transparent);
}
.tile-body { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.tile-title { font-weight: 700; font-size: 0.95rem; color: #fff; overflow-wrap: anywhere; }
.tile-desc { font-size: 0.8rem; color: var(--muted); line-height: 1.35; }
.tile-arrow {
  position: absolute;
  right: 14px;
  bottom: 14px;
  width: 34px; height: 34px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.22);
  border: 1px solid var(--glass-line);
  color: #fff;
}
.t-orange { --tile-color: #ff7a1a; }
.t-blue { --tile-color: #3b82f6; }
.t-red { --tile-color: #ef4444; }
.t-green { --tile-color: #22c55e; }
.t-purple { --tile-color: #8b5cf6; }
.t-gray { --tile-color: #4b5563; }
.t-pink { --tile-color: #ec4899; }

/* ---------- medical attendance ---------- */
.med-note { margin-top: 12px; }
.med-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 10px;
}
.med-card {
  padding: 12px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid var(--glass-line);
  min-width: 0;
}
.med-label { margin: 0 0 4px; font-size: 0.78rem; color: var(--muted); line-height: 1.3; }
.med-value { margin: 0; font-size: 1.15rem; font-weight: 800; color: #fff; overflow-wrap: anywhere; }

/* ---------- history ---------- */

.history-card { margin-bottom: 24px; }
.history-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  flex-wrap: wrap;
}
.history-title { display: flex; align-items: center; gap: 14px; min-width: 0; }
.history-title h2 { margin: 0; }
.history-title p { margin: 2px 0 0; }
.btn-amber {
  background: var(--amber);
  color: #fff;
  box-shadow: 0 6px 18px rgba(245, 158, 11, 0.4);
}
.btn-amber:hover:not(:disabled) { background: #fbbf24; }
.btn-trash { display: inline-flex; }

/* ---------- forms ---------- */

.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; min-width: 0; }
.field.inline { flex-direction: row; align-items: center; gap: 12px; flex-wrap: wrap; }
label { font-weight: 600; font-size: 0.92rem; color: #fff; }
input, select {
  font: inherit;
  padding: 10px 14px;
  border: 1px solid rgba(255, 255, 255, 0.6);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.92);
  color: #14203d;
  min-height: 44px;
  width: 100%;
  max-width: 100%;
  color-scheme: light;
}
input::placeholder { color: #6b7396; }
select option { background: #fff; color: #14203d; }
input:focus, select:focus {
  border-color: #fff;
  box-shadow: 0 0 0 3px rgba(255, 154, 60, 0.6);
  outline: none;
}
input[aria-invalid="true"] { border-color: #fecaca; box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.5); }
.help { color: var(--muted); font-size: 0.85rem; margin: 0; }
.error { color: #ffd6d6; font-size: 0.87rem; margin: 0; min-height: 0; font-weight: 600; }
.error:empty { display: none; }
.status-line { font-size: 0.93rem; margin-top: 6px; color: var(--text-soft); }
.status-line.ok { color: #bbf7d0; font-weight: 700; }
.status-line.warn { color: #ffd39a; font-weight: 700; }
.status-line.error { color: #ffd6d6; font-weight: 700; }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 6px; }

.btn {
  font: inherit;
  font-weight: 700;
  min-height: 44px;
  padding: 10px 22px;
  border-radius: 999px;
  border: 1px solid transparent;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-decoration: none;
  transition: background 0.15s, box-shadow 0.15s, transform 0.12s;
}
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn-primary {
  background: var(--grad-orange);
  color: #fff;
  box-shadow: 0 8px 22px rgba(255, 122, 26, 0.4);
}
.btn-primary:hover:not(:disabled) { box-shadow: 0 10px 28px rgba(255, 122, 26, 0.55); transform: translateY(-1px); }
.btn-small { min-height: 38px; padding: 7px 18px; font-size: 0.85rem; }
.btn-cta {
  font-size: 1rem;
  min-height: 52px;
  border-radius: 999px;
  justify-content: space-between;
  padding: 10px 22px;
}
.btn-cta > span:nth-child(2) { flex: 1; text-align: center; }
.btn-cta-icon { display: inline-flex; }
.btn-outline {
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  border: 1px solid var(--glass-line);
}
.btn-outline:hover:not(:disabled) { background: rgba(255, 255, 255, 0.24); }

.chip-row { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.chip {
  font: inherit;
  min-height: 38px;
  padding: 6px 16px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
  border: 1px solid var(--glass-line);
  color: #fff;
  font-weight: 600;
  cursor: pointer;
}
.chip:hover { background: rgba(255, 255, 255, 0.28); }

/* ---------- results ---------- */

.result-card h2 { color: #fff; }
.breakdown { margin-top: 10px; }
.breakdown p {
  margin: 0 0 6px;
  background: rgba(255, 255, 255, 0.14);
  border-left: 3px solid var(--orange);
  padding: 8px 12px;
  border-radius: 10px;
  overflow-wrap: anywhere;
  color: #fff;
}
.mono { font-family: Consolas, "Courier New", monospace; font-size: 0.9rem; }
.history-list { padding-left: 20px; margin: 10px 0 0; color: #fff; }
.history-list li { margin-bottom: 6px; overflow-wrap: anywhere; font-size: 0.9rem; }
.history-list li.muted { color: var(--muted); }
.result-card .big-number { color: #fff; }

/* ---------- progress ---------- */

.progress {
  position: relative;
  height: 10px;
  background: rgba(255, 255, 255, 0.22);
  border: none;
  border-radius: 999px;
  margin: 12px 0 16px;
}
.progress-fill {
  height: 100%;
  width: 0;
  background: var(--grad-orange);
  border-radius: 999px;
  transition: width 0.3s;
}
.marker {
  position: absolute;
  top: -6px;
  bottom: -6px;
  width: 3px;
  margin-left: -1.5px;
  border-radius: 2px;
}
.marker-current { background: #fff; }
.marker-target { background: #fde047; }

/* ---------- tables and chart ---------- */

.table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--glass-line-soft);
  border-radius: var(--radius-sm);
  background: rgba(10, 20, 50, 0.3);
}
.scenario-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 720px;
  font-size: 0.88rem;
  color: var(--text-soft);
}
.scenario-table th, .scenario-table td {
  padding: 9px 10px;
  border-bottom: 1px solid var(--glass-line-soft);
  text-align: right;
  white-space: nowrap;
}
.scenario-table th:first-child, .scenario-table td:first-child { text-align: left; }
.scenario-table thead th { background: rgba(255, 255, 255, 0.14); color: #fff; }
.chart-wrap { margin-top: 12px; background: rgba(255, 255, 255, 0.9); border-radius: 12px; padding: 6px; }
.chart-wrap svg { max-width: 100%; height: auto; }
.chart-wrap svg text { fill: #202020; }

/* ---------- footer over the lawn ---------- */

.site-footer {
  padding: 26px 16px 28px;
  color: #fff;
  font-size: 0.82rem;
  text-align: center;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.55);
}
.site-footer p { margin: 0 0 4px; }
.site-footer .disclaimer { max-width: 760px; margin: 0 auto 6px; }
.site-footer .copyright { font-weight: 700; }

/* ---------- responsive ---------- */

@media (max-width: 1099px) {
  .site-nav a { padding: 8px 9px; font-size: 0.8rem; }
  .site-nav a .nav-icon { display: none; }
}

@media (max-width: 899px) {
  .topbar {
    width: calc(100% - 24px);
    flex-wrap: wrap;
    gap: 10px;
    top: 8px;
    margin-top: 8px;
    padding: 10px 12px;
  }
  .topbar .brand-tagline { display: none; }
  .brand-mark { width: 38px; height: 38px; }
  .top-actions { margin-left: auto; }
  .theme-pill { display: none; }
  .avatar { display: none; }
  .menu-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    min-height: 44px;
    background: rgba(255, 255, 255, 0.18);
    border: 1px solid var(--glass-line);
    color: #fff;
    border-radius: 12px;
    cursor: pointer;
  }
  .site-nav {
    display: none;
    order: 3;
    width: 100%;
    justify-content: stretch;
  }
  .site-nav.open { display: block; }
  .site-nav ul { flex-direction: column; align-items: stretch; gap: 4px; }
  .site-nav a {
    width: 100%;
    padding: 11px 14px;
    font-size: 0.92rem;
    border-radius: 14px;
  }
  .site-nav a .nav-icon { display: inline-block; }
  .container { padding: 20px 14px 24px; }
}

@media (max-width: 560px) {
  .welcome-card { padding: 26px 20px; min-height: 0; }
  .welcome-card h1 { font-size: 2rem; }
  .quick-grid { grid-template-columns: minmax(0, 1fr); }
  .quick-tile { min-height: 0; flex-direction: row; align-items: center; padding: 16px 52px 16px 16px; }
  .tile-arrow { top: 50%; bottom: auto; transform: translateY(-50%); }
  .card { padding: 18px; }
  .history-title { align-items: flex-start; }
  .portal-pill { font-size: 0.6rem; }
}

@media (max-width: 360px) {
  .container { padding-left: 10px; padding-right: 10px; }
  .topbar { width: calc(100% - 16px); padding: 10px; }
  .brand-name { font-size: 0.98rem; }
  .welcome-card { padding: 20px 16px; }
  .big-number { font-size: 1.6rem; }
  .btn-row .btn { flex: 1 1 100%; }
  .pill-chip { font-size: 0.8rem; }
}

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

