/* ============================================================
   GestionEPP · Sistema visual
   Identidad sobria, corporativa y consistente para toda la app.
   ============================================================ */

:root {
  --gp-primary: #17505e;
  --gp-primary-hover: #103f4b;
  --gp-primary-soft: #e7f0f2;
  --gp-accent: #b7791f;
  --gp-accent-soft: #fbf3e5;

  --gp-bg: #f3f5f6;
  --gp-surface: #ffffff;
  --gp-surface-alt: #f8fafb;
  --gp-sidebar: #102c34;
  --gp-sidebar-alt: #0b2229;
  --gp-sidebar-text: #b9cbd0;
  --gp-sidebar-active: #ffffff;

  --gp-text: #172b33;
  --gp-text-soft: #4e626b;
  --gp-muted: #718189;
  --gp-border: #dfe6e9;
  --gp-border-strong: #cbd6da;
  --gp-table-grid: #e7ecee;
  --gp-table-head-bg: #f6f8f9;

  --gp-success: #2f7d5c;
  --gp-success-soft: #e8f4ee;
  --gp-warning: #a86b14;
  --gp-warning-soft: #fdf4e3;
  --gp-danger: #ad3b3b;
  --gp-danger-soft: #fbecec;
  --gp-info: #2b6c8f;
  --gp-info-soft: #eaf3f8;

  --gp-radius-sm: 8px;
  --gp-radius: 12px;
  --gp-radius-lg: 16px;
  --gp-shadow-sm: 0 1px 2px rgba(16, 44, 52, .05);
  --gp-shadow: 0 8px 24px rgba(16, 44, 52, .07);
  --gp-shadow-lg: 0 20px 45px rgba(16, 44, 52, .14);

  --gp-sidebar-w: 264px;
  --gp-sidebar-w-collapsed: 82px;
  --gp-topbar-h: 66px;

  --gp-font: "Inter", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body.gp-body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(1200px 500px at 100% -10%, rgba(23, 80, 94, .06), transparent 60%),
    var(--gp-bg);
  color: var(--gp-text);
  font-family: var(--gp-font);
  font-size: .925rem;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6 {
  color: var(--gp-text);
  font-family: var(--gp-font);
  font-weight: 650;
  letter-spacing: -.015em;
}

a { color: var(--gp-primary); }
a:hover { color: var(--gp-primary-hover); }

code {
  color: #2b5560;
  background: #edf3f4;
  padding: .1rem .35rem;
  border-radius: 5px;
}

/* ---------- Estructura ---------- */

.gp-sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 1040;
  display: flex;
  flex-direction: column;
  width: var(--gp-sidebar-w);
  overflow-y: auto;
  overflow-x: hidden;
  background: linear-gradient(180deg, var(--gp-sidebar) 0%, var(--gp-sidebar-alt) 100%);
  color: var(--gp-sidebar-text);
  transition: width .2s ease, transform .2s ease;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,.18) transparent;
}

.gp-brand {
  display: flex;
  align-items: center;
  gap: .7rem;
  min-height: var(--gp-topbar-h);
  padding: 0 1.15rem;
  border-bottom: 1px solid rgba(255, 255, 255, .08);
  text-decoration: none;
  white-space: normal;
  min-width: 0;
}

.gp-brand-logo {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: #ffffff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .18);
  overflow: hidden;
}

.gp-brand-logo img { max-width: 100%; max-height: 100%; object-fit: contain; }

.gp-brand-text { display: flex; flex-direction: column; line-height: 1.12; min-width: 0; }
.gp-brand-text strong {
  color: #ffffff;
  font-size: 1.0rem;
  font-weight: 700;
  letter-spacing: -.01em;
}
.gp-brand-text small {
  color: #89a4ab;
  font-size: .62rem;
  text-transform: uppercase;
  letter-spacing: .08em;
  white-space: normal;
  word-break: break-word;
  overflow-wrap: anywhere;
  hyphens: auto;
}

.gp-sidebar-nav { flex: 1 1 auto; padding: .9rem .7rem 1rem; }

.gp-nav-label {
  margin: 1.15rem .55rem .4rem;
  color: #78969e;
  font-size: .65rem;
  font-weight: 700;
  letter-spacing: .13em;
  text-transform: uppercase;
  white-space: nowrap;
}
.gp-nav-label:first-child { margin-top: .15rem; }

.gp-sidebar .nav { gap: .12rem; }

.gp-sidebar .nav-link {
  position: relative;
  display: flex;
  align-items: center;
  gap: .75rem;
  min-height: 40px;
  padding: .55rem .7rem;
  border-radius: 8px;
  color: var(--gp-sidebar-text);
  font-size: .885rem;
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
  transition: background-color .15s ease, color .15s ease;
}

.gp-sidebar .nav-link i {
  flex: 0 0 20px;
  font-size: 1.02rem;
  color: #8fb0b8;
  text-align: center;
  transition: color .15s ease;
}

.gp-sidebar .nav-link:hover,
.gp-sidebar .nav-link:focus-visible {
  background: rgba(255, 255, 255, .07);
  color: #ffffff;
  outline: none;
}
.gp-sidebar .nav-link:hover i,
.gp-sidebar .nav-link:focus-visible i { color: #ffffff; }

.gp-sidebar .nav-link.active {
  background: rgba(255, 255, 255, .12);
  color: var(--gp-sidebar-active);
  font-weight: 600;
}
.gp-sidebar .nav-link.active::before {
  content: "";
  position: absolute;
  left: 0;
  top: 9px;
  bottom: 9px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: #6fb3c2;
}
.gp-sidebar .nav-link.active i { color: #8fd0dd; }

.gp-sidebar-foot {
  padding: .85rem .8rem 1rem;
  border-top: 1px solid rgba(255, 255, 255, .08);
  white-space: nowrap;
}

.gp-userbox {
  display: flex;
  align-items: center;
  gap: .65rem;
  padding: .55rem .6rem;
  border-radius: 10px;
  background: rgba(255, 255, 255, .05);
}
.gp-avatar {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: #2d5f6b;
  color: #ffffff;
  font-size: .8rem;
  font-weight: 700;
}
.gp-userbox-meta { display: flex; flex-direction: column; line-height: 1.2; overflow: hidden; }
.gp-userbox-meta strong { color: #eaf2f4; font-size: .82rem; font-weight: 600; }
.gp-userbox-meta small { color: #85a0a7; font-size: .7rem; text-transform: capitalize; }
.gp-userbox .gp-logout {
  margin-left: auto;
  color: #9bb4ba;
  font-size: 1rem;
  text-decoration: none;
}
.gp-userbox .gp-logout:hover { color: #ffffff; }

.gp-topbar {
  position: fixed;
  top: 0;
  right: 0;
  left: var(--gp-sidebar-w);
  z-index: 1030;
  display: flex;
  align-items: center;
  gap: 1rem;
  height: var(--gp-topbar-h);
  padding: 0 1.5rem;
  background: rgba(255, 255, 255, .94);
  border-bottom: 1px solid var(--gp-border);
  backdrop-filter: blur(8px);
  transition: left .2s ease;
}

.gp-icon-btn {
  display: inline-grid;
  place-items: center;
  width: 38px;
  height: 38px;
  padding: 0;
  border: 1px solid var(--gp-border);
  border-radius: 9px;
  background: var(--gp-surface);
  color: var(--gp-text-soft);
  font-size: 1.12rem;
  transition: background-color .15s ease, border-color .15s ease, color .15s ease;
}
.gp-icon-btn:hover { background: var(--gp-surface-alt); border-color: var(--gp-border-strong); color: var(--gp-text); }

.gp-breadcrumb {
  display: flex;
  align-items: center;
  gap: .45rem;
  min-width: 0;
  margin: 0;
  color: var(--gp-muted);
  font-size: .82rem;
  white-space: nowrap;
}
.gp-breadcrumb a {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  color: var(--gp-text-soft);
  text-decoration: none;
}
.gp-breadcrumb a:hover { color: var(--gp-primary); }
.gp-breadcrumb .sep { color: #b3c0c5; }
.gp-breadcrumb .current {
  overflow: hidden;
  color: var(--gp-text);
  font-weight: 600;
  text-overflow: ellipsis;
}

.gp-topbar-actions { display: flex; align-items: center; gap: .6rem; margin-left: auto; }

.gp-role-chip {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .35rem .7rem;
  border: 1px solid var(--gp-border);
  border-radius: 999px;
  background: var(--gp-surface-alt);
  color: var(--gp-text-soft);
  font-size: .75rem;
  font-weight: 600;
  text-transform: capitalize;
}
.gp-role-chip::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--gp-success);
}

.gp-main {
  min-height: 100vh;
  margin-left: var(--gp-sidebar-w);
  padding: calc(var(--gp-topbar-h) + 1.7rem) 1.75rem 2.5rem;
  transition: margin-left .2s ease;
}
.gp-container { width: 100%; max-width: 1480px; margin: 0 auto; }

.gp-sidebar-overlay {
  position: fixed;
  inset: 0;
  z-index: 1035;
  display: none;
  background: rgba(9, 28, 34, .55);
  backdrop-filter: blur(2px);
}

/* Estado colapsado (escritorio) */
body.gp-sidebar-collapsed .gp-sidebar { width: var(--gp-sidebar-w-collapsed); }
body.gp-sidebar-collapsed .gp-topbar { left: var(--gp-sidebar-w-collapsed); }
body.gp-sidebar-collapsed .gp-main { margin-left: var(--gp-sidebar-w-collapsed); }
body.gp-sidebar-collapsed .gp-brand { justify-content: center; padding: 0; }
body.gp-sidebar-collapsed .gp-brand-text,
body.gp-sidebar-collapsed .gp-nav-label,
body.gp-sidebar-collapsed .gp-sidebar .nav-link span,
body.gp-sidebar-collapsed .gp-userbox-meta,
body.gp-sidebar-collapsed .gp-userbox .gp-logout { display: none; }
body.gp-sidebar-collapsed .gp-sidebar .nav-link { justify-content: center; padding: .55rem 0; }
body.gp-sidebar-collapsed .gp-sidebar .nav-link.active::before { top: 6px; bottom: 6px; }
body.gp-sidebar-collapsed .gp-sidebar-nav { padding: .9rem .55rem; }
body.gp-sidebar-collapsed .gp-sidebar-foot { padding: .85rem .55rem 1rem; }
body.gp-sidebar-collapsed .gp-userbox { justify-content: center; padding: .4rem; }

/* ---------- Encabezado de página ---------- */

.gp-page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1.25rem;
  flex-wrap: wrap;
  margin-bottom: 1.35rem;
}
.gp-page-head h1 {
  margin: 0;
  font-size: 1.55rem;
  font-weight: 700;
  letter-spacing: -.025em;
}
.gp-page-subtitle {
  max-width: 760px;
  margin: .35rem 0 0;
  color: var(--gp-muted);
  font-size: .875rem;
}
.gp-page-actions { display: flex; align-items: center; gap: .55rem; flex-wrap: wrap; }

.gp-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  margin-bottom: .45rem;
  color: var(--gp-primary);
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
}

/* ---------- Tarjetas y secciones ---------- */

.card {
  --bs-card-border-color: var(--gp-border);
  --bs-card-border-radius: var(--gp-radius);
  --bs-card-inner-border-radius: calc(var(--gp-radius) - 1px);
  box-shadow: var(--gp-shadow-sm);
  background: var(--gp-surface);
}
.card-header {
  padding: .9rem 1.15rem;
  background: var(--gp-surface);
  border-bottom: 1px solid var(--gp-border);
  color: var(--gp-text);
  font-weight: 600;
}
.card-body { padding: 1.15rem; }
.card-footer { background: var(--gp-surface-alt); border-top: 1px solid var(--gp-border); }

.gp-section { margin-bottom: 1.5rem; }
.gp-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: .8rem;
}
.gp-section-head h2,
.gp-section-head h3,
.gp-section-head h4,
.gp-section-head h5 { margin: 0; font-size: 1.02rem; font-weight: 650; }
.gp-section-head p { margin: .2rem 0 0; color: var(--gp-muted); font-size: .82rem; }

.gp-panel {
  padding: 1.15rem;
  border: 1px solid var(--gp-border);
  border-radius: var(--gp-radius);
  background: var(--gp-surface);
  box-shadow: var(--gp-shadow-sm);
}
.gp-panel-title { margin: 0 0 .25rem; font-size: .98rem; font-weight: 650; }
.gp-panel-sub { margin: 0 0 1rem; color: var(--gp-muted); font-size: .8rem; }

.gp-table-card { overflow-x: auto; overflow-y: visible; border: 1px solid var(--gp-border); border-radius: var(--gp-radius); background: var(--gp-surface); box-shadow: var(--gp-shadow-sm); }
.gp-table-card .table { margin-bottom: 0; }
.gp-table-card .table-responsive { width: 100%; max-width: 100%; }
.gp-table-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .8rem 1rem;
  flex-wrap: wrap;
  padding: .85rem 1.05rem;
  border-bottom: 1px solid var(--gp-border);
  background: var(--gp-surface-alt);
}
.gp-table-toolbar .gp-toolbar-title { margin: 0; font-size: .86rem; font-weight: 600; color: var(--gp-text-soft); }

/* ---------- Indicadores / KPI ---------- */

.gp-kpi {
  display: flex;
  align-items: flex-start;
  gap: .95rem;
  height: 100%;
  padding: 1.05rem 1.1rem;
  border: 1px solid var(--gp-border);
  border-radius: var(--gp-radius);
  background: var(--gp-surface);
  box-shadow: var(--gp-shadow-sm);
  transition: transform .15s ease, box-shadow .15s ease;
}
.gp-kpi:hover { transform: translateY(-1px); box-shadow: var(--gp-shadow); }
.gp-kpi-icon {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 42px;
  height: 42px;
  border-radius: 10px;
  background: var(--gp-primary-soft);
  color: var(--gp-primary);
  font-size: 1.18rem;
}
.gp-kpi-label { color: var(--gp-muted); font-size: .76rem; font-weight: 600; letter-spacing: .02em; }
.gp-kpi-value { margin: .15rem 0 0; font-size: 1.65rem; font-weight: 700; line-height: 1.15; letter-spacing: -.03em; }
.gp-kpi-note { margin-top: .15rem; color: var(--gp-muted); font-size: .74rem; }

.gp-kpi-danger .gp-kpi-icon { background: var(--gp-danger-soft); color: var(--gp-danger); }
.gp-kpi-warning .gp-kpi-icon { background: var(--gp-warning-soft); color: var(--gp-warning); }
.gp-kpi-success .gp-kpi-icon { background: var(--gp-success-soft); color: var(--gp-success); }
.gp-kpi-info .gp-kpi-icon { background: var(--gp-info-soft); color: var(--gp-info); }
.gp-kpi-accent { border-top: 3px solid var(--gp-primary); }
.gp-kpi-accent.gp-kpi-danger { border-top-color: var(--gp-danger); }
.gp-kpi-accent.gp-kpi-warning { border-top-color: var(--gp-warning); }
.gp-kpi-accent.gp-kpi-success { border-top-color: var(--gp-success); }
.gp-kpi-accent.gp-kpi-info { border-top-color: var(--gp-info); }

/* ---------- Tablas ---------- */

.table {
  --bs-table-bg: transparent;
  --bs-table-color: var(--gp-text);
  --bs-table-border-color: var(--gp-table-grid);
  --bs-table-striped-bg: var(--gp-surface-alt);
  --bs-table-hover-bg: #f1f6f7;
  border-collapse: collapse;
  margin-bottom: 0;
  color: var(--gp-text);
  font-size: .84rem;
  line-height: 1.35;
  vertical-align: middle;
  min-width: 640px;
}
.table > :not(caption) > * > * {
  padding: .42rem .6rem;
  border: 1px solid var(--gp-table-grid);
  vertical-align: middle;
}
.table > :not(caption) > * > :first-child { border-left: 0; }
.table > :not(caption) > * > :last-child { border-right: 0; }
.table > thead > tr > * { border-top: 0; }
.table > thead th {
  background: var(--gp-table-head-bg);
  color: var(--gp-text-soft);
  font-size: .67rem;
  font-weight: 700;
  letter-spacing: .045em;
  text-transform: uppercase;
  white-space: nowrap;
  vertical-align: middle;
}
.table > tbody > tr:last-child > td { border-bottom: 0; }
.table .badge,
.table .gp-badge,
.table .btn { vertical-align: middle; }
.table-striped > tbody > tr:nth-of-type(odd) > * { --bs-table-bg-type: var(--gp-surface-alt); }
.table-hover > tbody > tr:hover > * { --bs-table-bg-state: #eff5f6; }
.table-sm > :not(caption) > * > * { padding: .34rem .48rem; }
.table-responsive { border-radius: inherit; overflow-x: auto; -webkit-overflow-scrolling: touch; }

/* Tablas largas o anchas: el contenedor se limita al alto de la ventana y
   habilita scroll vertical y horizontal. El encabezado queda fijo arriba
   para no perder la referencia de las columnas al desplazarse. */
.gp-table-card .table-responsive {
  max-height: clamp(320px, calc(100vh - var(--gp-topbar-h) - 230px), 720px);
  overflow: auto;
  -webkit-overflow-scrolling: touch;
}
.gp-table-card .table-responsive > .table > thead > tr > th {
  position: sticky;
  top: 0;
  z-index: 2;
  box-shadow: inset 0 -1px 0 var(--gp-table-grid);
}

/* Columna de acciones fija a la derecha: el botón Editar sigue visible
   mientras se recorre horizontalmente una tabla ancha. */
@media (min-width: 992px) {
  .gp-table-pinned-actions > :not(caption) > * > :last-child {
    position: sticky;
    right: 0;
    z-index: 1;
    background: var(--gp-surface);
    box-shadow: inset 1px 0 0 var(--gp-table-grid);
  }
  .gp-table-pinned-actions > thead > tr > :last-child {
    z-index: 3;
    background: var(--gp-table-head-bg);
  }
  .gp-table-pinned-actions > tbody > tr:hover > :last-child { background: #eff5f6; }
}

.table .gp-cell-strong { font-weight: 600; color: var(--gp-text); }
.table .gp-cell-muted { color: var(--gp-muted); font-size: .77rem; }

/* Tablas densas: columnas proporcionadas y encabezados legibles. En pantallas
   angostas la tabla conserva un ancho mínimo y se desplaza en horizontal. */
.table.gp-table-dense { table-layout: fixed; width: 100%; min-width: 860px; font-size: .81rem; }
.gp-table-dense > :not(caption) > * > * { padding: .34rem .42rem; }
.gp-table-dense > thead th {
  padding: .34rem .42rem;
  white-space: normal;
  font-size: .62rem;
  letter-spacing: .015em;
  line-height: 1.25;
  vertical-align: middle;
  overflow-wrap: normal;
  word-break: normal;
  hyphens: none;
  text-wrap: balance;
}
.gp-table-dense > tbody > tr > td { overflow-wrap: break-word; }
.gp-table-dense .gp-nowrap { white-space: nowrap; overflow-wrap: normal; }
.gp-table-dense .badge { white-space: nowrap; }
.gp-table-dense .gp-badge { white-space: nowrap; }
.gp-clamp-2 {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
}

/* ---------- Mostrar/Ocultar contraseña ---------- */

.gp-pass-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .35rem;
  border-color: rgba(43, 108, 143, .45);
  color: #1f7aa8;
  background: linear-gradient(180deg, #f7fbff 0%, #f1f8ff 100%);
  transition: all .15s ease-in-out;
}
.gp-pass-toggle:hover,
.gp-pass-toggle:focus {
  border-color: rgba(31, 122, 168, .8);
  color: #146a9c;
  background: linear-gradient(180deg, #eaf5ff 0%, #e3f1ff 100%);
  box-shadow: 0 0 0 2px rgba(43, 108, 143, .12);
}
.gp-pass-toggle.is-active {
  border-color: rgba(31, 122, 168, .9);
  color: #0f5f8a;
  background: linear-gradient(180deg, #e3f1ff 0%, #d9ecff 100%);
}
.gp-pass-toggle i {
  font-size: 1rem;
  line-height: 1;
}

/* ---------- Formularios ---------- */

.form-label {
  margin-bottom: .32rem;
  color: var(--gp-text-soft);
  font-size: .78rem;
  font-weight: 600;
}
.form-control,
.form-select {
  min-height: 40px;
  border-color: var(--gp-border-strong);
  border-radius: var(--gp-radius-sm);
  background-color: #ffffff;
  color: var(--gp-text);
  font-size: .875rem;
  box-shadow: none;
}
.form-control::placeholder { color: #9aa9ae; }
.form-control:focus,
.form-select:focus {
  border-color: var(--gp-primary);
  box-shadow: 0 0 0 3px rgba(23, 80, 94, .13);
}
.form-control-sm, .form-select-sm { min-height: 33px; font-size: .8rem; border-radius: 7px; }
.form-text { color: var(--gp-muted); font-size: .75rem; }
.form-check-input:checked { background-color: var(--gp-primary); border-color: var(--gp-primary); }
.form-check-input:focus { border-color: var(--gp-primary); box-shadow: 0 0 0 3px rgba(23, 80, 94, .13); }

.gp-form-card { max-width: 980px; width: 100%; overflow-x: auto; }
.gp-form-card .card-body { padding: 1.5rem; overflow-x: auto; }
.gp-form-section { padding-bottom: 1.35rem; margin-bottom: 1.35rem; border-bottom: 1px solid var(--gp-border); }
.gp-form-section:last-of-type { padding-bottom: 0; margin-bottom: 0; border-bottom: 0; }
.gp-form-section-title {
  display: flex;
  align-items: center;
  gap: .5rem;
  margin: 0 0 1rem;
  color: var(--gp-text);
  font-size: .86rem;
  font-weight: 650;
}
.gp-form-section-title i { color: var(--gp-primary); }
.gp-form-actions {
  display: flex;
  align-items: center;
  gap: .6rem;
  flex-wrap: wrap;
  padding-top: 1.35rem;
  border-top: 1px solid var(--gp-border);
}
.gp-form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.gp-form-grid .gp-col-full { grid-column: 1 / -1; }
@media (max-width: 767.98px) { .gp-form-grid { grid-template-columns: 1fr; } }

/* ---------- Botones ---------- */

.btn {
  --bs-btn-border-radius: var(--gp-radius-sm);
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .4rem;
  padding: .42rem .9rem;
  font-size: .84rem;
  font-weight: 600;
  letter-spacing: -.005em;
  box-shadow: none;
  white-space: nowrap;
}
.btn-sm { min-height: 31px; padding: .28rem .6rem; font-size: .75rem; border-radius: 7px; white-space: nowrap; }
.btn-lg { min-height: 46px; font-size: .94rem; }
.btn i { font-size: .95em; }

.btn-primary {
  --bs-btn-bg: var(--gp-primary);
  --bs-btn-border-color: var(--gp-primary);
  --bs-btn-hover-bg: var(--gp-primary-hover);
  --bs-btn-hover-border-color: var(--gp-primary-hover);
  --bs-btn-active-bg: var(--gp-primary-hover);
  --bs-btn-active-border-color: var(--gp-primary-hover);
  --bs-btn-disabled-bg: #7c9aa1;
  --bs-btn-disabled-border-color: #7c9aa1;
  box-shadow: 0 1px 2px rgba(16, 44, 52, .16);
}
.btn-outline-primary {
  --bs-btn-color: var(--gp-primary);
  --bs-btn-border-color: #a9c3c9;
  --bs-btn-hover-bg: var(--gp-primary-soft);
  --bs-btn-hover-border-color: var(--gp-primary);
  --bs-btn-hover-color: var(--gp-primary-hover);
  --bs-btn-active-bg: var(--gp-primary-soft);
  --bs-btn-active-border-color: var(--gp-primary);
  --bs-btn-active-color: var(--gp-primary-hover);
}
.btn-outline-secondary {
  --bs-btn-color: var(--gp-text-soft);
  --bs-btn-border-color: var(--gp-border-strong);
  --bs-btn-hover-bg: var(--gp-surface-alt);
  --bs-btn-hover-border-color: #b7c5c9;
  --bs-btn-hover-color: var(--gp-text);
  --bs-btn-active-bg: var(--gp-surface-alt);
  --bs-btn-active-border-color: #b7c5c9;
  --bs-btn-active-color: var(--gp-text);
}
.btn-secondary {
  --bs-btn-bg: #63757c;
  --bs-btn-border-color: #63757c;
  --bs-btn-hover-bg: #53646b;
  --bs-btn-hover-border-color: #53646b;
}
.btn-danger { --bs-btn-bg: var(--gp-danger); --bs-btn-border-color: var(--gp-danger); }
.btn-success { --bs-btn-bg: var(--gp-success); --bs-btn-border-color: var(--gp-success); }

/* ---------- Badges y estados ---------- */

.badge {
  padding: .34em .62em;
  border-radius: 6px;
  font-size: .7rem;
  font-weight: 600;
  letter-spacing: .01em;
}
.gp-badge {
  display: inline-flex;
  align-items: center;
  gap: .2rem;
  border: 1px solid transparent;
  border-radius: 999px;
  padding: .18rem .45rem;
  font-size: .66rem;
  font-weight: 600;
  line-height: 1.2;
  text-transform: capitalize;
}
.gp-badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.gp-badge-success { background: var(--gp-success-soft); color: var(--gp-success); border-color: #c6e3d4; }
.gp-badge-warning { background: var(--gp-warning-soft); color: var(--gp-warning); border-color: #ecd6ac; }
.gp-badge-danger { background: var(--gp-danger-soft); color: var(--gp-danger); border-color: #efc9c9; }
.gp-badge-info { background: var(--gp-info-soft); color: var(--gp-info); border-color: #c3dce9; }
.gp-badge-neutral { background: #eef2f3; color: var(--gp-text-soft); border-color: var(--gp-border); }

/* ---------- Alertas ---------- */

.alert {
  border-radius: var(--gp-radius-sm);
  border-width: 1px;
  font-size: .86rem;
}
.alert-danger { background: var(--gp-danger-soft); border-color: #efc9c9; color: #7f2b2b; }
.alert-success { background: var(--gp-success-soft); border-color: #c6e3d4; color: #245f46; }
.alert-warning { background: var(--gp-warning-soft); border-color: #ecd6ac; color: #7c4f10; }
.alert-info { background: var(--gp-info-soft); border-color: #c3dce9; color: #1f526d; }
.alert-secondary, .alert-light { background: var(--gp-surface-alt); border-color: var(--gp-border); color: var(--gp-text-soft); }

/* ---------- Vacíos y ayudas ---------- */

.gp-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: .35rem;
  padding: 2.4rem 1rem;
  color: var(--gp-muted);
  text-align: center;
}
.gp-empty i { font-size: 1.6rem; color: #9db0b6; }
.gp-empty strong { color: var(--gp-text-soft); font-size: .9rem; }
.gp-empty span { font-size: .8rem; }

.gp-help { color: var(--gp-muted); font-size: .78rem; }
.gp-divider { height: 1px; margin: 1.4rem 0; background: var(--gp-border); }

/* ---------- Login ---------- */

.gp-login {
  display: grid;
  place-items: center;
  min-height: 100vh;
  padding: 2rem 1rem;
  background:
    radial-gradient(900px 500px at 15% 5%, rgba(111, 179, 194, .22), transparent 60%),
    radial-gradient(800px 500px at 95% 100%, rgba(183, 121, 31, .12), transparent 55%),
    linear-gradient(135deg, #0d2830 0%, #123b45 55%, #17505e 100%);
}
.gp-login-card {
  width: 100%;
  max-width: 430px;
  padding: 2.1rem 2rem 1.8rem;
  border: 1px solid rgba(255, 255, 255, .18);
  border-radius: var(--gp-radius-lg);
  background: #ffffff;
  box-shadow: var(--gp-shadow-lg);
}
.gp-login-brand { display: flex; align-items: center; gap: .8rem; margin-bottom: 1.6rem; }
.gp-login-brand .gp-brand-logo { width: 46px; height: 46px; background: var(--gp-surface-alt); border: 1px solid var(--gp-border); }
.gp-login-brand strong { display: block; font-size: 1.15rem; font-weight: 700; letter-spacing: -.02em; }
.gp-login-brand span { color: var(--gp-muted); font-size: .72rem; text-transform: uppercase; letter-spacing: .1em; }
.gp-login-title { margin: 0 0 .25rem; font-size: 1.3rem; font-weight: 700; }
.gp-login-sub { margin: 0 0 1.5rem; color: var(--gp-muted); font-size: .85rem; }
.gp-login-foot { margin-top: 1.4rem; padding-top: 1.1rem; border-top: 1px solid var(--gp-border); color: var(--gp-muted); font-size: .72rem; text-align: center; }

/* ---------- Matriz de riesgos ---------- */

.matriz-table { font-size: 10px; table-layout: fixed; width: 100%; max-width: 1100px; }
.matriz-table th, .matriz-table td { vertical-align: top; padding: 5px 4px; }
.matriz-table th { font-size: 9px; text-transform: uppercase; letter-spacing: .03em; }
.matriz-nivel { font-weight: 700; font-size: 12px; line-height: 1; margin-bottom: 2px; }
.matriz-lista { display: flex; flex-direction: column; gap: 1px; align-items: center; }
.matriz-badge {
  display: inline-block;
  background: rgba(23, 49, 56, .9);
  color: #fff;
  text-decoration: none;
  padding: 1px 4px;
  border-radius: 3px;
  font-size: 8px;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.matriz-badge:hover { background: #17505e; color: #fff; }
.matriz-badge-leyenda { color: #1f2328; border: 1px solid rgba(0, 0, 0, .22); padding: 3px 7px; }
.matriz-aceptable { background: #d9efe1 !important; }
.matriz-mayor { background: #fdf1d2 !important; }
.matriz-alto { background: #fbe2c4 !important; }
.matriz-critico { background: #f6d5d5 !important; }

/* ---------- Utilidades ---------- */

.text-muted { color: var(--gp-muted) !important; }
.fw-semibold { font-weight: 600 !important; }
.gp-nowrap { white-space: nowrap; }
.gp-actions { display: flex; gap: .35rem; flex-wrap: wrap; justify-content: flex-end; align-items: center; }
.gp-actions-column { flex-direction: column; flex-wrap: nowrap; align-items: stretch; gap: .3rem; }
.gp-actions-column .btn { justify-content: flex-start; white-space: nowrap; }
.gp-actions-column .btn-primary { margin-top: .2rem; }
.gp-col-indent { padding-left: .75rem !important; }
.gp-col-shift-left { padding-left: 0 !important; position: relative; left: -.5rem; }
.gp-scroll-x { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.gp-list-clean { list-style: none; margin: 0; padding: 0; }

/* ---------- Responsive ---------- */

@media (max-width: 1199.98px) {
  .gp-main { padding: calc(var(--gp-topbar-h) + 1.4rem) 1.25rem 2.25rem; }
  .gp-page-head { gap: .9rem; }
}

@media (max-width: 991.98px) {
  .gp-sidebar { transform: translateX(-100%); box-shadow: var(--gp-shadow-lg); }
  .gp-topbar { left: 0; padding: 0 1rem; }
  .gp-main { margin-left: 0; padding: calc(var(--gp-topbar-h) + 1.15rem) 1rem 2rem; }
  body.gp-nav-open .gp-sidebar { transform: translateX(0); }
  body.gp-nav-open .gp-sidebar-overlay { display: block; }
  body.gp-sidebar-collapsed .gp-sidebar { width: var(--gp-sidebar-w); }
  body.gp-sidebar-collapsed .gp-topbar { left: 0; }
  body.gp-sidebar-collapsed .gp-main { margin-left: 0; }
  body.gp-sidebar-collapsed .gp-brand { justify-content: flex-start; padding: 0 1.15rem; }
  body.gp-sidebar-collapsed .gp-brand-text { display: flex; }
  body.gp-sidebar-collapsed .gp-nav-label { display: block; }
  body.gp-sidebar-collapsed .gp-sidebar .nav-link span { display: inline; }
  body.gp-sidebar-collapsed .gp-userbox-meta { display: flex; }
  body.gp-sidebar-collapsed .gp-userbox .gp-logout { display: inline-flex; }
  body.gp-sidebar-collapsed .gp-sidebar .nav-link { justify-content: flex-start; padding: .55rem .7rem; }
  body.gp-sidebar-collapsed .gp-userbox { justify-content: flex-start; padding: .55rem .6rem; }
  .gp-role-chip { display: none; }
  .gp-table-toolbar { padding: .8rem .9rem; }
  .card-body { padding: 1rem; }
}

@media (max-width: 575.98px) {
  .gp-page-head h1 { font-size: 1.28rem; }
  .gp-page-actions { width: 100%; }
  .gp-page-actions .btn { flex: 1 1 auto; justify-content: center; }
  .gp-breadcrumb { display: none; }
  .gp-kpi-value { font-size: 1.4rem; }
  .card-body { padding: .95rem; }
  .gp-form-card .card-body { padding: 1.05rem; }
  .gp-table-toolbar { padding: .75rem .85rem; }
  .table > :not(caption) > * > * { padding: .4rem .5rem; }
  .gp-actions { justify-content: flex-start; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}

/* ---------- Impresión ---------- */

@media print {
  .gp-sidebar, .gp-topbar, .gp-sidebar-overlay, .btn, form, .gp-no-print, details > summary::marker { display: none !important; }
  details, details[open] { display: block !important; }
  .gp-main { margin-left: 0 !important; width: 100% !important; padding: 10px !important; }
  body, body.gp-body { background: #fff !important; font-size: 9px !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .gp-container { max-width: 100% !important; }
  .gp-page-head { margin-bottom: 8px !important; }
  .gp-page-head h1 { font-size: 15px !important; }
  .card { break-inside: avoid; page-break-inside: avoid; border: 1px solid #adb5bd !important; box-shadow: none !important; }
  table, .table { font-size: 7.5px !important; border-collapse: collapse !important; }
  td, th { padding: 1px 2px !important; }
  .table { width: 100% !important; }
  .gp-table-card .table-responsive { max-height: none !important; overflow: visible !important; }
  .gp-table-card .table-responsive > .table > thead > tr > th,
  .gp-table-pinned-actions > :not(caption) > * > :last-child { position: static !important; box-shadow: none !important; }
  .matriz-impresion { page-break-inside: avoid; }
  .matriz-table { max-width: 100% !important; }
  .matriz-nivel { font-size: 10px !important; }
  .matriz-badge { font-size: 6.8px !important; background: #212529 !important; color: #fff !important; }
  .matriz-aceptable { background: #b7f0c8 !important; }
  .matriz-mayor { background: #ffe08a !important; }
  .matriz-alto { background: #ffcc80 !important; }
  .matriz-critico { background: #f5b7b1 !important; }
  .badge { border: 1px solid #495057 !important; }
  h2, h3, h4, h5 { margin-top: 2px !important; margin-bottom: 2px !important; font-size: 11px !important; }
  .row { --bs-gutter-y: .25rem; }
  .col-lg-5, .col-lg-7 { flex: 0 0 50%; max-width: 50%; }
}

/* ---------- Modo demo ---------- */

.gp-demo-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1.25rem;
  padding: .8rem 1rem;
  border: 1px solid #c6dde2;
  border-left: 4px solid var(--gp-primary);
  border-radius: var(--gp-radius);
  background: linear-gradient(90deg, #eef7f8 0%, #f7fbfb 100%);
  box-shadow: var(--gp-shadow-sm);
}
.gp-demo-banner-main { display: flex; align-items: flex-start; gap: .7rem; min-width: 0; }
.gp-demo-banner-main > i { color: var(--gp-primary); font-size: 1.15rem; margin-top: .1rem; }
.gp-demo-banner-main strong { display: block; font-size: .84rem; color: var(--gp-text); }
.gp-demo-banner-main span { display: block; color: var(--gp-text-soft); font-size: .76rem; line-height: 1.45; }
.gp-demo-banner-actions { display: flex; align-items: center; gap: .45rem; flex-wrap: wrap; }
.gp-role-chip-demo { border-color: #bcd3d8; background: var(--gp-primary-soft); color: var(--gp-primary); }
.gp-role-chip-demo::before { background: var(--gp-primary); }
@media (max-width: 575.98px) {
  .gp-demo-banner { align-items: flex-start; }
  .gp-demo-banner-actions { width: 100%; }
  .gp-demo-banner-actions .btn, .gp-demo-banner-actions form { flex: 1 1 auto; }
  .gp-demo-banner-actions form .btn { width: 100%; }
}
.gp-brand-mobile { display: none; font-weight: 700; color: var(--gp-primary); }
@media (max-width: 575.98px) { .gp-brand-mobile { display: inline-block; } }
.forma-triangulo:has(img){clip-path:none !important;background:transparent !important;padding:0 !important;}
.forma-triangulo img{clip-path:polygon(50% 0,100% 100%,0 100%);}
.forma-triangulo:has(img){border:none !important;box-shadow:none !important;border-radius:0 !important;}
.forma-triangulo:has(img){border:none !important;box-shadow:none !important;border-radius:0 !important;}
.forma-triangulo img{object-fit:contain;}
