/* =====================================================================
   Airtrek Manager — estilos
   Conceito: painel de instrumentos digital do carro. Cartões em vidro
   fosco com anel de progresso (como um mostrador), tipografia técnica.
   ===================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@500;600;700&family=Inter:wght@400;500;600&family=JetBrains+Mono:wght@500;600&display=swap');

:root{
  --bg: #0B0E14;
  --bg-grad: radial-gradient(1200px 600px at 85% -10%, #15202b 0%, transparent 60%),
             radial-gradient(900px 500px at -10% 110%, #1a1430 0%, transparent 55%),
             #0B0E14;
  --painel: rgba(255,255,255,0.045);
  --painel-forte: rgba(255,255,255,0.065);
  --borda: rgba(255,255,255,0.09);
  --texto: #E9ECF1;
  --texto-fraco: #8891A3;
  --accent: #4FD1C5;
  --cor-ok: #34D399;
  --cor-atencao: #FBBF24;
  --cor-vencido: #F87171;
  --sombra: 0 20px 60px -20px rgba(0,0,0,0.6);
  --raio: 20px;
  --raio-pequeno: 12px;
}

[data-theme="light"]{
  --bg: #EEF1F5;
  --bg-grad: radial-gradient(1200px 600px at 85% -10%, #dfe8ee 0%, transparent 60%),
             radial-gradient(900px 500px at -10% 110%, #e7e2f5 0%, transparent 55%),
             #EEF1F5;
  --painel: rgba(255,255,255,0.65);
  --painel-forte: rgba(255,255,255,0.85);
  --borda: rgba(10,15,25,0.08);
  --texto: #171B22;
  --texto-fraco: #5B6474;
  --sombra: 0 20px 50px -25px rgba(20,30,50,0.25);
}

*{ box-sizing: border-box; }
html, body{ height: 100%; }
body{
  margin:0;
  background: var(--bg-grad);
  background-attachment: fixed;
  color: var(--texto);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
h1,h2,h3,.fonte-display{ font-family:'Space Grotesk', 'Inter', sans-serif; letter-spacing: -0.01em; }
.mono{ font-family:'JetBrains Mono', ui-monospace, monospace; }
a{ color: inherit; text-decoration: none; }
button{ font-family: inherit; }

.wrap{ max-width: 1180px; margin: 0 auto; padding: 28px 24px 80px; }

/* ---------- Topo ---------- */
.topo{
  display:flex; align-items:center; justify-content:space-between; gap:20px;
  margin-bottom: 30px; flex-wrap: wrap;
}
.topo-veiculo{ display:flex; align-items:center; gap:14px; }
.topo-veiculo .emblema{
  width:52px; height:52px; border-radius: 16px; display:flex; align-items:center; justify-content:center;
  background: linear-gradient(145deg, rgba(79,209,197,0.18), rgba(79,209,197,0.04));
  border: 1px solid var(--borda); color: var(--accent);
}
.topo-veiculo .emblema .icone{ width:26px; height:26px; }
.topo-veiculo h1{ font-size: 1.3rem; margin:0; font-weight:600; }
.topo-veiculo p{ margin:2px 0 0; color: var(--texto-fraco); font-size:0.86rem; }

.topo-acoes{ display:flex; align-items:center; gap:10px; }

.odometro{
  display:flex; align-items:center; gap:10px;
  background: var(--painel); border:1px solid var(--borda); border-radius: var(--raio-pequeno);
  padding: 9px 16px; backdrop-filter: blur(14px);
}
.odometro .icone{ width:18px; height:18px; color: var(--texto-fraco); }
.odometro b{ font-family:'JetBrains Mono', monospace; font-size:1.05rem; letter-spacing: 0.03em; }
.odometro span{ color: var(--texto-fraco); font-size: 0.78rem; }

.botao-icone{
  width:40px; height:40px; display:flex; align-items:center; justify-content:center;
  border-radius: 12px; border:1px solid var(--borda); background: var(--painel);
  color: var(--texto); cursor:pointer; backdrop-filter: blur(14px); transition: transform .15s ease, background .15s ease;
}
.botao-icone:hover{ background: var(--painel-forte); }
.botao-icone .icone{ width:18px; height:18px; }

.botao{
  display:inline-flex; align-items:center; gap:8px; padding: 10px 18px; border-radius: 12px;
  border:1px solid var(--borda); background: var(--painel); color:var(--texto); cursor:pointer;
  font-weight:600; font-size:0.88rem; backdrop-filter: blur(14px); transition: transform .15s ease, background .15s ease, border-color .15s ease;
}
.botao:hover{ background: var(--painel-forte); transform: translateY(-1px); }
.botao .icone{ width:16px; height:16px; }
.botao-primario{ background: linear-gradient(135deg, var(--accent), #2fb3a6); color:#04231f; border-color: transparent; }
.botao-primario:hover{ filter:brightness(1.07); }
.botao-perigo{ color: var(--cor-vencido); }
.botao-pequeno{ padding:7px 12px; font-size:0.8rem; border-radius:10px; }

.faixa-modo{
  display:inline-flex; align-items:center; gap:8px; padding:6px 13px; border-radius:999px;
  background: rgba(251,191,36,0.12); border:1px solid rgba(251,191,36,0.35); color:#FBBF24;
  font-size:0.78rem; font-weight:600; margin-bottom:22px;
}
.faixa-modo .icone{ width:14px; height:14px; }

/* ---------- Grupos / grid de cartões ---------- */
.grupo-titulo{
  font-size:0.78rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--texto-fraco);
  margin: 28px 0 12px; font-weight:600;
}
.grupo-titulo:first-of-type{ margin-top:4px; }

.grade-cartoes{
  display:grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap:16px;
}

.cartao{
  position:relative; display:block; padding:20px; border-radius: var(--raio);
  background: var(--painel); border:1px solid var(--borda); backdrop-filter: blur(18px);
  box-shadow: var(--sombra); transition: transform .18s ease, border-color .18s ease, background .18s ease;
  cursor:pointer; overflow:hidden;
}
.cartao::before{
  content:''; position:absolute; inset:0; border-radius: inherit; padding:1px;
  background: linear-gradient(135deg, var(--cor-cartao, var(--accent)) 0%, transparent 40%);
  opacity:0.35; -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude; pointer-events:none;
}
.cartao:hover{ transform: translateY(-3px); border-color: rgba(255,255,255,0.18); }

.anel{
  width:60px; height:60px; border-radius:50%; display:flex; align-items:center; justify-content:center;
  background: conic-gradient(var(--cor-cartao, var(--accent)) calc(var(--pct, 0) * 1%), var(--borda) 0);
  margin-bottom:14px;
}
.anel-interno{
  width:46px; height:46px; border-radius:50%; background: var(--bg);
  display:flex; align-items:center; justify-content:center; color: var(--cor-cartao, var(--accent));
}
.anel-interno .icone{ width:22px; height:22px; }
[data-theme="light"] .anel-interno{ background:#fff; }

.cartao h3{ font-size:1.0rem; margin:0 0 4px; font-weight:600; }
.cartao .grupo-label{ font-size:0.72rem; color: var(--texto-fraco); text-transform:uppercase; letter-spacing:0.06em; }
.cartao .resumo{ font-size:0.83rem; color: var(--texto-fraco); margin-top:10px; }
.cartao .detalhe{ font-size:0.83rem; margin-top:3px; font-weight:600; }

.selo{
  position:absolute; top:18px; right:18px; width:9px; height:9px; border-radius:50%;
  background: var(--cor-cartao, var(--accent)); box-shadow: 0 0 0 4px color-mix(in srgb, var(--cor-cartao, var(--accent)) 20%, transparent);
}

/* ---------- Página de detalhe ---------- */
.voltar{ display:inline-flex; align-items:center; gap:6px; color: var(--texto-fraco); font-size:0.88rem; margin-bottom:18px; }
.voltar .icone{ width:16px; height:16px; }
.voltar:hover{ color: var(--texto); }

.cabecalho-detalhe{ display:flex; align-items:flex-start; gap:18px; margin-bottom:26px; flex-wrap:wrap; }
.cabecalho-detalhe .emblema-grande{
  width:76px; height:76px; border-radius:22px; display:flex; align-items:center; justify-content:center;
  background: var(--painel); border:1px solid var(--borda); color: var(--cor-cat, var(--accent)); flex-shrink:0;
}
.cabecalho-detalhe .emblema-grande .icone{ width:36px; height:36px; }
.cabecalho-detalhe h2{ margin:0 0 4px; font-size:1.5rem; }
.cabecalho-detalhe .grupo-label{ color: var(--texto-fraco); font-size:0.82rem; text-transform:uppercase; letter-spacing:0.06em; }

.grade-detalhe{ display:grid; grid-template-columns: 300px 1fr; gap:20px; align-items:start; }
@media (max-width: 860px){ .grade-detalhe{ grid-template-columns: 1fr; } }

.painel{
  background: var(--painel); border:1px solid var(--borda); border-radius: var(--raio);
  padding:22px; backdrop-filter: blur(18px); box-shadow: var(--sombra);
}
.painel h4{ margin:0 0 16px; font-size:0.78rem; text-transform:uppercase; letter-spacing:0.08em; color: var(--texto-fraco); }

.anel-grande{ width:140px; height:140px; margin: 0 auto 16px; border-radius:50%;
  background: conic-gradient(var(--cor-cat, var(--accent)) calc(var(--pct, 0) * 1%), var(--borda) 0); display:flex; align-items:center; justify-content:center; }
.anel-grande-interno{ width:112px; height:112px; border-radius:50%; background: var(--bg); display:flex; flex-direction:column; align-items:center; justify-content:center; }
[data-theme="light"] .anel-grande-interno{ background:#fff; }
.anel-grande-interno b{ font-size:1.5rem; font-family:'Space Grotesk',sans-serif; }
.anel-grande-interno span{ font-size:0.72rem; color: var(--texto-fraco); }

.status-pill{ display:inline-flex; align-items:center; gap:7px; padding:5px 13px; border-radius:999px; font-size:0.8rem; font-weight:600;
  background: color-mix(in srgb, var(--cor-status, var(--accent)) 16%, transparent); color: var(--cor-status, var(--accent)); margin: 0 auto 16px; }
.status-pill::before{ content:''; width:7px; height:7px; border-radius:50%; background:currentColor; }
.centralizado{ display:flex; flex-direction:column; align-items:center; text-align:center; }

.lista-specs{ list-style:none; margin:0; padding:0; display:flex; flex-direction:column; gap:10px; }
.lista-specs li{ display:flex; justify-content:space-between; gap:10px; font-size:0.86rem; border-bottom:1px dashed var(--borda); padding-bottom:9px; }
.lista-specs li span{ color: var(--texto-fraco); }
.lista-specs li b{ text-align:right; }

/* ---------- Linha do tempo (histórico) ---------- */
.linha-tempo{ position:relative; padding-left:26px; }
.linha-tempo::before{ content:''; position:absolute; left:6px; top:6px; bottom:6px; width:2px; background: var(--borda); }
.item-tempo{ position:relative; padding-bottom:22px; }
.item-tempo:last-child{ padding-bottom:0; }
.item-tempo::before{ content:''; position:absolute; left:-26px; top:4px; width:13px; height:13px; border-radius:50%; background: var(--bg); border:2px solid var(--cor-cat, var(--accent)); }
.item-tempo-cartao{ background: var(--painel); border:1px solid var(--borda); border-radius: var(--raio-pequeno); padding:14px 16px; backdrop-filter: blur(14px); }
.item-tempo-topo{ display:flex; justify-content:space-between; align-items:flex-start; gap:10px; flex-wrap:wrap; }
.item-tempo-topo strong{ font-size:0.95rem; }
.item-tempo-meta{ color: var(--texto-fraco); font-size:0.78rem; margin-top:2px; }
.item-tempo-texto{ font-size:0.85rem; margin-top:8px; color: var(--texto); }
.item-tempo-acoes{ display:flex; gap:6px; }
.item-tempo-acoes .botao-icone{ width:30px; height:30px; border-radius:9px; }
.item-tempo-acoes .icone{ width:14px; height:14px; }

.vazio{ text-align:center; padding:50px 20px; color: var(--texto-fraco); }
.vazio .icone{ width:38px; height:38px; margin-bottom:10px; opacity:0.6; }

/* ---------- Formulários / modal ---------- */
.fundo-modal{ position:fixed; inset:0; background: rgba(5,8,14,0.6); backdrop-filter: blur(4px); display:flex; align-items:center; justify-content:center; padding:20px; z-index:50; }
.modal{ width:100%; max-width:520px; background: var(--bg); border:1px solid var(--borda); border-radius: var(--raio); padding:26px; box-shadow: var(--sombra); max-height:88vh; overflow-y:auto; }
[data-theme="light"] .modal{ background:#fff; }
.modal-topo{ display:flex; justify-content:space-between; align-items:center; margin-bottom:18px; }
.modal-topo h3{ margin:0; font-size:1.1rem; }

.campo{ margin-bottom:14px; }
.campo label{ display:block; font-size:0.78rem; color: var(--texto-fraco); margin-bottom:6px; text-transform:uppercase; letter-spacing:0.04em; }
.campo input, .campo select, .campo textarea{
  width:100%; padding:10px 12px; border-radius:10px; border:1px solid var(--borda); background: rgba(255,255,255,0.03);
  color: var(--texto); font-family:inherit; font-size:0.92rem;
}
[data-theme="light"] .campo input, [data-theme="light"] .campo select, [data-theme="light"] .campo textarea{ background: rgba(10,15,25,0.03); }
.campo input:focus, .campo select:focus, .campo textarea:focus{ outline:2px solid var(--accent); outline-offset:1px; }
.campo-linha{ display:grid; grid-template-columns: 1fr 1fr; gap:12px; }
.campo textarea{ resize:vertical; min-height:70px; }
.modal-acoes{ display:flex; justify-content:flex-end; gap:10px; margin-top:20px; }

.alerta{ padding:12px 16px; border-radius:12px; font-size:0.86rem; margin-bottom:18px; border:1px solid; }
.alerta-erro{ background: rgba(248,113,113,0.1); border-color: rgba(248,113,113,0.35); color:#F87171; }
.alerta-sucesso{ background: rgba(52,211,153,0.1); border-color: rgba(52,211,153,0.35); color:#34D399; }

/* ---------- Login ---------- */
.tela-login{ min-height:100vh; display:flex; align-items:center; justify-content:center; padding:20px; }
.cartao-login{ width:100%; max-width:380px; background: var(--painel); border:1px solid var(--borda); border-radius: var(--raio); padding:34px; backdrop-filter: blur(20px); box-shadow: var(--sombra); }
.cartao-login .emblema{ width:52px; height:52px; border-radius:16px; display:flex; align-items:center; justify-content:center; margin-bottom:18px; background: linear-gradient(145deg, rgba(79,209,197,0.18), rgba(79,209,197,0.04)); border:1px solid var(--borda); color: var(--accent); }
.cartao-login h2{ margin:0 0 4px; }
.cartao-login p{ color: var(--texto-fraco); margin:0 0 24px; font-size:0.88rem; }

/* ---------- Config: lista editável de categorias ---------- */
.tabela-config{ width:100%; border-collapse: collapse; }
.tabela-config th{ text-align:left; font-size:0.72rem; text-transform:uppercase; letter-spacing:0.06em; color: var(--texto-fraco); padding:10px 12px; border-bottom:1px solid var(--borda); }
.tabela-config td{ padding:12px; border-bottom:1px solid var(--borda); font-size:0.88rem; vertical-align:middle; }
.tabela-config tr:last-child td{ border-bottom:none; }
.chip-cor{ width:16px; height:16px; border-radius:5px; display:inline-block; vertical-align:middle; margin-right:8px; }

.rodape{ text-align:center; color: var(--texto-fraco); font-size:0.78rem; margin-top:50px; }

@media (max-width: 560px){
  .campo-linha{ grid-template-columns:1fr; }
  .topo{ flex-direction:column; align-items:flex-start; }
  .odometro b{ font-size:0.95rem; }
}
