:root {
  --red: #c8102e;
  --red-dark: #8f0d22;
  --black: #111111;
  --white: #ffffff;
  --gray-50: #f8f8f8;
  --gray-100: #f1f1f1;
  --gray-200: #dddddd;
  --gray-500: #666666;
  --gray-600: #4b5563;
  --gray-800: #222222;
  --ok: #0f766e;
  --warn: #b45309;
  --danger: #b91c1c;
  --shadow: 0 14px 40px rgba(0,0,0,.08);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;
  background: var(--gray-50);
  color: var(--black);
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: 290px;
  background: var(--black);
  color: var(--white);
  padding: 22px;
  position: fixed;
  inset: 0 auto 0 0;
  overflow: auto;
}

.brand {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 28px;
}

.brand-mark {
  width: 54px;
  height: 54px;
  border-radius: 16px;
  background: var(--red);
  display: grid;
  place-items: center;
  font-weight: 800;
  letter-spacing: .5px;
  box-shadow: 0 8px 22px rgba(200, 16, 46, .45);
}

.brand h1 {
  font-size: 19px;
  margin: 0;
}

.brand p {
  margin: 4px 0 0;
  font-size: 12px;
  color: #bbbbbb;
}

nav {
  display: grid;
  gap: 8px;
}

.nav {
  width: 100%;
  border: 0;
  background: transparent;
  color: #eeeeee;
  text-align: left;
  padding: 12px 14px;
  border-radius: 14px;
  cursor: pointer;
  font-weight: 700;
}

.nav:hover,
.nav.active {
  background: var(--red);
}

.side-note {
  margin-top: 28px;
  padding: 14px;
  border: 1px solid #333;
  border-radius: 16px;
  font-size: 13px;
  color: #dddddd;
  line-height: 1.45;
}

.side-note strong {
  color: var(--white);
  display: block;
  margin-bottom: 4px;
}

.main {
  margin-left: 290px;
  width: calc(100% - 290px);
  padding: 26px;
}

.topbar {
  background: var(--white);
  border-radius: 22px;
  box-shadow: var(--shadow);
  padding: 20px 22px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  margin-bottom: 22px;
}

.topbar h2 {
  margin: 0;
  font-size: 25px;
}

.topbar p {
  margin: 7px 0 0;
  color: var(--gray-500);
}

.actions, .form-actions, .filters {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}

.btn {
  border: 0;
  border-radius: 12px;
  padding: 10px 14px;
  font-weight: 800;
  cursor: pointer;
}

.btn.primary {
  background: var(--red);
  color: var(--white);
}

.btn.primary:hover { background: var(--red-dark); }

.btn.secondary {
  background: var(--gray-100);
  color: var(--black);
}

.btn.small {
  padding: 7px 10px;
  font-size: 12px;
}

.section { display: none; }
.section.active { display: block; }

.grid { display: grid; gap: 16px; }
.kpi-grid { grid-template-columns: repeat(6, minmax(140px, 1fr)); margin-bottom: 18px; }

.kpi-card {
  background: var(--white);
  border-radius: 20px;
  padding: 18px;
  box-shadow: var(--shadow);
  border-left: 6px solid var(--red);
}

.kpi-card span {
  display: block;
  color: var(--gray-500);
  font-size: 13px;
  margin-bottom: 10px;
}

.kpi-card strong {
  font-size: 30px;
}

.panel {
  background: var(--white);
  border-radius: 22px;
  box-shadow: var(--shadow);
  padding: 20px;
  margin-bottom: 20px;
}

.panel-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  margin-bottom: 16px;
}

.panel h3 {
  margin: 0;
  font-size: 19px;
}

.hint {
  color: var(--gray-500);
  font-size: 13px;
}

.pill {
  background: #fff1f2;
  color: var(--red);
  padding: 6px 10px;
  border-radius: 999px;
  font-weight: 800;
  font-size: 12px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(180px, 1fr));
  gap: 13px;
  margin-bottom: 18px;
}

.form-grid .full { grid-column: 1 / -1; }

label {
  display: grid;
  gap: 6px;
  font-weight: 800;
  color: var(--gray-800);
  font-size: 13px;
}

input, select {
  border: 1px solid var(--gray-200);
  border-radius: 12px;
  padding: 10px 11px;
  font-size: 14px;
  background: var(--white);
}

input:focus, select:focus {
  outline: 2px solid rgba(200,16,46,.22);
  border-color: var(--red);
}

.table-wrap {
  overflow: auto;
  border: 1px solid var(--gray-200);
  border-radius: 16px;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 760px;
}

th {
  background: var(--black);
  color: var(--white);
  text-align: left;
  font-size: 12px;
  padding: 11px;
  position: sticky;
  top: 0;
}

td {
  border-top: 1px solid var(--gray-200);
  padding: 10px 11px;
  font-size: 13px;
  vertical-align: top;
}

tr:nth-child(even) td {
  background: #fafafa;
}

.code, code {
  font-family: Consolas, monospace;
  background: #f3f4f6;
  padding: 2px 5px;
  border-radius: 5px;
}

.alert {
  padding: 14px 16px;
  border-radius: 16px;
  margin-bottom: 18px;
  background: #ecfdf5;
  color: #065f46;
  border: 1px solid #a7f3d0;
  font-weight: 700;
}

.alert.error {
  background: #fef2f2;
  color: var(--danger);
  border-color: #fecaca;
}

.hidden { display: none; }

.metadata {
  display: grid;
  grid-template-columns: repeat(3, minmax(180px, 1fr));
  gap: 12px;
}

.meta-item {
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  border-radius: 14px;
  padding: 13px;
}

.meta-item span {
  display: block;
  color: var(--gray-500);
  font-size: 12px;
  margin-bottom: 6px;
}

.checklist {
  line-height: 1.9;
  margin: 0;
  padding-left: 24px;
}

.status-inactive {
  color: var(--danger);
  font-weight: 800;
}

@media (max-width: 1100px) {
  .sidebar {
    width: 100%;
    position: static;
  }
  body { display: block; }
  .main {
    margin-left: 0;
    width: 100%;
  }
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .form-grid { grid-template-columns: 1fr; }
  .topbar { flex-direction: column; align-items: flex-start; }
}

.sortable {
  cursor: pointer;
  user-select: none;
}

.sortable:hover {
  background: var(--red-dark);
}

.form-note {
  margin: 0;
  color: var(--gray-500);
  font-size: 13px;
  line-height: 1.45;
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  padding: 10px 12px;
  border-radius: 12px;
}

.file-box {
  margin-top: 14px;
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  border-radius: 14px;
  padding: 12px;
  display: grid;
  gap: 6px;
  font-size: 13px;
}

.info-panel p {
  color: var(--gray-800);
  line-height: 1.5;
  margin: 8px 0;
}

.computed-box {
  display: grid;
  grid-template-columns: repeat(4, minmax(150px, 1fr));
  gap: 12px;
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  border-radius: 16px;
  padding: 13px;
}

.computed-box div {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: 13px;
  padding: 10px;
}

.computed-box span {
  display: block;
  color: var(--gray-500);
  font-size: 12px;
  margin-bottom: 5px;
}

.computed-box strong {
  font-size: 15px;
}

.money-cell {
  text-align: right;
  white-space: nowrap;
  font-weight: 700;
}

.nowrap { white-space: nowrap; }

@media (max-width: 1100px) {
  .computed-box { grid-template-columns: 1fr; }
}

/* Ajustes Fase 04 v04.1 */
.payment-form {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.payment-form .full {
  grid-column: 1 / -1;
}

.payment-form > label,
.payment-form .discount-box,
.payment-form .payment-preview-alert,
.payment-form .computed-box,
.payment-form .form-note {
  min-width: 0;
  align-self: stretch;
}

.payment-form input,
.payment-form select {
  width: 100%;
  min-height: 48px;
}

.date-field input {
  max-width: none;
}

.payment-form select#pagoPaquete {
  width: 100%;
}

.filters input[type="date"] {
  max-width: 165px;
}

@media (max-width: 1100px) {
  .payment-form { grid-template-columns: 1fr; }
  .date-field input { max-width: none; }
}


/* Ajustes Fase 04 v04.2 */
.cxc-filters {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 10px;
  flex: 1;
}

.cxc-filters .filter-row {
  display: flex;
  gap: 10px;
  align-items: center;
  width: 100%;
}

.cxc-filters .filter-row-primary {
  flex-wrap: wrap;
}

.cxc-filters .filter-row-dates {
  flex-wrap: nowrap;
  justify-content: flex-start;
}

.cxc-filters .filter-row-primary select {
  min-width: 150px;
}

.filter-date {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 800;
  color: var(--gray-800);
  white-space: nowrap;
}

.filter-date input[type="date"] {
  width: 145px;
  max-width: 145px;
}

.search-input {
  min-width: 275px;
  flex: 0 1 360px;
}

@media (max-width: 1200px) {
  .cxc-filters .filter-row-dates { flex-wrap: wrap; }
}


/* Ajustes Fase 04 v04.4 */
.cxc-panel-header {
  flex-direction: column;
  align-items: stretch;
}

.cxc-panel-header h3 {
  width: 100%;
}

.cxc-filters .filter-row-dates {
  flex-wrap: nowrap;
  justify-content: flex-start;
  align-items: center;
}

.days-filter input[type="number"] {
  width: 80px;
  max-width: 80px;
}

#btnClearCxcFilters {
  white-space: nowrap;
}

@media (max-width: 1400px) {
  .cxc-filters .filter-row-dates { flex-wrap: wrap; }
}

.hidden-select { display: none !important; }

/* Ajuste Fase 04 v04.6: autocompletado solo para Cliente en Pagos */
.autocomplete-field {
  position: relative;
}

.autocomplete-suggestions {
  position: absolute;
  z-index: 30;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: 12px;
  box-shadow: 0 14px 34px rgba(0,0,0,.12);
  overflow: hidden;
  max-height: 260px;
  overflow-y: auto;
}

.autocomplete-suggestions button {
  display: block;
  width: 100%;
  padding: 10px 12px;
  border: 0;
  border-bottom: 1px solid var(--gray-200);
  background: var(--white);
  text-align: left;
  font-weight: 700;
  cursor: pointer;
}

.autocomplete-suggestions button:hover,
.autocomplete-suggestions button:focus {
  background: var(--gray-50);
  color: var(--red);
}

/* Ajuste Fase 06 v06.2: descuentos aplicados después de seleccionar paquete */
.discount-box {
  border: 1px solid var(--gray-200);
  background: var(--gray-50);
  border-radius: 16px;
  padding: 16px;
}

.discount-title {
  display: flex;
  flex-direction: column;
  gap: 3px;
  margin-bottom: 12px;
}

.discount-title strong {
  font-size: 15px;
  color: var(--black);
}

.discount-title span {
  font-size: 12px;
  color: var(--gray-600);
}

.discount-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  grid-template-areas:
    "apply name name"
    "type value applied"
    "final final final";
  gap: 12px;
  align-items: stretch;
}

.discount-apply { grid-area: apply; }
.discount-name { grid-area: name; }
.discount-value-type { grid-area: type; }
.discount-value { grid-area: value; }
.discount-applied { grid-area: applied; }
.discount-final { grid-area: final; }

.readonly-metric {
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: var(--white);
  border: 1px dashed var(--gray-200);
  border-radius: 12px;
  padding: 10px 12px;
  color: var(--gray-600);
  font-size: 12px;
  font-weight: 800;
}

.readonly-metric strong {
  color: var(--black);
  font-size: 18px;
}

@media (max-width: 1100px) {
  .discount-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-areas:
      "apply name"
      "type value"
      "applied applied"
      "final final";
  }
}

@media (max-width: 720px) {
  .discount-grid {
    grid-template-columns: 1fr;
    grid-template-areas:
      "apply"
      "name"
      "type"
      "value"
      "applied"
      "final";
  }
}

/* Ajuste Fase 06 v06.2: claridad entre precio/base del paquete y pago real recibido */
.field-help {
  color: var(--gray-500);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.35;
}

.payment-preview-alert {
  background: #fff7ed;
  border: 1px solid #fed7aa;
  color: #9a3412;
  border-radius: 14px;
  padding: 11px 13px;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.4;
}

.payment-preview-alert.hidden {
  display: none;
}

.payment-preview-grid {
  grid-template-columns: repeat(4, minmax(165px, 1fr));
}

#btnGuardarPago:disabled {
  opacity: .55;
  cursor: not-allowed;
}


input:disabled,
select:disabled {
  background: #f5f5f5;
  color: #777777;
  cursor: not-allowed;
}

/* Fase 06 v06.2: pagos de costos desde Parámetros */
.referral-payment-box {
  border-color: #fecdd3;
  background: #fff7f8;
}

.referral-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  align-items: stretch;
}

.referral-grid .full {
  grid-column: 1 / -1;
}

.referral-grid label,
.referral-grid .readonly-metric {
  min-width: 0;
  width: 100%;
}

.referral-grid select,
.referral-grid input {
  width: 100%;
  min-height: 48px;
}

.phase05-kpis {
  grid-template-columns: repeat(5, minmax(140px, 1fr));
}

@media (max-width: 1200px) {
  .referral-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .phase05-kpis { grid-template-columns: repeat(2, minmax(140px, 1fr)); }
}

@media (max-width: 720px) {
  .referral-grid { grid-template-columns: 1fr; }
}


/* Ajustes Fase 06 v06.6: grilla administrativa profesional y reutilizable */
.admin-form {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 16px;
  align-items: start;
  margin-bottom: 18px;
}

.admin-form .full { grid-column: 1 / -1; }
.admin-form input[type="hidden"] { display: none !important; }

.form-field {
  display: grid;
  grid-template-rows: 18px 48px 34px;
  gap: 6px;
  min-width: 0;
  width: 100%;
  align-self: stretch;
  font-size: 13px;
  color: var(--gray-800);
}

.form-label {
  display: block;
  font-weight: 800;
  line-height: 18px;
  white-space: nowrap;
  overflow: hidden;
}

.admin-form input,
.admin-form select,
.admin-form textarea,
.form-control {
  width: 100%;
  height: 48px;
  min-height: 48px;
  box-sizing: border-box;
  border: 1px solid var(--gray-200);
  border-radius: 12px;
  padding: 10px 12px;
  font-size: 14px;
  line-height: 20px;
  background: var(--white);
  color: var(--black);
  vertical-align: middle;
  margin: 0;
}

.admin-form select {
  appearance: auto;
}

.admin-form input[readonly] {
  background: var(--gray-50);
  color: var(--gray-800);
}

.field-help {
  display: block;
  min-height: 34px;
  color: var(--gray-500);
  font-size: 12px;
  font-weight: 500;
  line-height: 17px;
  overflow: hidden;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  width: 100%;
  align-items: stretch;
}

.summary-card,
.admin-form .summary-card,
.phase06-form .summary-card {
  min-width: 0;
  width: 100%;
  min-height: 100px;
  display: grid;
  grid-template-rows: auto 1fr auto;
  align-items: center;
  gap: 6px;
  background: var(--white);
  border: 1px dashed var(--gray-200);
  border-radius: 14px;
  padding: 12px 14px;
  box-sizing: border-box;
}

.summary-card span {
  display: block;
  color: var(--gray-600);
  font-size: 12px;
  font-weight: 800;
  line-height: 16px;
}

.summary-card strong {
  display: block;
  color: var(--black);
  font-size: 20px;
  line-height: 24px;
  font-weight: 800;
  white-space: normal;
  word-break: break-word;
}

.summary-card small {
  display: block;
  color: var(--gray-500);
  font-size: 12px;
  font-weight: 500;
  line-height: 16px;
}

.phase-alert {
  background: #fff7ed;
  border: 1px solid #fed7aa;
  color: #9a3412;
  border-radius: 14px;
  padding: 12px 14px;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.45;
  box-sizing: border-box;
}

.phase-alert.hidden { display: none; }

.phase-alert.error {
  background: #fef2f2;
  border-color: #fecaca;
  color: #991b1b;
}

.phase-alert.ok {
  background: #ecfdf5;
  border-color: #bbf7d0;
  color: #166534;
}



.phase06-form .cost-concept { grid-column: span 4; }
.phase06-form .cost-type { grid-column: span 2; }
.phase06-form .cost-day { grid-column: span 3; }
.phase06-form .cost-base { grid-column: span 3; }
.phase06-form .cost-date { grid-column: span 3; }
.phase06-form .cost-amount { grid-column: span 3; }
.phase06-form .cost-method { grid-column: span 3; }
.phase06-form .cost-account { grid-column: span 3; }
.phase06-form .cost-control { grid-column: span 3; }
.phase06-form .cost-reconciled { grid-column: span 2; }
.phase06-form .cost-registry { grid-column: span 2; }
.phase06-form .cost-notes { grid-column: span 5; }

.phase06-form .form-note,
.phase06-form .form-actions,
.phase06-form .summary-grid,
.phase06-form .phase-alert {
  grid-column: 1 / -1;
}

@media (max-width: 1300px) {
  .admin-form { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .phase06-form .cost-concept { grid-column: span 3; }
  .phase06-form .cost-type { grid-column: span 3; }
  .phase06-form .cost-day,
  .phase06-form .cost-base,
  .phase06-form .cost-date,
  .phase06-form .cost-amount,
  .phase06-form .cost-method,
  .phase06-form .cost-account,
  .phase06-form .cost-control,
  .phase06-form .cost-reconciled,
  .phase06-form .cost-registry,
  .phase06-form .cost-notes { grid-column: span 3; }
  .summary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 760px) {
  .admin-form { grid-template-columns: 1fr; }
  .phase06-form .cost-concept,
  .phase06-form .cost-type,
  .phase06-form .cost-day,
  .phase06-form .cost-base,
  .phase06-form .cost-date,
  .phase06-form .cost-amount,
  .phase06-form .cost-method,
  .phase06-form .cost-account,
  .phase06-form .cost-control,
  .phase06-form .cost-reconciled,
  .phase06-form .cost-registry,
  .phase06-form .cost-notes,
  .phase06-form .form-note,
  .phase06-form .form-actions,
  .phase06-form .summary-grid,
  .phase06-form .phase-alert { grid-column: 1 / -1; }
  .summary-grid { grid-template-columns: 1fr; }
}

/* Fase 07 v07.1: Pasivos con estándar visual aprobado en Fase 06 v06.5 */
.phase07-form .passive-creditor { grid-column: span 3; }
.phase07-form .passive-type { grid-column: span 3; }
.phase07-form .passive-priority { grid-column: span 2; }
.phase07-form .passive-status { grid-column: span 4; }
.phase07-form .passive-description { grid-column: span 4; }
.phase07-form .passive-start { grid-column: span 2; }
.phase07-form .passive-due { grid-column: span 2; }
.phase07-form .passive-amount { grid-column: span 2; }
.phase07-form .passive-registry { grid-column: span 2; }
.phase07-form .passive-notes { grid-column: span 10; }
.phase07-form .form-note,
.phase07-form .form-actions,
.phase07-form .summary-grid,
.phase07-form .phase-alert { grid-column: 1 / -1; }
.pasivos-kpis { grid-template-columns: repeat(6, minmax(140px, 1fr)); margin-bottom: 18px; }
.clean-filters { margin-bottom: 14px; align-items: center; }
.clean-filters select,
.clean-filters input { min-height: 44px; height: 44px; border-radius: 12px; box-sizing: border-box; }
.list-header { margin-bottom: 12px; }
@media (max-width: 1300px) {
  .phase07-form .passive-creditor,
  .phase07-form .passive-type,
  .phase07-form .passive-priority,
  .phase07-form .passive-status,
  .phase07-form .passive-description,
  .phase07-form .passive-start,
  .phase07-form .passive-due,
  .phase07-form .passive-amount,
  .phase07-form .passive-registry { grid-column: span 3; }
  .phase07-form .passive-notes { grid-column: span 6; }
  .pasivos-kpis { grid-template-columns: repeat(3, minmax(140px, 1fr)); }
}
@media (max-width: 760px) {
  .phase07-form .passive-creditor,
  .phase07-form .passive-type,
  .phase07-form .passive-priority,
  .phase07-form .passive-status,
  .phase07-form .passive-description,
  .phase07-form .passive-start,
  .phase07-form .passive-due,
  .phase07-form .passive-amount,
  .phase07-form .passive-registry,
  .phase07-form .passive-notes,
  .phase07-form .form-note,
  .phase07-form .form-actions,
  .phase07-form .summary-grid { grid-column: 1 / -1; }
  .pasivos-kpis { grid-template-columns: 1fr; }
}

/* Fase 07 v07.2: deudas y movimientos integrados con estándar visual Fase 06 v06.5 */
.phase07-form .passive-creditor { grid-column: span 3; }
.phase07-form .passive-type { grid-column: span 3; }
.phase07-form .passive-priority { grid-column: span 2; }
.phase07-form .passive-status { grid-column: span 2; }
.phase07-form .passive-description { grid-column: span 4; }
.phase07-form .passive-start { grid-column: span 2; }
.phase07-form .passive-due { grid-column: span 2; }
.phase07-form .passive-amount { grid-column: span 2; }
.phase07-form .passive-registry { grid-column: span 2; }
.phase07-form .passive-notes { grid-column: span 10; }
.phase07-form .form-note,
.phase07-form .form-actions,
.phase07-form .summary-grid,
.phase07-form .phase-alert { grid-column: 1 / -1; }

.phase07-movement-form .movement-passive { grid-column: span 4; }
.phase07-movement-form .movement-type { grid-column: span 3; }
.phase07-movement-form .movement-date { grid-column: span 2; }
.phase07-movement-form .movement-amount { grid-column: span 3; }
.phase07-movement-form .movement-method { grid-column: span 3; }
.phase07-movement-form .movement-account { grid-column: span 3; }
.phase07-movement-form .movement-reconciled { grid-column: span 2; }
.phase07-movement-form .movement-registry { grid-column: span 2; }
.phase07-movement-form .movement-concept { grid-column: span 4; }
.phase07-movement-form .movement-notes { grid-column: span 8; }
.phase07-movement-form .form-note,
.phase07-movement-form .form-actions,
.phase07-movement-form .summary-grid,
.phase07-movement-form .phase-alert { grid-column: 1 / -1; }

#btnGuardarMovimiento:disabled {
  opacity: .55;
  cursor: not-allowed;
}

@media (max-width: 1300px) {
  .phase07-form .passive-creditor,
  .phase07-form .passive-type,
  .phase07-form .passive-priority,
  .phase07-form .passive-status,
  .phase07-form .passive-description,
  .phase07-form .passive-start,
  .phase07-form .passive-due,
  .phase07-form .passive-amount,
  .phase07-form .passive-registry,
  .phase07-movement-form .movement-passive,
  .phase07-movement-form .movement-type,
  .phase07-movement-form .movement-date,
  .phase07-movement-form .movement-amount,
  .phase07-movement-form .movement-method,
  .phase07-movement-form .movement-account,
  .phase07-movement-form .movement-reconciled,
  .phase07-movement-form .movement-registry,
  .phase07-movement-form .movement-concept { grid-column: span 3; }
  .phase07-form .passive-notes,
  .phase07-movement-form .movement-notes { grid-column: span 6; }
  .pasivos-kpis { grid-template-columns: repeat(3, minmax(140px, 1fr)); }
}
@media (max-width: 760px) {
  .phase07-form .passive-creditor,
  .phase07-form .passive-type,
  .phase07-form .passive-priority,
  .phase07-form .passive-status,
  .phase07-form .passive-description,
  .phase07-form .passive-start,
  .phase07-form .passive-due,
  .phase07-form .passive-amount,
  .phase07-form .passive-registry,
  .phase07-form .passive-notes,
  .phase07-form .form-note,
  .phase07-form .form-actions,
  .phase07-form .summary-grid,
  .phase07-movement-form .movement-passive,
  .phase07-movement-form .movement-type,
  .phase07-movement-form .movement-date,
  .phase07-movement-form .movement-amount,
  .phase07-movement-form .movement-method,
  .phase07-movement-form .movement-account,
  .phase07-movement-form .movement-reconciled,
  .phase07-movement-form .movement-registry,
  .phase07-movement-form .movement-concept,
  .phase07-movement-form .movement-notes,
  .phase07-movement-form .form-note,
  .phase07-movement-form .form-actions,
  .phase07-movement-form .summary-grid { grid-column: 1 / -1; }
  .pasivos-kpis { grid-template-columns: 1fr; }
}

/* Fase 07 v07.4: pasivos importados del Excel + selector de deuda existente */
.phase07-form .passive-creditor { grid-column: span 3; }
.phase07-form .passive-existing { grid-column: span 5; }
.phase07-form .passive-type { grid-column: span 2; }
.phase07-form .passive-priority { grid-column: span 2; }
.phase07-form .passive-status { grid-column: span 2; }
.phase07-form .passive-description { grid-column: span 4; }
.phase07-form .passive-start { grid-column: span 2; }
.phase07-form .passive-due { grid-column: span 2; }
.phase07-form .passive-amount { grid-column: span 2; }
.phase07-form .passive-registry { grid-column: span 2; }
.phase07-form .passive-notes { grid-column: span 10; }

@media (max-width: 1300px) {
  .phase07-form .passive-creditor,
  .phase07-form .passive-existing,
  .phase07-form .passive-type,
  .phase07-form .passive-priority,
  .phase07-form .passive-status,
  .phase07-form .passive-description,
  .phase07-form .passive-start,
  .phase07-form .passive-due,
  .phase07-form .passive-amount,
  .phase07-form .passive-registry { grid-column: span 3; }
  .phase07-form .passive-notes { grid-column: span 6; }
}

@media (max-width: 760px) {
  .phase07-form .passive-creditor,
  .phase07-form .passive-existing,
  .phase07-form .passive-type,
  .phase07-form .passive-priority,
  .phase07-form .passive-status,
  .phase07-form .passive-description,
  .phase07-form .passive-start,
  .phase07-form .passive-due,
  .phase07-form .passive-amount,
  .phase07-form .passive-registry,
  .phase07-form .passive-notes { grid-column: 1 / -1; }
}

/* Fase 09 v09.1: Ajustes Banco con estándar visual aprobado Fase 06 v06.5 */
.ajustes-kpis { grid-template-columns: repeat(6, minmax(140px, 1fr)); margin-bottom: 18px; }
.phase09-form .adj-date { grid-column: span 2; }
.phase09-form .adj-account { grid-column: span 2; }
.phase09-form .adj-method { grid-column: span 2; }
.phase09-form .adj-type { grid-column: span 3; }
.phase09-form .adj-amount { grid-column: span 3; }
.phase09-form .adj-reconciled { grid-column: span 2; }
.phase09-form .adj-registry { grid-column: span 2; }
.phase09-form .adj-concept { grid-column: span 4; }
.phase09-form .adj-notes { grid-column: span 8; }
.phase09-form .summary-grid,
.phase09-form .phase-alert,
.phase09-form .form-note,
.phase09-form .form-actions { grid-column: 1 / -1; }
@media (max-width: 1300px) {
  .phase09-form .adj-date,
  .phase09-form .adj-account,
  .phase09-form .adj-method,
  .phase09-form .adj-type,
  .phase09-form .adj-amount,
  .phase09-form .adj-reconciled,
  .phase09-form .adj-registry,
  .phase09-form .adj-concept { grid-column: span 3; }
  .phase09-form .adj-notes { grid-column: span 6; }
  .ajustes-kpis { grid-template-columns: repeat(3, minmax(140px, 1fr)); }
}
@media (max-width: 760px) {
  .phase09-form .adj-date,
  .phase09-form .adj-account,
  .phase09-form .adj-method,
  .phase09-form .adj-type,
  .phase09-form .adj-amount,
  .phase09-form .adj-reconciled,
  .phase09-form .adj-registry,
  .phase09-form .adj-concept,
  .phase09-form .adj-notes,
  .phase09-form .summary-grid,
  .phase09-form .phase-alert,
  .phase09-form .form-note,
  .phase09-form .form-actions { grid-column: 1 / -1; }
  .ajustes-kpis { grid-template-columns: 1fr; }
}

/* Fase 10 v10.1: Movimientos_Empresa consolidado */
.movements-kpis {
  grid-template-columns: repeat(6, minmax(140px, 1fr));
  margin-bottom: 18px;
}

.source-summary {
  grid-template-columns: repeat(4, minmax(180px, 1fr));
}

.movements-filters {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 12px;
  align-items: end;
  margin-bottom: 16px;
}

.movements-filters select,
.movements-filters input,
.movements-filters button,
.movements-filters .filter-date {
  width: 100%;
  min-height: 44px;
  box-sizing: border-box;
}

.movements-filters select:nth-child(1),
.movements-filters select:nth-child(2),
.movements-filters select:nth-child(3),
.movements-filters select:nth-child(4),
.movements-filters select:nth-child(5),
.movements-filters select:nth-child(6) {
  grid-column: span 2;
}

.movements-filters .filter-date {
  grid-column: span 2;
}

.movements-filters #filterQ {
  grid-column: span 6;
}

.movements-filters #btnClearFilters {
  grid-column: span 2;
}

.movements-table table {
  min-width: 1650px;
}

@media (max-width: 1500px) {
  .movements-kpis { grid-template-columns: repeat(3, minmax(140px, 1fr)); }
  .source-summary { grid-template-columns: repeat(2, minmax(180px, 1fr)); }
  .movements-filters select:nth-child(1),
  .movements-filters select:nth-child(2),
  .movements-filters select:nth-child(3),
  .movements-filters select:nth-child(4),
  .movements-filters select:nth-child(5),
  .movements-filters select:nth-child(6),
  .movements-filters .filter-date,
  .movements-filters #btnClearFilters {
    grid-column: span 3;
  }
  .movements-filters #filterQ { grid-column: span 6; }
}

@media (max-width: 900px) {
  .movements-kpis, .source-summary { grid-template-columns: 1fr; }
  .movements-filters { grid-template-columns: 1fr; }
  .movements-filters select:nth-child(1),
  .movements-filters select:nth-child(2),
  .movements-filters select:nth-child(3),
  .movements-filters select:nth-child(4),
  .movements-filters select:nth-child(5),
  .movements-filters select:nth-child(6),
  .movements-filters .filter-date,
  .movements-filters #filterQ,
  .movements-filters #btnClearFilters {
    grid-column: 1 / -1;
  }
}

/* Fase 11 v11.4: Tesorería operativa con estándar visual aprobado Fase 06 v06.5 */
.treasury-kpis {
  grid-template-columns: repeat(6, minmax(140px, 1fr));
  margin-bottom: 18px;
}

.treasury-filters {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 12px;
  align-items: end;
  margin-bottom: 0;
}

.treasury-filters select,
.treasury-filters input,
.treasury-filters button,
.treasury-filters .filter-date {
  width: 100%;
  min-height: 44px;
  box-sizing: border-box;
}

.treasury-filters select,
.treasury-filters .filter-date {
  grid-column: span 2;
}

.treasury-filters #filterQ { grid-column: span 6; }
.treasury-filters #btnClearFilters { grid-column: span 2; }

.alert-summary { grid-template-columns: repeat(3, minmax(180px, 1fr)); }
.treasury-table table { min-width: 1250px; }
.danger-card { border-color: #fecaca; background: #fff7f7; }

@media (max-width: 1500px) {
  .treasury-kpis { grid-template-columns: repeat(3, minmax(140px, 1fr)); }
  .treasury-filters select,
  .treasury-filters .filter-date,
  .treasury-filters #btnClearFilters { grid-column: span 3; }
  .treasury-filters #filterQ { grid-column: span 6; }
  .alert-summary { grid-template-columns: repeat(2, minmax(180px, 1fr)); }
}

@media (max-width: 900px) {
  .treasury-kpis,
  .alert-summary { grid-template-columns: 1fr; }
  .treasury-filters { grid-template-columns: 1fr; }
  .treasury-filters select,
  .treasury-filters .filter-date,
  .treasury-filters #filterQ,
  .treasury-filters #btnClearFilters { grid-column: 1 / -1; }
}

/* Ajustes Fase 11 v11.4: estructura Tesorería fiel al Excel */
.two-column-panel {
  display: grid;
  grid-template-columns: minmax(260px, 0.9fr) minmax(360px, 1.4fr);
  gap: 18px;
  align-items: start;
}
.compact-header {
  margin-bottom: 12px;
}
.control-summary {
  grid-template-columns: repeat(2, minmax(150px, 1fr));
}
.compact-card strong {
  font-size: 18px;
}
.status-ok {
  color: var(--ok);
  font-weight: 800;
}
.total-row td {
  font-weight: 800;
  background: var(--gray-50) !important;
}
@media (max-width: 1200px) {
  .two-column-panel { grid-template-columns: 1fr; }
  .control-summary { grid-template-columns: repeat(2, minmax(140px, 1fr)); }
}
@media (max-width: 720px) {
  .control-summary { grid-template-columns: 1fr; }
}

/* Ajuste Fase 11 v11.4: periodo global de Tesorería */
.period-panel {
  margin-bottom: 18px;
}
.period-header {
  align-items: end;
  gap: 16px;
}
.period-selector-wrap {
  width: min(360px, 100%);
}
.period-selector {
  display: grid;
  gap: 8px;
  margin: 0;
  font-weight: 800;
}
.period-selector select {
  width: 100%;
  min-height: 46px;
  box-sizing: border-box;
}
.period-selector span {
  min-height: 18px;
  color: var(--gray-500);
  font-size: 12px;
  font-weight: 500;
}
@media (max-width: 900px) {
  .period-header { align-items: stretch; }
  .period-selector-wrap { width: 100%; }
}

/* Fase 12 v12.1: Base_Clientes_Mes con estándar visual aprobado Fase 06 v06.5 */
.base-kpis {
  grid-template-columns: repeat(6, minmax(140px, 1fr));
  margin-bottom: 18px;
}
.base-filters {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 12px;
  align-items: end;
  margin-bottom: 0;
}
.base-filters select,
.base-filters input,
.base-filters button {
  width: 100%;
  min-height: 44px;
  box-sizing: border-box;
}
.base-filters select { grid-column: span 2; }
.base-filters #filterQ { grid-column: span 6; }
.base-filters #btnClearFilters { grid-column: span 2; }
.base-table table { min-width: 1850px; }
.base-table small { color: var(--gray-500); }
@media (max-width: 1500px) {
  .base-kpis { grid-template-columns: repeat(3, minmax(140px, 1fr)); }
  .base-filters select,
  .base-filters #btnClearFilters { grid-column: span 3; }
  .base-filters #filterQ { grid-column: span 6; }
}
@media (max-width: 900px) {
  .base-kpis { grid-template-columns: 1fr; }
  .base-filters { grid-template-columns: 1fr; }
  .base-filters select,
  .base-filters #filterQ,
  .base-filters #btnClearFilters { grid-column: 1 / -1; }
}


/* Fase 13 v13.3: Finanzas_Periodo con estándar visual aprobado Fase 06 v06.5 */
.finanzas-kpis { grid-template-columns: repeat(6, minmax(150px, 1fr)); }
.alert-reading .summary-card { min-height: 216px; align-content: start; }
.alert-card strong { font-size: 16px; line-height: 22px; }
.ok-card { border-color: rgba(15, 118, 110, .35); background: #f0fdfa; }
.danger-card { border-color: rgba(185, 28, 28, .35); background: #fff1f2; }
@media (max-width: 1400px) { .finanzas-kpis { grid-template-columns: repeat(3, minmax(150px, 1fr)); } }
@media (max-width: 720px) { .finanzas-kpis { grid-template-columns: 1fr; } }

/* Fase 15 v15.1: Resumen_Teachers_Mensual con estándar visual aprobado Fase 06 v06.5 */
.teachers-kpis {
  grid-template-columns: repeat(6, minmax(150px, 1fr));
  margin-bottom: 18px;
}
.teachers-filters {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 12px;
  align-items: end;
  margin-bottom: 0;
}
.teachers-filters select,
.teachers-filters input,
.teachers-filters button {
  width: 100%;
  min-height: 44px;
  box-sizing: border-box;
}
.teachers-filters select { grid-column: span 2; }
.teachers-filters #filterQ { grid-column: span 3; }
.teachers-filters #btnClearFilters { grid-column: span 1; }
.teachers-table table { min-width: 2100px; }
.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 4px 10px;
  border: 1px solid rgba(15, 23, 42, .12);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
  background: var(--gray-50);
}
.ok-pill {
  color: #0f766e;
  background: #f0fdfa;
  border-color: rgba(15, 118, 110, .28);
}
.danger-pill {
  color: #991b1b;
  background: #fff1f2;
  border-color: rgba(185, 28, 28, .32);
}
@media (max-width: 1500px) {
  .teachers-kpis { grid-template-columns: repeat(3, minmax(150px, 1fr)); }
  .teachers-filters select,
  .teachers-filters #btnClearFilters { grid-column: span 3; }
  .teachers-filters #filterQ { grid-column: span 6; }
}
@media (max-width: 900px) {
  .teachers-kpis { grid-template-columns: 1fr; }
  .teachers-filters { grid-template-columns: 1fr; }
  .teachers-filters select,
  .teachers-filters #filterQ,
  .teachers-filters #btnClearFilters { grid-column: 1 / -1; }
}

/* Fase 16 v16.2: Clientes por mes de ingreso con estándar visual aprobado Fase 06 v06.5 */
.cohortes-kpis {
  grid-template-columns: repeat(6, minmax(150px, 1fr));
  margin-bottom: 18px;
}
.cohortes-filters {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 12px;
  align-items: end;
  margin-bottom: 0;
}
.cohortes-filters select,
.cohortes-filters input,
.cohortes-filters button {
  width: 100%;
  min-height: 44px;
  box-sizing: border-box;
}
.cohortes-filters select { grid-column: span 2; }
.cohortes-filters #filterQ { grid-column: span 4; }
.cohortes-filters #btnClearFilters { grid-column: span 2; }
.cohortes-table table { min-width: 1450px; }
.cohortes-table td:nth-child(n+3),
.cohortes-table th:nth-child(n+3) {
  text-align: right;
  white-space: nowrap;
}
.matrix-panel .table-wrap {
  max-height: 420px;
}
@media (max-width: 1500px) {
  .cohortes-kpis { grid-template-columns: repeat(3, minmax(150px, 1fr)); }
  .cohortes-filters select,
  .cohortes-filters #btnClearFilters { grid-column: span 3; }
  .cohortes-filters #filterQ { grid-column: span 6; }
}
@media (max-width: 900px) {
  .cohortes-kpis { grid-template-columns: 1fr; }
  .cohortes-filters { grid-template-columns: 1fr; }
  .cohortes-filters select,
  .cohortes-filters #filterQ,
  .cohortes-filters #btnClearFilters { grid-column: 1 / -1; }
}

/* Ajustes Fase 17 v17.4: Clientes por teacher con fuente estricta y meses ordenados */
.teachers-kpis {
  grid-template-columns: repeat(6, minmax(150px, 1fr));
}

.teachers-filters {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 12px;
  align-items: stretch;
}

.teachers-filters select,
.teachers-filters input,
.teachers-filters button {
  width: 100%;
  min-height: 44px;
}

.teachers-filters select { grid-column: span 3; }
.teachers-filters #filterQ { grid-column: span 4; }
.teachers-filters #btnClearFilters { grid-column: span 2; }
.teachers-table table { min-width: 1380px; }
.teachers-table td:nth-child(n+2),
.teachers-table th:nth-child(n+2) {
  text-align: right;
  white-space: nowrap;
}
.teachers-table td:first-child,
.teachers-table th:first-child { text-align: left; }
.teachers-table td:last-child,
.teachers-table th:last-child { text-align: left; }

@media (max-width: 1300px) {
  .teachers-kpis { grid-template-columns: repeat(3, minmax(150px, 1fr)); }
  .teachers-filters select,
  .teachers-filters #btnClearFilters { grid-column: span 4; }
  .teachers-filters #filterQ { grid-column: span 4; }
}

@media (max-width: 800px) {
  .teachers-kpis { grid-template-columns: 1fr; }
  .teachers-filters { grid-template-columns: 1fr; }
  .teachers-filters select,
  .teachers-filters #filterQ,
  .teachers-filters #btnClearFilters { grid-column: 1 / -1; }
}

.wide-filter-panel {
  margin-bottom: 14px;
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  align-items: end;
}

.wide-filter-panel select,
.wide-filter-panel input {
  width: 100%;
  min-width: 0;
}

.wide-filter-panel select { grid-column: span 2; }
.wide-filter-panel input { grid-column: span 3; }
.wide-filter-panel .check-filter { grid-column: span 3; }
.wide-filter-panel .btn { grid-column: span 2; min-height: 40px; }

.check-filter {
  min-height: 40px;
  border: 1px solid var(--gray-200);
  border-radius: 12px;
  padding: 9px 11px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 800;
  color: var(--gray-800);
  background: var(--white);
}

.check-filter input {
  width: auto;
  padding: 0;
}

@media (max-width: 1100px) {
  .wide-filter-panel select,
  .wide-filter-panel input,
  .wide-filter-panel .check-filter,
  .wide-filter-panel .btn { grid-column: span 6; }
}

@media (max-width: 720px) {
  .wide-filter-panel select,
  .wide-filter-panel input,
  .wide-filter-panel .check-filter,
  .wide-filter-panel .btn { grid-column: 1 / -1; }
}

/* Integración v01 · Fases 01 a 19 sin Dashboard final */
.inline-help {
  margin-top: 10px;
  border: 1px solid var(--gray-200);
  border-radius: 12px;
  padding: 10px 12px;
  background: var(--gray-50);
}
.inline-help summary,
.side-note summary {
  cursor: pointer;
}
.integration-kpis,
.projection-kpis {
  grid-template-columns: repeat(4, minmax(160px, 1fr));
  margin-bottom: 18px;
}
.projection-kpis .kpi-card strong {
  font-size: 18px;
}
.integration-filter-panel {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 12px;
  align-items: end;
}
.integration-filter-panel label {
  grid-column: span 2;
  display: grid;
  gap: 6px;
  font-weight: 800;
}
.integration-filter-panel input {
  width: 100%;
  min-height: 44px;
  box-sizing: border-box;
}
.integration-filter-panel > input {
  grid-column: span 5;
}
.integration-filter-panel .btn {
  grid-column: span 3;
  min-height: 44px;
}
.projection-support-grid {
  grid-template-columns: repeat(6, minmax(140px, 1fr));
}
.modules-grid {
  grid-template-columns: repeat(3, minmax(220px, 1fr));
}
.modules-grid .summary-card {
  gap: 8px;
}
.modules-grid code {
  font-size: 12px;
  color: var(--gray-500);
  word-break: break-word;
}
.clean-section-panel {
  margin-bottom: 18px;
}
.section-divider-panel {
  border-left: 6px solid var(--red);
  background: #fffafa;
}
.reading-panel .summary-card {
  min-height: 0 !important;
}
@media (max-width: 1400px) {
  .integration-kpis,
  .projection-kpis { grid-template-columns: repeat(2, minmax(160px, 1fr)); }
  .projection-support-grid { grid-template-columns: repeat(3, minmax(140px, 1fr)); }
  .modules-grid { grid-template-columns: repeat(2, minmax(220px, 1fr)); }
}
@media (max-width: 820px) {
  .integration-kpis,
  .projection-kpis,
  .projection-support-grid,
  .modules-grid { grid-template-columns: 1fr; }
  .integration-filter-panel { grid-template-columns: 1fr; }
  .integration-filter-panel label,
  .integration-filter-panel > input,
  .integration-filter-panel .btn { grid-column: 1 / -1; }
}

/* Integración v02: índice de módulos y testeo dentro de una sola app */
.hub-body .sidebar {
  width: 310px;
}
.hub-body .main {
  margin-left: 310px;
}
.hub-nav {
  overflow-y: auto;
  max-height: calc(100vh - 245px);
  padding-right: 4px;
}
.nav-group-title {
  margin: 14px 0 8px;
  font-size: 11px;
  font-weight: 900;
  color: rgba(255,255,255,.55);
  text-transform: uppercase;
  letter-spacing: .08em;
}
.module-nav-btn {
  font-size: 12px;
  line-height: 16px;
  padding: 10px 12px;
  text-align: left;
}
.module-card,
.internal-card {
  align-content: start;
  min-height: 154px;
}
.module-card .btn {
  margin-top: 8px;
  min-height: 36px;
}
.internal-card {
  background: #f8fafc;
  opacity: .95;
}
.module-shell-panel {
  padding: 12px;
}
.module-shell-header {
  margin: 0 0 12px;
  padding: 6px 4px 12px;
  border-bottom: 1px solid var(--gray-200);
}
.module-frame-wrap {
  border: 1px solid var(--gray-200);
  border-radius: 18px;
  overflow: hidden;
  background: var(--white);
  min-height: calc(100vh - 180px);
}
.module-frame-wrap iframe {
  width: 100%;
  height: calc(100vh - 190px);
  min-height: 720px;
  border: 0;
  display: block;
  background: var(--white);
}
.hub-main .modules-grid {
  grid-template-columns: repeat(3, minmax(240px, 1fr));
}
.hub-main .modules-grid .summary-card small {
  color: var(--gray-500);
  line-height: 1.35;
}
.hub-main .modules-grid .summary-card strong {
  font-size: 18px;
}
@media (max-width: 1400px) {
  .hub-main .modules-grid { grid-template-columns: repeat(2, minmax(240px, 1fr)); }
}
@media (max-width: 1000px) {
  .hub-body .sidebar { width: 100%; position: relative; min-height: auto; }
  .hub-body .main { margin-left: 0; }
  .hub-nav { max-height: none; }
  .module-frame-wrap iframe { height: 760px; }
}
@media (max-width: 760px) {
  .hub-main .modules-grid { grid-template-columns: 1fr; }
}

/* Sistema Administrativo CFA · v03 */
.admin-body .brand h1 {
  font-size: 17px;
  line-height: 21px;
}
.admin-body .brand p {
  font-size: 12px;
}
.admin-sidebar .side-note {
  margin-top: 18px;
}
.admin-nav .nav-group-title {
  margin: 18px 12px 8px;
  font-size: 11px;
  color: rgba(255,255,255,.62);
  text-transform: uppercase;
  letter-spacing: .08em;
  font-weight: 900;
}
.admin-main .admin-welcome p {
  max-width: 980px;
}
.admin-action-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(180px, 1fr));
  gap: 12px;
}
.admin-action-grid .btn {
  width: 100%;
  min-height: 44px;
}
.audit-filter-panel {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 12px;
  align-items: end;
}
.audit-filter-panel label {
  grid-column: span 2;
  display: grid;
  gap: 7px;
  margin: 0;
  font-weight: 800;
}
.audit-filter-panel label:nth-child(3) { grid-column: span 3; }
.audit-filter-panel label:nth-child(4),
.audit-filter-panel label:nth-child(5) { grid-column: span 2; }
.audit-filter-panel button { grid-column: span 1; min-height: 44px; }
.audit-filter-panel input,
.audit-filter-panel select {
  width: 100%;
  min-height: 44px;
  box-sizing: border-box;
}
.module-shell-header .actions {
  flex-wrap: wrap;
  justify-content: flex-end;
}
.module-frame-wrap iframe {
  background: #fff;
}
.module-audit-panel {
  margin-top: 18px;
}
.admin-body .module-card span,
.admin-body .internal-card span {
  color: var(--red);
  font-weight: 900;
}
.admin-body .module-card strong {
  font-size: 18px;
}
@media (max-width: 1200px) {
  .audit-filter-panel label,
  .audit-filter-panel label:nth-child(3),
  .audit-filter-panel label:nth-child(4),
  .audit-filter-panel label:nth-child(5),
  .audit-filter-panel button { grid-column: span 6; }
  .admin-action-grid { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  .audit-filter-panel { grid-template-columns: 1fr; }
  .audit-filter-panel label,
  .audit-filter-panel label:nth-child(3),
  .audit-filter-panel label:nth-child(4),
  .audit-filter-panel label:nth-child(5),
  .audit-filter-panel button { grid-column: 1 / -1; }
}

/* Integración v04 · Sistema administrativo final */
.admin-brand { gap: 12px; }
.brand-logo-box, .topbar-logo-box { display: flex; align-items: center; justify-content: center; flex: 0 0 auto; }
.brand-logo { width: 54px; height: 54px; object-fit: contain; border-radius: 14px; background: #fff; padding: 4px; }
.topbar-title-with-logo { display: flex; align-items: center; gap: 14px; min-width: 0; }
.topbar-logo { width: 54px; height: 54px; object-fit: contain; border-radius: 14px; background: #fff; border: 1px solid rgba(15,23,42,.12); padding: 4px; }
.topbar-logo-placeholder { width: 54px; height: 54px; display: grid; place-items: center; border-radius: 14px; background: #111; color: #fff; font-weight: 900; letter-spacing: .5px; }
.hidden { display: none !important; }
.file-btn { position: relative; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
.admin-main-actions { flex-wrap: wrap; justify-content: flex-end; }
.module-help-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin: 14px 0 16px; }
.module-help-card { border: 1px solid rgba(15,23,42,.10); background: #fff; border-radius: 16px; padding: 14px; min-height: 118px; display: flex; flex-direction: column; gap: 8px; }
.module-help-card span { color: #334155; font-size: 12px; font-weight: 900; text-transform: uppercase; letter-spacing: .03em; }
.module-help-card p { margin: 0; color: #0f172a; font-weight: 650; line-height: 1.35; }
.module-frame-wrap { position: relative; border-radius: 18px; overflow: hidden; border: 1px solid rgba(15,23,42,.10); background: #fff; min-height: 760px; }
.module-frame-wrap iframe { min-height: 760px; transition: opacity .16s ease; }
.module-loading-overlay { position: absolute; inset: 0; z-index: 4; display: grid; place-items: center; padding: 24px; background: rgba(248,250,252,.96); opacity: 0; visibility: hidden; pointer-events: none; transition: opacity .16s ease, visibility .16s ease; }
.module-frame-wrap.is-loading .module-loading-overlay { opacity: 1; visibility: visible; pointer-events: auto; }
.module-frame-wrap.is-loading iframe { opacity: 0; pointer-events: none; }
.module-loading-card { display: flex; align-items: center; gap: 12px; padding: 15px 18px; border: 1px solid rgba(15,23,42,.12); border-radius: 14px; background: #fff; box-shadow: 0 18px 44px rgba(15,23,42,.13); color: #17202a; }
.module-loading-spinner { width: 22px; height: 22px; border: 3px solid #e2e8f0; border-top-color: #c8102e; border-radius: 50%; animation: module-spin .75s linear infinite; }
@keyframes module-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .module-loading-spinner { animation-duration: 1.5s; } .module-frame-wrap iframe,.module-loading-overlay { transition: none; } }
.admin-action-grid { display: grid; grid-template-columns: repeat(4, minmax(180px, 1fr)); gap: 12px; }
.modules-grid { grid-template-columns: repeat(4, minmax(220px, 1fr)); }
.modules-grid .module-card { min-height: 180px; display: flex; flex-direction: column; gap: 10px; align-items: flex-start; }
.modules-grid .module-card small { color: #475569; line-height: 1.35; min-height: 38px; }
.modules-grid .module-card .btn { margin-top: auto; width: 100%; }
.audit-filter-panel { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 12px; align-items: end; }
.audit-filter-panel label { grid-column: span 2; display: grid; gap: 6px; font-weight: 800; color: #0f172a; }
.audit-filter-panel label:nth-child(3) { grid-column: span 3; }
.audit-filter-panel button { grid-column: span 1; min-height: 44px; }
.audit-filter-panel input, .audit-filter-panel select { width: 100%; min-height: 44px; box-sizing: border-box; }
.nav-group-title { margin-top: 14px; padding: 8px 14px 4px; font-size: 11px; color: rgba(255,255,255,.56); text-transform: uppercase; letter-spacing: .06em; font-weight: 900; }
@media (max-width: 1400px) { .modules-grid { grid-template-columns: repeat(3, minmax(220px, 1fr)); } .module-help-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .admin-action-grid { grid-template-columns: repeat(2, minmax(180px, 1fr)); } }
@media (max-width: 900px) { .modules-grid, .module-help-grid, .admin-action-grid { grid-template-columns: 1fr; } .audit-filter-panel { grid-template-columns: 1fr; } .audit-filter-panel label, .audit-filter-panel label:nth-child(3), .audit-filter-panel button { grid-column: 1 / -1; } .admin-main-actions { justify-content: flex-start; } .topbar-title-with-logo { align-items: flex-start; } }

/* Integración v06: ajustes finales solicitados */
.file-btn.hidden { display: none !important; }
.integrated-config-tabs { margin-bottom: 16px; }
.integrated-tabs-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(178px, 1fr));
  gap: 14px;
  align-items: stretch;
}
.integrated-tabs-row .btn {
  width: 100%;
  min-height: 52px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid #e5e7eb;
  background: #fff;
  color: #111827;
  box-shadow: 0 6px 16px rgba(15,23,42,.06);
  text-align: center;
  line-height: 1.22;
  white-space: normal;
}
.integrated-tabs-row .btn:hover { border-color: #c8102e; box-shadow: 0 10px 24px rgba(200,16,46,.12); transform: translateY(-1px); }
.integrated-tabs-row .btn:focus-visible { outline: 3px solid rgba(200,16,46,.22); outline-offset: 2px; }
.integrated-tabs-row .btn.active,
.integrated-tabs-row .btn[aria-pressed="true"] { background: #c8102e; color: #fff; border-color: #c8102e; box-shadow: 0 10px 26px rgba(200,16,46,.24); }
.integrated-summary-panel,
.integrated-reading-panel { margin-bottom: 16px; }
.integrated-summary-panel .summary-grid,
.integrated-reading-panel .summary-grid,
.integrated-reading-panel .alert-reading { width: 100%; }
.integrated-summary-panel .summary-card,
.integrated-reading-panel .summary-card { min-height: 96px; }
@media (max-width: 1200px) { .integrated-tabs-row { grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); } }
@media (max-width: 720px) { .integrated-tabs-row { grid-template-columns: 1fr; gap: 10px; } }

/* Integración v09: filtro de periodo claro en Costos, Deudas y Ajustes */
.period-control-panel {
  margin-bottom: 16px;
}
.period-control-grid {
  display: grid;
  grid-template-columns: minmax(220px, 320px) minmax(220px, 1fr);
  gap: 14px;
  align-items: end;
}
.period-control-grid label {
  display: grid;
  gap: 7px;
  font-weight: 800;
}
.period-control-grid select {
  width: 100%;
  min-height: 44px;
  box-sizing: border-box;
}
.period-context {
  min-height: 44px;
  border: 1px solid var(--gray-200);
  border-radius: 14px;
  padding: 11px 14px;
  display: flex;
  align-items: center;
  color: var(--gray-700);
  background: var(--gray-50);
  font-weight: 700;
}
@media (max-width: 760px) {
  .period-control-grid { grid-template-columns: 1fr; }
}

/* Dashboard final CFA v10.8 */
.dashboard-view .panel { margin-bottom: 18px; }
.dashboard-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(280px, .8fr);
  gap: 18px;
  align-items: center;
  background: linear-gradient(135deg, #ffffff 0%, #f8fafc 58%, #fff1f2 100%);
  border: 1px solid #e5e7eb;
}
.dashboard-hero p { font-size: 1.04rem; line-height: 1.6; margin: 6px 0 0; color: #111827; }
.dashboard-hero-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.no-border { border-bottom: 0 !important; padding-bottom: 0 !important; }
.dashboard-kpis {
  grid-template-columns: repeat(auto-fit, minmax(195px, 1fr));
  align-items: stretch;
}

.dashboard-kpi {
  min-height: 132px;
  height: 132px;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  box-sizing: border-box;
  overflow: hidden;
}

.dashboard-kpi strong {
  display: block;
  max-width: 100%;
  white-space: nowrap;
  word-break: keep-all;
  overflow-wrap: normal;
  overflow: hidden;
  text-overflow: clip;
  font-size: clamp(1.32rem, 1.55vw, 1.78rem);
  line-height: 1.1;
  letter-spacing: -0.025em;
  font-variant-numeric: tabular-nums;
}

.dashboard-kpi strong.kpi-value-long {
  font-size: clamp(1.08rem, 1.28vw, 1.42rem);
}

.dashboard-kpi strong.kpi-value-extra-long {
  font-size: clamp(.98rem, 1.12vw, 1.24rem);
  letter-spacing: -0.035em;
}

.dashboard-kpi small {
  display:block;
  margin-top:6px;
  color:#6b7280;
  font-size:.78rem;
  line-height: 1.25;
}
.dashboard-status-grid, .dashboard-alerts-grid, .manual-rules-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 12px;
}
.status-card, .dashboard-alert-card, .dashboard-chart-card {
  border: 1px solid #e5e7eb;
  border-radius: 18px;
  padding: 14px;
  background: #fff;
}
.status-card span, .dashboard-alert-card span { display:block; color:#6b7280; font-size:.78rem; text-transform: uppercase; letter-spacing:.04em; }
.status-card strong, .dashboard-alert-card strong { display:block; margin-top:5px; color:#111827; }
.status-card p, .dashboard-alert-card p { margin: 8px 0 0; color:#4b5563; line-height:1.45; font-size:.9rem; }
.status-bien, .status-saludable, .status-controlados { border-left: 5px solid #111827; }
.status-revisar, .status-bajo-observación { border-left: 5px solid #dc2626; }
.dashboard-two-columns { display:grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.bar-chart-list { display:grid; gap: 12px; }
.bar-row-top { display:flex; align-items:center; justify-content:space-between; gap:12px; font-size:.9rem; }
.bar-row-top span { color:#374151; min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.bar-row-top strong { color:#111827; white-space:nowrap; }
.bar-track { height: 10px; border-radius:999px; background:#f3f4f6; overflow:hidden; margin-top:6px; }
.bar-fill { height:100%; border-radius:999px; background:#111827; }
.money-bars .bar-fill { background:#dc2626; }
.dashboard-chart-grid { display:grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.dashboard-chart-card h4 { margin: 0 0 12px; color:#111827; }
.month-chart { display:flex; align-items:end; gap: 10px; min-height: 210px; overflow-x:auto; padding: 10px 4px 0; }
.month-group { min-width: 82px; display:grid; grid-template-rows: 160px auto; align-items:end; gap:8px; }
.month-bars { display:flex; align-items:end; justify-content:center; gap:6px; height:160px; border-bottom:1px solid #e5e7eb; }
.month-bar-wrap { display:flex; flex-direction:column; justify-content:flex-end; align-items:center; height:100%; min-width:28px; }
.month-bar { width: 20px; min-height: 4px; background:#111827; border-radius:8px 8px 0 0; }
.month-bar-wrap:nth-child(2) .month-bar { background:#dc2626; }
.month-bar-wrap small { font-size:.65rem; color:#6b7280; writing-mode:vertical-rl; transform: rotate(180deg); margin-top:4px; }
.month-group > span { font-size:.75rem; color:#374151; text-align:center; }
.single-bars .month-bar { background:#111827 !important; }
.empty-state { color:#6b7280; margin: 0; }
.manual-accordion { display:grid; gap:10px; }
.manual-item { border:1px solid #e5e7eb; border-radius:16px; background:#fff; padding: 0; overflow:hidden; }
.manual-item summary { cursor:pointer; font-weight:700; padding:14px 16px; color:#111827; background:#f9fafb; }
.manual-item div { padding: 0 16px 14px; }
.manual-item p { margin: 10px 0 0; color:#4b5563; line-height:1.5; }
.manual-hero p { max-width: 920px; line-height:1.6; }
@media (max-width: 980px) {
  .dashboard-hero, .dashboard-two-columns, .dashboard-chart-grid { grid-template-columns: 1fr; }
  .dashboard-hero-actions { grid-template-columns: 1fr; }
}

/* Dashboard Ejecutivo CFA v10.18: bloques claros y comparativos simples */
.dashboard-kpi-sections {
  display: grid;
  gap: 18px;
  margin-bottom: 18px;
}
.dashboard-kpi-block {
  background: var(--white);
  border: 1px solid #e5e7eb;
  border-radius: 22px;
  box-shadow: var(--shadow);
  padding: 18px;
}
.dashboard-block-title {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 14px;
  border-bottom: 1px solid #f1f5f9;
  padding-bottom: 12px;
}
.dashboard-block-title h3 { margin: 0; font-size: 1.04rem; color: #111827; }
.dashboard-block-title p { margin: 3px 0 0; color: #6b7280; font-size: .88rem; line-height: 1.35; }
.dashboard-kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(205px, 1fr));
  gap: 14px;
}
.dashboard-kpi {
  height: auto;
  min-height: 168px;
  border-left-width: 5px;
  box-shadow: none;
  border-top: 1px solid #eef2f7;
  border-right: 1px solid #eef2f7;
  border-bottom: 1px solid #eef2f7;
}
.dashboard-kpi em {
  display: block;
  margin-top: 8px;
  color: #6b7280;
  font-style: normal;
  font-size: .76rem;
  line-height: 1.25;
}
.kpi-trend {
  margin-top: 8px;
  border-radius: 12px;
  padding: 7px 8px;
  font-size: .74rem;
  line-height: 1.25;
  border: 1px solid #e5e7eb;
  background: #f9fafb;
}
.kpi-trend b { display: block; margin-bottom: 2px; }
.kpi-trend span { display: block; margin: 0; color: inherit; font-size: inherit; }
.trend-good { border-color: #bbf7d0; background: #f0fdf4; color: #166534; }
.trend-bad { border-color: #fecaca; background: #fef2f2; color: #991b1b; }
.trend-neutral { border-color: #e5e7eb; background: #f9fafb; color: #374151; }
.trend-muted { border-color: #e5e7eb; background: #f3f4f6; color: #6b7280; }
.guided-filters .filter-help-box {
  width: 100%;
  display: grid;
  gap: 4px;
  background: #fff7ed;
  border: 1px solid #fed7aa;
  color: #9a3412;
  border-radius: 14px;
  padding: 11px 13px;
  font-size: 13px;
  line-height: 1.35;
}
.guided-filters .filter-field {
  display: grid;
  grid-template-rows: auto 44px auto;
  gap: 5px;
  min-width: 180px;
  flex: 1 1 180px;
  font-size: 12px;
  color: var(--gray-800);
}
.guided-filters .filter-field select,
.guided-filters .filter-field input { width: 100%; min-height: 44px; }
.guided-filters .filter-field small {
  color: var(--gray-500);
  font-size: 11px;
  line-height: 1.25;
  font-weight: 500;
}
@media (max-width: 760px) {
  .dashboard-block-title { display: block; }
  .dashboard-kpi-grid { grid-template-columns: 1fr; }
}


/* v10.18.2: tooltips reales para gráficos y barras */
.chart-tooltip-target { position: relative; cursor: help; outline: none; }
.chart-tooltip-target::after {
  content: attr(data-tooltip);
  position: absolute;
  left: 50%;
  bottom: calc(100% + 10px);
  transform: translateX(-50%);
  width: max-content;
  max-width: 260px;
  white-space: pre-line;
  background: #111827;
  color: #fff;
  padding: 10px 12px;
  border-radius: 12px;
  box-shadow: 0 12px 28px rgba(15, 23, 42, .24);
  font-size: 12px;
  line-height: 1.35;
  opacity: 0;
  pointer-events: none;
  z-index: 50;
  transition: opacity .12s ease, transform .12s ease;
}
.chart-tooltip-target::before {
  content: '';
  position: absolute;
  left: 50%;
  bottom: calc(100% + 2px);
  transform: translateX(-50%);
  border: 6px solid transparent;
  border-top-color: #111827;
  opacity: 0;
  z-index: 51;
}
.chart-tooltip-target:hover::after,
.chart-tooltip-target:focus::after,
.chart-tooltip-target:hover::before,
.chart-tooltip-target:focus::before { opacity: 1; }
.chart-tooltip-target:hover::after,
.chart-tooltip-target:focus::after { transform: translateX(-50%) translateY(-2px); }

/* v10.18.3: filtros proporcionados y tooltips visibles fuera del gráfico */
.cfa-filter-panel,
.filters.guided-filters,
.filters.clean-filters,
.filters.wide-filter-panel {
  align-items: start;
}
.cfa-filter-grid,
.filters.clean-filters,
.filters.wide-filter-panel,
.cxc-filters .filter-row {
  gap: 12px;
}
.filters .filter-field,
.cxc-filters .filter-field,
.guided-filters .filter-field,
.wide-filter-panel .filter-field,
.clean-filters .filter-field {
  display: flex !important;
  flex-direction: column !important;
  justify-content: flex-start !important;
  gap: 6px !important;
  min-width: 170px !important;
  min-height: 0 !important;
  height: auto !important;
  flex: 1 1 170px !important;
  font-weight: 800;
  color: #111827;
  line-height: 1.2;
}
.filters .filter-field select,
.filters .filter-field input,
.cxc-filters .filter-field select,
.cxc-filters .filter-field input,
.guided-filters .filter-field select,
.guided-filters .filter-field input,
.wide-filter-panel .filter-field select,
.wide-filter-panel .filter-field input,
.clean-filters .filter-field select,
.clean-filters .filter-field input {
  width: 100% !important;
  height: 44px !important;
  min-height: 44px !important;
  max-height: 44px !important;
  flex: 0 0 auto !important;
  box-sizing: border-box !important;
}
.filters .filter-field span,
.filters .filter-field small,
.filter-mini-help {
  display: block;
  color: #4b5563;
  font-size: 11px;
  line-height: 1.3;
  font-weight: 500;
  min-height: 28px;
}
.filter-field.filter-field-wide { flex-basis: 320px !important; min-width: 280px !important; }
.filter-field.filter-field-small { flex-basis: 135px !important; min-width: 135px !important; }
.filters .btn,
.clean-filters .btn,
.wide-filter-panel .btn {
  align-self: center;
  min-height: 44px;
  white-space: nowrap;
}
.auto-filter-guide,
.filter-help-box {
  flex: 0 0 100% !important;
  margin-bottom: 2px;
}
.filter-date {
  display: flex !important;
  align-items: center !important;
  gap: 8px !important;
  min-height: 44px !important;
  white-space: nowrap !important;
}
.filter-date input { height: 44px !important; min-height: 44px !important; }
.month-chart,
.month-bars,
.month-group,
.month-bar-wrap,
.dashboard-chart-card,
.dashboard-chart-grid,
.bar-chart-list,
.bar-row {
  overflow: visible;
}
.cfa-floating-tooltip {
  position: fixed;
  z-index: 999999;
  max-width: 320px;
  padding: 10px 12px;
  border-radius: 12px;
  background: #111827;
  color: #fff;
  box-shadow: 0 18px 36px rgba(15, 23, 42, .28);
  font-size: 12px;
  line-height: 1.35;
  white-space: pre-line;
  pointer-events: none;
  opacity: 0;
  transform: translate(-50%, -8px);
  transition: opacity .08s ease;
}
.cfa-floating-tooltip.is-visible { opacity: 1; }
.chart-tooltip-target::after,
.chart-tooltip-target::before { display: none !important; }

/* v10.18.3: Clientes por canal, periodo compacto dentro del módulo */
.period-panel.period-panel-inline {
  margin-top: 12px;
  border-left: 5px solid #d3072a;
}
.period-panel-inline .panel-header { margin-bottom: 10px; }
.period-panel-inline .wide-filter-panel {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}
.period-panel-inline .filter-help-box { grid-column: 1 / -1; }
@media (max-width: 900px) {
  .filters .filter-field,
  .cxc-filters .filter-field,
  .guided-filters .filter-field,
  .wide-filter-panel .filter-field,
  .clean-filters .filter-field,
  .filter-field.filter-field-wide,
  .filter-field.filter-field-small { flex-basis: 100% !important; min-width: 0 !important; }
}


/* v10.18.4: corrección visual pura — sistema reutilizable de filtros, tablas y tooltips.
   No altera lógica, endpoints, datos ni cálculos. */
.panel-header.cxc-panel-header,
.panel-header:has(.filters) {
  display: block !important;
  align-items: initial !important;
}
.panel-header.cxc-panel-header > div:first-child,
.panel-header:has(.filters) > div:first-child {
  margin-bottom: 14px !important;
}
.panel-header .filters {
  width: 100% !important;
  margin-top: 14px !important;
}

/* Panel de filtros unificado */
.filters.guided-filters,
.filters.clean-filters.guided-filters,
.filters.clean-filters.wide-filter-panel,
.filters.clean-filters.base-filters,
.filters.clean-filters.teachers-filters,
.filters.clean-filters.cohortes-filters,
.filters.clean-filters.integration-filter-panel,
.filters.clean-filters.audit-filter-panel,
.filters.clean-filters.treasury-filters,
.filters.clean-filters.movements-filters,
.filters.cxc-filters,
.cfa-filter-panel,
.cfa-filter-grid {
  display: grid !important;
  grid-template-columns: repeat(12, minmax(0, 1fr)) !important;
  gap: 14px !important;
  align-items: start !important;
  width: 100% !important;
  max-width: 100% !important;
  margin-bottom: 16px !important;
}

/* En módulos CxC/paquetes había filas internas que rompían la grilla. */
.filters.guided-filters .filter-row,
.filters.cxc-filters .filter-row,
.cxc-filters .filter-row-primary,
.cxc-filters .filter-row-dates {
  display: contents !important;
}

.filter-help-box,
.auto-filter-guide,
.filters.guided-filters > .filter-help-box,
.filters.clean-filters > .filter-help-box,
.filters.cxc-filters > .filter-help-box {
  grid-column: 1 / -1 !important;
  width: 100% !important;
  margin: 0 0 2px 0 !important;
  min-width: 0 !important;
}

/* Wrapper único label + campo + ayuda */
.filters .filter-field,
.filters.clean-filters .filter-field,
.filters.guided-filters .filter-field,
.filters.wide-filter-panel .filter-field,
.filters.base-filters .filter-field,
.filters.teachers-filters .filter-field,
.filters.cohortes-filters .filter-field,
.filters.integration-filter-panel .filter-field,
.filters.audit-filter-panel .filter-field,
.filters.treasury-filters .filter-field,
.filters.movements-filters .filter-field,
.cxc-filters .filter-field {
  grid-column: span 2 !important;
  display: flex !important;
  flex-direction: column !important;
  justify-content: flex-start !important;
  align-items: stretch !important;
  gap: 6px !important;
  min-width: 0 !important;
  width: 100% !important;
  height: auto !important;
  min-height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  color: #111827 !important;
  font-size: 12px !important;
  font-weight: 800 !important;
  line-height: 1.25 !important;
  box-sizing: border-box !important;
}

.filters .filter-field.filter-field-small,
.cxc-filters .filter-field.filter-field-small { grid-column: span 2 !important; }
.filters .filter-field.filter-field-wide,
.cxc-filters .filter-field.filter-field-wide { grid-column: span 3 !important; }

/* Campos base uniformes */
.filters .filter-field select,
.filters .filter-field input,
.filters .filter-field textarea,
.filters.clean-filters .filter-field select,
.filters.clean-filters .filter-field input,
.filters.guided-filters .filter-field select,
.filters.guided-filters .filter-field input,
.filters.wide-filter-panel .filter-field select,
.filters.wide-filter-panel .filter-field input,
.filters.base-filters .filter-field select,
.filters.base-filters .filter-field input,
.filters.teachers-filters .filter-field select,
.filters.teachers-filters .filter-field input,
.filters.cohortes-filters .filter-field select,
.filters.cohortes-filters .filter-field input,
.cxc-filters .filter-field select,
.cxc-filters .filter-field input {
  width: 100% !important;
  min-width: 0 !important;
  height: 44px !important;
  min-height: 44px !important;
  max-height: 44px !important;
  box-sizing: border-box !important;
  border-radius: 12px !important;
  padding: 0 14px !important;
  font-size: 13px !important;
  line-height: 44px !important;
  align-self: stretch !important;
}

.filters .filter-field input[type="date"] {
  line-height: normal !important;
  padding-top: 0 !important;
  padding-bottom: 0 !important;
}

/* Texto de ayuda con espacio reservado: evita que una fila se rompa cuando otro filtro sí tiene ayuda. */
.filters .filter-field span,
.filters .filter-field small,
.filters .filter-mini-help,
.filters .filter-help {
  display: block !important;
  min-height: 30px !important;
  max-height: 36px !important;
  overflow: hidden !important;
  color: #4b5563 !important;
  font-size: 10.5px !important;
  line-height: 1.3 !important;
  font-weight: 500 !important;
  margin: 0 !important;
}

/* Soporte para filtros antiguos que tienen select/input directos sin wrapper. */
.filters.clean-filters.base-filters > select,
.filters.clean-filters.base-filters > input,
.filters.clean-filters.teachers-filters > select,
.filters.clean-filters.teachers-filters > input,
.filters.clean-filters.cohortes-filters > select,
.filters.clean-filters.cohortes-filters > input,
.filters.clean-filters.integration-filter-panel > input,
.filters.clean-filters.audit-filter-panel > input,
.filters.clean-filters.audit-filter-panel > select,
.filters.clean-filters > select,
.filters.clean-filters > input {
  grid-column: span 2 !important;
  width: 100% !important;
  min-width: 0 !important;
  height: 44px !important;
  min-height: 44px !important;
  max-height: 44px !important;
  box-sizing: border-box !important;
  border-radius: 12px !important;
  padding: 0 14px !important;
  font-size: 13px !important;
}
.filters.clean-filters > input[id*="Q"],
.filters.clean-filters > input[id$="Q"],
.filters.clean-filters > input[placeholder*="Buscar"],
.filters.clean-filters.base-filters > #filterQ,
.filters.clean-filters.teachers-filters > #filterQ,
.filters.clean-filters.cohortes-filters > #filterQ,
.filters.clean-filters.integration-filter-panel > input:not([type="date"]) {
  grid-column: span 3 !important;
}

/* Labels antiguos de integración/auditoría */
.filters.clean-filters.integration-filter-panel label,
.filters.clean-filters.audit-filter-panel label {
  grid-column: span 2 !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 6px !important;
  min-width: 0 !important;
  margin: 0 !important;
  font-weight: 800 !important;
  font-size: 12px !important;
}
.filters.clean-filters.integration-filter-panel label input,
.filters.clean-filters.audit-filter-panel label input,
.filters.clean-filters.audit-filter-panel label select {
  width: 100% !important;
  height: 44px !important;
  min-height: 44px !important;
  box-sizing: border-box !important;
}

/* Botones alineados con la base del campo, nunca encima del buscador. */
.filters > .btn,
.filters.clean-filters > .btn,
.filters.guided-filters > .btn,
.filters.wide-filter-panel > .btn,
.filters.base-filters > .btn,
.filters.teachers-filters > .btn,
.filters.cohortes-filters > .btn,
.filters.integration-filter-panel > .btn,
.filters.audit-filter-panel > .btn,
.filters.cxc-filters > .btn,
.filters .filter-row > .btn,
.filters #btnClearFilters,
.filters #btnClear,
.filters button[id*="Clear"],
.filters button[id*="btn"] {
  grid-column: span 2 !important;
  width: 100% !important;
  min-width: 0 !important;
  height: 44px !important;
  min-height: 44px !important;
  max-height: 44px !important;
  align-self: start !important;
  margin: 22px 0 0 0 !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  white-space: nowrap !important;
  box-sizing: border-box !important;
}

/* Checkbox integrado a la grilla */
.filters .check-filter,
.wide-filter-panel .check-filter {
  grid-column: span 3 !important;
  width: 100% !important;
  min-width: 0 !important;
  height: 44px !important;
  min-height: 44px !important;
  margin: 22px 0 0 0 !important;
  box-sizing: border-box !important;
  display: flex !important;
  align-items: center !important;
  justify-content: flex-start !important;
  gap: 8px !important;
}
.filters .check-filter input {
  width: auto !important;
  height: auto !important;
  min-height: 0 !important;
  flex: 0 0 auto !important;
}

/* Filtros de fecha con contenedores antiguos */
.filter-date {
  display: flex !important;
  align-items: center !important;
  gap: 8px !important;
  min-width: 0 !important;
  height: 44px !important;
  min-height: 44px !important;
  margin: 0 !important;
  white-space: nowrap !important;
}
.filter-date input { height: 44px !important; min-height: 44px !important; min-width: 0 !important; }

/* Tablas: patrón visual uniforme sin alterar columnas ni datos. */
.table-wrap {
  width: 100% !important;
  overflow: auto !important;
  border-radius: 16px !important;
}
.table-wrap table {
  border-collapse: collapse !important;
}
.table-wrap th,
.table-wrap td {
  vertical-align: middle !important;
  line-height: 1.25 !important;
}
.table-wrap th {
  white-space: nowrap !important;
}
.table-wrap td {
  word-break: normal !important;
  overflow-wrap: anywhere !important;
}
.table-wrap td .btn,
.table-wrap .btn.small {
  min-height: 32px !important;
  height: auto !important;
  margin: 0 !important;
}

/* Tooltips de gráficos: separados del puntero y visibles encima de todo. */
.cfa-floating-tooltip {
  position: fixed !important;
  z-index: 2147483647 !important;
  max-width: 340px !important;
  padding: 10px 12px !important;
  border-radius: 12px !important;
  background: #111827 !important;
  color: #fff !important;
  box-shadow: 0 18px 36px rgba(15, 23, 42, .32) !important;
  font-size: 12px !important;
  line-height: 1.35 !important;
  white-space: pre-line !important;
  pointer-events: none !important;
  opacity: 0 !important;
  transform: none !important;
  transition: opacity .08s ease !important;
}
.cfa-floating-tooltip.is-visible { opacity: 1 !important; }
.chart-tooltip-target::after,
.chart-tooltip-target::before { display: none !important; }
.month-chart,
.month-bars,
.month-group,
.month-bar-wrap,
.dashboard-chart-card,
.dashboard-chart-grid,
.bar-chart-list,
.bar-row { overflow: visible !important; }

/* Responsive limpio */
@media (max-width: 1500px) {
  .filters .filter-field,
  .filters.clean-filters > select,
  .filters.clean-filters > input,
  .filters.clean-filters.integration-filter-panel label,
  .filters.clean-filters.audit-filter-panel label { grid-column: span 3 !important; }
  .filters .filter-field.filter-field-wide,
  .filters.clean-filters > input[id*="Q"],
  .filters.clean-filters > input[placeholder*="Buscar"] { grid-column: span 6 !important; }
  .filters > .btn,
  .filters.clean-filters > .btn,
  .filters button[id*="Clear"],
  .filters button[id*="btn"] { grid-column: span 3 !important; }
}
@media (max-width: 980px) {
  .filters.guided-filters,
  .filters.clean-filters.guided-filters,
  .filters.clean-filters.wide-filter-panel,
  .filters.clean-filters.base-filters,
  .filters.clean-filters.teachers-filters,
  .filters.clean-filters.cohortes-filters,
  .filters.clean-filters.integration-filter-panel,
  .filters.clean-filters.audit-filter-panel,
  .filters.cxc-filters { grid-template-columns: repeat(6, minmax(0, 1fr)) !important; }
  .filters .filter-field,
  .filters.clean-filters > select,
  .filters.clean-filters > input,
  .filters.clean-filters.integration-filter-panel label,
  .filters.clean-filters.audit-filter-panel label,
  .filters > .btn,
  .filters.clean-filters > .btn,
  .filters button[id*="Clear"],
  .filters button[id*="btn"] { grid-column: span 3 !important; }
  .filters .filter-field.filter-field-wide,
  .filters.clean-filters > input[id*="Q"],
  .filters.clean-filters > input[placeholder*="Buscar"] { grid-column: 1 / -1 !important; }
}
@media (max-width: 680px) {
  .filters.guided-filters,
  .filters.clean-filters.guided-filters,
  .filters.clean-filters.wide-filter-panel,
  .filters.clean-filters.base-filters,
  .filters.clean-filters.teachers-filters,
  .filters.clean-filters.cohortes-filters,
  .filters.clean-filters.integration-filter-panel,
  .filters.clean-filters.audit-filter-panel,
  .filters.cxc-filters { grid-template-columns: 1fr !important; }
  .filters .filter-field,
  .filters .filter-field.filter-field-wide,
  .filters .filter-field.filter-field-small,
  .filters.clean-filters > select,
  .filters.clean-filters > input,
  .filters.clean-filters.integration-filter-panel label,
  .filters.clean-filters.audit-filter-panel label,
  .filters > .btn,
  .filters.clean-filters > .btn,
  .filters .check-filter,
  .filters button[id*="Clear"],
  .filters button[id*="btn"] { grid-column: 1 / -1 !important; }
}


/* v10.18.4 ajuste final: filtros horizontales tipo formulario administrativo.
   Mantiene la lógica intacta; solo corrige layout, proporción y responsive. */
.filters.guided-filters,
.filters.clean-filters.guided-filters,
.filters.clean-filters.wide-filter-panel,
.filters.clean-filters.base-filters,
.filters.clean-filters.teachers-filters,
.filters.clean-filters.cohortes-filters,
.filters.clean-filters.integration-filter-panel,
.filters.clean-filters.audit-filter-panel,
.filters.clean-filters.treasury-filters,
.filters.clean-filters.movements-filters,
.filters.cxc-filters,
.cfa-filter-panel,
.cfa-filter-grid {
  display: grid !important;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)) !important;
  gap: 14px !important;
  align-items: start !important;
  width: 100% !important;
}
.filters .filter-field,
.filters.clean-filters .filter-field,
.filters.guided-filters .filter-field,
.filters.wide-filter-panel .filter-field,
.filters.base-filters .filter-field,
.filters.teachers-filters .filter-field,
.filters.cohortes-filters .filter-field,
.filters.integration-filter-panel .filter-field,
.filters.audit-filter-panel .filter-field,
.filters.treasury-filters .filter-field,
.filters.movements-filters .filter-field,
.cxc-filters .filter-field,
.filters.clean-filters > select,
.filters.clean-filters > input,
.filters.clean-filters.integration-filter-panel label,
.filters.clean-filters.audit-filter-panel label {
  grid-column: span 1 !important;
  min-width: 0 !important;
}
.filters .filter-field.filter-field-wide,
.cxc-filters .filter-field.filter-field-wide,
.filters.clean-filters > input[id*="Q"],
.filters.clean-filters > input[placeholder*="Buscar"] {
  grid-column: span 2 !important;
}
.filters .filter-field.filter-field-small,
.cxc-filters .filter-field.filter-field-small {
  grid-column: span 1 !important;
}
.filters > .btn,
.filters.clean-filters > .btn,
.filters.guided-filters > .btn,
.filters.wide-filter-panel > .btn,
.filters.base-filters > .btn,
.filters.teachers-filters > .btn,
.filters.cohortes-filters > .btn,
.filters.integration-filter-panel > .btn,
.filters.audit-filter-panel > .btn,
.filters.cxc-filters > .btn,
.filters .filter-row > .btn,
.filters #btnClearFilters,
.filters #btnClear,
.filters button[id*="Clear"],
.filters button[id*="btn"] {
  grid-column: span 1 !important;
  min-width: 150px !important;
}
.filters .check-filter,
.wide-filter-panel .check-filter {
  grid-column: span 2 !important;
}
@media (max-width: 900px) {
  .filters .filter-field.filter-field-wide,
  .cxc-filters .filter-field.filter-field-wide,
  .filters.clean-filters > input[id*="Q"],
  .filters.clean-filters > input[placeholder*="Buscar"],
  .filters .check-filter,
  .wide-filter-panel .check-filter {
    grid-column: 1 / -1 !important;
  }
}
@media (max-width: 680px) {
  .filters.guided-filters,
  .filters.clean-filters.guided-filters,
  .filters.clean-filters.wide-filter-panel,
  .filters.clean-filters.base-filters,
  .filters.clean-filters.teachers-filters,
  .filters.clean-filters.cohortes-filters,
  .filters.clean-filters.integration-filter-panel,
  .filters.clean-filters.audit-filter-panel,
  .filters.cxc-filters {
    grid-template-columns: 1fr !important;
  }
  .filters .filter-field,
  .filters .filter-field.filter-field-wide,
  .filters .filter-field.filter-field-small,
  .filters.clean-filters > select,
  .filters.clean-filters > input,
  .filters.clean-filters.integration-filter-panel label,
  .filters.clean-filters.audit-filter-panel label,
  .filters > .btn,
  .filters.clean-filters > .btn,
  .filters .check-filter,
  .filters button[id*="Clear"],
  .filters button[id*="btn"] {
    grid-column: 1 / -1 !important;
    min-width: 0 !important;
  }
}

/* v10.19.5: Gestión operativa por teacher compacta con porcentajes por estatus y variación visible */
.teacher-ops-table {
  font-size: 12px;
  width: 100%;
  min-width: 0;
  table-layout: fixed;
}
.teacher-ops-wrap {
  width: 100%;
}
.teacher-ops-table th,
.teacher-ops-table td {
  padding: 7px 8px;
  vertical-align: middle;
}
.teacher-ops-table .teacher-col-name { width: 16%; }
.teacher-ops-table .teacher-col-num { width: 9%; }
.teacher-ops-table .teacher-col-variation { width: 39%; }
.teacher-ops-table th:last-child,
.teacher-ops-table td:last-child {
  min-width: 0;
}
.teacher-metric-main {
  font-weight: 700;
  margin-right: 4px;
}
.teacher-metric-pct {
  color: var(--muted);
  font-size: 10px;
  white-space: nowrap;
}
.teacher-variation-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  max-width: none;
  width: 100%;
}
.teacher-var-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border: 1px solid rgba(0,0,0,.18);
  border-radius: 999px;
  padding: 3px 7px;
  font-size: 10px;
  line-height: 1.2;
  white-space: nowrap;
  background: #fff;
  box-shadow: 0 1px 2px rgba(0,0,0,.06);
}
.teacher-var-chip b {
  font-size: 10px;
  font-weight: 800;
}
.teacher-var-chip em {
  font-style: normal;
  font-weight: 700;
}

/* v10.19.9 - UX listados: encabezados visibles y resaltado de edición */
.table-wrap {
  max-height: min(72vh, 760px);
  overflow: auto !important;
  position: relative;
}
.table-wrap thead th,
.table-wrap th {
  position: sticky !important;
  top: 0 !important;
  z-index: 20 !important;
  background: var(--black, #111111) !important;
  color: #ffffff !important;
  box-shadow: 0 2px 0 rgba(0,0,0,.12) !important;
}
.row-highlight-updated td {
  animation: cfaUpdatedRow 2.8s ease-out;
}
@keyframes cfaUpdatedRow {
  0% { background: #fff7ed; }
  60% { background: #fef3c7; }
  100% { background: inherit; }
}
.wide-kpi-card { grid-column: 1 / -1; min-height: auto !important; }
.teacher-variation-grid { display: grid !important; grid-template-columns: repeat(auto-fit, minmax(145px, 1fr)) !important; gap: 8px !important; width: 100% !important; align-items: stretch !important; }
.teacher-var-chip { display:flex !important; justify-content:space-between !important; align-items:center !important; gap:8px !important; min-width:0 !important; width:100% !important; }
.money-cell { text-align: right; white-space: nowrap; }

/* v10.19.12 - Paquetes de cortesía: monto no editable ni validable como venta */
.input-disabled,
input.input-disabled:disabled {
  background: #f4f4f5 !important;
  color: #555 !important;
  cursor: not-allowed !important;
  border-style: dashed !important;
}


.mini-table-wrap table { min-width: 760px; }
.mini-empty { margin: 8px 0 0; color: #047857; font-weight: 700; }
.total-row td {
  background: #f8fafc;
  border-top: 2px solid rgba(15, 23, 42, .12);
}

/* v10.21.10 — totales filtrados discretos debajo de tablas */
.auto-filtered-summary-bar {
  padding: 8px 10px !important;
  margin: 8px 0 0 !important;
  border-radius: 12px !important;
  font-size: 12px !important;
  background: #f9fafb !important;
}
.auto-filtered-summary-bar::before {
  content: 'Total visible filtrado';
  font-weight: 800;
  color: #111827;
  margin-right: 4px;
}
.auto-filtered-summary-bar span {
  padding: 4px 8px !important;
  font-size: 12px !important;
}

/* v10.21.11 — Totales de tablas discretos: mismo tamaño que la tabla, no KPI. */
.dashboard-kpi .table-wrap table strong,
.dashboard-kpi .table-wrap table .total-row strong,
.dashboard-kpi .table-wrap table .money-cell strong,
.table-wrap table .total-row strong {
  font-size: 13px !important;
  line-height: 1.25 !important;
  letter-spacing: 0 !important;
  white-space: normal !important;
  overflow: visible !important;
  text-overflow: initial !important;
}
.dashboard-kpi .table-wrap table .total-row td,
.table-wrap table .total-row td {
  font-size: 13px !important;
  line-height: 1.25 !important;
  font-weight: 700 !important;
  background: #f8fafc !important;
  border-top: 1px solid rgba(15, 23, 42, .14) !important;
  padding: 10px 11px !important;
}
.dashboard-kpi .table-wrap table .total-row td:first-child,
.table-wrap table .total-row td:first-child {
  color: #111827 !important;
}
.dashboard-kpi .auto-filtered-summary-bar {
  display: none !important;
}

/* v10.21.13 - Guías rápidas por sección: caja breve, sin alterar la lógica ni el layout base */
.process-guide {
  margin: -6px 0 14px;
  padding: 10px 12px;
  border: 1px solid rgba(15, 23, 42, 0.10);
  border-left: 4px solid var(--red, #d80d2f);
  border-radius: 12px;
  background: #fff7f8;
  color: #334155;
  font-size: 13px;
  line-height: 1.45;
  font-weight: 600;
}
.process-guide strong {
  color: #111827;
  font-weight: 900;
}
@media (max-width: 900px) {
  .process-guide { margin-top: -2px; font-size: 12.5px; }
}


/* v10.21.13 - Manual desplegable por sección auditado */
.process-guide.section-guide {
  display: block;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-left: 4px solid #d40b2f;
  border-radius: 12px;
  padding: 0;
  margin: 8px 0 14px;
  color: #111827;
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.04);
}
.process-guide.section-guide summary {
  cursor: pointer;
  list-style: none;
  font-weight: 800;
  font-size: 13px;
  padding: 10px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.process-guide.section-guide summary::-webkit-details-marker { display: none; }
.process-guide.section-guide summary::after {
  content: 'Abrir guía';
  font-size: 11px;
  font-weight: 800;
  color: #d40b2f;
  background: #fff1f3;
  border-radius: 999px;
  padding: 4px 9px;
  white-space: nowrap;
}
.process-guide.section-guide[open] summary::after { content: 'Cerrar guía'; }
.process-guide.section-guide .section-guide-body {
  border-top: 1px solid #eef2f7;
  padding: 10px 14px 12px;
}
.process-guide.section-guide .section-guide-body p {
  margin: 0 0 7px;
  font-size: 12.5px;
  line-height: 1.45;
  color: #374151;
}
.process-guide.section-guide .section-guide-body p:last-child { margin-bottom: 0; }
.dashboard-guide { margin: 6px 0 12px; }
@media (max-width: 900px) {
  .process-guide.section-guide summary { align-items: flex-start; }
  .process-guide.section-guide summary::after { margin-top: -1px; }
}

/* v10.21.17 — Salud financiera avanzada + alineación UX de tablas Dashboard */
.dashboard-kpi-block {
  scroll-margin-top: 18px;
}
.dashboard-table-card {
  min-height: auto !important;
  height: auto !important;
  overflow: visible !important;
  padding-top: 14px !important;
}
.dashboard-table-card > span {
  display: block;
  margin-bottom: 4px;
}
.dashboard-table-card > small {
  display: block;
  margin: 0 0 10px !important;
  color: #6b7280 !important;
  font-size: 12px !important;
  line-height: 1.35 !important;
}
.dashboard-table-wrap {
  margin-top: 8px !important;
  max-height: min(68vh, 720px) !important;
  border: 1px solid #e5e7eb !important;
  border-radius: 14px !important;
}
.dashboard-data-table {
  min-width: 860px;
  table-layout: fixed !important;
  width: 100% !important;
}
.dashboard-data-table th,
.dashboard-data-table td {
  padding: 10px 12px !important;
  font-size: 13px !important;
  vertical-align: middle !important;
}
.dashboard-data-table th.text-cell,
.dashboard-data-table td.text-cell { text-align: left !important; }
.dashboard-data-table th.center-cell,
.dashboard-data-table td.center-cell { text-align: center !important; }
.dashboard-data-table th.money-cell,
.dashboard-data-table td.money-cell,
.dashboard-data-table th.percent-cell,
.dashboard-data-table td.percent-cell { text-align: right !important; }
.dashboard-data-table td.money-cell,
.dashboard-data-table td.percent-cell {
  font-variant-numeric: tabular-nums !important;
  white-space: nowrap !important;
}
.dashboard-data-table .total-row td {
  font-weight: 700 !important;
}
.dashboard-net-table th,
.dashboard-net-table td {
  white-space: nowrap !important;
}


/* v10.21.21 — Dashboard: historial mensual de costos por concepto */
.dashboard-history-card { align-self: stretch; }
.dashboard-history-table-wrap { max-height: 420px; overflow: auto; }
.dashboard-cost-history-table { min-width: 1180px; table-layout: fixed; }
.dashboard-cost-history-table th,
.dashboard-cost-history-table td { vertical-align: middle; }
.cost-history-summary {
  font-size: 12px;
  color: #334155;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 8px 10px;
  margin: 8px 0 10px;
}

/* v10.21.22 — Dashboard: presupuesto mensual, comparativo de costos por concepto y estandarización teacher */
.dashboard-budget-card,
.dashboard-history-card {
  grid-column: 1 / -1;
}
.dashboard-budget-table-wrap,
.dashboard-teacher-finance-wrap {
  margin-top: 10px !important;
  max-height: 520px !important;
}
.dashboard-budget-table,
.dashboard-teacher-finance-table {
  min-width: 980px;
}
.dashboard-teacher-finance-table th,
.dashboard-teacher-finance-table td,
.dashboard-budget-table th,
.dashboard-budget-table td {
  vertical-align: middle !important;
}
.dashboard-teacher-finance-wrap {
  border-radius: 14px !important;
  border: 1px solid #e5e7eb !important;
  overflow: auto !important;
}
.cost-history-executive {
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  overflow: hidden;
  margin-top: 10px;
  background: #fff;
}
.cost-history-head,
.cost-history-detail summary {
  display: grid;
  grid-template-columns: minmax(210px, 1.4fr) minmax(150px, .9fr) minmax(130px, .8fr) minmax(140px, .8fr) minmax(160px, 1fr);
  gap: 12px;
  align-items: center;
}
.cost-history-head {
  background: #111;
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  padding: 11px 13px;
}
.cost-history-detail {
  border-top: 1px solid #e5e7eb;
}
.cost-history-detail:first-of-type {
  border-top: 0;
}
.cost-history-detail summary {
  cursor: pointer;
  list-style: none;
  padding: 12px 13px;
  font-size: 13px;
  font-weight: 700;
  background: #fff;
}

.cost-history-head span:nth-child(3),
.cost-history-head span:nth-child(4),
.cost-history-detail summary span:nth-child(3),
.cost-history-detail summary span:nth-child(4) {
  text-align: right;
  justify-self: end;
}
.cost-history-head span:nth-child(5),
.cost-history-detail summary span:nth-child(5) {
  text-align: left;
  justify-self: start;
}
.cost-history-detail summary::-webkit-details-marker { display: none; }
.cost-history-detail summary:hover { background: #f8fafc; }
.cost-history-detail[open] summary { background: #fff7f8; border-bottom: 1px solid #ffe4e9; }
.cost-history-name { color: #111827; font-weight: 800; }
.cost-history-class { color: #475569; font-weight: 700; }
.cost-history-inner-wrap {
  margin: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  max-height: 320px !important;
}
.cost-history-inner-table {
  min-width: 980px;
}
.cost-history-inner-table thead th {
  background: #1f2937 !important;
}
@media (max-width: 1100px) {
  .cost-history-head,
  .cost-history-detail summary {
    grid-template-columns: 1fr;
    gap: 5px;
  }
  .cost-history-head span:nth-child(n+3) { display: none; }
  .cost-history-detail summary span { display: block; }
}


/* v10.21.23 — Presupuesto operativo sin socios + comparativo compacto por grupos */
.cost-history-compact {
  margin-top: 10px;
  display: grid;
  gap: 10px;
}
.cost-history-group {
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  background: #fff;
  overflow: hidden;
}
.cost-history-group > summary {
  cursor: pointer;
  list-style: none;
  display: grid;
  grid-template-columns: minmax(240px, 1.5fr) minmax(110px, .7fr) minmax(130px, .8fr) minmax(130px, .8fr);
  align-items: center;
  gap: 12px;
  padding: 13px 14px;
  font-size: 13px;
  font-weight: 800;
  background: #f8fafc;
}
.cost-history-group > summary::-webkit-details-marker { display: none; }
.cost-history-group > summary:hover { background: #f1f5f9; }
.cost-history-group[open] > summary {
  background: #111;
  color: #fff;
}
.cost-history-group[open] > summary .status-ok,
.cost-history-group[open] > summary .status-inactive { color: inherit !important; }
.cost-history-group-title { color: inherit; }
.cost-history-group-count {
  color: inherit;
  opacity: .85;
  font-weight: 700;
}
.cost-history-group-note {
  margin: 10px 14px;
  font-size: 12px;
  color: #475569;
}
.cost-history-group .cost-history-executive {
  margin: 10px 14px 14px;
}
@media (max-width: 1100px) {
  .cost-history-group > summary {
    grid-template-columns: 1fr;
    gap: 5px;
  }
}

/* v10.21.28 - filtro global de periodo del Dashboard */
.dashboard-period-filter {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin: 10px 0 8px;
  padding: 10px 12px;
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  background: #fafafa;
}
.dashboard-period-filter label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 700;
  color: #111827;
}
.dashboard-period-filter input[type="month"] {
  height: 34px;
  border: 1px solid #d1d5db;
  border-radius: 10px;
  padding: 0 10px;
  font-size: 13px;
  background: #fff;
}
.dashboard-period-filter .hint {
  flex: 1 1 280px;
  font-size: 12px;
  color: #6b7280;
}
@media (max-width: 720px) {
  .dashboard-period-filter { align-items: stretch; }
  .dashboard-period-filter label,
  .dashboard-period-filter .btn { width: 100%; justify-content: center; }
  .dashboard-period-filter input[type="month"] { flex: 1; }
}


.market-table-note {
  margin: 6px 0 10px;
  font-size: 0.86rem;
  color: var(--muted-text, #4b5563);
}
.commercial-reconcile-table {
  margin-top: 10px;
  max-height: 320px;
}

/* v10.21.35 — UX Dashboard: bloques largos a ancho completo y bloques cortos agrupados.
   Corrección visual pura. No cambia datos, cálculos, endpoints ni base de datos. */
.dashboard-wide-panel,
.dashboard-compact-panel,
.dashboard-market-panel {
  width: 100%;
  box-sizing: border-box;
}
.dashboard-commercial-card .bar-chart-list,
.dashboard-market-section .bar-chart-list {
  margin-bottom: 14px;
}
.dashboard-market-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
  margin-top: 18px;
}
.dashboard-market-section {
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
  padding: 16px;
  border: 1px solid #e5e7eb;
  border-radius: 18px;
  background: #ffffff;
  overflow: hidden;
}
.dashboard-market-section h4 {
  margin: 0 0 8px;
  color: #111827;
  font-size: 1rem;
}
.dashboard-commercial-card .dashboard-table-wrap,
.dashboard-market-section .dashboard-table-wrap {
  width: 100%;
  max-width: 100%;
}
.dashboard-commercial-card .commercial-reconcile-table,
.dashboard-sector-section .commercial-reconcile-table {
  max-height: 440px;
}
.dashboard-income-section .dashboard-table-wrap {
  max-height: 520px;
}
.dashboard-short-card-row {
  align-items: start;
}
.dashboard-short-card-row .panel {
  height: auto;
  margin-bottom: 0;
}
.dashboard-two-columns > .panel:only-child {
  grid-column: 1 / -1;
}
@media (min-width: 1180px) {
  .dashboard-market-panel .dashboard-kpi-grid {
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  }
}
@media (max-width: 980px) {
  .dashboard-market-section {
    padding: 14px;
  }
}

/* v10.21.43 · Inteligencia financiera gerencial */
.dashboard-wide-panel { width: 100%; }
.dashboard-data-table .status-ok, .status-ok { color: #166534; font-weight: 700; }
.dashboard-data-table .status-inactive, .status-inactive { color: #b91c1c; font-weight: 700; }
.dashboard-data-table .status-warning, .status-warning { color: #a16207; font-weight: 700; }
#dashboardFinancialIntelligence h4 { margin: 1rem 0 .5rem; }
.manual-rules-grid .module-help-card span { font-weight: 800; }

/* v10.21.44 · Integración visual de inteligencia financiera sin romper estándar del Dashboard */
#dashboardFinancialIntelligencePanel {
  margin: 18px 0;
}
#dashboardFinancialIntelligence .dashboard-kpi-grid {
  grid-template-columns: repeat(auto-fit, minmax(215px, 1fr));
  align-items: stretch;
}
#dashboardFinancialIntelligence .dashboard-kpi {
  min-height: 128px;
  display: grid;
  align-content: start;
  gap: 6px;
}
#dashboardFinancialIntelligence .dashboard-kpi em {
  display: block;
  color: #6b7280;
  font-style: normal;
  font-size: 11.5px;
  line-height: 1.35;
  margin-top: 2px;
}
#dashboardFinancialIntelligence .compact-title {
  margin-top: 18px;
  margin-bottom: 8px;
}
#dashboardFinancialIntelligence .compact-title h4 { margin: 0; }
#dashboardFinancialIntelligence .compact-title p { margin: 4px 0 0; color: #6b7280; font-size: 12.5px; }

/* v10.21.45 · Ajustes finos UX inteligencia financiera y escenarios */
#dashboardFinancialIntelligencePanel {
  margin-top: 22px;
}
#dashboardFinancialIntelligence .dashboard-kpi-grid {
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 14px;
}
#dashboardFinancialIntelligence .dashboard-kpi {
  min-height: 132px;
  padding: 18px 20px;
}
#dashboardFinancialIntelligence .dashboard-kpi small {
  display: block;
  margin-top: 6px;
  color: #4b5563;
  font-size: 12px;
  line-height: 1.38;
}
.scenario-help {
  margin: 8px 0 10px;
  padding: 10px 12px;
  border: 1px solid #f3c4cd;
  background: #fff7f8;
  border-radius: 12px;
  color: #1f2937;
  font-size: 13px;
}
.scenario-table th,
.scenario-table td {
  vertical-align: middle;
}
.scenario-table .money-cell,
.gerencial-scenario-table .money-cell {
  text-align: right;
  white-space: nowrap;
}

/* v10.21.46 · escenarios gerenciales sin totales acumulables */
.scenario-reading-box {
  margin: 10px 0 0;
  padding: 12px 14px;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  background: #f8fafc;
  color: #334155;
  line-height: 1.45;
}
.scenario-reading-box p { margin: 4px 0; }
.no-auto-total + .auto-filtered-summary-bar { display:none !important; }


/* Rediseño visual exclusivo de la pantalla inicial · v10.21.65 home visual */
body.admin-body {
  background: #f7f8fb;
}
.admin-sidebar {
  width: 310px;
  padding: 22px 18px;
  background: radial-gradient(circle at top left, rgba(200,16,46,.20), transparent 34%), linear-gradient(180deg, #16191f 0%, #090b0f 100%);
  border-right: 1px solid rgba(255,255,255,.08);
}
.admin-brand {
  padding: 2px 4px 18px;
  margin-bottom: 8px;
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.admin-brand .brand-logo-box,
.admin-brand .brand-mark {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  box-shadow: 0 14px 30px rgba(0,0,0,.28);
}
.admin-brand .brand-mark {
  background: #fff;
  color: var(--red);
}
.admin-nav .nav {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 38px;
  padding: 10px 12px;
  border-radius: 10px;
  color: rgba(255,255,255,.84);
  font-size: 13px;
  transition: transform .14s ease, background .14s ease, color .14s ease;
}
.admin-nav .nav::before {
  content: '▸';
  width: 18px;
  text-align: center;
  opacity: .86;
}
.admin-nav .module-nav-btn::before { content: none; }
.admin-nav .nav-icon {
  width: 18px;
  display: inline-flex;
  justify-content: center;
  flex: 0 0 18px;
}
.admin-nav .nav:hover {
  transform: translateX(2px);
  background: rgba(255,255,255,.09);
  color: #fff;
}
.admin-nav .nav.active {
  background: linear-gradient(135deg, #f0143a 0%, #c8102e 100%);
  color: #fff;
  box-shadow: 0 10px 24px rgba(200,16,46,.34);
}
.admin-nav .nav-group-title {
  color: rgba(255,255,255,.58);
  padding-left: 8px;
}
.admin-help {
  border-color: rgba(255,255,255,.12);
  background: rgba(255,255,255,.035);
}
.admin-main {
  padding: 18px 22px 26px;
}
.admin-topbar {
  margin-bottom: 16px;
  padding: 18px 20px;
  border: 1px solid rgba(15,23,42,.08);
  box-shadow: 0 12px 28px rgba(15,23,42,.06);
  border-radius: 18px;
}
.admin-main-actions .btn.secondary {
  background: #fff;
  border: 1px solid rgba(15,23,42,.10);
  box-shadow: 0 8px 20px rgba(15,23,42,.04);
}
.admin-main-actions .btn.secondary:hover,
.home-dashboard-btn:hover,
.home-module-card .btn:hover {
  transform: translateY(-1px);
}
.topbar-logo-placeholder,
.brand-logo:not(.hidden) {
  box-shadow: 0 10px 22px rgba(15,23,42,.08);
}

.home-index-view {
  display: none;
}
.home-index-view.active {
  display: block;
}
.home-hero-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 260px;
  gap: 14px;
  align-items: center;
  margin-bottom: 18px;
}
.home-welcome-block,
.home-period-card,
.home-footer-strip {
  background: #fff;
  border: 1px solid rgba(15,23,42,.08);
  box-shadow: 0 12px 28px rgba(15,23,42,.06);
  border-radius: 18px;
}
.home-welcome-block {
  min-height: 92px;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 18px 20px;
}
.home-hero-icon,
.home-card-icon,
.home-kpi-icon,
.home-section-icon {
  color: var(--red);
}
.home-hero-icon {
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  border-radius: 16px;
  background: #fff1f2;
  font-size: 28px;
}
.home-eyebrow {
  display: block;
  margin-bottom: 3px;
  color: var(--red);
  font-weight: 900;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .06em;
}
.home-welcome-block h2 {
  margin: 0;
  color: #0f172a;
  font-size: clamp(24px, 3vw, 32px);
  line-height: 1.05;
}
.home-welcome-block p {
  margin: 6px 0 0;
  color: #64748b;
}
.home-period-card {
  min-height: 92px;
  padding: 18px;
  display: grid;
  align-content: center;
  gap: 6px;
}
.home-period-card span,
.home-kpi-card span {
  color: #64748b;
  font-size: 12px;
  font-weight: 800;
}
.home-period-card strong {
  color: var(--red);
  font-size: 14px;
  line-height: 1.35;
}
.home-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 20px 0 12px;
}
.home-section-head > div {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
}
.home-section-head h3 {
  margin: 0;
  color: #111827;
  font-size: 15px;
  text-transform: uppercase;
  letter-spacing: .035em;
}
.home-section-head.compact {
  border-bottom: 1px solid rgba(15,23,42,.10);
  padding-bottom: 8px;
}
.home-section-icon {
  font-size: 18px;
}
.home-dashboard-btn {
  border: 1px solid var(--red) !important;
  color: var(--red) !important;
  background: #fff !important;
  transition: transform .14s ease;
}
.home-kpi-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(105px, 1fr));
  gap: 12px;
}
.home-kpi-card,
.home-module-card {
  background: #fff;
  border: 1px solid rgba(15,23,42,.08);
  border-radius: 16px;
  box-shadow: 0 10px 26px rgba(15,23,42,.055);
}
.home-kpi-card {
  min-height: 124px;
  padding: 16px;
  display: grid;
  gap: 8px;
  align-content: start;
}
.home-kpi-icon {
  font-size: 20px;
  line-height: 1;
}
.home-kpi-card strong {
  display: block;
  color: #111827;
  font-size: clamp(17px, 1.45vw, 23px);
  line-height: 1.05;
  letter-spacing: -.04em;
  white-space: nowrap;
  overflow: hidden;
}
.home-kpi-card small {
  color: #64748b;
  font-size: 11px;
}

.home-academic-teacher-strip {
  margin: 12px 0 16px;
  padding: 14px 16px 16px;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 14px;
  background: linear-gradient(180deg, #fff, #f8fafc);
  border: 1px solid rgba(15,23,42,.08);
  border-left: 4px solid var(--red);
  border-radius: 16px;
  box-shadow: 0 10px 24px rgba(15,23,42,.055);
}
.home-academic-strip-main {
  display: grid;
  gap: 4px;
  min-width: 0;
  width: 100%;
}
.home-academic-strip-main span {
  color: var(--red);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .055em;
}
.home-academic-strip-main strong {
  color: #111827;
  font-size: clamp(18px, 1.55vw, 22px);
  line-height: 1.08;
  letter-spacing: -.035em;
  white-space: normal;
  overflow-wrap: anywhere;
}
.home-academic-strip-main small {
  color: #64748b;
  font-size: 11px;
}
.home-teacher-chip-row {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  min-width: 0;
  width: 100%;
  max-width: 100%;
  flex-wrap: wrap;
  overflow: visible;
  padding-bottom: 2px;
  scrollbar-width: thin;
}
.teacher-mini-chip {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 34px;
  padding: 7px 10px;
  border-radius: 999px;
  background: #fff;
  border: 1px solid rgba(15,23,42,.10);
  color: #334155;
  box-shadow: 0 4px 12px rgba(15,23,42,.045);
  font-size: 12px;
  line-height: 1;
}
.teacher-mini-chip b {
  font-weight: 900;
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.teacher-mini-chip em {
  min-width: 24px;
  height: 24px;
  padding: 0 7px;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  background: #fff1f2;
  color: var(--red);
  font-style: normal;
  font-weight: 900;
}
.teacher-mini-chip.muted {
  color: #64748b;
  background: #f8fafc;
}
.teacher-mini-chip.warning {
  border-color: rgba(245,158,11,.35);
  background: #fffbeb;
}
.teacher-mini-chip.warning em {
  background: #fef3c7;
  color: #92400e;
}



/* B56360 P3.1 R3 UIX-0: Inicio - líderes mensuales de retiros sin superposición */
.home-retirement-leaders-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 12px;
  align-items: stretch;
  min-width: 0;
  width: 100%;
}
.home-retirement-leader-card {
  display: grid;
  gap: 5px;
  min-width: 0;
  padding: 10px 11px;
  border-radius: 14px;
  background: #fff;
  border: 1px solid rgba(15,23,42,.10);
  box-shadow: 0 5px 16px rgba(15,23,42,.045);
  overflow: hidden;
}
.home-retirement-leader-card header {
  color: var(--red);
  font-size: 11px;
  line-height: 1.15;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .045em;
}
.home-retirement-leader-card strong {
  color: #111827;
  font-size: 13px;
  line-height: 1.18;
  font-weight: 900;
  white-space: normal;
  overflow-wrap: anywhere;
}
.home-retirement-leader-metric {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
}
.home-retirement-leader-metric b {
  min-width: 28px;
  height: 26px;
  padding: 0 8px;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  background: #fff1f2;
  color: var(--red);
  font-size: 13px;
  font-weight: 900;
}
.home-retirement-leader-metric span,
.home-retirement-leader-card small,
.home-retirement-leader-card em {
  color: #64748b;
  font-size: 11px;
  line-height: 1.25;
  min-width: 0;
}
.home-retirement-leader-card small {
  display: block;
  overflow-wrap: anywhere;
}
.home-retirement-leader-card em {
  font-style: normal;
  font-weight: 800;
  color: #475569;
}
@media (max-width: 1180px) {
  .home-retirement-leaders-grid {
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  }
}
@media (max-width: 640px) {
  .home-retirement-leaders-grid {
    grid-template-columns: 1fr;
  }
}

.home-academic-retired-strip {
  margin-top: 10px;
}
.home-academic-retired-strip .home-academic-strip-main span {
  color: var(--red);
}
.home-projected-cxc-strip {
  margin-top: 10px;
}
.home-projected-cxc-strip .home-academic-strip-main span {
  color: var(--red);
}

.home-module-section {
  margin-top: 18px;
}
.home-card-grid {
  display: grid;
  gap: 12px;
}
.operation-grid,
.finance-grid {
  grid-template-columns: repeat(6, minmax(105px, 1fr));
}
.control-grid {
  grid-template-columns: repeat(3, minmax(150px, 1fr));
}
.tools-grid {
  grid-template-columns: repeat(2, minmax(150px, 1fr));
}
.home-bottom-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(320px, .9fr);
  gap: 22px;
  align-items: start;
}
.home-module-card {
  min-height: 162px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  cursor: pointer;
  transition: transform .14s ease, box-shadow .14s ease, border-color .14s ease;
}
.home-module-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 34px rgba(15,23,42,.09);
  border-color: rgba(200,16,46,.28);
}
.home-card-icon {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: #fff1f2;
  font-size: 20px;
}
.home-module-card h4 {
  margin: 2px 0 0;
  color: #111827;
  font-size: 13px;
  line-height: 1.28;
}
.home-module-card p {
  margin: 0;
  color: #64748b;
  font-size: 12px;
  line-height: 1.35;
}
.home-module-card .btn {
  width: 100%;
  margin-top: auto;
  min-height: 34px;
  padding: 8px 10px;
  font-size: 11px;
  border: 1px solid var(--red);
  transition: transform .14s ease;
}
.home-module-card .btn.secondary {
  background: #fff;
  color: var(--red);
}
.home-footer-strip {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  margin-top: 18px;
  padding: 14px 18px;
  color: #64748b;
  font-size: 12px;
}
.home-footer-strip div:first-child {
  display: flex;
  gap: 12px;
  align-items: center;
}
.home-footer-strip strong {
  color: #111827;
}
.home-footer-strip p {
  margin: 0;
}
.home-footer-brand {
  display: grid;
  justify-items: end;
  gap: 0 !important;
  text-transform: uppercase;
}
.home-footer-brand strong {
  color: #111827;
  font-size: 20px;
  line-height: 1;
}
.home-footer-brand span {
  color: #64748b;
  font-size: 9px;
  letter-spacing: .08em;
}
#dashboardView.dashboard-view .panel:first-child {
  margin-top: 0;
}

@media (max-width: 1180px) {
  .operation-grid,
  .finance-grid,
  .home-kpi-grid { grid-template-columns: repeat(3, minmax(160px, 1fr)); }
  .home-hero-panel,
  .home-bottom-layout { grid-template-columns: 1fr; }
  .control-grid,
  .tools-grid { grid-template-columns: repeat(2, minmax(160px, 1fr)); }
}
@media (max-width: 900px) {
  .home-kpi-grid,
  .operation-grid,
  .finance-grid,
  .control-grid,
  .tools-grid { grid-template-columns: 1fr; }
  .home-section-head,
  .home-footer-strip { align-items: flex-start; flex-direction: column; }
  .home-dashboard-btn { width: 100%; }
}
@media (max-width: 1000px) {
  .admin-sidebar { width: 100%; }
}

/* Alertas operativas del inicio */
.home-alerts-head { margin-top: 18px; }
.home-alerts-grid { display:grid; grid-template-columns: repeat(3, minmax(220px, 1fr)); gap:12px; margin: 10px 0 22px; }
.home-alert-card { display:grid; grid-template-columns: auto 1fr auto; align-items:center; gap:12px; padding:14px; border:1px solid #e5e7eb; border-radius:16px; background:#fff; box-shadow:0 10px 26px rgba(15,23,42,.06); }
.home-alert-card.warning { border-left:4px solid #f59e0b; }
.home-alert-card.danger { border-left:4px solid #dc143c; }
.home-alert-card.ok { border-left:4px solid #22c55e; }
.home-alert-card.muted { grid-template-columns:1fr; color:#6b7280; background:#f9fafb; }
.home-alert-icon { width:42px; height:42px; display:grid; place-items:center; border-radius:14px; background:#fff1f2; font-size:20px; }
.home-alert-content { display:flex; flex-direction:column; gap:3px; min-width:0; }
.home-alert-content span { font-size:12px; font-weight:800; color:#374151; text-transform:uppercase; letter-spacing:.02em; }
.home-alert-content strong { font-size:22px; color:#111827; line-height:1.1; }
.home-alert-content small { color:#6b7280; font-size:12px; }
.home-alert-action { white-space:nowrap; padding-inline:12px; }
@media (max-width: 1100px) { .home-alerts-grid { grid-template-columns:1fr; } .home-alert-card { grid-template-columns:auto 1fr; } .home-alert-action { grid-column: 1 / -1; width:100%; } }


/* v10.24.0 · shell bilingüe global y módulos académicos operativos */
.module-audit-compact{width:100%;border:1px solid rgba(15,23,42,.10);border-radius:14px;background:#fff;padding:13px 15px;display:grid;grid-template-columns:1fr auto auto;align-items:center;gap:12px;text-align:left;color:#0f172a;font-weight:900;cursor:pointer;transition:.18s ease}.module-audit-compact:hover,.module-audit-compact:focus-visible{border-color:var(--red);box-shadow:0 8px 22px rgba(200,16,46,.10);outline:none}.module-audit-compact strong{font-size:12px;color:#64748b}.module-audit-compact span:last-child{color:var(--red)}.module-audit-panel:has(.module-audit-compact:not(.hidden)){padding:12px}.module-shell-header .actions .hidden{display:none!important}
@media(max-width:760px){.module-audit-compact{grid-template-columns:1fr auto}.module-audit-compact span:last-child{display:none}}

/* Idioma de interfaz fijo en español; se retiró el selector global de idioma. */
@media(max-width:700px){.admin-main-actions{flex-wrap:wrap}}

/* Idioma fijo en español; topbar estable */
.admin-topbar{position:sticky;top:0;z-index:80;background:rgba(255,255,255,.96);backdrop-filter:blur(12px);border-bottom:1px solid rgba(15,23,42,.08)}


/* v10.24.28 — Ayudas compactas y alineadas para rentabilidad Teacher */
.teacher-finance-help-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 8px 0 12px;
  width: 100%;
}
.teacher-finance-help-card {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-height: 84px;
  padding: 11px 12px;
  border: 1px solid #e2e8f0;
  border-left: 4px solid var(--primary, #d90429);
  border-radius: 12px;
  background: #fff;
  box-sizing: border-box;
}
.teacher-finance-help-card strong,
.dashboard-kpi .teacher-finance-help-card strong {
  display: block;
  margin: 0;
  font-size: 13px !important;
  line-height: 1.25;
  color: #111827;
}
.teacher-finance-help-card span {
  font-size: 12px;
  line-height: 1.4;
  color: #475569;
}
@media (max-width: 1100px) {
  .teacher-finance-help-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 680px) {
  .teacher-finance-help-grid { grid-template-columns: 1fr; }
  .teacher-finance-help-card { min-height: 0; }
}


/* v10.24.29 — Corrección quirúrgica de layout en Resumen mensual de Teachers.
   El bloque de ayudas ocupa una fila completa y no compite por una sola columna
   con los filtros de fecha y Teacher. No altera Dashboard ni cálculos. */
#rentabilidadTeacherPanel .filters.clean-filters.guided-filters > .teacher-finance-help-grid {
  grid-column: 1 / -1 !important;
  width: 100% !important;
  min-width: 0 !important;
  max-width: 100% !important;
  margin: 0 0 4px 0 !important;
}
#rentabilidadTeacherPanel .teacher-finance-help-card {
  min-width: 0 !important;
  overflow-wrap: normal !important;
  word-break: normal !important;
}

/* v10.24.57-B.7 · Modo de prueba multirol y permisos activos */
.hidden-by-permission{display:none!important}
.role-testing-banner{position:fixed;left:320px;right:24px;bottom:18px;z-index:9999;display:flex;gap:12px;align-items:center;justify-content:space-between;background:#111827;color:#fff;border:1px solid rgba(255,255,255,.18);box-shadow:0 14px 40px rgba(0,0,0,.28);border-radius:16px;padding:12px 14px;font-size:13px}
.role-testing-banner.hidden{display:none!important}
.role-testing-banner strong{font-weight:800}.role-testing-banner span{color:#d1d5db}.role-testing-banner button{border:0;border-radius:999px;background:#fff;color:#111827;font-weight:800;padding:8px 12px;cursor:pointer}
@media(max-width:900px){.role-testing-banner{left:16px;right:16px;bottom:14px;flex-direction:column;align-items:flex-start}}

/* v10.24.57-B.7.3 · Portal Estudiante interconectado CFA */
.student-portal-hero{background:linear-gradient(135deg,#111827 0%,#7f1d1d 100%);color:#fff}.student-portal-hero p,.student-portal-hero .home-eyebrow,.student-portal-hero .home-period-card span{color:#f3f4f6}.student-portal-hero .home-period-card{background:rgba(255,255,255,.12);border-color:rgba(255,255,255,.2)}
.student-portal-loading{padding:28px;border:1px solid #e5e7eb;border-radius:18px;background:#fff;font-weight:800;color:#111827}
.student-portal-kpi-grid,.student-alert-grid,.student-portal-list-grid,.student-portal-action-grid{display:grid;gap:14px;margin:14px 0}.student-portal-kpi-grid{grid-template-columns:repeat(4,minmax(0,1fr))}.student-alert-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.student-portal-list-grid{grid-template-columns:repeat(3,minmax(0,1fr))}.student-portal-action-grid{grid-template-columns:repeat(3,minmax(0,1fr))}
.student-portal-section,.student-portal-kpi,.student-alert-card,.student-portal-list-card,.student-portal-package{background:#fff;border:1px solid #e5e7eb;border-radius:18px;box-shadow:0 10px 30px rgba(15,23,42,.06)}.student-portal-section{padding:16px;margin:16px 0}.student-portal-kpi,.student-alert-card,.student-portal-list-card,.student-portal-package{padding:15px}.student-portal-kpi span,.student-portal-package span,.student-portal-list-card span{display:block;font-size:12px;font-weight:800;color:#6b7280;text-transform:uppercase;letter-spacing:.04em}.student-portal-kpi strong,.student-portal-package strong{display:block;margin:6px 0;font-size:20px;color:#111827}.student-portal-kpi small{color:#64748b}.student-alert-card{display:flex;align-items:center;justify-content:space-between;gap:16px;border-left:5px solid var(--primary,#d90429)}.student-alert-card h4{margin:6px 0;color:#111827}.student-alert-card p{margin:0 0 8px;color:#475569}.student-alert-type,.student-alert-required{display:inline-block;margin-right:6px;padding:3px 8px;border-radius:999px;background:#fef2f2;color:#991b1b;font-size:11px;font-weight:900}.student-alert-required{background:#111827;color:#fff}.student-portal-package{display:grid;grid-template-columns:1.5fr .7fr .7fr;gap:12px;align-items:center}.student-portal-list-card strong{display:block;color:#111827;margin-bottom:6px}.student-portal-list-card p{color:#475569;margin:6px 0 0}.mini-link{display:inline-block;margin-top:8px;font-weight:800;color:var(--primary,#d90429)}
@media(max-width:1100px){.student-portal-kpi-grid,.student-alert-grid,.student-portal-list-grid,.student-portal-action-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.student-portal-package{grid-template-columns:1fr}}
@media(max-width:720px){.student-portal-kpi-grid,.student-alert-grid,.student-portal-list-grid,.student-portal-action-grid{grid-template-columns:1fr}.student-alert-card{flex-direction:column;align-items:flex-start}}


/* v10.24.57-B.7.5 · Portal estudiante: legibilidad, teacher card blanco y popup bloqueante */
.student-portal-hero{background:linear-gradient(135deg,#7f1d1d 0%,#111827 100%);color:#fff;position:relative;overflow:hidden}.student-portal-hero::after{content:"";position:absolute;inset:0;background:linear-gradient(90deg,rgba(0,0,0,.35),rgba(0,0,0,.12));pointer-events:none}.student-portal-hero>*{position:relative;z-index:1}.student-portal-hero h2,.student-portal-hero p,.student-portal-hero .home-eyebrow{color:#fff!important;text-shadow:0 2px 8px rgba(0,0,0,.35)}.student-portal-hero p{font-size:15px;line-height:1.55;max-width:820px}.student-portal-hero .home-hero-icon{background:#fff;color:#d90429;box-shadow:0 12px 28px rgba(0,0,0,.18)}
.student-portal-hero .student-teacher-card{background:#fff!important;border:1px solid #fecdd3!important;color:#111827!important;box-shadow:0 12px 34px rgba(15,23,42,.18)}.student-portal-hero .student-teacher-card span{color:#6b7280!important}.student-portal-hero .student-teacher-card strong{color:#111827!important;text-shadow:none;font-weight:900}
.student-blocking-popup-backdrop{position:fixed;inset:0;background:rgba(15,23,42,.72);z-index:99999;display:flex;align-items:center;justify-content:center;padding:24px}.student-blocking-popup{background:#fff;border-radius:24px;padding:28px;max-width:560px;width:min(560px,100%);box-shadow:0 30px 80px rgba(0,0,0,.35);border-top:7px solid var(--primary,#d90429)}.student-blocking-popup h2{margin:10px 0;color:#111827}.student-blocking-popup p{color:#374151;line-height:1.55}.student-blocking-popup .popup-actions{display:flex;gap:10px;flex-wrap:wrap;margin:18px 0}.student-help-actions{display:flex;gap:10px;flex-wrap:wrap;margin-top:10px}


/* v10.24.57-B.7.5.2 · Portal Estudiante CFA rediseño profesional */
.student-portal-shell{display:flex;flex-direction:column;gap:18px}.home-hero-panel.student-portal-hero,.student-portal-hero{background:#fff!important;color:#111827!important;border:1px solid #f1f5f9!important;border-left:6px solid #d90429!important;box-shadow:0 14px 38px rgba(15,23,42,.08)!important;border-radius:22px!important;padding:24px!important;display:grid!important;grid-template-columns:minmax(0,1fr) 280px!important;gap:22px!important;align-items:stretch!important;overflow:visible!important}.student-portal-hero::after{display:none!important}.student-portal-hero *{text-shadow:none!important}.student-portal-hero-main{display:flex;align-items:center;gap:18px}.student-portal-avatar{width:64px;height:64px;border-radius:20px;background:#fff1f2;color:#d90429;display:flex;align-items:center;justify-content:center;font-size:30px;box-shadow:inset 0 0 0 1px #fecdd3}.student-portal-eyebrow,.student-portal-hero .home-eyebrow{display:block;margin-bottom:6px;color:#d90429!important;font-weight:900;text-transform:uppercase;letter-spacing:.08em;font-size:12px}.student-portal-hero h2{margin:0;color:#111827!important;font-size:32px;line-height:1.1;font-weight:900}.student-portal-hero p{margin:10px 0 0;color:#475569!important;font-size:15px;line-height:1.55;max-width:820px}.student-teacher-card,.student-portal-hero .student-teacher-card{background:#fff!important;border:1px solid #fecdd3!important;border-radius:18px!important;padding:18px!important;color:#111827!important;display:flex;flex-direction:column;justify-content:center;gap:6px;box-shadow:0 12px 28px rgba(217,4,41,.08)!important}.student-teacher-card span{color:#6b7280!important;font-weight:900;text-transform:uppercase;font-size:12px;letter-spacing:.04em}.student-teacher-card strong{color:#111827!important;font-size:19px!important;font-weight:900!important;line-height:1.2}.student-teacher-card small{color:#64748b!important;font-weight:700}.student-portal-section{border-radius:20px!important;border:1px solid #e5e7eb!important;box-shadow:0 12px 32px rgba(15,23,42,.06)!important}.student-portal-kpi strong,.student-portal-package strong{color:#111827!important}.student-portal-kpi span,.student-portal-package span,.student-portal-list-card span{color:#64748b!important}.student-portal-action-grid .btn,.student-portal-section .btn{border-radius:12px}.student-blocking-popup-backdrop{position:fixed;inset:0;background:rgba(17,24,39,.72);z-index:9999;display:flex;align-items:center;justify-content:center;padding:24px}.student-blocking-popup{width:min(560px,100%);background:#fff;border-radius:24px;padding:26px;box-shadow:0 24px 90px rgba(0,0,0,.35);border-top:6px solid #d90429}.student-blocking-popup h2{margin:10px 0;color:#111827}.student-blocking-popup p{color:#475569;line-height:1.55}.popup-actions{display:flex;gap:12px;flex-wrap:wrap;margin:18px 0}.student-help-page{display:flex;flex-direction:column;gap:20px}.student-help-hero{background:#fff;border:1px solid #e5e7eb;border-left:6px solid #d90429;border-radius:22px;padding:24px;box-shadow:0 14px 38px rgba(15,23,42,.08)}.student-help-hero span{color:#d90429;text-transform:uppercase;letter-spacing:.08em;font-size:12px;font-weight:900}.student-help-hero h2{margin:8px 0;color:#111827}.student-help-hero p{margin:0;color:#475569}.student-help-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px}.student-help-card{background:#fff;border:1px solid #e5e7eb;border-radius:18px;padding:18px;box-shadow:0 10px 26px rgba(15,23,42,.06)}.student-help-card h3{margin:0 0 8px;color:#111827}.student-help-card p{color:#475569;line-height:1.5}.student-help-card .row-actions{margin-top:14px}@media(max-width:980px){.home-hero-panel.student-portal-hero,.student-portal-hero{grid-template-columns:1fr!important}.student-help-grid{grid-template-columns:1fr}.student-portal-hero h2{font-size:26px}}@media(max-width:620px){.student-portal-hero-main{align-items:flex-start}.student-portal-avatar{width:52px;height:52px;font-size:24px}}

/* B.4.89 · Navegación lateral agrupada Administrativo / Académico */
.nav-accordion { display: grid; gap: 6px; margin-bottom: 8px; }
.nav-group-toggle {
  width: 100%; border: 1px solid rgba(255,255,255,.12); background: rgba(255,255,255,.06); color: rgba(255,255,255,.88);
  display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 14px; cursor: pointer;
  font-size: 11px; font-weight: 900; text-transform: uppercase; letter-spacing: .06em;
}
.nav-group-toggle:hover { background: rgba(255,255,255,.12); }
.nav-group-items { display: grid; gap: 7px; padding-left: 6px; border-left: 2px solid rgba(255,255,255,.12); margin-left: 6px; }
.nav-group-items.closed { display: none; }
.nav-group-items.open { display: grid; }


/* B.4.89 · Submenú lateral Paquetes / Balance clientes */
.nav-subaccordion { display: grid; gap: 6px; }
.nav-parent-toggle { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.nav-parent-toggle span { display: inline-flex; align-items: center; gap: 8px; }
.nav-subitems { display: grid; gap: 6px; margin: 0 0 4px 14px; padding-left: 10px; border-left: 2px solid rgba(255,255,255,.16); }
.nav-subitems.closed { display: none; }
.nav-subitems.open { display: grid; }
.nav-child { padding-left: 16px; font-size: 13px; background: rgba(255,255,255,.035); }
.nav.nav-parent-active { background: rgba(217,4,41,.45); }


/* B.5.17 Teacher UX, role QA and horizontal class stats */
.hidden{display:none!important}
.role-current-chip{display:inline-flex;align-items:center;gap:8px;border:1px solid #cfe3ff;background:#f2f8ff;color:#18355f;border-radius:999px;padding:8px 14px;font-weight:800;width:max-content;margin:10px 0}
.teacher-session-badge{display:flex;flex-direction:column;gap:4px;align-items:flex-end;background:#fff;border:1px solid #e4e7ec;border-radius:18px;padding:12px 16px;box-shadow:0 12px 30px rgba(15,23,42,.08)}
.teacher-session-badge span{font-size:.78rem;text-transform:uppercase;letter-spacing:.06em;color:#64748b;font-weight:800}.teacher-session-badge strong{font-size:1rem;color:#0f172a}.teacher-session-badge small{color:#475569}
.teacher-home-hero{align-items:center}.teacher-kpi-grid,.teacher-alerts-grid{grid-template-columns:repeat(auto-fit,minmax(210px,1fr))}.teacher-kpi-card strong{color:#0f172a}.class-stats-horizontal .class-stats-grid-horizontal{display:grid;grid-template-columns:repeat(auto-fit,minmax(180px,1fr));gap:12px}.survey-bulk-toolbar.readonly{background:#f8fafc;border:1px solid #e5e7eb;color:#334155}.teacher-alerts-grid .home-alert-card strong{font-size:1.6rem}

@media (max-width: 980px) {
  .home-academic-teacher-strip {
    padding: 14px;
    gap: 12px;
  }
  .home-teacher-chip-row {
    justify-content: flex-start;
  }
}


/* B.5.60.5 · Teacher Hub limpio */
.teacher-hub{display:flex;flex-direction:column;gap:18px;max-width:100%;}
.teacher-hero-clean{display:flex;align-items:center;justify-content:space-between;gap:18px;padding:22px;border-radius:22px;background:linear-gradient(135deg,#ffffff,#f8fafc);border:1px solid #e5e7eb;box-shadow:0 18px 46px rgba(15,23,42,.08)}
.teacher-hero-clean span{font-size:12px;font-weight:900;letter-spacing:.08em;text-transform:uppercase;color:#dc143c}.teacher-hero-clean h2{margin:4px 0;font-size:30px;color:#0f172a}.teacher-hero-clean p{margin:0;color:#475569;max-width:820px;line-height:1.45}.teacher-hero-clean aside{min-width:180px;background:#fff;border:1px solid #e2e8f0;border-radius:18px;padding:14px;text-align:right}.teacher-hero-clean aside strong{display:block;font-size:18px;color:#0f172a}.teacher-hero-clean aside small{color:#64748b;font-weight:800}.teacher-section{background:#fff;border:1px solid #e5e7eb;border-radius:20px;padding:16px;box-shadow:0 10px 28px rgba(15,23,42,.05)}.teacher-section-title{display:flex;align-items:flex-end;justify-content:space-between;gap:12px;margin-bottom:12px}.teacher-section-title h3{margin:0;font-size:20px;color:#0f172a}.teacher-section-title span{font-size:13px;color:#64748b;font-weight:700}.teacher-action-grid,.teacher-metric-grid,.teacher-module-grid{display:grid;gap:12px}.teacher-action-grid{grid-template-columns:repeat(auto-fit,minmax(220px,1fr))}.teacher-metric-grid{grid-template-columns:repeat(auto-fit,minmax(180px,1fr))}.teacher-module-grid{grid-template-columns:repeat(auto-fit,minmax(240px,1fr))}.teacher-metric-card,.teacher-action-item,.teacher-module-card{border:1px solid #e5e7eb;border-radius:18px;background:#fff;padding:14px;min-width:0;box-shadow:0 8px 22px rgba(15,23,42,.04)}.teacher-metric-card{border-left:5px solid #64748b}.teacher-metric-card.good{border-left-color:#059669}.teacher-metric-card.warning{border-left-color:#f59e0b}.teacher-metric-card.danger{border-left-color:#dc143c}.teacher-metric-card span,.teacher-action-item span{display:block;font-size:12px;font-weight:900;text-transform:uppercase;letter-spacing:.04em;color:#64748b}.teacher-metric-card strong,.teacher-action-item strong{display:block;margin-top:4px;font-size:24px;color:#0f172a;white-space:normal;overflow-wrap:anywhere}.teacher-metric-card small,.teacher-action-item small{display:block;margin-top:6px;color:#475569;line-height:1.35}.teacher-action-item{display:flex;justify-content:space-between;gap:10px;align-items:center;border-left:5px solid #64748b}.teacher-action-item.good{border-left-color:#059669}.teacher-action-item.warning{border-left-color:#f59e0b}.teacher-action-item.danger{border-left-color:#dc143c}.teacher-module-card{display:grid;grid-template-columns:auto 1fr auto;align-items:center;gap:12px}.teacher-module-icon{width:44px;height:44px;border-radius:16px;background:#fff1f2;display:flex;align-items:center;justify-content:center;font-size:20px}.teacher-module-card h4{margin:0;font-size:16px;color:#0f172a}.teacher-module-card p{margin:3px 0 0;color:#64748b;line-height:1.3}.teacher-inline-actions{display:flex;gap:10px;flex-wrap:wrap;margin-top:12px}.teacher-bar-chart{display:flex;align-items:flex-end;gap:10px;min-height:180px;border:1px solid #e5e7eb;border-radius:18px;padding:14px;background:#f8fafc}.teacher-bar{flex:1;display:flex;flex-direction:column;align-items:center;gap:6px;min-width:42px}.teacher-bar-fill{width:100%;border-radius:12px 12px 4px 4px;background:#dc143c;min-height:4px}.teacher-bar small{text-align:center;font-size:11px;color:#475569}.teacher-finance-layout{display:grid;gap:16px}.teacher-table-wrap{overflow:auto;border:1px solid #e5e7eb;border-radius:16px}.teacher-table-wrap table{width:100%;border-collapse:collapse}.teacher-table-wrap th,.teacher-table-wrap td{padding:10px;border-bottom:1px solid #eef2f7;text-align:left}.teacher-table-wrap th{font-size:12px;text-transform:uppercase;color:#64748b;background:#f8fafc}.teacher-status-pill{display:inline-flex;border-radius:999px;padding:4px 9px;background:#f1f5f9;font-weight:800;font-size:12px}.teacher-status-pill.ok{background:#dcfce7;color:#166534}.teacher-status-pill.warn{background:#fff7ed;color:#9a3412}.teacher-status-pill.bad{background:#fee2e2;color:#991b1b}
@media(max-width:900px){.teacher-hero-clean{flex-direction:column;align-items:flex-start}.teacher-hero-clean aside{text-align:left;width:100%}.teacher-module-card{grid-template-columns:auto 1fr}.teacher-module-card button{grid-column:1/-1}}


/* B56360 R4: encabezado local del KPI retiros 6 meses sin subtitulo/resumen residual visible. */
.home-retirement-leaders-heading {
  min-width: 0;
  align-self: flex-start;
}
.home-retirement-leaders-heading span {
  display: block;
}

/* B56361 P3.2 R1: Inicio - Clientes nuevos con el mismo patrón mensual responsive de retiros */
.home-academic-new-clients-strip {
  border-left-color: #dc143c;
}
.home-new-clients-heading strong {
  display: block;
  margin-top: 2px;
}
.home-new-clients-heading small {
  display: block;
  margin-top: 4px;
}
.home-new-client-leader-card {
  min-height: 142px;
}
.home-new-client-leader-card .home-retirement-leader-metric b {
  background: #fff1f2;
}


/* B56361 P3.2 R4: Inicio - Clientes nuevos encabezado compacto sin corte ni invasión de cards */
.home-new-clients-heading strong {
  display: flex;
  align-items: baseline;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 2px;
  white-space: normal;
  overflow: visible;
  text-overflow: clip;
  max-width: 100%;
  line-height: 1.05;
}
.home-new-clients-heading strong b {
  color: #111827;
  font-size: clamp(22px, 2.1vw, 30px);
  line-height: 1;
  letter-spacing: -.04em;
}
.home-new-clients-heading strong span {
  color: #111827;
  font-size: clamp(14px, 1.2vw, 18px);
  line-height: 1.05;
  font-weight: 900;
}
/* B56370 R10 · acciones múltiples en alertas automáticas Student */
.student-alert-actions{display:flex;gap:10px;flex-wrap:wrap;align-items:center;justify-content:flex-end;min-width:220px}.student-alert-actions .btn{white-space:normal}.popup-actions{gap:10px;flex-wrap:wrap}.student-blocking-popup small{display:block;margin-top:8px;color:#667085}.automatic-alerts-admin-card{border:1px solid #dbe4f0;border-radius:16px;padding:14px;background:#fff}

/* B56370 R15 UX hotfix · Practica aquí prioritario en Inicio Student */
.student-practice-home-section{
  border-left:6px solid #d90429!important;
  background:linear-gradient(135deg,#ffffff 0%,#fff7f8 100%)!important;
  padding:18px!important;
}
.practice-home-head{
  align-items:flex-start!important;
  margin-bottom:14px!important;
}
.practice-home-head h3{
  margin:0;
  color:#0f172a;
  font-size:22px;
  font-weight:900;
}
.practice-home-head p{
  margin:5px 0 0;
  color:#64748b;
  font-weight:700;
}
.student-practice-home-grid{
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(240px,1fr));
  gap:14px;
}
.student-practice-home-card{
  background:#fff;
  border:1px solid #e5e7eb;
  border-radius:18px;
  padding:16px;
  box-shadow:0 12px 28px rgba(15,23,42,.06);
  display:flex;
  flex-direction:column;
  gap:10px;
  min-width:0;
}
.student-practice-card-top{
  display:flex;
  gap:8px;
  flex-wrap:wrap;
  align-items:center;
}
.practice-chip{
  display:inline-flex;
  align-items:center;
  gap:6px;
  min-height:26px;
  border-radius:999px;
  padding:4px 10px;
  font-size:11px;
  font-weight:900;
  letter-spacing:.03em;
  text-transform:uppercase;
  white-space:normal;
}
.practice-chip.accent{background:#fff1f2;color:#991b1b;border:1px solid #fecdd3;}
.practice-chip.neutral{background:#f8fafc;color:#475569;border:1px solid #e2e8f0;}
.student-practice-home-card strong{
  color:#0f172a;
  font-size:17px;
  line-height:1.25;
  font-weight:900;
  overflow-wrap:anywhere;
}
.student-practice-home-card p{
  color:#475569;
  line-height:1.45;
  margin:0;
  overflow-wrap:anywhere;
}
.student-practice-card-actions{
  margin-top:auto;
  padding-top:10px;
}
.student-practice-card-actions .btn{border-radius:11px;}
@media(max-width:720px){
  .student-practice-home-grid{grid-template-columns:1fr;}
  .practice-home-head{display:grid!important;gap:12px!important;}
}
