:root {
  --brand-primary: #0d6efd;
  --brand-secondary: #0a2540;
  --sidebar-width: 260px;
}

body {
  background-color: #f4f6f9;
}

/* ---------- Admin shell ---------- */
.app-shell {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: var(--sidebar-width);
  flex-shrink: 0;
  background-color: var(--brand-secondary);
  color: #fff;
  min-height: 100vh;
  position: sticky;
  top: 0;
  overflow-y: auto;
}

.sidebar .brand {
  padding: 1rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar .brand img {
  max-height: 32px;
}

.sidebar .brand span {
  font-weight: 600;
  font-size: 1.05rem;
  color: #fff;
}

.sidebar .nav-link {
  color: rgba(255, 255, 255, 0.8);
  padding: 0.55rem 1rem;
  border-radius: 0;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.92rem;
}

.sidebar .nav-link:hover,
.sidebar .nav-link.active {
  background-color: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.sidebar .submenu .nav-link {
  padding-left: 2.4rem;
  font-size: 0.87rem;
}

.sidebar .menu-toggle::after {
  content: '\F282';
  font-family: 'bootstrap-icons';
  margin-left: auto;
  transition: transform 0.15s ease;
  font-size: 0.7rem;
}

.sidebar .menu-toggle[aria-expanded='true']::after {
  transform: rotate(90deg);
}

.main-content {
  flex-grow: 1;
  min-width: 0;
}

.topbar {
  background: #fff;
  border-bottom: 1px solid #e5e9f0;
  padding: 0.65rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.page-content {
  padding: 1.5rem;
}

.brand-btn {
  --bs-btn-color: #fff;
  --bs-btn-bg: var(--brand-primary);
  --bs-btn-border-color: var(--brand-primary);
  --bs-btn-hover-color: #fff;
  --bs-btn-hover-bg: color-mix(in srgb, var(--brand-primary) 85%, black);
  --bs-btn-hover-border-color: color-mix(in srgb, var(--brand-primary) 80%, black);
  --bs-btn-active-color: #fff;
  --bs-btn-active-bg: color-mix(in srgb, var(--brand-primary) 75%, black);
  --bs-btn-active-border-color: color-mix(in srgb, var(--brand-primary) 70%, black);
  --bs-btn-disabled-color: #fff;
  --bs-btn-disabled-bg: var(--brand-primary);
  --bs-btn-disabled-border-color: var(--brand-primary);
  --bs-btn-focus-shadow-rgb: 13, 110, 253;
  background-color: var(--brand-primary);
  border-color: var(--brand-primary);
  color: #fff;
}

.text-brand {
  color: var(--brand-primary);
}

.card-metric .value {
  font-size: 1.8rem;
  font-weight: 700;
}

/* ---------- Auth pages ---------- */
.auth-wrapper {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--brand-secondary), var(--brand-primary));
  padding: 1rem;
}

.auth-card {
  width: 100%;
  max-width: 380px;
}

/* ---------- Site público ---------- */
.site-header {
  background: #fff;
  border-bottom: 1px solid #eee;
}

.site-hero {
  background: linear-gradient(135deg, var(--brand-secondary), var(--brand-primary));
  color: #fff;
  padding: 5rem 0;
}

.site-footer {
  background: var(--brand-secondary);
  color: rgba(255, 255, 255, 0.8);
  padding: 2.5rem 0;
}

/* ---------- Painel (dashboard) ---------- */
.dashboard-hero {
  background: linear-gradient(135deg, var(--brand-secondary), var(--brand-primary));
  color: #fff;
  border-radius: 0.75rem;
  padding: 1.5rem 1.75rem;
}

.dashboard-hero .text-white-50 {
  color: rgba(255, 255, 255, 0.75) !important;
}

.kpi-card {
  border-radius: 0.75rem;
  height: 100%;
}

.kpi-card .kpi-icon {
  width: 46px;
  height: 46px;
  border-radius: 0.6rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  color: #fff;
  background: linear-gradient(135deg, var(--brand-secondary), var(--brand-primary));
  flex-shrink: 0;
}

.kpi-card .kpi-value {
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1.2;
}

.kpi-card.kpi-warning .kpi-icon { background: linear-gradient(135deg, #b45309, #f59e0b); }
.kpi-card.kpi-danger .kpi-icon { background: linear-gradient(135deg, #991b1b, #ef4444); }
.kpi-card.kpi-success .kpi-icon { background: linear-gradient(135deg, #14532d, #22c55e); }
.kpi-card.kpi-info .kpi-icon { background: linear-gradient(135deg, #155e75, #06b6d4); }

.chip-stat {
  border-radius: 0.6rem;
  padding: 0.65rem 0.9rem;
  background: #f8f9fb;
  border: 1px solid #eef0f4;
}

.activity-feed {
  list-style: none;
  margin: 0;
  padding: 0;
}

.activity-feed li {
  display: flex;
  gap: 0.75rem;
  padding: 0.65rem 0;
  border-bottom: 1px solid #f0f2f5;
}

.activity-feed li:last-child {
  border-bottom: none;
}

.activity-feed .activity-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-top: 0.4rem;
  flex-shrink: 0;
  background: var(--brand-primary);
}

.quick-link {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.75rem 1rem;
  border-radius: 0.6rem;
  border: 1px solid #eef0f4;
  color: #212529;
  text-decoration: none;
  transition: all 0.15s ease;
  height: 100%;
}

.quick-link:hover {
  border-color: var(--brand-primary);
  background: color-mix(in srgb, var(--brand-primary) 6%, white);
  color: #212529;
}

.quick-link i {
  font-size: 1.15rem;
  color: var(--brand-primary);
}

@media (max-width: 991.98px) {
  .sidebar {
    position: fixed;
    z-index: 1040;
    left: -100%;
    transition: left 0.2s ease;
  }
  .sidebar.show {
    left: 0;
  }
}


/* ===========================
   TEMA DARK – inspirado no VPS Completa (fundo escuro profundo, sidebar navy, cards com borda sutil)
   =========================== */

[data-bs-theme="dark"] {
  --bs-body-bg: #0f1117;
  --bs-body-color: #cdd5e0;
  --bs-border-color: #2a2f3d;
  --bs-card-bg: #161b27;
  --bs-table-bg: #161b27;
  --bs-input-bg: #1e2434;
  --bs-input-color: #cdd5e0;
  --bs-input-border-color: #2a2f3d;
}

[data-bs-theme="dark"] body {
  background-color: #0f1117;
  color: #cdd5e0;
}

/* Dashboard específicos */
[data-bs-theme="dark"] .dashboard-hero {
  background: linear-gradient(135deg, #13172b, #1e2434);
  border: 1px solid #2a2f3d;
}

[data-bs-theme="dark"] .chip-stat {
  background-color: #161b27;
  border-color: #2a2f3d;
}

/* Sidebar escura */
[data-bs-theme="dark"] .sidebar {
  background-color: #13172b;
  border-right: 1px solid #1e2434;
}

/* Topbar */
[data-bs-theme="dark"] header.topbar {
  background-color: #161b27 !important;
  border-bottom: 1px solid #2a2f3d;
  color: #cdd5e0;
}

[data-bs-theme="dark"] header.topbar .btn-light {
  background-color: #1e2434;
  border-color: #2a2f3d;
  color: #cdd5e0;
}

[data-bs-theme="dark"] header.topbar .text-muted {
  color: #7a8596 !important;
}

/* Cards */
[data-bs-theme="dark"] .card {
  background-color: #161b27;
  border: 1px solid #2a2f3d !important;
  box-shadow: 0 2px 8px rgba(0,0,0,0.4) !important;
}

[data-bs-theme="dark"] .card-header {
  background-color: #1e2434 !important;
  border-bottom: 1px solid #2a2f3d;
  color: #cdd5e0 !important;
}

[data-bs-theme="dark"] .card-header.bg-white {
  background-color: #1e2434 !important;
}

/* Tables */
[data-bs-theme="dark"] .table {
  color: #cdd5e0;
  border-color: #2a2f3d;
  --bs-table-color: #cdd5e0;
  --bs-table-bg: transparent;
  --bs-table-striped-color: #cdd5e0;
  --bs-table-striped-bg: #191e2e;
  --bs-table-hover-color: #fff;
  --bs-table-hover-bg: #1e2434;
  --bs-table-border-color: #2a2f3d;
}

[data-bs-theme="dark"] .table thead th {
  background-color: #1a1f30;
  border-bottom: 2px solid #2a2f3d;
  color: #9aaec4;
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.07em;
  font-weight: 600;
}

[data-bs-theme="dark"] .table > :not(caption) > * > * {
  background-color: transparent;
  color: #cdd5e0;
}

[data-bs-theme="dark"] .table tbody tr {
  border-bottom: 1px solid #1e2434;
}

[data-bs-theme="dark"] .table-hover tbody tr:hover {
  background-color: #1e2434;
  color: #fff;
}

[data-bs-theme="dark"] .table-striped > tbody > tr:nth-of-type(odd) > * {
  background-color: #191e2e;
  color: #cdd5e0;
}

/* Linha de detalhes expandida (bg-light dentro da tabela) */
[data-bs-theme="dark"] .table .bg-light,
[data-bs-theme="dark"] tr.bg-light td,
[data-bs-theme="dark"] td.bg-light {
  background-color: #1a2035 !important;
  color: #b0bfd0 !important;
}

[data-bs-theme="dark"] .bg-light {
  background-color: #1e2434 !important;
  color: #b0bfd0 !important;
}

[data-bs-theme="dark"] .collapse .bg-light,
[data-bs-theme="dark"] .collapse td {
  background-color: #1a2035 !important;
  color: #b0bfd0 !important;
}


/* Formulários */
[data-bs-theme="dark"] .form-control,
[data-bs-theme="dark"] .form-select {
  background-color: #1e2434;
  border-color: #2a2f3d;
  color: #cdd5e0;
}

[data-bs-theme="dark"] .form-control:focus,
[data-bs-theme="dark"] .form-select:focus {
  background-color: #1e2434;
  border-color: #4a6fa5;
  color: #cdd5e0;
  box-shadow: 0 0 0 0.2rem rgba(74,111,165,0.25);
}

[data-bs-theme="dark"] .form-control::placeholder {
  color: #4a5568;
}

[data-bs-theme="dark"] .form-label {
  color: #8a9ab0;
}

/* Inputs de texto */
[data-bs-theme="dark"] input[type="text"],
[data-bs-theme="dark"] input[type="number"],
[data-bs-theme="dark"] input[type="email"],
[data-bs-theme="dark"] input[type="password"],
[data-bs-theme="dark"] textarea,
[data-bs-theme="dark"] select {
  background-color: #1e2434;
  border-color: #2a2f3d;
  color: #cdd5e0;
}

/* Badges & pills */
[data-bs-theme="dark"] .badge.bg-light {
  background-color: #1e2434 !important;
  color: #8a9ab0 !important;
  border-color: #2a2f3d !important;
}

/* Alertas */
[data-bs-theme="dark"] .alert-secondary {
  background-color: #1a1f30;
  border-color: #2a2f3d;
  color: #8a9ab0;
}

[data-bs-theme="dark"] .alert-info {
  background-color: #0d2137;
  border-color: #1a4a6e;
  color: #5bc0eb;
}

[data-bs-theme="dark"] .alert-warning {
  background-color: #2a1f00;
  border-color: #4a3500;
  color: #f0c040;
}

[data-bs-theme="dark"] .alert-danger {
  background-color: #2a0d0d;
  border-color: #4a1515;
  color: #f05050;
}

[data-bs-theme="dark"] .alert-success {
  background-color: #0a2a1a;
  border-color: #1a4a2a;
  color: #4ad090;
}

/* Botões outline */
[data-bs-theme="dark"] .btn-outline-secondary {
  color: #9aaec4;
  border-color: #3a4152;
}

[data-bs-theme="dark"] .btn-outline-secondary:hover {
  background-color: #2a2f3d;
  border-color: #4a5570;
  color: #fff;
}

[data-bs-theme="dark"] .btn-outline-primary {
  color: #5a9fff;
  border-color: #3a6fa5;
}

[data-bs-theme="dark"] .btn-outline-primary:hover {
  background-color: #1a3a6a;
  color: #fff;
}

[data-bs-theme="dark"] .btn-outline-danger {
  color: #ff7070;
  border-color: #8a2020;
}

[data-bs-theme="dark"] .btn-outline-danger:hover {
  background-color: #5a1515;
  color: #fff;
}

[data-bs-theme="dark"] .btn-outline-warning {
  color: #f0c040;
  border-color: #7a6020;
}

[data-bs-theme="dark"] .btn-outline-warning:hover {
  background-color: #4a3a10;
  color: #fff;
}

[data-bs-theme="dark"] .btn-outline-success {
  color: #50d090;
  border-color: #207050;
}

[data-bs-theme="dark"] .btn-outline-success:hover {
  background-color: #104030;
  color: #fff;
}

/* Links dentro de tabelas */
[data-bs-theme="dark"] .table a,
[data-bs-theme="dark"] a.btn-link {
  color: #5a9fff;
}

[data-bs-theme="dark"] .table a:hover {
  color: #88bbff;
}

[data-bs-theme="dark"] .btn-light {
  background-color: #1e2434;
  border-color: #2a2f3d;
  color: #cdd5e0;
}


/* Modais */
[data-bs-theme="dark"] .modal-content {
  background-color: #161b27;
  border: 1px solid #2a2f3d;
}

[data-bs-theme="dark"] .modal-header {
  background-color: #1e2434;
  border-bottom: 1px solid #2a2f3d;
  color: #cdd5e0;
}

[data-bs-theme="dark"] .modal-footer {
  background-color: #1a1f30;
  border-top: 1px solid #2a2f3d;
}

[data-bs-theme="dark"] .modal-header .btn-close {
  filter: invert(1);
}

/* Dropdowns */
[data-bs-theme="dark"] .dropdown-menu {
  background-color: #1e2434;
  border: 1px solid #2a2f3d;
}

[data-bs-theme="dark"] .dropdown-item {
  color: #cdd5e0;
}

[data-bs-theme="dark"] .dropdown-item:hover {
  background-color: #2a2f3d;
  color: #fff;
}

[data-bs-theme="dark"] .dropdown-divider {
  border-color: #2a2f3d;
}

/* Breadcrumb */
[data-bs-theme="dark"] .breadcrumb-item a {
  color: #4a9eff;
}

[data-bs-theme="dark"] .breadcrumb-item.active {
  color: #7a8596;
}

/* Paginação */
[data-bs-theme="dark"] .page-link {
  background-color: #1e2434;
  border-color: #2a2f3d;
  color: #7a8cff;
}

[data-bs-theme="dark"] .page-link:hover {
  background-color: #2a2f3d;
  border-color: #3a3f5d;
  color: #a0b4ff;
}

[data-bs-theme="dark"] .page-item.active .page-link {
  background-color: #4a6fa5;
  border-color: #4a6fa5;
}

[data-bs-theme="dark"] .page-item.disabled .page-link {
  background-color: #161b27;
  border-color: #2a2f3d;
  color: #3a4050;
}

/* Tabs */
[data-bs-theme="dark"] .nav-tabs {
  border-bottom-color: #2a2f3d;
}

[data-bs-theme="dark"] .nav-tabs .nav-link {
  color: #7a8596;
}

[data-bs-theme="dark"] .nav-tabs .nav-link.active {
  background-color: #161b27;
  border-color: #2a2f3d #2a2f3d #161b27;
  color: #cdd5e0;
}

/* Texto muted */
[data-bs-theme="dark"] .text-muted {
  color: #5a6880 !important;
}

/* Área de conteúdo */
[data-bs-theme="dark"] .page-content {
  background-color: #0f1117;
}

/* List groups */
[data-bs-theme="dark"] .list-group-item {
  background-color: #161b27;
  border-color: #2a2f3d;
  color: #cdd5e0;
}

[data-bs-theme="dark"] .list-group-item:hover,
[data-bs-theme="dark"] .list-group-item-action:hover {
  background-color: #1e2434;
  color: #fff;
}

/* Progress bars */
[data-bs-theme="dark"] .progress {
  background-color: #1e2434;
}

/* Quick links */
[data-bs-theme="dark"] .quick-link {
  border-color: #2a2f3d;
  color: #cdd5e0;
  background-color: #161b27;
}

[data-bs-theme="dark"] .quick-link:hover {
  border-color: #4a6fa5;
  background-color: #1e2434;
  color: #fff;
}

/* Scrollbar */
[data-bs-theme="dark"] * {
  scrollbar-width: thin;
  scrollbar-color: #2a2f3d #161b27;
}

[data-bs-theme="dark"] *::-webkit-scrollbar {
  width: 6px;
}

[data-bs-theme="dark"] *::-webkit-scrollbar-track {
  background: #161b27;
}

[data-bs-theme="dark"] *::-webkit-scrollbar-thumb {
  background-color: #2a2f3d;
  border-radius: 3px;
}

/* hr */
[data-bs-theme="dark"] hr {
  border-color: #2a2f3d;
}

/* code */
[data-bs-theme="dark"] code {
  color: #7aadff;
  background-color: #1a2240;
  padding: 1px 4px;
  border-radius: 3px;
}

/* Activity feed */
[data-bs-theme="dark"] .activity-feed {
  border-color: #2a2f3d;
}

/* Toggle button */
[data-bs-theme="dark"] #themeToggle {
  color: #f0c040 !important;
}

[data-bs-theme="light"] #themeToggle {
  color: #4a5568 !important;
}
