/* ============================================================
   Controle de Caronas — Design System
   Cores baseadas na logo: teal (#00BFA5) + navy (#1A2744)
   Mobile-first, responsivo
   ============================================================ */

:root {
  --teal:          #00BFA5;
  --teal-dark:     #00897B;
  --teal-light:    #E0F7F4;
  --teal-gradient: linear-gradient(135deg, #2DD4BF 0%, #0891B2 100%);
  --navy:          #1A2744;
  --navy-light:    #243257;
  --white:         #ffffff;
  --gray-bg:       #F0F4F8;
  --gray-border:   #CBD5E1;
  --gray-200:      #E2E8F0;
  --text:          #1A2744;
  --text-muted:    #64748B;
  --danger:        #EF4444;
  --danger-light:  #FEE2E2;
  --success:       #10B981;
  --success-light: #D1FAE5;
  --radius-sm:     8px;
  --radius-md:     12px;
  --radius-lg:     16px;
  --shadow-sm:     0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.06);
  --shadow-md:     0 4px 12px rgba(0,0,0,0.10), 0 2px 4px rgba(0,0,0,0.06);
  --shadow-lg:     0 10px 30px rgba(0,0,0,0.12), 0 4px 8px rgba(0,0,0,0.08);
  --transition:    all 0.2s ease;
}

/* ── Reset & Base ──────────────────────────────────────────── */

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  background: var(--gray-bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.5;
}

a {
  color: var(--teal-dark);
  text-decoration: none;
}

img {
  max-width: 100%;
  height: auto;
}

/* ── Header ────────────────────────────────────────────────── */

.app-header {
  background: var(--navy);
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-md);
}

.header-logo {
  height: 40px;
  width: auto;
  border-radius: 6px;
}

.header-user {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.header-greeting {
  color: rgba(255,255,255,0.85);
  font-size: 14px;
  white-space: nowrap;
}

.header-greeting strong {
  color: #4DD0C4;
}

/* ── Main Content ──────────────────────────────────────────── */

#content {
  max-width: 720px;
  margin: 0 auto;
  padding: 20px 16px 40px;
}

/* ── Buttons ───────────────────────────────────────────────── */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 14px 20px;
  border-radius: var(--radius-md);
  font-size: 15px;
  font-weight: 600;
  border: 2px solid transparent;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
  line-height: 1;
  white-space: nowrap;
}

.btn:active {
  transform: scale(0.97);
}

.btn-primary {
  background: var(--teal);
  color: var(--white);
  border-color: var(--teal);
}

.btn-primary:hover {
  background: var(--teal-dark);
  border-color: var(--teal-dark);
  color: var(--white);
}

.btn-outline {
  background: transparent;
  color: var(--teal-dark);
  border-color: var(--teal);
}

.btn-outline:hover {
  background: var(--teal-light);
  color: var(--teal-dark);
}

.btn-logout {
  background: rgba(255,255,255,0.12);
  color: var(--white);
  border-color: rgba(255,255,255,0.25);
  padding: 8px 14px;
  font-size: 13px;
  border-radius: var(--radius-sm);
}

.btn-logout:hover {
  background: rgba(255,255,255,0.22);
  color: var(--white);
}

.btn-sm {
  padding: 10px 16px;
  font-size: 13px;
  border-radius: var(--radius-sm);
}

.btn-danger {
  background: transparent;
  color: var(--danger);
  border-color: var(--danger);
  padding: 6px 10px;
  font-size: 12px;
  border-radius: 6px;
}

.btn-danger:hover {
  background: var(--danger-light);
}

/* ── Home page actions ─────────────────────────────────────── */

.home-actions {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 8px;
}

.home-actions .btn {
  width: 100%;
  padding: 20px;
  font-size: 17px;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

.home-actions .btn-primary {
  background: var(--teal-gradient);
  border: none;
}

.home-actions .btn-outline {
  background: var(--white);
}

/* ── Cards ─────────────────────────────────────────────────── */

.card {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 16px;
}

.card-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--gray-200);
}

/* ── Forms ─────────────────────────────────────────────────── */

.form-group {
  margin-bottom: 16px;
}

.form-group label,
label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 6px;
}

.form-control,
input[type="date"],
input[type="text"],
input[type="password"],
select {
  display: block;
  width: 100%;
  padding: 12px 14px;
  border: 2px solid var(--gray-border);
  border-radius: var(--radius-sm);
  font-size: 15px;
  color: var(--text);
  background: var(--white);
  transition: var(--transition);
  appearance: auto;
}

.form-control:focus,
input[type="date"]:focus,
input[type="text"]:focus,
input[type="password"]:focus,
select:focus {
  outline: none;
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(0, 191, 165, 0.15);
}

/* ── Passageiros Checkboxes ────────────────────────────────── */

.passageiros-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  margin: 16px 0;
}

.passageiros-card h3 {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 12px;
}

.passageiros-header {
  display: grid;
  grid-template-columns: 48px 48px 1fr;
  gap: 8px;
  align-items: center;
  padding: 8px 0;
  border-bottom: 2px solid var(--gray-200);
  margin-bottom: 4px;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
  text-align: center;
}

.passageiro-row {
  display: grid;
  grid-template-columns: 48px 48px 1fr;
  gap: 8px;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--gray-200);
}

.passageiro-row:last-child {
  border-bottom: none;
}

.passageiro-desabilitado {
  opacity: 0.4;
  pointer-events: none;
}

.passageiro-row input[type="checkbox"] {
  width: 22px;
  height: 22px;
  margin: 0 auto;
  display: block;
  cursor: pointer;
  accent-color: var(--teal);
}

.passageiro-row label {
  font-size: 15px;
  font-weight: 500;
  color: var(--text);
  text-transform: none;
  letter-spacing: normal;
  margin-bottom: 0;
  cursor: pointer;
  text-align: center;
}

/* ── Filtro relatório ──────────────────────────────────────── */

.filtro-form {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 16px 20px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 20px;
}

.filtro-row {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.filtro-row label {
  margin-bottom: 0;
}

.filtro-row select {
  flex: 1;
}

@media (min-width: 480px) {
  .filtro-row {
    flex-direction: row;
    align-items: flex-end;
  }
  .filtro-row label {
    display: none;
  }
}

/* ── Tables ────────────────────────────────────────────────── */

.table-wrapper {
  overflow-x: auto;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  margin-bottom: 16px;
  background: var(--white);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  background: var(--white);
}

thead th {
  background: var(--navy);
  color: var(--white);
  font-weight: 700;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 12px 14px;
  text-align: center;
  white-space: nowrap;
}

thead th:first-child { border-radius: var(--radius-lg) 0 0 0; }
thead th:last-child  { border-radius: 0 var(--radius-lg) 0 0; }

tbody td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--gray-200);
  vertical-align: middle;
  text-align: center;
}

tbody tr:last-child td {
  border-bottom: none;
}

tbody tr:nth-child(even) td {
  background: var(--gray-bg);
}

tbody tr:hover td {
  background: var(--teal-light);
  transition: background 0.15s;
}

.dia-semana {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
}

/* ── Linha de viagem / passageiro ──────────────────────────── */

.viagem-passageiro {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 2px 0;
}

.btn-apagar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  color: var(--danger);
  border: 1px solid var(--danger);
  font-size: 14px;
  line-height: 1;
  text-decoration: none;
  flex-shrink: 0;
  transition: var(--transition);
}

.btn-apagar:hover {
  background: var(--danger-light);
  color: var(--danger);
}

/* ── Seção de totais ───────────────────────────────────────── */

.totais-motorista-nome {
  font-weight: 700;
  font-size: 15px;
  color: var(--navy);
  margin-bottom: 6px;
  padding: 8px 0 4px;
  border-bottom: 1px solid var(--gray-200);
}

.totais-passageiro {
  display: flex;
  align-items: baseline;
  gap: 6px;
  padding: 4px 0;
  font-size: 13px;
  color: var(--text-muted);
  border-bottom: 1px solid var(--gray-200);
}

.totais-passageiro:last-child {
  border-bottom: none;
}

.totais-passageiro strong {
  color: var(--text);
  font-size: 14px;
}

.totais-passageiro u {
  color: var(--teal-dark);
  text-decoration: none;
  font-weight: 600;
}

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

/* ── Acerto cards ──────────────────────────────────────────── */

.acerto-row {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px 0;
  border-bottom: 1px solid var(--gray-200);
}

.acerto-row:last-child {
  border-bottom: none;
}

.acerto-pessoas {
  font-size: 15px;
  font-weight: 600;
  color: var(--navy);
}

.acerto-valor {
  font-size: 14px;
  color: var(--teal-dark);
  font-weight: 600;
}

.acerto-form {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.acerto-form input[type="date"] {
  flex: 1;
  min-width: 130px;
  padding: 8px 10px;
  font-size: 14px;
}

@media (min-width: 600px) {
  .acerto-row {
    flex-direction: row;
    align-items: center;
  }
  .acerto-pessoas { flex: 1; }
  .acerto-valor   { flex: 1; }
  .acerto-form    { flex: 1; justify-content: flex-end; }
}

/* ── Mensagens ─────────────────────────────────────────────── */

.msg-success,
.msg-error {
  border-radius: var(--radius-md);
  padding: 14px 18px;
  font-size: 15px;
  font-weight: 500;
  margin: 16px 0;
  border-left: 5px solid;
}

.msg-success {
  background: var(--success-light);
  border-color: var(--success);
  color: #065F46;
}

.msg-error {
  background: var(--danger-light);
  border-color: var(--danger);
  color: #991B1B;
}

/* ── Último lançamento ─────────────────────────────────────── */

.ultimo-lancamento {
  font-size: 13px;
  color: var(--text-muted);
  background: var(--gray-200);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  margin-bottom: 16px;
  display: inline-block;
}

/* ── Rodapé / nav ──────────────────────────────────────────── */

.rodape-nav {
  margin-top: 32px;
  padding-top: 20px;
  border-top: 2px solid var(--gray-200);
  text-align: center;
}

/* ── Seções ────────────────────────────────────────────────── */

.secao-titulo {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin: 24px 0 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.secao-titulo::after {
  content: '';
  flex: 1;
  height: 2px;
  background: var(--gray-200);
  border-radius: 2px;
}

/* ── Login Page ────────────────────────────────────────────── */

.login-body {
  background: var(--teal-gradient);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.login-card {
  background: var(--white);
  border-radius: 24px;
  padding: 36px 28px;
  width: 100%;
  max-width: 380px;
  box-shadow: var(--shadow-lg);
  text-align: center;
}

.login-logo {
  height: 80px;
  width: auto;
  margin-bottom: 16px;
}

.login-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 24px;
}

.login-form {
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.login-form label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 4px;
}

.login-form .btn {
  width: 100%;
  margin-top: 6px;
  padding: 16px;
  font-size: 16px;
  background: var(--teal-gradient);
  border: none;
}

.login-form .btn:hover {
  opacity: 0.92;
  filter: brightness(0.97);
}

/* ── Utilities ─────────────────────────────────────────────── */

.text-center { text-align: center; }
.text-muted  { color: var(--text-muted); font-size: 13px; }
.mt-16       { margin-top: 16px; }
.mb-16       { margin-bottom: 16px; }
