
/* =========================================================
   SisCompras V5.4.8 - Frontend Foundation
   Identidade institucional Itaguaí + componentes reutilizáveis
   ========================================================= */

:root{
  --itaguai-navy:#003366;
  --itaguai-navy-2:#00264d;
  --itaguai-cyan:#00A8FF;
  --itaguai-cyan-soft:#e6f6ff;
  --itaguai-success:#2ECC71;
  --itaguai-success-dark:#239b56;
  --itaguai-warning:#F4B400;
  --itaguai-danger:#D93025;
  --itaguai-bg:#F8F9FA;
  --itaguai-card:#FFFFFF;
  --itaguai-border:#E5E7EB;
  --itaguai-muted:#6B7280;
  --itaguai-text:#111827;
  --itaguai-radius:12px;
  --itaguai-radius-sm:8px;
  --itaguai-shadow:0 10px 25px rgba(0, 51, 102, .08);
  --itaguai-shadow-soft:0 4px 14px rgba(15, 23, 42, .07);
  --sidebar-width:288px;
  --sidebar-collapsed-width:88px;
}

html{
  scrollbar-color:rgba(0,51,102,.35) transparent;
}

body{
  background:linear-gradient(180deg,#f6f9fc 0%,#f8f9fa 38%,#eef4f9 100%)!important;
  color:var(--itaguai-text);
}

/* ===================== Layout base ===================== */
.main-area,
main.ml-72{
  transition:margin-left .22s ease, width .22s ease;
}

.content-area,
.page-content,
.panel,
.card,
.dashboard-card,
.kpi-card{
  color:var(--itaguai-text);
}

.panel,
.card,
.dashboard-card,
.kpi-card,
.metric-card,
.stat-card{
  border:1px solid rgba(0,51,102,.08)!important;
  border-radius:var(--itaguai-radius)!important;
  box-shadow:var(--itaguai-shadow-soft)!important;
  background:var(--itaguai-card)!important;
}

/* ===================== Sidebar institucional ===================== */
.sidebar,
#sidebar{
  background:linear-gradient(180deg,var(--itaguai-navy) 0%,var(--itaguai-navy-2) 100%)!important;
  color:#eaf4ff!important;
  border-right:1px solid rgba(255,255,255,.08)!important;
}

.sidebar-brand,
.sidebar-brand-pro{
  border-bottom:1px solid rgba(255,255,255,.10);
  min-height:78px;
}

.brand-symbol{
  background:#fff!important;
  color:var(--itaguai-navy)!important;
  border:1px solid rgba(255,255,255,.25)!important;
  box-shadow:0 10px 24px rgba(0,0,0,.18);
  overflow:hidden;
}

.brand-symbol.sc-logo-applied{
  background:#fff!important;
  padding:5px!important;
}

.brand-symbol.sc-logo-applied img{
  width:100%;
  height:100%;
  object-fit:contain;
  display:block;
}

.brand-name{
  font-weight:900!important;
  letter-spacing:.01em;
}

.brand-caption{
  color:#b7d7f0!important;
}

.sidebar-collapse-btn{
  background:rgba(255,255,255,.10)!important;
  border:1px solid rgba(255,255,255,.18)!important;
}

.sidebar-collapse-btn:hover{
  background:var(--itaguai-cyan)!important;
  color:#003366!important;
}

.nav-section-title,
.nav-group-toggle{
  color:#a9cce7!important;
}

.nav-group-toggle:hover{
  background:rgba(255,255,255,.08)!important;
  color:#fff!important;
}

.nav-link{
  border-radius:12px!important;
  min-height:48px!important;
  transition:background .16s ease, transform .16s ease, color .16s ease;
}

.nav-link:hover{
  background:rgba(255,255,255,.10)!important;
  transform:translateX(2px);
}

.nav-link.active{
  background:linear-gradient(90deg,var(--itaguai-cyan),#3bc3ff)!important;
  color:#00264d!important;
  font-weight:900!important;
  box-shadow:0 10px 20px rgba(0,168,255,.22)!important;
}

.nav-link.active .nav-icon{
  background:rgba(255,255,255,.42)!important;
  color:#003366!important;
}

.nav-icon{
  background:rgba(255,255,255,.10)!important;
  color:#eaf4ff!important;
  border:1px solid rgba(255,255,255,.10)!important;
}

.sidebar-note{
  background:rgba(255,255,255,.08)!important;
  border:1px solid rgba(255,255,255,.10)!important;
  color:#eaf4ff!important;
}

.sidebar-note .sidebar-logout,
.sidebar-logout{
  color:#fee2e2!important;
  border-color:rgba(239,68,68,.25)!important;
}

.sidebar-note .sidebar-logout:hover,
.sidebar-logout:hover{
  background:#b91c1c!important;
  color:#fff!important;
}

/* ===================== Topbar / Navbar ===================== */
.topbar{
  position:sticky!important;
  top:0;
  z-index:45;
  background:rgba(255,255,255,.88)!important;
  backdrop-filter:blur(14px);
  border:1px solid rgba(0,51,102,.08)!important;
  border-radius:18px!important;
  box-shadow:0 8px 24px rgba(0,51,102,.06)!important;
  margin-bottom:18px!important;
}

.sc-topbar-v548{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:16px;
}

.sc-topbar-left-v548{
  display:flex;
  align-items:center;
  gap:12px;
  min-width:0;
}

.sc-topbar-right-v548{
  display:flex;
  align-items:center;
  gap:10px;
  margin-left:auto;
  flex-wrap:wrap;
  justify-content:flex-end;
}

.sc-hamburger-v548{
  width:44px;
  height:44px;
  border-radius:14px;
  border:1px solid rgba(0,51,102,.12);
  background:#fff;
  color:var(--itaguai-navy);
  display:inline-grid;
  place-items:center;
  cursor:pointer;
  font-weight:900;
  box-shadow:var(--itaguai-shadow-soft);
}

.sc-hamburger-v548:hover{
  background:var(--itaguai-cyan-soft);
  border-color:rgba(0,168,255,.45);
}

.sc-global-search-v548{
  display:flex;
  align-items:center;
  min-width:min(380px,38vw);
  max-width:520px;
  background:#fff;
  border:1px solid rgba(0,51,102,.12);
  border-radius:999px;
  padding:0 12px;
  height:44px;
  box-shadow:var(--itaguai-shadow-soft);
}

.sc-global-search-v548 span{
  color:var(--itaguai-muted);
  font-size:14px;
}

.sc-global-search-v548 input{
  border:0;
  outline:0;
  flex:1;
  min-width:0;
  padding:0 10px;
  background:transparent;
  font-size:.92rem;
  color:var(--itaguai-text);
}

.sc-global-search-v548 input::placeholder{
  color:#94a3b8;
}

.sc-icon-btn-v548{
  position:relative;
  width:44px;
  height:44px;
  border-radius:14px;
  border:1px solid rgba(0,51,102,.12);
  background:#fff;
  color:var(--itaguai-navy);
  display:inline-grid;
  place-items:center;
  cursor:pointer;
  box-shadow:var(--itaguai-shadow-soft);
}

.sc-icon-btn-v548:hover{
  background:var(--itaguai-cyan-soft);
  color:#00264d;
}

.sc-badge-dot-v548{
  position:absolute;
  top:7px;
  right:7px;
  min-width:16px;
  height:16px;
  padding:0 4px;
  border-radius:999px;
  background:var(--itaguai-danger);
  color:#fff;
  font-size:10px;
  font-weight:900;
  display:grid;
  place-items:center;
  border:2px solid #fff;
}

.sc-user-pill-v548{
  display:flex;
  align-items:center;
  gap:10px;
  padding:6px 10px 6px 6px;
  border-radius:999px;
  background:#fff;
  border:1px solid rgba(0,51,102,.12);
  box-shadow:var(--itaguai-shadow-soft);
  max-width:260px;
}

.sc-avatar-v548{
  width:34px;
  height:34px;
  border-radius:50%;
  background:linear-gradient(135deg,var(--itaguai-navy),var(--itaguai-cyan));
  color:#fff;
  display:grid;
  place-items:center;
  font-weight:900;
  font-size:.82rem;
  flex:0 0 auto;
}

.sc-user-meta-v548{
  display:flex;
  flex-direction:column;
  line-height:1.1;
  min-width:0;
}

.sc-user-meta-v548 strong{
  font-size:.82rem;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
  max-width:165px;
}

.sc-user-meta-v548 span{
  color:var(--itaguai-muted);
  font-size:.72rem;
}

/* ===================== Cards/KPIs ===================== */
.sc-start-cards-v548,
.kpi-grid,
.stats-grid,
.stat-grid:not(.sc-auto){
  gap:16px!important;
}

.kpi-card,
.stat-card,
.metric-card{
  position:relative;
  overflow:hidden;
}

.kpi-card::before,
.stat-card::before,
.metric-card::before{
  content:"";
  position:absolute;
  left:0;
  top:0;
  width:4px;
  height:100%;
  background:var(--itaguai-cyan);
}

.kpi-card.success::before,
.stat-card.success::before,
.metric-card.success::before{background:var(--itaguai-success)}

.kpi-card.warning::before,
.stat-card.warning::before,
.metric-card.warning::before{background:var(--itaguai-warning)}

.kpi-card.danger::before,
.stat-card.danger::before,
.metric-card.danger::before{background:var(--itaguai-danger)}

/* ===================== Tabelas ===================== */
.data-table,
.table,
table{
  border-collapse:separate!important;
  border-spacing:0!important;
  width:100%;
}

.data-table thead th,
.table thead th,
table thead th{
  background:var(--itaguai-navy)!important;
  color:#fff!important;
  font-weight:800!important;
  letter-spacing:.01em;
  border-bottom:0!important;
  font-variant-numeric:tabular-nums;
}

.data-table thead th:first-child,
.table thead th:first-child,
table thead th:first-child{
  border-top-left-radius:10px;
}

.data-table thead th:last-child,
.table thead th:last-child,
table thead th:last-child{
  border-top-right-radius:10px;
}

.data-table tbody tr:nth-child(even),
.table tbody tr:nth-child(even),
table tbody tr:nth-child(even){
  background:#f6f8fb;
}

.data-table tbody tr:hover,
.table tbody tr:hover,
table tbody tr:hover{
  background:#eaf6ff!important;
}

.data-table td,
.table td,
table td{
  border-bottom:1px solid rgba(0,51,102,.08)!important;
  font-variant-numeric:tabular-nums;
  vertical-align:middle;
}

/* ===================== Botões e ações ===================== */
.btn,
button{
  transition:background .16s ease, color .16s ease, border-color .16s ease, transform .12s ease, box-shadow .16s ease;
}

.btn:hover,
button:hover{
  cursor:pointer;
}

.btn-primary{
  background:var(--itaguai-navy)!important;
  border-color:var(--itaguai-navy)!important;
  color:#fff!important;
}

.btn-primary:hover{
  background:var(--itaguai-navy-2)!important;
  box-shadow:0 8px 20px rgba(0,51,102,.22)!important;
}

.btn-success,
.btn-save{
  background:var(--itaguai-success)!important;
  border-color:var(--itaguai-success)!important;
  color:#fff!important;
}

.btn-success:hover,
.btn-save:hover{
  background:var(--itaguai-success-dark)!important;
}

.btn-danger{
  background:#fff!important;
  border-color:rgba(217,48,37,.55)!important;
  color:var(--itaguai-danger)!important;
}

.btn-danger:hover{
  background:var(--itaguai-danger)!important;
  color:#fff!important;
}

.actions{
  display:flex;
  align-items:center;
  gap:6px;
  justify-content:flex-end;
  flex-wrap:wrap;
}

.actions .btn,
.actions button{
  min-width:38px;
  width:38px;
  height:38px;
  padding:0!important;
  border-radius:12px!important;
  display:inline-grid!important;
  place-items:center!important;
}

.actions .btn .sc-btn-label-v548,
.actions button .sc-btn-label-v548{
  position:absolute!important;
  width:1px!important;
  height:1px!important;
  padding:0!important;
  margin:-1px!important;
  overflow:hidden!important;
  clip:rect(0,0,0,0)!important;
  white-space:nowrap!important;
  border:0!important;
}

.sc-action-icon-v548{
  font-size:16px;
  line-height:1;
}

/* ===================== Tooltip ===================== */
[data-tooltip]{
  position:relative;
}

[data-tooltip]::after{
  content:attr(data-tooltip);
  position:absolute;
  left:50%;
  bottom:calc(100% + 8px);
  transform:translateX(-50%) translateY(3px);
  min-width:max-content;
  max-width:260px;
  background:#0f172a;
  color:#fff;
  padding:7px 9px;
  border-radius:8px;
  font-size:12px;
  font-weight:700;
  line-height:1.2;
  opacity:0;
  pointer-events:none;
  transition:opacity .14s ease, transform .14s ease;
  z-index:9999;
  box-shadow:0 10px 24px rgba(0,0,0,.18);
}

[data-tooltip]::before{
  content:"";
  position:absolute;
  left:50%;
  bottom:calc(100% + 2px);
  transform:translateX(-50%);
  border:6px solid transparent;
  border-top-color:#0f172a;
  opacity:0;
  transition:opacity .14s ease;
  z-index:9999;
}

[data-tooltip]:hover::after,
[data-tooltip]:hover::before,
[data-tooltip]:focus-visible::after,
[data-tooltip]:focus-visible::before{
  opacity:1;
  transform:translateX(-50%) translateY(0);
}

/* ===================== Formulários ===================== */
.field,
.select,
textarea,
input[type="text"],
input[type="date"],
input[type="number"],
input[type="search"],
select{
  border:1px solid rgba(0,51,102,.16)!important;
  border-radius:10px!important;
  transition:border-color .16s ease, box-shadow .16s ease, background .16s ease;
}

.field:focus,
.select:focus,
textarea:focus,
input:focus,
select:focus{
  outline:0!important;
  border-color:var(--itaguai-cyan)!important;
  box-shadow:0 0 0 4px rgba(0,168,255,.12)!important;
}

/* ===================== Modais e alertas ===================== */
.modal,
.dialog,
.modal-card{
  border-radius:18px!important;
}

.alert,
.toast,
.notice{
  border-radius:12px!important;
}

/* ===================== Modo escuro ===================== */
html[data-theme="dark"]{
  --itaguai-bg:#0b1220;
  --itaguai-card:#111827;
  --itaguai-border:#334155;
  --itaguai-text:#e5edf8;
  --itaguai-muted:#94a3b8;
}

html[data-theme="dark"] body{
  background:#0b1220!important;
  color:var(--itaguai-text)!important;
}

html[data-theme="dark"] .topbar,
html[data-theme="dark"] .panel,
html[data-theme="dark"] .card,
html[data-theme="dark"] .dashboard-card,
html[data-theme="dark"] .kpi-card,
html[data-theme="dark"] .metric-card,
html[data-theme="dark"] .stat-card,
html[data-theme="dark"] .sc-global-search-v548,
html[data-theme="dark"] .sc-icon-btn-v548,
html[data-theme="dark"] .sc-user-pill-v548{
  background:#111827!important;
  color:#e5edf8!important;
  border-color:#334155!important;
}

html[data-theme="dark"] .data-table tbody tr:nth-child(even),
html[data-theme="dark"] .table tbody tr:nth-child(even),
html[data-theme="dark"] table tbody tr:nth-child(even){
  background:#0f172a!important;
}

html[data-theme="dark"] .data-table tbody tr:hover,
html[data-theme="dark"] .table tbody tr:hover,
html[data-theme="dark"] table tbody tr:hover{
  background:#172554!important;
}

/* ===================== Responsivo ===================== */
@media(max-width:920px){
  .sc-global-search-v548{
    min-width:180px;
    max-width:50vw;
  }
  .sc-user-meta-v548{
    display:none;
  }
}

@media(max-width:680px){
  .topbar{
    position:relative!important;
  }
  .sc-topbar-v548{
    align-items:flex-start;
    flex-direction:column;
  }
  .sc-topbar-right-v548,
  .sc-global-search-v548{
    width:100%;
    max-width:none;
  }
  .sc-global-search-v548{
    min-width:100%;
  }
}
