:root {
  --navy: #0f172a;
  --navy-light: #1e293b;
  --blue: #2563eb;
  --blue-hover: #1d4ed8;
  --bg: #f8fafc;
  --card: #ffffff;
  --line: #e2e8f0;
  --text: #0f172a;
  --muted: #64748b;
  --red: #ef4444;
  --red-bg: #fee2e2;
  --red-text: #991b1b;
  --green: #10b981;
  --green-bg: #d1fae5;
  --green-text: #065f46;
  --yellow: #f59e0b;
  --yellow-bg: #fef3c7;
  --yellow-text: #92400e;
  --radius: 14px;
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

body {
  margin: 0;
  background: var(--bg);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--text);
  min-height: 100vh;
}

.app {
  max-width: 820px;
  margin: auto;
  min-height: 100vh;
  padding-bottom: calc(88px + env(safe-area-inset-bottom));
}

header {
  position: sticky;
  top: 0;
  z-index: 25;
  background: rgba(15, 23, 42, 0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  color: #fff;
  padding: max(12px, env(safe-area-inset-top)) 16px 12px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.header-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.header-title-col {
  min-width: 0;
  flex: 1;
}

.header-main-title {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

h1 {
  margin: 0;
  font-size: 18px;
  font-weight: 850;
  letter-spacing: -0.02em;
  color: #ffffff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.unit-id-badge {
  display: inline-flex;
  align-items: center;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 11px;
  font-weight: 700;
  background: rgba(37, 99, 235, 0.22);
  color: #93c5fd;
  border: 1px solid rgba(147, 197, 253, 0.25);
  padding: 2px 7px;
  border-radius: 6px;
  letter-spacing: 0.04em;
  flex-shrink: 0;
}
.unit-id-badge:empty {
  display: none;
}

.sub {
  font-size: 12px;
  color: #94a3b8;
  margin-top: 3px;
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.badge-live {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  color: #34d399;
  font-weight: 700;
  flex-shrink: 0;
}
.badge-live::before {
  content: "";
  width: 7px;
  height: 7px;
  background: #10b981;
  border-radius: 50%;
  box-shadow: 0 0 8px #10b981;
  animation: pulseLive 2s infinite ease-in-out;
}

@keyframes pulseLive {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.85); }
}

.header-officer {
  color: #cbd5e1;
  font-weight: 600;
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.header-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #1e293b;
  color: #f1f5f9;
  border: 1px solid #334155;
  border-radius: 9px;
  padding: 7px 11px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.15);
}
.header-btn:hover {
  background: #334155;
  border-color: #475569;
  color: #fff;
}
.header-btn:active {
  transform: scale(0.97);
}

.header-btn-code {
  background: rgba(30, 41, 59, 0.9);
  border-color: #3b82f6;
  color: #93c5fd;
}
.header-btn-code:hover {
  background: rgba(37, 99, 235, 0.2);
  color: #bfdbfe;
}

.header-btn-unit {
  background: #1e293b;
  color: #e2e8f0;
}

main {
  padding: 14px;
}

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 14px;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.04);
}

.title {
  font-weight: 800;
  font-size: 16px;
  margin-bottom: 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.muted { font-size: 13px; color: var(--muted); }
.tiny { font-size: 11px; color: var(--muted); }

.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }

input, select, textarea, button {
  font: inherit;
}

input, select, textarea {
  width: 100%;
  padding: 11px 13px;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  background: #fff;
  color: var(--text);
  font-size: 14px;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

button {
  border: 0;
  border-radius: 10px;
  padding: 11px 14px;
  font-weight: 700;
  cursor: pointer;
  transition: opacity 0.15s, transform 0.05s;
}
button:active {
  transform: scale(0.98);
}
.btn { background: var(--blue); color: #fff; }
.btn:hover { background: var(--blue-hover); }
.secondary { background: #e2e8f0; color: #1e293b; }
.danger { background: var(--red-bg); color: var(--red-text); }
.success { background: var(--green-bg); color: var(--green-text); }
.warn { background: var(--yellow-bg); color: var(--yellow-text); }
.full { width: 100%; }

.stat {
  text-align: center;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 8px;
}
.stat .n { font-size: 24px; font-weight: 800; line-height: 1.2; }
.stat .l { font-size: 11px; font-weight: 700; color: var(--muted); margin-top: 2px; }
.stat.green { background: #f0fdf4; border-color: #bbf7d0; color: #166534; }
.stat.yellow { background: #fefce8; border-color: #fef08a; color: #854d0e; }
.stat.red { background: #fef2f2; border-color: #fecaca; color: #991b1b; }

.pie-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: 14px 0;
}
.pie {
  width: 160px;
  height: 160px;
  border-radius: 50%;
  position: relative;
  background: conic-gradient(var(--green) 0 0deg, var(--yellow) 0 0deg, var(--red) 0 360deg);
  transition: background 0.3s ease;
}
.pie:after {
  content: "";
  position: absolute;
  inset: 26px;
  border-radius: 50%;
  background: #ffffff;
}
.pieCenter {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 2;
}
.pieCenter .count { font-size: 26px; font-weight: 850; }
.pieCenter .label { font-size: 11px; font-weight: 700; color: var(--muted); }

.legend {
  display: flex;
  justify-content: center;
  gap: 16px;
  font-size: 12px;
  font-weight: 600;
  margin-top: 10px;
}
.dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  display: inline-block;
  margin-right: 5px;
}
.dg { background: var(--green); }
.dy { background: var(--yellow); }
.dr { background: var(--red); }

/* Member List */
.member {
  display: grid;
  grid-template-columns: 1fr 130px;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
  align-items: center;
}
.member:last-child { border-bottom: 0; }
.member-info { cursor: pointer; }
.nm { font-weight: 750; font-size: 15px; }
.rank { font-size: 12px; color: var(--muted); margin-top: 1px; }

.status-select {
  font-weight: 750;
  font-size: 13px;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid transparent;
}
.status-select.Present { background: var(--green-bg); color: var(--green-text); border-color: #a7f3d0; }
.status-select.Excused { background: var(--yellow-bg); color: var(--yellow-text); border-color: #fde68a; }
.status-select.Absent { background: var(--red-bg); color: var(--red-text); border-color: #fecaca; }

.row { display: flex; gap: 8px; align-items: center; }
.between { justify-content: space-between; }
.wrap { flex-wrap: wrap; }
.toolbar { display: flex; gap: 8px; flex-wrap: wrap; }
.toolbar button { flex: 1; padding: 10px 8px; font-size: 12px; }

.pill {
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.04em;
}
.pill.open { background: #dbeafe; color: #1e40af; }
.pill.locked, .pill.closed { background: #e2e8f0; color: #475569; }

/* Tabs */
.tabs {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  border-top: 1px solid var(--line);
  background: #ffffff;
  z-index: 15;
  padding-bottom: env(safe-area-inset-bottom);
}
.tabs > div {
  max-width: 820px;
  margin: auto;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
}
.tab {
  background: #fff;
  color: #64748b;
  border-radius: 0;
  font-size: 12px;
  font-weight: 700;
  padding: 12px 6px;
  text-align: center;
}
.tab.active {
  background: #eff6ff;
  color: var(--blue);
  border-top: 2px solid var(--blue);
}

.hidden { display: none !important; }

/* Modal & Dialogs */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.7);
  backdrop-filter: blur(4px);
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.modal {
  background: #fff;
  border-radius: 18px;
  width: 100%;
  max-width: 480px;
  max-height: 90vh;
  overflow-y: auto;
  padding: 22px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.25);
}
.modal-title {
  font-size: 18px;
  font-weight: 800;
  margin-bottom: 6px;
}
.modal-desc {
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 16px;
}

/* Rolling Code Display Box */
.rolling-code-box {
  background: #f1f5f9;
  border: 2px dashed #cbd5e1;
  border-radius: 14px;
  padding: 18px;
  text-align: center;
  margin: 16px 0;
}
.rolling-code-number {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 38px;
  font-weight: 900;
  letter-spacing: 6px;
  color: #0f172a;
}
.rolling-progress-bar {
  width: 100%;
  height: 6px;
  background: #e2e8f0;
  border-radius: 999px;
  margin-top: 12px;
  overflow: hidden;
}
.rolling-progress-fill {
  height: 100%;
  background: var(--blue);
  width: 100%;
  transition: width 1s linear;
}

/* Unit selector banner */
.unit-banner {
  background: #1e293b;
  color: #fff;
  padding: 10px 14px;
  border-radius: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}
.unit-banner-info { font-weight: 750; font-size: 14px; }
.unit-banner-action {
  background: #334155;
  color: #93c5fd;
  border: 0;
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

/* History Matrix Grid & Overview */
.history-matrix-wrapper {
  position: relative;
  overflow-x: auto;
  overflow-y: auto;
  max-height: 72vh;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  margin-top: 10px;
  -webkit-overflow-scrolling: touch;
}

.history-matrix-table {
  border-collapse: separate;
  border-spacing: 0;
  width: 100%;
  font-size: 13px;
}

.history-matrix-table thead th {
  position: sticky;
  top: 0;
  background: #f8fafc;
  z-index: 10;
  border-bottom: 2px solid var(--line);
  border-right: 1px solid var(--line);
  padding: 10px 10px;
  text-align: center;
  white-space: nowrap;
  font-weight: 700;
  color: var(--navy);
}

.history-matrix-table th.sticky-event-col,
.history-matrix-table td.sticky-event-col {
  position: sticky;
  left: 0;
  background: #ffffff;
  z-index: 5;
  border-right: 2px solid var(--line);
  text-align: left;
  min-width: 210px;
  max-width: 280px;
  padding: 10px 12px;
}

.history-matrix-table thead th.sticky-event-col {
  z-index: 15;
  background: #f1f5f9;
}

.history-matrix-table tbody tr {
  transition: background 0.1s ease;
}

.history-matrix-table tbody tr:hover td {
  background: #f8fafc;
}

.history-matrix-table tbody tr:hover td.sticky-event-col {
  background: #f1f5f9;
}

.history-matrix-table td {
  border-bottom: 1px solid var(--line);
  border-right: 1px solid var(--line);
  padding: 8px 6px;
  text-align: center;
  vertical-align: middle;
}

/* Status Matrix Badges */
.matrix-cell {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  font-weight: 800;
  font-size: 12px;
  line-height: 1;
}

.matrix-cell.present {
  background: #dcfce7;
  color: #15803d;
  border: 1px solid #bbf7d0;
}

.matrix-cell.excused {
  background: #fef9c3;
  color: #a16207;
  border: 1px solid #fef08a;
}

.matrix-cell.absent {
  background: #fee2e2;
  color: #b91c1c;
  border: 1px solid #fecaca;
}

.matrix-cell.unlisted {
  color: #94a3b8;
  font-weight: 500;
}

.history-matrix-legend {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 12px;
  color: var(--muted);
  flex-wrap: wrap;
}

.history-matrix-legend span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.history-event-link {
  font-weight: 800;
  color: var(--blue);
  cursor: pointer;
  display: inline-block;
  text-decoration: none;
  font-size: 14px;
}

.history-event-link:hover {
  text-decoration: underline;
}

/* Closed Event Card in Events Overview */
.closed-event-card {
  background: #fafafa;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 14px;
  margin-bottom: 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  transition: all 0.15s ease;
  cursor: pointer;
}

.closed-event-card:hover {
  border-color: #94a3b8;
  background: #f1f5f9;
}

.closed-event-card:last-child {
  margin-bottom: 0;
}

/* Roster Editor row */
.roster-row {
  display: flex;
  gap: 8px;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
  align-items: center;
}
.roster-row input {
  flex: 1;
  min-width: 0;
}
.roster-row:last-child { border-bottom: 0; }
.roster-row button { padding: 9px 12px; font-size: 12px; flex-shrink: 0; }

label {
  display: block;
  margin-bottom: 5px;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
}

/* Open Event Card in Main Page */
.open-event-card {
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 14px;
  margin-bottom: 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  transition: all 0.15s ease;
}
.open-event-card:hover {
  border-color: var(--blue);
  background: #eff6ff;
}
.open-event-card:last-child {
  margin-bottom: 0;
}
.open-event-info {
  flex: 1;
  min-width: 0;
}
.open-event-title {
  font-weight: 800;
  font-size: 15px;
  color: var(--text);
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.open-event-meta {
  font-size: 12px;
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.open-event-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  background: #dbeafe;
  color: #1e40af;
}

/* Attendee Controls: Search, Filter, Sort & Group */
.attendee-controls-grid {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.attendee-dropdowns {
  display: grid;
  grid-template-columns: 1.2fr 1.4fr 1.1fr;
  gap: 8px;
}

@media(max-width: 540px) {
  .attendee-dropdowns {
    grid-template-columns: 1fr;
    gap: 6px;
  }
}

/* Tag Chips */
.tag-chip {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  background: #f1f5f9;
  color: #334155;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  padding: 1px 6px;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.3;
}

.tag-chip.accent {
  background: #eff6ff;
  color: #1d4ed8;
  border-color: #bfdbfe;
}

.member-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-top: 3px;
}

/* Tag Group Header */
.tag-group-header {
  background: #f8fafc;
  border: 1px solid var(--line);
  border-left: 4px solid var(--blue);
  border-radius: 8px;
  padding: 7px 10px;
  margin: 14px 0 6px;
  font-size: 12px;
  font-weight: 800;
  color: #1e293b;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.tag-group-header:first-child {
  margin-top: 4px;
}
.tag-group-count {
  font-size: 11px;
  color: var(--muted);
  font-weight: 600;
}

/* Roster Row Tags */
.roster-tags-container {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px;
  margin-top: 6px;
}
.btn-tag-add {
  background: #f8fafc;
  color: #2563eb;
  border: 1px dashed #93c5fd;
  border-radius: 6px;
  padding: 2px 8px;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  transition: all 0.15s ease;
}
.btn-tag-add:hover {
  background: #eff6ff;
  border-color: #2563eb;
}

.roster-member-card {
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}
.roster-member-card:last-child {
  border-bottom: 0;
}

/* Tag Editor Modal */
.tag-pill-removable {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #eff6ff;
  color: #1e40af;
  border: 1px solid #bfdbfe;
  border-radius: 999px;
  padding: 3px 10px;
  font-size: 12px;
  font-weight: 700;
}
.tag-pill-removable button {
  background: transparent;
  border: 0;
  color: #ef4444;
  cursor: pointer;
  padding: 0;
  font-weight: 800;
  font-size: 13px;
  line-height: 1;
}
.available-tags-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.tag-suggest-btn {
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  color: #334155;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}
.tag-suggest-btn:hover {
  background: #eff6ff;
  border-color: #3b82f6;
  color: #1d4ed8;
}

@media(max-width: 600px) {
  input, select, textarea {
    font-size: 16px; /* Prevents auto-zoom on iOS Safari */
  }
}

@media(max-width: 520px) {
  .grid2 { grid-template-columns: 1fr; }
  .member { grid-template-columns: 1fr 115px; }
  .toolbar button { font-size: 11px; padding: 9px 5px; }
}

@media(max-width: 380px) {
  header {
    padding: max(10px, env(safe-area-inset-top)) 10px 10px;
  }
  .header-top {
    gap: 8px;
  }
  main {
    padding: 10px;
  }
  .card {
    padding: 12px;
    margin-bottom: 10px;
  }
  h1 {
    font-size: 15px;
  }
  .unit-id-badge {
    font-size: 10px;
    padding: 1px 5px;
  }
  .header-actions {
    gap: 5px;
  }
  .header-btn {
    padding: 6px 7px;
    font-size: 11px;
    gap: 4px;
  }
  .toolbar {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 6px;
  }
  .toolbar button {
    font-size: 11px;
    padding: 8px 4px;
    line-height: 1.2;
    text-align: center;
  }
  .member {
    grid-template-columns: 1fr 108px;
    gap: 6px;
    padding: 8px 0;
  }
  .status-select {
    font-size: 12px;
    padding: 6px 6px;
  }
  .stat {
    padding: 8px 4px;
  }
  .stat .n {
    font-size: 20px;
  }
  .pie {
    width: 130px;
    height: 130px;
  }
  .pie:after {
    inset: 20px;
  }
  .pieCenter .count {
    font-size: 22px;
  }
  .tab {
    font-size: 11px;
    padding: 10px 4px;
  }
  .open-event-card {
    padding: 10px;
    gap: 8px;
  }
  .open-event-card button {
    padding: 8px 10px;
    font-size: 12px;
  }
}

/* ================= AUTH GATE & PASSKEY ONBOARDING SCREEN ================= */
.auth-gate-screen {
  position: fixed;
  inset: 0;
  background: var(--navy);
  color: #fff;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px 20px;
  text-align: center;
  overflow-y: auto;
}

.auth-gate-content {
  width: 100%;
  max-width: 420px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.auth-gate-icon {
  width: 92px;
  height: 92px;
  background: #1e293b;
  border: 2px solid #334155;
  border-radius: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.35);
}

.auth-gate-title {
  font-size: 24px;
  font-weight: 850;
  letter-spacing: -0.02em;
  margin: 0 0 6px;
  color: #ffffff;
}

.auth-gate-subtitle {
  font-size: 14px;
  color: #94a3b8;
  margin: 0 0 28px;
}

.auth-gate-card {
  width: 100%;
  background: #1e293b;
  border: 1px solid #334155;
  border-radius: 18px;
  padding: 22px;
  text-align: left;
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.3);
}

.auth-gate-card .card-title {
  font-size: 16px;
  font-weight: 800;
  color: #ffffff;
  margin-bottom: 6px;
}

.auth-gate-card .card-desc {
  font-size: 13px;
  color: #94a3b8;
  margin-bottom: 18px;
  line-height: 1.4;
}

.spinner {
  width: 38px;
  height: 38px;
  border: 3px solid rgba(255, 255, 255, 0.15);
  border-top-color: var(--blue);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 14px auto;
}
@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ================= FULLSCREEN UNIT HUB SCREEN ================= */
.unit-hub-screen {
  min-height: 100vh;
  background: var(--bg);
  padding-bottom: 60px;
}

.unit-hub-header {
  background: var(--navy);
  color: #fff;
  padding: max(16px, env(safe-area-inset-top)) 20px 16px;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.15);
}

.unit-hub-container {
  max-width: 820px;
  margin: auto;
  padding: 20px 16px;
}

.unit-card-item {
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 16px;
  margin-bottom: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: 0 4px 10px rgba(15, 23, 42, 0.04);
}

.hub-action-card {
  background: #ffffff;
  border: 2px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  cursor: pointer;
  transition: all 0.18s ease;
  display: flex;
  flex-direction: column;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.04);
}

.hub-action-card:hover, .hub-action-card:active {
  border-color: var(--blue);
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(37, 99, 235, 0.12);
}

.hub-action-icon {
  font-size: 32px;
  margin-bottom: 10px;
}

.hub-action-title {
  font-size: 17px;
  font-weight: 800;
  color: var(--navy);
  margin-bottom: 6px;
}

.hub-action-desc {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.45;
  flex: 1;
}


