/* ── Variables ──────────────────────────────────────────────── */
:root {
  --sidebar-width: 240px;
  --topbar-height: 56px;
  --sidebar-bg: #1a1d21;
  --sidebar-hover: #2c3036;
  --sidebar-active: #dc3545;
  --sidebar-text: #adb5bd;
  --sidebar-section: #6c757d;
}

/* ── Layout ─────────────────────────────────────────────────── */
body {
  background: #f4f6f9;
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
}

body.auth-body {
  background: linear-gradient(135deg, #1a1d21 0%, #2c3036 100%);
}

.sidebar {
  position: fixed;
  top: var(--topbar-height);
  left: 0;
  width: var(--sidebar-width);
  height: calc(100vh - var(--topbar-height));
  background: var(--sidebar-bg);
  overflow-y: auto;
  overflow-x: hidden;
  z-index: 1030;
  padding-bottom: 2rem;
}

.sidebar::-webkit-scrollbar { width: 4px; }
.sidebar::-webkit-scrollbar-track { background: transparent; }
.sidebar::-webkit-scrollbar-thumb { background: #495057; border-radius: 2px; }

.main-content {
  margin-left: var(--sidebar-width);
  margin-top: var(--topbar-height);
  padding: 1.5rem;
  min-height: calc(100vh - var(--topbar-height));
}

/* ── Sidebar nav ────────────────────────────────────────────── */
.sidebar .nav-link {
  color: var(--sidebar-text);
  padding: .45rem 1.25rem;
  font-size: .875rem;
  display: flex;
  align-items: center;
  gap: .6rem;
  border-radius: 0;
  transition: background .15s, color .15s;
  white-space: nowrap;
}

.sidebar .nav-link i {
  font-size: 1rem;
  width: 18px;
  text-align: center;
  flex-shrink: 0;
}

.sidebar .nav-link:hover {
  background: var(--sidebar-hover);
  color: #fff;
}

.sidebar .nav-link.active {
  background: var(--sidebar-active);
  color: #fff;
  font-weight: 600;
}

.nav-section {
  padding: .85rem 1.25rem .3rem;
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--sidebar-section);
  pointer-events: none;
}

/* ── Stat cards ─────────────────────────────────────────────── */
.stat-card {
  transition: transform .15s, box-shadow .15s;
}
.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 .5rem 1rem rgba(0,0,0,.1) !important;
}
.stat-icon {
  width: 52px;
  height: 52px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto .75rem;
  font-size: 1.4rem;
}
.stat-value {
  font-size: 2rem;
  font-weight: 700;
  line-height: 1;
  color: #1a1d21;
}
.stat-label {
  font-size: .8rem;
  color: #6c757d;
  margin-top: .25rem;
}

/* ── Botones XS ─────────────────────────────────────────────── */
.btn-xs {
  padding: .15rem .4rem;
  font-size: .78rem;
  line-height: 1.4;
}

/* ── Código / monospace ──────────────────────────────────────── */
.font-monospace { font-family: 'Consolas', 'Monaco', monospace !important; }

pre code {
  font-family: 'Consolas', 'Monaco', monospace;
  font-size: .82rem;
}

/* ── Cards ──────────────────────────────────────────────────── */
.card { border-radius: .6rem !important; }
.card-header { border-radius: .6rem .6rem 0 0 !important; }

/* ── Tables ─────────────────────────────────────────────────── */
.table > :not(caption) > * > * { padding: .55rem .75rem; vertical-align: middle; }

/* ── Responsive sidebar ──────────────────────────────────────── */
@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); transition: transform .25s; }
  .sidebar.open { transform: translateX(0); }
  .main-content { margin-left: 0; }
}
