/* =========================
   BASE / TOKENS / RESET
========================= */
:root{
  /* Cores */
  --brand: #7a0c0c;
  --brand-700:#6a0a0a;
  --ink:   #222;
  --muted: #666;
  --card:  #fff;
  --bg:    #f6f7fb;
  --line:  #eaeaea;
  --soft:  #fafafa;
  --ok-bg:#eaf7ea;   --ok-ink:#216e21;
  --warn-bg:#fff3cd; --warn-ink:#8a6d1a;
  --info-bg:#e8f0fe; --info-ink:#1a57b8;

  /* Espaçamentos e raios */
  --r: 10px;
  --space-1: 6px;
  --space-2: 10px;
  --space-3: 12px;
  --space-4: 16px;
}

*{box-sizing:border-box}
html{-webkit-font-smoothing:antialiased; -moz-osx-font-smoothing:grayscale}
body{
  margin:0; font-family:Arial,Helvetica,sans-serif;
  color:var(--ink); background:var(--bg);
}

/* Acessibilidade: foco visível */
:focus{outline:none}
:focus-visible{
  outline: 2px solid color-mix(in srgb, var(--brand) 60%, transparent);
  outline-offset: 2px;
}

/* Animações */
*{transition: color .15s, background .15s, border-color .15s, box-shadow .15s}
@media (prefers-reduced-motion: reduce){
  *{transition:none !important; animation-duration:.01ms !important; animation-iteration-count:1 !important}
}

/* =========================
   LAYOUT / ESTRUTURA
========================= */
.container{padding:24px; max-width:1180px; margin:0 auto}

.card{
  background:var(--card);
  border:1px solid var(--line);
  border-radius:var(--r);
  box-shadow:0 2px 10px rgba(0,0,0,.06);
  padding:var(--space-4);
  margin-bottom:18px;
}
.card h2{margin:0 0 var(--space-2) 0; font-size:22px}
.card-header{display:flex; align-items:center; justify-content:space-between; margin-bottom:var(--space-2)}

/* Topbar */
.topbar{
  position:sticky; top:0; z-index:50;
  background:var(--brand); color:#fff;
  padding:12px 20px; display:flex; align-items:center; justify-content:space-between;
}
.topbar h1{margin:0; font-size:22px; letter-spacing:.3px}
.topbar nav a{
  color:#fff; text-decoration:none; margin-right:14px;
  opacity:.95; padding:6px 8px; border-radius:8px;
}
.topbar nav a:hover{opacity:1; background:rgba(255,255,255,.1)}

/* =========================
   FORMULÁRIOS
========================= */
.field{display:flex; flex-direction:column; gap:4px}
label{font-size:.9rem; color:var(--muted)}
input,select,textarea{
  width:100%; padding:10px; border:1px solid #d9d9d9; border-radius:8px;
  background:#fff; color:inherit;
  box-shadow:0 0 0 0 rgba(0,0,0,0);
}
input:focus,select:focus,textarea:focus{
  border-color:var(--brand);
  box-shadow:0 0 0 3px rgba(122,12,12,.12);
}

/* Remover spinners em number */
input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button{ -webkit-appearance:none; margin:0 }
input[type="number"]{ -moz-appearance:textfield }

/* Grid de formulários */
.form-grid{
  display:grid; gap:12px; align-items:end;
  grid-template-columns:repeat(auto-fit, minmax(240px,1fr));
}
.field.full   {grid-column:1 / -1}
.field.span-2 {grid-column:span 2}
.field.span-3 {grid-column:span 3}
.field.xs input, .field.xs select {max-width:120px}
.field.sm input, .field.sm select {max-width:180px}
.field.md input, .field.md select {max-width:260px}
@media (max-width: 720px){
  .field.full, .field.span-2, .field.span-3 { grid-column: 1 / -1; }
  .field.xs input, .field.sm input, .field.md input,
  .field.xs select, .field.sm select, .field.md select { max-width:100%; }
}

/* =========================
   BOTÕES / LINKS
========================= */
button,.btn{
  background:var(--brand); color:#fff; border:0; cursor:pointer;
  padding:10px 14px; border-radius:8px;
  transform:translateY(0);
}
button:hover,.btn:hover{filter:brightness(1.05); transform:translateY(-1px)}
button:active,.btn:active{transform:translateY(0)}
.btn[disabled], button[disabled]{opacity:.6; cursor:not-allowed; transform:none}
.btn-link{background:transparent; border:0; cursor:pointer; color:var(--brand); padding:0; text-decoration:underline}

/* =========================
   TABELAS
========================= */
.table{width:100%; border-collapse:collapse; background:var(--card)}
.table th,.table td{
  border-bottom:1px solid #eee; padding:10px; text-align:left; vertical-align:middle;
}
.table th{font-weight:700; color:#333; border-bottom:2px solid var(--line)}
.table tr:nth-child(even){background:var(--soft)}
.table tr:hover{background:#f5f9ff}
.table-wrap{overflow:auto; -webkit-overflow-scrolling:touch}

/* Colunas fixas p/ OS */
.table thead th:nth-child(1){width:60px}      /* # */
.table thead th:nth-child(2){width:110px}     /* Data */
.table thead th:nth-child(3){min-width:220px} /* Cliente */
.table thead th:nth-child(4){width:110px}     /* Placa */
.table thead th:nth-child(5){min-width:220px} /* Serviço */
.table thead th:nth-child(6){width:110px}     /* Status */
.table thead th:nth-child(7){width:120px}     /* Total */
.table thead th:nth-child(8){min-width:160px} /* Loja */
.table thead th:nth-child(9){width:130px; text-align:left} /* Ações */

/* =========================
   BADGES
========================= */
.badge{display:inline-block; padding:4px 8px; border-radius:999px; background:#eee; font-size:12px}
.badge.success{background:var(--ok-bg); color:var(--ok-ink)}
.badge.warn   {background:var(--warn-bg); color:var(--warn-ink)}
.badge.info   {background:var(--info-bg); color:var(--info-ink)}
.badge.muted  {background:#eee; color:#555}

/* =========================
   FILTROS (listagens)
========================= */
.filters{
  display:grid;
  grid-template-columns: 1.4fr 0.9fr 1.1fr 0.8fr 0.8fr auto;
  gap:10px; align-items:end;
}
.filters .field{display:flex; flex-direction:column}
.filters .field > label{font-size:.9rem; color:#666; margin-bottom:4px}
.filters input, .filters select{width:100%}
.filters input[type="date"]{min-width:160px}
.filters .actions{display:flex; gap:8px; align-items:flex-end; justify-self:end}
@media (max-width: 980px){
  .filters{grid-template-columns: 1fr 1fr;}
  .filters .actions{grid-column: 1 / -1; justify-self:start;}
}
@media (max-width: 560px){ .filters{ grid-template-columns: 1fr; } }

/* =========================
   DASHBOARD / ATALHOS
========================= */
.grid{display:grid; grid-template-columns:repeat(3, minmax(0,1fr)); gap:16px}
@media(max-width:900px){ .grid{grid-template-columns:1fr} }
.col-span-2{grid-column:span 2 / span 2}
.col-span-3{grid-column:span 3 / span 3}
.kpi{display:flex; flex-direction:column; gap:6px; align-items:flex-start}
.kpi-title{font-size:14px; color:var(--muted)}
.kpi-value{font-size:28px; font-weight:700; line-height:1}
.kpi-link{font-size:13px; color:var(--brand); text-decoration:none}
.quick-grid{display:grid; gap:10px; grid-template-columns:repeat(2, minmax(0,1fr))}
.quick{
  display:block; text-align:center; padding:10px;
  border:1px dashed #ccc; border-radius:10px; background:#fff; color:#333; text-decoration:none;
}
.quick:hover{box-shadow:0 4px 16px rgba(0,0,0,.06); border-color:#ddd}

/* =========================
   FOOTER
========================= */
.footer{padding:16px; text-align:center; background:#f0f0f0; color:#666}

/* =========================
   UTILITÁRIOS
========================= */
.small{font-size:.85rem; color:var(--muted)}
.hidden{display:none !important}
.sr-only{
  position:absolute !important; width:1px; height:1px; padding:0; margin:-1px; overflow:hidden;
  clip:rect(0,0,0,0); white-space:nowrap; border:0;
}

/* Grid dos KPIs */
.kpis-row{
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin: 10px 0 18px;
}

/* Card compacto */
.mini-card{
  position: relative;
  background: #fff;
  border: 1px solid #e9e9e9;
  border-radius: 12px;
  padding: 12px 14px;
  box-shadow: 0 2px 8px rgba(0,0,0,.04);
}

.mini-card__bar{
  position:absolute; left:0; top:0; width:100%; height:4px;
  border-radius:12px 12px 0 0;
  background: var(--kpi-color, #3b82f6);
}

.mini-card__label{
  font-size: 12px;
  color: #666;
  margin-top: 2px;
}

.mini-card__value{
  margin-top: 6px;
  font-size: 22px;
  font-weight: 800;
  color: #111;
  line-height: 1.1;
}

/* Cores por card (bar + sutileza) */
.mini-card.c1{ --kpi-color: #1e3a8a; }  /* azul */
.mini-card.c2{ --kpi-color: #166534; }  /* verde */
.mini-card.c3{ --kpi-color: #991b1b; }  /* vermelho */
.mini-card.c4{ --kpi-color: #b45309; }  /* laranja */

/* Hover sutil para dar “vida” */
.mini-card:hover{
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(0,0,0,.06);
  transition: transform .15s ease, box-shadow .15s ease;
}
.print-modal-backdrop{
  position:fixed; inset:0; background:rgba(0,0,0,.35); display:none; z-index:999;
}
.print-modal{
  position:fixed; inset:0; display:flex; align-items:center; justify-content:center; z-index:1000;
  pointer-events:none;
}
.print-modal .box{
  width:min(520px, 94vw); background:#fff; border-radius:12px; border:1px solid #e6e6e6;
  box-shadow:0 20px 60px rgba(0,0,0,.25); padding:16px; pointer-events:auto;
}
.print-modal .hdr{display:flex; align-items:center; justify-content:space-between; margin-bottom:10px}
.print-modal .hdr h3{margin:0; font-size:18px}
.print-modal .content{display:grid; gap:12px}
.print-modal .grid2{display:grid; grid-template-columns:1fr 1fr; gap:10px}
.print-modal .actions{display:flex; justify-content:flex-end; gap:10px; margin-top:12px}
.print-radio{display:flex; gap:10px; align-items:flex-start; padding:8px; border:1px solid #eaeaea; border-radius:10px}
.print-radio:hover{background:#fafafa}

/* ===== Fonte menor padrão nas tabelas ===== */
.table {
  font-size: 12px; /* reduz tamanho base */
}

.table th,
.table td {
  font-size: 12px;
  padding: 6px 8px; /* mantém espaçamento confortável */
}

/* Versão mais compacta (opcional) */
.card.compact .table {
  font-size: 11px;
}
.card.compact .table th,
.card.compact .table td {
  font-size: 11px;
  padding: 5px 7px;
}

