/* ==========================================================================
   Family Hub & Menu PWA - Clean, Light & Airy Modern Design System (Apple/iOS Style)
   ========================================================================== */

:root {
  --bg-primary: #f8fafc;
  --bg-secondary: #ffffff;
  --bg-card: #ffffff;
  --bg-card-subtle: #f1f5f9;
  --border-color: #e2e8f0;
  --border-light: #f1f5f9;
  
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #94a3b8;

  --accent-primary: #0284c7;
  --accent-primary-hover: #0369a1;
  --accent-primary-light: #e0f2fe;

  --accent-green: #059669;
  --accent-green-light: #ecfdf5;
  --accent-green-border: #a7f3d0;

  --accent-amber: #d97706;
  --accent-amber-light: #fef3c7;
  --accent-amber-border: #fde68a;

  --accent-purple: #6366f1;
  --accent-purple-light: #eef2ff;
  --accent-purple-border: #c7d2fe;

  --accent-pink: #ec4899;
  --accent-pink-light: #fdf2f8;
  --accent-pink-border: #fbcfe8;

  --accent-red: #dc2626;
  --accent-red-light: #fef2f2;
  --accent-red-border: #fecaca;

  --font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 24px;
  
  --shadow-subtle: 0 1px 3px rgba(0, 0, 0, 0.05), 0 4px 12px rgba(0, 0, 0, 0.02);
  --shadow-card: 0 2px 6px rgba(0, 0, 0, 0.04), 0 10px 24px rgba(0, 0, 0, 0.03);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: var(--font-family);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  font-size: 16px;
  line-height: 1.5;
  min-height: 100vh;
  padding-bottom: 96px;
  -webkit-font-smoothing: antialiased;
}

/* ==================== APP HEADER ==================== */
.app-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-color);
  padding: 12px 18px;
}

.header-main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 680px;
  margin: 0 auto;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-icon {
  font-size: 26px;
  background: var(--accent-primary-light);
  color: var(--accent-primary);
  padding: 6px 8px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
}

.brand-title {
  font-size: 19px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.4px;
}

.brand-sub {
  font-size: 13px;
  color: var(--text-secondary);
}

.btn-icon {
  background: var(--bg-card-subtle);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  border-radius: var(--radius-sm);
  width: 42px;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  cursor: pointer;
  transition: background 0.15s ease;
}

/* ==================== CONTENT ==================== */
.app-content {
  padding: 16px;
  max-width: 680px;
  margin: 0 auto;
}

.tab-page {
  display: none;
  animation: fadeIn 0.2s ease-out;
}

.tab-page.active {
  display: block;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ==================== VIEWER SELECTOR (КТО СМОТРИТ) ==================== */
.viewer-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 8px 12px;
  margin-bottom: 12px;
  box-shadow: var(--shadow-subtle);
}

.viewer-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.viewer-pills {
  display: flex;
  gap: 4px;
}

.viewer-btn {
  background: var(--bg-card-subtle);
  border: 1px solid transparent;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.viewer-btn.active {
  background: var(--accent-primary);
  color: #ffffff;
  box-shadow: 0 2px 6px rgba(2, 132, 199, 0.3);
}

/* ==================== HORIZONTAL WEEK DAY PICKER ==================== */
.week-picker-container {
  margin-bottom: 14px;
}

/* ==================== WEEK & DATE NAVIGATION ==================== */
.week-nav-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 8px 12px;
  margin-bottom: 8px;
  box-shadow: var(--shadow-subtle);
}

.btn-nav-week {
  background: var(--bg-card-subtle);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  color: var(--text-primary);
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-nav-week:hover, .btn-nav-week:active {
  background: var(--primary-light);
  border-color: var(--primary);
  color: var(--primary);
}

.week-nav-center {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  color: var(--text-primary);
}

.week-range-text {
  font-size: 14px;
  letter-spacing: -0.2px;
}

.date-picker-label {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  background: var(--bg-card-subtle);
  border: 1px solid var(--border-color);
  cursor: pointer;
  font-size: 15px;
  transition: all 0.15s ease;
}

.date-picker-label:hover {
  background: var(--primary-light);
  border-color: var(--primary);
}

.date-picker-native {
  position: absolute;
  opacity: 0;
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
  cursor: pointer;
}

.btn-today-pill {
  background: var(--primary-light);
  border: 1px solid var(--primary);
  color: var(--primary);
  border-radius: 9999px;
  padding: 5px 12px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-today-pill:hover {
  background: var(--primary);
  color: #ffffff;
}

.week-strip {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 8px 6px;
  box-shadow: var(--shadow-subtle);
}

.day-chip {
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  padding: 8px 2px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
}

.day-chip .d-name {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
}

.day-chip .d-num {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
}

.day-chip .d-dots {
  display: flex;
  gap: 2px;
  font-size: 10px;
  min-height: 12px;
}

.day-chip:hover {
  background: var(--bg-card-subtle);
}

.day-chip.active {
  background: var(--accent-primary);
  border-color: var(--accent-primary);
  box-shadow: 0 4px 12px rgba(2, 132, 199, 0.25);
}

.day-chip.active .d-name {
  color: #bae6fd;
}

.day-chip.active .d-num {
  color: #ffffff;
}

/* Selected Day Banner */
.selected-day-banner {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  margin-bottom: 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: var(--shadow-subtle);
}

.active-day-title {
  font-size: 19px;
  font-weight: 700;
  color: var(--text-primary);
}

/* ==================== TIMELINE ==================== */
.timeline-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 16px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-subtle);
}

.timeline-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.timeline-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.timeline-actions {
  display: flex;
  gap: 6px;
}

.btn-timeline-action {
  background: var(--bg-card-subtle);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  font-size: 12px;
  font-weight: 600;
  padding: 5px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-timeline-action:hover {
  background: var(--border-color);
}

.timeline-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.timeline-item {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 12px;
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  transition: all 0.15s ease;
  position: relative;
}

.timeline-item.all {
  border-left: 4px solid var(--accent-purple);
  background: #faf5ff;
}

.timeline-item.personal {
  border-left: 4px solid var(--accent-amber);
  background: #fffbeb;
}

.timeline-item.participants {
  border-left: 4px solid var(--accent-primary);
  background: #f0f9ff;
}

.t-time {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
  min-width: 85px;
}

.t-body {
  flex: 1;
}

.t-badges-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 4px;
  flex-wrap: wrap;
}

.vis-badge {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
}

.vis-all {
  background: var(--accent-purple-light);
  color: var(--accent-purple);
}

.vis-personal {
  background: var(--accent-amber-light);
  color: var(--accent-amber);
}

.vis-participants {
  background: var(--accent-primary-light);
  color: var(--accent-primary);
}

.part-chip {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 10px;
  background: rgba(0,0,0,0.05);
  color: var(--text-secondary);
}

.t-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
}

.t-desc {
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 2px;
}

.t-loc {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}

.btn-delete-ev {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 14px;
  cursor: pointer;
  padding: 4px;
  position: absolute;
  top: 8px;
  right: 8px;
}

.btn-delete-ev:hover {
  color: var(--accent-red);
}

/* ==================== CARDS & BUTTONS ==================== */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 16px;
  margin-bottom: 14px;
  box-shadow: var(--shadow-subtle);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  font-weight: 600;
  padding: 12px 20px;
  min-height: 48px;
  border-radius: var(--radius-sm);
  border: none;
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
}

.btn-primary {
  background: var(--accent-primary);
  color: #ffffff;
}

.btn-primary:active {
  background: var(--accent-primary-hover);
  transform: scale(0.98);
}

.btn-secondary {
  background: var(--bg-card-subtle);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
}

.btn-outline {
  background: #ffffff;
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  padding: 8px 14px;
  min-height: 40px;
  font-size: 13px;
}

.btn-text {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  padding: 8px;
  min-height: 40px;
  font-size: 13px;
}

.text-danger {
  color: var(--accent-red) !important;
}

.full-width {
  width: 100%;
}

/* ==================== MEALS ==================== */
.meals-section-header {
  font-size: 17px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.meal-row {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 10px;
  box-shadow: var(--shadow-subtle);
}

.meal-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.meal-slot-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--accent-primary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.meal-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.35;
}

.meal-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.badge {
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.badge-pre-workout {
  background: var(--accent-amber-light);
  color: var(--accent-amber);
  border: 1px solid var(--accent-amber-border);
}

.badge-post-workout {
  background: var(--accent-green-light);
  color: var(--accent-green);
  border: 1px solid var(--accent-green-border);
}

.badge-batch {
  background: var(--accent-purple-light);
  color: var(--accent-purple);
  border: 1px solid var(--accent-purple-border);
}

.badge-quick {
  background: var(--accent-primary-light);
  color: var(--accent-primary);
  border: 1px solid #bae6fd;
}

.meal-kbju-strip {
  display: flex;
  gap: 12px;
  font-size: 12px;
  color: var(--text-secondary);
  background: var(--bg-card-subtle);
  padding: 6px 10px;
  border-radius: 6px;
}

.meal-kbju-strip b {
  color: var(--text-primary);
}

.substitution-tag {
  font-size: 12px;
  color: var(--text-secondary);
  background: #faf5ff;
  border: 1px dashed #d8b4fe;
  padding: 6px 10px;
  border-radius: 6px;
  line-height: 1.4;
}

.substitution-tag strong {
  color: #7e22ce;
}

.meal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 4px;
}

.btn-sm {
  padding: 6px 12px;
  font-size: 13px;
  min-height: 38px;
}

/* ==================== BATCH COOKING CYCLES TAB ==================== */
.cycle-big-card {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 16px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-subtle);
}

.cycle-big-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.cycle-badge {
  font-size: 12px;
  font-weight: 700;
  padding: 4px 8px;
  border-radius: 6px;
  background: var(--accent-purple-light);
  color: var(--accent-purple);
}

.cycle-prep-list {
  padding-left: 20px;
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* ==================== SHOPPING LIST ==================== */
.shopping-group {
  margin-bottom: 18px;
}

.group-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 8px;
  padding-left: 2px;
}

.shopping-items {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.shopping-item {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.shopping-item.checked {
  background: #f8fafc;
  opacity: 0.55;
}

.shopping-item.checked .item-name {
  text-decoration: line-through;
}

.item-main-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.item-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.item-checkbox {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  border: 2px solid #cbd5e1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  color: white;
}

.shopping-item.checked .item-checkbox {
  background: var(--accent-green);
  border-color: var(--accent-green);
}

.item-name {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
}

.item-amt {
  font-size: 14px;
  font-weight: 700;
  color: var(--accent-primary);
  background: var(--accent-primary-light);
  padding: 3px 8px;
  border-radius: 6px;
}

.item-subs-row {
  font-size: 12px;
  color: #6b21a8;
  background: #faf5ff;
  border-radius: 6px;
  padding: 4px 8px;
  margin-left: 34px;
}

.add-item-card {
  padding: 14px;
}

.add-item-form input[type="text"] {
  width: 100%;
  padding: 10px 14px;
  font-size: 15px;
  border-radius: var(--radius-sm);
  background: #ffffff;
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  margin-bottom: 8px;
}

.add-item-row {
  display: grid;
  grid-template-columns: 80px 70px 1fr 48px;
  gap: 6px;
}

.add-item-row input, .add-item-row select {
  padding: 8px 10px;
  font-size: 14px;
  border-radius: var(--radius-sm);
  background: #ffffff;
  border: 1px solid var(--border-color);
  color: var(--text-primary);
}

/* ==================== FRIDGE CONSTRUCTOR ==================== */
.input-row {
  display: flex;
  gap: 8px;
  margin-top: 6px;
  margin-bottom: 12px;
}

.input-row input {
  flex: 1;
  padding: 12px 14px;
  font-size: 15px;
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
}

.input-label {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
}

.quick-chips-wrapper {
  margin-top: 8px;
}

.chips-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  display: block;
  margin-bottom: 6px;
}

.chips-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.chip {
  background: #ffffff;
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.chip.active {
  background: var(--accent-primary);
  color: white;
  border-color: var(--accent-primary);
  font-weight: 600;
}

.missing-pill {
  font-size: 12px;
  background: var(--accent-red-light);
  color: var(--accent-red);
  border: 1px solid var(--accent-red-border);
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  margin-top: 6px;
  line-height: 1.4;
}

/* ==================== FORM GROUPS (EVENT MODAL) ==================== */
.form-group {
  margin-bottom: 14px;
}

.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.form-group input, .form-group select, .form-group textarea {
  width: 100%;
  padding: 10px 12px;
  font-size: 15px;
  border-radius: var(--radius-sm);
  background: #ffffff;
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  font-family: inherit;
}

.form-row-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.checkbox-group {
  display: flex;
  gap: 12px;
  margin-top: 6px;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  cursor: pointer;
}

.json-textarea {
  width: 100%;
  height: 180px;
  font-family: monospace;
  font-size: 13px;
  padding: 10px;
  border-radius: var(--radius-sm);
  background: #f8fafc;
  border: 1px solid var(--border-color);
  color: #0f172a;
}

/* ==================== MODALS ==================== */
.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 200;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.modal-backdrop.hidden {
  display: none;
}

.modal-content {
  background: #ffffff;
  border-radius: 24px 24px 0 0;
  width: 100%;
  max-width: 680px;
  max-height: 88vh;
  overflow-y: auto;
  padding: 24px 20px 30px;
  animation: slideUp 0.25s ease-out;
  box-shadow: 0 -10px 40px rgba(0,0,0,0.15);
}

@keyframes slideUp {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 14px;
}

.modal-title {
  font-size: 20px;
  font-weight: 700;
  line-height: 1.3;
  color: var(--text-primary);
}

.modal-close-btn {
  background: var(--bg-card-subtle);
  border: none;
  color: var(--text-secondary);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  cursor: pointer;
}

.kbju-box {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  background: var(--bg-card-subtle);
  padding: 12px 6px;
  border-radius: var(--radius-sm);
  text-align: center;
  margin: 14px 0 18px;
}

.kbju-item .k-num {
  display: block;
  font-size: 18px;
  font-weight: 700;
  color: var(--accent-primary);
}

.kbju-item .k-txt {
  font-size: 11px;
  color: var(--text-secondary);
}

.modal-section {
  margin-bottom: 20px;
}

.modal-section h4 {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 10px;
}

.ingredients-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.ingredient-item {
  background: #fafbfc;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.ing-main {
  display: flex;
  justify-content: space-between;
  font-size: 15px;
  font-weight: 600;
}

.ing-sub-box {
  font-size: 12px;
  color: #6b21a8;
  background: #faf5ff;
  border: 1px dashed #d8b4fe;
  padding: 4px 8px;
  border-radius: 6px;
  margin-top: 2px;
}

.steps-list {
  padding-left: 20px;
  font-size: 15px;
  color: var(--text-primary);
  line-height: 1.6;
}

.steps-list li {
  margin-bottom: 8px;
}

/* ==================== BOTTOM NAV ==================== */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 72px;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: space-around;
  align-items: center;
  z-index: 100;
  padding-bottom: env(safe-area-inset-bottom, 6px);
}

.nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 6px 0;
  gap: 3px;
  transition: all 0.15s ease;
}

.nav-item.active {
  color: var(--accent-primary);
  font-weight: 700;
}

.nav-icon {
  font-size: 22px;
}

.nav-label {
  font-size: 11px;
}

/* ==================== TOAST ==================== */
.toast {
  position: fixed;
  bottom: 86px;
  left: 50%;
  transform: translateX(-50%);
  background: #0f172a;
  color: white;
  padding: 10px 20px;
  border-radius: 30px;
  font-size: 14px;
  font-weight: 600;
  box-shadow: 0 10px 25px rgba(0,0,0,0.2);
  z-index: 300;
  animation: fadeIn 0.2s ease-out;
}

.toast.hidden {
  display: none;
}

.loading-state, .empty-state {
  text-align: center;
  padding: 36px 16px;
  color: var(--text-secondary);
}

.empty-icon {
  font-size: 44px;
  display: block;
  margin-bottom: 8px;
}

.btn-timeline-action.tg-action {
  background: rgba(14, 165, 233, 0.12);
  color: #0284c7;
  border-color: rgba(14, 165, 233, 0.3);
  font-weight: 600;
}
.btn-timeline-action.tg-action:hover {
  background: #0284c7;
  color: #ffffff;
}

/* Telegram OTP Auth Card */
.auth-card {
  max-width: 360px;
  padding: 28px 22px;
  border-radius: 24px;
}
.otp-input {
  width: 100%;
  font-size: 26px;
  font-weight: 800;
  letter-spacing: 6px;
  text-align: center;
  padding: 12px 14px;
  border: 2px solid var(--accent-primary);
  border-radius: 14px;
  background: var(--bg-card);
  color: var(--text-primary);
  box-sizing: border-box;
}
.auth-error-pill {
  margin-top: 12px;
  padding: 8px 12px;
  border-radius: 10px;
  font-size: 13px;
  background: #fee2e2;
  color: #b91c1c;
  text-align: center;
  font-weight: 600;
}


/* ==========================================================================
   SHOPPING PERIODS & REVISION STYLES
   ========================================================================== */
.shopping-period-bar {
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
  background: var(--bg-card);
  padding: 6px;
  border-radius: 14px;
  border: 1px solid var(--border-color);
}
.period-btn {
  flex: 1;
  padding: 8px 10px;
  font-size: 13px;
  font-weight: 600;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: center;
}
.period-btn.active {
  background: var(--accent-primary);
  color: #ffffff;
  box-shadow: 0 2px 6px rgba(16, 185, 129, 0.25);
}

.revision-card {
  margin-bottom: 14px;
  background: #f8fafc;
  border: 1px dashed #cbd5e1;
}
.revision-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}
.revision-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
}
.revision-subtitle {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 2px;
}
.revision-tools {
  display: flex;
  gap: 8px;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid #e2e8f0;
  flex-wrap: wrap;
}
.btn-xs {
  padding: 4px 10px;
  font-size: 11px;
  border-radius: 6px;
}

.item-title-col {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.stock-badge {
  display: inline-block;
  font-size: 11px;
  padding: 2px 6px;
  border-radius: 6px;
  font-weight: 600;
  width: fit-content;
}
.stock-badge.stock-ok {
  background: #dcfce7;
  color: #15803d;
}
.stock-badge.stock-partial {
  background: #fef3c7;
  color: #b45309;
}

.shopping-item.in-stock {
  opacity: 0.75;
  background: #f8fafc;
}
.amt-muted {
  color: var(--text-muted);
  text-decoration: line-through;
  font-size: 13px;
}
.amt-highlight {
  color: var(--accent-primary);
  font-weight: 700;
  font-size: 14px;
}

.revision-row {
  margin-top: 8px;
  padding-top: 6px;
  border-top: 1px dashed var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 12px;
  color: var(--text-secondary);
}
.revision-input-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
}
.revision-qty-input {
  width: 65px;
  padding: 4px 6px;
  font-size: 13px;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  text-align: right;
  background: #ffffff;
}
.revision-unit {
  font-size: 12px;
  font-weight: 600;
}

/* ==========================================================================
   HOCKEY HUB & STANDINGS STYLES
   ========================================================================== */
.hockey-team-card {
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
  color: #ffffff;
  padding: 16px;
  border-radius: 18px;
  margin-bottom: 16px;
  box-shadow: 0 6px 16px rgba(15, 23, 42, 0.12);
}
.team-card-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}
.team-icon-badge {
  font-size: 28px;
  background: rgba(255, 255, 255, 0.1);
  padding: 8px;
  border-radius: 12px;
}
.team-card-title {
  font-size: 16px;
  font-weight: 800;
  letter-spacing: -0.2px;
  line-height: 1.2;
}
.team-card-sub {
  font-size: 12px;
  color: #94a3b8;
  margin-top: 2px;
}
.team-stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  background: rgba(255, 255, 255, 0.06);
  padding: 10px;
  border-radius: 12px;
  text-align: center;
}
.team-stat-item .stat-num {
  font-size: 18px;
  font-weight: 800;
  color: #38bdf8;
  display: block;
}
.team-stat-item .stat-lbl {
  font-size: 10px;
  color: #94a3b8;
  text-transform: uppercase;
  margin-top: 2px;
}

.hockey-standings-card {
  margin-bottom: 16px;
  overflow: hidden;
}
.table-responsive {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.hockey-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  text-align: center;
}
.hockey-table th {
  padding: 8px 6px;
  font-weight: 700;
  color: var(--text-secondary);
  border-bottom: 2px solid var(--border-color);
  font-size: 11px;
  text-transform: uppercase;
}
.hockey-table td {
  padding: 8px 6px;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-primary);
}
.hockey-table tr.my-team-row {
  background: rgba(14, 165, 233, 0.12);
  font-weight: 700;
}
.hockey-table tr.my-team-row td {
  color: #0369a1;
}

.hockey-games-card {
  margin-bottom: 16px;
}
.hockey-games-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 10px;
}
.hockey-game-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 12px;
  border-radius: 12px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
}
.game-row-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  color: var(--text-secondary);
}
.game-gather-badge {
  background: #fef3c7;
  color: #b45309;
  font-size: 11px;
  padding: 2px 6px;
  border-radius: 6px;
  font-weight: 600;
}
.game-row-match {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 14px;
  font-weight: 700;
}
.score-chip {
  padding: 4px 10px;
  border-radius: 8px;
  background: #0f172a;
  color: #ffffff;
  font-weight: 800;
  letter-spacing: 1px;
  font-size: 13px;
}
.score-win {
  background: #16a34a;
}
.score-loss {
  background: #dc2626;
}
.game-row-bottom {
  font-size: 11px;
  color: var(--text-muted);
}

/* ==========================================================================
   SETTINGS PAGE STYLES
   ========================================================================== */
.settings-card {
  margin-bottom: 14px;
}
.card-subtitle {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 10px;
  color: var(--text-primary);
}
.settings-note {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.4;
  margin-bottom: 12px;
}
.settings-family-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.family-member-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px;
  background: #f8fafc;
  border-radius: 12px;
}
.member-avatar {
  font-size: 24px;
}
.member-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
}
.member-role {
  font-size: 12px;
  color: var(--text-secondary);
}

.settings-param-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid var(--border-color);
  font-size: 13px;
}
.settings-param-row:last-child {
  border-bottom: none;
}
.param-label {
  color: var(--text-secondary);
}
.param-value {
  font-weight: 600;
  color: var(--text-primary);
  text-align: right;
}
.param-badge {
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 6px;
  background: #e2e8f0;
  color: #334155;
}
.param-badge.badge-accent {
  background: rgba(14, 165, 233, 0.15);
  color: #0284c7;
}
.param-badge.badge-success {
  background: #dcfce7;
  color: #16a34a;
}
.settings-btn-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.btn-danger-outline {
  border-color: #fca5a5 !important;
  color: #dc2626 !important;
}
.btn-danger-outline:hover {
  background: #fee2e2 !important;
}


/* ==========================================================================
   SCROLLABLE BOTTOM NAV (7 TABS)
   ========================================================================== */
.bottom-nav.nav-scrollable {
  display: flex;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  justify-content: flex-start;
  padding: 6px 8px;
  gap: 4px;
}
.bottom-nav.nav-scrollable::-webkit-scrollbar {
  display: none;
}
.bottom-nav.nav-scrollable .nav-item {
  flex: 0 0 auto;
  min-width: 62px;
  padding: 6px 4px;
}

/* ==========================================================================
   SUBNAV CONTROLS (HOCKEY & FAMILY)
   ========================================================================== */
.hockey-subnav, .family-subnav {
  display: flex;
  gap: 6px;
  margin-bottom: 14px;
  background: var(--bg-card);
  padding: 6px;
  border-radius: 14px;
  border: 1px solid var(--border-color);
  overflow-x: auto;
}
.hockey-subnav::-webkit-scrollbar, .family-subnav::-webkit-scrollbar {
  display: none;
}
.hockey-subnav-btn, .family-subnav-btn {
  flex: 1 0 auto;
  padding: 7px 12px;
  font-size: 13px;
  font-weight: 600;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  border-radius: 10px;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s ease;
}
.hockey-subnav-btn.active, .family-subnav-btn.active {
  background: var(--accent-primary);
  color: #ffffff;
  box-shadow: 0 2px 6px rgba(14, 165, 233, 0.25);
}

.hockey-sub-pane, .family-sub-pane {
  display: none;
}
.hockey-sub-pane.active, .family-sub-pane.active {
  display: block;
  animation: fadeIn 0.2s ease;
}

/* ==========================================================================
   FAMILY NOTICE & 3-PERSON CALCULATIONS
   ========================================================================== */
.notice-banner-card {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  padding: 12px 14px;
  margin-bottom: 14px;
  border-radius: 14px;
}
.notice-flex {
  display: flex;
  align-items: center;
  gap: 12px;
}
.notice-flex strong {
  font-size: 14px;
  color: #166534;
  display: block;
}
.notice-flex .sub-text {
  font-size: 12px;
  color: #15803d;
  margin-top: 2px;
}
.family-notice-pill {
  display: inline-block;
  background: #dcfce7;
  color: #166534;
  font-size: 12px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 8px;
  margin-bottom: 12px;
}

/* ==========================================================================
   SCHOOL BELLS & WORK SCHEDULE
   ========================================================================== */
.school-bells-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.bell-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  background: #f8fafc;
  border: 1px solid var(--border-color);
  border-radius: 10px;
  font-size: 13px;
}
.bell-item.highlight-breakfast {
  background: #fefce8;
  border-color: #fef08a;
}
.lesson-num {
  font-weight: 700;
  color: var(--text-primary);
  width: 65px;
}
.lesson-time {
  font-weight: 600;
  color: var(--accent-primary);
}
.lesson-break {
  font-size: 12px;
  color: var(--text-secondary);
}

.work-member-box {
  background: #f8fafc;
  border: 1px solid var(--border-color);
  padding: 14px;
  border-radius: 12px;
}
.member-badge-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 4px;
}
.shift-status-pill {
  margin-top: 10px;
  padding: 8px 12px;
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  font-size: 13px;
}

/* ==========================================================================
   FILTER CHIPS & TIMELINE
   ========================================================================== */
.filter-chips-bar {
  display: flex;
  gap: 6px;
  margin-bottom: 14px;
  overflow-x: auto;
  padding: 2px 0;
}
.filter-chips-bar::-webkit-scrollbar {
  display: none;
}
.filter-chip {
  padding: 6px 12px;
  border-radius: 20px;
  border: 1px solid var(--border-color);
  background: var(--bg-card);
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  white-space: nowrap;
}
.filter-chip.active {
  background: var(--text-primary);
  color: #ffffff;
  border-color: var(--text-primary);
}

.timeline-card {
  margin-bottom: 16px;
}
.timeline-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 8px;
}
.timeline-title {
  font-size: 16px;
  font-weight: 700;
}
.timeline-events-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.timeline-event-item {
  display: flex;
  gap: 12px;
  padding: 12px;
  border-radius: 12px;
  background: #f8fafc;
  border: 1px solid var(--border-color);
  position: relative;
}
.timeline-event-item.event-hockey {
  border-left: 4px solid #0284c7;
}
.timeline-event-item.event-school {
  border-left: 4px solid #f59e0b;
}
.timeline-event-item.event-work {
  border-left: 4px solid #8b5cf6;
}
.timeline-event-item.event-nutrition {
  border-left: 4px solid #10b981;
  background: #f0fdf4;
}
.timeline-event-item.event-nutrition:hover {
  background: #dcfce7;
  cursor: pointer;
}
.timeline-event-item.event-family {
  border-left: 4px solid #059669;
}

.event-time-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 55px;
}
.event-time-text {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
}
.event-info-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.event-title-text {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
}
.event-meta-text {
  font-size: 12px;
  color: var(--text-secondary);
}


/* ==========================================================================
   STRICT HORIZONTAL 7-DAY PICKER STRIP
   ========================================================================== */
.week-picker-container {
  margin-bottom: 14px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 6px;
  width: 100%;
  box-sizing: border-box;
}
.week-picker-strip {
  display: grid !important;
  grid-template-columns: repeat(7, 1fr) !important;
  gap: 4px !important;
  width: 100% !important;
  box-sizing: border-box;
}
.day-chip {
  min-width: 0 !important;
  width: 100% !important;
  padding: 6px 1px !important;
  box-sizing: border-box;
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;
}
.day-chip .d-name {
  font-size: 11px !important;
  font-weight: 700 !important;
}
.day-chip .d-num {
  font-size: 15px !important;
  font-weight: 800 !important;
}
.day-chip .d-dots {
  font-size: 9px !important;
  min-height: 12px;
}


/* ==========================================================================
   HOCKEY EMBEDDED FRAME (EXACT HOCKEY.KVANTUM.ONLINE)
   ========================================================================== */
.hockey-frame {
  width: 100%;
  height: calc(100vh - 120px);
  min-height: 650px;
  border: none;
  border-radius: 18px;
  display: block;
  background: #090e1a;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
}
