:root {
  --primary: #0f2237;
  --secondary: #f8b500;
  --accent: #5a95e5;
  --light: #f5f7fb;
  --muted: #6c757d;
  --card-radius: 20px;
  --shadow: 0 10px 30px rgba(15, 34, 55, 0.08);
}
body {
  font-family: var(--font-body, 'Lato', sans-serif);
  background: var(--light);
  color: #18212f;
}
h1,h2,h3,h4,h5,h6,.brand-title {
  font-family: var(--font-heading, 'Montserrat', sans-serif);
}
a { text-decoration: none; }
.sidebar {
  width: 280px;
  min-height: 100vh;
  background: linear-gradient(180deg, var(--primary), #0b1a2a);
  color: #fff;
  position: fixed;
  left: 0; top: 0;
  z-index: 1040;
  box-shadow: var(--shadow);
}
.sidebar .nav-link {
  color: rgba(255,255,255,.82);
  border-radius: 14px;
  padding: .85rem 1rem;
  margin-bottom: .35rem;
}
.sidebar .nav-link.active,
.sidebar .nav-link:hover {
  background: rgba(248,181,0,.15);
  color: #fff;
}
.app-shell { margin-left: 280px; }
.topbar {
  background: rgba(255,255,255,.9);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(0,0,0,.05);
}
.card-soft {
  border: 0;
  border-radius: var(--card-radius);
  box-shadow: var(--shadow);
}
.stat-card {
  background: linear-gradient(135deg, #fff, #f8fbff);
}
.btn-primary {
  background: var(--primary);
  border-color: var(--primary);
}
.btn-warning {
  background: var(--secondary);
  border-color: var(--secondary);
  color: #172031;
}
.btn-outline-primary { color: var(--primary); border-color: var(--primary); }
.badge-soft {
  background: rgba(90,149,229,.12);
  color: var(--accent);
}
.alert-strip {
  border-left: 6px solid var(--secondary);
  border-radius: 16px;
}
.table-modern {
  --bs-table-bg: transparent;
  --bs-table-striped-bg: rgba(15,34,55,.02);
}
.table-modern thead th {
  color: var(--muted);
  font-size: .85rem;
  text-transform: uppercase;
  letter-spacing: .05em;
}
.hero-card {
  background: linear-gradient(135deg, rgba(15,34,55,.98), rgba(90,149,229,.92));
  color: white;
  overflow: hidden;
}
.hero-card::after {
  content: '';
  position: absolute;
  width: 260px;
  height: 260px;
  border-radius: 50%;
  background: rgba(248,181,0,.18);
  right: -40px;
  top: -40px;
}
.landing {
  min-height: 100vh;
  background: radial-gradient(circle at top right, rgba(90,149,229,.18), transparent 30%), #f6f8fc;
}
.landing-hero {
  background: linear-gradient(135deg, var(--primary), #17375b);
  color: white;
  border-radius: 32px;
  box-shadow: var(--shadow);
}
.auth-card {
  border: 0;
  border-radius: 24px;
  overflow: hidden;
  box-shadow: 0 25px 60px rgba(15,34,55,.15);
}
.input-modern, .form-select, .form-control {
  border-radius: 14px;
  min-height: 48px;
}
.module-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.logo-box {
  width: 48px; height: 48px; border-radius: 14px;
  background: linear-gradient(135deg, var(--secondary), #ffca45);
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--primary); font-weight: 700;
}
.card-kpi-icon {
  width: 52px; height: 52px; border-radius: 16px;
  background: rgba(248,181,0,.15);
  color: var(--secondary);
  display: inline-flex; align-items: center; justify-content: center;
}
.ck-editor__editable_inline { min-height: 220px; }
@media (max-width: 991.98px) {
  .sidebar { transform: translateX(-100%); transition: .3s ease; }
  .sidebar.open { transform: translateX(0); }
  .app-shell { margin-left: 0; }
}

/* ── V4 Fixes ── */
/* Sidebar desktop: scrollable */
.sidebar {
  overflow-y: auto;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
}
.sidebar::-webkit-scrollbar { width: 4px; }
.sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,.2); border-radius: 2px; }

/* Sidebar mobile: overlay backdrop */
.sidebar-backdrop {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,.5);
  z-index: 1039;
}
.sidebar-backdrop.show { display: block; }

/* Eventos calendar */
.cal-grid { display: grid; grid-template-columns: repeat(7,1fr); }
.cal-day { min-height: 90px; border: 1px solid rgba(0,0,0,.07); padding: .4rem; font-size: .8rem; }
.cal-day.other-month { background: rgba(0,0,0,.02); color: #aaa; }
.cal-day.today { background: rgba(248,181,0,.1); }
.cal-event { background: var(--primary); color: #fff; border-radius: 6px; padding: 2px 6px; margin-bottom: 2px; cursor: pointer; font-size: .72rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal-event:hover { background: var(--accent); }

/* Noticias blog */
.blog-card .card-img-top { height: 200px; object-fit: cover; }
.blog-excerpt { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }

/* Directorio compact */
.dir-card .card-body { padding: 1rem 1.25rem; }
