/* =========================================================
   SharedSpace Global Tokens & Apple HIG Design System
   ========================================================= */
* {
  box-sizing: border-box;
}

:root {
  /* Apple HIG Tokens */
  --apple-bg: #f5f5f7;
  --apple-surface: #ffffff;
  --apple-tile-bg: #f2f2f7;
  --apple-text-primary: #1d1d1f;
  --apple-text-secondary: #6e6e73;
  --apple-text-tertiary: #86868b;
  --apple-border: rgba(0, 0, 0, 0.08);
  --apple-blue: #007aff;
  --apple-green: #34c759;
  --apple-orange: #ff9500;
  --apple-red: #ff3b30;
  --apple-shadow: 0 2px 12px rgba(0, 0, 0, 0.04), 0 1px 2px rgba(0, 0, 0, 0.03);

  /* Shared Tokens used by css/student.css */
  --brand-primary: #007aff;
  --brand-soft: rgba(0, 122, 255, 0.1);
  --brand-border: rgba(0, 122, 255, 0.25);
  --bg-surface: #ffffff;
  --border-subtle: rgba(0, 0, 0, 0.08);
  --text-primary: #1d1d1f;
  --text-secondary: #48484a;
  --text-muted: #6e6e73;
  --radius-md: 12px;
  --radius-lg: 18px;
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.04);
  --status-green: #34c759;
  --status-green-bg: rgba(52, 199, 89, 0.14);
  --status-amber-bg: rgba(255, 149, 0, 0.14);
}

body {
  margin: 0;
  min-height: 100vh;
  font-family:
    -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text",
    "Helvetica Neue", sans-serif;
  background-color: var(--apple-bg);
  color: var(--apple-text-primary);
  -webkit-font-smoothing: antialiased;
}

#app {
  width: 100%;
  min-height: 100vh;
}

.container {
  max-width: 960px;
  margin: 0 auto;
  padding: 28px 20px;
}

/* =========================================================
   Top Navigation Bar (NavBar.js)
   ========================================================= */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--apple-border);
}

.site-header .header-inner {
  max-width: 960px;
  margin: 0 auto;
  padding: 12px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.site-header h1 {
  margin: 0;
  font-size: 19px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--apple-text-primary);
  text-align: left;
}

.site-header nav {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  font-size: 0;
}

.site-header nav a {
  font-size: 14px;
  font-weight: 500;
  color: var(--apple-text-secondary);
  text-decoration: none;
  padding: 6px 12px;
  border-radius: 980px;
  transition:
    background-color 0.16s ease,
    color 0.16s ease;
}

.site-header nav a:hover {
  background: rgba(118, 118, 128, 0.1);
  color: var(--apple-text-primary);
}

.site-header nav a.router-link-exact-active {
  background: rgba(0, 122, 255, 0.12);
  color: var(--apple-blue);
  font-weight: 600;
}

.site-header nav button {
  margin: 0 0 0 6px;
  padding: 6px 14px;
  border: none;
  border-radius: 980px;
  background: rgba(118, 118, 128, 0.12);
  color: var(--apple-text-primary);
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition:
    background-color 0.16s ease,
    color 0.16s ease;
}

.site-header nav button:hover {
  background: rgba(255, 59, 48, 0.14);
  color: var(--apple-red);
}

/* Burger button: hidden on laptop, shown on phone */
.menu-toggle {
  display: none;
}

@media (max-width: 768px) {
  .site-header .header-inner {
    padding: 10px 16px;
  }

  .menu-toggle {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 40px;
    height: 40px;
    padding: 0 9px;
    border: none;
    border-radius: 10px;
    background: transparent;
    cursor: pointer;
  }

  .menu-toggle span {
    display: block;
    height: 2px;
    border-radius: 2px;
    background: var(--apple-text-primary);
    transition: transform 0.2s ease, opacity 0.2s ease;
  }

  /* Turn the three lines into an X when the menu is open */
  .menu-toggle.open span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
  }
  .menu-toggle.open span:nth-child(2) {
    opacity: 0;
  }
  .menu-toggle.open span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
  }

  /* Menu links drop down under the bar, one per line */
  .site-header nav {
    display: none;
    width: 100%;
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
    padding-bottom: 6px;
  }

  .site-header nav.open {
    display: flex;
  }

  .site-header nav a {
    font-size: 16px;
    padding: 12px 14px;
    border-radius: 12px;
  }

  .site-header nav button {
    margin: 6px 0 0;
    padding: 12px 14px;
    border-radius: 12px;
    font-size: 16px;
    text-align: left;
  }
}

/* =========================================================
   Sign-In Screen (LoginPage.js)
   ========================================================= */
.apple-login-wrapper {
  min-height: calc(100vh - 60px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px 48px;
}

.login-box {
  width: 100%;
  max-width: 400px;
  padding: 32px 28px;
  background: var(--apple-surface);
  border: 1px solid var(--apple-border);
  border-radius: 24px;
  box-shadow:
    0 12px 32px rgba(0, 0, 0, 0.06),
    0 2px 6px rgba(0, 0, 0, 0.03);
}

.login-header {
  text-align: center;
  margin-bottom: 24px;
}

.login-badge {
  display: inline-block;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--apple-blue);
  background: rgba(0, 122, 255, 0.1);
  padding: 4px 12px;
  border-radius: 980px;
  margin-bottom: 10px;
}

.login-box h1 {
  margin: 0;
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.025em;
  color: var(--apple-text-primary);
}

.login-subtitle {
  margin: 6px 0 0;
  font-size: 14px;
  color: var(--apple-text-secondary);
}

.login-box form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* iOS Segmented Control */
.roles {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  padding: 4px;
  background: var(--apple-tile-bg);
  border-radius: 12px;
}

.roles label {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px 12px;
  border-radius: 9px;
  font-size: 14px;
  font-weight: 500;
  color: var(--apple-text-secondary);
  cursor: pointer;
  transition:
    background-color 0.18s ease,
    color 0.18s ease,
    box-shadow 0.18s ease;
  user-select: none;
}

.roles label input[type="radio"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.roles label.active {
  background: var(--apple-surface);
  color: var(--apple-text-primary);
  font-weight: 600;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
}

.login-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.login-field label {
  font-size: 13px;
  font-weight: 600;
  color: var(--apple-text-primary);
}

.login-box input[type="email"],
.login-box input[type="password"],
.login-box input[type="text"],
.login-box input[type="date"] {
  width: 100%;
  padding: 11px 14px;
  border: 1px solid var(--apple-border);
  border-radius: 12px;
  background-color: var(--apple-tile-bg);
  color: var(--apple-text-primary);
  font-family: inherit;
  font-size: 15px;
  transition:
    background-color 0.16s ease,
    border-color 0.16s ease,
    box-shadow 0.16s ease;
}

.login-box input[type="email"]::placeholder,
.login-box input[type="password"]::placeholder,
.login-box input[type="text"]::placeholder {
  color: var(--apple-text-tertiary);
}

.login-box input[type="email"]:focus,
.login-box input[type="password"]:focus,
.login-box input[type="text"]:focus,
.login-box input[type="date"]:focus {
  outline: none;
  background-color: var(--apple-surface);
  border-color: var(--apple-blue);
  box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.16);
}

.login-box button[type="submit"] {
  margin-top: 6px;
  padding: 12px 18px;
  border: none;
  border-radius: 980px;
  background-color: var(--apple-blue);
  color: #ffffff;
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.01em;
  cursor: pointer;
  transition:
    background-color 0.16s ease,
    transform 0.12s ease;
}

.login-box button[type="submit"]:hover {
  background-color: #0066d6;
}

.login-box button[type="submit"]:active {
  transform: scale(0.98);
}

.back-link {
  margin: 18px 0 0;
  text-align: center;
  font-size: 13px;
}

.back-link a {
  color: var(--apple-blue);
  text-decoration: none;
  font-weight: 500;
}

/* =========================================================
   Admin Page Shell & Headers
   ========================================================= */
.apple-page {
  background-color: var(--apple-bg);
  color: var(--apple-text-primary);
  min-height: calc(100vh - 56px);
  padding: 28px 20px 64px;
}

.apple-container {
  max-width: 960px;
  margin: 0 auto;
}

.apple-container-narrow {
  max-width: 620px;
}

.apple-page-header {
  margin-bottom: 24px;
}

.apple-header-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.apple-eyebrow {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--apple-blue);
  margin: 0 0 4px;
}

.apple-page-title {
  font-size: 30px;
  font-weight: 700;
  letter-spacing: -0.025em;
  margin: 0;
  color: var(--apple-text-primary);
}

.apple-page-subtitle {
  font-size: 15px;
  color: var(--apple-text-secondary);
  margin: 6px 0 0;
}

.apple-count-pill {
  padding: 4px 11px;
  border-radius: 980px;
  background: rgba(118, 118, 128, 0.12);
  color: var(--apple-text-secondary);
  font-size: 13px;
  font-weight: 600;
}

/* =========================================================
   Buttons & Toolbars
   ========================================================= */
.apple-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  gap: 12px;
  flex-wrap: wrap;
}

.apple-toolbar-group {
  display: flex;
  align-items: center;
  gap: 10px;
}

.apple-btn {
  appearance: none;
  border: none;
  border-radius: 980px;
  padding: 8px 16px;
  margin: 0;
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: -0.01em;
  text-decoration: none;
  cursor: pointer;
  transition:
    background-color 0.16s ease,
    transform 0.12s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.apple-btn:active {
  transform: scale(0.98);
}

.apple-btn-primary {
  background: var(--apple-blue);
  color: #ffffff;
  font-weight: 600;
  padding: 11px 20px;
}

.apple-btn-primary:hover {
  background: #0066d6;
}

.apple-btn-full {
  width: 100%;
}

.apple-btn-secondary {
  background: rgba(118, 118, 128, 0.12);
  color: var(--apple-text-primary);
}

.apple-btn-secondary:hover {
  background: rgba(118, 118, 128, 0.2);
}

.apple-btn-tinted {
  background: rgba(0, 122, 255, 0.12);
  color: var(--apple-blue);
}

.apple-btn-tinted:hover {
  background: rgba(0, 122, 255, 0.2);
}

.apple-btn-danger {
  background: rgba(255, 59, 48, 0.12);
  color: var(--apple-red);
}

.apple-btn-danger:hover {
  background: rgba(255, 59, 48, 0.2);
}

.apple-btn-sm {
  padding: 5px 12px;
  font-size: 13px;
}

/* =========================================================
   Forms & Selectors (AdminPage.js)
   ========================================================= */
.apple-form-stack {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.apple-field {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.apple-field-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--apple-text-primary);
}

.apple-input,
.apple-select {
  width: 100%;
  padding: 11px 14px;
  border-radius: 12px;
  border: 1px solid var(--apple-border);
  background-color: var(--apple-tile-bg);
  color: var(--apple-text-primary);
  font-family: inherit;
  font-size: 15px;
  font-weight: 500;
  line-height: 1.35;
  transition:
    border-color 0.16s ease,
    background-color 0.16s ease,
    box-shadow 0.16s ease;
}

.apple-select {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 38px;
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236e6e73' stroke-width='2.25' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 13px center;
  background-size: 15px 15px;
}

.apple-select:hover:not(:disabled) {
  background-color: #e9e9ef;
  border-color: rgba(0, 0, 0, 0.14);
}

.apple-input:focus,
.apple-select:focus {
  outline: none;
  background-color: var(--apple-surface);
  border-color: var(--apple-blue);
  box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.16);
}

.apple-select:focus {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23007aff' stroke-width='2.25' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
}

.apple-input:disabled,
.apple-select:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.apple-form-actions {
  margin-top: 6px;
}

/* Choice Cards for Creation */
.apple-choice-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 24px;
}

@media (max-width: 600px) {
  .apple-choice-grid {
    grid-template-columns: 1fr;
  }
}

.apple-choice-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 20px 14px;
  background: var(--apple-surface);
  border: 1.5px solid var(--apple-border);
  border-radius: 18px;
  box-shadow: var(--apple-shadow);
  cursor: pointer;
  transition:
    border-color 0.18s ease,
    background-color 0.18s ease,
    box-shadow 0.18s ease,
    transform 0.14s ease;
  user-select: none;
}

.apple-choice-card:hover {
  border-color: rgba(0, 122, 255, 0.35);
  transform: translateY(-2px);
}

.apple-choice-card:active {
  transform: translateY(0) scale(0.98);
}

.apple-choice-card.active {
  border-color: var(--apple-blue);
  background: rgba(0, 122, 255, 0.04);
  box-shadow: 0 0 0 2px rgba(0, 122, 255, 0.2), var(--apple-shadow);
}

.apple-choice-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--apple-tile-bg);
  color: var(--apple-text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 12px;
  transition: all 0.18s ease;
}

.apple-choice-card.active .apple-choice-icon {
  background: var(--apple-blue);
  color: #ffffff;
}

.apple-choice-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--apple-text-primary);
  margin-bottom: 4px;
}

.apple-choice-desc {
  font-size: 12px;
  color: var(--apple-text-secondary);
  line-height: 1.3;
}

/* =========================================================
   All Students Directory Rows (AllStudentsPage.js)
   ========================================================= */
.apple-student-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 18px;
  border-bottom: 1px solid var(--apple-border);
  gap: 14px;
  transition: background-color 0.15s ease;
}

.apple-student-row:last-child {
  border-bottom: none;
}

.apple-student-row:hover {
  background-color: rgba(0, 0, 0, 0.015);
}

.apple-student-link {
  display: flex;
  align-items: center;
  gap: 14px;
  text-decoration: none;
  color: inherit;
  flex: 1;
  min-width: 0;
}

.apple-student-meta {
  min-width: 0;
}

.apple-student-name {
  font-size: 15px;
  font-weight: 600;
  color: var(--apple-text-primary);
}

.apple-student-email {
  font-size: 13px;
  color: var(--apple-text-secondary);
  overflow: hidden;
  text-overflow: ellipsis;
}

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

@media (max-width: 600px) {
  .apple-student-row {
    flex-direction: column;
    align-items: stretch;
  }

  .apple-student-actions {
    justify-content: flex-end;
  }
}

/* =========================================================
   Loading & Error States
   ========================================================= */
.apple-state-card {
  background: var(--apple-surface);
  border: 1px solid var(--apple-border);
  border-radius: 18px;
  padding: 24px;
  text-align: center;
  color: var(--apple-text-secondary);
}

.apple-state-error {
  color: var(--apple-red);
}

/* =========================================================
   Profile Hero & Avatars (StudentDetailAdminPOV.js)
   ========================================================= */
.apple-profile-hero {
  display: flex;
  align-items: center;
  gap: 16px;
  background: var(--apple-surface);
  border: 1px solid var(--apple-border);
  border-radius: 20px;
  box-shadow: var(--apple-shadow);
  padding: 20px 24px;
  margin-bottom: 8px;
}

.apple-avatar {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: linear-gradient(135deg, #007aff, #5ac8fa);
  color: #ffffff;
  font-size: 20px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  text-transform: uppercase;
}

.apple-avatar-sm {
  width: 40px;
  height: 40px;
  font-size: 15px;
}

.apple-profile-title {
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0 0 4px;
  color: var(--apple-text-primary);
}

.apple-profile-subtitle {
  font-size: 14px;
  color: var(--apple-text-secondary);
  margin: 0;
}

/* =========================================================
   Section Headers & Cards
   ========================================================= */
.apple-section-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin: 26px 4px 10px;
}

.apple-section-title {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--apple-text-secondary);
  margin: 0;
}

.apple-section-meta {
  font-size: 12px;
  color: var(--apple-text-tertiary);
}

.apple-card {
  background: var(--apple-surface);
  border: 1px solid var(--apple-border);
  border-radius: 20px;
  box-shadow: var(--apple-shadow);
  padding: 20px;
  margin-bottom: 14px;
}

/* =========================================================
   Room Sensor Telemetry Cards
   ========================================================= */
.apple-room-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  gap: 12px;
}

.apple-room-title-wrap {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.apple-room-name {
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.015em;
  margin: 0;
}

.apple-room-node {
  font-size: 12px;
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  color: var(--apple-text-tertiary);
}

.apple-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 11px;
  border-radius: 980px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.03em;
}

.apple-status-pill.online {
  background: rgba(52, 199, 89, 0.14);
  color: #1f8b3c;
}

.apple-status-pill.offline {
  background: rgba(255, 59, 48, 0.12);
  color: var(--apple-red);
}

.apple-status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
}

.apple-metrics-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

@media (max-width: 720px) {
  .apple-metrics-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.apple-metric-tile {
  background: var(--apple-tile-bg);
  border-radius: 14px;
  padding: 14px 16px;
  transition: background-color 0.2s ease;
}

.apple-metric-tile.alert-warn {
  background: rgba(255, 149, 0, 0.13);
}

.apple-metric-tile.alert-critical {
  background: rgba(255, 59, 48, 0.13);
}

.apple-metric-label {
  font-size: 12px;
  font-weight: 500;
  color: var(--apple-text-secondary);
  margin-bottom: 6px;
}

.apple-metric-value {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  color: var(--apple-text-primary);
}

.apple-metric-tile.alert-critical .apple-metric-value {
  color: var(--apple-red);
}

.apple-metric-tile.alert-warn .apple-metric-value {
  color: #b86200;
}

.apple-metric-unit {
  font-size: 14px;
  font-weight: 500;
  color: var(--apple-text-secondary);
  margin-left: 2px;
}

.apple-room-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 12px;
  font-size: 12px;
  color: var(--apple-text-tertiary);
  font-variant-numeric: tabular-nums;
}

.apple-emergency-tag {
  color: var(--apple-red);
  font-weight: 700;
}

/* =========================================================
   Inset Grouped Lists & Two-Column Grid
   ========================================================= */
.apple-two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

@media (max-width: 760px) {
  .apple-two-col {
    grid-template-columns: 1fr;
  }
}

.apple-inset-list {
  background: var(--apple-surface);
  border: 1px solid var(--apple-border);
  border-radius: 18px;
  box-shadow: var(--apple-shadow);
  overflow: hidden;
}

.apple-list-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 13px 18px;
  border-bottom: 1px solid var(--apple-border);
  font-size: 14px;
  gap: 14px;
}

.apple-list-row:last-child {
  border-bottom: none;
}

.apple-list-row-stack {
  flex-direction: column;
  align-items: stretch;
  gap: 4px;
}

.apple-row-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.apple-list-key {
  font-weight: 500;
  color: var(--apple-text-primary);
}

.apple-list-val {
  color: var(--apple-text-secondary);
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.apple-mono {
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 12px;
}

.apple-row-sub {
  font-size: 12px;
  color: var(--apple-text-secondary);
  margin-top: 2px;
  text-transform: capitalize;
}

.apple-empty-text {
  color: var(--apple-text-secondary);
  font-size: 14px;
  margin: 0;
}

/* =========================================================
   Semantic Status Badges
   ========================================================= */
.apple-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 980px;
  font-size: 12px;
  font-weight: 600;
  text-transform: capitalize;
  white-space: nowrap;
}

.apple-badge.paid,
.apple-badge.done {
  background: rgba(52, 199, 89, 0.14);
  color: #1f8b3c;
}

.apple-badge.pending,
.apple-badge.todo {
  background: rgba(255, 149, 0, 0.14);
  color: #b86200;
}

.apple-badge.overdue,
.apple-badge.missed {
  background: rgba(255, 59, 48, 0.14);
  color: var(--apple-red);
}

.apple-badge.offline {
  background: rgba(142, 142, 147, 0.16);
  color: var(--apple-text-secondary);
}
.apple-search-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  margin-bottom: 20px;
  background-color: var(--apple-surface);
  border: 1px solid var(--apple-border);
  border-radius: 12px;
  box-shadow: var(--apple-shadow);
  transition: border-color 0.16s ease, box-shadow 0.16s ease;
}

.apple-search-bar:focus-within {
  border-color: var(--apple-blue);
  box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.16);
}

.apple-search-icon {
  display: flex;
  align-items: center;
  color: var(--apple-text-tertiary);
}

.apple-search-icon .icon {
  width: 17px;
  height: 17px;
}

.apple-search-input {
  flex: 1;
  border: none;
  background: transparent;
  font-family: inherit;
  font-size: 15px;
  color: var(--apple-text-primary);
  outline: none;
}

.apple-search-input::placeholder {
  color: var(--apple-text-tertiary);
}

.apple-search-clear {
  border: none;
  background: rgba(118, 118, 128, 0.16);
  color: var(--apple-text-secondary);
  width: 20px;
  height: 20px;
  border-radius: 50%;
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}


/* =========================================================
   Home / Landing Page (HomePage.js)
   ========================================================= */
.hp {
  overflow-x: hidden;
}

/* ── Hero ── */
.hp-hero {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  min-height: calc(100vh - 56px);
  padding: 80px 24px 60px;
  background:
    radial-gradient(ellipse 80% 60% at 50% -10%, rgba(0, 122, 255, 0.10), transparent),
    radial-gradient(ellipse 60% 50% at 80% 90%, rgba(52, 199, 89, 0.08), transparent),
    var(--apple-bg);
}

.hp-hero-inner {
  max-width: 640px;
}

.hp-badge {
  display: inline-block;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--apple-blue);
  background: rgba(0, 122, 255, 0.10);
  padding: 5px 14px;
  border-radius: 980px;
  margin-bottom: 20px;
}

.hp-title {
  font-size: clamp(44px, 8vw, 72px);
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1.05;
  margin: 0 0 18px;
  background: linear-gradient(135deg, var(--apple-text-primary) 40%, var(--apple-blue));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hp-subtitle {
  font-size: 18px;
  line-height: 1.55;
  color: var(--apple-text-secondary);
  margin: 0 auto 36px;
  max-width: 480px;
}

.hp-hero-actions {
  display: flex;
  justify-content: center;
  gap: 12px;
}

.hp-cta {
  padding: 14px 28px !important;
  font-size: 16px !important;
  gap: 8px !important;
  border-radius: 980px;
}

/* ── Section headers ── */
.hp-features,
.hp-how,
.hp-stats {
  max-width: 960px;
  margin: 0 auto;
  padding: 60px 24px;
}

.hp-section-header {
  text-align: center;
  margin-bottom: 40px;
}

.hp-section-title {
  font-size: 32px;
  font-weight: 700;
  letter-spacing: -0.025em;
  margin: 0 0 8px;
}

.hp-section-sub {
  font-size: 16px;
  color: var(--apple-text-secondary);
  margin: 0;
}

/* ── Feature cards ── */
.hp-feature-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

@media (max-width: 700px) {
  .hp-feature-grid {
    grid-template-columns: 1fr;
  }
}

.hp-feature-card {
  background: var(--apple-surface);
  border: 1px solid var(--apple-border);
  border-radius: 20px;
  padding: 28px 24px;
  box-shadow: var(--apple-shadow);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.hp-feature-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.08), 0 2px 6px rgba(0, 0, 0, 0.04);
}

.hp-feature-icon {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
}

.hp-icon-blue  { background: rgba(0, 122, 255, 0.12); color: var(--apple-blue); }
.hp-icon-green { background: rgba(52, 199, 89, 0.12); color: var(--apple-green); }
.hp-icon-orange { background: rgba(255, 149, 0, 0.12); color: var(--apple-orange); }

.hp-feature-name {
  font-size: 18px;
  font-weight: 700;
  margin: 0 0 6px;
}

.hp-feature-desc {
  font-size: 14px;
  line-height: 1.55;
  color: var(--apple-text-secondary);
  margin: 0;
}

/* ── How it works ── */
.hp-steps {
  display: flex;
  flex-direction: column;
  gap: 0;
  max-width: 520px;
  margin: 0 auto;
}

.hp-step {
  display: flex;
  align-items: flex-start;
  gap: 20px;
  padding: 20px 0;
  position: relative;
}

.hp-step:not(:last-child)::after {
  content: "";
  position: absolute;
  left: 19px;
  top: 60px;
  bottom: 0;
  width: 2px;
  background: var(--apple-border);
}

.hp-step-num {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--apple-blue);
  color: #ffffff;
  font-size: 16px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hp-step-body h4 {
  font-size: 16px;
  font-weight: 700;
  margin: 0 0 4px;
}

.hp-step-body p {
  font-size: 14px;
  color: var(--apple-text-secondary);
  margin: 0;
  line-height: 1.5;
}

/* ── Stats strip ── */
.hp-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  padding-top: 20px;
  padding-bottom: 60px;
}

@media (max-width: 600px) {
  .hp-stats {
    grid-template-columns: repeat(2, 1fr);
  }
}

.hp-stat {
  text-align: center;
  background: var(--apple-surface);
  border: 1px solid var(--apple-border);
  border-radius: 18px;
  padding: 24px 16px;
  box-shadow: var(--apple-shadow);
}

.hp-stat-num {
  display: block;
  font-size: 36px;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--apple-blue);
}

.hp-stat-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--apple-text-secondary);
  margin-top: 4px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

/* ── Footer ── */
.hp-footer {
  text-align: center;
  padding: 24px;
  font-size: 13px;
  color: var(--apple-text-tertiary);
  border-top: 1px solid var(--apple-border);
}

.hp-footer p {
  margin: 0;
}
