/* ==========================================================================
   ChurSys Theme — capa base (tokens + componentes)
   Se carga DESPUÉS de AdminLTE para "vestir" el dashboard con la esencia
   del diseño de login: tipografía Geist/Geist Mono, paleta monocroma,
   tarjetas y controles suaves tipo pastilla.
   No reescribe AdminLTE: solo sobreescribe lo visual.
   ========================================================================== */

:root {
  /* color */
  --ground: #8c8c8c;
  --paper: #ffffff;
  --ink: #0a0a0a;
  --mute: #9a9a9a;
  --line: #e3e3e3;
  --soft: #f6f6f6;
  --err: #b3261e;

  /* tipografía */
  --font-sans: "Geist", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: "Geist Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;

  /* forma */
  --radius-card: 16px;
  --radius-field: 16px;
  --radius-pill: 999px;
  --shadow-soft: 0 8px 24px rgba(0, 0, 0, 0.05);
  --shadow-lift: 0 18px 50px rgba(0, 0, 0, 0.10);
}

/* ---------- Base ---------- */
body {
  font-family: var(--font-sans);
  color: var(--ink);
  background-color: var(--soft);
  -webkit-font-smoothing: antialiased;
}
.content-wrapper,
.wrapper {
  background-color: var(--soft);
}

h1, h2, h3, h4, h5, h6,
.h1, .h2, .h3, .h4, .h5, .h6 {
  font-family: var(--font-sans);
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--ink);
}

a { color: var(--ink); }
a:hover { color: #000; }

small, .small, .text-muted { color: var(--mute) !important; }

.font-mono, code, pre, kbd, samp {
  font-family: var(--font-mono);
}

/* ---------- Encabezado de contenido ---------- */
.content-header h5,
.content-header .m-0 {
  font-family: var(--font-sans);
  font-weight: 600;
  letter-spacing: -0.01em;
}

/* ---------- Tarjetas ---------- */
.card {
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  background-color: var(--paper);
  box-shadow: var(--shadow-soft);
}
.card-header {
  background-color: transparent;
  border-bottom: 1px solid var(--line);
  padding: 14px 18px;
}
.card-title {
  font-weight: 600;
  font-size: 15px;
  letter-spacing: -0.01em;
}
.card-body { padding: 18px; }
.card-footer {
  background-color: transparent;
  border-top: 1px solid var(--line);
}
/* Las tarjetas "outline" de AdminLTE llevan borde superior de color: lo dejamos en tinta */
.card-outline { border-top-color: var(--ink) !important; }

/* ---------- Métricas (small-box) en monocromo ---------- */
.small-box {
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  background-color: var(--paper);
  color: var(--ink);
  box-shadow: var(--shadow-soft);
  overflow: hidden;
}
.small-box.bg-info, .small-box.bg-success, .small-box.bg-warning, .small-box.bg-danger,
.small-box.bg-primary, .small-box.bg-secondary, .small-box.bg-dark {
  background-color: var(--paper) !important;
  color: var(--ink) !important;
}
.small-box .inner h3 {
  font-family: var(--font-mono);
  font-weight: 600;
  letter-spacing: -0.03em;
  color: var(--ink);
}
.small-box .inner p {
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--mute);
}
.small-box .icon > i {
  color: var(--ink);
  opacity: 0.12;
}
.small-box > .small-box-footer {
  background-color: transparent;
  border-top: 1px solid var(--line);
  color: var(--ink);
}
.small-box > .small-box-footer:hover {
  background-color: var(--soft);
  color: var(--ink);
}

/* ---------- Botones (pastilla) ---------- */
.btn {
  border-radius: var(--radius-pill);
  font-family: var(--font-sans);
  font-weight: 500;
  padding: 0.45rem 1.15rem;
  transition: background-color .15s, border-color .15s, color .15s, transform .1s;
}
.btn:active { transform: scale(0.985); }
.btn-sm { padding: 0.25rem 0.85rem; border-radius: var(--radius-pill); }
.btn-lg { padding: 0.65rem 1.5rem; border-radius: var(--radius-pill); }

.btn-primary,
.btn-dark {
  background-color: var(--ink);
  border-color: var(--ink);
  color: #fff;
}
.btn-primary:hover, .btn-dark:hover,
.btn-primary:focus, .btn-dark:focus,
.btn-primary:not(:disabled):not(.disabled):active {
  background-color: #262626;
  border-color: #262626;
  color: #fff;
}
.btn-default,
.btn-outline-primary,
.btn-outline-secondary {
  background-color: var(--paper);
  border: 1px solid var(--line);
  color: var(--ink);
}
.btn-default:hover,
.btn-outline-primary:hover,
.btn-outline-secondary:hover {
  background-color: var(--soft);
  border-color: #d2d2d2;
  color: var(--ink);
}
.btn-primary:focus, .btn-dark:focus, .btn-default:focus,
.btn-outline-primary:focus, .btn-outline-secondary:focus {
  box-shadow: 0 0 0 0.2rem rgba(10, 10, 10, 0.15);
}

/* ---------- Formularios ---------- */
.form-control,
.custom-select {
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  height: 38px;
  font-family: var(--font-sans);
  color: var(--ink);
  transition: border-color .15s, box-shadow .15s;
}
.form-control::placeholder { color: #b0b0b0; }
.form-control:focus,
.custom-select:focus {
  border-color: var(--ink);
  box-shadow: none;
  color: var(--ink);
}
textarea.form-control {
  border-radius: var(--radius-field);
  height: auto;
  min-height: 110px;
  padding: 0.6rem 1rem;
}
.input-group-text {
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  background-color: var(--paper);
  color: var(--mute);
}
.input-group > .form-control:not(:last-child),
.input-group > .custom-select:not(:last-child) {
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
}
.input-group > .input-group-append:last-child > .input-group-text {
  border-top-left-radius: 0;
  border-bottom-left-radius: 0;
}

label, .col-form-label, .form-group > label {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: var(--ink);
}
.form-text, .help-block { color: var(--mute); }
.custom-control-label::before { border-color: var(--line); }

/* ---------- Tablas ---------- */
.table { color: var(--ink); }
.table thead th {
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--mute);
  border-top: 0;
  border-bottom: 1px solid var(--line);
}
.table td, .table th {
  border-top: 1px solid var(--line);
  vertical-align: middle;
}
.table-striped tbody tr:nth-of-type(odd) { background-color: var(--soft); }
.table-hover tbody tr:hover { background-color: #efefef; }

/* ---------- Insignias ---------- */
.badge {
  border-radius: var(--radius-pill);
  font-family: var(--font-mono);
  font-weight: 500;
  letter-spacing: 0.02em;
  padding: 0.35em 0.7em;
}

/* ---------- Callouts / Alerts ---------- */
.callout {
  border: 1px solid var(--line);
  border-left-width: 3px;
  border-radius: 12px;
}
.alert {
  border: 1px solid var(--line);
  border-radius: 14px;
}

/* ---------- Modales ---------- */
.modal-content {
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-lift);
}
.modal-header { border-bottom: 1px solid var(--line); }
.modal-footer { border-top: 1px solid var(--line); }

/* ---------- Dropdowns ---------- */
.dropdown-menu {
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow-soft);
}
.dropdown-item.active, .dropdown-item:active {
  background-color: var(--ink);
  color: #fff;
}

@media (prefers-reduced-motion: reduce) {
  .btn { transition: none; }
}

/* ==========================================================================
   Shell: marco oscuro (navbar + sidebar) y contenido claro con textura
   ========================================================================== */

/* ---------- Navbar oscuro ---------- */
.main-header.navbar {
  background-color: #121212 !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
  box-shadow: none !important;
}
.main-header .navbar-nav .nav-link { color: rgba(255, 255, 255, 0.75) !important; }
.main-header .navbar-nav .nav-link:hover { color: #fff !important; }
.main-header .navbar-nav .nav-link .user-image { box-shadow: none; }

/* Créditos: pastilla neutra (en vez del amarillo) */
#credits-nav-item .badge {
  background-color: transparent !important;
  color: #fff !important;
  border: 1px solid rgba(255, 255, 255, 0.25) !important;
  box-shadow: none !important;
}

/* ---------- Sidebar oscuro ---------- */
.main-sidebar {
  background-color: #121212 !important;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: none !important;
}
.main-sidebar .brand-link {
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  color: #fff;
}
.main-sidebar .brand-link .brand-text {
  font-family: var(--font-sans);
  font-weight: 600;
  letter-spacing: -0.01em;
  color: #fff;
}
.main-sidebar .sidebar { background-color: transparent; }

/* Barra de suscripción neutra (el JS pinta el color inline; lo forzamos) */
#subscription-container { background-color: rgba(255, 255, 255, 0.06) !important; }
#subscription-timer { color: rgba(255, 255, 255, 0.72) !important; }

.nav-sidebar .nav-link {
  color: rgba(255, 255, 255, 0.72);
  border-radius: 10px;
  transition: background-color .15s, color .15s;
}
.nav-sidebar .nav-link:hover { background-color: rgba(255, 255, 255, 0.06); color: #fff; }
.nav-sidebar .nav-link > p { font-family: var(--font-sans); }
.nav-sidebar .nav-link .right,
.nav-sidebar .nav-link .nav-icon { color: rgba(255, 255, 255, 0.45); }

/* Ítem activo: sutil, no pesado */
.nav-sidebar .nav-link.active {
  background-color: rgba(255, 255, 255, 0.12) !important;
  color: #fff !important;
  box-shadow: none !important;
}
.nav-sidebar .nav-link.active .right,
.nav-sidebar .nav-link.active .nav-icon { color: #fff !important; }

/* Submenús */
.nav-sidebar .nav-treeview .nav-link { color: rgba(255, 255, 255, 0.55); }
.nav-sidebar .nav-treeview .nav-link:hover { background-color: rgba(255, 255, 255, 0.06); color: #fff; }
.nav-sidebar .nav-treeview .nav-link.active {
  background-color: rgba(255, 255, 255, 0.12) !important;
  color: #fff !important;
}
.nav-sidebar .nav-treeview > .nav-item > .nav-link { border-radius: 10px; }

/* Encabezados de sección del menú */
.nav-sidebar .nav-header {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  color: rgba(255, 255, 255, 0.32);
}

/* ---------- Contenido claro con textura sutil (eco del halftone) ---------- */
.content-wrapper {
  background-color: #f2f2f2;
  background-image: radial-gradient(rgba(10, 10, 10, 0.05) 1px, transparent 1px);
  background-size: 16px 16px;
}

/* Más profundidad en tarjetas */
.card { box-shadow: 0 10px 30px rgba(0, 0, 0, 0.07); }

/* Menú de usuario (dropdown) oscuro */
.user-menu .user-header { background-color: #121212 !important; }
.user-menu .user-header small { color: rgba(255, 255, 255, 0.7); }

/* ==========================================================================
   Halftone (firma visual) + hero de página
   ========================================================================== */
.chursys-halftone {
  position: absolute;
  inset: 0;
  overflow: hidden;
  color: rgba(255, 255, 255, 0.5);
}
.chursys-halftone canvas { width: 100%; height: 100%; display: block; touch-action: pan-y; }
.chursys-halftone.on-light { color: rgba(10, 10, 10, 0.75); }

.hero {
  position: relative;
  border: 0;
  border-radius: var(--radius-card);
  background-color: #121212;
  color: #fff;
  overflow: hidden;
  min-height: 150px;
  box-shadow: var(--shadow-lift);
}
.hero .chursys-halftone { color: rgba(255, 255, 255, 0.7); }
.hero .hero-body { position: relative; z-index: 1; padding: 24px; }
.hero .hero-body h3 {
  margin: 0;
  color: #fff;
  font-family: var(--font-sans);
  font-weight: 600;
  letter-spacing: -0.02em;
}
.hero .hero-sub {
  margin: 6px 0 0;
  color: rgba(255, 255, 255, 0.6);
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* ==========================================================================
   Botones de acciones en tablas de listados (look unificado)
   Referencia: /intenciones/registro/intencionmisa/listar/
   ========================================================================== */
.btn-xs {
  padding: 3px 8px;
  font-size: 11px;
  line-height: 1.4;
  border-radius: 5px;
}

/* Acciones de fila dentro de cualquier tabla: compactas con leve redondeo
   (en vez de la pastilla global) para que se vean igual en todos los módulos. */
.table .btn,
table.dataTable td .btn {
  padding: 3px 8px;
  font-size: 11px;
  line-height: 1.4;
  border-radius: 5px;
}
.table .btn-group { box-shadow: none; }
.table .btn-group > .btn { border-radius: 0; }
.table .btn-group > .btn:first-child { border-top-left-radius: 5px; border-bottom-left-radius: 5px; }
.table .btn-group > .btn:last-child { border-top-right-radius: 5px; border-bottom-right-radius: 5px; }
.table .btn-group > .btn:only-child { border-radius: 5px; }
