/* ============================================================
   CIRCUITO — Design System (Apple Glassmorphism)
   Identidade visual do ecossistema Peregrino
   ============================================================ */

/* ---- Tokens ---- */
:root {
  --apple-blue: #0a84ff;
  --apple-green: #30d158;
  --apple-orange: #ff9f0a;
  --apple-red: #ff453a;
  --apple-yellow: #ffd60a;
  --apple-purple: #bf5af2;
  --apple-teal: #64d2ff;
  --text-primary: #ffffff;
  --text-secondary: rgba(255, 255, 255, 0.6);
  --text-tertiary: rgba(255, 255, 255, 0.35);
  --card-bg: rgba(20, 20, 24, 0.65);
  --card-border: rgba(255, 255, 255, 0.08);
  --card-hover: rgba(255, 255, 255, 0.16);
  --input-bg: rgba(255, 255, 255, 0.06);
  --input-border: rgba(255, 255, 255, 0.12);
  --input-focus: rgba(10, 132, 255, 0.5);
  --font-main: "Barlow Semi Condensed", "Avenir Next Condensed", -apple-system, BlinkMacSystemFont, "SF Pro Display", sans-serif;
  --font-mono: "JetBrains Mono", "SF Mono", monospace;
  --radius: 14px;
  --radius-sm: 8px;
  --radius-xs: 6px;
  --transition: 0.2s cubic-bezier(0.2, 0.8, 0.2, 1);
}

/* ---- Reset ---- */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html, body { height: 100%; }

body {
  font-family: var(--font-main);
  letter-spacing: 0.2px;
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  font-size: 15px;
  line-height: 1.5;
  background-color: #031332;
  background-image:
    radial-gradient(circle at 0% 0%, rgba(40, 110, 255, 0.4) 0%, transparent 60%),
    radial-gradient(circle at 100% 100%, rgba(130, 40, 255, 0.3) 0%, transparent 60%),
    radial-gradient(circle at 100% 0%, rgba(10, 200, 255, 0.2) 0%, transparent 50%),
    linear-gradient(135deg, #020917 0%, #0a1b3f 100%);
  background-attachment: fixed;
}

/* ---- Layout ---- */
.container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 16px 16px 100px;
}

/* ---- Header ---- */
.app-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 18px;
  padding: 4px 2px;
  flex-wrap: wrap;
  gap: 10px;
}

.app-title-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
}

.app-title {
  font-size: 32px;
  font-weight: 700;
  letter-spacing: -0.5px;
  background: linear-gradient(180deg, #fff 0%, rgba(255,255,255,0.85) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.app-badge {
  background: rgba(10, 132, 255, 0.15);
  color: var(--apple-blue);
  border: 1px solid rgba(10, 132, 255, 0.35);
  padding: 4px 10px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.app-badge::before {
  content: "";
  width: 6px;
  height: 6px;
  background: var(--apple-blue);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--apple-blue);
}

.app-meta {
  font-size: 14px;
  color: var(--text-secondary);
  font-weight: 500;
  font-family: var(--font-mono);
}

/* ---- Navigation Tabs ---- */
.nav-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 20px;
  padding: 4px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--card-border);
  border-radius: 14px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.nav-tab {
  flex: 1;
  min-width: 120px;
  padding: 10px 14px;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-family: var(--font-main);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  border-radius: 10px;
  transition: all var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  white-space: nowrap;
}

.nav-tab:hover {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-primary);
}

.nav-tab.active {
  background: var(--apple-blue);
  color: #fff;
  box-shadow: 0 4px 16px rgba(10, 132, 255, 0.35);
}

.nav-tab i {
  font-size: 13px;
}

/* ---- Tab Content ---- */
.tab-panel {
  display: none;
  animation: fadeSlideIn 0.3s var(--transition);
}

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

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

/* ---- Glass Card ---- */
.glass-card {
  background: var(--card-bg);
  backdrop-filter: blur(40px) saturate(150%);
  -webkit-backdrop-filter: blur(40px) saturate(150%);
  border: 1px solid var(--card-border);
  border-radius: 20px;
  box-shadow:
    0 12px 30px rgba(0, 0, 0, 0.25),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
  margin-bottom: 16px;
  overflow: hidden;
}

.card-header {
  padding: 14px 20px;
  border-bottom: 1px solid var(--card-border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.card-title {
  font-size: 18px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
  color: #fff;
}

.card-title i {
  font-size: 16px;
  opacity: 0.8;
}

.card-subtitle {
  font-size: 13px;
  color: var(--text-secondary);
}

.card-body {
  padding: 20px;
}

.card-body-compact {
  padding: 14px 20px;
}

/* ---- KPI Cards ---- */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}

.kpi-card {
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 14px 16px;
  transition: border-color var(--transition);
}

.kpi-card:hover {
  border-color: var(--card-hover);
}

.kpi-label {
  font-size: 11px;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 600;
}

.kpi-value {
  font-size: 28px;
  font-weight: 700;
  margin-top: 4px;
  color: #fff;
  font-family: var(--font-mono);
}

.kpi-sub {
  font-size: 12px;
  font-weight: 600;
  margin-top: 2px;
}

.kpi-blue .kpi-value { color: var(--apple-blue); }
.kpi-green .kpi-value { color: var(--apple-green); }
.kpi-orange .kpi-value { color: var(--apple-orange); }
.kpi-purple .kpi-value { color: var(--apple-purple); }
.kpi-teal .kpi-value { color: var(--apple-teal); }

/* ---- Forms ---- */
.form-row {
  display: flex;
  gap: 10px;
  margin-bottom: 12px;
  flex-wrap: wrap;
  align-items: flex-end;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
  min-width: 140px;
}

.form-label {
  font-size: 11px;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  font-weight: 600;
}

.form-input, .form-select, .form-textarea {
  background: var(--input-bg);
  border: 1px solid var(--input-border);
  border-radius: var(--radius-sm);
  padding: 9px 12px;
  color: var(--text-primary);
  font-family: var(--font-main);
  font-size: 14px;
  transition: border-color var(--transition), box-shadow var(--transition);
  outline: none;
  width: 100%;
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
  border-color: var(--apple-blue);
  box-shadow: 0 0 0 3px var(--input-focus);
}

.form-select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='rgba(255,255,255,0.5)' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 30px;
}

.form-textarea {
  min-height: 70px;
  resize: vertical;
}

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

/* ---- Buttons ---- */
.btn {
  padding: 9px 18px;
  border: none;
  border-radius: var(--radius-sm);
  font-family: var(--font-main);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.btn-primary {
  background: var(--apple-blue);
  color: #fff;
}

.btn-primary:hover {
  background: #3399ff;
  box-shadow: 0 4px 14px rgba(10, 132, 255, 0.4);
}

.btn-success {
  background: rgba(48, 209, 88, 0.15);
  color: var(--apple-green);
  border: 1px solid rgba(48, 209, 88, 0.3);
}

.btn-success:hover {
  background: rgba(48, 209, 88, 0.25);
}

.btn-danger {
  background: rgba(255, 69, 58, 0.12);
  color: var(--apple-red);
  border: 1px solid rgba(255, 69, 58, 0.25);
}

.btn-danger:hover {
  background: rgba(255, 69, 58, 0.2);
}

.btn-ghost {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-secondary);
  border: 1px solid var(--input-border);
}

.btn-ghost:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-primary);
}

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

.btn-icon {
  width: 34px;
  height: 34px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-xs);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--input-border);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition);
}

.btn-icon:hover {
  background: rgba(255, 69, 58, 0.15);
  color: var(--apple-red);
  border-color: rgba(255, 69, 58, 0.3);
}

/* ---- Tables ---- */
.table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: var(--radius);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.data-table th {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-secondary);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  font-weight: 700;
  padding: 10px 12px;
  text-align: left;
  border-bottom: 1px solid var(--card-border);
  white-space: nowrap;
  position: sticky;
  top: 0;
  z-index: 2;
}

.data-table td {
  padding: 8px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  vertical-align: middle;
}

.data-table tbody tr {
  transition: background var(--transition);
}

.data-table tbody tr:hover {
  background: rgba(255, 255, 255, 0.03);
}

.data-table .num-input {
  background: var(--input-bg);
  border: 1px solid transparent;
  border-radius: var(--radius-xs);
  padding: 5px 8px;
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 13px;
  width: 70px;
  text-align: right;
  transition: border-color var(--transition);
  outline: none;
}

.data-table .num-input:focus {
  border-color: var(--apple-blue);
}

.data-table tfoot td {
  font-weight: 700;
  border-top: 2px solid rgba(10, 132, 255, 0.3);
  background: rgba(10, 132, 255, 0.04);
  color: var(--apple-blue);
}

.data-table .text-input {
  background: var(--input-bg);
  border: 1px solid transparent;
  border-radius: var(--radius-xs);
  padding: 5px 8px;
  color: var(--text-primary);
  font-family: var(--font-main);
  font-size: 13px;
  width: 100%;
  outline: none;
}

.data-table .text-input:focus {
  border-color: var(--apple-blue);
}

/* ---- Congregations List ---- */
.cong-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.cong-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: var(--radius-sm);
  transition: all var(--transition);
}

.cong-item:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: var(--card-hover);
}

.cong-num {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--apple-blue);
  font-weight: 700;
  min-width: 60px;
}

.cong-name {
  font-weight: 600;
  font-size: 14px;
  flex: 1;
}

.cong-city {
  font-size: 12px;
  color: var(--text-secondary);
}

.cong-parte {
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 6px;
  text-transform: uppercase;
}

.parte-a { background: rgba(10, 132, 255, 0.15); color: var(--apple-blue); }
.parte-b { background: rgba(48, 209, 88, 0.15); color: var(--apple-green); }
.parte-c { background: rgba(255, 159, 10, 0.15); color: var(--apple-orange); }

/* ---- Map ---- */
#map-container {
  width: 100%;
  height: 400px;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--card-border);
}

.leaflet-popup-content-wrapper {
  background: rgba(20, 20, 30, 0.9) !important;
  color: #fff !important;
  border-radius: 10px !important;
  backdrop-filter: blur(20px) !important;
  border: 1px solid rgba(255,255,255,0.1) !important;
  box-shadow: 0 8px 25px rgba(0,0,0,0.4) !important;
}

.leaflet-popup-content {
  margin: 10px 14px !important;
  font-family: var(--font-main) !important;
  font-size: 13px !important;
}

.leaflet-popup-tip {
  background: rgba(20, 20, 30, 0.9) !important;
}

/* ---- Calendar/Itinerary ---- */
.cal-controls {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.cal-month-label {
  font-size: 20px;
  font-weight: 700;
  min-width: 180px;
  text-align: center;
}

.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
  margin-bottom: 16px;
}

.cal-day-header {
  text-align: center;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  padding: 8px 4px;
}

.cal-day {
  min-height: 80px;
  padding: 6px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.04);
  border-radius: var(--radius-xs);
  cursor: pointer;
  transition: all var(--transition);
  position: relative;
}

.cal-day:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: var(--card-hover);
}

.cal-day.other-month {
  opacity: 0.3;
}

.cal-day.today {
  border-color: var(--apple-blue);
  box-shadow: inset 0 0 0 1px var(--apple-blue);
}

.cal-day-num {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 4px;
}

.cal-day.today .cal-day-num {
  color: var(--apple-blue);
  font-weight: 700;
}

.cal-event {
  font-size: 10px;
  padding: 2px 5px;
  border-radius: 4px;
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-weight: 600;
  cursor: pointer;
}

.cal-event.visita { background: rgba(48, 209, 88, 0.2); color: var(--apple-green); }
.cal-event.substituto { background: rgba(10, 132, 255, 0.2); color: var(--apple-blue); }
.cal-event.assembleia { background: rgba(191, 90, 242, 0.2); color: var(--apple-purple); }
.cal-event.congresso { background: rgba(255, 214, 10, 0.2); color: var(--apple-yellow); }
.cal-event.ausencia { background: rgba(255, 69, 58, 0.2); color: var(--apple-red); }

/* ---- Cycle Progress ---- */
.cycle-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 10px;
}

.cycle-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: var(--radius-sm);
}

.cycle-dots {
  display: flex;
  gap: 4px;
}

.cycle-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 1.5px solid rgba(255, 255, 255, 0.2);
  transition: all var(--transition);
}

.cycle-dot.done {
  background: var(--apple-green);
  border-color: var(--apple-green);
  box-shadow: 0 0 6px rgba(48, 209, 88, 0.4);
}

.cycle-dot.overdue {
  background: var(--apple-orange);
  border-color: var(--apple-orange);
}

.cycle-info {
  flex: 1;
  min-width: 0;
}

.cycle-cong-name {
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cycle-last-visit {
  font-size: 11px;
  color: var(--text-secondary);
}

/* ---- Programação da Semana ---- */
.prog-section {
  margin-bottom: 24px;
}

.prog-section-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--apple-blue);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 12px;
  padding-bottom: 6px;
  border-bottom: 1px solid rgba(10, 132, 255, 0.2);
  display: flex;
  align-items: center;
  gap: 8px;
}

.prog-day-row {
  display: grid;
  grid-template-columns: 70px 70px 1fr 1fr 1fr;
  gap: 8px;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.prog-day-row.header {
  border-bottom: 1px solid var(--card-border);
}

.prog-day-row .day-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
}

.prog-day-row .time-label {
  font-size: 13px;
  font-family: var(--font-mono);
  color: var(--text-secondary);
}

.prog-hospedagem {
  display: grid;
  grid-template-columns: 1fr 1fr 2fr;
  gap: 10px;
}

.prog-refeicao-grid {
  display: grid;
  grid-template-columns: 70px 70px 1fr 1fr 1fr;
  gap: 8px;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.prog-note {
  font-size: 12px;
  color: var(--apple-orange);
  font-style: italic;
  padding: 6px 0;
}

/* ---- Charts ---- */
.chart-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 14px;
}

.chart-box {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 16px;
}

.chart-box-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 12px;
}

.chart-box svg {
  width: 100%;
  height: auto;
}

/* ---- Sub-tabs ---- */
.sub-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 14px;
}

.sub-tab {
  padding: 7px 14px;
  border: 1px solid var(--input-border);
  background: transparent;
  color: var(--text-secondary);
  font-family: var(--font-main);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: all var(--transition);
}

.sub-tab:hover {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-primary);
}

.sub-tab.active {
  background: rgba(10, 132, 255, 0.15);
  color: var(--apple-blue);
  border-color: rgba(10, 132, 255, 0.35);
}

/* ---- Modal ---- */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(8px);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-overlay.active {
  display: flex;
}

.modal {
  background: rgba(25, 25, 35, 0.95);
  backdrop-filter: blur(40px);
  border: 1px solid var(--card-border);
  border-radius: 20px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  width: 100%;
  max-width: 500px;
  max-height: 90vh;
  overflow-y: auto;
}

.modal-header {
  padding: 18px 22px;
  border-bottom: 1px solid var(--card-border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-title {
  font-size: 18px;
  font-weight: 700;
}

.modal-close {
  width: 30px;
  height: 30px;
  border: none;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-secondary);
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  transition: all var(--transition);
}

.modal-close:hover {
  background: rgba(255, 69, 58, 0.2);
  color: var(--apple-red);
}

.modal-body {
  padding: 20px 22px;
}

.modal-footer {
  padding: 14px 22px;
  border-top: 1px solid var(--card-border);
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

/* ---- Toast ---- */
#toast {
  position: fixed;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%) translateY(80px);
  background: rgba(30, 30, 40, 0.95);
  backdrop-filter: blur(20px);
  border: 1px solid var(--card-border);
  color: var(--text-primary);
  padding: 12px 22px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 600;
  z-index: 2000;
  opacity: 0;
  transition: all 0.3s ease;
  pointer-events: none;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4);
}

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

/* ---- Utilities ---- */
.text-blue { color: var(--apple-blue) !important; }
.text-green { color: var(--apple-green) !important; }
.text-orange { color: var(--apple-orange) !important; }
.text-red { color: var(--apple-red) !important; }
.text-purple { color: var(--apple-purple) !important; }
.text-muted { color: var(--text-secondary) !important; }
.text-mono { font-family: var(--font-mono) !important; }
.text-center { text-align: center; }
.text-right { text-align: right; }
.mt-8 { margin-top: 8px; }
.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }
.mb-8 { margin-bottom: 8px; }
.mb-12 { margin-bottom: 12px; }
.mb-16 { margin-bottom: 16px; }
.gap-8 { gap: 8px; }
.flex { display: flex; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.flex-center { display: flex; align-items: center; }
.flex-1 { flex: 1; }
.hidden { display: none !important; }

.separator {
  height: 1px;
  background: var(--card-border);
  margin: 16px 0;
}

.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-secondary);
}

.empty-state i {
  font-size: 36px;
  opacity: 0.3;
  margin-bottom: 12px;
  display: block;
}

.empty-state p {
  font-size: 14px;
}

/* ---- Legend ---- */
.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 16px;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-secondary);
}

.legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 3px;
}

/* ---- Responsive ---- */
@media (max-width: 768px) {
  .container {
    padding: 12px 10px 80px;
  }

  .app-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .nav-tabs {
    flex-wrap: nowrap;
    overflow-x: auto;
  }

  .nav-tab {
    min-width: 90px;
    padding: 8px 10px;
    font-size: 12px;
  }

  .nav-tab span.tab-text {
    display: none;
  }

  .kpi-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .cal-grid {
    font-size: 11px;
  }

  .cal-day {
    min-height: 50px;
    padding: 4px;
  }

  .prog-day-row {
    grid-template-columns: 50px 50px 1fr;
  }

  .prog-day-row .form-input:nth-child(n+4) {
    grid-column: 1 / -1;
  }

  .chart-grid {
    grid-template-columns: 1fr;
  }

  #map-container {
    height: 280px;
  }

  .cycle-grid {
    grid-template-columns: 1fr;
  }

  .prog-hospedagem {
    grid-template-columns: 1fr;
  }

  .prog-refeicao-grid {
    grid-template-columns: 50px 50px 1fr;
  }
}

@media (max-width: 480px) {
  .app-title {
    font-size: 24px;
  }

  .kpi-grid {
    grid-template-columns: 1fr 1fr;
  }

  .form-row {
    flex-direction: column;
  }

  .form-group {
    min-width: unset;
  }
}

/* ---- Print ---- */
@media print {
  body { background: #fff; color: #000; }
  .nav-tabs, .app-header, #toast, .modal-overlay, .btn { display: none !important; }
  .glass-card { background: #fff; border: 1px solid #ddd; box-shadow: none; }
  .tab-panel { display: block !important; }
}
