/* Interface do Carona da Turma. style.css é a base do kit (não editar aqui). */
:root {
  --primary: #0e7490;
  --primary-contrast: #ffffff;
  --accent: #0e7490;
  --bg: #f1f5f4;
  --border: #dbe3e2;
}

@media (prefers-color-scheme: dark) {
  :root {
    --primary: #22d3ee;
    --primary-contrast: #062830;
    --accent: #22d3ee;
    --bg: #0d1719;
    --surface: #152326;
    --border: #26383c;
    --text-muted: #9fb4b7;
  }
}

body { font-size: 15px; }
a { color: var(--accent); }
.home-link { color: inherit; text-decoration: none; }
.center { text-align: center; }
.hint { font-size: 13px; color: var(--text-muted); line-height: 1.45; margin: 4px 0; }
.lead { font-size: 15px; line-height: 1.5; margin: 0 0 16px; }
.status-erro { color: var(--danger) !important; }
.update-banner { background: var(--primary); color: var(--primary-contrast); }
a.menu-item { text-decoration: none; display: block; }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-bottom: 14px;
}
.card h2 { font-size: 16px; margin: 0 0 8px; }
.card-title-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.card-title-row h2 { margin: 0; }

.form { display: flex; flex-direction: column; gap: 12px; }
.form-actions { display: flex; justify-content: flex-end; gap: 10px; flex-wrap: wrap; }
.form-status { min-height: 0; font-size: 13px; color: var(--text-muted); margin: 0; }
.form-status:empty { display: none; }
.field textarea, .field select, .sheet select, .busca {
  font: inherit;
  font-size: 15px;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
  width: 100%;
}
.field input { width: 100%; }
.stack { display: flex; flex-direction: column; gap: 10px; }
.stack .btn { justify-content: center; }
.row-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.btn { text-decoration: none; justify-content: center; }
.btn:disabled { opacity: 0.6; }
.check { display: flex; align-items: center; gap: 8px; font-size: 15px; color: var(--text); padding: 6px 0; }
.check input { width: 20px; height: 20px; accent-color: var(--primary); }
.checks { display: flex; flex-direction: column; }
.stepper { display: flex; gap: 8px; align-items: center; }
.stepper .num { width: 80px; text-align: center; font-size: 18px; }
.stepper .btn { font-size: 20px; padding: 6px 16px; }

/* Início */
.link-list { list-style: none; padding: 0; margin: 0; }
.link-list li a { display: block; padding: 10px 0; border-top: 1px solid var(--border); text-decoration: none; color: var(--text); }
.link-list li:first-child a { border-top: none; }
.link-tipo { font-size: 11px; font-weight: 700; text-transform: uppercase; color: var(--accent); }

/* Evento */
.evento-head h2 { font-size: 22px; margin: 0; }
.ev-desc { font-size: 14px; margin: 6px 0 0; white-space: pre-line; }

.tabs {
  display: flex;
  gap: 6px;
  margin: 14px 0 0;
  position: sticky;
  top: 57px;
  z-index: 5;
  background: var(--bg);
  padding: 6px 0;
}
.tab {
  flex: 1;
  font: inherit;
  font-weight: 700;
  font-size: 15px;
  padding: 10px 8px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.tab-ativa { background: var(--primary); color: var(--primary-contrast); border-color: var(--primary); }
.tab-badge { font-size: 12px; min-width: 22px; padding: 2px 6px; border-radius: 999px; }
.badge-falta { background: var(--danger); color: #fff; }
.badge-ok { background: var(--success-bg); color: var(--success); }

.painel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 14px;
  margin: 8px 0 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.painel-sem { background: var(--danger-bg); margin: -12px -14px 0; padding: 12px 14px; border-radius: var(--radius) var(--radius) 0 0; }
.painel-label { font-size: 13px; font-weight: 700; color: var(--danger); margin-bottom: 6px; }
.painel-ok { font-weight: 600; color: var(--success); }
.painel-vagas, .painel-ausentes { font-size: 13px; color: var(--text-muted); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  font: inherit;
  font-size: 14px;
  border-radius: 999px;
  padding: 6px 12px;
  border: 1px solid transparent;
  cursor: pointer;
}
.chip-falta { background: var(--surface); color: var(--danger); border-color: var(--danger); font-weight: 600; }

.ev-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 12px; }
.ev-actions .btn { padding: 12px 10px; font-size: 15px; }
.ev-more { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin: 4px 0 8px; }

.carro {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 14px;
  margin-bottom: 10px;
}
.carro-meu { border-color: var(--primary); box-shadow: inset 4px 0 0 var(--primary); }
.carro-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.carro-head strong { font-size: 16px; }
.carro-num {
  display: inline-flex; align-items: center; justify-content: center;
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--bg); font-size: 12px; font-weight: 700; margin-right: 6px;
}
.tag-meu { font-size: 11px; font-weight: 700; color: var(--accent); margin-left: 6px; }
.carro-status { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; white-space: nowrap; }
.carro-status .ok { color: var(--success); }
.carro-status .falta { color: var(--pending); }
.carro-obs { font-size: 13px; color: var(--text-muted); margin: 4px 0 0; font-style: italic; }
.slots { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-top: 10px; }
.slot {
  font: inherit;
  font-size: 14px;
  min-height: 44px;
  border-radius: 10px;
  padding: 8px 10px;
  cursor: pointer;
  text-align: left;
  display: flex;
  flex-direction: column;
  justify-content: center;
  touch-action: manipulation;
}
.slot-ocupado { background: var(--bg); border: 1px solid var(--border); color: var(--text); font-weight: 600; }
.slot-frente { border-color: var(--primary); }
.slot-tag { font-size: 11px; font-weight: 600; color: var(--accent); }
.slot-livre { background: transparent; border: 2px dashed var(--border); color: var(--accent); font-weight: 600; align-items: center; }

/* Folha (bottom sheet) */
.sheet {
  border: none;
  padding: 0;
  margin: auto auto 0;
  width: 100%;
  max-width: 640px;
  max-height: 88vh;
  border-radius: 18px 18px 0 0;
  background: var(--surface);
  color: var(--text);
}
.sheet::backdrop { background: rgba(0, 0, 0, 0.45); }
.sheet-inner { display: flex; flex-direction: column; max-height: 88vh; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 14px 16px 8px; border-bottom: 1px solid var(--border); }
.sheet-head h3 { margin: 0; font-size: 17px; }
.sheet-body { overflow-y: auto; padding: 12px 16px calc(20px + env(safe-area-inset-bottom)); }
@media (min-width: 700px) {
  .sheet { margin: auto; border-radius: 18px; }
}
.busca { margin-bottom: 8px; }
.picker { display: flex; flex-direction: column; gap: 6px; }
.picker-grupo { font-size: 12px; font-weight: 700; text-transform: uppercase; color: var(--text-muted); margin-top: 6px; }
.picker-item {
  font: inherit;
  font-size: 16px;
  text-align: left;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.picker-falta { border-color: var(--danger); color: var(--danger); font-weight: 600; }
.picker-sub { font-size: 12px; color: var(--text-muted); font-weight: 400; }
.filhos { display: flex; flex-direction: column; gap: 6px; }
.filho { display: flex; align-items: center; gap: 10px; justify-content: space-between; }
.filho .check { padding: 0; font-size: 13px; }
.lista-texto { width: 100%; font: 13px/1.4 ui-monospace, monospace; }
.copy-buffer { position: fixed; top: -1000px; opacity: 0; }

/* Organizador */
.admin-aviso { background: var(--pending-bg); border-color: transparent; color: var(--text); font-size: 14px; }
.evento-list, .crianca-list, .historico { list-style: none; padding: 0; margin: 8px 0 0; }
.evento-item { padding: 10px 0; border-top: 1px solid var(--border); }
.evento-item:first-child { border-top: none; }
.crianca-item { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 6px 0; border-top: 1px solid var(--border); }
.crianca-item .row-actions { margin: 0; flex-wrap: nowrap; }
.crianca-list { max-height: 360px; overflow-y: auto; margin-bottom: 12px; }
.danger-zone h2 { color: var(--danger); }
.trechos-edit { display: flex; flex-direction: column; gap: 10px; }
.trecho-row { border: 1px solid var(--border); border-radius: 12px; padding: 8px; display: flex; flex-direction: column; gap: 6px; }
.trecho-linha { display: flex; gap: 6px; align-items: center; }
.trecho-linha input {
  flex: 1;
  min-width: 0;
  font: inherit;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px;
}
.trecho-linha input[type="time"] { flex: 0 0 110px; }
.historico li { display: flex; gap: 10px; padding: 8px 0; border-top: 1px solid var(--border); font-size: 14px; }
.hist-quando { color: var(--text-muted); font-size: 12px; white-space: nowrap; padding-top: 2px; }

/* Aviso flutuante */
.toast {
  position: fixed;
  left: 50%;
  bottom: calc(16px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  width: calc(100% - 32px);
  max-width: 560px;
  background: #102a2f;
  color: #fff;
  border-radius: 12px;
  padding: 12px 14px;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  z-index: 100;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
}
.toast-erro { background: var(--danger); }
.btn-toast { background: #fff; color: #102a2f; flex-shrink: 0; }
