/* Estilos compartidos del ERP web (Flask) — La Concepción y demo */
:root {
  --demo-green: #1b5e20;
  --demo-green-dark: #0d3d12;
  --demo-green-mid: #2e7d32;
  --demo-green-light: #e8f5e9;
  --bs-nav-pills-link-active-color: #fff;
  --bs-nav-pills-link-active-bg: var(--demo-green-mid);
  --bs-btn-active-color: #fff;
}

body.demo-body {
  background: #f4f6f8;
  min-height: 100vh;
}

.demo-navbar {
  background: linear-gradient(90deg, var(--demo-green-dark), var(--demo-green));
}

.demo-navbar-brand {
  min-width: 0;
  line-height: 1.2;
}

.demo-navbar-logo {
  width: auto;
  max-height: 36px;
  max-width: 72px;
  object-fit: contain;
  flex-shrink: 0;
}

.demo-main {
  min-height: calc(100vh - 56px);
}

.demo-main-auth {
  min-height: 100vh;
  padding: 0;
  overflow: hidden;
}

.login-page {
  position: relative;
  min-height: 100vh;
  width: 100%;
}

/* Vista aérea / drone: sectores geométricos + patio industrial */
.login-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
  background: #0f1418;
}

.login-bg-photo {
  position: absolute;
  inset: -3%;
  background-image: url("../login/bg_login_drone.jpg");
  background-image: image-set(
    url("../login/bg_login_drone.webp") type("image/webp"),
    url("../login/bg_login_drone.jpg") type("image/jpeg")
  );
  background-size: cover;
  background-position: 52% 46%;
  background-repeat: no-repeat;
  transform: scale(1.06);
  filter: saturate(0.92) contrast(1.04) brightness(1.04);
  animation: login-bg-drift 36s ease-in-out infinite alternate;
}

.login-bg-rows {
  position: absolute;
  inset: 0;
  opacity: 0.18;
  background-image:
    linear-gradient(rgba(120, 200, 180, 0.14) 1px, transparent 1px),
    linear-gradient(90deg, rgba(120, 200, 180, 0.14) 1px, transparent 1px);
  background-size: 64px 64px;
  mix-blend-mode: soft-light;
}

.login-bg-steel {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 68% 72%, rgba(255, 255, 255, 0.08), transparent 22%),
    radial-gradient(ellipse 90% 70% at 50% 40%, transparent 35%, rgba(8, 14, 18, 0.28) 100%),
    linear-gradient(180deg, rgba(8, 14, 18, 0.22) 0%, rgba(8, 14, 18, 0.06) 42%, rgba(8, 14, 18, 0.26) 100%);
}

.login-scrim {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: linear-gradient(
    180deg,
    rgba(8, 12, 16, 0.4) 0%,
    rgba(8, 12, 16, 0.12) 46%,
    rgba(8, 12, 16, 0.45) 100%
  );
}

@keyframes login-bg-drift {
  from { transform: scale(1.06) translate3d(0, 0, 0); }
  to   { transform: scale(1.1) translate3d(-0.8%, 0.5%, 0); }
}

.login-logo-corner {
  position: fixed;
  top: 1.1rem;
  left: 1.1rem;
  right: auto;
  bottom: auto;
  z-index: 8;
  width: fit-content;
  height: fit-content;
  pointer-events: none;
}

.logo-login {
  max-height: 52px;
  width: auto;
  filter: drop-shadow(0 4px 14px rgba(0, 0, 0, 0.45));
}

.login-access {
  position: fixed;
  top: 1.25rem;
  right: 1.25rem;
  z-index: 30;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.75rem;
}

.btn-acceso {
  border: 1px solid rgba(220, 230, 220, 0.35);
  cursor: pointer;
  padding: 0.65rem 1.35rem;
  border-radius: 10px;
  background: linear-gradient(135deg, #3d5c48, #1f3a2c);
  color: #f2f5f1;
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: 0.04em;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.35);
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.btn-acceso:hover {
  transform: translateY(-1px);
  background: linear-gradient(135deg, #4a6d56, #274a38);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.42);
}

.login-panel {
  width: min(320px, calc(100vw - 2rem));
  background: rgba(248, 250, 247, 0.94);
  backdrop-filter: blur(14px);
  border: 1px solid rgba(255, 255, 255, 0.45);
  border-radius: 12px;
  padding: 1.25rem 1.35rem 1.1rem;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.32);
  opacity: 0;
  transform: translateY(-8px) scale(0.98);
  pointer-events: none;
  transition: opacity 0.22s ease, transform 0.22s ease;
}

.login-panel.open {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.login-panel-form label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  color: #1f3a2c;
  margin: 0.65rem 0 0.35rem;
}

.login-panel-form label:first-of-type {
  margin-top: 0;
}

.login-panel-form input[type="email"],
.login-panel-form input[type="password"] {
  width: 100%;
  padding: 0.65rem 0.75rem;
  border-radius: 8px;
  border: 1px solid #c5d2c8;
  background: #f7f9f6;
  font-size: 0.95rem;
}

.login-panel-form .form-check-label {
  font-size: 0.85rem;
  color: #444;
  font-weight: 500;
}

.btn-ingresar {
  width: 100%;
  margin-top: 0.75rem;
  padding: 0.7rem;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  background: linear-gradient(135deg, #4a6d56, #1f3a2c);
  color: #fff;
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: 0.06em;
}

.login-hero {
  position: fixed;
  z-index: 5;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  width: min(640px, 92vw);
  color: #f4f7f2;
  text-shadow: 0 2px 18px rgba(0, 0, 0, 0.55);
  pointer-events: none;
  animation: login-hero-in 0.9s ease-out both;
}

.login-brand {
  margin: 0 0 0.55rem;
  font-size: clamp(1.35rem, 3.8vw, 2rem);
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #e8efe6;
  opacity: 0.95;
}

.login-hero-icon {
  display: block;
  font-size: clamp(3rem, 9vw, 4.5rem);
  line-height: 1;
  margin: 0 auto 0.65rem;
  filter: drop-shadow(0 8px 24px rgba(0, 0, 0, 0.4));
}

.login-hero h1 {
  font-size: clamp(1.15rem, 3.2vw, 1.65rem);
  font-weight: 650;
  letter-spacing: 0.08em;
  margin-bottom: 0.55rem;
  color: #d7e2d6;
}

.login-hero p {
  font-size: clamp(0.98rem, 2.2vw, 1.15rem);
  opacity: 0.92;
  margin-bottom: 0;
  font-weight: 500;
  max-width: 28rem;
  margin-left: auto;
  margin-right: auto;
}

.login-demo-badge {
  display: inline-block;
  padding: 0.35rem 0.95rem;
  border-radius: 8px;
  background: rgba(255, 243, 205, 0.92);
  color: #7a5c00;
  font-size: 0.78rem;
  font-weight: 700;
  border: 1px solid rgba(255, 193, 7, 0.55);
  letter-spacing: 0.04em;
}

.login-hero-select {
  pointer-events: auto;
  width: min(420px, 92vw);
}
.tenant-pick {
  display: grid;
  gap: 0.75rem;
  margin: 1.25rem 0 0.75rem;
  text-align: left;
}
.tenant-pick-item {
  display: grid;
  gap: 0.2rem;
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.28);
  background: rgba(18, 32, 24, 0.55);
  color: #fff;
  border-radius: 12px;
  padding: 0.95rem 1.1rem;
  cursor: pointer;
  text-align: left;
  backdrop-filter: blur(8px);
  transition: transform 150ms ease, background 150ms ease;
}
.tenant-pick-item:hover {
  transform: translateY(-1px);
  background: rgba(31, 77, 58, 0.72);
}
.tenant-pick-item strong {
  font-size: 1.05rem;
}
.tenant-pick-item span {
  font-size: 0.88rem;
  opacity: 0.85;
}
.login-select-back {
  margin-top: 0.85rem;
  font-size: 0.9rem;
}
.login-select-back a {
  color: #fff;
  text-decoration: underline;
  text-underline-offset: 3px;
}

@keyframes login-hero-in {
  from { opacity: 0; transform: translate(-50%, calc(-50% + 12px)); }
  to   { opacity: 1; transform: translate(-50%, -50%); }
}

@media (max-width: 768px) {
  .login-bg-photo {
    background-position: 50% 44%;
    animation: none;
    transform: scale(1.08);
  }

  .login-access {
    top: 0.75rem;
    right: 0.75rem;
  }

  .login-logo-corner {
    top: 0.75rem;
    left: 0.75rem;
  }

  .logo-login {
    max-height: 42px;
  }

  .login-brand {
    letter-spacing: 0.1em;
  }
}

@media (prefers-reduced-motion: reduce) {
  .login-bg-photo,
  .login-hero {
    animation: none;
  }
}

.kpi-card {
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 12px;
  padding: 1rem;
  height: 100%;
}

.kpi-label {
  font-size: 0.75rem;
  color: #666;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.kpi-value {
  font-size: 1.35rem;
  font-weight: 700;
  color: #1a1a1a;
}

.kpi-danger .kpi-value { color: #c62828; }
.kpi-warn .kpi-value { color: #ef6c00; }

.riego-npk-kpi { border-left-width: 4px; border-left-style: solid; }
.riego-npk-n { border-left-color: #2e7d32; }
.riego-npk-p { border-left-color: #1565c0; }
.riego-npk-k { border-left-color: #ef6c00; }
.riego-npk-ayuda code { font-size: 0.85em; }

.riego-npk-panel {
  border: 1px solid #c5d9c5;
  background: linear-gradient(180deg, #f7faf6 0%, #fff 48%);
}
.riego-npk-cc-table {
  border-collapse: separate;
  border-spacing: 0;
}
.riego-npk-cc-table thead th {
  background: #eef5eb;
  border-bottom: 2px solid #b7cfb8;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #4a5d4a;
  padding: 0.65rem 0.75rem;
}
.riego-npk-cc-table tbody td,
.riego-npk-cc-table tfoot td {
  padding: 0.7rem 0.75rem;
  border-bottom: 1px solid #e3ebe0;
  font-size: 0.9rem;
  vertical-align: middle;
}
.riego-npk-cc-table tbody tr:last-child td { border-bottom-width: 0; }
.riego-npk-cc-row-active {
  background: #fff;
}
.riego-npk-cc-row-active td:first-child {
  border-left: 4px solid var(--demo-green, #2e7d32);
}
.riego-npk-cc-foot {
  background: #eef5eb;
}
.riego-npk-cc-foot td {
  border-top: 2px solid #b7cfb8;
  font-size: 0.95rem;
}
.riego-npk-th-n, .riego-npk-val-n { color: #2e7d32; font-weight: 600; }
.riego-npk-th-p, .riego-npk-val-p { color: #1565c0; font-weight: 600; }
.riego-npk-th-k, .riego-npk-val-k { color: #ef6c00; font-weight: 600; }
.riego-npk-cc-table tbody tr:not(.riego-npk-cc-row-active) .riego-npk-val-n,
.riego-npk-cc-table tbody tr:not(.riego-npk-cc-row-active) .riego-npk-val-p,
.riego-npk-cc-table tbody tr:not(.riego-npk-cc-row-active) .riego-npk-val-k {
  font-weight: 400;
  color: #888;
}

.panel-card {
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 12px;
  padding: 1rem 1.25rem;
}

.panel-title {
  margin-bottom: 0.75rem;
  color: var(--demo-green);
}

/* Tablas ERP — columnas alineadas + líneas finas entre columnas */
body.demo-body .table {
  border-collapse: collapse;
  width: 100%;
  margin-bottom: 0;
}

body.demo-body .table th,
body.demo-body .table td {
  vertical-align: middle;
  padding: 0.48rem 0.65rem;
  border-bottom: 1px solid #e3e8e5;
  border-right: 1px solid #e3e8e5;
  box-sizing: border-box;
}

body.demo-body .table th:last-child,
body.demo-body .table td:last-child {
  border-right: none;
}

body.demo-body .table thead th {
  background: #f3f6f4;
  color: #1b3a24;
  font-weight: 600;
  font-size: 0.82rem;
  border-bottom: 2px solid #cfd8d3;
  white-space: nowrap;
}

body.demo-body .table tbody tr:nth-child(even) {
  background-color: rgba(0, 0, 0, 0.02);
}

body.demo-body .table-striped > tbody > tr:nth-of-type(odd) > * {
  --bs-table-accent-bg: transparent;
  background-color: #fff;
}

body.demo-body .table-striped > tbody > tr:nth-of-type(even) > * {
  --bs-table-accent-bg: rgba(0, 0, 0, 0.025);
  background-color: rgba(0, 0, 0, 0.025);
}

body.demo-body .table-responsive {
  border: 1px solid #dee2e6;
  border-radius: 0.5rem;
  overflow-x: auto;
}

body.demo-body .table-responsive > .table {
  border: 0;
}

body.demo-body table.dataTable {
  width: 100% !important;
  margin: 0 !important;
}

body.demo-body table.dataTable thead th,
body.demo-body table.dataTable tbody td {
  vertical-align: middle;
}

body.demo-body table.dataTable thead .sorting,
body.demo-body table.dataTable thead .sorting_asc,
body.demo-body table.dataTable thead .sorting_desc {
  padding-right: 1.35rem;
  background-position: right 0.35rem center;
}

body.demo-body .dataTables_wrapper .dataTables_length,
body.demo-body .dataTables_wrapper .dataTables_filter,
body.demo-body .dataTables_wrapper .dataTables_info,
body.demo-body .dataTables_wrapper .dataTables_paginate {
  padding: 0.35rem 0.15rem;
  font-size: 0.85rem;
}

/* Sidebar — navegación principal */
.demo-offcanvas {
  background: #fff;
}

.demo-menu {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  margin-top: 0.35rem;
  padding: 0 0.5rem 0.75rem;
}

.demo-nav-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem;
  width: 100%;
  padding: 0.62rem 0.85rem;
  border-radius: 10px;
  border: 0;
  background: transparent;
  color: #1f2933;
  font-weight: 600;
  font-size: 0.94rem;
  line-height: 1.25;
  text-decoration: none;
  transition: background 140ms ease, color 140ms ease;
}

.demo-nav-link:hover,
.demo-nav-link:focus {
  background: var(--demo-green-light);
  color: var(--demo-green-dark);
}

.demo-nav-link.active {
  background: var(--demo-green);
  color: #fff !important;
}

.nav-link-main {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  min-width: 0;
}

.nav-link-main i {
  flex-shrink: 0;
  width: 1.15rem;
  font-size: 1.05rem;
  opacity: 0.92;
}

.nav-link-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.demo-nav-link.active .nav-link-main i {
  opacity: 1;
}

.demo-nav-link.nav-with-count {
  padding-right: 0.65rem;
}

.nav-count {
  flex-shrink: 0;
  min-width: 1.45rem;
  padding: 0.12rem 0.45rem;
  border-radius: 999px;
  background: #e8edf2;
  color: #425466;
  font-size: 0.72rem;
  font-weight: 800;
  line-height: 1.2;
  text-align: center;
}

.nav-count-alert {
  background: #ffebee;
  color: #b71c1c;
}

.demo-nav-link.active .nav-count {
  background: rgba(255, 255, 255, 0.22);
  color: #fff;
}

.demo-nav-link.active .nav-count-alert {
  background: #fff;
  color: #b71c1c;
}

.demo-nav-section {
  margin: 0.85rem 0.85rem 0.35rem;
  padding-top: 0.65rem;
  border-top: 1px solid #dde5df;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #5f6b7a;
}

.demo-menu-foot {
  margin-top: auto;
  flex-shrink: 0;
  padding: 0.75rem 0.5rem 0.25rem;
  border-top: 1px solid #dde5df;
}

.demo-nav-link.nav-planes {
  flex-direction: column;
  align-items: stretch;
  gap: 0.5rem;
  margin: 0 0.15rem;
  padding: 0.75rem 0.7rem;
  border: 1px solid rgba(46, 125, 50, 0.35);
  background: linear-gradient(135deg, rgba(46, 125, 50, 0.92), rgba(27, 94, 32, 0.95));
  color: #f3fff4 !important;
  box-shadow: 0 6px 16px rgba(27, 94, 32, 0.22);
}

.demo-nav-link.nav-planes .nav-link-main {
  justify-content: center;
  width: 100%;
  font-size: 1.02rem;
}

.demo-nav-link.nav-planes .nav-link-main i {
  color: #ffe8a3;
}

.demo-nav-link.nav-planes .nav-fee {
  display: block;
  width: 100%;
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-align: center;
  white-space: nowrap;
  padding: 0.35rem 0.45rem;
  border-radius: 999px;
  border: 1px solid #f0c14b;
  color: #3d2a00;
  background: #ffe8a3;
  line-height: 1.25;
  box-sizing: border-box;
}

.demo-nav-link.nav-planes:hover,
.demo-nav-link.nav-planes:focus {
  background: linear-gradient(135deg, #388e3c, #1b5e20);
  color: #fff !important;
}

.demo-nav-link.nav-planes.active {
  background: linear-gradient(135deg, #f0a202, #2e7d32) !important;
  border-color: #ffe8a3 !important;
}

.demo-nav-link.nav-planes.active .nav-link-main i {
  color: #fff8e1;
}

.demo-nav-link.nav-planes.active .nav-fee-pack {
  color: #5a3d00;
  background: #fff3cd;
  border-color: transparent;
}

/* Compatibilidad menú antiguo list-group */
.demo-menu .list-group-item {
  border: 0 !important;
  position: relative;
  z-index: 1;
  text-align: left;
  padding-left: 1.15rem;
  padding-right: 1rem;
}

.demo-menu .list-group-item-action {
  cursor: pointer;
  pointer-events: auto;
}

.demo-sidebar-head {
  padding: 0.35rem 1.15rem 0.75rem;
  margin-top: 0.75rem;
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.22em;
  color: var(--demo-green);
  text-transform: uppercase;
  text-align: left;
}

@media (min-width: 992px) {
  .demo-sidebar-head {
    margin-top: 1rem;
  }
}

.demo-menu .list-group-item.active {
  background: var(--demo-green);
  border-color: var(--demo-green);
  color: #fff !important;
}

/* Pestañas de sección (Tesorería, RRHH, Costos, etc.) */
.demo-nav-seccion .nav-link,
.demo-main .nav-pills .nav-link {
  color: var(--demo-green-dark);
  font-weight: 600;
  background: #fff;
  border: 1px solid #dde5df;
}

.demo-nav-seccion .nav-link:hover:not(.active),
.demo-main .nav-pills .nav-link:hover:not(.active) {
  background: var(--demo-green-light);
  color: var(--demo-green-dark);
}

.demo-nav-seccion .nav-link.active,
.demo-main .nav-pills .nav-link.active,
.demo-main .nav-pills .show > .nav-link {
  background-color: var(--demo-green-mid) !important;
  border-color: var(--demo-green-mid) !important;
  color: #fff !important;
}

/* Botones sólidos — texto claro sobre fondo oscuro */
.demo-main .btn-primary,
.demo-main .btn-success,
.demo-main .btn-danger,
.demo-main .btn-info,
.demo-main .btn-dark,
.demo-main .btn-primary:hover,
.demo-main .btn-primary:focus,
.demo-main .btn-primary:active,
.demo-main .btn-success:hover,
.demo-main .btn-success:focus,
.demo-main .btn-success:active {
  color: #fff !important;
}

.demo-main .btn-group > .btn-primary,
.demo-main .btn-group > .btn-success {
  color: #fff !important;
}

/* Radio / toggle tipo botón (Compras, etc.) */
.demo-main .btn-check:checked + .btn-outline-primary,
.demo-main .btn-check:checked + .btn-outline-success,
.demo-main .btn-check:active + .btn-outline-primary,
.demo-main .btn-check:active + .btn-outline-success {
  background-color: var(--demo-green-mid) !important;
  border-color: var(--demo-green-mid) !important;
  color: #fff !important;
}

.manual-viewer {
  max-height: 75vh;
  overflow: auto;
  font-size: 0.95rem;
  line-height: 1.55;
}

@media (min-width: 992px) {
  body.demo-body {
    overflow-x: hidden;
  }
  .demo-main {
    margin-left: 280px;
    width: auto;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
  }
  .demo-offcanvas,
  .demo-offcanvas.demo-sidebar-desktop {
    position: fixed !important;
    top: 56px;
    left: 0;
    width: 280px !important;
    height: calc(100vh - 56px) !important;
    transform: none !important;
    visibility: visible !important;
    border-right: 1px solid #dee2e6;
    z-index: 1040;
    overflow: hidden;
    pointer-events: auto !important;
  }
  .offcanvas-backdrop {
    display: none !important;
  }
  .demo-offcanvas .offcanvas-body {
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow-x: hidden;
    overflow-y: auto;
    padding-top: 0.25rem;
    padding-bottom: 1rem;
    -webkit-overflow-scrolling: touch;
  }
  .demo-offcanvas .demo-menu {
    flex: 1 1 auto;
    padding-bottom: 0.5rem;
    min-height: 0;
  }
  .demo-offcanvas .btn-close { display: none; }
}

/* Dashboard — variables y estilos (fuera de .demo-module para que apliquen) */
.dashboard-page {
  --verde-oscuro: #1B5E20;
  --verde-medio: #2E7D32;
  --verde-claro: #E8F5E9;
  --azul-accion: #1565C0;
  --azul-oscuro: #0D47A1;
  --tarjeta: #FFFFFF;
  --texto: #1F2933;
  --texto-suave: #5F6B7A;
  --borde: #DDE5DF;
  --radio: 14px;
  --sombra: 0 8px 24px rgba(27, 94, 32, 0.08);
  --alert-roja-bg: #FFEBEE;
  --alert-roja-text: #B71C1C;
  --alert-roja-border: #EF9A9A;
}

.dashboard-page .banner-econ {
  background: linear-gradient(135deg, #0D47A1 0%, #1565C0 50%, #1976D2 100%);
  color: #ffffff;
  padding: 0.9rem 1.15rem;
  border-radius: 12px;
  text-align: center;
  font-weight: 700;
  font-size: clamp(0.8rem, 1.4vw, 0.95rem);
  line-height: 1.5;
  margin-bottom: 1rem;
  border: 1px solid #0D47A1;
  box-shadow: 0 6px 18px rgba(13, 71, 161, 0.28);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
  letter-spacing: 0.01em;
}

.dashboard-page .alert-roja {
  background: var(--alert-roja-bg);
  color: var(--alert-roja-text);
  border: 1px solid var(--alert-roja-border);
  padding: 0.75rem 1rem;
  border-radius: 12px;
  margin-bottom: 0.75rem;
  font-weight: 700;
}

.dashboard-page .dashboard-kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 11.5rem), 1fr));
  gap: 0.75rem;
  margin-bottom: 1rem;
  width: 100%;
}

.dashboard-page .dashboard-kpi-card {
  background: var(--tarjeta);
  padding: 0.95rem 1rem;
  border-radius: var(--radio);
  box-shadow: var(--sombra);
  border: 1px solid var(--borde);
  border-left: 5px solid var(--verde-medio);
  min-width: 0;
  overflow: visible;
}

.dashboard-page .dashboard-kpi-label {
  font-size: clamp(0.7rem, 1.15vw, 0.88rem);
  font-weight: 600;
  color: var(--texto-suave);
  line-height: 1.25;
  margin-bottom: 0.35rem;
  word-wrap: break-word;
}

.dashboard-page .dashboard-kpi-value {
  font-size: clamp(0.95rem, 2.1vw, 1.65rem);
  font-weight: 800;
  color: var(--verde-oscuro);
  line-height: 1.15;
  word-break: break-word;
  overflow-wrap: anywhere;
}

.dashboard-page .dashboard-kpi-value.critico { color: #c62828; }
.dashboard-page .dashboard-kpi-value.alerta { color: #1565c0; }

.dashboard-page .dashboard-dual-panel {
  background: var(--tarjeta);
  border: 1px solid var(--borde);
  border-radius: var(--radio);
  padding: 1rem;
  margin-bottom: 1rem;
  box-shadow: var(--sombra);
}

.dashboard-page .dashboard-dual-title {
  font-weight: 800;
  color: var(--verde-oscuro);
  border-bottom: 2px solid var(--verde-claro);
  padding-bottom: 0.5rem;
  margin-bottom: 0.75rem;
}

.dashboard-page .dashboard-cc-header {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(4.2rem, 1fr) minmax(3.2rem, 0.7fr) minmax(4rem, 0.75fr);
  gap: 0.5rem;
  font-size: 0.76rem;
  font-weight: 700;
  color: #37474f;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  padding: 0 0.75rem 0.35rem;
  border-bottom: 1px solid var(--borde);
  margin-bottom: 0.35rem;
}

.dashboard-page .dashboard-cc-header span:not(:first-child),
.dashboard-page .dashboard-fila-cc .monto,
.dashboard-page .dashboard-fila-cc .metrica {
  text-align: right;
}

.dashboard-page .dashboard-fila-monto {
  display: flex;
  justify-content: space-between;
  padding: 0.55rem 0.75rem;
  border-left: 4px solid var(--verde-medio);
  background: #fafcfa;
  border-radius: 8px;
  margin-bottom: 0.35rem;
  color: #1f2933;
}

.dashboard-page .dashboard-fila-monto .etiqueta,
.dashboard-page .dashboard-fila-monto .monto {
  color: #1f2933;
  font-weight: 600;
}

.dashboard-page .dashboard-fila-monto.pago .monto {
  color: #0d47a1;
}

.dashboard-page .dashboard-fila-cc {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(4.2rem, 1fr) minmax(3.2rem, 0.7fr) minmax(4rem, 0.75fr);
  gap: 0.5rem;
  align-items: center;
  justify-content: unset;
}

.dashboard-page .dashboard-fila-cc .metrica {
  font-weight: 700;
  white-space: nowrap;
  font-size: 0.86rem;
}

.dashboard-page .dashboard-fila-cc.total {
  font-weight: 700;
  background: #eceff1;
}

.dashboard-page .dashboard-fila-cc .badge-costos {
  display: inline-block;
  padding: 0.15rem 0.45rem;
  border-radius: 6px;
  font-size: 0.82rem;
  font-weight: 700;
  color: #1f2933;
  background: #eceff1;
  border: 1px solid #cfd8dc;
}

.dashboard-page .dashboard-fila-cc .badge-costos.costos-badge-verde {
  color: #2e7d32 !important;
  background: #e8f5e9 !important;
  border-color: #a5d6a7;
}
.dashboard-page .dashboard-fila-cc .badge-costos.costos-badge-amarillo {
  color: #f9a825 !important;
  background: #fff8e1 !important;
  border-color: #ffe082;
}
.dashboard-page .dashboard-fila-cc .badge-costos.costos-badge-naranja {
  color: #e65100 !important;
  background: #fff3e0 !important;
  border-color: #ffcc80;
}
.dashboard-page .dashboard-fila-cc .badge-costos.costos-badge-rojo {
  color: #c62828 !important;
  background: #ffebee !important;
  border-color: #ef9a9a;
}

.dashboard-page .dashboard-fila-monto.pago-vacio {
  opacity: 1;
  background: #f1f3f4;
  border-left-color: #b0bec5;
}

.dashboard-page .dashboard-fila-monto.pago-vacio .etiqueta,
.dashboard-page .dashboard-fila-monto.pago-vacio .monto {
  color: #546e7a;
}

/* Estilos heredados del ERP demo (captura Streamlit) */
.demo-module {
  --verde-oscuro: #1B5E20;
  --verde-medio: #2E7D32;
  --verde-claro: #E8F5E9;
  --azul-accion: #1565C0;
  --azul-oscuro: #0D47A1;
  --tarjeta: #FFFFFF;
  --texto: #1F2933;
  --texto-suave: #5F6B7A;
  --borde: #DDE5DF;
  --radio: 14px;
  --sombra: 0 8px 24px rgba(27, 94, 32, 0.08);
  --saldo-bg: #E3F2FD;
  --saldo-text: #0D47A1;
  --saldo-border: #90CAF9;
  --alert-roja-bg: #FFEBEE;
  --alert-roja-text: #B71C1C;
  --alert-roja-border: #EF9A9A;
}

.demo-captured-content h1,
.demo-captured-content h2,
.demo-captured-content h3,
.demo-captured-content h4 {
  color: var(--verde-oscuro);
}

.dashboard-kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 11.5rem), 1fr));
  gap: 0.75rem;
  margin-bottom: 1rem;
}
.dashboard-kpi-card {
  background: var(--tarjeta);
  padding: 0.95rem 1rem;
  border-radius: var(--radio);
  box-shadow: var(--sombra);
  border: 1px solid var(--borde);
  border-left: 5px solid var(--verde-medio);
}
.dashboard-kpi-label { font-size: 0.82rem; font-weight: 600; color: var(--texto-suave); }
.dashboard-kpi-value { font-size: 1.35rem; font-weight: 800; color: var(--verde-oscuro); }
.dashboard-kpi-value.critico { color: #d32f2f; }
.dashboard-kpi-value.alerta { color: #1976d2; }
.dashboard-dual-panel {
  background: var(--tarjeta);
  border: 1px solid var(--borde);
  border-radius: var(--radio);
  padding: 1rem;
  margin-bottom: 1rem;
}
.dashboard-dual-title {
  font-weight: 800;
  color: var(--verde-oscuro);
  border-bottom: 2px solid var(--verde-claro);
  padding-bottom: 0.5rem;
  margin-bottom: 0.75rem;
}
.dashboard-fila-monto {
  display: flex;
  justify-content: space-between;
  padding: 0.55rem 0.75rem;
  border-left: 4px solid var(--verde-medio);
  background: #fafcfa;
  border-radius: 8px;
  margin-bottom: 0.35rem;
  color: #1f2933;
}
.dashboard-fila-monto .etiqueta,
.dashboard-fila-monto .monto {
  color: #1f2933;
  font-weight: 600;
}
.dashboard-page .dashboard-fila-monto.pago .monto {
  color: #0d47a1;
}
.saldo-banner {
  background: var(--saldo-bg);
  color: var(--saldo-text);
  padding: 1rem;
  border-radius: var(--radio);
  border: 1px solid var(--saldo-border);
  text-align: center;
  font-weight: 800;
  margin-bottom: 1rem;
}
.banner-econ {
  background: linear-gradient(135deg, var(--azul-oscuro), var(--azul-accion));
  color: white;
  padding: 0.85rem 1rem;
  border-radius: 12px;
  text-align: center;
  font-weight: 700;
  margin-bottom: 1rem;
}
.alert-roja {
  background: var(--alert-roja-bg);
  color: var(--alert-roja-text);
  border: 1px solid var(--alert-roja-border);
  padding: 0.75rem 1rem;
  border-radius: 12px;
  margin-bottom: 0.75rem;
  font-weight: 700;
}
.lc-evento-banner {
  background: linear-gradient(135deg, #e8f5e9, #f1f8e9);
  border: 1px solid var(--borde, #dde5df);
  border-left: 4px solid var(--demo-green, #1b5e20);
  padding: 0.65rem 1rem;
  border-radius: 10px;
  font-size: 0.9rem;
}

.status-pill {
  display: inline-block;
  background: var(--verde-claro);
  color: var(--verde-oscuro);
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 700;
}

/* Widget donut — actividad usuarios (dashboard admin) */
.dash-us-widget-bottom {
  display: flex;
  justify-content: flex-end;
  width: 100%;
}

.dash-us-widget-bottom .us-widget-anchor {
  flex: 0 0 auto;
  max-width: min(270px, 100%);
}

.clima-widget-compact {
  background: linear-gradient(135deg, #f3e5f5 0%, #ede7f6 100%);
  border: 1px solid #ce93d8;
  border-radius: 14px;
  padding: 0.75rem 0.9rem 0.7rem;
  text-align: right;
  max-width: 270px;
  margin-left: auto;
  box-shadow: 0 6px 16px rgba(21, 101, 192, 0.1);
}

.clima-widget-kicker {
  font-size: 0.78rem;
  font-weight: 700;
  color: #6a1b9a;
  letter-spacing: 0.01em;
  margin-bottom: 0.15rem;
}

.clima-widget-meta {
  font-size: 0.72rem;
  color: #6b7b8c;
  margin-top: 0.35rem;
  line-height: 1.3;
}

.us-widget-donut .clima-widget-kicker {
  margin-bottom: 0.45rem;
}

.us-donut-wrap {
  display: flex;
  justify-content: flex-end;
  margin: 0.1rem 0 0.3rem;
}

.us-donut {
  width: 118px;
  height: 118px;
  border-radius: 50%;
  position: relative;
  flex-shrink: 0;
}

.us-donut-hole {
  position: absolute;
  width: 74px;
  height: 74px;
  background: #fff;
  border-radius: 50%;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  box-shadow: inset 0 0 0 1px rgba(106, 27, 154, 0.1);
}

.us-donut-center {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  z-index: 2;
  line-height: 1.05;
}

.us-donut-num {
  font-size: 1.55rem;
  font-weight: 800;
  color: #4a148c;
}

.us-donut-lbl {
  font-size: 0.58rem;
  font-weight: 600;
  color: #5f6b7a;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.us-leyenda {
  margin-top: 0.2rem;
  text-align: right;
}

.us-leyenda-vacia {
  font-size: 0.68rem;
  color: #90a4ae;
  font-style: italic;
}

.us-ley-fila {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.28rem;
  font-size: 0.62rem;
  line-height: 1.45;
  color: #37474f;
}

.us-ley-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}

.us-ley-nom {
  max-width: 5.5rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.us-ley-pct {
  font-weight: 800;
  color: #6a1b9a;
  min-width: 1.8rem;
  text-align: right;
}

.us-ley-otros {
  color: #78909c;
}

/* Logo */
.logo-modulo, .logo-sidebar, .logo-login {
  max-width: 220px;
  width: 100%;
  height: auto;
  display: block;
  margin: 0 auto;
}
.dashboard-page--concepcion .dashboard-tenant-logo .logo-modulo {
  max-width: 320px;
}
.dashboard-master-logo {
  position: fixed;
  right: 1.15rem;
  bottom: 1rem;
  z-index: 6;
  pointer-events: none;
  opacity: 0.92;
}
.dashboard-master-logo img {
  max-height: 42px;
  width: auto;
  display: block;
  filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.12));
}
.erp-master-brand {
  position: fixed;
  right: 1.15rem;
  bottom: 1rem;
  z-index: 6;
  pointer-events: none;
  opacity: 0.88;
}
.erp-master-brand img {
  max-height: 34px;
  width: auto;
  display: block;
  filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.1));
}
@media (max-width: 767.98px) {
  .dashboard-master-logo,
  .erp-master-brand {
    right: 0.65rem;
    bottom: 0.65rem;
  }
  .dashboard-master-logo img { max-height: 32px; }
  .erp-master-brand img { max-height: 28px; }
}
.demo-sidebar-logo {
  padding-top: 0.85rem;
  padding-bottom: 0.25rem;
  margin-bottom: 0;
  min-height: 118px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.logo-sidebar {
  max-width: 235px;
  max-height: 112px;
  width: auto;
  object-fit: contain;
}
.logo-login { max-width: 380px; }
.login-logo-corner {
  position: fixed;
  top: 1.1rem;
  left: 1.1rem;
  right: auto;
  bottom: auto;
  z-index: 8;
  width: fit-content;
  height: fit-content;
  pointer-events: none;
}
.login-logo-corner .logo-login {
  max-width: 200px;
  max-height: 52px;
  width: auto;
  margin: 0;
  pointer-events: auto;
}

/* Dashboard encabezado */
.dash-hr {
  height: 5px;
  border: none;
  border-radius: 6px;
  margin: 0 0 0.35rem;
  background: linear-gradient(90deg, #1b5e20, #e8f5e9);
}
.dash-main-title {
  font-size: 2rem;
  font-weight: 800;
  color: #1b5e20;
  margin: 0 0 0.15rem;
  line-height: 1.15;
}
.dash-subtitle { color: #5f6b7a; font-size: 0.92rem; margin-bottom: 0.35rem; }
.modulo-badge {
  display: inline-block;
  background: #e8f5e9;
  color: #1b5e20;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
}
.dashboard-cc-header {
  display: grid;
  grid-template-columns: 2fr 1.2fr 1fr 1fr;
  gap: 0.5rem;
  font-size: 0.78rem;
  font-weight: 700;
  color: #546e7a;
  padding: 0 0.75rem 0.35rem;
  border-bottom: 1px solid var(--borde);
  margin-bottom: 0.35rem;
}
.dashboard-fila-cc {
  display: grid;
  grid-template-columns: 2fr 1.2fr 1fr 1fr;
  gap: 0.5rem;
  align-items: center;
}
.dashboard-fila-cc.total { font-weight: 700; background: #eceff1; }
.dashboard-fila-cc .badge-costos {
  display: inline-block;
  padding: 0.15rem 0.45rem;
  border-radius: 6px;
  font-size: 0.82rem;
  font-weight: 700;
  color: #1f2933 !important;
  background: #eceff1 !important;
  border: 1px solid #cfd8dc;
}
.dashboard-fila-monto.pago-vacio {
  opacity: 1;
  background: #f1f3f4;
  border-left-color: #b0bec5;
}
.dashboard-fila-monto.pago-vacio .etiqueta,
.dashboard-fila-monto.pago-vacio .monto {
  color: #546e7a;
}
.dashboard-page .table td,
.dashboard-page .table th {
  color: #1f2933;
}

/* Costos matriz + widgets */
.costos-matriz-table { font-size: 0.78rem; }
.costos-matriz-table th,
.costos-matriz-table td { white-space: nowrap; padding: 0.28rem 0.45rem; }

body.demo-body .costos-matriz-table tr.costos-row-gasto > td {
  background-color: #fff8e1 !important;
  color: #f57f17 !important;
  font-weight: 600;
}
body.demo-body .costos-matriz-table tr.costos-row-ppto > td {
  background-color: #e3f2fd !important;
  color: #0d47a1 !important;
  font-weight: 600;
}
body.demo-body .costos-matriz-table tr.costos-row-saldo > td {
  font-weight: 600;
}
body.demo-body .costos-matriz-table td.costos-saldo-neg {
  background-color: #ffebee !important;
  color: #c62828 !important;
}
body.demo-body .costos-matriz-table td.costos-saldo-pos {
  background-color: #e8f5e9 !important;
  color: #2e7d32 !important;
}
body.demo-body .costos-matriz-table td.costos-saldo-neutro {
  background-color: #f5f5f5 !important;
  color: #616161 !important;
}

.costos-kpi-value.costos-tone-verde { color: #2e7d32; }
.costos-kpi-value.costos-tone-amarillo { color: #f9a825; }
.costos-kpi-value.costos-tone-naranja { color: #e65100; }
.costos-kpi-value.costos-tone-rojo { color: #c62828; }
.costos-kpi-card.costos-saldo-kpi-neg {
  border-left: 4px solid #c62828;
}
.costos-kpi-card.costos-saldo-kpi-neg .kpi-value {
  color: #c62828;
}
.costos-kpi-card.costos-saldo-kpi-pos {
  border-left: 4px solid #2e7d32;
}
.costos-kpi-card.costos-saldo-kpi-pos .kpi-value {
  color: #2e7d32;
}

/* Flujo financiero */
.flujo-th-mes { background: #eceff1 !important; color: #1f2933 !important; text-align: center; }
.flujo-th-ing { background: #2e7d32 !important; color: #fff !important; text-align: center; }
.flujo-th-eg { background: #c62828 !important; color: #fff !important; text-align: center; }
.flujo-th-res { background: #1565c0 !important; color: #fff !important; text-align: center; }
.flujo-cell-proy { background: #fff3e0 !important; color: #e65100 !important; font-weight: 600; }
.flujo-cell-neg { color: #c62828 !important; font-weight: 600; }
.flujo-cell-total { background: #eceff1 !important; font-weight: 700; }
.flujo-row-total td { background: #eceff1; font-weight: 700; }
.flujo-legend { display: inline-block; padding: 2px 8px; border-radius: 6px; font-size: 0.82rem; margin-right: 8px; }
.flujo-legend-real { background: #e3f2fd; }
.flujo-legend-proy { background: #fff3e0; color: #e65100; }
.flujo-kpi-row { min-width: 0; }
.flujo-metric { border-radius: 8px; overflow: hidden; border: 1px solid #dde5df; margin-bottom: 4px; height: 100%; }
.flujo-metric-label { font-size: 12px; padding: 6px 10px; font-weight: 600; color: #fff; line-height: 1.3; }
.flujo-metric-value {
  font-size: clamp(0.95rem, 2.5vw, 1.35rem);
  font-weight: 600;
  padding: 8px 10px 10px;
  color: #1f2933;
  line-height: 1.2;
  word-break: break-word;
}
.flujo-metric-ing .flujo-metric-label { background: #2e7d32; }
.flujo-metric-eg .flujo-metric-label { background: #c62828; }
.flujo-metric-res .flujo-metric-label { background: #1565c0; }
.flujo-tabla-principal table { font-size: 0.88rem; }
.flujo-tabla-principal th, .flujo-tabla-principal td { text-align: right; }
.flujo-tabla-principal th:first-child, .flujo-tabla-principal td:first-child { text-align: center; }

/* Móvil / iPhone — sidebar oculta; dashboard como demo */
@media (max-width: 991.98px) {
  .demo-main {
    margin-left: 0 !important;
  }

  .demo-body {
    overflow-x: hidden;
  }

  .dashboard-page.container-fluid {
    padding-left: 0.75rem !important;
    padding-right: 0.75rem !important;
  }

  .logo-sidebar {
    max-width: 200px;
    max-height: 96px;
  }

  .dashboard-page .banner-econ {
    font-size: clamp(0.75rem, 3.2vw, 0.92rem);
    line-height: 1.45;
    word-wrap: break-word;
  }

  .dashboard-page .dashboard-kpi-grid,
  .dashboard-kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .dashboard-page .dashboard-cc-header {
    display: none;
  }

  .dashboard-page .dashboard-fila-cc {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: auto auto auto;
    gap: 0.35rem 0.5rem;
    align-items: start;
    padding: 0.65rem 0.75rem;
  }

  .dashboard-page .dashboard-fila-cc .etiqueta {
    grid-column: 1 / -1;
    font-weight: 700;
    font-size: 0.88rem;
    line-height: 1.25;
    word-break: break-word;
    padding-bottom: 0.25rem;
    border-bottom: 1px dashed var(--borde);
  }

  .dashboard-page .dashboard-fila-cc .monto {
    grid-column: 1 / -1;
    text-align: left !important;
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 0.5rem;
    white-space: normal;
    font-size: 0.9rem;
  }

  .dashboard-page .dashboard-fila-cc .monto::before {
    content: "Total";
    font-size: 0.68rem;
    font-weight: 700;
    color: #546e7a;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    flex-shrink: 0;
  }

  .dashboard-page .dashboard-fila-cc .metrica {
    white-space: normal;
    font-size: 0.78rem;
    text-align: center !important;
    min-width: 0;
  }

  .dashboard-page .dashboard-fila-cc .metrica.avance::before {
    content: "Avance";
    display: block;
    font-size: 0.62rem;
    font-weight: 700;
    color: #546e7a;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    margin-bottom: 0.12rem;
  }

  .dashboard-page .dashboard-fila-cc .metrica.usd-kg::before {
    content: "USD/kg";
    display: block;
    font-size: 0.62rem;
    font-weight: 700;
    color: #546e7a;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    margin-bottom: 0.12rem;
  }

  .dashboard-page .dashboard-fila-cc .badge-costos {
    padding: 0.2rem 0.3rem;
    font-size: 0.74rem;
    min-width: 0;
    width: 100%;
    box-sizing: border-box;
  }
}

@media (max-width: 1280px) {
  .dashboard-page .dashboard-kpi-grid,
  .dashboard-kpi-grid {
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 9.5rem), 1fr));
  }
}

@media (max-width: 960px) {
  .dashboard-page .dashboard-kpi-grid,
  .dashboard-kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* Visor PDF (iPhone / iPad) */
.demo-main:has(.erp-pdf-viewer-shell) {
  padding: 0 !important;
  margin-left: 0 !important;
  display: flex;
  flex-direction: column;
  min-height: calc(100vh - 56px);
}

.erp-pdf-viewer-shell {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: calc(100vh - 56px);
  background: #eceff1;
}

.erp-pdf-viewer-bar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.55rem 0.75rem;
  background: #fff;
  border-bottom: 1px solid #dee2e6;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  flex-shrink: 0;
  z-index: 2;
}

.erp-pdf-back-btn {
  flex-shrink: 0;
  font-weight: 600;
  white-space: nowrap;
}

.erp-pdf-viewer-title {
  flex: 1;
  min-width: 0;
  font-size: 0.82rem;
  font-weight: 600;
  color: #37474f;
}

.erp-pdf-share-btn {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-weight: 700;
  min-width: 2.5rem;
  justify-content: center;
}

.erp-pdf-share-icon {
  display: inline-block;
  font-size: 1.15rem;
  line-height: 1;
  transform: translateY(-1px);
}

.erp-pdf-viewer-frame {
  flex: 1 1 auto;
  width: 100%;
  border: 0;
  min-height: 0;
  background: #525659;
}

/* iOS: iframe trunca PDF multi-página; object suele funcionar mejor en desktop */
.erp-pdf-viewer-object {
  display: none;
}

@media (min-width: 768px) {
  .erp-pdf-viewer-iframe {
    display: block;
  }
}

body.erp-ios .erp-pdf-viewer-iframe {
  display: none;
}

body.erp-ios .erp-pdf-viewer-object {
  display: block;
}

.erp-pdf-rows-hint {
  white-space: nowrap;
}

.erp-pdf-viewer-hint {
  margin: 0;
  padding: 0.45rem 0.75rem 0.65rem;
  font-size: 0.72rem;
  color: #546e7a;
  background: #f8faf9;
  border-top: 1px solid #e0e0e0;
  line-height: 1.35;
  text-align: center;
}

/* Bitácora salida petróleo (QR, móvil) */
.salida-petroleo-body {
  margin: 0;
  min-height: 100dvh;
  background: linear-gradient(160deg, #e8f5e9 0%, #f4f7f6 45%, #fff 100%);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: #1f2933;
}

.salida-petroleo-page {
  max-width: 420px;
  margin: 0 auto;
  padding: 1.25rem 1rem 2rem;
}

.salida-petroleo-header {
  text-align: center;
  margin-bottom: 1.25rem;
}

.salida-petroleo-icon {
  font-size: 2.5rem;
  line-height: 1;
  margin-bottom: 0.35rem;
}

.salida-petroleo-header h1 {
  font-size: 1.45rem;
  font-weight: 800;
  color: #1b5e20;
  margin: 0 0 0.25rem;
}

.salida-petroleo-header p {
  margin: 0;
  font-size: 0.9rem;
  color: #5f6b7a;
}

.salida-petroleo-estanque {
  background: var(--alert-roja-bg, #ffebee);
  border: 2px solid var(--alert-roja-border, #ef9a9a);
  border-radius: 12px;
  padding: 1rem 1rem 0.9rem;
  text-align: center;
}

.salida-petroleo-estanque-kicker {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--alert-roja-text, #b71c1c);
}

.salida-petroleo-estanque-valor {
  font-size: 2rem;
  font-weight: 800;
  line-height: 1.15;
  color: #c62828;
  margin: 0.2rem 0;
  letter-spacing: -0.02em;
}

.salida-petroleo-estanque-meta {
  font-size: 0.8rem;
  color: #8d6e63;
}

.salida-petroleo-form .form-label {
  font-weight: 700;
  font-size: 0.88rem;
  margin-top: 0.75rem;
  margin-bottom: 0.25rem;
}

.salida-petroleo-form .form-control-lg {
  font-size: 1.1rem;
  padding: 0.65rem 0.85rem;
  border-radius: 10px;
}

.salida-petroleo-submit {
  margin-top: 1.35rem;
  font-weight: 800;
  padding: 0.75rem;
  border-radius: 12px;
}

.salida-petroleo-ok {
  background: #e8f5e9;
  border: 1px solid #a5d6a7;
  border-radius: 12px;
  padding: 0.85rem 1rem;
  margin-bottom: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  color: #1b5e20;
}

.salida-petroleo-foot {
  margin-top: 1.25rem;
  font-size: 0.78rem;
  color: #78909c;
  text-align: center;
  line-height: 1.45;
}

.salida-petroleo-honeypot {
  position: absolute;
  left: -9999px;
  height: 0;
  overflow: hidden;
}

.salida-petroleo-qr-page .salida-petroleo-qr-img {
  max-width: 100%;
  height: auto;
  border: 1px solid #dde5df;
  border-radius: 12px;
}

.salida-petroleo-cuarteles {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.45rem;
  background: #fafcfa;
  border: 1px solid #dde5df;
  border-radius: 10px;
  padding: 0.65rem 0.75rem;
}

.salida-petroleo-cc-chip {
  display: flex;
  align-items: flex-start;
  gap: 0.45rem;
  margin: 0;
  padding: 0.55rem 0.6rem;
  border: 1px solid #c5d6cb;
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
  min-height: 2.75rem;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.salida-petroleo-cc-chip .form-check-input {
  flex-shrink: 0;
  margin-top: 0.15rem;
}

.salida-petroleo-cc-label {
  font-size: 0.84rem;
  font-weight: 600;
  line-height: 1.25;
  word-break: break-word;
}

.salida-petroleo-cc-chip:has(input:checked) {
  border-color: #2e7d32;
  background: #e8f5e9;
}

.salida-petroleo-cc-chip:has(input:focus-visible) {
  outline: 2px solid rgba(46, 125, 50, 0.35);
  outline-offset: 1px;
}

.salida-petroleo-submit:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.salida-petroleo-body.salida-petroleo-exito {
  background: #2e7d32 !important;
  transition: background 0.35s ease;
}

.salida-petroleo-body.salida-petroleo-exito .salida-petroleo-page {
  color: #fff;
}

.salida-petroleo-body.salida-petroleo-exito .salida-petroleo-header h1,
.salida-petroleo-body.salida-petroleo-exito .salida-petroleo-header p {
  color: #fff;
}

.salida-petroleo-ok-flash {
  background: rgba(255, 255, 255, 0.15) !important;
  border-color: rgba(255, 255, 255, 0.45) !important;
  color: #fff !important;
  text-align: center;
  padding: 1.5rem 1rem !important;
  font-size: 1.05rem;
}

.salida-petroleo-ok-flash strong {
  display: block;
  font-size: 1.35rem;
  margin-bottom: 0.35rem;
}

.salida-petroleo-recarga-hint {
  display: block;
  margin-top: 0.75rem;
  font-size: 0.82rem;
  opacity: 0.9;
}

/* Registro riego link — pantalla azul al confirmar (como petróleo) */
.registro-riego-body.registro-riego-exito {
  background: #1565c0 !important;
  transition: background 0.35s ease;
}

.registro-riego-body.registro-riego-exito .salida-petroleo-page {
  color: #fff;
}

.registro-riego-body.registro-riego-exito .salida-petroleo-header h1,
.registro-riego-body.registro-riego-exito .salida-petroleo-header p {
  color: #fff;
}

.registro-riego-fert-block {
  margin-top: 1rem;
}

.registro-riego-fert-kicker {
  margin: 0;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #1565c0;
}

.registro-riego-fert-toggle {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  margin: 0;
  padding: 0.85rem 0.95rem;
  border: 2px solid #90caf9;
  border-radius: 12px;
  background: linear-gradient(135deg, #e3f2fd 0%, #f5fbff 100%);
  cursor: pointer;
  min-height: 4.25rem;
  box-shadow: 0 2px 8px rgba(21, 101, 192, 0.12);
  transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.registro-riego-fert-toggle .form-check-input {
  flex-shrink: 0;
  width: 1.35rem;
  height: 1.35rem;
  margin-top: 0.15rem;
  border-width: 2px;
  cursor: pointer;
}

.registro-riego-fert-toggle-body {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.registro-riego-fert-toggle-title {
  font-size: 1.05rem;
  font-weight: 800;
  line-height: 1.25;
  color: #0d47a1;
}

.registro-riego-fert-toggle-hint {
  font-size: 0.82rem;
  line-height: 1.35;
  color: #546e7a;
}

.registro-riego-fert-toggle:has(input:checked) {
  border-color: #1565c0;
  background: linear-gradient(135deg, #bbdefb 0%, #e3f2fd 100%);
  box-shadow: 0 3px 12px rgba(21, 101, 192, 0.22);
}

.registro-riego-fert-toggle:has(input:checked) .registro-riego-fert-toggle-title {
  color: #0d47a1;
}

.registro-riego-fert-toggle:has(input:focus-visible) {
  outline: 2px solid rgba(21, 101, 192, 0.45);
  outline-offset: 2px;
}

.riego-links-demo .riego-link-demo-row td,
.riego-links-demo .js-link-personal {
  opacity: 0.38;
}

.riego-links-demo .js-link-personal {
  background-color: rgba(248, 249, 250, 0.6);
  color: #6c757d;
}

.riego-links-demo .btn {
  opacity: 0.45;
}

/* Petróleo — salida manual (formulario ordenado) */
.petroleo-salida-manual .panel-title { margin-bottom: 0; }
.petroleo-salida-fieldset {
  border: 0;
  margin: 0;
  padding: 0;
  min-width: 0;
}
.petroleo-salida-manual .form-label {
  font-weight: 600;
  color: #37474F;
  margin-bottom: 0.35rem;
}
.petroleo-salida-manual .form-control-lg,
.petroleo-salida-manual .form-select-lg {
  font-size: 1rem;
  min-height: 2.75rem;
}
.petroleo-pmp-pill {
  background: #E3F2FD;
  color: #0D47A1;
  border: 1px solid #90CAF9;
  border-radius: 999px;
  padding: 0.35rem 0.85rem;
  white-space: nowrap;
}
.petroleo-salida-manual .salida-petroleo-cuarteles {
  margin-top: 0.25rem;
}

/* Sesión por inactividad — modal centrado (oculto hasta aviso) */
.session-idle-overlay {
  position: fixed;
  inset: 0;
  z-index: 4000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
  background: rgba(18, 28, 40, 0.55);
  backdrop-filter: blur(3px);
}
.session-idle-overlay.is-open {
  display: flex;
}
.session-idle-card {
  width: min(420px, 100%);
  background: #fffaf3;
  border: 1px solid rgba(40, 52, 68, 0.16);
  border-radius: 4px;
  box-shadow: 0 18px 40px rgba(18, 28, 40, 0.28);
  padding: 1.35rem 1.3rem 1.2rem;
  color: #1f2a36;
}
.session-idle-card h2 {
  margin: 0 0 0.45rem;
  font-size: 1.2rem;
  font-weight: 800;
  color: #163a5f;
}
.session-idle-card p {
  margin: 0 0 0.85rem;
  color: #5b6b7c;
  font-size: 0.95rem;
  line-height: 1.4;
}
.session-idle-count {
  display: inline-block;
  min-width: 3.2rem;
  font-weight: 800;
  color: #9a4d12;
  font-variant-numeric: tabular-nums;
}
.session-idle-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
}
.session-idle-actions button {
  border-radius: 2px;
  font-weight: 700;
  font-size: 0.82rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.65rem 1rem;
  cursor: pointer;
  border: 1px solid transparent;
}
.session-idle-continue {
  background: #243546;
  border-color: #243546;
  color: #f4f1ea;
  flex: 1 1 auto;
}
.session-idle-continue:hover {
  background: #1a2734;
}
.session-idle-logout {
  background: transparent;
  border-color: rgba(40, 52, 68, 0.35);
  color: #243546;
}
.session-idle-logout:hover {
  background: rgba(40, 52, 68, 0.06);
}

/* ===== Planes (flyers) — incluido en erp.css para carga garantizada ===== */
/* Planes — tarjetas comparativas */
.planes-pricing {
  --plan-ink: #12263f;
  --plan-muted: #5b6b7c;
  --plan-line: #d7e0ea;
  --plan-teal: #0f8fa8;
  --plan-teal-deep: #0f4c5c;
  --plan-amber: #f0a202;
  --plan-ok: #2e7d32;
  --plan-no: #b0bec5;
  max-width: 1100px;
  margin: 0 auto;
  padding: 0.5rem 0.75rem 2rem;
}

.demo-main:has(.planes-pricing) {
  padding: 1rem 1.15rem 2rem;
}

.planes-pricing-head {
  text-align: center;
  margin-bottom: 1.5rem;
}
.planes-pricing-head h1 {
  margin: 0 0 .45rem;
  font-size: clamp(1.85rem, 2.8vw, 2.4rem);
  font-weight: 800;
  color: var(--plan-ink);
  letter-spacing: -0.02em;
}
.planes-pricing-head p {
  margin: 0 auto;
  max-width: 36rem;
  color: var(--plan-muted);
  font-size: 1.02rem;
  line-height: 1.5;
}

.planes-cards {
  display: grid;
  grid-template-columns: 1fr 1.08fr;
  gap: 1.15rem;
  align-items: stretch;
  margin: 0 auto 1.75rem;
  max-width: 860px;
}
.planes-cards.planes-cards-3,
.planes-cards.planes-cards-4 {
  grid-template-columns: 1fr 1fr;
  max-width: 920px;
  gap: 1rem;
}
@media (max-width: 820px) {
  .planes-cards.planes-cards-3,
  .planes-cards.planes-cards-4 { grid-template-columns: 1fr; max-width: 420px; }
  .planes-cards.planes-cards-4 .plan-card-featured { order: -1; }
}
@media (max-width: 820px) {
  .planes-cards { grid-template-columns: 1fr; max-width: 420px; }
  .plan-card-featured { order: -1; }
}
.plan-card-pack-ventas {
  border-color: #2f6fed;
  box-shadow: 0 10px 28px rgba(47, 111, 237, 0.12);
}
.plan-card-pack-ventas .plan-card-icon {
  background: rgba(47, 111, 237, 0.12);
  color: #2f6fed;
}
.plan-card-badge-mid {
  background: #2f6fed;
}
.plan-card-pack-compras {
  border-color: #0f8fa8;
  box-shadow: 0 10px 28px rgba(15, 143, 168, 0.12);
}
.plan-card-pack-compras .plan-card-icon {
  background: rgba(15, 143, 168, 0.12);
  color: #0f8fa8;
}
.plan-card-badge-compras {
  background: #0f8fa8;
}

.plan-card {
  position: relative;
  display: flex;
  flex-direction: column;
  background: #fff;
  border: 1px solid var(--plan-line);
  border-radius: 18px;
  padding: 1.35rem 1.35rem 1.2rem;
  box-shadow: 0 10px 28px rgba(18, 38, 63, .08);
}
.plan-card-featured {
  border-color: rgba(240, 162, 2, .55);
  box-shadow: 0 16px 36px rgba(15, 76, 92, .16);
  transform: translateY(-6px);
  background:
    linear-gradient(#fff, #fff) padding-box,
    linear-gradient(160deg, rgba(240,162,2,.55), rgba(15,143,168,.45)) border-box;
  border: 2px solid transparent;
}
@media (max-width: 820px) {
  .plan-card-featured { transform: none; }
}

.plan-card-badge {
  position: absolute;
  top: -0.65rem;
  left: 50%;
  transform: translateX(-50%);
  background: linear-gradient(135deg, #f0a202, #0f8fa8);
  color: #fff;
  font-size: .68rem;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
  padding: .28rem .7rem;
  border-radius: 999px;
  white-space: nowrap;
}

.plan-card-top {
  text-align: center;
  padding: .35rem 0 1rem;
  border-bottom: 1px solid #eef3f6;
  margin-bottom: .85rem;
}
.plan-card-icon {
  width: 3.1rem;
  height: 3.1rem;
  margin: 0 auto .65rem;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 1.45rem;
  background: #e0f7fa;
  color: var(--plan-teal-deep);
}
.plan-card-pack .plan-card-icon {
  background: #fff3cd;
  color: #7a4e00;
}
.plan-card h2 {
  margin: 0 0 .55rem;
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: .06em;
  color: var(--plan-ink);
}
.plan-card-price {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: center;
  gap: .25rem .35rem;
  color: var(--plan-teal-deep);
}
.plan-card-price strong {
  font-size: 2.15rem;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.02em;
}
.plan-card-from,
.plan-card-period {
  font-size: .9rem;
  font-weight: 700;
  color: var(--plan-muted);
}
.plan-card-note {
  margin: .45rem 0 0;
  font-size: .86rem;
  color: var(--plan-muted);
  font-weight: 600;
}

.plan-card-features {
  list-style: none;
  margin: 0;
  padding: 0 0 .25rem;
  flex: 1;
}
.plan-card-features li {
  display: flex;
  align-items: flex-start;
  gap: .55rem;
  margin: 0 0 .55rem;
  font-size: .9rem;
  line-height: 1.35;
  color: #3d4d5c;
}
.plan-card-features li i {
  flex: 0 0 auto;
  margin-top: .1rem;
  font-size: 1rem;
  font-weight: 800;
}
.plan-card-features li.ok i { color: var(--plan-ok); }
.plan-card-features li.no {
  color: #90a4ae;
}
.plan-card-features li.no i { color: var(--plan-no); }

.plan-card-foot {
  margin-top: auto;
  padding-top: .85rem;
}
.plan-card-cta {
  display: block;
  text-align: center;
  text-decoration: none;
  font-weight: 800;
  letter-spacing: .03em;
  text-transform: uppercase;
  font-size: .88rem;
  padding: .85rem 1rem;
  border-radius: 999px;
  color: #fff;
  background: linear-gradient(135deg, #0f8fa8, #0f4c5c);
  box-shadow: 0 8px 18px rgba(15, 143, 168, .28);
  transition: transform .15s ease, box-shadow .15s ease;
}
.plan-card-cta:hover {
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 10px 22px rgba(15, 143, 168, .35);
}
.plan-card-pack .plan-card-cta {
  background: linear-gradient(135deg, #f0a202, #0f8fa8);
  box-shadow: 0 8px 18px rgba(240, 162, 2, .28);
}

.planes-mod-prices {
  max-width: 560px;
  margin: 0 auto 1.25rem;
  background: #fff;
  border: 1px solid var(--plan-line);
  border-radius: 14px;
  padding: 1rem 1.2rem;
}
.planes-mod-prices h2 {
  margin: 0 0 .75rem;
  font-size: 1rem;
  font-weight: 800;
  color: var(--plan-ink);
}
.planes-mod-price-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.planes-mod-price-list li {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: .45rem 0;
  border-top: 1px solid #eef3f6;
  font-size: .92rem;
  color: #3d4d5c;
}
.planes-mod-price-list li:first-child { border-top: 0; }
.planes-mod-price-list .mod-fee {
  font-weight: 800;
  color: var(--plan-teal-deep);
  white-space: nowrap;
}
.planes-mod-price-list .mod-total,
.planes-mod-price-list .mod-setup {
  font-weight: 700;
  color: var(--plan-ink);
}

.planes-detail {
  max-width: 860px;
  margin: 0 auto 1rem;
  border: 1px solid var(--plan-line);
  border-radius: 12px;
  background: #fff;
  padding: .35rem .9rem .9rem;
}
.planes-detail summary {
  cursor: pointer;
  font-weight: 800;
  color: var(--plan-teal-deep);
  padding: .65rem 0;
  list-style-position: outside;
}
.planes-detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: .75rem;
  margin-top: .35rem;
}
.planes-detail-card {
  border: 1px solid #e6edf3;
  border-radius: 10px;
  padding: .8rem .9rem;
  background: #fafcfd;
}
.planes-detail-card h3 {
  margin: 0 0 .45rem;
  font-size: .95rem;
  font-weight: 800;
  color: var(--plan-ink);
}
.planes-detail-card h3 small {
  display: block;
  margin-top: .15rem;
  font-size: .8rem;
  font-weight: 800;
  color: var(--plan-teal-deep);
}
.planes-detail-card ul {
  margin: 0;
  padding-left: 1.05rem;
  font-size: .82rem;
  color: #3d4d5c;
  line-height: 1.4;
}
.planes-detail-card li { margin: .18rem 0; }
.planes-func-strong { font-weight: 800; color: var(--plan-teal-deep); }

.planes-legal {
  max-width: 860px;
  margin: 1rem auto 0;
  padding-top: .85rem;
  border-top: 1px solid var(--plan-line);
  font-size: .85rem;
  color: var(--plan-muted);
  line-height: 1.45;
  text-align: center;
}


/* Planes — tarjetas por módulo (misma interfaz) */
.planes-modulos-block {
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid #d7e0ea;
}
.planes-modulos-head h2 {
  margin: 0 0 .45rem;
  font-size: clamp(1.35rem, 2.2vw, 1.75rem);
  font-weight: 800;
  color: #12263f;
  letter-spacing: -0.02em;
}
.planes-mod-cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  margin: 0 auto 1rem;
}
@media (max-width: 980px) {
  .planes-mod-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .planes-mod-cards { grid-template-columns: 1fr; max-width: 420px; }
}
.plan-card-modulo {
  transform: none;
  padding: 1.15rem 1.15rem 1rem;
}
.plan-card-modulo .plan-card-top {
  padding-bottom: .85rem;
  margin-bottom: .7rem;
}
.plan-card-modulo h2 {
  font-size: .92rem;
}
.plan-card-modulo .plan-card-price strong {
  font-size: 1.55rem;
}
.plan-card-incluido-txt {
  font-size: 1.35rem !important;
  color: #0f4c5c;
}
.plan-card-incluido {
  background: #fafcfd;
}
.plan-card-modulo .plan-card-features li {
  font-size: .84rem;
  margin-bottom: .42rem;
}
.plan-feat-strong {
  color: #0f4c5c !important;
}
.planes-mod-summary {
  text-align: center;
  margin: .5rem 0 0;
  font-size: .92rem;
  color: #5b6b7c;
}
.planes-mod-summary strong {
  color: #0f4c5c;
}

/* Página Planes más presente */
.page-head:has(+ .planes-hero) h1,
body:has(.planes-hero) .page-head h1 {
  font-size: clamp(1.75rem, 2.4vw, 2.15rem);
  font-weight: 800;
  color: #0f4c5c;
}
.planes-pack {
  padding: 1.55rem 1.65rem;
  border: 1px solid rgba(255,232,163,.35);
  box-shadow: 0 10px 28px rgba(15, 76, 92, .18);
}
.planes-pack .big { font-size: 2.35rem; }
.planes-pack h2 { font-size: 1.45rem; }

.planes-pack-extra {
  margin-top: .35rem;
  font-size: .95rem;
  letter-spacing: .01em;
}
.planes-legal {
  border-top: 1px solid #d7e0ea;
  padding-top: .85rem;
  line-height: 1.45;
}
.planes-func-strong { font-weight: 800; color: #0f4c5c; }



/* Agrícola — 5 planes + historia Costos + Pack Oficina */
.planes-cards.planes-cards-5 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  max-width: 1100px;
  gap: 1rem;
}
@media (min-width: 1100px) {
  .planes-cards.planes-cards-5 {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }
  .planes-cards.planes-cards-5 .plan-card {
    padding: 1.1rem 0.95rem 1rem;
  }
  .planes-cards.planes-cards-5 .plan-card-price strong {
    font-size: 1.55rem;
  }
  .planes-cards.planes-cards-5 .plan-card-features li {
    font-size: .8rem;
  }
}
@media (max-width: 820px) {
  .planes-cards.planes-cards-5 {
    grid-template-columns: 1fr;
    max-width: 420px;
  }
  .planes-cards.planes-cards-5 .plan-card-featured { order: -1; }
}

.planes-story {
  max-width: 860px;
  margin: 0 auto 1.75rem;
  padding: 1.25rem 1.35rem 1.15rem;
  border-radius: 16px;
  border: 1px solid rgba(15, 76, 92, .18);
  background:
    linear-gradient(135deg, rgba(15, 143, 168, .08), rgba(240, 162, 2, .1)),
    #fff;
  box-shadow: 0 10px 28px rgba(18, 38, 63, .06);
  text-align: left;
  position: relative;
}
.planes-story-badge {
  display: inline-block;
  font-size: .68rem;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: #0f4c5c;
  background: rgba(15, 143, 168, .14);
  padding: .22rem .55rem;
  border-radius: 6px;
  margin-bottom: .55rem;
}
.planes-story h2 {
  margin: 0 0 .55rem;
  font-size: clamp(1.2rem, 2vw, 1.45rem);
  font-weight: 800;
  color: #12263f;
  letter-spacing: -0.02em;
}
.planes-story h2 strong {
  color: #0f4c5c;
}
.planes-story p {
  margin: 0 0 .55rem;
  color: #3d4d5c;
  font-size: .96rem;
  line-height: 1.5;
}
.planes-story-foot {
  margin-bottom: 0 !important;
  color: #0f4c5c !important;
  font-weight: 600;
}

.plan-card-pack-campo {
  border-color: #2e7d32;
  box-shadow: 0 10px 28px rgba(46, 125, 50, 0.12);
}
.plan-card-pack-campo .plan-card-icon {
  background: rgba(46, 125, 50, 0.12);
  color: #2e7d32;
}
.plan-card-badge-campo { background: #2e7d32; }

.plan-card-pack-patio {
  border-color: #0f8fa8;
  box-shadow: 0 10px 28px rgba(15, 143, 168, 0.12);
}
.plan-card-pack-patio .plan-card-icon {
  background: rgba(15, 143, 168, 0.12);
  color: #0f8fa8;
}
.plan-card-badge-patio { background: #0f8fa8; }

.plan-card-pack-oficina {
  border-color: rgba(240, 162, 2, .55);
}
.plan-card-pack-oficina .plan-card-icon {
  background: #fff3cd;
  color: #7a4e00;
}
.plan-card-badge-oficina {
  background: linear-gradient(135deg, #f0a202, #0f8fa8);
}
.plan-card-badge-full {
  background: #12263f;
}

.plan-card-eje {
  border-color: rgba(240, 162, 2, .5);
  box-shadow: 0 12px 28px rgba(240, 162, 2, .14);
}
.plan-card-eje .plan-card-icon {
  background: #fff3cd;
  color: #7a4e00;
}
.plan-card-badge-eje {
  background: linear-gradient(135deg, #f0a202, #0f4c5c);
}

.planes-iva-note {
  margin: 0.65rem 0 0;
  padding: 0.55rem 0.85rem;
  display: inline-block;
  background: rgba(15, 76, 92, 0.08);
  border: 1px solid rgba(15, 76, 92, 0.18);
  border-radius: 10px;
  color: #0f4c5c;
  font-size: 0.95rem;
}


.planes-trust-note {
  margin: 0.75rem 0 0;
  padding: 0.7rem 0.95rem;
  display: inline-block;
  background: rgba(15, 76, 92, 0.08);
  border-left: 4px solid #0f4c5c;
  border-radius: 10px;
  color: #0f4c5c;
  font-weight: 800;
  font-size: 1.05rem;
  line-height: 1.35;
}

/* Layout Planes con sidebar fijo (evita columnas aplastadas) */
body.demo-body.planes-page {
  font-family: "Manrope", system-ui, -apple-system, "Segoe UI", sans-serif;
}
body.demo-body.planes-page .demo-main {
  padding: 1rem 1.15rem 2.5rem;
}
body.demo-body.planes-page .planes-pricing {
  max-width: none;
  width: 100%;
}
body.demo-body.planes-page .planes-cards.planes-cards-5 {
  grid-template-columns: 1fr;
  max-width: 420px;
}
@media (min-width: 768px) {
  body.demo-body.planes-page .planes-cards.planes-cards-5 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    max-width: none;
  }
}
@media (min-width: 1200px) {
  body.demo-body.planes-page .planes-cards.planes-cards-5 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
@media (min-width: 1600px) {
  body.demo-body.planes-page .planes-cards.planes-cards-5 {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }
}

/* GlobalGAP — tablero Gantt */
.gap-gantt-hero {
  border-left: 4px solid #163A5F;
  background: linear-gradient(180deg, #f5f8fc 0%, #ffffff 55%);
}
.gap-timeline-track {
  position: relative;
  height: 14px;
  border-radius: 999px;
  background: #e8eef5;
  overflow: hidden;
}
.gap-timeline-cosecha {
  position: absolute;
  top: 0;
  bottom: 0;
  background: rgba(15, 143, 168, 0.35);
  border-radius: 999px;
}
.gap-timeline-today {
  position: absolute;
  top: -2px;
  bottom: -2px;
  width: 3px;
  margin-left: -1px;
  background: #c62828;
  border-radius: 2px;
}
.gap-cosecha-chip {
  display: inline-block;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  background: #e0f7fa;
  color: #006064;
  font-weight: 700;
}
.gap-mod-card {
  display: block;
  text-decoration: none;
  color: inherit;
  border: 1px solid #e0e6ee;
  border-radius: 12px;
  padding: 0.75rem 0.85rem;
  background: #fff;
  height: 100%;
  transition: border-color .15s ease, transform .15s ease;
}
.gap-mod-card:hover {
  border-color: #0F8FA8;
  transform: translateY(-1px);
  color: inherit;
}
.gap-mod-pct {
  font-weight: 800;
  color: #163A5F;
}
.gap-mod-progress {
  height: 8px;
  background: #eef2f7;
  margin: 0.4rem 0 0.35rem;
}
.gap-mod-card.tone-ok .progress-bar { background: #2e7d32; }
.gap-mod-card.tone-mid .progress-bar { background: #0F8FA8; }
.gap-mod-card.tone-low .progress-bar { background: #ef6c00; }
.gap-mod-card.tone-warn .progress-bar { background: #c62828; }
.gap-gantt-chart {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}
.gap-gantt-row {
  display: grid;
  grid-template-columns: minmax(180px, 1.2fr) minmax(220px, 2.4fr) minmax(90px, 0.7fr);
  gap: 0.65rem;
  align-items: center;
}
.gap-gantt-label {
  min-width: 0;
}
.gap-gantt-lane {
  position: relative;
  height: 28px;
  background: #f3f6fa;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid #e4ebf2;
}
.gap-gantt-cosecha-band {
  position: absolute;
  top: 0;
  bottom: 0;
  background: rgba(15, 143, 168, 0.12);
}
.gap-gantt-today-line {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 2px;
  background: #c62828;
  z-index: 2;
}
.gap-gantt-bar {
  position: absolute;
  top: 5px;
  height: 18px;
  border-radius: 6px;
  background: #c5d0dc;
  overflow: hidden;
  min-width: 8px;
  z-index: 1;
}
.gap-gantt-bar .gap-gantt-fill {
  display: block;
  height: 100%;
  background: #163A5F;
}
.gap-gantt-bar.tone-ok .gap-gantt-fill { background: #2e7d32; }
.gap-gantt-bar.tone-warn .gap-gantt-fill { background: #ef6c00; }
.gap-gantt-bar.tone-bad .gap-gantt-fill { background: #c62828; }
.gap-gantt-bar.tone-neutral .gap-gantt-fill { background: #0F8FA8; }
.gap-gantt-bar-txt {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.68rem;
  font-weight: 800;
  color: #fff;
  text-shadow: 0 1px 1px rgba(0, 0, 0, .25);
}
.gap-gantt-meta {
  text-align: right;
  line-height: 1.25;
  color: #455a64;
}
.gap-legend {
  display: inline-block;
  margin-left: 0.45rem;
  padding: 0.1rem 0.45rem;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.72rem;
}
.gap-legend.ok { background: #e8f5e9; color: #2e7d32; }
.gap-legend.warn { background: #fff3e0; color: #ef6c00; }
.gap-legend.bad { background: #ffebee; color: #c62828; }
.gap-legend.cos { background: #e0f7fa; color: #006064; }
@media (max-width: 900px) {
  .gap-gantt-row {
    grid-template-columns: 1fr;
  }
  .gap-gantt-meta {
    text-align: left;
    display: flex;
    gap: 0.75rem;
  }
}

/* GlobalGAP panel — estilo Comercial (Río Maipo) */
body.gap-comercial-page main.demo-main {
  background: #eef2f7;
}
.gap-comercial-wrap {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0.25rem 0 1rem;
}
.gap-comercial-wrap .page-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1rem;
}
.gap-comercial-wrap .page-head h1 {
  margin: 0;
  font-size: 1.55rem;
  font-weight: 800;
  color: #163a5f;
}
.gap-comercial-wrap .page-head p {
  margin: 0.25rem 0 0;
  color: #5b6b7c;
  font-size: 0.9rem;
}
.gap-comercial-wrap .panel {
  background: #fff;
  border: 1px solid #d7e0ea;
  border-radius: 12px;
  padding: 1rem;
  box-shadow: 0 8px 24px rgba(22, 58, 95, 0.06);
  margin-bottom: 0;
}
.gap-comercial-wrap .kpi-grid,
.gap-comercial-wrap .kpi-grid.kpi-grid-6 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.65rem;
  margin-bottom: 1rem;
}
@media (min-width: 992px) {
  .gap-comercial-wrap .kpi-grid.kpi-grid-6 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
.gap-comercial-wrap .kpi {
  border-radius: 12px;
  padding: 0.85rem 0.95rem;
  color: #fff;
  min-height: 88px;
  box-shadow: 0 8px 22px rgba(22, 58, 95, 0.12);
}
.gap-comercial-wrap .kpi .label {
  font-size: 0.78rem;
  font-weight: 700;
  opacity: 0.95;
}
.gap-comercial-wrap .kpi .value {
  font-size: 1.12rem;
  font-weight: 800;
  margin-top: 0.35rem;
}
.gap-comercial-wrap .kpi .hint {
  font-size: 0.78rem;
  margin-top: 0.25rem;
  opacity: 0.9;
}
.gap-comercial-wrap .kpi.blue { background: linear-gradient(135deg, #1f4b99, #2f6fed); }
.gap-comercial-wrap .kpi.cyan { background: linear-gradient(135deg, #0f8fa8, #22b8cf); }
.gap-comercial-wrap .kpi.green { background: linear-gradient(135deg, #1f8a65, #2fbf71); }
.gap-comercial-wrap .kpi.orange { background: linear-gradient(135deg, #c46a12, #f0a202); }
.gap-comercial-wrap .kpi.kpi-info { background: linear-gradient(135deg, #1f4b99, #2f6fed); }
.gap-comercial-wrap a.kpi.gap-kpi-clientes-link {
  display: block;
  color: #fff;
  background: linear-gradient(135deg, #5b21b6, #8b5cf6);
}
.gap-comercial-wrap a.kpi:hover {
  color: #fff;
  filter: brightness(1.05);
}
.gap-comercial-wrap .gap-client-title {
  color: #163a5f;
}
.gap-comercial-wrap .gap-client-panel {
  border-left-width: 4px;
  border-left-style: solid;
}
.gap-comercial-wrap .gap-client-panel--blue { border-left-color: #2f6fed; }
.gap-comercial-wrap .gap-client-panel--cyan { border-left-color: #22b8cf; }
.gap-comercial-wrap .gap-client-panel--green { border-left-color: #2fbf71; }
.gap-comercial-wrap .gap-client-panel--orange { border-left-color: #f0a202; }
.gap-comercial-wrap .gap-ambito-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
}
.gap-comercial-wrap .gap-ambito-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 118px;
  padding: 0.55rem 0.45rem 0.5rem;
  background: #f8fafc;
  border: 1px solid #d7e0ea;
  border-radius: 10px;
  text-decoration: none;
  color: inherit;
  transition: transform 0.12s ease, box-shadow 0.12s ease, border-color 0.12s ease;
  position: relative;
}
.gap-comercial-wrap .gap-ambito-tile:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 14px rgba(22, 58, 95, 0.1);
  border-color: var(--client-accent, #2f6fed);
}
.gap-comercial-wrap .gap-ambito-csg {
  font-size: 0.58rem;
  font-weight: 700;
  color: var(--client-accent, #2f6fed);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.gap-comercial-wrap .gap-ambito-huerto {
  font-size: 0.72rem;
  font-weight: 700;
  color: #1a2b3c;
  margin-top: 0.15rem;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.gap-comercial-wrap .gap-ambito-esp {
  font-size: 0.62rem;
  color: #5b6b7c;
  margin-bottom: 0.35rem;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.gap-comercial-wrap .gap-ambito-donut-wrap {
  position: relative;
  width: 72px;
  height: 72px;
}
.gap-comercial-wrap .gap-ambito-donut-wrap canvas {
  width: 72px !important;
  height: 72px !important;
}
.gap-comercial-wrap .gap-ambito-donut-val {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.78rem;
  font-weight: 800;
  color: #163a5f;
  pointer-events: none;
}
.gap-comercial-wrap .gap-ambito-nc {
  position: absolute;
  top: 4px;
  right: 5px;
  font-size: 0.55rem;
  font-weight: 700;
  color: #c62828;
  background: #ffebee;
  border-radius: 3px;
  padding: 0 0.25rem;
  line-height: 1.35;
}

