/* ==========================================================
   VEO OS - Identidade visual
   Fonte de titulo: Space Grotesk / Fonte de corpo: Inter
   ========================================================== */

:root {
  --primary: #0526D9;
  --primary-dark: #050F6B;
  --primary-darker: #060B33;
  --primary-light: #4F63F0;
  --primary-tint: #EAEDFC;

  --bg: #F2F4FA;
  --surface: #FFFFFF;
  --border: #E2E6F1;
  --text: #10132B;
  --text-muted: #5C6178;
  --text-faint: #8A8FA6;

  --success: #158A4C;
  --success-tint: #E3F6EC;
  --warning: #B5720B;
  --warning-tint: #FCF1DD;
  --danger: #C22A2A;
  --danger-tint: #FBE9E9;
  --neutral: #565B72;
  --neutral-tint: #EDEFF6;

  --radius: 10px;
  --radius-sm: 6px;
  --shadow-sm: 0 1px 2px rgba(11, 17, 48, .06);
  --shadow-md: 0 6px 20px rgba(11, 17, 48, .08);
  --font-display: 'Space Grotesk', 'Inter', sans-serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: -0.01em;
  margin: 0 0 4px;
  color: var(--primary-darker);
}
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
ul { list-style: none; margin: 0; padding: 0; }
img { max-width: 100%; display: block; }

/* ---------- Sinal / marca (motivo de assinatura) ---------- */
.veo-signal {
  display: inline-flex;
  align-items: flex-end;
  gap: 2px;
  height: 14px;
}
.veo-signal span {
  width: 3px;
  background: currentColor;
  border-radius: 1px;
  display: block;
}
.veo-signal span:nth-child(1) { height: 40%; }
.veo-signal span:nth-child(2) { height: 65%; }
.veo-signal span:nth-child(3) { height: 85%; }
.veo-signal span:nth-child(4) { height: 100%; }

/* ---------- Layout base ---------- */
.veo-shell { display: flex; min-height: 100vh; }

.veo-sidebar {
  width: 236px;
  flex-shrink: 0;
  background: var(--primary-darker);
  color: #C7CCEE;
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; bottom: 0; left: 0;
}
.veo-sidebar__brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 22px 20px;
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.veo-sidebar__brand img { height: 30px; width: auto; }
.veo-sidebar__brand .veo-signal { color: #7C8CFF; }
.veo-sidebar nav { padding: 16px 12px; flex: 1; overflow-y: auto; }
.veo-nav-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: #6C74A8;
  padding: 14px 12px 6px;
  font-weight: 600;
}
.veo-nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  color: #C7CCEE;
  font-size: 13.5px;
  font-weight: 500;
  margin-bottom: 2px;
}
.veo-nav-item:hover { background: rgba(255,255,255,.06); text-decoration: none; color: #fff; }
.veo-nav-item.is-active { background: var(--primary); color: #fff; }
.veo-nav-item .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .5; flex-shrink: 0; }
.veo-sidebar__footer {
  padding: 16px 20px;
  border-top: 1px solid rgba(255,255,255,.08);
  font-size: 12.5px;
}
.veo-sidebar__footer .nome { color: #fff; font-weight: 600; display: block; }
.veo-sidebar__footer .perfil { color: #8890C0; text-transform: capitalize; }
.veo-sidebar__footer a { color: #9DA6E0; display: inline-block; margin-top: 8px; font-size: 12.5px; }

.veo-main { margin-left: 236px; flex: 1; min-width: 0; padding: 28px 32px 60px; }

.veo-topbar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 24px;
  gap: 16px;
  flex-wrap: wrap;
}
.veo-topbar__eyebrow {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--text-faint);
  font-weight: 600;
  margin-bottom: 4px;
}
.veo-topbar__actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* ---------- Cards / superficies ---------- */
.veo-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
.veo-card__header {
  padding: 18px 22px;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.veo-card__body { padding: 22px; }

.veo-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; margin-bottom: 24px; }
.veo-kpi {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
  border-left: 3px solid var(--primary);
}
.veo-kpi__label { font-size: 12px; color: var(--text-muted); text-transform: uppercase; letter-spacing: .04em; font-weight: 600; }
.veo-kpi__value { font-family: var(--font-display); font-size: 28px; font-weight: 700; color: var(--primary-darker); margin-top: 4px; }

/* ---------- Botoes ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  padding: 9px 16px;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  font-family: var(--font-body);
  transition: background .12s ease, border-color .12s ease;
}
.btn:hover { text-decoration: none; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-outline { background: #fff; color: var(--primary); border-color: var(--border); }
.btn-outline:hover { border-color: var(--primary); background: var(--primary-tint); }
.btn-ghost { background: transparent; color: var(--text-muted); border-color: transparent; }
.btn-ghost:hover { background: var(--neutral-tint); color: var(--text); }
.btn-danger { background: var(--danger-tint); color: var(--danger); }
.btn-danger:hover { background: var(--danger); color: #fff; }
.btn-sm { padding: 6px 12px; font-size: 12.5px; }
.btn-block { width: 100%; justify-content: center; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }

/* ---------- Formularios ---------- */
.veo-form-section {
  margin-bottom: 26px;
  padding-bottom: 22px;
  border-bottom: 1px dashed var(--border);
}
.veo-form-section:last-child { border-bottom: none; margin-bottom: 0; padding-bottom: 0; }
.veo-form-section__title {
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--primary);
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.veo-grid { display: grid; grid-template-columns: repeat(12, 1fr); gap: 14px 16px; }
.veo-field { display: flex; flex-direction: column; gap: 6px; }
.veo-field label { font-size: 12.5px; font-weight: 600; color: var(--text-muted); }
.veo-field .req { color: var(--danger); }
.veo-field input,
.veo-field select,
.veo-field textarea {
  font-family: var(--font-body);
  font-size: 13.5px;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: #fff;
  color: var(--text);
  width: 100%;
}
.veo-field input:focus,
.veo-field select:focus,
.veo-field textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-tint);
}
.veo-field textarea { resize: vertical; min-height: 80px; }
.veo-field-help { font-size: 11.5px; color: var(--text-faint); }

.col-2 { grid-column: span 2; }
.col-3 { grid-column: span 3; }
.col-4 { grid-column: span 4; }
.col-6 { grid-column: span 6; }
.col-8 { grid-column: span 8; }
.col-12 { grid-column: span 12; }
@media (max-width: 860px) {
  .col-2, .col-3, .col-4, .col-6, .col-8 { grid-column: span 12; }
}

.veo-radio-group { display: flex; gap: 18px; align-items: center; height: 100%; padding-top: 4px; }
.veo-radio-group label { display: flex; align-items: center; gap: 6px; font-size: 13.5px; font-weight: 500; color: var(--text); }

/* ---------- Tabelas ---------- */
.veo-table { width: 100%; border-collapse: collapse; }
.veo-table th {
  text-align: left;
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--text-faint);
  font-weight: 700;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.veo-table td {
  padding: 13px 14px;
  border-bottom: 1px solid var(--border);
  font-size: 13.5px;
  vertical-align: middle;
}
.veo-table tr:last-child td { border-bottom: none; }
.veo-table tr:hover td { background: var(--primary-tint); }
.veo-protocolo { font-family: 'Space Grotesk', monospace; font-weight: 700; color: var(--primary-darker); }
.veo-table-empty { padding: 50px 20px; text-align: center; color: var(--text-faint); }

/* ---------- Badges ---------- */
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 100px; font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; }
.badge-agendado { background: var(--neutral-tint); color: var(--neutral); }
.badge-andamento { background: var(--warning-tint); color: var(--warning); }
.badge-concluido { background: var(--success-tint); color: var(--success); }
.badge-cancelado { background: var(--danger-tint); color: var(--danger); }

/* ---------- Filtros ---------- */
.veo-filters { display: flex; gap: 10px; flex-wrap: wrap; padding: 16px 22px; border-bottom: 1px solid var(--border); background: #FAFBFE; }
.veo-filters input, .veo-filters select { padding: 8px 12px; border: 1px solid var(--border); border-radius: var(--radius-sm); font-size: 13px; }

/* ---------- Alertas ---------- */
.veo-alert { padding: 13px 16px; border-radius: var(--radius-sm); font-size: 13.5px; margin-bottom: 18px; border: 1px solid transparent; }
.veo-alert-danger { background: var(--danger-tint); color: var(--danger); border-color: #F0C6C6; }
.veo-alert-success { background: var(--success-tint); color: var(--success); border-color: #BFE6D2; }
.veo-alert ul { margin: 6px 0 0 18px; list-style: disc; }

/* ---------- Fotos ---------- */
.veo-fotos-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; }
.veo-foto { border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; background: #fff; aspect-ratio: 1; }
.veo-foto img { width: 100%; height: 100%; object-fit: cover; }
.veo-upload-box {
  border: 1.5px dashed var(--border);
  border-radius: var(--radius-sm);
  padding: 22px;
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
  background: #FAFBFE;
}

/* ---------- Login ---------- */
.veo-login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at 20% 20%, #0A2AD6 0%, var(--primary-darker) 55%, #050920 100%);
  padding: 20px;
}
.veo-login-card {
  width: 100%;
  max-width: 380px;
  background: #fff;
  border-radius: 14px;
  padding: 36px 32px 30px;
  box-shadow: 0 20px 60px rgba(2, 6, 30, .35);
}
.veo-login-card img { height: 34px; margin: 0 auto 10px; }
.veo-login-card__title { text-align: center; margin-bottom: 26px; }
.veo-login-card__title .veo-signal { color: var(--primary); margin-bottom: 8px; justify-content: center; display: flex; }
.veo-login-card__title p { color: var(--text-muted); font-size: 13px; margin: 4px 0 0; }

/* ---------- Detalhe / laudo ---------- */
.veo-detail-grid { display: grid; grid-template-columns: 2fr 1fr; gap: 20px; align-items: start; }
@media (max-width: 960px) { .veo-detail-grid { grid-template-columns: 1fr; } }
.veo-def-list { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px 20px; }
.veo-def-list dt { font-size: 11.5px; text-transform: uppercase; letter-spacing: .04em; color: var(--text-faint); font-weight: 700; margin: 0; }
.veo-def-list dd { margin: 3px 0 0; font-size: 13.5px; color: var(--text); }
.veo-def-list.full dt, .veo-def-list.full dd { grid-column: span 2; }

.veo-timeline-status { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------- Impressao (laudo em PDF via navegador) ---------- */
@media print {
  .no-print { display: none !important; }
  .veo-main { margin-left: 0; padding: 0; }
  body { background: #fff; }
  .veo-card { box-shadow: none; border: none; }
}

.veo-print-header { display: flex; justify-content: space-between; align-items: center; border-bottom: 3px solid var(--primary); padding-bottom: 14px; margin-bottom: 20px; }
.veo-print-header img { height: 32px; }
.veo-print-header .prot { text-align: right; }
.veo-print-header .prot strong { font-family: var(--font-display); font-size: 18px; color: var(--primary-darker); }

.veo-empty-state { text-align: center; padding: 60px 20px; color: var(--text-faint); }
.veo-empty-state h3 { color: var(--text-muted); margin-bottom: 6px; }
