/* Design tokens: Figma "ArunFit Admin Console · Redesign" (Theme / Dark). One brand green; status colours only for status. */
:root {
  --bg-base: #0b0f14;
  --bg-surface: #11161d;
  --bg-raised: #171d26;
  --bg-hover: #1c2430;
  --bg-card: var(--bg-surface);
  --bg-card-hover: var(--bg-hover);
  --border-color: #232b36;
  --border-subtle: #1a212b;
  --text-primary: #e9eef4;
  --text-secondary: #9aa6b5;
  --text-muted: #667181;
  --brand: #34d399;
  --brand-strong: #6ee7b7;
  --brand-soft: #123326;
  --on-brand: #06281c;
  --warn-soft: #33280e;
  --danger-soft: #361a1c;
  --info-soft: #14243a;
  /* Older names, still used by inline styles in the page scripts */
  --accent-emerald: #34d399;
  --accent-teal: #2dd4bf;
  --accent-cyan: #22d3ee;
  --accent-blue: #60a5fa;
  --accent-amber: #fbbf24;
  --accent-rose: #f87171;
  --accent-purple: #a78bfa;
  --series-1: #3987e5;
  --series-2: #d95926;
  --series-3: #199e70;
  --series-4: #c98500;
  --series-5: #d55181;
  --series-6: #008300;
  --chart-grid: #1e2631;
  --chart-surface: #11161d;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 14px;
  --shadow-card: 0 1px 2px rgba(0, 0, 0, 0.18), 0 8px 24px -8px rgba(0, 0, 0, 0.12);
  --shadow-pop: 0 12px 32px rgba(0, 0, 0, 0.45);
  --focus-ring: 0 0 0 3px rgba(52, 211, 153, 0.22);
  --shadow-glow: var(--shadow-card);
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: 'Plus Jakarta Sans', 'PingFang SC', 'Microsoft YaHei', 'Noto Sans SC', 'Kantumruy Pro', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 13px;
  background: var(--bg-base);
  color: var(--text-primary);
  display: flex;
  height: 100vh;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}
:focus-visible { outline: none; box-shadow: var(--focus-ring); }
.icon { width: 18px; height: 18px; flex-shrink: 0; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; display: inline-block; vertical-align: middle; }
/* Sidebar */
.sidebar {
  width: 256px;
  background: var(--bg-surface);
  border-right: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
}
.logo-box {
  padding: 20px 24px 12px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.logo-icon {
  width: 32px;
  height: 32px;
  display: block;
  flex-shrink: 0;
}
.logo-text h1 { font-size: 16px; font-weight: 800; color: var(--text-primary); letter-spacing: -0.3px; line-height: 1.25; }
.logo-text p { font-size: 12px; color: var(--text-muted); font-weight: 500; }
.nav-list {
  list-style: none;
  padding: 4px 16px 16px;
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.nav-item {
  padding: 8px 12px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
  user-select: none;
}
.nav-item:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}
.nav-item.active {
  background: var(--brand-soft);
  color: var(--brand-strong);
}
.nav-icon { display: inline-flex; width: 18px; justify-content: center; color: var(--text-secondary); }
.nav-item:hover .nav-icon { color: var(--text-primary); }
.nav-item.active .nav-icon { color: var(--brand); }
.nav-section {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 600;
  letter-spacing: 0.6px;
  padding: 14px 12px 4px;
}
/* Main Content */
.main-wrapper {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-width: 0;
}
.top-bar {
  height: 60px;
  border-bottom: 1px solid var(--border-subtle);
  background: var(--bg-base);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 32px;
  gap: 16px;
}
.crumbs { display: flex; align-items: center; gap: 6px; min-width: 0; color: var(--text-muted); font-size: 13px; }
.crumbs .icon { width: 14px; height: 14px; }
.crumbs:has(#page-section:empty) .crumb-sep { display: none; }
.top-title { font-size: 13px; font-weight: 600; display: flex; align-items: center; gap: 6px; min-width: 0; color: var(--text-primary); }
.top-actions { display: flex; align-items: center; gap: 12px; }

/* Language Selector */
.lang-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  height: 34px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 0 10px;
  color: var(--text-secondary);
}
.lang-select {
  background: transparent;
  border: none;
  color: var(--text-primary);
  font-size: 12.5px;
  font-weight: 500;
  outline: none;
  cursor: pointer;
  font-family: inherit;
}
.lang-select option {
  background: var(--bg-surface);
  color: var(--text-primary);
}

.btn {
  height: 34px;
  padding: 0 14px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-family: inherit;
  text-decoration: none;
  white-space: nowrap;
  flex-shrink: 0;
  user-select: none;
}
.btn-primary {
  background: var(--brand);
  color: var(--on-brand);
}
.btn-primary:hover { background: var(--brand-strong); }
.btn-outline {
  background: var(--bg-surface);
  border-color: var(--border-color);
  color: var(--text-primary);
}
.btn-outline:hover {
  background: var(--bg-hover);
  border-color: #2e3846;
}
.btn-danger {
  background: var(--danger-soft);
  border-color: rgba(248, 113, 113, 0.3);
  color: var(--accent-rose);
}
.btn-danger:hover {
  background: var(--accent-rose);
  color: #2a0d0d;
}
.btn-sm {
  height: 30px;
  padding: 0 11px;
  font-size: 12px;
}
.btn-2fa, .btn-soft { background: var(--brand-soft); border-color: transparent; color: var(--brand); }
.btn-2fa:hover, .btn-soft:hover { background: #164030; border-color: transparent; }

.content-area {
  flex: 1;
  padding: 28px 32px 40px;
  overflow-y: auto;
}
/* Stat Cards Grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}
.stat-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  position: relative;
  min-width: 0;
}
.stat-label { font-size: 13px; color: var(--text-secondary); font-weight: 500; display: flex; align-items: center; gap: 8px; }
.stat-chip { width: 28px; height: 28px; border-radius: 8px; background: var(--bg-raised); display: inline-flex; align-items: center; justify-content: center; color: var(--text-secondary); flex-shrink: 0; }
.stat-chip .icon { width: 16px; height: 16px; }
.stat-val { font-size: 28px; font-weight: 700; color: var(--text-primary); letter-spacing: -0.5px; line-height: 1.2; }
.stat-sub { font-size: 12px; color: var(--text-muted); }
.stat-sub:empty { display: none; }
/* Compact record tiles: icon, label + note, number on the right */
.stats-grid.is-compact { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.stat-card.is-compact { flex-direction: row; align-items: center; gap: 12px; padding: 16px 20px; }
.stat-card.is-compact .stat-chip { width: 36px; height: 36px; border-radius: 10px; }
.stat-card.is-compact .stat-chip .icon { width: 18px; height: 18px; }
.stat-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.stat-card.is-compact .stat-val { font-size: 20px; }
/* Tables & Cards */
.card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  padding: 20px;
  margin-bottom: 24px;
}
.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  flex-wrap: wrap;
  gap: 12px;
}
.card-title { font-size: 15px; font-weight: 600; color: var(--text-primary); display: flex; align-items: center; gap: 8px; }
.filter-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.search-input, .select-input {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  height: 36px;
  padding: 0 12px;
  font-size: 13px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.search-input::placeholder, .form-input::placeholder { color: var(--text-muted); }
.search-input:focus, .select-input:focus { border-color: var(--brand); box-shadow: var(--focus-ring); }
.search-input {
  min-width: 300px;
  padding-left: 36px;
  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='%23667181' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cpath d='m21 21-4.3-4.3'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: 12px center;
}
.select-input { cursor: pointer; }
.table-container { width: 100%; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; text-align: left; font-size: 13px; }
th {
  padding: 10px 14px;
  background: var(--bg-raised);
  color: var(--text-muted);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.4px;
  border-bottom: 1px solid var(--border-subtle);
  white-space: nowrap;
}
td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-primary);
  vertical-align: middle;
  font-variant-numeric: tabular-nums;
}
tbody tr:last-child td { border-bottom: none; }
tr:hover td { background: var(--bg-hover); }
/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 2px 8px;
  border-radius: 9999px;
  font-size: 12px;
  font-weight: 500;
  line-height: 18px;
  white-space: nowrap;
  background: var(--bg-raised);
  color: var(--text-secondary);
}
.badge::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex-shrink: 0; }
.badge-success { background: var(--brand-soft); color: var(--brand); }
.badge-warning { background: var(--warn-soft); color: var(--accent-amber); }
.badge-danger { background: var(--danger-soft); color: var(--accent-rose); }
.badge-info, .badge-blue { background: var(--info-soft); color: var(--accent-blue); }
.badge-cyan { background: rgba(34, 211, 238, 0.12); color: var(--accent-cyan); }
.badge-teal { background: rgba(45, 212, 191, 0.12); color: var(--accent-teal); }
.badge-purple { background: rgba(167, 139, 250, 0.12); color: var(--accent-purple); }
/* Page header inside the content area */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 24px; }
.page-head h2 { font-size: 22px; font-weight: 700; line-height: 30px; color: var(--text-primary); }
.page-head p { font-size: 12px; color: var(--text-muted); margin-top: 4px; }
.page-head-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
/* Segmented control (date range) */
.segmented { display: inline-flex; gap: 2px; padding: 3px; border-radius: var(--radius-sm); background: var(--bg-surface); border: 1px solid var(--border-subtle); }
.segmented button { border: none; background: transparent; color: var(--text-secondary); font: inherit; font-size: 12px; padding: 5px 12px; border-radius: 6px; cursor: pointer; }
.segmented button:hover { color: var(--text-primary); }
.segmented button.active { background: var(--bg-raised); color: var(--text-primary); font-weight: 600; }
/* Member list */
.member-cell { display: flex; align-items: center; gap: 12px; min-width: 0; }
.member-avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--bg-raised); display: inline-flex; align-items: center; justify-content: center; font-weight: 600; font-size: 13px; flex-shrink: 0; }
.member-sub { font-size: 12px; color: var(--text-muted); }

/* Modal */
.modal-overlay {
  position: fixed; top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(5, 8, 12, 0.72);
  backdrop-filter: blur(4px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 999;
  padding: 20px;
}
.modal-overlay.open { display: flex; }
.modal-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  width: 520px;
  max-width: 95vw;
  max-height: 90vh;
  overflow-y: auto;
  padding: 24px;
  box-shadow: var(--shadow-pop);
}
.modal-title { font-size: 17px; font-weight: 700; margin-bottom: 16px; display: flex; align-items: center; gap: 8px; }
.form-group { margin-bottom: 14px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-label { display: block; font-size: 12px; font-weight: 600; color: var(--text-secondary); margin-bottom: 6px; }
.form-input {
  width: 100%;
  background: var(--bg-base);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  padding: 9px 12px;
  font-size: 13px;
  font-family: inherit;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.form-input:focus { border-color: var(--brand); box-shadow: var(--focus-ring); outline: none; }
.form-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 22px; }

/* Upload Drag & Drop Dropzone */
.dropzone {
  border: 1.5px dashed var(--border-color);
  background: var(--bg-raised);
  border-radius: var(--radius-sm);
  padding: 16px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  position: relative;
}
.dropzone:hover {
  border-color: var(--brand);
}
.dropzone.drag-active {
  border-color: var(--brand);
  background: var(--brand-soft);
}
.dropzone-text {
  font-size: 12.5px;
  color: var(--text-secondary);
}
.upload-preview-box {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 10px;
}
.upload-preview-img {
  width: 60px;
  height: 60px;
  border-radius: 8px;
  object-fit: cover;
  border: 1px solid var(--border-color);
}

/* Multi-select & Batch Action Bar */
.batch-action-bar {
  display: none;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 8px 8px 16px;
  margin: 10px 20px 0 20px;
  background: var(--bg-raised);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
  animation: fadeInSlide 0.2s ease-out;
}
.batch-action-bar.visible {
  display: flex;
}
.batch-count-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text-primary);
  font-weight: 600;
  font-size: 13px;
}
.batch-buttons-group {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.th-checkbox, .td-checkbox {
  width: 44px;
  text-align: center !important;
  padding: 8px !important;
  vertical-align: middle;
}
.row-select-checkbox {
  width: 17px;
  height: 17px;
  cursor: pointer;
  accent-color: var(--accent-emerald);
  border-radius: 4px;
  vertical-align: middle;
}
tr.row-selected {
  background: rgba(52, 211, 153, 0.07) !important;
}
tr.row-selected:hover {
  background: rgba(16, 185, 129, 0.15) !important;
}
@keyframes fadeInSlide {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}

.toast {
  position: fixed; bottom: 24px; right: 24px;
  background: var(--bg-raised);
  border: 1px solid var(--accent-emerald);
  color: var(--text-primary);
  padding: 12px 18px;
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 500;
  box-shadow: var(--shadow-pop);
  display: none;
  z-index: 1000;
}
.thumb-cell {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  object-fit: cover;
  background: var(--bg-raised);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  border: 1px solid var(--border-subtle);
}
.modal-card-lg {
  width: 820px;
  max-width: 95vw;
}
.duration-chip {
  padding: 8px 10px;
  font-size: 12px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  background: var(--bg-raised);
  color: var(--text-secondary);
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
  text-align: center;
}
.duration-chip:hover {
  border-color: var(--accent-rose);
  color: var(--text-primary);
}
.duration-chip.active {
  background: var(--danger-soft);
  border-color: var(--accent-rose);
  color: var(--text-primary);
  font-weight: 600;
}
.user-filter-banner {
  background: var(--brand-soft);
  border: 1px solid rgba(52, 211, 153, 0.3);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  animation: fadeIn 0.3s ease;
}
.clickable-user {
  cursor: pointer;
  color: var(--text-primary);
  font-weight: 600;
  text-decoration: none;
  transition: color 0.15s;
}
.clickable-user:hover {
  color: var(--brand);
}
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}
.category-pills {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: 14px;
}
.category-pill {
  padding: 5px 12px;
  border-radius: var(--radius-sm);
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
  user-select: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: inherit;
}
.category-pill:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}
.category-pill.active {
  background: var(--brand-soft);
  color: var(--brand-strong);
  border-color: rgba(52, 211, 153, 0.35);
  font-weight: 600;
}

/* Fasting Squads Modern Design System */
.squads-control-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  padding: 16px 20px;
  margin-bottom: 24px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.squads-search-box {
  position: relative;
  display: flex;
  align-items: center;
  flex: 1;
  max-width: 480px;
  min-width: 260px;
}
.squads-search-icon {
  position: absolute;
  left: 13px;
  font-size: 14px;
  opacity: 0.65;
  pointer-events: none;
  display: flex;
  align-items: center;
}
.squads-search-input {
  width: 100%;
  height: 36px;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  padding: 0 36px;
  font-size: 13px;
  font-family: inherit;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.squads-search-input:focus {
  border-color: var(--brand);
  outline: none;
  box-shadow: var(--focus-ring);
}
.squads-search-clear {
  position: absolute;
  right: 10px;
  background: rgba(255, 255, 255, 0.12);
  border: none;
  color: var(--text-secondary);
  border-radius: 50%;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  cursor: pointer;
  transition: all 0.15s;
}
.squads-search-clear:hover {
  background: var(--accent-rose);
  color: #fff;
}
.squad-pill {
  padding: 5px 12px;
  border-radius: var(--radius-sm);
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
  user-select: none;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  white-space: nowrap;
}
.squad-pill:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}
.squad-pill.active {
  background: var(--brand-soft);
  color: var(--brand-strong);
  border-color: rgba(52, 211, 153, 0.35);
  font-weight: 600;
}
.squad-pill-count {
  padding: 1px 6px;
  border-radius: 9999px;
  font-size: 11px;
  background: var(--bg-raised);
  color: inherit;
  font-weight: 600;
  line-height: 1.4;
}
.squad-pill.active .squad-pill-count {
  background: var(--brand);
  color: var(--on-brand);
}
.squad-card-pro {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  padding: 20px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: border-color 0.15s ease, background 0.15s ease;
  position: relative;
  overflow: hidden;
}
.squad-card-pro:hover {
  border-color: rgba(52, 211, 153, 0.35);
}
.squad-card-pro::before {
  content: none;
}
.squad-card-pro:hover::before {
  opacity: 1;
}
/* List paging */
.pager {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding: 14px 4px 0;
  font-size: 12.5px;
  color: var(--text-secondary);
}
.pager-buttons { display: flex; align-items: center; gap: 10px; }
.pager-page { font-variant-numeric: tabular-nums; color: var(--text-primary); }
.btn[disabled] { opacity: 0.4; cursor: not-allowed; pointer-events: none; }
/* Dashboard */
.dash-section-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  margin: 8px 0 12px;
}
.stat-card.is-link { cursor: pointer; transition: border-color 0.15s, background 0.15s; }
.stat-card.is-link:hover { border-color: var(--border-color); background: var(--bg-raised); }
.dash-alert { display: flex; align-items: flex-start; gap: 10px; padding: 12px 16px; margin-bottom: 20px; border-radius: 10px; background: var(--danger-soft); color: var(--accent-rose); font-weight: 600; line-height: 1.5; }
.dash-alert .icon { width: 18px; height: 18px; flex-shrink: 0; margin-top: 2px; }
.todo-list { list-style: none; display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 16px; margin-bottom: 24px; }
.todo-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 20px;
  border-radius: var(--radius-lg);
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-card);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.todo-item:hover { border-color: var(--border-color); background: var(--bg-raised); }
.todo-chip { width: 40px; height: 40px; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.todo-chip .icon { width: 20px; height: 20px; }
.todo-chip.tone-warn { background: var(--warn-soft); color: var(--accent-amber); }
.todo-chip.tone-danger { background: var(--danger-soft); color: var(--accent-rose); }
.todo-chip.tone-clear { background: var(--bg-raised); color: var(--text-muted); }
.todo-label { flex: 1; min-width: 0; font-weight: 600; }
.todo-item .todo-arrow { color: var(--text-muted); }
.todo-item.is-clear { cursor: default; opacity: 0.6; }
.todo-item.is-clear:hover { border-color: var(--border-subtle); background: var(--bg-surface); }
.todo-count { font-size: 24px; font-weight: 700; font-variant-numeric: tabular-nums; }
.status-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--border-subtle); font-size: 13px; font-variant-numeric: tabular-nums; }
.status-row:last-child { border-bottom: none; }
.status-row .status-key { color: var(--text-secondary); }
.dash-columns { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 16px; margin-bottom: 24px; }
.dash-columns > .card { margin-bottom: 0; }
.dash-split { display: grid; grid-template-columns: repeat(auto-fit, minmax(380px, 1fr)); gap: 16px; margin-bottom: 24px; }
.dash-split > .card { margin-bottom: 0; }
.load-error { max-width: 640px; }
.menu-toggle { display: none; }
.text-clamp { max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* Dashboard charts */
.chart-grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(420px, 1fr)); gap: 16px; margin-bottom: 16px; }
.chart-grid-4 { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; margin-bottom: 24px; }
.chart-card { margin-bottom: 0; padding: 20px 20px 14px; }
.chart-title { font-size: 15px; font-weight: 600; color: var(--text-primary); }
.chart-subtitle { font-size: 12px; color: var(--text-muted); margin-top: 2px; margin-bottom: 8px; }
.chart-legend { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 12px; color: var(--text-secondary); margin: 8px 0 6px; }
/* Status note: icon + plain text on a soft status background (colour never carries the message alone) */
.status-note { display: flex; align-items: flex-start; gap: 8px; margin-top: 10px; padding: 8px 12px; border-radius: var(--radius-sm); font-size: 12px; line-height: 1.5; color: var(--text-primary); }
.status-note .icon { width: 15px; height: 15px; margin-top: 2px; }
.status-note.is-warn { background: var(--warn-soft); }
.status-note.is-warn .icon { color: var(--accent-amber); }
.status-note.is-danger { background: var(--danger-soft); }
.status-note.is-danger .icon { color: var(--accent-rose); }
.chart-legend-item { display: inline-flex; align-items: center; gap: 6px; }
.chart-key { display: inline-block; flex-shrink: 0; }
.chart-key-rect { width: 10px; height: 10px; border-radius: 2px; }
.chart-key-line { width: 14px; height: 2px; border-radius: 1px; }
.chart-svg { width: 100%; height: auto; display: block; overflow: visible; }
.chart-svg .chart-grid { stroke: var(--chart-grid); stroke-width: 1; }
.chart-svg .chart-baseline { stroke: #2e3846; }
.chart-svg .chart-tick { fill: var(--text-muted); font-size: 10.5px; font-variant-numeric: tabular-nums; }
.chart-svg .chart-endlabel { fill: var(--text-primary); font-size: 11.5px; font-weight: 600; paint-order: stroke; stroke: var(--chart-surface); stroke-width: 3px; stroke-linejoin: round; }
.chart-svg .chart-line { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart-svg .chart-area { opacity: 0.1; stroke: none; }
.chart-svg .chart-dot { stroke: var(--chart-surface); stroke-width: 2; }
.chart-svg .chart-hit { fill: transparent; cursor: crosshair; }
.chart-svg .chart-crosshair { stroke: var(--text-muted); stroke-width: 1; opacity: 0; pointer-events: none; }
.chart-table { margin-top: 6px; font-size: 12px; color: var(--text-secondary); }
.chart-table summary { cursor: pointer; color: var(--text-muted); width: fit-content; }
.chart-table summary:hover { color: var(--text-secondary); }
.chart-table .table-container { max-height: 220px; overflow-y: auto; margin-top: 6px; }
.chart-table th, .chart-table td { padding: 4px 8px; font-size: 11.5px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.chart-empty { color: var(--text-muted); font-size: 12.5px; padding: 18px 0; }
.chart-footnote { margin-top: 12px; font-size: 11px; color: var(--text-muted); }
.chart-footnote a { color: var(--text-secondary); }
.country-badge { font-size: 10.5px; color: var(--text-secondary); font-family: inherit; white-space: nowrap; }
.bar-list { display: flex; flex-direction: column; gap: 6px; margin-top: 10px; }
.bar-row { display: grid; grid-template-columns: minmax(70px, 38%) 1fr auto; align-items: center; gap: 10px; font-size: 12.5px; padding: 2px 0; border-radius: 6px; }
.bar-row:hover { background: var(--bg-hover); }
.bar-row:hover .bar-label { color: var(--text-primary); }
.bar-label { color: var(--text-secondary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-track { height: 10px; overflow: hidden; }
.bar-fill { display: block; height: 100%; min-width: 2px; background: var(--series-1); border-radius: 0 4px 4px 0; }
.bar-value { color: var(--text-primary); font-weight: 700; font-variant-numeric: tabular-nums; text-align: right; }
.bar-share { color: var(--text-muted); font-weight: 500; margin-left: 4px; }
.chart-tip {
  position: fixed; z-index: 2000; display: none; pointer-events: none;
  background: var(--bg-raised); border: 1px solid var(--border-color); border-radius: 8px;
  padding: 8px 10px; font-size: 12px; color: var(--text-primary); box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
  min-width: 150px;
}
.chart-tip-date { color: var(--text-muted); font-size: 11px; margin-bottom: 4px; }
.chart-tip-row { display: flex; align-items: center; gap: 8px; line-height: 1.7; }
.chart-tip-row strong { font-variant-numeric: tabular-nums; min-width: 34px; }
.chart-tip-key { width: 12px; height: 2px; border-radius: 1px; flex-shrink: 0; }
.chart-tip-label { color: var(--text-secondary); }
/* Exercise details: tick boxes shown as chips */
.exercise-chip-group { display: flex; flex-wrap: wrap; gap: 6px; }
.exercise-chip { display: inline-flex; align-items: center; gap: 5px; padding: 4px 10px; border-radius: 99px; border: 1px solid var(--border-color); font-size: 12px; color: var(--text-secondary); cursor: pointer; user-select: none; }
.exercise-chip input { width: 14px; height: 14px; margin: 0; cursor: pointer; }
.exercise-chip:has(input:checked) { border-color: var(--brand); color: var(--text-primary); background: var(--brand-soft); }
#program-steps .form-input { padding: 6px 8px; min-width: 0; }
.program-section-row td { font-size: 12px; font-weight: 800; color: var(--accent-teal); padding-top: 10px; border-bottom: none; }
/* Narrow screens: the sidebar slides in from the left */
@media (max-width: 900px) {
  .sidebar {
    position: fixed;
    top: 0; bottom: 0; left: 0;
    z-index: 900;
    transform: translateX(-100%);
    transition: transform 0.2s ease;
    box-shadow: 0 0 40px rgba(0, 0, 0, 0.5);
  }
  body.nav-open .sidebar { transform: translateX(0); }
  .menu-toggle { display: inline-flex; }
  .top-bar { padding: 0 16px; height: auto; min-height: 60px; flex-wrap: wrap; padding-top: 10px; padding-bottom: 10px; }
  .top-actions { flex-wrap: wrap; gap: 8px; }
  .content-area { padding: 16px !important; }
  .search-input { min-width: 0; width: 100%; }
  .crumbs #page-section, .crumbs .crumb-sep { display: none; }
  .form-row { grid-template-columns: 1fr; }
  .chart-grid-2 { grid-template-columns: 1fr; }
}
/* Member list: record counts with small icons */
.member-counts { display: flex; gap: 10px; flex-wrap: wrap; color: var(--text-secondary); font-size: 12px; font-variant-numeric: tabular-nums; }
.member-counts span { display: inline-flex; align-items: center; gap: 3px; }
.member-counts .icon, td .icon { width: 14px; height: 14px; }
.member-counts .icon { color: var(--text-muted); }
.todo-arrow .icon { width: 18px; height: 18px; }
/* A table directly inside a card runs edge to edge; the pager below it gets a top rule */
.card > .table-container { margin-left: -20px; margin-right: -20px; width: auto; }
.card > .table-container th:first-child, .card > .table-container td:first-child { padding-left: 20px; }
.card > .table-container th:last-child, .card > .table-container td:last-child { padding-right: 20px; }
.card > .table-container:last-child { margin-bottom: -20px; }
.card > .table-container + .pager { margin: 0 -20px -20px; padding: 12px 20px 14px; border-top: 1px solid var(--border-subtle); }
.page-head p:empty { display: none; }
.page-head-actions:empty { display: none; }
/* Row actions: one visible button, the rest in a floating "More" menu (placed by placeRowMenu in core.js) */
.row-actions { display: flex; gap: 6px; align-items: center; flex-wrap: nowrap; justify-content: flex-end; }
.row-more > summary { list-style: none; }
.row-more > summary::-webkit-details-marker { display: none; }
.row-more[open] > summary { background: var(--bg-hover); border-color: #2e3846; }
.row-more-list {
  position: fixed;
  z-index: 950;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 180px;
  padding: 6px;
  background: var(--bg-raised);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  box-shadow: var(--shadow-pop);
}
.row-more-list:empty { display: none; }
.row-more-list .btn {
  justify-content: flex-start;
  width: 100%;
  height: 32px;
  background: transparent;
  border-color: transparent;
  color: var(--text-primary);
  font-weight: 500;
}
.row-more-list .btn:hover { background: var(--bg-hover); }
.row-more-list .btn-danger { color: var(--accent-rose); }
.row-more-list .btn-danger:hover { background: var(--danger-soft); color: var(--accent-rose); }
.row-more-list .btn-soft { color: var(--brand); }
.row-more-list .btn { border-color: transparent !important; }

/* Food library ZIP import (food-zip-modal) */
.zip-rules {
  margin: 0 0 12px;
  padding-left: 18px;
  font-size: 12.5px;
  line-height: 1.6;
  color: var(--text-secondary);
}
.zip-file-badge {
  margin-top: 8px;
  font-size: 12px;
  font-weight: 600;
  color: var(--brand);
}
.zip-option {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  margin-bottom: 12px;
  font-size: 12.5px;
  color: var(--text-secondary);
}
.zip-result {
  margin-bottom: 12px;
  font-size: 12.5px;
}
.zip-summary {
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: var(--bg-raised);
  border: 1px solid var(--border-color);
  margin-bottom: 8px;
}
.zip-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  margin-top: 6px;
  color: var(--text-secondary);
}
.zip-ok {
  color: var(--brand);
  font-weight: 700;
}
.zip-error {
  color: var(--accent-rose);
}
.zip-summary .zip-error {
  font-weight: 700;
}
.zip-warn {
  color: var(--accent-amber);
}
.zip-muted {
  color: var(--text-muted);
}
.zip-problems {
  margin: 0 0 8px;
  padding-left: 18px;
}
.zip-table {
  max-height: 320px;
  overflow: auto;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
}
.zip-table table {
  width: 100%;
  border-collapse: collapse;
}
.zip-table th,
.zip-table td {
  padding: 6px 10px;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--border-subtle);
}
.zip-table th {
  position: sticky;
  top: 0;
  background: var(--bg-raised);
  color: var(--text-secondary);
  font-weight: 600;
}
