/* ==========================================================================
   GET FIT FOLKS (GFF) — Human-Designed UI / UX Design System
   Architecture: Tokens -> Reset -> Base -> Typography -> Layout -> 
                 Components -> Workspace Layouts -> Responsive -> Print
   ========================================================================== */

/* --- 1. DESIGN TOKENS --- */
:root {
  /* Brand Core Palette */
  --brand-primary: #6A1B9A;
  --brand-primary-hover: #571380;
  --brand-deep: #3D0C5C;
  --brand-soft: #F2E5F7;
  --brand-soft-hover: #E9D2F2;
  --brand-subtle: #FAF4FD;
  
  /* Canvas & Surfaces */
  --page-bg: #FBF7FD;
  --surface: #FFFFFF;
  --surface-raised: #FFFFFF;
  --surface-subtle: #F7F3FA;
  --surface-active: #EFE8F5;
  
  /* Text & Contrast */
  --text: #1F1128;
  --text-secondary: #4E4057;
  --text-muted: #74657E;
  --text-disabled: #A598AE;
  --text-inverse: #FFFFFF;
  
  /* Borders & Dividers */
  --border: #E4D9EB;
  --border-light: #EFE8F5;
  --border-strong: #CDBED8;
  --border-focus: #6A1B9A;
  
  /* Semantic Status */
  --ok: #157347;
  --ok-bg: #E8F5E9;
  --ok-border: #C8E6C9;
  --ok-text: #0E5A36;
  
  --warn: #9A6700;
  --warn-bg: #FFF8E1;
  --warn-border: #FFE082;
  --warn-text: #7A4F00;
  
  --err: #B42318;
  --err-bg: #FEE4E2;
  --err-border: #FECDCA;
  --err-text: #91180E;
  
  --info: #1A5694;
  --info-bg: #E8F1FA;
  --info-border: #BCD5EF;
  --info-text: #134273;

  /* Typography Scale */
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-display: 'Plus Jakarta Sans', 'Inter', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  /* Elevation & Shadows */
  --shadow-xs: 0 1px 2px rgba(35, 19, 43, 0.04);
  --shadow-sm: 0 1px 3px rgba(35, 19, 43, 0.06), 0 1px 2px rgba(35, 19, 43, 0.04);
  --shadow-md: 0 4px 12px rgba(35, 19, 43, 0.07), 0 2px 4px rgba(35, 19, 43, 0.03);
  --shadow-lg: 0 12px 24px rgba(35, 19, 43, 0.09), 0 4px 8px rgba(35, 19, 43, 0.04);
  
  /* Radii */
  --radius-xs: 4px;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 18px;
  --radius-full: 9999px;

  /* Spacing Scale */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
}

/* --- 2. RESET & BASE --- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

/* Immediate feedback for server-rendered page navigation, including iPhone PWA. */
#page-navigation-progress {
  position: fixed;
  z-index: 10000;
  top: env(safe-area-inset-top, 0px);
  left: 0;
  width: 0;
  height: 3px;
  opacity: 0;
  pointer-events: none;
  background: linear-gradient(90deg, #8e24aa, #6a1b9a, #d7a7ef);
  box-shadow: 0 0 8px rgba(106, 27, 154, 0.45);
  transition: opacity 120ms ease;
}

#page-navigation-progress.is-active {
  opacity: 1;
  animation: page-navigation-progress 1.1s ease-out forwards;
}

@keyframes page-navigation-progress {
  0% { width: 0; }
  45% { width: 58%; }
  80% { width: 82%; }
  100% { width: 92%; }
}

body {
  font-family: var(--font-sans);
  background-color: var(--page-bg);
  color: var(--text);
  line-height: 1.55;
  font-feature-settings: 'cv02', 'cv03', 'cv04', 'cv11';
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img, svg {
  display: block;
  max-width: 100%;
}

button, input, select, textarea {
  font: inherit;
  color: inherit;
}

a {
  color: var(--brand-primary);
  text-decoration: none;
  transition: color 0.15s ease;
}

a:hover {
  color: var(--brand-primary-hover);
}

/* --- 3. TYPOGRAPHY HIERARCHY --- */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  color: var(--brand-deep);
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.015em;
}

.page-category {
  font-size: 0.8125rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--brand-primary);
  margin-bottom: 0.25rem;
}

.page-title {
  font-size: 1.625rem;
  font-weight: 800;
  color: var(--brand-deep);
  letter-spacing: -0.025em;
  margin-bottom: 0.35rem;
}

@media (min-width: 768px) {
  .page-title {
    font-size: 2rem;
  }
}

.page-subtitle {
  font-size: 0.9375rem;
  color: var(--text-secondary);
  line-height: 1.5;
  max-width: 48rem;
  margin-bottom: 1.5rem;
}

.page-header-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1.75rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border-light);
}

/* --- 4. APP LAYOUT & SHELL --- */
.app-layout {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
}

@media (min-width: 840px) {
  .app-layout {
    grid-template-columns: 260px minmax(0, 1fr);
  }
}

/* Desktop Sidebar */
.app-sidebar {
  display: none;
  background-color: var(--surface);
  border-right: 1px solid var(--border);
  padding: 1.25rem 1rem;
  flex-direction: column;
  height: 100vh;
  position: sticky;
  top: 0;
  overflow-y: auto;
  z-index: 20;
}

@media (min-width: 840px) {
  .app-sidebar {
    display: flex;
  }
}

.brand-badge {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 0.875rem;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--brand-deep) 0%, var(--brand-primary) 100%);
  color: #FFFFFF;
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow-sm);
}

.brand-badge-icon {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-sm);
  background-color: rgba(255, 255, 255, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-weight: 800;
  font-size: 0.875rem;
  letter-spacing: 0.04em;
}

.brand-logo-img {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  object-fit: contain;
  background: #fff;
  flex-shrink: 0;
  background-color: #FFFFFF;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
  border: 1.5px solid rgba(255, 255, 255, 0.6);
  display: block;
}

.brand-badge-text {
  display: flex;
  flex-direction: column;
}

.brand-title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 0.9375rem;
  letter-spacing: 0.04em;
  line-height: 1.1;
}

.brand-tagline {
  font-size: 0.6875rem;
  opacity: 0.8;
  letter-spacing: 0.03em;
  margin-top: 2px;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  flex: 1;
}

.nav-section-title {
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  padding: 0.75rem 0.875rem 0.25rem;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.55rem 0.875rem;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-secondary);
  text-decoration: none;
  transition: all 0.15s ease;
  min-height: 40px;
}

.nav-link:hover {
  background-color: var(--surface-subtle);
  color: var(--brand-deep);
}

.nav-link.active {
  background-color: var(--brand-soft);
  color: var(--brand-primary);
  font-weight: 600;
}

.nav-link.active .nav-icon {
  stroke: var(--brand-primary);
}

.nav-icon {
  width: 1.2rem;
  height: 1.2rem;
  flex-shrink: 0;
  stroke: var(--text-muted);
  transition: stroke 0.15s ease;
}

.sidebar-footer {
  margin-top: auto;
  padding-top: 1rem;
  border-top: 1px solid var(--border-light);
}

/* Header & Workspace Switcher */
.app-header {
  position: sticky;
  top: 0;
  z-index: 15;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 3.75rem;
  padding: 0 1.5rem;
  background-color: rgba(251, 247, 253, 0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.header-brand-mobile {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 800;
  color: var(--brand-deep);
  letter-spacing: -0.01em;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  white-space: nowrap;
}

.header-logo-mobile {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  background-color: #FFFFFF;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.12);
  border: 1px solid var(--border-light);
  display: block;
}

.auth-logo-img {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  object-fit: contain;
  background: #fff;
  margin: 0 auto 0.75rem;
  display: block;
  background-color: #FFFFFF;
  box-shadow: 0 4px 14px rgba(61, 12, 92, 0.15);
  border: 2px solid var(--border-light);
}

.print-logo-img {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: contain;
  background: #fff;
  flex-shrink: 0;
  background-color: #FFFFFF;
  border: 1px solid #333333;
  display: inline-block;
  vertical-align: middle;
}

@media (max-width: 440px) {
  .app-header {
    padding: 0 0.75rem;
  }
  .header-context {
    gap: 0.35rem;
  }
  .install-app-button {
    width: 36px;
    padding: 0.4rem;
  }
  .install-app-button span {
    display: none;
  }
  .header-brand-mobile span {
    font-size: 0.875rem;
    letter-spacing: -0.02em;
  }
  .header-logo-mobile {
    width: 28px;
    height: 28px;
  }
}

@media (min-width: 840px) {
  .header-brand-mobile {
    display: none;
  }
}

.header-context {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  position: relative;
}

.install-app-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  min-height: 36px;
  padding: 0.4rem 0.75rem;
  border: 1px solid var(--brand-primary);
  border-radius: var(--radius-sm);
  background: var(--brand-primary);
  color: #fff;
  font: inherit;
  font-size: 0.8125rem;
  font-weight: 700;
  white-space: nowrap;
  cursor: pointer;
  box-shadow: var(--shadow-xs);
  transition: background-color 0.15s ease, transform 0.15s ease;
}

.install-app-button:hover {
  background: var(--brand-deep);
  transform: translateY(-1px);
}

.install-app-button:focus-visible,
.install-app-help button:focus-visible {
  outline: 3px solid var(--brand-soft);
  outline-offset: 2px;
}

.install-app-button svg {
  width: 1rem;
  height: 1rem;
  flex: none;
}

.install-app-help {
  position: absolute;
  z-index: 20;
  top: calc(100% + 0.5rem);
  right: 0;
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  width: min(22rem, calc(100vw - 2rem));
  padding: 0.75rem 0.875rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  font-size: 0.8125rem;
  line-height: 1.45;
  box-shadow: var(--shadow-md);
}

.install-app-help[hidden],
.install-app-button[hidden] {
  display: none;
}

.install-app-help button {
  flex: none;
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--text-muted);
  font-size: 1.125rem;
  line-height: 1;
  cursor: pointer;
}

.workspace-select-wrapper {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.workspace-select {
  appearance: none;
  -webkit-appearance: none;
  min-height: 36px;
  padding: 0.35rem 2.25rem 0.35rem 0.875rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background-color: var(--surface);
  color: var(--brand-deep);
  font-weight: 600;
  font-size: 0.8125rem;
  cursor: pointer;
  outline: none;
  transition: all 0.15s ease;
  box-shadow: var(--shadow-xs);
}

.workspace-select:hover {
  border-color: var(--border-strong);
  background-color: var(--surface-subtle);
}

.workspace-select:focus {
  border-color: var(--brand-primary);
  box-shadow: 0 0 0 3px var(--brand-soft);
}

.workspace-chevron {
  position: absolute;
  right: 0.625rem;
  pointer-events: none;
  width: 0.875rem;
  height: 0.875rem;
  color: var(--text-muted);
}

/* Main Content Area */
.main-content {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 1.25rem 1rem 6.5rem;
}

@media (min-width: 768px) {
  .main-content {
    padding: 1.75rem 1.75rem 3.5rem;
  }
}

/* --- 5. COMPONENT SYSTEM --- */

/* Cards */
.card {
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  box-shadow: var(--shadow-xs);
  position: relative;
}

@media (min-width: 768px) {
  .card {
    padding: 1.5rem;
  }
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.card-header-title {
  font-size: 1.0625rem;
  font-weight: 700;
  color: var(--brand-deep);
}

.card-header-sub {
  font-size: 0.8125rem;
  color: var(--text-muted);
  margin-top: 0.125rem;
}

/* --- HUMAN-DESIGNED UI PRIMITIVES --- */

/* Section Dividers */
.section-divider {
  height: 1px;
  background-color: var(--border);
  margin: 1.75rem 0;
  border: none;
}

/* Structured Information & Callout Boxes (Proper text boxes) */
.info-box {
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--brand-primary);
  border-radius: var(--radius-sm);
  padding: 1rem 1.25rem;
  margin: 1.25rem 0;
}

.info-box-tip {
  background-color: #FFFDF5;
  border: 1px solid #F0E6CA;
  border-left: 3px solid #D4A017;
  border-radius: var(--radius-sm);
  padding: 1rem 1.25rem;
  margin: 1.25rem 0;
}

.info-box-ok {
  background-color: #F6FCF7;
  border: 1px solid var(--ok-border);
  border-left: 3px solid var(--ok);
  border-radius: var(--radius-sm);
  padding: 1rem 1.25rem;
  margin: 1.25rem 0;
}

.info-box-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.35rem;
}

.info-box-title {
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--brand-deep);
  letter-spacing: -0.01em;
}

.info-box-text {
  font-size: 0.8125rem;
  color: var(--text-secondary);
  line-height: 1.55;
  margin: 0;
}

/* Structured Summary Panel (replaces floating multi-cards) */
.summary-panel {
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.25rem 1.5rem;
  box-shadow: var(--shadow-xs);
  margin-bottom: 1.5rem;
}

.summary-panel-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding-bottom: 0.875rem;
  border-bottom: 1px solid var(--border-light);
  margin-bottom: 1rem;
}

.summary-panel-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--brand-deep);
  margin: 0;
}

.summary-panel-meta {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.metric-strip {
  display: grid;
  grid-template-columns: 1.3fr 1fr 1fr 1fr;
  align-items: center;
  gap: 1.25rem;
}

@media (max-width: 767px) {
  .metric-strip {
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
  }
}

.metric-strip-item {
  display: flex;
  flex-direction: column;
}

.metric-strip-item.is-primary {
  padding-right: 1rem;
  border-right: 1px solid var(--border-light);
}

@media (max-width: 767px) {
  .metric-strip-item.is-primary {
    border-right: none;
    grid-column: 1 / -1;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border-light);
  }
}

.metric-strip-label {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 0.2rem;
}

.metric-strip-value {
  font-family: var(--font-display);
  font-size: 1.625rem;
  font-weight: 800;
  color: var(--brand-deep);
  line-height: 1.1;
  letter-spacing: -0.02em;
}

.metric-strip-value.is-brand {
  color: var(--brand-primary);
  font-size: 2rem;
}

.metric-strip-desc {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
  font-weight: 500;
}

/* Package Catalogue Redesign (Max 3-Col, No Purple Bar, Human Editorial) */
.package-catalog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.25rem;
  margin-bottom: 1.75rem;
}

@media (min-width: 1024px) {
  .package-catalog-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.package-card {
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
  position: relative;
  box-shadow: var(--shadow-xs);
}

.package-card:hover {
  border-color: var(--brand-primary);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.package-card-header {
  margin-bottom: 0.875rem;
}

.package-category-label {
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--brand-primary);
  display: inline-block;
  margin-bottom: 0.35rem;
}

.package-card-title {
  font-size: 1.1875rem;
  font-weight: 700;
  color: var(--brand-deep);
  line-height: 1.25;
  margin: 0;
}

.package-price-wrap {
  margin: 0.875rem 0;
  padding: 0.75rem 0;
  border-top: 1px solid var(--border-light);
  border-bottom: 1px solid var(--border-light);
}

.package-price-row {
  display: flex;
  align-items: baseline;
  gap: 0.35rem;
}

.package-price {
  font-family: var(--font-display);
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--brand-deep);
  letter-spacing: -0.02em;
  line-height: 1;
}

.package-price-unit {
  font-size: 0.8125rem;
  color: var(--text-muted);
}

.package-meta-line {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-top: 0.35rem;
}

.package-desc {
  font-size: 0.8125rem;
  color: var(--text-secondary);
  line-height: 1.55;
  margin-bottom: 1.25rem;
  flex: 1;
}

.package-inclusions {
  list-style: none;
  padding: 0;
  margin: 0 0 1.25rem 0;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.package-inclusions li {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.package-inclusions li svg {
  color: var(--ok);
  flex-shrink: 0;
}

/* KPI Summary Metric Cards */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.kpi-card {
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.125rem 1.25rem;
  box-shadow: var(--shadow-xs);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 105px;
}

.kpi-label {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}

.kpi-val {
  font-family: var(--font-display);
  font-size: 1.875rem;
  font-weight: 800;
  color: var(--brand-deep);
  line-height: 1.1;
  margin-top: 0.25rem;
  letter-spacing: -0.02em;
}

.kpi-sub {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.35rem;
  font-weight: 500;
}

/* Humanized Hero Card (Client Workspace) */
.client-hero-card {
  background: linear-gradient(135deg, #2A0840 0%, #460E68 100%);
  color: #FFFFFF;
  border-radius: var(--radius-md);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 1.75rem;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 1.5rem;
  position: relative;
  overflow: hidden;
}

.client-hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.25rem 0.625rem;
  border-radius: var(--radius-full);
  background-color: rgba(255, 255, 255, 0.16);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.client-hero-title {
  color: #FFFFFF;
  font-size: 1.625rem;
  font-weight: 800;
  line-height: 1.2;
}

.client-hero-desc {
  color: #E9D2F2;
  font-size: 0.9375rem;
  margin-top: 0.35rem;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  min-height: 40px;
  padding: 0.45rem 1rem;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.15s ease;
  border: 1px solid transparent;
  white-space: nowrap;
  line-height: 1.2;
}

.btn:focus-visible {
  outline: 2px solid var(--brand-primary);
  outline-offset: 2px;
}

.btn:disabled {
  cursor: not-allowed;
  opacity: 0.55;
  pointer-events: none;
}

.btn-primary {
  background-color: var(--brand-primary);
  color: #FFFFFF;
  border-color: var(--brand-primary);
}

.btn-primary:hover {
  background-color: var(--brand-primary-hover);
  border-color: var(--brand-primary-hover);
  color: #FFFFFF;
}

.btn-secondary {
  background-color: var(--surface);
  color: var(--brand-deep);
  border-color: var(--border-strong);
}

.btn-secondary:hover {
  background-color: var(--surface-subtle);
  border-color: var(--text-muted);
}

.btn-ghost {
  background-color: transparent;
  color: var(--text-secondary);
  border-color: var(--border);
}

.btn-ghost:hover {
  background-color: var(--surface-subtle);
  color: var(--brand-deep);
}

.btn-danger {
  background-color: var(--err-bg);
  color: var(--err-text);
  border-color: var(--err-border);
}

.btn-danger:hover {
  background-color: #FECDCA;
}

.btn-sm {
  min-height: 32px;
  padding: 0.25rem 0.75rem;
  font-size: 0.8125rem;
}

.btn-hero-white {
  background-color: #FFFFFF;
  color: var(--brand-deep);
  border-color: #FFFFFF;
}

.btn-hero-white:hover {
  background-color: #F2E5F7;
  color: var(--brand-deep);
}

.btn-hero-translucent {
  background-color: rgba(255, 255, 255, 0.12);
  color: #FFFFFF;
  border-color: rgba(255, 255, 255, 0.3);
}

.btn-hero-translucent:hover {
  background-color: rgba(255, 255, 255, 0.22);
}

/* Status Badges */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.2rem 0.55rem;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1.2;
}

.status-dot {
  width: 6px;
  height: 6px;
  border-radius: var(--radius-full);
  background-color: currentColor;
}

.status-ok {
  background-color: var(--ok-bg);
  color: var(--ok-text);
  border: 1px solid var(--ok-border);
}

.status-warn {
  background-color: var(--warn-bg);
  color: var(--warn-text);
  border: 1px solid var(--warn-border);
}

.status-err {
  background-color: var(--err-bg);
  color: var(--err-text);
  border: 1px solid var(--err-border);
}

.status-info {
  background-color: var(--info-bg);
  color: var(--info-text);
  border: 1px solid var(--info-border);
}

.status-neutral {
  background-color: var(--surface-subtle);
  color: var(--text-secondary);
  border: 1px solid var(--border);
}

/* Alerts */
.alert {
  padding: 0.875rem 1.125rem;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  margin-bottom: 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  box-shadow: var(--shadow-xs);
}

.alert-error {
  background-color: var(--err-bg);
  color: var(--err-text);
  border: 1px solid var(--err-border);
}

.alert-success {
  background-color: var(--ok-bg);
  color: var(--ok-text);
  border: 1px solid var(--ok-border);
}

.alert-info {
  background-color: var(--info-bg);
  color: var(--info-text);
  border: 1px solid var(--info-border);
}

/* Forms */
.form-group {
  margin-bottom: 1.125rem;
}

.form-label {
  display: block;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 0.35rem;
}

.form-input, .form-select, .form-textarea {
  width: 100%;
  min-height: 42px;
  padding: 0.55rem 0.875rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background-color: var(--surface);
  color: var(--text);
  font-family: inherit;
  font-size: 0.875rem;
  outline: none;
  transition: all 0.15s ease;
  box-shadow: var(--shadow-xs);
}

.form-input:hover, .form-select:hover, .form-textarea:hover {
  border-color: var(--border-strong);
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
  border-color: var(--brand-primary);
  box-shadow: 0 0 0 3px var(--brand-soft);
}

.form-hint {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.35rem;
}

/* Data Tables */
.table-container {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background-color: var(--surface);
  box-shadow: var(--shadow-xs);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.875rem;
}

.data-table th {
  padding: 0.75rem 1rem;
  font-weight: 600;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  background-color: var(--surface-subtle);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.data-table td {
  padding: 0.875rem 1rem;
  border-bottom: 1px solid var(--border-light);
  color: var(--text);
  vertical-align: middle;
}

.data-table tbody tr:last-child td {
  border-bottom: none;
}

.data-table tbody tr:hover td {
  background-color: var(--surface-subtle);
}

/* Tabs */
.tabs-container {
  display: flex;
  gap: 0.5rem;
  border-bottom: 1px solid var(--border);
  overflow-x: auto;
  scrollbar-width: none;
  margin-bottom: 1.5rem;
  padding-bottom: 1px;
}

.tabs-container::-webkit-scrollbar {
  display: none;
}

.tab-btn {
  min-height: 40px;
  padding: 0.5rem 1.125rem;
  border: none;
  border-bottom: 2px solid transparent;
  background: transparent;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  white-space: nowrap;
  text-decoration: none;
  transition: all 0.15s ease;
}

.tab-btn:hover {
  color: var(--brand-deep);
}

.tab-btn.active {
  border-bottom-color: var(--brand-primary);
  color: var(--brand-primary);
  font-weight: 600;
}

/* Mobile Bottom Navigation (Client, Tutor, Admin Workspaces) */
.mobile-bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 40;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  background-color: var(--surface);
  border-top: 1px solid var(--border);
  padding-bottom: env(safe-area-inset-bottom, 0px);
  box-shadow: 0 -2px 12px rgba(35, 19, 43, 0.06);
}

@media (min-width: 840px) {
  .mobile-bottom-nav {
    display: none;
  }
}

.mobile-nav-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  min-height: 56px;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.6875rem;
  font-weight: 500;
  transition: color 0.15s ease, background-color 0.15s ease;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.mobile-nav-btn:active {
  background-color: var(--surface-subtle);
}

.mobile-nav-btn.active {
  color: var(--brand-primary);
  font-weight: 600;
}

.mobile-nav-btn.active svg {
  stroke: var(--brand-primary);
}

/* Mobile Slide-Out Drawer / Navigation Sheet */
.mobile-drawer-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(31, 17, 40, 0.45);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 998;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

.mobile-drawer-backdrop.open {
  opacity: 1;
  visibility: visible;
}

.mobile-drawer {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: min(85vw, 320px);
  background-color: var(--surface);
  z-index: 999;
  display: flex;
  flex-direction: column;
  transform: translateX(-100%);
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: var(--shadow-lg);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}

.mobile-drawer.open {
  transform: translateX(0);
}

.mobile-drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border);
  background: var(--surface-subtle);
}

.mobile-drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 1rem 0.75rem;
  -webkit-overflow-scrolling: touch;
}

.mobile-drawer-footer {
  padding: 0.875rem 1rem;
  border-top: 1px solid var(--border);
  background: var(--surface-subtle);
}

/* iPhone safe area: keep dashboard controls below the Dynamic Island/notch. */
@media (max-width: 839px) {
  html.is-iphone .app-header {
    height: calc(3.75rem + env(safe-area-inset-top, 0px));
    padding-top: env(safe-area-inset-top, 0px);
  }

  html.is-iphone .mobile-drawer-backdrop {
    top: env(safe-area-inset-top, 0px);
  }

  html.is-iphone .mobile-drawer {
    top: env(safe-area-inset-top, 0px);
    padding-bottom: env(safe-area-inset-bottom, 0px);
  }
}

/* Mobile Header Hamburger Button */
.btn-hamburger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: var(--radius-sm);
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--brand-deep);
  cursor: pointer;
  margin-right: 0.625rem;
  transition: all 0.15s ease;
  flex-shrink: 0;
  box-shadow: var(--shadow-xs);
}

.btn-hamburger:hover, .btn-hamburger:active {
  background-color: var(--surface-subtle);
  border-color: var(--border-strong);
}

@media (min-width: 840px) {
  .btn-hamburger {
    display: none;
  }
}

/* Responsive Table Card Alternative on Small Screens */
.desktop-table-container {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.mobile-card-list {
  display: grid;
  gap: 0.75rem;
}

/* Admin client directory: allow the header, search, and cards to fit phone widths. */
.client-directory-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.client-directory-heading {
  flex: 1 1 20rem;
  min-width: 0;
}

.client-directory-heading .page-title {
  overflow-wrap: anywhere;
}

.client-directory-actions,
.client-directory-search {
  display: flex;
  flex-wrap: wrap;
  min-width: 0;
}

.client-directory-actions {
  gap: 0.5rem;
  max-width: 100%;
}

.client-directory-search {
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}

.client-directory-search .form-input {
  flex: 1 1 16rem;
  min-width: 0;
}

.client-directory-card-container,
.client-directory-mobile-card,
.client-directory-identity {
  min-width: 0;
}

.client-directory-card-container .mobile-card-list {
  grid-template-columns: minmax(0, 1fr);
}

.client-directory-credit-fields {
  display: grid;
  grid-template-columns: minmax(0, 5rem) minmax(0, 1fr);
  gap: 0.5rem;
}

.client-directory-credit-fields .form-input {
  min-width: 0;
}

@media (max-width: 767px) {
  .client-directory-actions {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    width: 100%;
  }

  .client-directory-actions .btn,
  .client-directory-search .btn {
    width: 100%;
    min-width: 0;
    white-space: normal;
    text-align: center;
  }

  .client-directory-search .form-input {
    flex-basis: 100%;
  }

  .client-directory-identity {
    flex: 1 1 auto;
  }

  .client-directory-mobile-card .btn {
    white-space: normal;
    overflow-wrap: anywhere;
  }

  .client-directory-identity p,
  .client-directory-details > div > :last-child {
    overflow-wrap: anywhere;
  }

  .client-directory-details > div {
    min-width: 0;
    gap: 0.5rem;
  }

  .client-directory-details > div > :last-child {
    min-width: 0;
    max-width: 70%;
    text-align: right;
    white-space: normal;
  }
}

/* FIT12 activity inputs: keep all workbook activity fields usable at each width. */
.fit12-activity-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem;
  align-items: end;
}

.fit12-activity-form {
  container: fit12-activity-form / inline-size;
}

.fit12-activity-row > .form-group:first-child {
  grid-column: 1 / -1;
}

.fit12-activity-row > .form-group:nth-child(5) {
  grid-column: span 2;
}

.fit12-activity-row > .form-group {
  min-width: 0;
}

.fit12-activity-row .form-input,
.fit12-activity-row .form-select {
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
}

.fit12-activity-row .remove-act-btn {
  grid-column: 3;
  justify-self: end;
}

@container fit12-activity-form (min-width: 720px) {
  .fit12-activity-row {
    grid-template-columns: minmax(0, 1.5fr) repeat(3, minmax(5rem, 0.9fr)) minmax(0, 1.3fr) auto;
  }

  .fit12-activity-row > .form-group:first-child {
    grid-column: auto;
  }

  .fit12-activity-row > .form-group:nth-child(5) {
    grid-column: auto;
  }

  .fit12-activity-row .remove-act-btn {
    grid-column: auto;
  }
}

@media (min-width: 768px) {
  .mobile-card-list {
    display: none !important;
  }
}

@media (max-width: 767px) {
  /* When mobile card list is present in the parent container, hide the desktop table */
  .card:has(.mobile-card-list) .desktop-table-container,
  .desktop-table-container.has-mobile-cards {
    display: none !important;
  }

  .mobile-w-full {
    width: 100% !important;
    text-align: center !important;
    justify-content: center !important;
    display: flex !important;
  }
}

/* Keep mobile dropdown menus inside the control width instead of using oversized native popups. */
.responsive-select-picker { display:none; }
@media (max-width:767px) {
  select.mobile-native-select {
    position:absolute !important;
    width:1px !important;
    height:1px !important;
    min-height:1px !important;
    margin:0 !important;
    padding:0 !important;
    opacity:0 !important;
    pointer-events:none !important;
  }
  .responsive-select-picker {
    display:block;
    position:relative;
    width:100%;
    min-width:0;
    max-width:100%;
    box-sizing:border-box;
    z-index:5;
  }
  .responsive-select-trigger {
    display:flex;
    width:100%;
    min-width:0;
    min-height:42px;
    align-items:center;
    justify-content:space-between;
    gap:0.65rem;
    box-sizing:border-box;
    padding:0.55rem 0.875rem;
    border:1px solid var(--border);
    border-radius:var(--radius-sm);
    background:var(--surface);
    color:var(--text);
    font:inherit;
    font-size:16px;
    text-align:left;
    box-shadow:var(--shadow-xs);
  }
  .responsive-select-trigger:focus-visible,
  .responsive-select-option:focus-visible {
    outline:3px solid var(--brand-soft);
    outline-offset:1px;
  }
  .responsive-select-current { min-width:0; overflow-wrap:anywhere; }
  .responsive-select-arrow { flex:0 0 auto; color:var(--text-muted); font-size:1.1rem; line-height:1; }
  .responsive-select-options {
    display:grid;
    gap:0.2rem;
    width:100%;
    max-height:min(40vh, 240px);
    overflow-y:auto;
    box-sizing:border-box;
    margin-top:0.35rem;
    padding:0.3rem;
    border:1px solid var(--border);
    border-radius:var(--radius-sm);
    background:var(--surface);
    box-shadow:var(--shadow-md);
  }
  .responsive-select-options[hidden] { display:none; }
  .responsive-select-option {
    display:block;
    width:100%;
    min-width:0;
    padding:0.6rem 0.65rem;
    border:0;
    border-radius:var(--radius-sm);
    background:transparent;
    color:var(--text);
    font:inherit;
    font-size:0.9rem;
    text-align:left;
    white-space:normal;
    overflow-wrap:anywhere;
  }
  .responsive-select-option[aria-selected="true"] { background:var(--brand-soft); color:var(--brand-deep); font-weight:700; }
  .responsive-select-option:disabled { color:var(--text-muted); opacity:0.7; }
  .workspace-select-wrapper.mobile-select-enhanced .workspace-chevron { display:none; }
  .workspace-select-wrapper .workspace-select-picker {
    width:min(220px, calc(100vw - 2rem));
  }
  .workspace-select-picker .responsive-select-trigger {
    min-height:36px;
    padding:0.35rem 0.65rem;
    color:var(--brand-deep);
    font-size:0.8125rem;
    font-weight:600;
  }
  .workspace-select-picker .responsive-select-options {
    position:absolute;
    top:calc(100% + 0.35rem);
    right:0;
    left:auto;
    width:min(220px, calc(100vw - 2rem));
    margin-top:0;
  }
}

/* Empty States */
.empty-state {
  text-align: center;
  padding: 3rem 1.5rem;
  border-radius: var(--radius-md);
  background-color: var(--surface);
  border: 1px dashed var(--border-strong);
}

.empty-state-title {
  font-size: 1.0625rem;
  font-weight: 700;
  color: var(--brand-deep);
  margin-top: 0.5rem;
}

.empty-state-desc {
  font-size: 0.875rem;
  color: var(--text-muted);
  max-width: 24rem;
  margin: 0.35rem auto 1.25rem;
}

/* In-app notifications */
.notification-menu { position: relative; flex: 0 0 auto; }
.notification-bell {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 36px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--brand-deep);
  cursor: pointer;
}
.notification-bell:hover, .notification-bell[aria-expanded="true"] { background: var(--brand-soft); border-color: var(--border-strong); }
.notification-bell svg { width: 19px; height: 19px; }
.notification-count {
  position: absolute;
  top: -6px;
  right: -6px;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  border: 2px solid var(--page-bg);
  border-radius: var(--radius-full);
  background: var(--err);
  color: #fff;
  font-size: 0.625rem;
  font-weight: 800;
  line-height: 14px;
  text-align: center;
}
.notification-popover {
  position: fixed;
  z-index: 40;
  top: 0;
  left: 0;
  width: min(370px, calc(100vw - 24px));
  max-width: calc(100vw - 24px);
  box-sizing: border-box;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
  box-shadow: var(--shadow-lg);
}
.notification-popover[hidden] { display: none !important; }
.notification-popover-header, .notification-view-all {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.8rem 1rem;
}
.notification-popover-header { border-bottom: 1px solid var(--border-light); color: var(--brand-deep); }
.notification-push-actions { display: flex; flex-direction: column; align-items: flex-start; gap: 0.3rem; padding: 0.55rem 1rem; border-bottom: 1px solid var(--border-light); }
.notification-push-toggle { padding: 0; border: 0; background: transparent; color: var(--brand-primary); font: inherit; font-size: 0.75rem; font-weight: 700; cursor: pointer; text-align: left; }
.notification-push-toggle:disabled { color: var(--text-muted); cursor: default; }
.notification-push-status { color: var(--text-muted); font-size: 0.6875rem; line-height: 1.35; }
.notification-mark-all { border: 0; background: transparent; color: var(--brand-primary); font: inherit; font-size: 0.75rem; font-weight: 700; cursor: pointer; }
.notification-popover-list { max-height: min(420px, 65vh); overflow-y: auto; }
.notification-item {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  width: 100%;
  padding: 0.8rem 1rem;
  border: 0;
  border-bottom: 1px solid var(--border-light);
  background: var(--surface);
  color: var(--text);
  text-align: left;
  font: inherit;
  cursor: pointer;
}
.notification-item:hover, .notification-page-open:hover { background: var(--surface-subtle); }
.notification-item.is-unread, .notification-page-item.is-unread { background: var(--brand-subtle); }
.notification-unread-dot { flex: 0 0 8px; width: 8px; height: 8px; margin-top: 0.4rem; border-radius: 50%; background: transparent; }
.is-unread > .notification-unread-dot { background: var(--brand-primary); }
.notification-item-copy, .notification-page-copy { display: grid; gap: 0.22rem; min-width: 0; }
.notification-item-copy strong, .notification-page-copy strong { color: var(--brand-deep); font-size: 0.8125rem; }
.notification-item-copy > span, .notification-page-copy > span { color: var(--text-secondary); font-size: 0.75rem; line-height: 1.4; overflow-wrap: anywhere; }
.notification-item-copy time, .notification-page-copy time { color: var(--text-muted); font-size: 0.6875rem; }
.notification-empty { padding: 1.4rem 1rem; color: var(--text-muted); font-size: 0.8125rem; text-align: center; }
.notification-view-all { justify-content: center; border-top: 1px solid var(--border-light); color: var(--brand-primary); font-size: 0.8125rem; font-weight: 700; text-decoration: none; }
.notification-view-all:hover { background: var(--brand-subtle); }
.notification-page-list { padding: 0.25rem 1.25rem; }
.notification-page-item { border-bottom: 1px solid var(--border-light); }
.notification-page-item:last-child { border-bottom: 0; }
.notification-page-open { display: flex; align-items: flex-start; gap: 0.75rem; width: 100%; padding: 1rem 0.75rem; border: 0; background: transparent; color: inherit; text-align: left; font: inherit; cursor: pointer; }
.notification-page-copy { flex: 1; }
.notification-open-arrow { color: var(--text-muted); font-size: 1.4rem; line-height: 1; }
@media (max-width: 440px) {
  .notification-bell { width: 36px; }
  .notification-page-list { padding: 0.15rem 0.5rem; }

  .app-header { padding: 0 0.5rem; gap: 0.25rem; }
  .workspace-select-wrapper .workspace-select-picker,
  .workspace-select { width: 120px; max-width: 120px; }
  .header-context > .status-badge { max-width: 120px; }
}

@media (max-width: 400px) {
  .header-brand-mobile span { display: none; }
  .btn-hamburger { width: 34px; height: 34px; margin-right: 0.35rem; }
}

/* Client support messaging */
.support-page-header { margin-bottom: 1.25rem; }
.support-client-layout,
.support-staff-layout {
  display: grid;
  grid-template-columns: minmax(17rem, 0.85fr) minmax(0, 1.5fr);
  align-items: start;
  gap: 1rem;
}
.support-client-layout > *,
.support-staff-layout > *,
.support-conversation-detail { min-width: 0; }
.support-conversation-detail { margin-top: 1rem; }
.support-form,
.support-reply-form { display: grid; gap: 0.6rem; }
.support-form .btn,
.support-reply-form .btn { justify-self: start; }
.support-empty-state { padding: 2.5rem 1rem; text-align: center; }
.support-empty-state h3 { margin-bottom: 0.4rem; }
.support-empty-state p { margin: 0 auto; max-width: 28rem; color: var(--text-muted); font-size: 0.875rem; }
.support-thread-list { display: grid; gap: 0.625rem; min-width: 0; }
.support-thread-link {
  display: grid;
  gap: 0.35rem;
  min-width: 0;
  padding: 0.8rem;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
}
.support-thread-link:hover,
.support-thread-link.is-selected { border-color: var(--brand-primary); background: var(--brand-subtle); }
.support-thread-heading { display: flex; justify-content: space-between; align-items: flex-start; gap: 0.5rem; min-width: 0; }
.support-thread-heading strong,
.support-thread-subject,
.support-thread-preview { min-width: 0; overflow-wrap: anywhere; }
.support-thread-meta { color: var(--text-muted); font-size: 0.75rem; }
.support-thread-preview { color: var(--text-secondary); font-size: 0.8125rem; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.support-message-list { display: grid; gap: 0.75rem; max-height: 55vh; overflow-y: auto; padding: 0.25rem 0 1rem; }
.support-message { max-width: min(88%, 46rem); padding: 0.75rem 0.875rem; border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--surface-subtle); min-width: 0; }
.support-message.is-own { justify-self: end; border-color: var(--brand-soft-hover); background: var(--brand-subtle); }
.support-message.is-staff { justify-self: start; }
.support-message-meta { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.25rem 0.75rem; margin-bottom: 0.35rem; color: var(--text-muted); font-size: 0.75rem; }
.support-message-meta strong { color: var(--brand-deep); }
.support-message p { margin: 0; overflow-wrap: anywhere; white-space: normal; }
.support-detail-header { align-items: flex-start; }
.support-closed-note { margin-top: 0.75rem; padding: 0.75rem; border-radius: var(--radius-sm); background: var(--surface-subtle); color: var(--text-muted); font-size: 0.875rem; }

/* Automatic, dismissible PWA install prompt. Native installation still needs a user click. */
.install-app-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: rgba(31, 17, 40, 0.58);
}
.install-app-modal[hidden] { display: none !important; }
.install-app-dialog {
  position: relative;
  width: min(100%, 27rem);
  padding: 2rem 1.5rem 1.5rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-lg);
  text-align: center;
}
.install-app-mark { width: 4rem; height: 4rem; margin: 0 auto 0.85rem; padding: 0.2rem; border: 2px solid var(--brand-soft); border-radius: 50%; background: #fff; }
.install-app-mark img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }
.install-app-dialog h2 { margin: 0 0 0.5rem; font-size: 1.4rem; }
.install-app-message { margin: 0 auto; max-width: 22rem; color: var(--text-secondary); font-size: 0.9rem; }
.install-app-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.625rem; margin-top: 1.25rem; }
.install-app-actions [hidden] { display: none !important; }
.install-app-close { position: absolute; top: 0.65rem; right: 0.7rem; width: 2rem; height: 2rem; border: 0; border-radius: 50%; background: transparent; color: var(--text-muted); font-size: 1.4rem; cursor: pointer; }
.install-app-close:hover { background: var(--surface-subtle); color: var(--brand-deep); }

@media (max-width: 767px) {
  .support-client-layout,
  .support-staff-layout { grid-template-columns: minmax(0, 1fr); }
  .support-thread-list { max-height: 42vh; overflow-y: auto; }
  .support-message { max-width: 96%; }
  .support-message-list { max-height: 48vh; }
  .install-app-dialog { padding: 1.75rem 1.15rem 1.25rem; }
}

/* --- 6. PRINT & PDF DOCUMENT STYLES --- */
@media print {
  body {
    background-color: #FFFFFF !important;
    color: #1A0826 !important;
    padding: 0 !important;
    font-size: 11pt !important;
  }

  .app-sidebar,
  .app-header,
  .mobile-bottom-nav,
  .print-actions-bar,
  .no-print {
    display: none !important;
  }

  .main-content {
    max-width: 100% !important;
    padding: 0 !important;
  }

  .card, .table-container, .print-container {
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
  }

  .data-table th, .print-table th {
    background-color: #F2E5F7 !important;
    color: #3D0C5C !important;
  }

  tr {
    page-break-inside: avoid;
  }

@page {
    margin: 1.5cm;
    size: A4 portrait;
  }
}

/* Mobile installed-app intro screen. */
.pwa-launch-intro {
  position: fixed;
  z-index: 20000;
  inset: 0;
  display: grid;
  place-items: center;
  min-height: 100vh;
  min-height: 100dvh;
  overflow: hidden;
  background: #fbf7ff;
  opacity: 0;
  transition: opacity 380ms ease;
}

.pwa-launch-intro[hidden] {
  display: none;
}

.pwa-launch-intro.is-visible {
  opacity: 1;
}

.pwa-launch-intro.is-leaving {
  opacity: 0;
  pointer-events: none;
}

.pwa-launch-intro-content {
  display: flex;
  width: 100%;
  min-height: 260px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.pwa-launch-intro-logo {
  display: block;
  width: clamp(176px, 59vw, 224px);
  height: auto;
  aspect-ratio: 1;
  object-fit: contain;
  filter: drop-shadow(0 10px 22px rgba(56, 13, 61, 0.12));
  opacity: 0;
  transform: scale(0.92) translateY(8px);
  transition: opacity 420ms ease, transform 520ms cubic-bezier(0.2, 0.75, 0.25, 1);
}

.pwa-launch-intro.is-visible .pwa-launch-intro-logo {
  opacity: 1;
  transform: scale(1) translateY(0);
}

.pwa-launch-intro-tagline {
  margin: 18px 0 0;
  color: #380d3d;
  font-family: var(--font-body, sans-serif);
  font-size: 0.64rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  line-height: 1.4;
  text-align: center;
  text-transform: uppercase;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 360ms ease 180ms, transform 360ms ease 180ms;
}

.pwa-launch-intro.is-visible .pwa-launch-intro-tagline {
  opacity: 1;
  transform: translateY(0);
}

.pwa-launch-intro-progress {
  position: relative;
  display: block;
  width: 34px;
  height: 2px;
  margin-top: 15px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(124, 58, 237, 0.16);
  opacity: 0;
  transition: opacity 300ms ease 320ms;
}

.pwa-launch-intro-progress::after {
  position: absolute;
  inset: 0 auto 0 0;
  width: 18px;
  border-radius: inherit;
  background: #7c3aed;
  content: "";
  animation: pwa-intro-progress 900ms ease-in-out infinite alternate;
}

.pwa-launch-intro.is-visible .pwa-launch-intro-progress {
  opacity: 1;
}

@keyframes pwa-intro-progress {
  from { transform: translateX(0); }
  to { transform: translateX(16px); }
}

@media (prefers-reduced-motion: reduce) {
  .pwa-launch-intro,
  .pwa-launch-intro-logo,
  .pwa-launch-intro-tagline,
  .pwa-launch-intro-progress {
    transition-duration: 1ms !important;
    animation-duration: 1ms !important;
  }
}

.password-input-wrap {
  position: relative;
}

.password-input-wrap .form-input {
  padding-right: 3.25rem;
}

.signup-form .password-input-wrap .form-input {
  padding-right: 3.25rem;
}

.password-visibility-toggle {
  position: absolute;
  top: 50%;
  right: 0.45rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  padding: 0;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transform: translateY(-50%);
}

.password-visibility-toggle:hover {
  background: var(--surface-subtle);
  color: var(--brand-primary);
}

.password-visibility-toggle:focus-visible {
  outline: 2px solid var(--border-focus);
  outline-offset: 2px;
}

.password-visibility-toggle svg {
  width: 1.2rem;
  height: 1.2rem;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.password-visibility-toggle svg[hidden] {
  display: none;
}

.password-match-status {
  display: block;
  min-height: 1.1rem;
  margin-top: 0.35rem;
  color: var(--text-muted);
  font-size: 0.75rem;
  line-height: 1.4;
}

.password-match-status.is-match {
  color: var(--ok);
}

.password-match-status.is-mismatch {
  color: var(--err);
}

.password-input-wrap .form-input.password-match-valid {
  border-color: var(--ok);
}

.password-input-wrap .form-input.password-match-invalid {
  border-color: var(--err);
}

/* ==========================================================================
   7. CALM SHELL + SHARED PAGE PATTERN (UI contract)
   Loaded last so these quieter defaults win over the older component rules.
   ========================================================================== */

/* --- Focus: always visible for keyboard users --- */
a:focus-visible,
button:focus-visible,
summary:focus-visible,
select:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--brand-primary);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}
#main-content:focus { outline: none; }

.skip-link {
  position: absolute;
  left: 0.75rem;
  top: -4rem;
  z-index: 10001;
  padding: 0.5rem 0.875rem;
  border-radius: var(--radius-sm);
  background: var(--brand-deep);
  color: #fff;
  font-weight: 600;
  font-size: 0.875rem;
}
.skip-link:focus { top: 0.75rem; color: #fff; }

/* --- Quieter base surfaces --- */
.card,
.summary-panel,
.kpi-card,
.table-container {
  border-color: var(--border-light);
  box-shadow: none;
}
.alert { box-shadow: none; }
.alert-warning {
  background-color: var(--warn-bg);
  color: var(--warn-text);
  border: 1px solid var(--warn-border);
}
.alert-close {
  flex: none;
  border: 0;
  background: transparent;
  color: inherit;
  opacity: 0.7;
  cursor: pointer;
  font-size: 0.875rem;
  line-height: 1;
  padding: 0.25rem;
}
.alert-close:hover { opacity: 1; }
.data-table th {
  text-transform: none;
  letter-spacing: 0;
  font-size: 0.8125rem;
  background-color: transparent;
}
.form-input, .form-select, .form-textarea { box-shadow: none; }

/* Legacy eyebrow / kicker labels: decorative only, so keep them out of the way. */
.main-content p.page-category,
.main-content span.page-category { display: none; }
.main-content div.page-category {
  text-transform: none;
  letter-spacing: 0;
  font-weight: 500;
  color: var(--text-muted);
}
.page-title { font-size: 1.5rem; font-weight: 700; }
@media (min-width: 768px) { .page-title { font-size: 1.75rem; } }
.page-header-row { border-bottom: 0; padding-bottom: 0; }
.metric-strip-label,
.kpi-label { text-transform: none; letter-spacing: 0; font-size: 0.8125rem; }

/* --- App shell --- */
.app-sidebar {
  border-right: 1px solid var(--border-light);
  padding: 1.25rem 0.875rem 1rem;
}
.brand-badge {
  background: none;
  box-shadow: none;
  color: var(--brand-deep);
  padding: 0.25rem 0.5rem;
  margin-bottom: 1.75rem;
  gap: 0.625rem;
}
.brand-badge:hover { color: var(--brand-deep); }
.brand-badge .brand-logo-img {
  width: 36px;
  height: 36px;
  border: 1px solid var(--border-light);
  box-shadow: none;
}
.brand-title {
  font-size: 1rem;
  letter-spacing: -0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sidebar-nav { gap: 2px; }
.nav-link {
  border-radius: var(--radius-md);
  padding: 0.55rem 0.75rem;
  font-size: 0.9375rem;
  color: var(--text-secondary);
}
.nav-link:hover { background-color: var(--surface-subtle); color: var(--brand-deep); }
.nav-link.active { background-color: var(--brand-soft); color: var(--brand-deep); }
.nav-link.active .nav-icon { stroke: var(--brand-primary); }
.nav-link-quiet { font-size: 0.875rem; color: var(--text-muted); }
.sidebar-footer { border-top: 0; padding-top: 0.75rem; }

.app-header {
  background-color: rgba(251, 247, 253, 0.92);
  border-bottom: 1px solid var(--border-light);
  gap: 0.75rem;
  padding: 0 1rem;
}
@media (min-width: 768px) { .app-header { padding: 0 1.75rem; } }
.header-context { margin-left: auto; gap: 0.5rem; min-width: 0; }
.header-brand-mobile { min-width: 0; color: var(--brand-deep); }
.header-brand-mobile span { overflow: hidden; text-overflow: ellipsis; }

/* Role switcher: a small pill, only rendered for multi-role users. */
.workspace-select {
  min-height: 34px;
  border-radius: var(--radius-full);
  border-color: var(--border-light);
  background-color: var(--surface);
  box-shadow: none;
  padding: 0.25rem 2rem 0.25rem 0.875rem;
}
.workspace-select-wrapper .workspace-select-picker { min-width: 0; }

.notification-bell {
  width: 38px;
  height: 38px;
  border-color: transparent;
  border-radius: var(--radius-full);
  background: transparent;
  color: var(--text-secondary);
}
.notification-bell:hover,
.notification-bell[aria-expanded="true"] { background: var(--surface-active); border-color: transparent; color: var(--brand-deep); }
.notification-count { top: -2px; right: -2px; }

/* User menu */
.user-menu-trigger {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.2rem 0.5rem 0.2rem 0.2rem;
  border-radius: var(--radius-full);
  color: var(--brand-deep);
  font-size: 0.875rem;
  font-weight: 600;
  min-height: 38px;
}
.user-menu-trigger:hover,
.user-menu[open] > .user-menu-trigger { background: var(--surface-active); }
.avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  flex: none;
  border-radius: 50%;
  background: var(--brand-soft);
  color: var(--brand-primary);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}
.user-menu-name {
  max-width: 11rem;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.user-menu-chevron { width: 14px; height: 14px; color: var(--text-muted); flex: none; }
@media (max-width: 639px) {
  .user-menu-name, .user-menu-chevron { display: none; }
  .user-menu-trigger { padding: 0.2rem; }
}
.user-menu .menu-panel { min-width: 14rem; }
.menu-head {
  display: grid;
  gap: 0.1rem;
  padding: 0.5rem 0.75rem 0.625rem;
  margin-bottom: 0.25rem;
  border-bottom: 1px solid var(--border-light);
  min-width: 0;
}
.menu-head strong { color: var(--brand-deep); font-size: 0.875rem; overflow-wrap: anywhere; }
.menu-head span { color: var(--text-muted); font-size: 0.75rem; overflow-wrap: anywhere; }
.menu-icon { width: 18px; height: 18px; flex: none; color: var(--text-muted); }
.menu-panel .menu-danger { color: var(--err-text); }
.menu-panel .menu-danger .menu-icon { color: currentColor; }

/* Phone tab bar + "More" sheet */
.mobile-bottom-nav {
  border-top: 1px solid var(--border-light);
  box-shadow: none;
  background-color: rgba(255, 255, 255, 0.97);
}
.mobile-nav-btn {
  background: none;
  border: 0;
  cursor: pointer;
  font: inherit;
  font-size: 0.6875rem;
  min-width: 0;
  padding: 0 0.125rem;
}
.mobile-nav-btn span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mobile-nav-icon { width: 22px; height: 22px; stroke: currentColor; }
.mobile-drawer {
  top: auto;
  right: 0;
  width: auto;
  max-height: 80vh;
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  transform: translateY(100%);
  visibility: hidden;
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.25s;
}
.mobile-drawer.open { transform: translateY(0); visibility: visible; }
html.is-iphone .mobile-drawer { top: auto; }
.mobile-drawer-header { background: transparent; border-bottom: 0; padding: 1rem 1.25rem 0.25rem; color: var(--brand-deep); }
.mobile-drawer-body { padding: 0.5rem 0.75rem 1rem; }
.mobile-drawer .nav-link { min-height: 48px; }
@media (min-width: 840px) { .mobile-drawer, .mobile-drawer-backdrop { display: none; } }

.main-content { padding-top: 1.5rem; }
@media (min-width: 768px) { .main-content { padding-top: 2rem; } }

/* --- Page header --- */
.page-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1rem;
  margin: 0 0 1.5rem;
  min-width: 0;
}
.page-head h1 {
  margin: 0;
  min-width: 0;
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  overflow-wrap: anywhere;
}
@media (min-width: 768px) { .page-head h1 { font-size: 1.75rem; } }
.page-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}
.page-hint {
  max-width: 44rem;
  margin: -0.75rem 0 1.5rem;
  color: var(--text-secondary);
  font-size: 0.9375rem;
  line-height: 1.5;
}
.page-head .page-hint { flex-basis: 100%; order: 3; margin: -0.25rem 0 0; }
.section-title {
  margin: 0 0 0.875rem;
  font-size: 1.0625rem;
  font-weight: 700;
  color: var(--brand-deep);
  letter-spacing: -0.01em;
}

/* --- Sub-navigation tabs --- */
.subnav {
  display: flex;
  gap: 0.25rem;
  margin: -0.5rem 0 1.5rem;
  border-bottom: 1px solid var(--border-light);
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.subnav::-webkit-scrollbar { display: none; }
.subnav-item {
  flex: none;
  margin-bottom: -1px;
  padding: 0.625rem 0.875rem;
  border-bottom: 2px solid transparent;
  color: var(--text-secondary);
  font-size: 0.875rem;
  font-weight: 500;
  white-space: nowrap;
}
.subnav-item:hover { color: var(--brand-deep); }
.subnav-item.is-active {
  color: var(--brand-primary);
  border-bottom-color: var(--brand-primary);
  font-weight: 600;
}
.subnav-item:focus-visible { outline-offset: -2px; }

/* --- Menus (<details class="menu">) --- */
details.menu { position: relative; display: inline-block; }
details.menu > summary { list-style: none; cursor: pointer; user-select: none; }
details.menu > summary::-webkit-details-marker { display: none; }
details.menu > summary::marker { content: ''; }
details.menu > summary.btn::after {
  content: '';
  width: 0.4rem;
  height: 0.4rem;
  margin: -0.2rem 0 0 0.15rem;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(45deg);
  opacity: 0.7;
}
.menu-panel {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 60;
  display: grid;
  gap: 2px;
  min-width: 11rem;
  max-width: min(20rem, calc(100vw - 1.5rem));
  max-height: min(70vh, 32rem);
  overflow-y: auto;
  padding: 0.375rem;
  background: var(--surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  text-align: left;
}
details.menu:not([open]) > .menu-panel { display: none; }
.menu-panel > form { margin: 0; }
.menu-panel > a,
.menu-panel > button,
.menu-panel > form > button:not(.btn) {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  width: 100%;
  min-height: 38px;
  padding: 0.5rem 0.75rem;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 0.875rem;
  font-weight: 500;
  text-align: left;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
}
.menu-panel > a:hover,
.menu-panel > button:hover,
.menu-panel > form > button:not(.btn):hover,
.menu-panel > a:focus-visible,
.menu-panel > button:focus-visible,
.menu-panel > form > button:not(.btn):focus-visible {
  background: var(--surface-subtle);
  color: var(--brand-deep);
  outline-offset: -2px;
}
.menu-panel > a[aria-current="page"] { color: var(--brand-primary); font-weight: 600; }
.menu-panel hr { border: 0; border-top: 1px solid var(--border-light); margin: 0.25rem 0; }
.row-menu { flex: none; }

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  flex: none;
  padding: 0;
  border: 1px solid transparent;
  border-radius: var(--radius-full);
  background: transparent;
  color: var(--text-secondary);
  font-size: 1.125rem;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
}
.icon-btn:hover,
details[open] > summary.icon-btn { background: var(--surface-active); color: var(--brand-deep); }

/* --- Status chips --- */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.15rem 0.6rem;
  border: 1px solid transparent;
  border-radius: var(--radius-full);
  background: var(--surface-subtle);
  color: var(--text-secondary);
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1.4;
  white-space: nowrap;
}
.chip.is-ok { background: var(--ok-bg); color: var(--ok-text); }
.chip.is-warn { background: var(--warn-bg); color: var(--warn-text); }
.chip.is-bad { background: var(--err-bg); color: var(--err-text); }
.chip.is-muted { background: var(--surface-subtle); color: var(--text-muted); }
.chip.is-info { background: var(--brand-soft); color: var(--brand-deep); }
/* Chips used as filters (links / buttons) */
a.chip, button.chip {
  cursor: pointer;
  font: inherit;
  font-size: 0.8125rem;
  font-weight: 500;
  padding: 0.35rem 0.875rem;
  border-color: var(--border-light);
  background: var(--surface);
}
a.chip:hover, button.chip:hover { border-color: var(--border-strong); color: var(--brand-deep); }
a.chip.is-active, button.chip.is-active, a.chip[aria-current], button.chip[aria-pressed="true"] {
  background: var(--brand-deep);
  border-color: var(--brand-deep);
  color: #fff;
}

/* --- Big numbers --- */
.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 9.5rem), 1fr));
  gap: 0.75rem;
  margin: 0 0 1.5rem;
}
@media (max-width: 479px) { .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.stat {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  min-width: 0;
  padding: 1rem 1.125rem;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  background: var(--surface);
  color: inherit;
  text-decoration: none;
}
a.stat:hover { border-color: var(--border-strong); color: inherit; }
.stat-value {
  font-family: var(--font-display);
  font-size: 1.75rem;
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.02em;
  color: var(--brand-deep);
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}
.stat-label { font-size: 0.8125rem; color: var(--text-secondary); line-height: 1.35; }

/* --- Empty state --- */
.empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  padding: 2rem 1rem;
  text-align: center;
  color: var(--text-secondary);
}
.empty img { width: 72px; height: auto; opacity: 0.95; }
.empty p { margin: 0; max-width: 26rem; font-size: 0.9375rem; }

/* --- Needs attention list --- */
.todo { list-style: none; margin: 0; padding: 0; }
.todo > li {
  display: flex;
  align-items: center;
  gap: 0.875rem;
  min-width: 0;
  padding: 0.75rem 0;
  border-top: 1px solid var(--border-light);
}
.todo > li:first-child { border-top: 0; }
.todo-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  min-width: 2.25rem;
  height: 2.25rem;
  padding: 0 0.5rem;
  border-radius: var(--radius-full);
  background: var(--brand-soft);
  color: var(--brand-deep);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.todo-text { flex: 1; min-width: 0; color: var(--text); overflow-wrap: anywhere; }
.todo > li > .btn { flex: none; }

/* Small button (kept here too in case older rules change) */
.btn-sm { min-height: 32px; padding: 0.25rem 0.75rem; font-size: 0.8125rem; }

/* --- Error page --- */
.error-page { max-width: 30rem; margin: 2rem auto; }
.error-page h1 { font-size: 1.5rem; margin: 0; }
.error-page .page-actions { justify-content: center; }

/* Small "back" link above page titles */
.back-link { display: inline-flex; align-items: center; gap: .3rem; margin-bottom: .5rem; color: var(--text-muted); font-size: .875rem; font-weight: 600; text-decoration: none; }
.back-link:hover { color: var(--brand-primary); }
