/* =============================================
   AssisteTecnologia — Sistema de Orçamento
   style.css
   ============================================= */

:root {
  --brand-primary:   #0d1b2a;
  --brand-accent:    #1565c0;
  --brand-accent2:   #ffc107;
  --sidebar-w:       220px;
  --sidebar-bg:      #0d1b2a;
  --sidebar-hover:   #1a3050;
  --sidebar-active:  #1565c0;
  --card-radius:     10px;
  --input-radius:    6px;
  --shadow-sm:       0 2px 8px rgba(0,0,0,.08);
  --shadow-md:       0 4px 16px rgba(0,0,0,.12);
}

/* ---- NAVBAR ---- */
.navbar-brand-custom { background: var(--brand-primary); border-bottom: 3px solid var(--brand-accent); }

/* ---- SIDEBAR ---- */
.sidebar {
  width: var(--sidebar-w);
  min-height: calc(100vh - 56px);
  background: var(--sidebar-bg);
  position: sticky;
  top: 56px;
  align-self: flex-start;
  overflow-y: auto;
}
.sidebar-inner { padding: 1rem 0; }
.sidebar .nav-link {
  color: rgba(255,255,255,.65);
  padding: .6rem 1.25rem;
  border-radius: 0;
  display: flex;
  align-items: center;
  gap: .6rem;
  font-size: .875rem;
  transition: all .15s;
}
.sidebar .nav-link:hover  { background: var(--sidebar-hover); color: #fff; }
.sidebar .nav-link.active { background: var(--sidebar-active); color: #fff; font-weight: 600; }
.sidebar .nav-link i      { font-size: 1.05rem; width: 18px; text-align: center; }
.nav-divider { border-top: 1px solid rgba(255,255,255,.1); margin: .75rem 0; }

/* ---- MAIN ---- */
.main-content { min-width: 0; }

/* ---- CARDS ---- */
.card { border: none; border-radius: var(--card-radius); box-shadow: var(--shadow-sm); }
.card-header { border-radius: var(--card-radius) var(--card-radius) 0 0 !important; }

.card-grupo { border-left: 4px solid var(--brand-accent); }
.card-grupo.cftv            { border-color: #1565c0; }
.card-grupo.controle_acesso { border-color: #6a1b9a; }
.card-grupo.rede_nobreak    { border-color: #00838f; }
.card-grupo.alarmes         { border-color: #e65100; }
.card-grupo.infraestrutura  { border-color: #2e7d32; }
.card-grupo.servicos        { border-color: #c62828; }

/* ---- KPI CARDS ---- */
.kpi-card { text-align: center; padding: 1.25rem; }
.kpi-card .kpi-value { font-size: 1.5rem; font-weight: 700; color: var(--brand-accent); }
.kpi-card .kpi-label { font-size: .78rem; color: #6c757d; text-transform: uppercase; letter-spacing: .05em; }

/* ---- TABLES ---- */
.table-orcamento { font-size: .82rem; }
.table-orcamento th { background: #f1f5fb; font-weight: 600; white-space: nowrap; vertical-align: middle; }
.table-orcamento td { vertical-align: middle; }
.table-orcamento .input-sm {
  font-size: .82rem;
  padding: .2rem .4rem;
  border-radius: var(--input-radius);
  border: 1px solid #dee2e6;
  width: 100%;
}
.table-orcamento .input-sm:focus { outline: none; border-color: var(--brand-accent); box-shadow: 0 0 0 2px rgba(21,101,192,.15); }
.table-orcamento .td-calc { background: #f8f9fa; color: #495057; font-variant-numeric: tabular-nums; }
.table-orcamento .td-margem { font-weight: 600; }
.table-orcamento .td-lucro { color: #2e7d32; font-weight: 600; }
.row-subtotal { background: #e8f0fe !important; font-weight: 700; }
.row-total    { background: #1565c0 !important; color: #fff !important; font-weight: 700; }

/* ---- FORM ---- */
.form-label { font-weight: 500; font-size: .875rem; margin-bottom: .25rem; }
.form-control, .form-select { border-radius: var(--input-radius); font-size: .875rem; }
.form-section-title {
  font-size: .7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: #6c757d;
  margin-bottom: .75rem;
  padding-bottom: .35rem;
  border-bottom: 1px solid #dee2e6;
}

/* ---- BADGES ---- */
.badge-grupo { font-size: .72rem; padding: .3em .6em; }

/* ---- BOTÃO ADICIONAR ITEM ---- */
.btn-add-item { font-size: .8rem; padding: .25rem .75rem; }

/* ---- TOTALS BAR ---- */
.totals-bar {
  position: sticky;
  bottom: 0;
  background: #fff;
  border-top: 2px solid #dee2e6;
  box-shadow: 0 -4px 16px rgba(0,0,0,.08);
  z-index: 100;
  padding: .75rem 1.5rem;
}
.totals-bar .tot-item { text-align: center; }
.totals-bar .tot-value { font-size: 1.1rem; font-weight: 700; }
.totals-bar .tot-label { font-size: .7rem; color: #6c757d; text-transform: uppercase; }

/* ---- HISTORICO ---- */
.table-historico .acoes .btn { padding: .2rem .5rem; font-size: .78rem; }

/* ---- CONFIGURAÇÕES ---- */
.config-section { margin-bottom: 2rem; }
.config-section .card-header { background: var(--brand-primary); color: #fff; }

/* ---- MODAL MEMÓRIA ---- */
.memoria-item { font-size: .82rem; padding: .35rem .5rem; border-bottom: 1px solid #f0f0f0; }
.memoria-item:last-child { border-bottom: none; }
.memoria-label { color: #6c757d; width: 150px; display: inline-block; }

/* ---- SERVIÇOS TÉCNICOS ---- */
.secao-servico { border-left: 4px solid var(--brand-accent2); }
.secao-titulo  { font-weight: 700; font-size: .9rem; display: flex; align-items: center; gap: .5rem; }

/* ---- RESPONSIVO ---- */
@media (max-width: 991px) {
  .sidebar { display: none !important; }
  .main-content { width: 100%; }
}

/* ---- UTILITÁRIOS ---- */
.text-mono { font-family: 'Courier New', monospace; }
.fw-600 { font-weight: 600; }
.fs-13 { font-size: .8125rem; }

/* ---- ALERTAS ---- */
.alert-flutuante {
  position: fixed;
  top: 70px;
  right: 20px;
  z-index: 9999;
  min-width: 280px;
  animation: fadeInRight .3s ease;
}
@keyframes fadeInRight {
  from { opacity: 0; transform: translateX(30px); }
  to   { opacity: 1; transform: translateX(0); }
}

/* ---- SPINNER OVERLAY ---- */
.spinner-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.35);
  display: flex; align-items: center; justify-content: center;
  z-index: 9998;
}

/* ---- PRINT ---- */
@media print {
  .sidebar, .navbar, .totals-bar, .btn, .no-print { display: none !important; }
  .main-content { padding: 0 !important; }
}
