﻿:root{
  --sidebar-bg:#0b2340;
  --sidebar-bg2:#081a2f;
  --sidebar-text:#e8eef7;
  --primary:#0d5bd7;
}

html,body{height:100%;}
body{background:#f4f7fb;}
body.sidebar-mobile-open{overflow:hidden;}

.sidebar{
  position:fixed; top:0; left:0; bottom:0;
  width:260px;
  background:linear-gradient(180deg,var(--sidebar-bg),var(--sidebar-bg2));
  color:var(--sidebar-text);
  padding:18px 0;
  overflow-y:auto;
  overflow-x:hidden;
  z-index:1040;
}
.sidebar-backdrop{display:none}
.mobile-sidebar-toggle{
  display:none;
  position:fixed;
  top:12px;
  left:12px;
  z-index:1055;
  width:46px;
  height:46px;
  border:0;
  border-radius:12px;
  background:#0d5bd7;
  box-shadow:0 10px 20px rgba(13,91,215,.25);
  padding:11px 10px;
}
.mobile-sidebar-toggle span{
  display:block;
  width:100%;
  height:3px;
  margin:4px 0;
  border-radius:999px;
  background:#fff;
}

.sidebar .brand{
  padding:0 14px 12px;
  display:flex; align-items:center; gap:10px;
  border-bottom:1px solid rgba(255,255,255,.08);
  margin-bottom:14px;
  overflow:hidden;
  min-height:72px;
}
.brand .logo{
  width:34px; height:34px;
  border-radius:10px;
  background:#1f6feb;
  display:flex; align-items:center; justify-content:center;
  font-weight:700; color:white;
  overflow:hidden;
  flex:0 0 34px;
}
.brand .title{line-height:1.05;min-width:0;overflow:hidden;flex:1 1 auto;}
.brand .title .name{font-weight:700;font-size:20px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
.brand .title .sub{font-size:11px; opacity:.82;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}

.sidebar .userbox{
  padding:12px 18px;
  border-bottom:1px solid rgba(255,255,255,.08);
  margin-bottom:10px;
}
.userbox .role{font-weight:700;}
.userbox .meta{font-size:12px; opacity:.85;}
.userbox .badge{
  display:inline-block;
  padding:2px 8px;
  border-radius:12px;
  background:rgba(255,255,255,.12);
  font-size:11px;
  margin-top:6px;
}

.sidebar .nav-title{
  padding:10px 18px 4px;
  font-size:12px;
  text-transform:uppercase;
  letter-spacing:.05em;
  opacity:.6;
}

.sidebar .nav a{
  color:var(--sidebar-text);
  padding:9px 18px;
  display:block;
  text-decoration:none;
  opacity:.92;
  word-break:break-word;
  line-height:1.2;
}

/* garante itens do menu um embaixo do outro */
.sidebar .nav{display:flex; flex-direction:column;}
.sidebar .nav a:hover, .sidebar .nav a.active{
  background:rgba(255,255,255,.08);
  opacity:1;
}

.sidebar .logout{
  position:fixed;
  left:18px;
  bottom:14px;
  width:224px;
}

.main{
  margin-left:260px;
  min-height:100%;
}

.topbar{
  height:48px;
  display:flex;
  align-items:center;
  justify-content:flex-end;
  padding:0 18px;
  font-size:13px;
  color:#5b6b80;
}

.content{
  padding:12px 6px 28px;
}

/* Em monitores grandes (ex.: 21"), evita esticar demais e mantem o layout alinhado */
@media (min-width: 1401px){
  .content{max-width:none; margin:0;}
}

.card-metric{
  border:1px solid rgba(0,0,0,.08);
  border-left:4px solid var(--primary);
  border-radius:3px;
}
.card-metric .label{font-size:13px; color:#6b7b8f;}
.card-metric .value{font-size:30px; font-weight:700; line-height:1;}

.table thead th{background:#eef2f6;}

/* Ajuste fino para telas 14"/15" (ex.: 1366px): layout mais compacto */
@media (max-width: 1400px){
  .sidebar{width:220px;}
  .sidebar .logout{width:188px; position:static; margin:12px 18px 0;}
  .main{margin-left:220px;}
  .content{padding:10px 6px 24px;}
  body{font-size:14px;}
  .table td, .table th{padding:.45rem;}
  .card-metric .value{font-size:26px;}
}

/* Melhorias gerais de responsividade em tabelas e botoes */
.table td.text-nowrap, .table th.text-nowrap{white-space:nowrap;}
.btn-group .btn{white-space:nowrap;}
.form-help{font-size:12px; color:#6b7b8f;}
.login-shell{
  display:flex;
  min-height:100vh;
}
.login-side{
  width:320px;
  background:linear-gradient(180deg,var(--sidebar-bg),var(--sidebar-bg2));
  color:var(--sidebar-text);
  padding:26px 18px;
}
.login-side h4{font-weight:700;}
.login-side p{opacity:.9;}
.login-main{
  flex:1;
  display:flex;
  align-items:center;
  justify-content:center;
  padding:24px;
}
.login-card{
  width:480px;
  border:1px solid rgba(0,0,0,.08);
  border-radius:6px;
  box-shadow:0 12px 24px rgba(0,0,0,.06);
}


/* Responsividade */
@media (max-width: 991.98px){
  .mobile-sidebar-toggle{display:block}
  .sidebar{
    position:fixed;
    width:232px;
    max-width:74vw;
    height:100vh;
    padding:12px 0 18px;
    transform:translateX(-104%);
    transition:transform .24s ease;
    box-shadow:0 14px 32px rgba(7,20,38,.26);
  }
  body.sidebar-mobile-open .sidebar{transform:translateX(0)}
  .sidebar-backdrop{
    position:fixed;
    inset:0;
    background:rgba(7,20,38,.36);
    z-index:1035;
  }
  body.sidebar-mobile-open .sidebar-backdrop{display:block}
  .sidebar .brand{
    margin-bottom:8px;
    padding:0 12px 10px;
    min-height:64px;
  }
  .brand .title .name{font-size:17px;}
  .brand .title .sub{font-size:10px;}
  .sidebar .logout{position:static;width:auto;margin:14px 18px 0}
  .main{margin-left:0;}
  .content{padding:12px;}
  .topbar{
    justify-content:space-between;
    padding:12px 12px 12px 64px;
    min-height:64px;
  }
  .topbar-right{gap:10px}
  .topbar-user .name{font-size:15px}
  .topbar-user .meta{font-size:11px}
  .topbar-time{font-size:11px}
  .table-responsive{overflow-x:auto; -webkit-overflow-scrolling:touch;}
  .card{border-radius:12px;}
}

@media (max-width: 575.98px){
  .content{padding:10px;}
  .btn{white-space:nowrap;}
  table{font-size:12px;}
  .topbar{
    align-items:flex-start;
    flex-direction:column;
    gap:8px;
    padding:12px 10px 10px 62px;
  }
  .topbar-left,.topbar-right{width:100%}
  .topbar-right{justify-content:space-between}
  .topbar-user{text-align:left}
}

.brand .logo img{width:100%;height:100%;max-width:100%;max-height:100%;display:block;object-fit:contain;}
.topbar{min-height:58px;display:flex;align-items:center;justify-content:space-between;padding:10px 18px;font-size:13px;color:#5b6b80;background:#fff;border-bottom:1px solid rgba(0,0,0,.06);}
.topbar-left{display:flex;align-items:center;gap:10px;font-weight:700;color:#20324a;}
.topbar-left img{width:28px;height:28px;object-fit:contain;}
.topbar-title{font-size:16px;}
.topbar-right{display:flex;align-items:center;gap:18px;}
.topbar-user .name{font-weight:700;color:#1d2c3f;}
.topbar-user .meta{font-size:12px;color:#6a7b8f;}
.topbar-time{white-space:nowrap;}
.row-saved{background:#eceff3 !important;}
.row-warning-soft{background:#fff8d8 !important;}
#totais_gerais{text-align:right;}

.sidebar .userbox{display:none !important;}
.brand .logo{
  width:48px;
  height:48px;
  flex:0 0 48px;
  background:#fff;
  border-radius:12px;
  box-shadow:0 2px 8px rgba(0,0,0,.12);
  padding:4px;
  align-self:flex-start;
}
.brand .logo img{
  width:100%;
  height:100%;
  max-width:100%;
  max-height:100%;
  display:block;
  object-fit:contain;
  object-position:center;
  border-radius:8px;
}
.brand .title .name,.brand .title .sub{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
.topbar{min-height:74px;display:flex;align-items:center;justify-content:space-between;padding:14px 22px;font-size:13px;color:#5b6b80;background:#fff;border-bottom:1px solid rgba(0,0,0,.08);position:sticky;top:0;z-index:10}
.topbar-left{display:flex;align-items:center;gap:12px;font-weight:700;color:#20324a;}
.topbar-left img{width:42px;height:42px;object-fit:contain;border-radius:12px;background:#fff;box-shadow:0 2px 8px rgba(0,0,0,.08);padding:4px;}
.topbar-title-wrap{display:flex;flex-direction:column;line-height:1.05;}
.topbar-title{font-size:18px;font-weight:800;color:#0d5bd7}
.topbar-sub{font-size:12px;color:#6a7b8f;font-weight:600;}
.topbar-right{display:flex;align-items:center;gap:18px;}
.topbar-user{text-align:right;}
.topbar-user .name{font-weight:700;color:#1d2c3f;font-size:18px;line-height:1.1;}
.topbar-user .meta{font-size:13px;color:#6a7b8f;}
.topbar-time{white-space:nowrap;font-size:13px;color:#44556a;}
#pecas_table .table-responsive,#serv_table .table-responsive,.table-fit-full .table-responsive{overflow-x:visible !important;}
.os-line-locked{background:#eceff3 !important;}
.os-line-over{background:#fff7cf !important;}
.os-line-ok{background:#eceff3 !important;}

.os-view-row{margin-top:6px!important}.os-view-card{padding-top:0!important}.content>.card:first-child,.content>.row:first-child{margin-top:6px!important}
.page-shell-wide{width:100%;max-width:none;padding-left:0;padding-right:0}
.page-shell-wide .card{margin-left:0;margin-right:0}

@media (max-width: 991.98px){
  .dashboard-header-grid{grid-template-columns:1fr !important}
  .dashboard-metrics{row-gap:1rem}
  .sidebar .nav a{padding:8px 16px;font-size:15px}
  .sidebar .nav-title{padding:10px 16px 4px}
}







