:root {
  --sidebar-width: 265px;
  --sidebar-bg: #141414;
  --sidebar-border: #2a2a2a;
  --gold: #C9A227;
  --gold-light: #E8C44A;
  --gold-dark: #A07D10;
  --topbar-height: 56px;
  --body-bg: #0f0f0f;
  --card-bg: #1c1c1c;
  --card-border: #2a2a2a;
  --text-muted-custom: #888;
}

body {
  background-color: #111318;
  font-family: 'Segoe UI', sans-serif;
  color: #e0e0e0;
}

/* ── SIDEBAR ── */
.sidebar {
  width: var(--sidebar-width);
  min-height: 100vh;
  background: #1a1a1a;
  border-right: 1px solid #2a2a2a;
  color: #fff;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  transition: width 0.25s ease;
  z-index: 100;
}

.sidebar-brand {
  color: var(--gold);
  text-decoration: none;
  letter-spacing: 0.02em;
}
.sidebar-brand:hover { color: var(--gold-light); }

.sidebar-logo-text {
  line-height: 1.1;
}
.sidebar-logo-text .brand-name {
  font-size: 1rem;
  font-weight: 700;
  color: #fff;
  letter-spacing: 0.1em;
}
.sidebar-logo-text .brand-sub {
  font-size: 0.6rem;
  color: var(--gold);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.sidebar-logo-img {
  width: 100%;
  max-width: 220px;
  height: auto;
  display: block;
  margin: 0 auto;
  border-radius: 8px;
}

.login-logo {
  width: 200px;
  height: auto;
  filter: drop-shadow(0 0 16px rgba(201,162,39,0.4));
}

.rv-badge {
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, var(--gold-dark), var(--gold));
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-size: 1rem;
  color: #0d0d0d;
  flex-shrink: 0;
  box-shadow: 0 0 12px rgba(201,162,39,0.4);
}

.sidebar-section {
  display: block;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: #444;
  text-transform: uppercase;
  padding: 0.5rem 0.75rem 0.15rem;
}

.sidebar .nav-link {
  color: #aaa;
  border-radius: 8px;
  font-size: 0.875rem;
  padding: 0.45rem 0.75rem;
  transition: all 0.15s;
}
.sidebar .nav-link:hover {
  background: rgba(201,162,39,0.1);
  color: var(--gold-light);
}
.sidebar .nav-link.active {
  background: rgba(201,162,39,0.15);
  color: var(--gold);
  font-weight: 600;
  border-left: 3px solid var(--gold);
}
.sidebar .nav-link i { opacity: 0.8; }
.sidebar .nav-link.active i, .sidebar .nav-link:hover i { opacity: 1; }

/* ── TOPBAR ── */
.topbar {
  height: var(--topbar-height);
  background: #141414;
  border-bottom: 1px solid #1e1e1e;
  position: sticky;
  top: 0;
  z-index: 99;
}
.topbar .breadcrumb-item a { color: var(--gold); text-decoration: none; }
.topbar .breadcrumb-item.active { color: #888; }
.topbar .breadcrumb-item + .breadcrumb-item::before { color: #444; }

/* ── CONTENT ── */
#page-content { min-height: 100vh; overflow-x: hidden; }

/* ── CARDS ── */
.card {
  background: #1a1a1a;
  border-color: #252525 !important;
  color: #ddd;
}
.card-header {
  background: #1a1a1a !important;
  border-bottom-color: #252525 !important;
  color: #ddd;
}

/* ── STAT CARDS ── */
.stat-card { border-radius: 12px; transition: transform 0.15s; }
.stat-card:hover { transform: translateY(-2px); }
.stat-icon {
  width: 56px; height: 56px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
}

/* ── TABLES ── */
.table {
  color: #ccc;
  border-color: #252525;
}
.table-dark { background: #111 !important; }
.table-dark th { background: #111 !important; color: #aaa; border-color: #222; }
.table-hover > tbody > tr:hover > * { background-color: rgba(201,162,39,0.05); color: #eee; }
.table th {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #888;
}
.table td { font-size: 0.875rem; border-color: #222; }
.table-light { background: #161616 !important; color: #aaa; }
.table-light th { background: #161616 !important; }

/* ── ALERTS / MESSAGES ── */
.alert { border: none; border-radius: 8px; font-size: 0.875rem; }
.alert-success { background: rgba(39,174,96,0.15); color: #2ecc71; }
.alert-danger  { background: rgba(231,76,60,0.15);  color: #e74c3c; }
.alert-warning { background: rgba(243,156,18,0.15); color: #f39c12; }
.alert-info    { background: rgba(52,152,219,0.15); color: #3498db; }

/* ── BUTTONS ── */
.btn-primary {
  background: linear-gradient(135deg, var(--gold-dark), var(--gold));
  border: none;
  color: #0d0d0d;
  font-weight: 600;
}
.btn-primary:hover {
  background: linear-gradient(135deg, var(--gold), var(--gold-light));
  color: #0d0d0d;
}
.btn-outline-primary {
  border-color: var(--gold);
  color: var(--gold);
}
.btn-outline-primary:hover {
  background: var(--gold);
  color: #0d0d0d;
}
.btn-outline-secondary {
  border-color: #333;
  color: #aaa;
}
.btn-outline-secondary:hover {
  background: #333;
  color: #fff;
  border-color: #333;
}

/* ── FORMS ── */
.form-control, .form-select {
  background: #141414;
  border-color: #2a2a2a;
  color: #ddd;
}
.form-control:focus, .form-select:focus {
  background: #141414;
  border-color: var(--gold);
  color: #fff;
  box-shadow: 0 0 0 0.2rem rgba(201,162,39,0.2);
}
.form-control::placeholder { color: #555; }
.input-group-text {
  background: #1a1a1a;
  border-color: #2a2a2a;
  color: #666;
}

/* ── BADGES ── */
.badge { font-weight: 500; }
.bg-primary { background: var(--gold) !important; color: #0d0d0d !important; }

/* ── LIST GROUP ── */
.list-group-item {
  background: transparent;
  border-color: #252525;
  color: #ccc;
}

/* ── BREADCRUMB ── */
.breadcrumb { margin: 0; }

/* ── LOGIN ── */
.login-bg {
  background: radial-gradient(ellipse at center, #1a1500 0%, #0d0d0d 70%);
  position: relative;
  overflow: hidden;
}
.login-bg::before {
  content: '';
  position: absolute;
  width: 500px; height: 500px;
  background: radial-gradient(circle, rgba(201,162,39,0.08) 0%, transparent 70%);
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;
}
.login-card {
  width: 100%;
  max-width: 430px;
  border-radius: 16px;
  background: #161616 !important;
  border: 1px solid #2a2a2a !important;
  box-shadow: 0 25px 60px rgba(0,0,0,0.6), 0 0 40px rgba(201,162,39,0.05) !important;
}
.login-icon {
  width: 76px; height: 76px;
  background: linear-gradient(135deg, #0d0d0d, #1a1400);
  border: 2px solid var(--gold);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto;
  box-shadow: 0 0 20px rgba(201,162,39,0.3);
}
.login-title { color: #fff; font-weight: 700; letter-spacing: 0.05em; }
.login-subtitle { color: var(--gold) !important; }

/* ── USER INFO NA SIDEBAR ── */
.sidebar-user { color: #aaa; }
.sidebar-user .user-name { color: #ddd; font-weight: 600; font-size: 0.85rem; }
.sidebar-user .user-level { color: var(--gold); font-size: 0.72rem; }

/* ── DIVIDERS ── */
hr { border-color: #1e1e1e; opacity: 1; }

/* ── SCROLLBAR ── */
.sidebar::-webkit-scrollbar { width: 4px; }
.sidebar::-webkit-scrollbar-track { background: transparent; }
.sidebar::-webkit-scrollbar-thumb { background: #2a2a2a; border-radius: 4px; }

/* ── SIDEBAR COLLAPSED ── */
#wrapper.sidebar-collapsed .sidebar { width: 0; padding: 0 !important; overflow: hidden; }

@media (max-width: 768px) {
  .sidebar { position: fixed; width: 0; overflow: hidden; }
  #wrapper.sidebar-open .sidebar { width: var(--sidebar-width); padding: 1rem !important; }
  #page-content { width: 100%; }
}

/* ── TABLE DANGER/WARNING OVERRIDE ── */
.table-danger { background-color: rgba(231,76,60,0.1) !important; }
.table-warning { background-color: rgba(243,156,18,0.1) !important; }

/* ── STAT CARD BACKGROUNDS ── */
.stat-primary .stat-icon { background: rgba(201,162,39,0.12); color: var(--gold); }
.stat-danger  .stat-icon { background: rgba(231,76,60,0.12);  color: #e74c3c; }
.stat-warning .stat-icon { background: rgba(243,156,18,0.12); color: #f39c12; }
.stat-success .stat-icon { background: rgba(46,204,113,0.12); color: #2ecc71; }

/* ── DARK THEME: TEXT OVERRIDES ── */
/* text-muted do Bootstrap é #6c757d — invisível no fundo escuro */
.text-muted { color: #8a8a8a !important; }
small.text-muted, p.text-muted { color: #7a7a7a !important; }

/* Labels dos stat-cards — mais legíveis no dark */
.stat-label {
  color: #aaa;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 4px;
}
.stat-sublabel { color: #666; font-size: 0.75rem; }

/* Card headers devem ter texto visível */
.card-header h6, .card-header .h6 { color: #ccc; }

/* Chart.js canvas — fundo transparente */
canvas { background: transparent !important; }

/* ── BADGE NAO_LANCADO ── */
.badge-nao-lancado { background: #8B0000; color: #fff; }
