
:root {
  --uvp-radius: 1rem;
  --uvp-card-shadow: 0 10px 24px rgba(0,0,0,.06), 0 2px 6px rgba(0,0,0,.06);
}

/* Smooth fonts */
html { -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }

/* Cards */
.card {
  border: 0 !important;
  border-radius: var(--uvp-radius) !important;
  box-shadow: var(--uvp-card-shadow);
}

/* Buttons */
.btn {
  border-radius: .75rem !important;
  font-weight: 600;
}

/* Badges */
.badge {
  border-radius: 999px;
  font-weight: 600;
}

/* Navbar spacing */
.navbar .btn, .navbar .badge { margin-left: .25rem; }

/* Tables */
.table {
  border-collapse: separate;
  border-spacing: 0 6px;
}
.table thead th {
  font-weight: 700;
  text-transform: none;
}

.table tbody tr td:first-child {
  border-top-left-radius: .6rem;
  border-bottom-left-radius: .6rem;
}
.table tbody tr td:last-child {
  border-top-right-radius: .6rem;
  border-bottom-right-radius: .6rem;
}

/* Offcanvas menu style (if used) */
.offcanvas {
  border-radius: var(--uvp-radius);
}

/* DataTables tweaks to match Tabler look */
.dataTables_wrapper .dataTables_paginate .paginate_button {
  border-radius: .6rem !important;
}
.dataTables_wrapper .dataTables_filter input {
  border-radius: .6rem !important;
  padding: .5rem .75rem !important;
}

/* Form controls */
.form-control, .form-select {
  border-radius: .75rem !important;
}


/* Ensure page content is not hidden behind fixed navbar + sidebar */
@media (min-width: 992px) {
  body { padding-top: 56px; }
  .navbar-vertical { position: fixed; left: 0; bottom: 0; width: 260px; overflow-y: auto; }
  .page-content, .container, .container-xl { margin-left: 260px; }
}
@media (max-width: 991.98px) {
  .navbar-vertical { display: none; }
}


/* ===== UltraVision Dark Theme Fixes ===== */
:root {
  --uvp-radius: 1rem;
  --uvp-card-shadow: 0 10px 24px rgba(0,0,0,.25), 0 2px 6px rgba(0,0,0,.24);
  --uvp-bg: #0f1722;
  --uvp-bg-2: #131c28;
  --uvp-card: #151e2b;
  --uvp-border: #263041;
  --uvp-text: #e2e8f0;
  --uvp-muted: #97a6ba;
  --uvp-green: #22c55e;
  --uvp-red: #ef4444;
  --uvp-primary: #5368f1;
}
html[data-bs-theme="dark"] body { background: var(--uvp-bg) !important; color: var(--uvp-text); }
html[data-bs-theme="dark"] .card { background: var(--uvp-card) !important; color: var(--uvp-text); border: 1px solid var(--uvp-border) !important; }
html[data-bs-theme="dark"] .card .text-muted { color: var(--uvp-muted) !important; }
html[data-bs-theme="dark"] .btn { border-color: transparent; }
html[data-bs-theme="dark"] .btn-primary { background: var(--uvp-primary); }
html[data-bs-theme="dark"] .btn-danger { background: var(--uvp-red); }
html[data-bs-theme="dark"] .btn-success, .badge.bg-success { background: var(--uvp-green) !important; color: #0a0a0a !important; }
html[data-bs-theme="dark"] .navbar { background: #0c1320 !important; border-bottom: 1px solid var(--uvp-border); }
html[data-bs-theme="dark"] .offcanvas, html[data-bs-theme="dark"] .navbar-vertical { background: var(--uvp-bg-2) !important; border-right: 1px solid var(--uvp-border); }
html[data-bs-theme="dark"] .table { color: var(--uvp-text); }
html[data-bs-theme="dark"] .table thead th { border-bottom-color: var(--uvp-border); }
html[data-bs-theme="dark"] .table td, html[data-bs-theme="dark"] .table th { border-color: var(--uvp-border) !important; }
html[data-bs-theme="dark"] .form-control, 
html[data-bs-theme="dark"] .form-select, 
html[data-bs-theme="dark"] .form-control:focus { 
  background: var(--uvp-bg) !important; color: var(--uvp-text) !important; border-color: var(--uvp-border) !important; 
}
html[data-bs-theme="dark"] .form-control::placeholder { color: var(--uvp-muted) !important; }
html[data-bs-theme="dark"] .bg-white, 
html[data-bs-theme="dark"] .bg-light, 
html[data-bs-theme="dark"] .btn-light, 
html[data-bs-theme="dark"] .list-group-item { 
  background: var(--uvp-card) !important; color: var(--uvp-text) !important; 
  border-color: var(--uvp-border) !important;
}
html[data-bs-theme="dark"] .dropdown-menu { background: var(--uvp-card) !important; color: var(--uvp-text) !important; border-color: var(--uvp-border) !important; }
html[data-bs-theme="dark"] .dropdown-item { color: var(--uvp-text) !important; }
html[data-bs-theme="dark"] .dropdown-item:hover { background: #1a2535 !important; }
html[data-bs-theme="dark"] .nav-link, html[data-bs-theme="dark"] .navbar-brand { color: var(--uvp-text) !important; }
html[data-bs-theme="dark"] .nav-link.active { color: #fff !important; background: rgba(255,255,255,.06); border-radius: .6rem; }
/* Sidebar layout */
@media (min-width: 992px) {
  body { padding-top: 56px; }
  .navbar-vertical { position: fixed; left: 0; top: 56px; bottom: 0; width: 260px; overflow-y: auto; }
  .page-content, .container, .container-fluid, .container-xl { margin-left: 260px; }
}
@media (max-width: 991.98px) {
  .navbar-vertical { display: none; }
}
/* Card spacing */
.card { border-radius: var(--uvp-radius) !important; box-shadow: var(--uvp-card-shadow) !important; }
.btn { border-radius: .75rem !important; font-weight: 600; }
/* KPI icon size */
.kpi-icon { font-size: 1.5rem; opacity: .9; }

/* Dark tables and cards */
.table tbody tr {
  background: var(--uvp-card, #161b22);
}
.card-footer {
  background: transparent !important;
  border-top: 1px solid rgba(255,255,255,.08) !important;
  color: var(--uvp-muted, #9aa6b2);
}
.card { color: var(--uvp-text, #e6edf3); }
.text-muted { color: var(--uvp-muted, #9aa6b2) !important; }

/* Navbar spacing preserved (already added) */

/* Force dark surface for any accidental bg-white/bg-light */
.bg-white, .bg-light, .card.bg-white, .card.bg-light { 
  background-color: var(--uvp-card, #161b22) !important; 
  color: var(--uvp-text, #e6edf3) !important;
}


/* === Dark theme fixes and mobile sidebar === */
:root {
  --uvp-bg: #0f172a; /* slate-900 */
  --uvp-bg-2: #111827;
  --uvp-card: #111827;
  --uvp-text: #e5e7eb;
}
body { background: var(--uvp-bg); color: var(--uvp-text); }
.card { background: var(--uvp-card) !important; color: var(--uvp-text) !important; }
.list-group-item { background: transparent; color: var(--uvp-text); }

/* Top navbar above sidebar */
.navbar.fixed-top { z-index: 1060; }

/* Desktop sidebar */
@media (min-width: 992px) {
  .navbar-vertical { position: fixed; left: 0; top: 56px; bottom: 0; width: 260px; overflow-y: auto; background: #0b1220; }
  .page-content, .container, .container-xl { margin-left: 260px; }
}

/* Mobile sidebar: slide-in + overlay */
@media (max-width: 991.98px) {
  .navbar-vertical { position: fixed; left: 0; top: 56px; bottom: 0; width: 82vw; max-width: 320px; background: #0b1220; transform: translateX(-100%); transition: transform .25s ease; z-index: 1051; }
  .navbar-vertical.show { transform: translateX(0); }
  .page-overlay { display: none; position: fixed; left: 0; right: 0; top: 56px; bottom: 0; background: rgba(0,0,0,.45); z-index: 1050; }
  .page-overlay.show { display: block; }
}

/* Remove any stray white blocks */
.bg-white, .card.bg-white { background: var(--uvp-card) !important; }
.text-dark { color: var(--uvp-text) !important; }


/* Online list compact rows */
.online-row { display:flex; justify-content:space-between; align-items:center; padding:.5rem .75rem; border-radius:.75rem; background: rgba(255,255,255,.03); margin-bottom:.5rem; }

/* neutralize sidebar margins after restore */
.page-content, .container, .container-xl { margin-left: 0 !important; }
@media (min-width: 992px){ .navbar-vertical { position: static !important; width:auto !important; height:auto !important; display:none !important; } }

/* Breadcrumbs tweaks */
.breadcrumb .breadcrumb-item + .breadcrumb-item::before { opacity:.5; }
.breadcrumb a { text-decoration: none; }


/* === Zoom-out tweaks (compact mode) === */
html { font-size: 15px; }            /* ~-6% menor que 16px */
@media (max-width: 575.98px){ html { font-size: 14px; } } /* mobile ainda menor */

h1 { font-size: 1.6rem; } 
h2 { font-size: 1.4rem; } 
h3 { font-size: 1.25rem; }

.card { padding: .75rem !important; } /* cards mais compactos */
.btn { padding: .45rem .8rem !important; font-size: .925rem !important; }
.badge { font-size: .8rem !important; padding: .4rem .6rem !important; }

/* Tabelas mais compactas */
.table td, .table th { padding: .5rem .6rem !important; font-size: .9rem; }

/* KPI icons um pouco menores */
.h1 { font-size: 1.75rem; }


/* === COMPACT HEADER & LAYOUT TUNING === */
@media (max-width: 991.98px){
  html { font-size: 13.25px; } /* zoom-out extra no mobile */
}
/* Header menor */
.navbar.fixed-top { padding-top: .2rem; padding-bottom: .2rem; }
.navbar .navbar-brand { font-size: 1.02rem; }
.navbar .btn { padding: .32rem .55rem !important; font-size: .84rem !important; border-radius: .6rem !important; }
.navbar .badge { font-size: .72rem; padding: .3rem .5rem; }
/* Ajuste do espaço do conteúdo (navbar fixa) */
body { padding-top: 50px; }
@media (max-width: 575.98px){ body { padding-top: 46px; } }

/* Breadcrumbs mais discretos e escondidos no mobile */
.uvp-bcbar { padding-top: .2rem !important; padding-bottom: .2rem !important; }
@media (max-width: 767.98px){ .uvp-bcbar { display: none !important; } }

/* Cartões/tiles mais compactos */
.card { padding: .6rem !important; border-radius: .8rem !important; }
.card .btn { padding: .38rem .6rem !important; font-size: .9rem !important; }
.card .badge { font-size: .78rem; }

/* Títulos menores (global) - override */
h1 { font-size: 1.35rem; }
h2 { font-size: 1.2rem; }
h3 { font-size: 1.05rem; }

/* Tabelas e formulários mais compactos */
.table td, .table th { padding: .45rem .5rem !important; font-size: .88rem; }
.form-control, .form-select { padding: .4rem .6rem !important; font-size: .92rem; border-radius: .6rem !important; }
