:root{
  --navy:#0f172a;
  --navy-2:#111827;
  --brand:#0ea5e9;
  --brand-strong:#0284c7;
  --brand-soft:#e0f2fe;
  --success:#16a34a;
  --warning:#f59e0b;
  --danger:#dc2626;
  --info:#2563eb;
  --purple:#7c3aed;
  --muted:#64748b;
  --line:#e5e7eb;
  --line-soft:#eef2f7;
  --bg:#f5f7fb;
  --bg-2:#f8fbff;
  --card:#ffffff;
  --text:#111827;
}

body{
  padding-bottom:40px;
  background:
    radial-gradient(circle at top, rgba(14,165,233,.08), transparent 32%),
    linear-gradient(180deg, #f8fbff 0%, #f5f7fb 28%, #f5f7fb 100%);
  color:var(--text);
  font-family:Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.app-body-driver{
  background:
    radial-gradient(circle at top, rgba(14,165,233,.05), transparent 28%),
    linear-gradient(180deg, #f8fafc 0%, #f5f7fb 100%);
}

.app-shell{
  padding:28px 0 44px;
}

.app-shell-compact{
  padding-top:22px;
}

.app-content-shell{
  width:min(1500px, calc(100% - 32px));
  margin:0 auto;
}

.app-alert-stack .alert{
  border:1px solid rgba(148,163,184,.22);
  border-radius:16px;
  box-shadow:0 10px 24px rgba(15,23,42,.05);
}

.app-navbar{
  background:linear-gradient(90deg, #111827 0%, #0f172a 55%, #1f2937 100%);
  border-bottom:1px solid rgba(255,255,255,.08);
  box-shadow:0 10px 30px rgba(15,23,42,.22);
  min-height:64px;
}

.app-nav-shell{
  width:min(1500px, calc(100% - 32px));
  margin:0 auto;
  padding-left:0;
  padding-right:0;
}

.navbar-brand{
  font-weight:800;
  letter-spacing:.02em;
}

.menu-pill{
  color:#e5e7eb;
  text-decoration:none;
  border:1px solid rgba(148,163,184,.35);
  background:rgba(15,23,42,.45);
  padding:.42rem .72rem;
  border-radius:.75rem;
  font-size:.82rem;
  line-height:1.1rem;
  transition:all .2s ease;
  display:inline-flex;
  align-items:center;
  gap:.35rem;
}

.menu-pill:hover{
  color:#fff;
  border-color:rgba(125,211,252,.8);
  background:rgba(14,116,144,.25);
}

.menu-pill.active{
  color:#fff;
  border-color:#67e8f9;
  box-shadow:inset 0 0 0 1px rgba(103,232,249,.25), 0 0 0 1px rgba(56,189,248,.12);
  background:linear-gradient(180deg, rgba(14,116,144,.6), rgba(2,132,199,.52));
}

.dropdown-menu .dropdown-item.active{
  background:#0ea5e9;
  color:#fff;
}

.dropdown-menu{
  border-radius:.75rem;
  border:1px solid rgba(15,23,42,.12);
  box-shadow:0 10px 28px rgba(2,6,23,.18);
  min-width:14rem;
  padding:.45rem;
}

.dropdown-menu .dropdown-item{
  padding:.55rem .7rem;
  border-radius:.5rem;
}

.menu-pill-exit{
  border-color:rgba(248,113,113,.55);
}

.menu-pill-exit:hover{
  border-color:rgba(252,165,165,.95);
  background:rgba(127,29,29,.45);
}

.mobile-menu-group{
  color:#93c5fd;
  text-transform:uppercase;
  letter-spacing:.04em;
  font-size:.72rem;
  margin-top:.9rem;
  margin-bottom:.35rem;
}

.mobile-menu-link{
  display:block;
  color:#e5e7eb;
  text-decoration:none;
  padding:.55rem .2rem;
  border-bottom:1px solid rgba(148,163,184,.18);
}

.mobile-menu-link.active{
  color:#7dd3fc;
}

.card{
  border:1px solid rgba(226,232,240,.9);
  border-radius:20px;
  box-shadow:0 10px 28px rgba(15,23,42,.05);
}

.card-header{
  background:linear-gradient(180deg, rgba(248,250,252,.96), rgba(255,255,255,.96));
  border-bottom:1px solid var(--line);
  padding:1rem 1.15rem;
}

.card-body{
  padding:1.15rem;
}

.table{
  --bs-table-striped-bg:#f8fafc;
  --bs-table-hover-bg:#f3f7fb;
}

.form-control,
.form-select{
  border-radius:12px;
  border-color:#d7dee8;
  box-shadow:none;
}

.form-control:focus,
.form-select:focus{
  border-color:rgba(14,165,233,.55);
  box-shadow:0 0 0 .2rem rgba(14,165,233,.14);
}

.btn{
  border-radius:12px;
}

.btn-dark{
  background:linear-gradient(180deg, #111827, #0f172a);
  border-color:#0f172a;
}

.btn-dark:hover{
  background:#020617;
  border-color:#020617;
}

.hero{
  background:linear-gradient(135deg, #ffffff, #f8fbff);
  border:1px solid var(--line);
  border-radius:24px;
  padding:24px;
  box-shadow:0 15px 35px rgba(15,23,42,.06);
  margin-bottom:22px;
}

.hero h1,
.hero h2,
.hero h3{
  font-weight:850;
  margin:0;
}

.subtitle{
  color:var(--muted);
  font-size:.93rem;
  margin-top:4px;
}

.filter-card{
  background:#fff;
  border:1px solid var(--line);
  border-radius:18px;
  padding:14px;
}

.summary-strip{
  display:grid;
  grid-template-columns:repeat(4, 1fr);
  gap:14px;
  margin-bottom:18px;
}

.dashboard-summary-grid{
  display:grid;
  grid-template-columns:repeat(5, minmax(0, 1fr));
  gap:14px;
  margin-bottom:18px;
}

.dashboard-sla-grid{
  display:grid;
  grid-template-columns:repeat(4, minmax(0, 1fr));
  gap:14px;
  margin-bottom:18px;
}

.kpi-card{
  background:var(--card);
  border:1px solid var(--line);
  border-radius:20px;
  padding:18px;
  box-shadow:0 10px 24px rgba(15,23,42,.05);
  position:relative;
  overflow:hidden;
}

.kpi-card::after{
  content:"";
  position:absolute;
  right:-35px;
  top:-35px;
  width:100px;
  height:100px;
  border-radius:50%;
  background:var(--brand-soft);
  opacity:.85;
}

.kpi-label,
.kpi-foot{
  color:var(--muted);
  position:relative;
  z-index:1;
}

.kpi-label{
  font-size:.83rem;
  font-weight:700;
}

.kpi-value{
  font-size:2rem;
  line-height:1;
  font-weight:850;
  margin-top:10px;
  position:relative;
  z-index:1;
}

.kpi-foot{
  font-size:.78rem;
  margin-top:9px;
}

.kpi-actions-layer{
  position:relative;
  z-index:1;
}

.accent-danger::after{background:#fee2e2;}
.accent-warning::after{background:#fef3c7;}
.accent-info::after{background:#dbeafe;}
.accent-success::after{background:#dcfce7;}
.accent-dark::after{background:#e2e8f0;}

.widget-area{
  display:grid;
  grid-template-columns:repeat(3, 1fr);
  gap:16px;
  margin-bottom:22px;
}

.dashboard-widget-grid{
  display:grid;
  grid-template-columns:repeat(3, minmax(0, 1fr));
  gap:16px;
  margin-bottom:22px;
}

.widget-card{
  background:#fff;
  border:1px solid #e5e7eb;
  border-radius:20px;
  padding:20px;
  min-height:132px;
  display:flex;
  align-items:center;
  gap:16px;
  box-shadow:0 10px 25px rgba(15,23,42,.06);
  position:relative;
  overflow:hidden;
  transition:.2s ease;
}

.widget-card:hover{
  transform:translateY(-2px);
  box-shadow:0 16px 35px rgba(15,23,42,.09);
}

.widget-card::before{
  content:"";
  position:absolute;
  left:0;
  top:0;
  width:6px;
  height:100%;
  background:#0ea5e9;
}

.widget-icon{
  width:54px;
  height:54px;
  border-radius:17px;
  background:#e0f2fe;
  color:#0284c7;
  display:flex;
  align-items:center;
  justify-content:center;
  font-size:1.45rem;
  flex:0 0 auto;
}

.widget-label{
  display:block;
  color:#64748b;
  font-size:.86rem;
  font-weight:700;
}

.widget-period{
  display:block;
  color:#94a3b8;
  font-size:.75rem;
  margin-top:1px;
}

.widget-value{
  display:block;
  font-size:2rem;
  line-height:1.1;
  font-weight:850;
  color:#111827;
  margin-top:4px;
}

.widget-desc{
  display:block;
  color:#64748b;
  font-size:.8rem;
  margin-top:5px;
}

.widget-green::before{background:#16a34a;}
.widget-green .widget-icon{background:#dcfce7; color:#15803d;}
.widget-orange::before{background:#f59e0b;}
.widget-orange .widget-icon{background:#fef3c7; color:#b45309;}
.widget-red::before{background:#dc2626;}
.widget-red .widget-icon{background:#fee2e2; color:#b91c1c;}
.widget-purple::before{background:#7c3aed;}
.widget-purple .widget-icon{background:#ede9fe; color:#6d28d9;}
.widget-dark::before{background:#334155;}
.widget-dark .widget-icon{background:#e2e8f0; color:#334155;}
.widget-outline-warning{border-color:#fbbf24;}
.widget-outline-danger{border-color:#f87171;}

.section-card{
  background:#fff;
  border:1px solid var(--line);
  border-radius:22px;
  box-shadow:0 12px 30px rgba(15,23,42,.05);
  overflow:hidden;
  margin-bottom:22px;
}

.section-head{
  padding:18px 20px;
  border-bottom:1px solid var(--line);
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
}

.section-title{
  font-size:1rem;
  font-weight:850;
  margin:0;
}

.section-hint{
  color:var(--muted);
  font-size:.82rem;
  margin:2px 0 0;
}

.section-body{
  padding:18px 20px;
}

.delta-grid{
  display:grid;
  grid-template-columns:repeat(3, minmax(0, 1fr));
  gap:14px;
}

.delta-card{
  background:linear-gradient(180deg, #f8fbff, #ffffff);
  border:1px solid var(--line);
  border-radius:18px;
  padding:16px 18px;
}

.delta-label{
  color:var(--muted);
  font-size:.82rem;
  font-weight:700;
}

.delta-value{
  font-size:1.75rem;
  line-height:1.1;
  font-weight:850;
  margin-top:8px;
  color:var(--text);
}

.dashboard-empty{
  color:var(--muted);
  padding:4px 0;
}

.bi-chart-canvas-wrap{
  position:relative;
  min-height:360px;
  height:360px;
}

.bi-chart-canvas-wrap canvas{
  width:100% !important;
  height:100% !important;
}

.bi-gobrax-oficina-totais{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
  justify-content:flex-end;
}

.bi-gobrax-total-cavalo{
  background:#dbeafe;
  color:#1d4ed8;
}

.bi-gobrax-total-prf{
  background:#dcfce7;
  color:#15803d;
}

.bi-gobrax-total-geral{
  background:#e2e8f0;
  color:#0f172a;
}

.bi-gobrax-oficina-total-row th,
.bi-gobrax-oficina-total-row td{
  background:linear-gradient(180deg, #eff6ff, #f8fbff);
  color:#0f172a;
  font-weight:800;
  border-top:2px solid #bfdbfe;
}

.vp-interval-note{
  font-size:.75rem;
}

.noc-gobrax-apelido{
  max-width:7rem;
}

.table-modern{
  margin:0;
  vertical-align:middle;
}

.table-modern thead th{
  background:#111827;
  color:#fff;
  font-size:.78rem;
  text-transform:uppercase;
  letter-spacing:.03em;
  border:0;
  padding:13px 14px;
  white-space:nowrap;
}

.table-modern tbody td{
  padding:13px 14px;
  color:#1f2937;
  border-color:var(--line-soft);
  font-size:.9rem;
}

.table-modern tbody tr:hover{
  background:#f8fafc;
}

.badge-status{
  border-radius:999px;
  padding:.38rem .62rem;
  font-size:.72rem;
  font-weight:850;
  letter-spacing:.02em;
}

.status-oficina{background:#fef3c7; color:#92400e;}
.status-atrasada{background:#fee2e2; color:#991b1b;}
.status-andamento{background:#dbeafe; color:#1e40af;}
.status-planejada{background:#e0f2fe; color:#075985;}

.btn-open{
  border-radius:10px;
  border:1px solid #cbd5e1;
  background:#fff;
  font-weight:700;
  color:#334155;
  padding:.38rem .65rem;
}

.btn-open:hover{
  background:#0f172a;
  color:#fff;
  border-color:#0f172a;
}

.ranking-grid{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:16px;
}

.progress-mini{
  height:8px;
  background:#e5e7eb;
  border-radius:999px;
  overflow:hidden;
  min-width:110px;
}

.progress-mini span{
  display:block;
  height:100%;
  border-radius:999px;
  background:linear-gradient(90deg, #0ea5e9, #2563eb);
}

@media (max-width:1200px){
  .summary-strip{grid-template-columns:repeat(2, 1fr);}
  .widget-area{grid-template-columns:repeat(2, 1fr);}
  .dashboard-summary-grid{grid-template-columns:repeat(3, minmax(0, 1fr));}
  .dashboard-sla-grid{grid-template-columns:repeat(2, minmax(0, 1fr));}
  .dashboard-widget-grid{grid-template-columns:repeat(2, minmax(0, 1fr));}
}

@media (max-width:768px){
  .app-content-shell,
  .app-nav-shell{
    width:min(100% - 24px, 100%);
  }

  .app-shell{
    padding-top:20px;
  }

  .summary-strip,
  .dashboard-summary-grid,
  .dashboard-sla-grid,
  .widget-area,
  .dashboard-widget-grid,
  .delta-grid,
  .ranking-grid{
    grid-template-columns:1fr;
  }

  .hero{
    padding:18px;
  }

  .section-head{
    align-items:flex-start;
    flex-direction:column;
  }
}
