/* =========================================================
   Садик: Доп. занятия - Modern PWA Stylesheet
   Mobile-First, iOS & Android Optimized, Apple HIG Inspired
   ========================================================= */

:root {
  --primary: #4F46E5;
  --primary-hover: #4338CA;
  --primary-light: #EEF2FF;
  --primary-text: #3730A3;
  
  --success: #10B981;
  --success-light: #ECFDF5;
  --success-dark: #047857;
  
  --warning: #F59E0B;
  --warning-light: #FEF3C7;
  
  --danger: #EF4444;
  --danger-light: #FEE2E2;
  
  --bg-app: #F8FAFC;
  --bg-card: #FFFFFF;
  --bg-surface: #F1F5F9;
  
  --text-main: #0F172A;
  --text-muted: #64748B;
  --text-light: #94A3B8;
  
  --border-color: #E2E8F0;
  --border-radius-lg: 20px;
  --border-radius-md: 14px;
  --border-radius-sm: 8px;
  
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.08), 0 2px 4px -2px rgba(0, 0, 0, 0.04);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -4px rgba(0, 0, 0, 0.03);
  
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

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

button,
.cal-day-cell,
.btn-garden-status,
.chip-reason,
.nav-tab,
.nav-arrow-btn,
.activity-day-card,
.day-chip {
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background-color: var(--bg-app);
  color: var(--text-main);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  justify-content: center;
}

.app-shell {
  width: 100%;
  max-width: 540px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background-color: var(--bg-app);
  position: relative;
  box-shadow: 0 0 40px rgba(0, 0, 0, 0.04);
}

/* ================= HEADER ================= */
.top-bar {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-color);
  padding: calc(var(--safe-top) + 10px) 16px 12px 16px;
}

.header-main {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.child-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-surface);
  padding: 6px 14px;
  border-radius: 30px;
  cursor: pointer;
  border: 1px solid var(--border-color);
  transition: all 0.2s ease;
}

.child-badge:hover {
  background: var(--primary-light);
  border-color: #C7D2FE;
}

.child-avatar {
  font-size: 18px;
}

.child-name {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-main);
  max-width: 140px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.edit-hint-icon {
  font-size: 11px;
  opacity: 0.6;
}

.header-month-summary {
  text-align: right;
}

.summary-label {
  font-size: 12px;
  color: var(--text-muted);
  display: block;
}

.summary-val {
  font-size: 16px;
  font-weight: 700;
  color: var(--primary);
}

/* ================= MAIN CONTENT & VIEWS ================= */
.content-container {
  flex: 1;
  padding: 16px 16px calc(var(--safe-bottom) + 85px) 16px;
}

.view-panel {
  display: none;
  animation: fadeIn 0.2s ease-in-out;
}

.view-panel.active {
  display: block;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

.section-heading {
  margin: 20px 0 12px 0;
}

.section-heading h2 {
  font-size: 19px;
  font-weight: 700;
  color: var(--text-main);
}

.section-heading h3 {
  font-size: 17px;
  font-weight: 700;
  color: var(--text-main);
}

.heading-sub {
  font-size: 13px;
  color: var(--text-muted);
  display: block;
  margin-top: 2px;
}

.section-heading-with-action {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 12px 0 16px 0;
}

.section-heading-with-action h2 {
  font-size: 19px;
  font-weight: 700;
}

/* ================= DATE NAVIGATOR ================= */
.date-navigator-card {
  background: var(--bg-card);
  border-radius: var(--border-radius-md);
  padding: 10px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-color);
  margin-bottom: 12px;
  position: relative;
}

.nav-arrow-btn {
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
  border-radius: 50%;
  border: 1px solid var(--border-color);
  background: var(--bg-surface);
  color: var(--text-main);
  font-size: 22px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.15s ease;
}

.nav-arrow-btn:active {
  background: #E2E8F0;
  transform: scale(0.95);
}

.date-center {
  text-align: center;
  cursor: pointer;
  padding: 4px 10px;
  border-radius: var(--border-radius-sm);
  position: relative;
}

.date-center:hover {
  background: var(--bg-surface);
}

.date-weekday {
  display: block;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--primary);
}

.date-full {
  display: block;
  font-size: 17px;
  font-weight: 700;
  color: var(--text-main);
}

.hidden-date-input {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}

.today-shortcut-btn {
  background: var(--primary-light);
  color: var(--primary-text);
  border: none;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  padding: 6px 12px;
  cursor: pointer;
}

.today-shortcut-btn:active {
  background: #C7D2FE;
}

/* ================= GARDEN DAY ATTENDANCE ================= */
.garden-day-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-md);
  padding: 12px 14px;
  margin-bottom: 12px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.garden-day-top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border-color);
  flex-wrap: wrap;
}

.day-type-badge {
  font-size: 11.5px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.day-type-badge.workday {
  background: #F1F5F9;
  color: var(--text-muted);
}

.day-type-badge.holiday {
  background: #EFF6FF;
  border: 1px solid #BFDBFE;
  color: #1D4ED8;
}

.day-type-badge.custom {
  background: #FEF3C7;
  border: 1px solid #FDE68A;
  color: #B45309;
}

.btn-toggle-daytype {
  background: none;
  border: 1px dashed var(--border-color);
  border-radius: 12px;
  font-size: 12px;
  font-weight: 500;
  color: var(--primary);
  padding: 6px 10px;
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-toggle-daytype:hover {
  background: var(--bg-surface);
  border-color: var(--primary);
}

.garden-day-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.garden-day-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 6px;
}

.garden-status-pills {
  display: flex;
  gap: 6px;
}

.btn-garden-status {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: 22px;
  font-size: 13px;
  font-weight: 600;
  padding: 10px 16px;
  min-height: 44px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--text-muted);
  transition: all 0.15s ease;
}

.btn-garden-status.active-present {
  background: #DCFCE7;
  border-color: #86EFAC;
  color: #15803D;
}

.btn-garden-status.active-absent {
  background: #FEE2E2;
  border-color: #FCA5A5;
  color: #B91C1C;
}

.btn-garden-status.active-weekend {
  background: #F1F5F9;
  border-color: #CBD5E1;
  color: #64748B;
}

.garden-reason-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-top: 8px;
  border-top: 1px dashed var(--border-color);
  flex-wrap: wrap;
}

.reason-label {
  font-size: 12px;
  color: var(--text-muted);
}

.reason-chips {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.chip-reason {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: 18px;
  font-size: 13px;
  font-weight: 500;
  padding: 8px 14px;
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-muted);
  transition: all 0.15s ease;
}

.chip-reason.active {
  background: #FEF2F2;
  border-color: #EF4444;
  color: #B91C1C;
  font-weight: 600;
}

/* Garden Summary Card in Month View */
.garden-summary-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-md);
  padding: 12px 14px;
  margin-bottom: 14px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.gsm-top {
  display: flex;
  align-items: center;
  gap: 10px;
}

.gsm-icon {
  font-size: 22px;
}

.gsm-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-main);
}

.gsm-sub {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}

.gsm-badges-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 2px;
}

.gsm-pill {
  font-size: 12px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.gsm-pill.present {
  background: #DCFCE7;
  color: #15803D;
}

.gsm-pill.absent {
  background: #FEE2E2;
  color: #B91C1C;
}

/* ================= STAT BANNER ================= */
.day-stat-banner {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-md);
  padding: 12px 14px;
  font-size: 14px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 14px;
  margin-bottom: 24px;
  box-shadow: var(--shadow-sm);
}

.day-stat-banner strong {
  color: var(--text-main);
  font-size: 15px;
}

/* ================= ACTIVITY CARDS LIST (TODAY) ================= */
.activity-cards-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.activity-day-card {
  background: var(--bg-card);
  border-radius: var(--border-radius-md);
  padding: 14px 16px;
  border: 2px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: var(--shadow-sm);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  cursor: pointer;
  user-select: none;
}

.activity-day-card:active {
  transform: scale(0.985);
}

.activity-day-card.attended {
  border-color: var(--success);
  background: #F0FDF4;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.12);
}

.act-left-info {
  display: flex;
  align-items: center;
  gap: 14px;
  flex: 1;
}

.act-icon {
  font-size: 28px;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--bg-surface);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.activity-day-card.attended .act-icon {
  background: #DCFCE7;
}

.act-text-details {
  display: flex;
  flex-direction: column;
}

.act-name {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-main);
}

.act-meta-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 3px;
  flex-wrap: wrap;
}

.act-price-badge {
  font-size: 12px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 6px;
  background: var(--bg-surface);
  color: var(--text-muted);
}

.activity-day-card.attended .act-price-badge {
  background: #DCFCE7;
  color: var(--success-dark);
}

.act-scheduled-tag {
  font-size: 11px;
  color: var(--primary);
  font-weight: 500;
}

/* Big Checkbox Toggle Button */
.act-toggle-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 2px solid #CBD5E1;
  background: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  color: transparent;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  flex-shrink: 0;
}

.activity-day-card.attended .act-toggle-btn {
  background: var(--success);
  border-color: var(--success);
  color: #FFFFFF;
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.4);
}

/* Day Note Field */
.day-note-wrapper {
  margin-top: 18px;
  background: var(--bg-card);
  padding: 12px 14px;
  border-radius: var(--border-radius-md);
  border: 1px solid var(--border-color);
}

.note-label {
  font-size: 13px;
  color: var(--text-muted);
  font-weight: 600;
  margin-bottom: 6px;
  display: block;
}

.note-input {
  width: 100%;
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-sm);
  padding: 10px 12px;
  font-size: 16px;
  outline: none;
  font-family: inherit;
  transition: border-color 0.2s;
}

.note-input:focus {
  border-color: var(--primary);
}

/* ================= MONTH & REPORT VIEW ================= */
.month-selector-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.month-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-main);
}

.finance-cards-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 16px;
}

.finance-card {
  background: var(--bg-card);
  border-radius: var(--border-radius-md);
  padding: 14px;
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
}

.finance-card.card-actual {
  border-left: 4px solid var(--primary);
}

.finance-card.card-forecast {
  border-left: 4px solid var(--warning);
  background: #FFFDF9;
}

.card-caption {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.card-amount {
  font-size: 22px;
  font-weight: 800;
  color: var(--text-main);
  margin: 4px 0 2px 0;
}

.card-desc {
  font-size: 12px;
  color: var(--text-muted);
}

/* Report Action Buttons */
.report-actions-panel {
  margin-bottom: 20px;
}

.action-btn-primary {
  width: 100%;
  background: linear-gradient(135deg, #4F46E5 0%, #3B82F6 100%);
  color: #FFFFFF;
  border: none;
  border-radius: var(--border-radius-md);
  padding: 14px 18px;
  font-size: 16px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(79, 70, 229, 0.35);
  transition: all 0.2s;
}

.action-btn-primary:active {
  transform: scale(0.98);
  box-shadow: 0 2px 6px rgba(79, 70, 229, 0.2);
}

.action-btn-secondary {
  width: 100%;
  background: var(--bg-surface);
  color: var(--primary-text);
  border: 1px solid #C7D2FE;
  border-radius: var(--border-radius-md);
  padding: 12px 16px;
  font-size: 14px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  transition: background 0.15s;
}

.action-btn-secondary:active {
  background: var(--primary-light);
}

.btn-footnote {
  text-align: center;
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 6px;
}

/* Mini Monthly Calendar */
.monthly-calendar-card {
  background: var(--bg-card);
  border-radius: var(--border-radius-md);
  padding: 14px;
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
  margin-bottom: 20px;
}

.calendar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.calendar-header h3 {
  font-size: 15px;
  font-weight: 600;
}

.legend-dot-info {
  font-size: 12px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 4px;
}

.mini-dot.green {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--success);
  display: inline-block;
}

.mini-dot.red {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #EF4444;
  display: inline-block;
}

.mini-dot.blue {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #3B82F6;
  display: inline-block;
}

.weekdays-row {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  text-align: center;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-light);
  margin-bottom: 6px;
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}

.cal-day-cell {
  aspect-ratio: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  position: relative;
  transition: background 0.1s;
}

.cal-day-cell:hover {
  background: var(--bg-surface);
}

.cal-day-cell.empty {
  cursor: default;
  pointer-events: none;
}

.cal-day-cell.today {
  border: 1.5px solid var(--primary);
  font-weight: 700;
  color: var(--primary);
}

.cal-day-cell.has-attendance {
  background: #ECFDF5;
  font-weight: 700;
  color: #065F46;
}

.cal-day-cell.is-absent {
  background: #FEF2F2;
  font-weight: 700;
  color: #B91C1C;
}

.cal-day-cell.is-holiday {
  background: #EFF6FF;
  color: #1D4ED8;
  font-weight: 600;
}

.cal-dots-container {
  display: flex;
  gap: 2px;
  margin-top: 2px;
  height: 4px;
}

.cal-dot {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--success);
}

.cal-dot.red {
  background: #EF4444;
}

.cal-dot.blue {
  background: #3B82F6;
}

/* Breakdown List */
.month-breakdown-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 20px;
}

.breakdown-card {
  background: var(--bg-card);
  border-radius: var(--border-radius-md);
  padding: 12px 16px;
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
}

.bd-top-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.bd-title-group {
  display: flex;
  align-items: center;
  gap: 10px;
}

.bd-emoji {
  font-size: 22px;
}

.bd-name {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-main);
}

.bd-count-tag {
  font-size: 12px;
  color: var(--text-muted);
}

.bd-total-price {
  font-size: 16px;
  font-weight: 700;
  color: var(--primary);
}

.bd-dates-row {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px dashed var(--border-color);
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.4;
}

.bd-dates-row strong {
  color: var(--text-main);
}

/* Report Preview */
.report-preview-card {
  background: var(--bg-surface);
  border-radius: var(--border-radius-md);
  padding: 14px;
  border: 1px solid var(--border-color);
}

.preview-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
}

.mini-copy-link {
  background: none;
  border: none;
  color: var(--primary);
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  padding: 2px 6px;
}

.report-text-pre {
  font-family: -apple-system, BlinkMacSystemFont, "SF Mono", Menlo, Consolas, monospace;
  font-size: 13px;
  line-height: 1.6;
  white-space: pre-wrap;
  color: var(--text-main);
  background: #FFFFFF;
  padding: 12px;
  border-radius: var(--border-radius-sm);
  border: 1px solid var(--border-color);
  max-height: 240px;
  overflow-y: auto;
}

/* ================= PACKAGES / АБОНЕМЕНТЫ ================= */
.packages-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: 20px;
}

.package-card {
  background: var(--bg-card);
  border-radius: var(--border-radius-md);
  padding: 16px;
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
}

.package-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 12px;
}

.pkg-title-area {
  display: flex;
  align-items: center;
  gap: 10px;
}

.pkg-title {
  font-size: 16px;
  font-weight: 700;
}

.pkg-subtitle {
  font-size: 12px;
  color: var(--text-muted);
}

.pkg-badge-active {
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 12px;
  background: var(--success-light);
  color: var(--success-dark);
}

.pkg-progress-bar-bg {
  width: 100%;
  height: 10px;
  border-radius: 10px;
  background: var(--bg-surface);
  overflow: hidden;
  margin: 10px 0 8px 0;
}

.pkg-progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #10B981, #059669);
  border-radius: 10px;
  transition: width 0.3s ease;
}

.pkg-stats-row {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
}

.pkg-remaining-count {
  font-weight: 700;
  color: var(--success-dark);
}

/* Package Payment Status Banner */
.pkg-payment-banner {
  border-radius: var(--border-radius-sm);
  padding: 12px 14px;
  margin-bottom: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: all 0.2s ease;
}

.pkg-payment-banner.unpaid {
  background: #FFFBEB;
  border: 1px solid #FDE68A;
}

.pkg-payment-banner.paid {
  background: #F0FDF4;
  border: 1px solid #BBF7D0;
}

.pkg-payment-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.pkg-purchase-month {
  font-size: 13px;
  color: var(--text-main);
}

.pkg-paid-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 8px;
}

.pkg-paid-pill.unpaid {
  background: #FEF3C7;
  color: #B45309;
}

.pkg-paid-pill.paid {
  background: #DCFCE7;
  color: #15803D;
}

.pkg-toggle-paid-btn {
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all 0.15s ease;
}

.pkg-toggle-paid-btn.is-unpaid {
  background: #2563EB;
  color: #FFFFFF;
  border: 1px solid #1D4ED8;
}

.pkg-toggle-paid-btn.is-unpaid:hover {
  background: #1D4ED8;
}

.pkg-toggle-paid-btn.is-paid {
  background: transparent;
  color: var(--text-muted);
  border: 1px dashed var(--border-color);
}

.pkg-toggle-paid-btn.is-paid:hover {
  background: var(--bg-surface);
}

.pkg-forecast-box {
  background: #F8FAFC;
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-sm);
  padding: 10px 12px;
  margin-top: 12px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.pkg-forecast-icon {
  font-size: 20px;
  line-height: 1;
}

.pkg-forecast-title {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  margin-bottom: 2px;
}

.pkg-forecast-value {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-main);
}

.packages-info-card {
  background: #F0FDF4;
  border: 1px solid #BBF7D0;
  border-radius: var(--border-radius-md);
  padding: 14px;
  font-size: 13px;
  color: #166534;
}

.packages-info-card h4 {
  margin-bottom: 4px;
}

/* ================= SETTINGS & ACTIVITIES ================= */
.settings-card {
  background: var(--bg-card);
  border-radius: var(--border-radius-md);
  padding: 16px;
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
  margin-bottom: 16px;
}

.settings-card h3 {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 6px;
}

.setting-field-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  display: block;
  margin-bottom: 6px;
}

.input-with-button {
  display: flex;
  gap: 8px;
}

.form-input {
  flex: 1;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
  padding: 10px 14px;
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-sm);
  font-size: 16px;
  outline: none;
  font-family: inherit;
  background: #FFFFFF;
}

select.form-input {
  text-overflow: ellipsis;
  white-space: nowrap;
  overflow: hidden;
  cursor: pointer;
}

.form-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-light);
}

.settings-activities-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 16px;
}

.setting-activity-item {
  background: var(--bg-card);
  border-radius: var(--border-radius-md);
  padding: 12px 14px;
  border: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: var(--shadow-sm);
}

.set-act-info {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
}

.set-act-emoji {
  font-size: 24px;
}

.set-act-name {
  font-size: 15px;
  font-weight: 600;
}

.set-act-price {
  font-size: 13px;
  color: var(--text-muted);
}

.set-act-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.btn-icon-action {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.15s;
}

.btn-icon-action:hover {
  background: var(--primary-light);
}

.setting-activity-item.disabled {
  opacity: 0.6;
  background: var(--bg-surface);
  border-style: dashed;
}

.set-act-status-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 500;
  padding: 1px 6px;
  border-radius: 6px;
  margin-left: 6px;
  vertical-align: middle;
}

/* iOS-style toggle switch */
.toggle-switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 26px;
  flex-shrink: 0;
  cursor: pointer;
  margin-right: 4px;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #CBD5E1;
  transition: 0.2s ease;
  border-radius: 26px;
}

.toggle-slider:before {
  position: absolute;
  content: "";
  height: 20px;
  width: 20px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: 0.2s ease;
  border-radius: 50%;
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.toggle-switch input:checked + .toggle-slider {
  background-color: var(--success);
}

.toggle-switch input:checked + .toggle-slider:before {
  transform: translateX(18px);
}

.customize-activities-hint {
  margin-top: 14px;
  text-align: center;
}

.btn-customize-link {
  background: transparent;
  border: 1px dashed var(--border-color);
  color: var(--primary);
  font-size: 13px;
  font-weight: 500;
  padding: 10px 16px;
  border-radius: var(--border-radius-md);
  cursor: pointer;
  width: 100%;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.btn-customize-link:hover {
  background: var(--primary-light);
  border-color: var(--primary);
}

.btn-icon-action.delete:hover {
  background: var(--danger-light);
  color: var(--danger);
  border-color: #FECACA;
}

.backup-buttons-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 10px;
}

.btn-outline {
  padding: 10px;
  background: #FFFFFF;
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-sm);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  color: var(--text-main);
  transition: background 0.15s;
}

.btn-outline:active {
  background: var(--bg-surface);
}

.btn-danger-text {
  background: none;
  border: none;
  color: var(--danger);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  padding: 4px 0;
  text-decoration: underline;
}

.btn-small-action {
  background: var(--primary-light);
  color: var(--primary-text);
  border: 1px solid #C7D2FE;
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.btn-small-action:active {
  background: #C7D2FE;
}

.btn-secondary {
  padding: 10px 16px;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-sm);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

.text-muted {
  font-size: 13px;
  color: var(--text-muted);
}

/* ================= BOTTOM NAVIGATION ================= */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 540px;
  height: calc(65px + var(--safe-bottom));
  padding-bottom: var(--safe-bottom);
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: space-around;
  align-items: center;
  z-index: 50;
}

.nav-tab {
  flex: 1;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  transition: all 0.15s ease;
  padding-top: 4px;
}

.tab-icon {
  font-size: 20px;
  line-height: 1;
  margin-bottom: 3px;
  transition: transform 0.15s ease;
}

.tab-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: -0.1px;
}

.nav-tab.active {
  color: var(--primary);
}

.nav-tab.active .tab-icon {
  transform: translateY(-2px) scale(1.1);
}

/* ================= MODAL / DIALOG ================= */
.app-dialog {
  border: none;
  border-radius: var(--border-radius-lg);
  padding: 0;
  max-width: 480px;
  width: calc(100% - 32px);
  max-height: calc(100dvh - 32px);
  max-height: calc(100vh - 32px);
  margin: auto;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.2), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
  background: var(--bg-card);
}

.app-dialog:not([open]) {
  display: none !important;
}

.app-dialog[open] {
  display: flex;
  flex-direction: column;
}

.app-dialog::backdrop {
  background: rgba(15, 23, 42, 0.5);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.dialog-content {
  display: flex;
  flex-direction: column;
  max-height: calc(100dvh - 32px);
  max-height: calc(100vh - 32px);
  overflow: hidden;
}

.dialog-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-shrink: 0;
}

.dialog-header h3 {
  font-size: 17px;
  font-weight: 700;
}

.dialog-close-btn {
  background: none;
  border: none;
  font-size: 24px;
  color: var(--text-muted);
  cursor: pointer;
  line-height: 1;
}

.dialog-body {
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  flex: 1;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-group label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-main);
}

.form-help {
  font-size: 11px;
  color: var(--text-muted);
}

.form-row-2 {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 12px;
}

.form-row-2 > .form-group {
  min-width: 0;
}

@media (max-width: 380px) {
  .form-row-2 {
    grid-template-columns: 1fr;
    gap: 10px;
  }
}

.weekdays-toggle-group {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.day-chip {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--border-color);
  background: var(--bg-surface);
  font-size: 12px;
  font-weight: 600;
  color: var(--text-main);
  cursor: pointer;
  transition: all 0.15s;
}

.day-chip.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #FFFFFF;
}

.dialog-footer {
  padding: 14px 20px;
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  background: var(--bg-surface);
  flex-shrink: 0;
}

.btn-cancel {
  padding: 10px 16px;
  background: #FFFFFF;
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-sm);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

.btn-save {
  padding: 10px 20px;
  background: var(--primary);
  color: #FFFFFF;
  border: none;
  border-radius: var(--border-radius-sm);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

/* ================= TOAST NOTIFICATION ================= */
.toast-popup {
  position: fixed;
  top: calc(var(--safe-top) + 20px);
  left: 50%;
  transform: translateX(-50%) translateY(-30px);
  background: #0F172A;
  color: #FFFFFF;
  padding: 12px 20px;
  border-radius: 30px;
  font-size: 14px;
  font-weight: 600;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.25);
  opacity: 0;
  pointer-events: none;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 100;
  display: flex;
  align-items: center;
  gap: 8px;
  text-align: center;
  max-width: 90%;
}

.toast-popup.visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ================= AUTHOR FOOTER ================= */
.author-footer-card {
  text-align: center;
  padding: 12px 10px 16px 10px;
  margin-top: 8px;
  margin-bottom: 20px;
  border-top: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.author-feedback-row {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 7px;
}

.author-feedback-text {
  font-size: 12px;
  color: var(--text-muted);
}

.author-feedback-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: var(--bg-surface);
  color: var(--text-muted) !important;
  border: 1px solid var(--border-color);
  text-decoration: none;
  font-size: 11.5px;
  font-weight: 500;
  padding: 3px 10px;
  border-radius: 12px;
  box-shadow: none;
  transition: all 0.15s ease;
}

.author-feedback-btn:hover {
  background: #E2E8F0;
  color: var(--text-main) !important;
  border-color: #CBD5E1;
}

.author-copyright {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-muted);
  opacity: 0.8;
  margin: 0;
}

.tg-svg-icon {
  flex-shrink: 0;
  opacity: 0.7;
  color: #475569;
}

/* ================= PWA INSTALL BANNER ================= */
.pwa-install-banner {
  position: fixed;
  bottom: calc(var(--nav-height) + 12px + env(safe-area-inset-bottom, 0px));
  left: 14px;
  right: 14px;
  max-width: 480px;
  margin: 0 auto;
  background: #1E293B;
  color: #FFFFFF;
  border-radius: 16px;
  padding: 11px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.28);
  z-index: 9999;
  animation: slideUpPwaBanner 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slideUpPwaBanner {
  from { transform: translateY(24px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.pwa-banner-content {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  line-height: 1.35;
}

.pwa-banner-icon {
  font-size: 22px;
  flex-shrink: 0;
}

.pwa-banner-close {
  background: rgba(255, 255, 255, 0.15);
  border: none;
  color: #FFFFFF;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  font-size: 13px;
  font-weight: bold;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 0.15s ease;
}

.pwa-banner-close:active {
  background: rgba(255, 255, 255, 0.35);
}

/* ================= PWA UPDATE BANNER ================= */
.pwa-update-toast {
  position: fixed;
  top: calc(var(--safe-top) + 14px);
  left: 14px;
  right: 14px;
  max-width: 480px;
  margin: 0 auto;
  background: #1E1B4B;
  color: #EEF2FF;
  border: 1px solid #4338CA;
  border-radius: 16px;
  padding: 10px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
  z-index: 10000;
  animation: slideDownToast 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slideDownToast {
  from { transform: translateY(-30px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.pwa-update-text {
  font-size: 13px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 6px;
}

.btn-pwa-update {
  background: var(--primary);
  color: #FFFFFF;
  border: none;
  border-radius: 20px;
  padding: 6px 14px;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  box-shadow: 0 2px 8px rgba(79, 70, 229, 0.3);
}

.btn-pwa-update:active {
  background: var(--primary-hover);
}
