/* MOLTO Contable — interfaz administrativa profesional.
   Esta capa unifica las vistas heredadas con superficies blancas,
   jerarquía financiera y acentos funcionales. */

:root,
[data-theme="dark"] {
  --molto-bg: #f7f8fa;
  --molto-bg-soft: #f4f6f8;
  --molto-surface: #ffffff;
  --molto-surface-raised: #ffffff;
  --molto-border: #e6e9ee;
  --molto-border-strong: #d7dce3;
  --molto-ink: #17202e;
  --molto-muted: #687386;
  --molto-brand: #7f3026;
  --molto-brand-dark: #61231c;
  --molto-brand-soft: #f9efed;
  --molto-accent: #087f78;
  --molto-accent-hover: #06675f;
  --molto-accent-soft: #eaf7f5;
  --molto-success: #16825d;
  --molto-success-soft: #eaf7f1;
  --molto-danger: #c23b43;
  --molto-danger-soft: #fff0f1;
  --molto-warning: #ad6a05;
  --molto-warning-soft: #fff7e6;
  --molto-info-soft: #edf6ff;
  --molto-radius: 10px;
  --molto-radius-sm: 7px;
  --molto-shadow: 0 1px 2px rgb(23 32 46 / 0.04), 0 8px 24px rgb(23 32 46 / 0.055);
  --molto-shadow-soft: 0 1px 3px rgb(23 32 46 / 0.045);
  --bs-body-bg: var(--molto-bg);
  --bs-body-color: var(--molto-ink);
  --bs-border-color: var(--molto-border);
}

html,
body,
[data-theme="dark"] body {
  background: var(--molto-bg);
  color: var(--molto-ink);
}

body {
  font-size: 0.9rem;
}

body::after {
  display: none;
}

h1, h2, h3, h4, h5, h6,
.h1, .h2, .h3, .h4, .h5, .h6 {
  color: var(--molto-ink);
  letter-spacing: -0.018em;
}

main.molto-main {
  margin: 0 auto;
  max-width: 1440px;
  padding: 2rem 2.25rem 4rem;
}

/* Barra de contexto */
.molto-workbar {
  align-items: center;
  background: rgb(255 255 255 / 0.94);
  border-bottom: 1px solid var(--molto-border);
  display: flex;
  height: 64px;
  justify-content: space-between;
  padding: 0 2rem;
  position: sticky;
  top: 0;
  z-index: 1020;
}

.molto-workbar-context,
.molto-workbar-actions,
.molto-workbar-user {
  align-items: center;
  display: flex;
}

.molto-workbar-context {
  gap: 0.7rem;
}

.molto-workbar-kicker {
  color: var(--molto-brand);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.12em;
}

.molto-workbar-divider {
  background: var(--molto-border-strong);
  height: 18px;
  width: 1px;
}

.molto-workbar-area {
  color: var(--molto-ink);
  font-size: 0.84rem;
  font-weight: 600;
}

.molto-workbar-actions {
  gap: 0.8rem;
}

.molto-workbar-date {
  color: var(--molto-muted);
  font-size: 0.78rem;
  text-transform: capitalize;
}

.molto-workbar-icon {
  align-items: center;
  border: 1px solid var(--molto-border);
  border-radius: 8px;
  color: var(--molto-muted);
  display: inline-flex;
  height: 34px;
  justify-content: center;
  position: relative;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
  width: 34px;
}

.molto-workbar-icon:hover {
  background: var(--molto-brand-soft);
  border-color: #ead3ce;
  color: var(--molto-brand);
}

.molto-workbar-user {
  color: var(--molto-muted);
  font-size: 0.78rem;
  gap: 0.5rem;
  max-width: 220px;
}

.molto-workbar-avatar {
  align-items: center;
  background: var(--molto-bg-soft);
  border-radius: 50%;
  color: var(--molto-brand);
  display: inline-flex;
  flex: 0 0 auto;
  height: 30px;
  justify-content: center;
  width: 30px;
}

/* Navegación */
.molto-sidebar,
[data-theme="dark"] .molto-sidebar {
  background: #fff !important;
  border-right: 1px solid var(--molto-border) !important;
}

.molto-sidebar .molto-sidebar-body {
  padding: 1.25rem 0.8rem 1rem !important;
}

.molto-sidebar-brand {
  justify-content: flex-start !important;
  padding-inline: 0.55rem !important;
}

.molto-brand-logo-wrap {
  height: 62px;
  justify-content: flex-start;
  width: 168px;
}

.molto-brand-logo {
  filter: none;
  width: 152px;
}

.sidebar-toolbar {
  border-top: 1px solid var(--molto-border);
  justify-content: flex-start;
  margin: 0.25rem 0.55rem 0;
  padding-top: 0.75rem;
}

.sidebar-tool-btn {
  background: #fff;
  border-color: var(--molto-border);
  box-shadow: none;
}

.molto-sidebar-nav .nav-section {
  color: #8a94a5 !important;
  font-size: 0.64rem !important;
  letter-spacing: 0.105em !important;
  padding: 0.78rem 0.7rem 0.32rem !important;
}

.molto-sidebar-nav .side-link {
  border-radius: 7px !important;
  color: #606b7c !important;
  font-size: 0.855rem !important;
  gap: 0.68rem !important;
  min-height: 38px;
  padding: 0.5rem 0.7rem !important;
}

.molto-sidebar-nav .side-link i {
  font-size: 1rem !important;
  width: 1.25rem !important;
}

.molto-sidebar-nav .side-link:hover {
  background: #f6f7f9 !important;
  color: var(--molto-ink) !important;
}

.molto-sidebar-nav .side-link.active,
.sidebar-group-panel .side-link.active,
.sidebar-group-operacion .side-link.active,
.sidebar-group-cierre .side-link.active,
.sidebar-group-fiscal .side-link.active,
.sidebar-group-catalogos .side-link.active,
.sidebar-group-admin .side-link.active {
  background: var(--molto-brand-soft) !important;
  color: var(--molto-brand-dark) !important;
}

.molto-sidebar-nav .side-link.active::after {
  background: var(--molto-brand);
  border-radius: 2px;
  content: "";
  height: 18px;
  position: absolute;
  right: -0.8rem;
  top: 10px;
  width: 3px;
}

.molto-sidebar-footer {
  background: #fff !important;
}

.molto-sidebar-user,
[data-theme="dark"] .molto-sidebar-user {
  background: #f8f9fb !important;
  border-color: var(--molto-border) !important;
  box-shadow: none;
}

/* Encabezados y jerarquía */
.page-header {
  align-items: flex-end;
  border-bottom: 1px solid var(--molto-border);
  display: flex;
  gap: 1.25rem;
  justify-content: space-between;
  margin-bottom: 1.5rem !important;
  padding-bottom: 1.35rem;
}

.page-header h1 {
  font-size: clamp(1.45rem, 2vw, 1.85rem);
  font-weight: 720;
  line-height: 1.2;
}

.page-header .text-muted {
  margin-top: 0.35rem;
}

.dashboard-eyebrow {
  color: var(--molto-brand);
  display: block;
  font-size: 0.68rem;
  font-weight: 750;
  letter-spacing: 0.1em;
  margin-bottom: 0.35rem;
  text-transform: uppercase;
}

.form-eyebrow {
  color: var(--molto-brand);
  display: block;
  font-size: 0.67rem;
  font-weight: 750;
  letter-spacing: 0.095em;
  margin-bottom: 0.4rem;
  text-transform: uppercase;
}

/* Superficies */
.card,
.stat-card,
.saas-metric-card,
.saas-chart-card,
.widget,
[data-theme="dark"] .card,
[data-theme="dark"] .stat-card,
[data-theme="dark"] .saas-metric-card,
[data-theme="dark"] .saas-chart-card {
  background: #fff !important;
  border: 1px solid var(--molto-border) !important;
  border-radius: var(--molto-radius) !important;
  box-shadow: var(--molto-shadow-soft) !important;
}

.card:hover,
.stat-card:hover,
.saas-metric-card:hover,
.widget:hover {
  border-color: var(--molto-border-strong) !important;
  box-shadow: var(--molto-shadow) !important;
  transform: translateY(-1px);
}

.card-header {
  background: #fff;
  border-bottom-color: var(--molto-border);
  font-size: 0.82rem;
  font-weight: 650;
  padding: 0.95rem 1.1rem;
}

.stat-grid {
  gap: 1rem;
}

.saas-metric-card {
  min-height: 152px;
  padding: 1.2rem 1.25rem !important;
}

.saas-metric-label,
.stat-label,
.widget-label {
  color: var(--molto-muted);
  font-size: 0.7rem;
  letter-spacing: 0.075em;
}

.saas-metric-value,
.stat-value,
.widget-value,
.dash-hero-value {
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.035em;
}

.saas-metric-value {
  font-size: 1.65rem;
  font-weight: 740;
}

.saas-icon-badge {
  border-radius: 8px;
  height: 36px;
  width: 36px;
}

.saas-card-footer {
  border-top-color: var(--molto-border);
}

.dash-hero-card,
[data-theme="dark"] .dash-hero-card {
  background: linear-gradient(120deg, #72291f, #96392c) !important;
  border: 0 !important;
  border-radius: var(--molto-radius) !important;
  box-shadow: 0 10px 28px rgb(97 35 28 / 0.18) !important;
  min-height: 190px;
  padding: 1.55rem 1.65rem;
}

.dash-hero-card:hover {
  box-shadow: 0 14px 32px rgb(97 35 28 / 0.23) !important;
}

.dash-hero-glow {
  background: radial-gradient(circle, rgb(255 255 255 / 0.12), transparent 68%);
}

.dash-hero-label,
.dash-hero-note,
[data-theme="dark"] .dash-hero-label,
[data-theme="dark"] .dash-hero-note {
  color: rgb(255 255 255 / 0.72);
}

.dash-hero-value,
[data-theme="dark"] .dash-hero-value {
  color: #fff !important;
}

.dash-hero-btn,
[data-theme="dark"] .dash-hero-btn {
  background: #fff;
  color: var(--molto-brand-dark) !important;
}

.dash-hero-btn:hover,
[data-theme="dark"] .dash-hero-btn:hover {
  background: #f9efed;
}

.dash-attention {
  background: #fff;
  border-color: var(--molto-border);
  box-shadow: var(--molto-shadow-soft);
}

/* Resúmenes ejecutivos */
.metric-summary .card-body {
  min-height: 132px;
  padding: 1.15rem 1.2rem;
  position: relative;
}

.metric-summary-icon {
  align-items: center;
  background: var(--molto-bg-soft);
  border-radius: 8px;
  color: var(--molto-muted);
  display: inline-flex;
  font-size: 1rem;
  height: 34px;
  justify-content: center;
  position: absolute;
  right: 1.1rem;
  top: 1.1rem;
  width: 34px;
}

.metric-summary-icon.es-success {
  background: var(--molto-success-soft);
  color: var(--molto-success);
}

.metric-summary-icon.es-warning {
  background: var(--molto-warning-soft);
  color: var(--molto-warning);
}

.metric-summary-icon.es-danger {
  background: var(--molto-danger-soft);
  color: var(--molto-danger);
}

.metric-summary-icon.es-brand {
  background: var(--molto-brand-soft);
  color: var(--molto-brand);
}

.metric-summary-label {
  color: var(--molto-muted);
  font-size: 0.7rem;
  font-weight: 650;
  letter-spacing: 0.065em;
  max-width: calc(100% - 45px);
  text-transform: uppercase;
}

.metric-summary-value {
  color: var(--molto-ink);
  font-size: clamp(1.3rem, 2vw, 1.65rem);
  font-variant-numeric: tabular-nums;
  font-weight: 740;
  letter-spacing: -0.035em;
  margin-top: 1.15rem;
}

/* Controles */
.btn {
  border-radius: 7px;
  box-shadow: none;
  font-size: 0.82rem;
  font-weight: 620;
}

.btn:hover {
  transform: none;
}

.btn-primary {
  box-shadow: 0 4px 10px rgb(127 48 38 / 0.14);
}

.btn-outline-primary {
  --bs-btn-color: var(--molto-brand);
  --bs-btn-hover-bg: var(--molto-brand-soft);
  --bs-btn-hover-border-color: #d9aaa3;
  --bs-btn-hover-color: var(--molto-brand-dark);
}

.form-control,
.form-select,
[data-theme="dark"] .form-control,
[data-theme="dark"] .form-select {
  background-color: #fff;
  border-color: var(--molto-border-strong);
  min-height: 40px;
}

.form-control:focus,
.form-select:focus {
  border-color: #b66a60;
  box-shadow: 0 0 0 3px rgb(127 48 38 / 0.1);
}

.form-label {
  color: #3f4959;
  font-size: 0.8rem;
  font-weight: 620;
}

.form-card {
  max-width: 1040px;
}

.form-card > h1 {
  font-size: 1.55rem !important;
  font-weight: 720;
  letter-spacing: -0.025em;
}

.form-card > .text-muted {
  line-height: 1.55;
  max-width: 75ch;
}

.form-card form .border-top {
  border-color: var(--molto-border) !important;
  margin-top: 1.5rem !important;
  padding-top: 1.4rem !important;
}

.form-card form .border-top > h2,
form .card-body > h2.h6 {
  color: var(--molto-ink) !important;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.055em;
  margin-bottom: 1rem !important;
  text-transform: uppercase;
}

.form-card input[type="file"] {
  cursor: pointer;
}

.danger-confirmation {
  border-top: 3px solid var(--molto-danger) !important;
  max-width: 680px;
}

.danger-confirmation-icon {
  align-items: center;
  background: var(--molto-danger-soft);
  border-radius: 10px;
  color: var(--molto-danger);
  display: inline-flex;
  font-size: 1.2rem;
  height: 42px;
  justify-content: center;
  margin-bottom: 1rem;
  width: 42px;
}

/* Filtros de listados */
.molto-filterbar {
  align-items: center;
  background: #fff;
  border: 1px solid var(--molto-border);
  border-radius: var(--molto-radius);
  box-shadow: var(--molto-shadow-soft);
  margin-bottom: 1rem !important;
  padding: 0.75rem;
}

.molto-filterbar::before {
  color: var(--molto-muted);
  content: "\F3CA";
  font-family: "bootstrap-icons";
  font-size: 1rem;
  margin: 0 0.2rem 0 0.25rem;
}

.molto-filterbar .form-control-sm,
.molto-filterbar .form-select-sm {
  min-height: 36px;
}

/* Tablas financieras */
.table {
  --bs-table-bg: #fff;
  --bs-table-hover-bg: #fafbfc;
  color: var(--molto-ink);
}

.table > thead th {
  background: #f7f8fa;
  border-bottom-color: var(--molto-border-strong);
  color: #687386;
  font-size: 0.66rem;
  letter-spacing: 0.075em;
  padding: 0.72rem 0.85rem;
}

.table > tbody td {
  border-color: #edf0f3;
  padding: 0.74rem 0.85rem;
}

.table > tbody tr:last-child td {
  border-bottom: 0;
}

.molto-data-card > .card-body {
  padding: 0;
}

.molto-data-card div.dt-container > .row:first-child {
  align-items: center;
  border-bottom: 1px solid var(--molto-border);
  margin: 0;
  padding: 0.85rem 1rem;
}

.molto-data-card div.dt-container > .row:last-child {
  align-items: center;
  border-top: 1px solid var(--molto-border);
  margin: 0;
  padding: 0.85rem 1rem;
}

.molto-data-card div.dt-container > .row.dt-row {
  margin: 0;
}

.molto-empty-cell {
  color: var(--molto-muted) !important;
  padding: 2.5rem 1rem !important;
  text-align: center;
}

.molto-empty-cell::before {
  color: #a5adba;
  content: "\F47A";
  display: block;
  font-family: "bootstrap-icons";
  font-size: 1.45rem;
  margin-bottom: 0.5rem;
}

div.dt-container .dt-search input,
div.dt-container .dt-length select {
  background: #fff;
  border-color: var(--molto-border-strong);
  min-height: 36px;
}

.badge {
  border-radius: 5px;
  font-size: 0.68rem;
}

.text-dark {
  color: var(--molto-ink) !important;
}

/* Acceso */
.molto-layout--sola {
  background: #f7f8fa;
}

.entrance-card,
[data-theme="dark"] .entrance-card {
  background: #fff;
  border-color: var(--molto-border);
  border-radius: 12px;
  box-shadow: 0 18px 50px rgb(23 32 46 / 0.1);
}

.molto-layout--sola::before {
  background: var(--molto-brand);
  content: "";
  height: 4px;
  inset: 0 0 auto;
  position: fixed;
}

.login-eyebrow {
  align-items: center;
  color: var(--molto-brand);
  display: flex;
  font-size: 0.68rem;
  font-weight: 750;
  gap: 0.35rem;
  justify-content: center;
  letter-spacing: 0.09em;
  margin-bottom: 0.65rem;
  text-transform: uppercase;
}

.entrance-card .login-subtitle {
  margin: -0.15rem auto 1.5rem;
  max-width: 32ch;
}

/* Estados del sistema */
.system-state {
  align-items: center;
  display: flex;
  flex-direction: column;
  margin: min(12vh, 8rem) auto 0;
  max-width: 560px;
  text-align: center;
}

.system-state-code {
  color: #a0a8b5;
  font-size: 0.68rem;
  font-weight: 750;
  letter-spacing: 0.16em;
  margin-bottom: 0.75rem;
}

.system-state-icon {
  align-items: center;
  background: var(--molto-brand-soft);
  border-radius: 14px;
  color: var(--molto-brand);
  display: inline-flex;
  font-size: 1.5rem;
  height: 58px;
  justify-content: center;
  margin-bottom: 1.3rem;
  width: 58px;
}

.system-state-icon.es-danger {
  background: var(--molto-danger-soft);
  color: var(--molto-danger);
}

.system-state h1 {
  font-size: 1.7rem;
  font-weight: 740;
}

.system-state p {
  color: var(--molto-muted);
  line-height: 1.6;
  margin: 0.35rem 0 1.5rem;
}

/* Calendario */
.fc .fc-toolbar-title {
  color: var(--molto-ink);
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.fc .fc-button-primary {
  background: #fff !important;
  border-color: var(--molto-border-strong) !important;
  color: var(--molto-muted) !important;
  box-shadow: none !important;
  font-size: 0.78rem !important;
  font-weight: 620 !important;
  text-transform: capitalize;
}

.fc .fc-button-primary:hover,
.fc .fc-button-primary:not(:disabled).fc-button-active {
  background: var(--molto-brand-soft) !important;
  border-color: #e4c8c3 !important;
  color: var(--molto-brand) !important;
}

.fc-theme-standard th,
.fc-theme-standard td,
.fc-theme-standard .fc-scrollgrid {
  border-color: var(--molto-border) !important;
}

.fc .fc-col-header-cell-cushion {
  color: var(--molto-muted);
  font-size: 0.67rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  padding: 0.65rem 0.25rem;
  text-transform: uppercase;
}

.fc .fc-daygrid-day-number {
  color: var(--molto-muted);
  font-size: 0.76rem;
  padding: 0.45rem;
}

.fc .fc-day-today {
  background: #fffaf9 !important;
}

/* ============================================================
   Movimientos — centro de operación financiera
   ============================================================ */

.movement-page-header {
  align-items: center;
}

.movement-header-actions {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: flex-end;
}

.movement-header-actions .btn {
  align-items: center;
  display: inline-flex;
  gap: 0.4rem;
  min-height: 36px;
  padding-inline: 0.8rem;
}

.movement-period-bar {
  align-items: center;
  display: flex;
  gap: 0.8rem;
  justify-content: center;
  margin: -0.15rem 0 1rem;
}

.movement-period-bar > div {
  display: grid;
  min-width: 140px;
  text-align: center;
}

.movement-period-label {
  color: var(--molto-muted);
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.movement-period-bar strong {
  color: var(--molto-ink);
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.movement-period-arrow {
  align-items: center;
  background: #fff;
  border: 1px solid var(--molto-border);
  border-radius: 7px;
  color: var(--molto-muted);
  display: inline-flex;
  height: 32px;
  justify-content: center;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
  width: 32px;
}

.movement-period-arrow:hover {
  background: var(--molto-brand-soft);
  border-color: #e4c8c3;
  color: var(--molto-brand);
}

.movement-summary-grid {
  background: #fff;
  border: 1px solid var(--molto-border);
  border-radius: var(--molto-radius);
  box-shadow: var(--molto-shadow-soft);
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 1rem;
}

.movement-summary-item {
  align-items: center;
  display: flex;
  gap: 0.8rem;
  min-height: 88px;
  padding: 1rem 1.1rem;
  position: relative;
}

.movement-summary-item + .movement-summary-item::before {
  background: var(--molto-border);
  content: "";
  inset: 18px auto 18px 0;
  position: absolute;
  width: 1px;
}

.movement-summary-item > div {
  display: grid;
  gap: 0.15rem;
  min-width: 0;
}

.movement-summary-item > div > span {
  color: var(--molto-muted);
  font-size: 0.68rem;
  font-weight: 650;
  letter-spacing: 0.055em;
  text-transform: uppercase;
}

.movement-summary-item strong {
  color: var(--molto-ink);
  font-size: 1.04rem;
  font-variant-numeric: tabular-nums;
  font-weight: 740;
  letter-spacing: -0.025em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.movement-summary-icon {
  align-items: center;
  background: var(--molto-bg-soft);
  border-radius: 9px;
  color: var(--molto-muted);
  display: inline-flex;
  flex: 0 0 auto;
  font-size: 1rem;
  height: 38px;
  justify-content: center;
  width: 38px;
}

.movement-summary-icon.es-success {
  background: var(--molto-success-soft);
  color: var(--molto-success);
}

.movement-summary-icon.es-danger {
  background: var(--molto-danger-soft);
  color: var(--molto-danger);
}

.movement-summary-icon.es-brand {
  background: var(--molto-brand-soft);
  color: var(--molto-brand);
}

.movement-filters {
  align-items: end;
  background: #fff;
  border: 1px solid var(--molto-border);
  border-radius: var(--molto-radius);
  box-shadow: var(--molto-shadow-soft);
  display: grid;
  gap: 0.7rem;
  grid-template-columns: 0.8fr 1.25fr repeat(3, 1fr) auto;
  margin-bottom: 1rem;
  padding: 0.85rem;
}

.movement-filter-field {
  min-width: 0;
}

.movement-filter-field label {
  color: var(--molto-muted);
  display: block;
  font-size: 0.64rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  margin: 0 0 0.3rem 0.15rem;
  text-transform: uppercase;
}

.movement-filter-field .form-control,
.movement-filter-field .form-select {
  background-color: #fafbfc;
  border-color: #e3e7ec;
  font-size: 0.78rem;
  min-height: 37px;
}

.movement-filter-field .form-control:hover,
.movement-filter-field .form-select:hover {
  border-color: var(--molto-border-strong);
}

.movement-filter-actions {
  align-items: center;
  display: flex;
  gap: 0.35rem;
}

.movement-filter-actions .btn {
  align-items: center;
  display: inline-flex;
  gap: 0.35rem;
  min-height: 37px;
  white-space: nowrap;
}

.movement-filter-actions .btn-link {
  color: var(--molto-muted);
  text-decoration: none;
}

.movement-filter-actions .btn-link:hover {
  color: var(--molto-brand);
}

.movement-table-card {
  overflow: visible !important;
}

.movement-table-heading {
  align-items: center;
  border-bottom: 1px solid var(--molto-border);
  display: flex;
  justify-content: space-between;
  padding: 1rem 1.15rem;
}

.movement-table-heading h2 {
  font-size: 0.92rem;
  font-weight: 700;
  margin: 0;
}

.movement-table-heading p {
  color: var(--molto-muted);
  font-size: 0.73rem;
  margin: 0.2rem 0 0;
}

.movement-table-count {
  background: var(--molto-bg-soft);
  border-radius: 6px;
  color: var(--molto-muted);
  font-size: 0.68rem;
  font-weight: 650;
  padding: 0.35rem 0.55rem;
}

.movement-table {
  min-width: 940px;
}

.movement-table > thead th {
  background: #fafbfc;
  padding-block: 0.7rem;
}

.movement-table > tbody td {
  padding: 0.85rem;
}

.movement-row {
  position: relative;
}

.movement-row::after {
  background: transparent;
  content: "";
  inset: 12px auto 12px 0;
  position: absolute;
  width: 2px;
}

.movement-row.es-ingreso::after {
  background: #73bda4;
}

.movement-row.es-egreso::after {
  background: #e6a3a8;
}

.movement-date {
  min-width: 76px;
}

.movement-date span,
.movement-date small {
  display: block;
}

.movement-date span {
  color: var(--molto-ink);
  font-size: 0.88rem;
  font-weight: 680;
}

.movement-date small {
  color: var(--molto-muted);
  font-size: 0.66rem;
  margin-top: 0.1rem;
  text-transform: capitalize;
}

.movement-description {
  min-width: 290px;
  max-width: 440px;
}

.movement-description-main {
  align-items: flex-start;
  display: flex;
  gap: 0.7rem;
}

.movement-description-main > div {
  min-width: 0;
}

.movement-description-main strong {
  color: var(--molto-ink);
  display: block;
  font-size: 0.82rem;
  font-weight: 650;
  line-height: 1.35;
}

.movement-type-icon {
  align-items: center;
  background: var(--molto-bg-soft);
  border-radius: 7px;
  color: var(--molto-muted);
  display: inline-flex;
  flex: 0 0 auto;
  height: 30px;
  justify-content: center;
  width: 30px;
}

.movement-row.es-ingreso .movement-type-icon {
  background: var(--molto-success-soft);
  color: var(--molto-success);
}

.movement-row.es-egreso .movement-type-icon {
  background: var(--molto-danger-soft);
  color: var(--molto-danger);
}

.movement-meta {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 0.5rem;
  margin-top: 0.28rem;
}

.movement-meta span {
  color: var(--molto-muted);
  font-size: 0.66rem;
  line-height: 1.3;
}

.movement-meta span + span::before {
  color: #c0c6cf;
  content: "·";
  margin-right: 0.45rem;
}

.movement-account {
  min-width: 130px;
}

.movement-account strong,
.movement-account small {
  display: block;
}

.movement-account strong {
  color: #3f4959;
  font-size: 0.76rem;
  font-weight: 650;
}

.movement-account small {
  color: var(--molto-muted);
  font-size: 0.66rem;
  margin-top: 0.15rem;
}

.movement-status {
  min-width: 140px;
}

.status-pill {
  align-items: center;
  border-radius: 5px;
  display: flex;
  font-size: 0.64rem;
  font-weight: 620;
  gap: 0.3rem;
  line-height: 1;
  margin: 0.18rem 0;
  padding: 0.28rem 0.42rem;
  width: fit-content;
}

a.status-pill:hover {
  filter: brightness(0.96);
}

.status-pill.es-success {
  background: var(--molto-success-soft);
  color: var(--molto-success);
}

.status-pill.es-info {
  background: var(--molto-info-soft);
  color: #2472a4;
}

.status-pill.es-warning {
  background: var(--molto-warning-soft);
  color: var(--molto-warning);
}

.status-pill.es-danger {
  background: var(--molto-danger-soft);
  color: var(--molto-danger);
}

.status-pill.es-neutral {
  background: var(--molto-bg-soft);
  color: var(--molto-muted);
}

.movement-amount {
  font-size: 0.84rem;
  font-variant-numeric: tabular-nums;
  font-weight: 740;
  min-width: 120px;
  white-space: nowrap;
}

.movement-actions {
  min-width: 112px;
  white-space: nowrap;
}

.movement-action-btn {
  align-items: center;
  background: #fff;
  border: 1px solid var(--molto-border);
  border-radius: 6px;
  color: var(--molto-muted);
  display: inline-flex;
  height: 30px;
  justify-content: center;
  margin-left: 0.18rem;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
  width: 30px;
}

.movement-action-btn:hover {
  background: var(--molto-brand-soft);
  border-color: #e4c8c3;
  color: var(--molto-brand);
}

.movement-action-btn.es-danger:hover {
  background: var(--molto-danger-soft);
  border-color: #f0c8cb;
  color: var(--molto-danger);
}

.movement-table-card div.dt-container > .dt-layout-row:first-child {
  align-items: center;
  border-bottom: 1px solid var(--molto-border);
  margin: 0;
  padding: 0.75rem 1rem;
}

.movement-table-card div.dt-container > .dt-layout-row:last-child {
  align-items: center;
  border-top: 1px solid var(--molto-border);
  margin: 0;
  padding: 0.75rem 1rem;
}

.movement-table-card div.dt-container .dt-search input {
  background: #fafbfc;
  min-width: 220px;
}

/* Calendario y agenda de pagos */
.payment-summary-grid,
.project-summary-grid {
  background: #fff;
  border: 1px solid var(--molto-border);
  border-radius: var(--molto-radius);
  box-shadow: var(--molto-shadow-soft);
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 1rem;
}

.payment-summary-item,
.project-summary-item {
  align-items: center;
  display: flex;
  gap: 0.8rem;
  min-height: 88px;
  padding: 1rem 1.1rem;
  position: relative;
}

.payment-summary-item + .payment-summary-item::before,
.project-summary-item + .project-summary-item::before {
  background: var(--molto-border);
  content: "";
  inset: 18px auto 18px 0;
  position: absolute;
  width: 1px;
}

.payment-summary-item > div,
.project-summary-item > div {
  display: grid;
  gap: 0.15rem;
  min-width: 0;
}

.payment-summary-item > div > span,
.project-summary-item > div > span {
  color: var(--molto-muted);
  font-size: 0.66rem;
  font-weight: 650;
  letter-spacing: 0.055em;
  text-transform: uppercase;
}

.payment-summary-item strong,
.project-summary-item strong {
  color: var(--molto-ink);
  font-size: 1.02rem;
  font-variant-numeric: tabular-nums;
  font-weight: 740;
  letter-spacing: -0.025em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.payment-summary-icon,
.project-summary-icon {
  align-items: center;
  background: var(--molto-bg-soft);
  border-radius: 9px;
  color: var(--molto-muted);
  display: inline-flex;
  flex: 0 0 auto;
  font-size: 1rem;
  height: 38px;
  justify-content: center;
  width: 38px;
}

.payment-summary-icon.es-brand,
.project-summary-icon.es-brand {
  background: var(--molto-brand-soft);
  color: var(--molto-brand);
}

.payment-summary-icon.es-success,
.project-summary-icon.es-success {
  background: var(--molto-success-soft);
  color: var(--molto-success);
}

.payment-summary-icon.es-warning {
  background: var(--molto-warning-soft);
  color: var(--molto-warning);
}

.payment-summary-icon.es-danger,
.project-summary-icon.es-danger {
  background: var(--molto-danger-soft);
  color: var(--molto-danger);
}

.payment-calendar-card {
  overflow: hidden;
}

.payment-calendar-heading,
.payment-list-heading,
.entity-table-heading {
  align-items: center;
  border-bottom: 1px solid var(--molto-border);
  display: flex;
  justify-content: space-between;
  padding: 1rem 1.15rem;
}

.payment-calendar-heading h2,
.payment-list-heading h2,
.entity-table-heading h2 {
  font-size: 0.92rem;
  font-weight: 700;
  margin: 0;
}

.payment-calendar-heading p,
.payment-list-heading p,
.entity-table-heading p {
  color: var(--molto-muted);
  font-size: 0.72rem;
  margin: 0.2rem 0 0;
}

.payment-calendar-legend {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
}

.payment-calendar-legend span {
  align-items: center;
  color: var(--molto-muted);
  display: inline-flex;
  font-size: 0.65rem;
  gap: 0.3rem;
}

.payment-calendar-legend i {
  background: #cbd5e1;
  border-radius: 50%;
  height: 7px;
  width: 7px;
}

.payment-calendar-legend .es-pendiente { background: #e5a628; }
.payment-calendar-legend .es-vencido { background: var(--molto-danger); }
.payment-calendar-legend .es-pagado { background: var(--molto-success); }
.payment-calendar-legend .es-omitido { background: #a0a8b5; }

.payment-list-heading > strong {
  color: var(--molto-brand);
  font-size: 1.05rem;
  font-variant-numeric: tabular-nums;
  font-weight: 740;
}

.payment-table {
  min-width: 780px;
}

.payment-date {
  min-width: 78px;
}

.payment-date span,
.payment-date small {
  display: block;
}

.payment-date span {
  color: var(--molto-ink);
  font-weight: 700;
}

.payment-date small {
  color: var(--molto-muted);
  font-size: 0.66rem;
  text-transform: capitalize;
}

.payment-concept {
  min-width: 230px;
}

.payment-concept > strong {
  color: var(--molto-ink);
  display: block;
  font-size: 0.8rem;
  font-weight: 650;
  margin-bottom: 0.3rem;
}

.payment-concept > div {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
}

.payment-account {
  color: var(--molto-muted);
  font-size: 0.75rem;
}

.payment-amount {
  color: var(--molto-ink);
  font-variant-numeric: tabular-nums;
  font-weight: 740;
}

.fc .fc-daygrid-event {
  border-radius: 4px;
  font-size: 0.67rem;
  font-weight: 600;
  margin: 2px 4px;
  padding: 2px 4px;
}

/* Formularios de movimiento y comprobante */
.document-movement-context,
.movement-edit-context {
  align-items: center;
  background: #fff;
  border: 1px solid var(--molto-border);
  border-left: 3px solid var(--molto-brand);
  border-radius: var(--molto-radius);
  box-shadow: var(--molto-shadow-soft);
  display: flex;
  gap: 0.85rem;
  margin-bottom: 1rem;
  padding: 0.9rem 1rem;
}

.document-context-icon,
.movement-edit-icon,
.document-form-heading > span,
.movement-form-heading > span {
  align-items: center;
  background: var(--molto-brand-soft);
  border-radius: 9px;
  color: var(--molto-brand);
  display: inline-flex;
  flex: 0 0 auto;
  font-size: 1rem;
  height: 38px;
  justify-content: center;
  width: 38px;
}

.movement-edit-icon.es-success {
  background: var(--molto-success-soft);
  color: var(--molto-success);
}

.movement-edit-icon.es-danger {
  background: var(--molto-danger-soft);
  color: var(--molto-danger);
}

.document-context-main,
.movement-edit-context > div {
  display: grid;
  min-width: 0;
}

.document-context-main > span,
.movement-edit-context > div > span {
  color: var(--molto-muted);
  font-size: 0.63rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.document-context-main strong,
.movement-edit-context > div > strong {
  color: var(--molto-ink);
  font-size: 0.82rem;
  font-weight: 650;
}

.document-context-main small,
.movement-edit-context > div > small {
  color: var(--molto-muted);
  font-size: 0.68rem;
}

.document-context-amount,
.movement-edit-amount {
  font-size: 1rem;
  font-variant-numeric: tabular-nums;
  font-weight: 750;
  margin-left: auto;
  white-space: nowrap;
}

.document-form-card,
.movement-form-card {
  overflow: hidden;
}

.document-form-heading,
.movement-form-heading {
  align-items: center;
  background: #fafbfc;
  border-bottom: 1px solid var(--molto-border);
  display: flex;
  gap: 0.75rem;
  padding: 1rem 1.2rem;
}

.document-form-heading h2,
.movement-form-heading h2 {
  font-size: 0.9rem;
  font-weight: 700;
  margin: 0;
}

.document-form-heading p,
.movement-form-heading p {
  color: var(--molto-muted);
  font-size: 0.7rem;
  margin: 0.15rem 0 0;
}

.document-upload-form input[type="file"] {
  background: #fafbfc;
  border: 1px dashed #cbd1da;
  min-height: 54px;
  padding: 0.8rem;
}

.form-action-bar {
  align-items: center;
  border-top: 1px solid var(--molto-border);
  display: flex;
  justify-content: space-between;
  margin-top: 1.4rem;
  padding-top: 1.1rem;
}

.form-action-note {
  align-items: center;
  color: var(--molto-muted);
  display: inline-flex;
  font-size: 0.68rem;
  gap: 0.35rem;
}

.form-action-note i {
  color: var(--molto-accent);
}

/* Proyectos */
.entity-table-heading > span {
  background: var(--molto-bg-soft);
  border-radius: 6px;
  color: var(--molto-muted);
  font-size: 0.67rem;
  font-weight: 650;
  padding: 0.35rem 0.55rem;
}

.project-table-card,
.receivables-table-card {
  overflow: visible !important;
}

.project-table,
.receivables-table {
  min-width: 960px;
}

.project-name {
  min-width: 230px;
}

.project-name > a,
.receivable-project > a {
  align-items: center;
  display: flex;
  gap: 0.65rem;
}

.project-avatar {
  align-items: center;
  background: var(--molto-brand-soft);
  border-radius: 8px;
  color: var(--molto-brand);
  display: inline-flex;
  flex: 0 0 auto;
  height: 32px;
  justify-content: center;
  width: 32px;
}

.project-name a > span:last-child,
.receivable-project a > span:last-child {
  display: grid;
}

.project-name a strong,
.receivable-project a strong {
  color: var(--molto-ink);
  font-size: 0.78rem;
  font-weight: 650;
}

.project-name a small,
.receivable-project a small {
  color: var(--molto-muted);
  font-size: 0.64rem;
}

.project-table td[data-order] {
  font-variant-numeric: tabular-nums;
  font-weight: 630;
}

/* Portafolio de cuentas */
.accounts-total-card,
.receivables-total {
  align-items: center;
  background: linear-gradient(120deg, #72291f, #96392c);
  border-radius: var(--molto-radius);
  box-shadow: 0 10px 28px rgb(97 35 28 / 0.18);
  color: #fff;
  display: flex;
  justify-content: space-between;
  margin-bottom: 1rem;
  min-height: 150px;
  overflow: hidden;
  padding: 1.45rem 1.6rem;
  position: relative;
}

.accounts-total-card > div,
.receivables-total > div {
  display: grid;
  position: relative;
  z-index: 1;
}

.accounts-total-label,
.receivables-total > div > span {
  color: rgb(255 255 255 / 0.7);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.075em;
  text-transform: uppercase;
}

.accounts-total-card > div > strong,
.receivables-total > div > strong {
  color: #fff;
  font-size: clamp(1.7rem, 4vw, 2.35rem);
  font-variant-numeric: tabular-nums;
  font-weight: 760;
  letter-spacing: -0.04em;
  line-height: 1.15;
  margin: 0.25rem 0;
}

.accounts-total-card small,
.receivables-total small {
  color: rgb(255 255 255 / 0.66);
  font-size: 0.7rem;
}

.accounts-total-icon,
.receivables-total-icon {
  align-items: center;
  background: rgb(255 255 255 / 0.1);
  border: 1px solid rgb(255 255 255 / 0.13);
  border-radius: 18px;
  color: rgb(255 255 255 / 0.82);
  display: inline-flex;
  font-size: 2rem;
  height: 74px;
  justify-content: center;
  transform: rotate(-4deg);
  width: 74px;
}

.account-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.account-card {
  background: #fff;
  border: 1px solid var(--molto-border);
  border-radius: var(--molto-radius);
  box-shadow: var(--molto-shadow-soft);
  display: flex;
  flex-direction: column;
  min-height: 240px;
  padding: 1.1rem;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.account-card:hover {
  border-color: var(--molto-border-strong);
  box-shadow: var(--molto-shadow);
  transform: translateY(-2px);
}

.account-card-head,
.account-card-footer {
  align-items: center;
  display: flex;
  justify-content: space-between;
}

.account-type-icon {
  align-items: center;
  background: var(--molto-brand-soft);
  border-radius: 9px;
  color: var(--molto-brand);
  display: inline-flex;
  font-size: 1rem;
  height: 38px;
  justify-content: center;
  width: 38px;
}

.account-card-body {
  display: grid;
  padding: 1.2rem 0;
}

.account-card-body > span {
  color: var(--molto-muted);
  font-size: 0.64rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.account-card-body h2 {
  font-size: 0.95rem;
  font-weight: 680;
  margin: 0.25rem 0 0.7rem;
}

.account-card-body strong {
  color: var(--molto-ink);
  font-size: 1.5rem;
  font-variant-numeric: tabular-nums;
  font-weight: 750;
  letter-spacing: -0.04em;
}

.account-card-body small {
  color: var(--molto-muted);
  font-size: 0.65rem;
}

.account-card-footer {
  border-top: 1px solid var(--molto-border);
  margin-top: auto;
  padding-top: 0.8rem;
}

.account-card-footer > a {
  align-items: center;
  color: var(--molto-brand);
  display: inline-flex;
  font-size: 0.72rem;
  font-weight: 650;
  gap: 0.35rem;
}

.account-card-footer > a:hover i {
  transform: translateX(2px);
}

.account-card-footer > a i {
  transition: transform 0.15s ease;
}

.accounts-empty {
  align-items: center;
  background: #fff;
  border: 1px dashed var(--molto-border-strong);
  border-radius: var(--molto-radius);
  display: flex;
  flex-direction: column;
  grid-column: 1 / -1;
  padding: 3rem;
  text-align: center;
}

.accounts-empty > i {
  color: var(--molto-brand);
  font-size: 1.7rem;
}

.accounts-empty h2 {
  font-size: 1rem;
  margin: 0.8rem 0 0.25rem;
}

.accounts-empty p {
  color: var(--molto-muted);
  font-size: 0.75rem;
}

/* Cobranza */
.receivables-date {
  align-items: center;
  color: var(--molto-muted);
  display: inline-flex;
  font-size: 0.72rem;
  gap: 0.4rem;
}

.receivables-buckets {
  background: #fff;
  border: 1px solid var(--molto-border);
  border-radius: var(--molto-radius);
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 1rem;
}

.receivable-bucket {
  align-items: center;
  display: flex;
  gap: 0.7rem;
  min-height: 78px;
  padding: 0.9rem 1rem;
}

.receivable-bucket + .receivable-bucket {
  border-left: 1px solid var(--molto-border);
}

.receivable-bucket-dot {
  background: #a8b0bc;
  border-radius: 50%;
  height: 8px;
  width: 8px;
}

.receivable-bucket.es-b31_60 .receivable-bucket-dot { background: #d8a13e; }
.receivable-bucket.es-b61_90 .receivable-bucket-dot { background: #cf773a; }
.receivable-bucket.es-b90 .receivable-bucket-dot { background: var(--molto-danger); }

.receivable-bucket > div {
  display: grid;
}

.receivable-bucket span {
  color: var(--molto-muted);
  font-size: 0.65rem;
}

.receivable-bucket strong {
  color: var(--molto-ink);
  font-size: 0.94rem;
  font-variant-numeric: tabular-nums;
  font-weight: 720;
}

.receivable-project {
  min-width: 230px;
}

.receivable-client {
  color: #4b5565;
  font-size: 0.75rem;
}

.aging-pill {
  background: var(--molto-bg-soft);
  border-radius: 5px;
  color: var(--molto-muted);
  display: inline-flex;
  font-size: 0.65rem;
  font-weight: 650;
  padding: 0.3rem 0.45rem;
}

.aging-pill.es-warning {
  background: var(--molto-warning-soft);
  color: var(--molto-warning);
}

.aging-pill.es-danger {
  background: var(--molto-danger-soft);
  color: var(--molto-danger);
}

.receivable-amount {
  color: var(--molto-ink);
  font-variant-numeric: tabular-nums;
  font-weight: 740;
}

.receivable-row.es-b90 {
  box-shadow: inset 2px 0 0 #e6a3a8;
}

/* Detalle ejecutivo de proyecto */
.project-detail-hero {
  align-items: flex-end;
  background: #fff;
  border: 1px solid var(--molto-border);
  border-radius: var(--molto-radius);
  box-shadow: var(--molto-shadow-soft);
  display: flex;
  justify-content: space-between;
  margin-bottom: 1rem;
  padding: 1.25rem 1.35rem;
}

.project-detail-identity {
  min-width: 0;
}

.project-back-link {
  align-items: center;
  color: var(--molto-muted);
  display: inline-flex;
  font-size: 0.68rem;
  gap: 0.3rem;
  margin-bottom: 1rem;
}

.project-back-link:hover {
  color: var(--molto-brand);
}

.project-detail-title {
  align-items: center;
  display: flex;
  gap: 0.9rem;
}

.project-detail-avatar {
  align-items: center;
  background: var(--molto-brand-soft);
  border-radius: 12px;
  color: var(--molto-brand);
  display: inline-flex;
  flex: 0 0 auto;
  font-size: 1.35rem;
  height: 54px;
  justify-content: center;
  width: 54px;
}

.project-detail-title h1 {
  font-size: clamp(1.4rem, 3vw, 1.9rem);
  font-weight: 750;
  line-height: 1.15;
  margin: 0;
}

.project-detail-title .dashboard-eyebrow {
  margin-bottom: 0.25rem;
}

.project-detail-title p {
  align-items: center;
  color: var(--molto-muted);
  display: flex;
  font-size: 0.74rem;
  gap: 0.3rem;
  margin: 0.3rem 0 0;
}

.project-detail-statuses {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin: 0.85rem 0 0 63px;
}

.project-detail-statuses .status-pill {
  margin: 0;
}

.project-detail-actions {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: flex-end;
}

.project-detail-actions .btn {
  align-items: center;
  display: inline-flex;
  gap: 0.35rem;
  min-height: 36px;
}

.project-detail-kpis {
  background: #fff;
  border: 1px solid var(--molto-border);
  border-radius: var(--molto-radius);
  box-shadow: var(--molto-shadow-soft);
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 1rem;
}

.project-detail-kpis article {
  align-items: center;
  display: flex;
  gap: 0.8rem;
  min-height: 94px;
  padding: 1rem 1.1rem;
  position: relative;
}

.project-detail-kpis article + article::before {
  background: var(--molto-border);
  content: "";
  inset: 18px auto 18px 0;
  position: absolute;
  width: 1px;
}

.project-kpi-icon {
  align-items: center;
  background: var(--molto-bg-soft);
  border-radius: 9px;
  color: var(--molto-muted);
  display: inline-flex;
  flex: 0 0 auto;
  font-size: 1rem;
  height: 40px;
  justify-content: center;
  width: 40px;
}

.project-kpi-icon.es-brand {
  background: var(--molto-brand-soft);
  color: var(--molto-brand);
}

.project-kpi-icon.es-success {
  background: var(--molto-success-soft);
  color: var(--molto-success);
}

.project-kpi-icon.es-danger {
  background: var(--molto-danger-soft);
  color: var(--molto-danger);
}

.project-detail-kpis article > div {
  display: grid;
  min-width: 0;
}

.project-detail-kpis article > div > span {
  color: var(--molto-muted);
  font-size: 0.65rem;
  font-weight: 650;
  letter-spacing: 0.055em;
  text-transform: uppercase;
}

.project-detail-kpis article strong {
  color: var(--molto-ink);
  font-size: 1.08rem;
  font-variant-numeric: tabular-nums;
  font-weight: 750;
  letter-spacing: -0.03em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.project-detail-overview {
  display: grid;
  gap: 1rem;
  grid-template-columns: minmax(0, 1.55fr) minmax(310px, 0.75fr);
  margin-bottom: 1rem;
}

.project-progress-card,
.project-info-card,
.project-invoices-card,
.project-ledger-card {
  overflow: hidden;
}

.project-section-heading {
  align-items: center;
  border-bottom: 1px solid var(--molto-border);
  display: flex;
  justify-content: space-between;
  min-height: 64px;
  padding: 0.9rem 1rem;
}

.project-section-heading h2 {
  font-size: 0.88rem;
  font-weight: 700;
  margin: 0;
}

.project-section-heading p {
  color: var(--molto-muted);
  font-size: 0.68rem;
  margin: 0.15rem 0 0;
}

.project-section-heading > span {
  background: var(--molto-bg-soft);
  border-radius: 6px;
  color: var(--molto-muted);
  font-size: 0.66rem;
  font-weight: 650;
  padding: 0.35rem 0.5rem;
}

.project-section-heading > span.es-pending {
  background: var(--molto-warning-soft);
  color: var(--molto-warning);
}

.project-section-heading > span.es-complete {
  background: var(--molto-success-soft);
  color: var(--molto-success);
}

.project-section-heading > strong {
  font-size: 1rem;
  font-variant-numeric: tabular-nums;
  font-weight: 750;
}

.project-progress-card .card-body {
  display: grid;
  gap: 1.35rem;
  padding: 1.2rem;
}

.project-progress-row {
  display: grid;
  gap: 0.55rem;
}

.project-progress-label,
.project-progress-values {
  align-items: center;
  display: flex;
  justify-content: space-between;
}

.project-progress-label span {
  color: #485365;
  font-size: 0.75rem;
  font-weight: 650;
}

.project-progress-label strong {
  color: var(--molto-ink);
  font-size: 0.75rem;
  font-variant-numeric: tabular-nums;
}

.project-progress-track {
  background: #edf0f3;
  border-radius: 999px;
  height: 8px;
  overflow: hidden;
}

.project-progress-track > span {
  border-radius: inherit;
  display: block;
  height: 100%;
}

.project-progress-track > span.es-success { background: var(--molto-success); }
.project-progress-track > span.es-brand { background: var(--molto-brand); }
.project-progress-track > span.es-danger { background: var(--molto-danger); }

.project-progress-values {
  color: var(--molto-muted);
  font-size: 0.64rem;
}

.project-info-card dl {
  margin: 0;
  padding: 0.45rem 1rem;
}

.project-info-card dl > div {
  align-items: center;
  border-bottom: 1px solid #eef0f3;
  display: flex;
  justify-content: space-between;
  padding: 0.65rem 0;
}

.project-info-card dl > div:last-child {
  border-bottom: 0;
}

.project-info-card dt {
  color: var(--molto-muted);
  font-size: 0.66rem;
  font-weight: 600;
}

.project-info-card dd {
  color: var(--molto-ink);
  font-size: 0.7rem;
  font-weight: 650;
  margin: 0;
  text-align: right;
}

.project-notes {
  background: #fafbfc;
  border-top: 1px solid var(--molto-border);
  padding: 0.8rem 1rem;
}

.project-notes > span {
  color: var(--molto-muted);
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.project-notes p {
  color: #525d6e;
  font-size: 0.7rem;
  line-height: 1.5;
  margin: 0.25rem 0 0;
}

.project-fiscal-strip {
  background: #fff;
  border: 1px solid var(--molto-border);
  border-radius: var(--molto-radius);
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 1rem;
}

.project-fiscal-strip > div {
  display: grid;
  min-height: 78px;
  padding: 0.95rem 1rem;
  position: relative;
}

.project-fiscal-strip > div + div::before {
  background: var(--molto-border);
  content: "";
  inset: 16px auto 16px 0;
  position: absolute;
  width: 1px;
}

.project-fiscal-strip span {
  color: var(--molto-muted);
  font-size: 0.65rem;
  font-weight: 650;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.project-fiscal-strip strong {
  color: var(--molto-ink);
  font-size: 0.95rem;
  font-variant-numeric: tabular-nums;
  font-weight: 730;
}

.project-invoices-table {
  min-width: 620px;
}

.project-invoice-link {
  align-items: center;
  display: inline-flex;
  gap: 0.55rem;
}

.project-invoice-link > span {
  align-items: center;
  background: var(--molto-brand-soft);
  border-radius: 7px;
  color: var(--molto-brand);
  display: inline-flex;
  height: 30px;
  justify-content: center;
  width: 30px;
}

.project-invoice-link strong {
  color: var(--molto-ink);
  font-size: 0.74rem;
  font-weight: 650;
}

.project-ledger-table {
  min-width: 850px;
}

.project-ledger-table tbody tr {
  position: relative;
}

.project-ledger-table tbody tr::after {
  background: transparent;
  content: "";
  inset: 12px auto 12px 0;
  position: absolute;
  width: 2px;
}

.project-ledger-table tbody tr.es-ingreso::after { background: #73bda4; }
.project-ledger-table tbody tr.es-egreso::after { background: #e6a3a8; }

.project-ledger-date {
  min-width: 72px;
}

.project-ledger-date span,
.project-ledger-date small {
  display: block;
}

.project-ledger-date span {
  color: var(--molto-ink);
  font-weight: 700;
}

.project-ledger-date small {
  color: var(--molto-muted);
  font-size: 0.65rem;
  text-transform: capitalize;
}

.project-ledger-description {
  min-width: 290px;
}

.project-ledger-description > div {
  align-items: center;
  display: flex;
  gap: 0.65rem;
}

.project-ledger-description > div > span:last-child {
  display: grid;
}

.project-ledger-description strong {
  color: var(--molto-ink);
  font-size: 0.76rem;
  font-weight: 650;
}

.project-ledger-description small {
  color: var(--molto-muted);
  font-size: 0.64rem;
}

.project-ledger-table tr.es-ingreso .movement-type-icon {
  background: var(--molto-success-soft);
  color: var(--molto-success);
}

.project-ledger-table tr.es-egreso .movement-type-icon {
  background: var(--molto-danger-soft);
  color: var(--molto-danger);
}

.project-ledger-account {
  color: #4c5768;
  font-size: 0.72rem;
}

.project-ledger-table td.text-end,
.project-invoices-table td.text-end {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.project-ledger-table tfoot th,
.project-ledger-table tfoot td {
  background: #fafbfc;
  border-top: 1px solid var(--molto-border-strong);
  padding: 0.8rem;
}

/* Conciliaciones bancarias */
.reconciliation-summary-grid {
  background: #fff;
  border: 1px solid var(--molto-border);
  border-radius: var(--molto-radius);
  box-shadow: var(--molto-shadow-soft);
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 1rem;
}

.reconciliation-summary-grid > div {
  align-items: center;
  display: flex;
  gap: 0.75rem;
  min-height: 88px;
  padding: 1rem;
  position: relative;
}

.reconciliation-summary-grid > div + div::before {
  background: var(--molto-border);
  content: "";
  inset: 18px auto 18px 0;
  position: absolute;
  width: 1px;
}

.reconciliation-summary-icon {
  align-items: center;
  background: var(--molto-bg-soft);
  border-radius: 9px;
  color: var(--molto-muted);
  display: inline-flex;
  flex: 0 0 auto;
  height: 38px;
  justify-content: center;
  width: 38px;
}

.reconciliation-summary-icon.es-brand { background: var(--molto-brand-soft); color: var(--molto-brand); }
.reconciliation-summary-icon.es-warning { background: var(--molto-warning-soft); color: var(--molto-warning); }
.reconciliation-summary-icon.es-success { background: var(--molto-success-soft); color: var(--molto-success); }
.reconciliation-summary-icon.es-danger { background: var(--molto-danger-soft); color: var(--molto-danger); }

.reconciliation-summary-grid p {
  display: grid;
  margin: 0;
}

.reconciliation-summary-grid p span {
  color: var(--molto-muted);
  font-size: 0.65rem;
  font-weight: 650;
  letter-spacing: 0.055em;
  text-transform: uppercase;
}

.reconciliation-summary-grid p strong {
  color: var(--molto-ink);
  font-size: 1.08rem;
  font-weight: 750;
}

.reconciliation-list-card,
.reconciliation-detail-card {
  overflow: visible !important;
}

.reconciliation-table {
  min-width: 860px;
}

.reconciliation-table tr.es-difference {
  box-shadow: inset 2px 0 0 #e6a3a8;
}

.reconciliation-account {
  min-width: 200px;
}

.reconciliation-account > a {
  align-items: center;
  display: flex;
  gap: 0.6rem;
}

.reconciliation-account > a > span:first-child {
  align-items: center;
  background: var(--molto-brand-soft);
  border-radius: 8px;
  color: var(--molto-brand);
  display: inline-flex;
  flex: 0 0 auto;
  height: 32px;
  justify-content: center;
  width: 32px;
}

.reconciliation-account > a > span:last-child {
  display: grid;
}

.reconciliation-account strong {
  color: var(--molto-ink);
  font-size: 0.76rem;
  font-weight: 650;
}

.reconciliation-account small,
.reconciliation-difference small {
  color: var(--molto-muted);
  display: block;
  font-size: 0.63rem;
}

.reconciliation-period {
  color: #4c5768;
  font-size: 0.73rem;
  font-weight: 620;
  text-transform: capitalize;
}

.reconciliation-table td.text-end {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.reconciliation-difference {
  font-weight: 740;
}

.reconciliation-detail-header {
  align-items: flex-end;
  background: #fff;
  border: 1px solid var(--molto-border);
  border-radius: var(--molto-radius);
  box-shadow: var(--molto-shadow-soft);
  display: flex;
  justify-content: space-between;
  margin-bottom: 1rem;
  padding: 1.2rem 1.3rem;
}

.reconciliation-detail-header > div > a {
  align-items: center;
  color: var(--molto-muted);
  display: inline-flex;
  font-size: 0.68rem;
  gap: 0.3rem;
  margin-bottom: 0.9rem;
}

.reconciliation-detail-header .dashboard-eyebrow {
  margin-bottom: 0.25rem;
}

.reconciliation-detail-header h1 {
  font-size: 1.65rem;
  font-weight: 750;
  margin: 0;
}

.reconciliation-detail-header p {
  color: var(--molto-muted);
  font-size: 0.72rem;
  margin: 0.3rem 0 0;
  text-transform: capitalize;
}

.reconciliation-state {
  align-items: center;
  border-radius: 7px;
  display: inline-flex;
  font-size: 0.7rem;
  font-weight: 650;
  gap: 0.4rem;
  padding: 0.5rem 0.65rem;
}

.reconciliation-state.es-open {
  background: var(--molto-warning-soft);
  color: var(--molto-warning);
}

.reconciliation-state.es-closed {
  background: var(--molto-success-soft);
  color: var(--molto-success);
}

.reconciliation-balance-grid {
  align-items: stretch;
  display: grid;
  gap: 0.55rem;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr) auto minmax(0, 1fr);
  margin-bottom: 1rem;
}

.reconciliation-balance-grid article {
  background: #fff;
  border: 1px solid var(--molto-border);
  border-radius: var(--molto-radius);
  display: grid;
  min-height: 125px;
  padding: 1.05rem 1.1rem;
}

.reconciliation-balance-grid article > span {
  color: var(--molto-muted);
  font-size: 0.66rem;
  font-weight: 650;
  letter-spacing: 0.055em;
  text-transform: uppercase;
}

.reconciliation-balance-grid article > strong {
  color: var(--molto-ink);
  font-size: 1.35rem;
  font-variant-numeric: tabular-nums;
  font-weight: 760;
  letter-spacing: -0.04em;
}

.reconciliation-balance-grid article > small {
  color: var(--molto-muted);
  font-size: 0.64rem;
}

.reconciliation-balance-grid article.es-balanced {
  background: var(--molto-success-soft);
  border-color: #cde8dc;
}

.reconciliation-balance-grid article.es-balanced > strong {
  color: var(--molto-success);
}

.reconciliation-balance-grid article.es-unbalanced {
  background: var(--molto-danger-soft);
  border-color: #f0d2d4;
}

.reconciliation-balance-grid article.es-unbalanced > strong {
  color: var(--molto-danger);
}

.reconciliation-operator {
  align-items: center;
  color: #9ba4b2;
  display: flex;
  font-size: 1.3rem;
  font-weight: 400;
}

.reconciliation-progress-card {
  align-items: center;
  background: #fff;
  border: 1px solid var(--molto-border);
  border-radius: var(--molto-radius);
  display: grid;
  gap: 1rem;
  grid-template-columns: minmax(190px, auto) 1fr auto;
  margin-bottom: 1rem;
  padding: 0.85rem 1rem;
}

.reconciliation-progress-card > div:first-child {
  display: grid;
}

.reconciliation-progress-card > div:first-child span {
  color: var(--molto-muted);
  font-size: 0.64rem;
  font-weight: 650;
  text-transform: uppercase;
}

.reconciliation-progress-card > div:first-child strong,
.reconciliation-progress-card > strong {
  color: var(--molto-ink);
  font-size: 0.75rem;
  font-weight: 700;
}

.reconciliation-progress-track {
  background: #edf0f3;
  border-radius: 999px;
  height: 7px;
  overflow: hidden;
}

.reconciliation-progress-track > span {
  background: var(--molto-success);
  border-radius: inherit;
  display: block;
  height: 100%;
}

.reconciliation-warning {
  align-items: center;
  background: var(--molto-warning-soft);
  border: 1px solid #f0dfb8;
  border-radius: var(--molto-radius);
  display: flex;
  gap: 0.75rem;
  margin-bottom: 1rem;
  padding: 0.85rem 1rem;
}

.reconciliation-warning > span {
  align-items: center;
  background: #fff3cf;
  border-radius: 8px;
  color: var(--molto-warning);
  display: inline-flex;
  flex: 0 0 auto;
  height: 36px;
  justify-content: center;
  width: 36px;
}

.reconciliation-warning strong {
  color: #79500d;
  font-size: 0.75rem;
}

.reconciliation-warning p {
  color: #8a681f;
  font-size: 0.68rem;
  margin: 0.1rem 0 0;
}

.reconciliation-detail-table {
  min-width: 850px;
}

.reconciliation-opening-row td {
  background: #fafbfc !important;
  color: var(--molto-muted);
  font-size: 0.7rem;
}

.reconciliation-check {
  cursor: pointer;
  display: inline-flex;
}

.reconciliation-check input {
  height: 1px;
  opacity: 0;
  position: absolute;
  width: 1px;
}

.reconciliation-check span {
  align-items: center;
  background: #fff;
  border: 1px solid var(--molto-border-strong);
  border-radius: 5px;
  color: transparent;
  display: inline-flex;
  height: 24px;
  justify-content: center;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
  width: 24px;
}

.reconciliation-check input:checked + span {
  background: var(--molto-success);
  border-color: var(--molto-success);
  color: #fff;
}

.reconciliation-check input:focus-visible + span {
  box-shadow: 0 0 0 3px rgb(22 130 93 / 0.14);
}

.reconciliation-check input:disabled + span {
  cursor: default;
  opacity: 0.7;
}

.reconciliation-detail-table tr.is-verified {
  background: #fbfefc;
}

.reconciliation-movement-date span,
.reconciliation-movement-date small,
.reconciliation-movement-description strong,
.reconciliation-movement-description small {
  display: block;
}

.reconciliation-movement-date span {
  color: var(--molto-ink);
  font-weight: 700;
}

.reconciliation-movement-date small,
.reconciliation-movement-description small {
  color: var(--molto-muted);
  font-size: 0.64rem;
  text-transform: capitalize;
}

.reconciliation-movement-description {
  min-width: 250px;
}

.reconciliation-movement-description strong {
  color: var(--molto-ink);
  font-size: 0.75rem;
  font-weight: 650;
}

.reconciliation-detail-table td.text-end {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.reconciliation-detail-table tfoot td {
  background: #fafbfc;
  border-top: 1px solid var(--molto-border-strong);
  padding-block: 0.8rem;
}

.reconciliation-action-bar {
  align-items: center;
  background: #fff;
  border: 1px solid var(--molto-border);
  border-radius: var(--molto-radius);
  display: flex;
  justify-content: space-between;
  padding: 0.85rem 1rem;
}

.reconciliation-action-bar > div {
  align-items: center;
  display: flex;
  gap: 0.5rem;
}

.reconciliation-action-bar > div:first-child {
  color: var(--molto-muted);
  font-size: 0.68rem;
}

.reconciliation-action-bar .btn {
  align-items: center;
  display: inline-flex;
  gap: 0.35rem;
}

/* Emisión de factura */
.invoice-form {
  max-width: 1220px;
  margin-inline: auto;
}

.invoice-environment-alert {
  align-items: center;
  border: 1px solid var(--molto-border);
  border-radius: var(--molto-radius);
  display: flex;
  gap: 0.75rem;
  margin-bottom: 1rem;
  padding: 0.85rem 1rem;
}

.invoice-environment-alert > span {
  align-items: center;
  border-radius: 8px;
  display: inline-flex;
  flex: 0 0 auto;
  height: 36px;
  justify-content: center;
  width: 36px;
}

.invoice-environment-alert.es-warning {
  background: var(--molto-warning-soft);
  border-color: #f0dfb8;
}

.invoice-environment-alert.es-warning > span { background: #fff3cf; color: var(--molto-warning); }
.invoice-environment-alert.es-info { background: var(--molto-info-soft); border-color: #cfe3f3; }
.invoice-environment-alert.es-info > span { background: #fff; color: #2472a4; }

.invoice-environment-alert strong {
  color: var(--molto-ink);
  font-size: 0.74rem;
}

.invoice-environment-alert p {
  color: var(--molto-muted);
  font-size: 0.68rem;
  margin: 0.1rem 0 0;
}

.invoice-review-card,
.invoice-general-card,
.invoice-concepts-card {
  overflow: hidden;
}

.invoice-review-card {
  border-top: 3px solid var(--molto-warning) !important;
}

.invoice-review-heading,
.invoice-section-heading {
  align-items: center;
  background: #fafbfc;
  border-bottom: 1px solid var(--molto-border);
  display: flex;
  gap: 0.75rem;
  min-height: 68px;
  padding: 0.9rem 1rem;
}

.invoice-review-heading > span:first-child,
.invoice-section-heading > span:first-child {
  align-items: center;
  background: var(--molto-brand-soft);
  border-radius: 9px;
  color: var(--molto-brand);
  display: inline-flex;
  flex: 0 0 auto;
  height: 38px;
  justify-content: center;
  width: 38px;
}

.invoice-review-heading > div,
.invoice-section-heading > div {
  min-width: 0;
}

.invoice-review-heading h2,
.invoice-section-heading h2 {
  font-size: 0.88rem;
  font-weight: 700;
  margin: 0;
}

.invoice-review-heading p,
.invoice-section-heading p {
  color: var(--molto-muted);
  font-size: 0.68rem;
  margin: 0.15rem 0 0;
}

.invoice-review-heading > .status-pill,
.invoice-step {
  margin-left: auto;
}

.invoice-step {
  color: #9ba4b2;
  font-size: 0.68rem;
  font-weight: 750;
  letter-spacing: 0.08em;
}

.invoice-review-meta {
  background: #fafbfc;
  border: 1px solid var(--molto-border);
  border-radius: 8px;
  display: grid;
  gap: 1rem;
  grid-template-columns: 1fr 1fr;
  margin-bottom: 1rem;
  padding: 0.85rem;
}

.invoice-review-meta > div {
  display: grid;
}

.invoice-review-meta span {
  color: var(--molto-muted);
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.invoice-review-meta strong {
  color: var(--molto-ink);
  font-size: 0.75rem;
  font-weight: 650;
}

.invoice-review-meta small {
  color: var(--molto-muted);
  font-size: 0.65rem;
  margin-top: 0.15rem;
}

.invoice-review-totals {
  margin: 1rem 0 0 auto;
  max-width: 390px;
}

.invoice-review-totals > div {
  align-items: center;
  border-bottom: 1px solid var(--molto-border);
  display: flex;
  justify-content: space-between;
  padding: 0.45rem 0;
}

.invoice-review-totals dt,
.invoice-review-totals dd {
  font-size: 0.7rem;
  margin: 0;
}

.invoice-review-totals dt {
  color: var(--molto-muted);
  font-weight: 600;
}

.invoice-review-totals dd {
  color: var(--molto-ink);
  font-variant-numeric: tabular-nums;
  font-weight: 680;
}

.invoice-review-totals .es-total {
  border-bottom: 0;
  padding-top: 0.65rem;
}

.invoice-review-totals .es-total dt,
.invoice-review-totals .es-total dd {
  color: var(--molto-brand);
  font-size: 1rem;
  font-weight: 750;
}

.invoice-form-grid {
  display: grid;
  gap: 0 1rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.invoice-form-grid > div:nth-last-child(-n + 2) {
  grid-column: auto;
}

.invoice-form-grid .mb-3 {
  margin-bottom: 1rem !important;
}

.invoice-concepts-table {
  min-width: 1180px;
}

.invoice-concepts-table input,
.invoice-concepts-table select {
  font-size: 0.72rem;
  min-height: 34px;
  min-width: 88px;
  padding: 0.35rem 0.45rem;
}

.invoice-concepts-table td:nth-child(2) input {
  min-width: 220px;
}

.invoice-concept-actions {
  min-width: 44px;
  text-align: center;
}

.invoice-remove-concept {
  align-items: center;
  background: #fff;
  border: 1px solid var(--molto-border);
  border-radius: 6px;
  color: var(--molto-muted);
  display: inline-flex;
  height: 30px;
  justify-content: center;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease, opacity 0.15s ease;
  width: 30px;
}

.invoice-remove-concept:hover:not(:disabled) {
  background: var(--molto-danger-soft);
  border-color: #f0c8cb;
  color: var(--molto-danger);
}

.invoice-remove-concept:disabled {
  cursor: not-allowed;
  opacity: 0.3;
}

.invoice-concepts-toolbar {
  align-items: center;
  border-top: 1px solid var(--molto-border);
  display: flex;
  justify-content: space-between;
  margin-top: 0.5rem;
  padding-top: 0.85rem;
}

.invoice-concepts-toolbar .btn {
  align-items: center;
  display: inline-flex;
  gap: 0.35rem;
}

.invoice-concepts-toolbar > span {
  color: var(--molto-muted);
  font-size: 0.65rem;
}

.invoice-concepts-toolbar > span strong {
  color: var(--molto-ink);
  font-variant-numeric: tabular-nums;
}

.invoice-concepts-toolbar + .invoice-help {
  margin-top: 0.85rem;
}

.invoice-help {
  align-items: flex-start;
  background: var(--molto-info-soft);
  border-radius: 7px;
  color: #2472a4;
  display: flex;
  gap: 0.45rem;
  padding: 0.65rem 0.75rem;
}

.invoice-help p {
  color: #416b89;
  font-size: 0.67rem;
  margin: 0;
}

.invoice-action-bar {
  align-items: center;
  background: #fff;
  border: 1px solid var(--molto-border);
  border-radius: var(--molto-radius);
  display: flex;
  justify-content: space-between;
  padding: 0.85rem 1rem;
}

.invoice-action-bar > div {
  align-items: center;
  display: flex;
  gap: 0.5rem;
}

.invoice-action-bar > div:first-child {
  color: var(--molto-muted);
  font-size: 0.68rem;
}

.invoice-action-bar .btn {
  align-items: center;
  display: inline-flex;
  gap: 0.4rem;
}

/* Selects con búsqueda */
.ts-wrapper {
  max-width: 100%;
}

.ts-control {
  align-items: center;
  background: #fff;
  border: 1px solid #d7dde5;
  border-radius: 8px;
  box-shadow: none;
  color: var(--molto-ink);
  display: flex;
  font-size: 0.78rem;
  gap: 0.25rem;
  min-height: 38px;
  padding: 0.4rem 2rem 0.4rem 0.75rem;
}

.ts-control,
.ts-control input {
  color: var(--molto-ink);
  font-size: 0.78rem;
}

.ts-control input::placeholder,
.ts-wrapper .item[data-value=""] {
  color: var(--molto-muted);
}

.ts-wrapper.single .ts-control::after {
  border-color: var(--molto-muted) transparent transparent;
  right: 0.85rem;
}

.ts-wrapper.focus .ts-control,
.ts-wrapper.dropdown-active .ts-control {
  border-color: var(--molto-brand);
  box-shadow: 0 0 0 0.16rem rgb(155 61 47 / 0.12);
}

.ts-dropdown {
  border: 1px solid var(--molto-border);
  border-radius: 8px;
  box-shadow: 0 18px 38px rgb(17 24 39 / 0.12);
  color: var(--molto-ink);
  font-size: 0.76rem;
  margin-top: 0.25rem;
  overflow: hidden;
}

.ts-dropdown .option,
.ts-dropdown .no-results {
  padding: 0.48rem 0.65rem;
}

.ts-dropdown .active {
  background: var(--molto-brand-soft);
  color: var(--molto-brand);
}

.ts-wrapper.plugin-clear_button .clear-button {
  color: var(--molto-muted);
  font-size: 1rem;
  line-height: 1;
  margin-right: 0.45rem;
}

.invoice-concepts-table .ts-control,
.rep-documents-table .ts-control {
  font-size: 0.72rem;
  min-height: 34px;
  padding-block: 0.28rem;
}

.invoice-concepts-table .ts-control input,
.rep-documents-table .ts-control input {
  font-size: 0.72rem;
}

/* Complemento de pago */
.rep-form .invoice-form-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.rep-documents-table {
  min-width: 980px;
}

.rep-documents-table input,
.rep-documents-table select {
  font-size: 0.72rem;
  min-height: 34px;
  padding: 0.35rem 0.45rem;
}

.rep-invoice-cell select {
  min-width: 280px;
}

.rep-number-cell {
  width: 135px;
}

.rep-number-cell input {
  max-width: 110px;
}

.rep-money-cell {
  width: 180px;
}

.rep-money-cell input {
  min-width: 145px;
  text-align: right;
}

.rep-remove-cell {
  text-align: center;
  width: 62px;
}

.rep-suggested-payments {
  background: #fafbfc;
  border: 1px solid var(--molto-border);
  border-radius: 8px;
  margin-top: 1rem;
  padding: 0.85rem;
}

.rep-suggested-payments h3 {
  align-items: center;
  color: var(--molto-ink);
  display: flex;
  font-size: 0.76rem;
  font-weight: 750;
  gap: 0.4rem;
  margin: 0 0 0.65rem;
}

.rep-suggested-payments > div {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.rep-suggested-payments .btn {
  align-items: center;
  display: inline-flex;
  font-variant-numeric: tabular-nums;
  gap: 0.35rem;
}

/* Catálogos, formularios y calidad de datos */
.module-subnav {
  align-items: center;
  background: var(--molto-surface);
  border: 1px solid var(--molto-border);
  border-radius: var(--molto-radius);
  box-shadow: var(--molto-shadow-soft);
  display: flex;
  gap: 0.2rem;
  margin-bottom: 1.15rem;
  overflow-x: auto;
  padding: 0.38rem;
  scrollbar-width: none;
}

.module-subnav::-webkit-scrollbar {
  display: none;
}

.module-subnav a {
  align-items: center;
  border-radius: 7px;
  color: var(--molto-muted);
  display: inline-flex;
  flex: 0 0 auto;
  font-size: 0.66rem;
  font-weight: 650;
  gap: 0.38rem;
  min-height: 35px;
  padding: 0.48rem 0.68rem;
  text-decoration: none;
}

.module-subnav a:hover {
  background: var(--molto-bg-soft);
  color: var(--molto-ink);
}

.module-subnav a.active {
  background: var(--molto-brand-soft);
  color: var(--molto-brand);
}

.close-page-header h1 { margin: 0; }
.close-page-header p { color: var(--molto-muted); margin: .4rem 0 0; }
.close-status-banner { align-items: center; border: 1px solid var(--molto-border); border-radius: var(--molto-radius); display: flex; gap: .7rem; margin-bottom: 1rem; padding: .85rem 1rem; }
.close-status-banner.es-pending { background: var(--molto-warning-soft); border-color: #f1d9a7; }
.close-status-banner.es-ready, .close-status-banner.es-closed { background: var(--molto-success-soft); border-color: #bfe4d3; }
.close-status-banner > span { align-items: center; background: #fff; border-radius: 8px; color: var(--molto-warning); display: inline-flex; height: 36px; justify-content: center; width: 36px; }
.close-status-banner.es-ready > span, .close-status-banner.es-closed > span { color: var(--molto-success); }
.close-status-banner strong, .close-status-banner small { display: block; }
.close-status-banner strong { font-size: .76rem; }
.close-status-banner small { color: var(--molto-muted); font-size: .64rem; margin-top: .15rem; }
.close-checklist-card, .close-duplicates-card, .close-action-card { border: 1px solid var(--molto-border); box-shadow: var(--molto-shadow-soft); margin-bottom: 1rem; overflow: hidden; }
.close-section-heading { align-items: center; border-bottom: 1px solid var(--molto-border); display: flex; gap: 1rem; justify-content: space-between; padding: 1rem 1.15rem; }
.close-section-heading h2 { font-size: .88rem; font-weight: 730; margin: 0; }
.close-section-heading p { color: var(--molto-muted); font-size: .65rem; margin: .25rem 0 0; }
.close-checklist { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); }
.close-checklist > a { align-items: center; color: inherit; display: grid; gap: .65rem; grid-template-columns: auto minmax(0,1fr) auto auto; min-height: 88px; padding: .9rem 1.1rem; text-decoration: none; }
.close-checklist > a:nth-child(odd) { border-right: 1px solid var(--molto-border); }
.close-checklist > a:nth-child(n+3) { border-top: 1px solid var(--molto-border); }
.close-checklist > a:hover { background: #fafbfc; }
.close-check-icon { align-items: center; border-radius: 7px; display: inline-flex; height: 32px; justify-content: center; width: 32px; }
.close-check-icon.es-done { background: var(--molto-success-soft); color: var(--molto-success); }
.close-check-icon.es-pending { background: var(--molto-danger-soft); color: var(--molto-danger); }
.close-check-icon.es-warning { background: var(--molto-warning-soft); color: var(--molto-warning); }
.close-checklist strong, .close-checklist small { display: block; }
.close-checklist strong { font-size: .7rem; }
.close-checklist small { color: var(--molto-muted); font-size: .59rem; margin-top: .15rem; }
.close-checklist b { font-size: .78rem; font-variant-numeric: tabular-nums; }
.close-checklist > a > i { color: var(--molto-border-strong); font-size: .7rem; }
.close-action-card { padding: 1rem 1.15rem; }
.close-action-card form { align-items: end; display: flex; gap: 1rem; justify-content: space-between; }
.close-action-card form > div { flex: 1; }
.close-action-card form > div > strong { font-size: .75rem; }
.close-action-card form > div > p { color: var(--molto-muted); font-size: .64rem; margin: .2rem 0 0; }
.close-observations label { color: var(--molto-muted); font-size: .63rem; font-weight: 650; margin-bottom: .3rem; }
.close-permission-note { align-items: center; color: var(--molto-muted); display: flex; font-size: .68rem; gap: .4rem; }
.document-filterbar, .security-filterbar { align-items: end; background: var(--molto-surface); border: 1px solid var(--molto-border); border-radius: var(--molto-radius); box-shadow: var(--molto-shadow-soft); display: grid; gap: .65rem; margin-bottom: 1rem; padding: .85rem 1rem; }
.document-filterbar { grid-template-columns: minmax(180px,.55fr) minmax(220px,.8fr) auto; }
.security-filterbar { grid-template-columns: minmax(200px,.7fr) minmax(200px,.7fr) auto; }
.document-filterbar label, .security-filterbar label { color: var(--molto-muted); display: block; font-size: .61rem; font-weight: 650; margin-bottom: .3rem; }
.document-filter-actions { align-items: center; display: flex; gap: .35rem; }
.document-table { min-width: 1020px; }
.document-download { align-items: center; color: var(--molto-brand); display: inline-flex; font-size: .64rem; font-weight: 660; gap: .3rem; text-decoration: none; }
.admin-event-table { min-width: 900px; }
.fiscal-ledger-table, .rep-ledger-table { min-width: 980px; }
.segment-filter { background: var(--molto-surface); border: 1px solid var(--molto-border); border-radius: 7px; padding: .25rem; }
.segment-filter .btn { border: 0; border-radius: 5px !important; font-size: .64rem; }

.invoice-ledger-header {
  align-items: center;
}

.invoice-ledger-header h1 {
  margin: 0;
}

.invoice-ledger-header p {
  color: var(--molto-muted);
  margin: 0.4rem 0 0;
}

.invoice-link-notice {
  align-items: center;
  background: var(--molto-warning-soft);
  border: 1px solid #f1d9a7;
  border-radius: var(--molto-radius);
  display: flex;
  gap: 0.7rem;
  margin-bottom: 1rem;
  padding: 0.75rem 0.9rem;
}

.invoice-link-notice > span {
  align-items: center;
  background: #fff;
  border-radius: 7px;
  color: var(--molto-warning);
  display: inline-flex;
  flex: 0 0 auto;
  height: 34px;
  justify-content: center;
  width: 34px;
}

.invoice-link-notice > div {
  flex: 1;
}

.invoice-link-notice strong,
.invoice-link-notice small {
  display: block;
}

.invoice-link-notice strong {
  color: #6f4807;
  font-size: 0.72rem;
}

.invoice-link-notice small {
  color: #87621f;
  font-size: 0.62rem;
  margin-top: 0.12rem;
}

.invoice-link-notice > a {
  align-items: center;
  color: #6f4807;
  display: inline-flex;
  font-size: 0.65rem;
  font-weight: 680;
  gap: 0.3rem;
  text-decoration: none;
  white-space: nowrap;
}

.catalog-page-header,
.quality-page-header {
  align-items: center;
}

.catalog-page-header h1,
.quality-page-header h1 {
  margin: 0;
}

.catalog-page-header p,
.quality-page-header p {
  color: var(--molto-muted);
  margin: 0.4rem 0 0;
}

.catalog-page-header > .btn,
.catalog-page-header > form .btn {
  align-items: center;
  display: inline-flex;
  gap: 0.45rem;
}

.catalog-module-nav {
  align-items: center;
  background: linear-gradient(180deg, #fff 0%, #fbfcfd 100%);
  border: 1px solid var(--molto-border);
  border-radius: var(--molto-radius);
  box-shadow: var(--molto-shadow-soft);
  display: flex;
  gap: 0.35rem;
  margin-bottom: 1rem;
  overflow-x: auto;
  padding: 0.45rem;
  position: relative;
  scrollbar-width: none;
}

.catalog-module-nav::after {
  background: linear-gradient(90deg, rgb(255 255 255 / 0), #fff);
  content: "";
  height: calc(100% - 2px);
  pointer-events: none;
  position: sticky;
  right: -0.45rem;
  width: 26px;
}

.catalog-module-nav::-webkit-scrollbar {
  display: none;
}

.catalog-module-nav a {
  align-items: center;
  border: 1px solid transparent;
  border-radius: 9px;
  color: var(--molto-muted);
  display: inline-flex;
  flex: 0 0 auto;
  font-size: 0.7rem;
  font-weight: 720;
  gap: 0.5rem;
  min-height: 42px;
  padding: 0.35rem 0.72rem 0.35rem 0.42rem;
  text-decoration: none;
  transition: background 0.16s ease, border-color 0.16s ease, color 0.16s ease, transform 0.16s ease;
}

.catalog-nav-icon {
  align-items: center;
  background: #f5f7fa;
  border: 1px solid #edf0f4;
  border-radius: 8px;
  color: #7b8492;
  display: inline-flex;
  flex: 0 0 auto;
  height: 30px;
  justify-content: center;
  width: 30px;
}

.catalog-module-nav a > span:last-child {
  line-height: 1;
  white-space: nowrap;
}

.catalog-module-nav a:hover {
  background: #fff;
  border-color: #e7ebf0;
  color: var(--molto-ink);
  transform: translateY(-1px);
}

.catalog-module-nav a:hover .catalog-nav-icon {
  background: var(--molto-brand-soft);
  border-color: #efd7d1;
  color: var(--molto-brand);
}

.catalog-module-nav a.active {
  background: #fff;
  border-color: #ead2cd;
  box-shadow: 0 10px 20px rgb(155 61 47 / 0.08);
  color: var(--molto-brand);
}

.catalog-module-nav a.active .catalog-nav-icon {
  background: var(--molto-brand);
  border-color: var(--molto-brand);
  color: #fff;
}

.catalog-summary-grid,
.quality-summary-grid {
  background: var(--molto-surface);
  border: 1px solid var(--molto-border);
  border-radius: var(--molto-radius);
  box-shadow: var(--molto-shadow-soft);
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 1rem;
  overflow: hidden;
}

.catalog-summary-grid.es-three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.catalog-summary-grid > article,
.quality-summary-grid > article {
  align-items: center;
  display: flex;
  gap: 0.75rem;
  min-height: 108px;
  padding: 1rem;
}

.catalog-summary-grid > article + article,
.quality-summary-grid > article + article {
  border-left: 1px solid var(--molto-border);
}

.catalog-summary-icon,
.quality-summary-icon {
  align-items: center;
  background: var(--molto-bg-soft);
  border-radius: 8px;
  color: var(--molto-muted);
  display: inline-flex;
  flex: 0 0 auto;
  height: 39px;
  justify-content: center;
  width: 39px;
}

.catalog-summary-icon.es-brand {
  background: var(--molto-brand-soft);
  color: var(--molto-brand);
}

.catalog-summary-icon.es-success,
.quality-summary-icon.es-success {
  background: var(--molto-success-soft);
  color: var(--molto-success);
}

.catalog-summary-icon.es-info,
.quality-summary-icon.es-info {
  background: var(--molto-info-soft);
  color: #2472a4;
}

.catalog-summary-icon.es-warning,
.quality-summary-icon.es-warning {
  background: var(--molto-warning-soft);
  color: var(--molto-warning);
}

.catalog-summary-icon.es-danger,
.quality-summary-icon.es-danger {
  background: var(--molto-danger-soft);
  color: var(--molto-danger);
}

.catalog-summary-item.es-neutral,
.quality-summary-icon.es-neutral {
  background: var(--molto-bg-soft);
  color: var(--molto-muted);
}

.catalog-summary-grid article > div,
.quality-summary-grid article > div {
  min-width: 0;
}

.catalog-summary-grid article > div > span,
.catalog-summary-grid small,
.quality-summary-grid article > div > span,
.quality-summary-grid small {
  color: var(--molto-muted);
  display: block;
  font-size: 0.64rem;
}

.catalog-summary-grid strong,
.quality-summary-grid strong {
  color: var(--molto-ink);
  display: block;
  font-size: 1.22rem;
  font-variant-numeric: tabular-nums;
  font-weight: 760;
  line-height: 1.2;
  margin: 0.15rem 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.catalog-table-card {
  border: 1px solid var(--molto-border);
  box-shadow: var(--molto-shadow-soft);
  overflow: hidden;
}

.catalog-table-heading {
  align-items: center;
  border-bottom: 1px solid var(--molto-border);
  display: flex;
  gap: 1rem;
  justify-content: space-between;
  padding: 1rem 1.15rem;
}

.catalog-table-heading h2 {
  font-size: 0.9rem;
  font-weight: 730;
  margin: 0;
}

.catalog-table-heading p {
  color: var(--molto-muted);
  font-size: 0.67rem;
  margin: 0.25rem 0 0;
}

.catalog-table-heading > span {
  background: var(--molto-bg-soft);
  border: 1px solid var(--molto-border);
  border-radius: 5px;
  color: var(--molto-muted);
  flex: 0 0 auto;
  font-size: 0.61rem;
  font-weight: 650;
  padding: 0.32rem 0.45rem;
}

.catalog-table {
  margin: 0;
  min-width: 850px;
}

.fiscal-template-table {
  min-width: 1080px;
}

.catalog-table th {
  background: #fafbfc;
  white-space: nowrap;
}

.catalog-table td {
  vertical-align: middle;
}

.catalog-identity {
  align-items: center;
  display: flex;
  gap: 0.55rem;
  min-width: 175px;
}

.catalog-identity > span {
  align-items: center;
  background: var(--molto-brand-soft);
  border-radius: 7px;
  color: var(--molto-brand);
  display: inline-flex;
  flex: 0 0 auto;
  font-size: 0.68rem;
  font-weight: 750;
  height: 31px;
  justify-content: center;
  width: 31px;
}

.catalog-identity.es-provider > span,
.catalog-identity.es-payment > span {
  background: var(--molto-warning-soft);
  color: var(--molto-warning);
}

.catalog-identity.es-employee > span {
  background: var(--molto-info-soft);
  color: #2472a4;
}

.catalog-identity.es-category > span,
.catalog-identity.es-template > span {
  background: var(--molto-success-soft);
  color: var(--molto-success);
}

.catalog-identity strong,
.catalog-identity small,
.catalog-fiscal-data strong,
.catalog-fiscal-data small,
.catalog-date strong,
.catalog-date small,
.catalog-tax strong,
.catalog-tax small {
  display: block;
}

.catalog-identity strong,
.catalog-fiscal-data strong,
.catalog-date strong,
.catalog-tax strong {
  color: var(--molto-ink);
  font-size: 0.69rem;
  font-weight: 670;
}

.catalog-identity small,
.catalog-fiscal-data small,
.catalog-date small,
.catalog-tax small {
  color: var(--molto-muted);
  font-size: 0.59rem;
  margin-top: 0.14rem;
}

.catalog-secondary,
.catalog-description {
  color: var(--molto-muted) !important;
  font-size: 0.65rem;
  line-height: 1.45;
}

.catalog-description {
  min-width: 220px;
}

.catalog-code,
.catalog-frequency,
.catalog-context {
  background: var(--molto-bg-soft);
  border-radius: 4px;
  color: var(--molto-muted);
  display: inline-block;
  font-size: 0.6rem;
  padding: 0.25rem 0.35rem;
  white-space: nowrap;
}

.catalog-code,
.catalog-code.es-sat {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

.catalog-code.es-sat {
  background: var(--molto-info-soft);
  color: #2472a4;
  font-weight: 700;
}

.catalog-count {
  align-items: center;
  background: var(--molto-bg-soft);
  border-radius: 999px;
  color: var(--molto-ink);
  display: inline-flex;
  font-size: 0.65rem;
  font-weight: 700;
  height: 25px;
  justify-content: center;
  min-width: 25px;
}

.catalog-money {
  color: var(--molto-muted) !important;
  font-size: 0.7rem;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.catalog-money.es-strong {
  color: var(--molto-ink) !important;
  font-weight: 710;
}

.catalog-money.es-danger {
  color: var(--molto-danger) !important;
  font-weight: 690;
}

.catalog-row-actions {
  display: flex;
  gap: 0.3rem;
  justify-content: flex-end;
  min-width: 70px;
}

.catalog-row-actions .btn {
  align-items: center;
  display: inline-flex;
  height: 29px;
  justify-content: center;
  padding: 0;
  width: 29px;
}

.catalog-empty {
  align-items: center;
  color: var(--molto-muted);
  display: flex;
  flex-direction: column;
  gap: 0.28rem;
  justify-content: center;
  min-height: 170px;
  text-align: center;
}

.catalog-empty i {
  color: var(--molto-border-strong);
  font-size: 1.35rem;
}

.catalog-empty strong {
  color: var(--molto-ink);
  font-size: 0.75rem;
}

.catalog-empty span {
  font-size: 0.63rem;
}

.sat-search-card {
  border: 1px solid var(--molto-border);
  box-shadow: var(--molto-shadow-soft);
  margin-bottom: 1rem;
  padding: 0.9rem 1rem;
}

.sat-search-grid {
  align-items: end;
  display: grid;
  gap: 0.65rem;
  grid-template-columns: minmax(190px, 0.7fr) minmax(260px, 1.4fr) auto auto;
}

.sat-search-grid label {
  color: var(--molto-muted);
  display: block;
  font-size: 0.61rem;
  font-weight: 650;
  margin-bottom: 0.3rem;
}

.sat-catalog-table {
  min-width: 880px;
}

.catalog-form-page {
  max-width: 880px;
}

.catalog-form-header {
  align-items: flex-start;
  display: flex;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.catalog-form-back {
  align-items: center;
  border: 1px solid var(--molto-border);
  border-radius: 7px;
  color: var(--molto-muted);
  display: inline-flex;
  flex: 0 0 auto;
  height: 36px;
  justify-content: center;
  text-decoration: none;
  width: 36px;
}

.catalog-form-header h1 {
  font-size: 1.35rem;
  font-weight: 730;
  margin: 0;
}

.catalog-form-header p {
  color: var(--molto-muted);
  font-size: 0.72rem;
  margin: 0.35rem 0 0;
}

.catalog-form-card {
  border: 1px solid var(--molto-border);
  box-shadow: var(--molto-shadow-soft);
  overflow: hidden;
}

.catalog-form-card-heading {
  align-items: center;
  border-bottom: 1px solid var(--molto-border);
  display: flex;
  gap: 0.65rem;
  padding: 0.9rem 1.1rem;
}

.catalog-form-card-heading > span {
  align-items: center;
  background: var(--molto-brand-soft);
  border-radius: 7px;
  color: var(--molto-brand);
  display: inline-flex;
  height: 34px;
  justify-content: center;
  width: 34px;
}

.catalog-form-card-heading strong,
.catalog-form-card-heading small {
  display: block;
}

.catalog-form-card-heading strong {
  font-size: 0.75rem;
}

.catalog-form-card-heading small {
  color: var(--molto-muted);
  font-size: 0.62rem;
  margin-top: 0.15rem;
}

.catalog-form-card .card-body {
  padding: 1.35rem;
}

.catalog-record-form label {
  color: #455064;
  font-size: 0.66rem;
  font-weight: 650;
}

.catalog-form-actions {
  border-top: 1px solid var(--molto-border);
  display: flex;
  gap: 0.55rem;
  justify-content: flex-end;
  margin-top: 1rem;
  padding-top: 1rem;
}

.catalog-form-actions .btn {
  align-items: center;
  display: inline-flex;
  gap: 0.35rem;
  justify-content: center;
}

.quality-finding-card {
  border: 1px solid var(--molto-border);
  box-shadow: var(--molto-shadow-soft);
  margin-bottom: 0.75rem;
  overflow: hidden;
}

.quality-finding-card.es-danger {
  border-left: 3px solid var(--molto-danger);
}

.quality-finding-card.es-warning {
  border-left: 3px solid #dfa844;
}

.quality-finding-heading {
  align-items: center;
  display: flex;
  gap: 1rem;
  justify-content: space-between;
}

.quality-finding-heading > div:first-child {
  align-items: center;
  display: flex;
  gap: 0.65rem;
}

.quality-finding-icon {
  align-items: center;
  background: var(--molto-warning-soft);
  border-radius: 7px;
  color: var(--molto-warning);
  display: inline-flex;
  flex: 0 0 auto;
  height: 34px;
  justify-content: center;
  width: 34px;
}

.quality-finding-card.es-danger .quality-finding-icon {
  background: var(--molto-danger-soft);
  color: var(--molto-danger);
}

.quality-finding-heading h2 {
  font-size: 0.78rem;
  font-weight: 700;
  margin: 0;
}

.quality-finding-heading p {
  color: var(--molto-muted);
  font-size: 0.64rem;
  margin: 0.2rem 0 0;
}

.quality-count {
  align-items: center;
  background: var(--molto-warning-soft);
  border-radius: 999px;
  color: var(--molto-warning);
  display: inline-flex;
  font-size: 0.62rem;
  font-weight: 750;
  height: 25px;
  justify-content: center;
  min-width: 25px;
}

.quality-count.es-danger {
  background: var(--molto-danger-soft);
  color: var(--molto-danger);
}

.quality-finding-table {
  border-top: 1px solid var(--molto-border);
  margin-top: 0.85rem !important;
}

.quality-clear-state {
  align-items: center;
  color: var(--molto-success);
  display: flex;
  font-size: 0.67rem;
  gap: 0.35rem;
  margin-top: 0.75rem;
}

.quality-secondary-grid .card {
  border: 1px solid var(--molto-border);
  box-shadow: var(--molto-shadow-soft);
}

/* Inventario y activos */
.inventory-page-header {
  align-items: center;
}

.inventory-page-header h1 {
  margin: 0;
}

.inventory-page-header p {
  color: var(--molto-muted);
  margin: 0.4rem 0 0;
}

.inventory-module-nav {
  align-items: center;
  background: var(--molto-surface);
  border: 1px solid var(--molto-border);
  border-radius: var(--molto-radius);
  box-shadow: var(--molto-shadow-soft);
  display: flex;
  gap: 0.25rem;
  margin-bottom: 1rem;
  overflow-x: auto;
  padding: 0.4rem;
  scrollbar-width: none;
}

.inventory-module-nav::-webkit-scrollbar {
  display: none;
}

.inventory-module-nav a {
  align-items: center;
  border-radius: 7px;
  color: var(--molto-muted);
  display: inline-flex;
  flex: 0 0 auto;
  font-size: 0.68rem;
  font-weight: 650;
  gap: 0.4rem;
  min-height: 36px;
  padding: 0.5rem 0.7rem;
  text-decoration: none;
}

.inventory-module-nav a:hover {
  background: var(--molto-bg-soft);
  color: var(--molto-ink);
}

.inventory-module-nav a.active {
  background: var(--molto-brand-soft);
  color: var(--molto-brand);
}

.inventory-module-nav a > span {
  align-items: center;
  background: rgb(255 255 255 / 0.8);
  border: 1px solid currentColor;
  border-radius: 999px;
  display: inline-flex;
  font-size: 0.56rem;
  height: 18px;
  justify-content: center;
  min-width: 18px;
  padding: 0 0.25rem;
}

.inventory-summary-grid {
  background: var(--molto-surface);
  border: 1px solid var(--molto-border);
  border-radius: var(--molto-radius);
  box-shadow: var(--molto-shadow-soft);
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 1rem;
  overflow: hidden;
}

.inventory-summary-item {
  align-items: center;
  display: flex;
  gap: 0.85rem;
  min-height: 116px;
  padding: 1.1rem;
}

.inventory-summary-item + .inventory-summary-item {
  border-left: 1px solid var(--molto-border);
}

.inventory-summary-icon {
  align-items: center;
  background: var(--molto-bg-soft);
  border-radius: 9px;
  color: var(--molto-muted);
  display: inline-flex;
  flex: 0 0 auto;
  font-size: 1rem;
  height: 42px;
  justify-content: center;
  width: 42px;
}

.inventory-summary-icon.es-brand {
  background: var(--molto-brand-soft);
  color: var(--molto-brand);
}

.inventory-summary-icon.es-info {
  background: var(--molto-info-soft);
  color: #2472a4;
}

.inventory-summary-icon.es-danger {
  background: var(--molto-danger-soft);
  color: var(--molto-danger);
}

.inventory-summary-icon.es-success {
  background: var(--molto-success-soft);
  color: var(--molto-success);
}

.inventory-summary-icon.es-warning {
  background: var(--molto-warning-soft);
  color: var(--molto-warning);
}

.inventory-summary-item > div {
  min-width: 0;
}

.inventory-summary-item > div > span,
.inventory-summary-item small {
  color: var(--molto-muted);
  display: block;
  font-size: 0.66rem;
}

.inventory-summary-item strong {
  color: var(--molto-ink);
  display: block;
  font-size: 1.25rem;
  font-variant-numeric: tabular-nums;
  font-weight: 760;
  line-height: 1.2;
  margin: 0.18rem 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.inventory-stock-alert {
  align-items: center;
  background: var(--molto-warning-soft);
  border: 1px solid #f1d9a7;
  border-radius: var(--molto-radius);
  display: flex;
  gap: 0.8rem;
  margin-bottom: 1rem;
  padding: 0.9rem 1rem;
}

.inventory-stock-alert > span {
  align-items: center;
  background: #fff;
  border-radius: 8px;
  color: var(--molto-warning);
  display: inline-flex;
  flex: 0 0 auto;
  height: 36px;
  justify-content: center;
  width: 36px;
}

.inventory-stock-alert > div {
  flex: 1;
  min-width: 0;
}

.inventory-stock-alert strong {
  color: #6f4807;
  display: block;
  font-size: 0.74rem;
}

.inventory-stock-alert p {
  color: #87621f;
  font-size: 0.68rem;
  line-height: 1.5;
  margin: 0.2rem 0 0;
}

.inventory-stock-alert p a {
  color: #6f4807;
  font-weight: 680;
}

.inventory-section-card {
  border: 1px solid var(--molto-border);
  box-shadow: var(--molto-shadow-soft);
  margin-bottom: 1rem;
  overflow: hidden;
  scroll-margin-top: 82px;
}

.inventory-section-heading {
  align-items: center;
  border-bottom: 1px solid var(--molto-border);
  display: flex;
  gap: 1rem;
  justify-content: space-between;
  padding: 1rem 1.15rem;
}

.inventory-section-heading > div:first-child {
  align-items: center;
  display: flex;
  gap: 0.7rem;
}

.inventory-section-icon {
  align-items: center;
  background: var(--molto-info-soft);
  border-radius: 8px;
  color: #2472a4;
  display: inline-flex;
  flex: 0 0 auto;
  height: 36px;
  justify-content: center;
  width: 36px;
}

.inventory-section-icon.es-tools {
  background: var(--molto-warning-soft);
  color: var(--molto-warning);
}

.inventory-section-heading h2 {
  font-size: 0.9rem;
  font-weight: 730;
  margin: 0;
}

.inventory-section-heading p {
  color: var(--molto-muted);
  font-size: 0.67rem;
  margin: 0.25rem 0 0;
}

.inventory-section-heading .btn,
.inventory-section-actions {
  align-items: center;
  display: flex;
  gap: 0.4rem;
}

.inventory-section-actions {
  flex-wrap: wrap;
  justify-content: flex-end;
}

.inventory-table {
  margin: 0;
  min-width: 990px;
}

.tools-table {
  min-width: 1060px;
}

.inventory-table th {
  background: #fafbfc;
  white-space: nowrap;
}

.inventory-table td {
  vertical-align: middle;
}

.inventory-item-identity {
  align-items: center;
  display: flex;
  gap: 0.6rem;
  min-width: 180px;
}

.inventory-item-identity > span {
  align-items: center;
  background: var(--molto-brand-soft);
  border-radius: 7px;
  color: var(--molto-brand);
  display: inline-flex;
  flex: 0 0 auto;
  font-size: 0.7rem;
  font-weight: 760;
  height: 31px;
  justify-content: center;
  width: 31px;
}

.inventory-item-identity.es-tool > span {
  background: var(--molto-warning-soft);
  color: var(--molto-warning);
}

.inventory-item-identity strong,
.inventory-item-identity small {
  display: block;
}

.inventory-item-identity strong {
  color: var(--molto-ink);
  font-size: 0.72rem;
  font-weight: 680;
}

.inventory-item-identity small {
  color: var(--molto-muted);
  font-size: 0.61rem;
  margin-top: 0.15rem;
}

.inventory-code {
  background: var(--molto-bg-soft);
  border-radius: 4px;
  color: var(--molto-muted);
  display: inline-block;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.61rem;
  padding: 0.25rem 0.35rem;
  white-space: nowrap;
}

.inventory-money {
  color: var(--molto-muted) !important;
  font-size: 0.7rem;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.inventory-money.es-strong {
  color: var(--molto-ink) !important;
  font-weight: 710;
}

.inventory-stock-value {
  min-width: 105px;
}

.inventory-stock-value strong,
.inventory-stock-value > span,
.inventory-stock-value small {
  display: inline;
}

.inventory-stock-value strong {
  color: var(--molto-ink);
  font-size: 0.76rem;
  font-variant-numeric: tabular-nums;
  font-weight: 710;
}

.inventory-stock-value > span {
  color: var(--molto-muted);
  font-size: 0.62rem;
}

.inventory-stock-value small {
  color: var(--molto-muted);
  display: block;
  font-size: 0.57rem;
  margin-top: 0.12rem;
}

.inventory-stock-value.es-low strong {
  color: var(--molto-danger);
}

.inventory-assignment {
  min-width: 145px;
}

.inventory-assignment strong,
.inventory-assignment small {
  display: block;
}

.inventory-assignment strong {
  color: var(--molto-ink);
  font-size: 0.69rem;
  font-weight: 650;
}

.inventory-assignment small,
.inventory-secondary {
  color: var(--molto-muted) !important;
  font-size: 0.62rem;
}

.inventory-assignment small {
  margin-top: 0.15rem;
}

.inventory-row-actions {
  display: flex;
  gap: 0.3rem;
  justify-content: flex-end;
  min-width: 72px;
}

.inventory-row-actions .btn {
  align-items: center;
  display: inline-flex;
  height: 30px;
  justify-content: center;
  padding: 0;
  width: 30px;
}

.inventory-table-empty {
  align-items: center;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 190px;
  text-align: center;
}

.inventory-table-empty > span {
  align-items: center;
  background: var(--molto-bg-soft);
  border-radius: 50%;
  color: var(--molto-muted);
  display: inline-flex;
  font-size: 1.05rem;
  height: 44px;
  justify-content: center;
  margin-bottom: 0.55rem;
  width: 44px;
}

.inventory-table-empty strong {
  color: var(--molto-ink);
  font-size: 0.78rem;
}

.inventory-table-empty p {
  color: var(--molto-muted);
  font-size: 0.67rem;
  margin: 0.3rem 0 0.7rem;
}

/* Centro de alertas financieras */
.alerts-page-header {
  align-items: center;
}

.alerts-page-header h1 {
  margin: 0;
}

.alerts-page-header p {
  color: var(--molto-muted);
  margin: 0.4rem 0 0;
}

.page-header-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
}

.page-header-actions .btn {
  align-items: center;
  display: inline-flex;
  gap: 0.45rem;
  justify-content: center;
}

.alerts-summary-grid {
  background: var(--molto-surface);
  border: 1px solid var(--molto-border);
  border-radius: var(--molto-radius);
  box-shadow: var(--molto-shadow-soft);
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 1rem;
  overflow: hidden;
}

.alerts-summary-item {
  align-items: center;
  display: flex;
  gap: 0.85rem;
  min-height: 118px;
  padding: 1.15rem;
  position: relative;
}

.alerts-summary-item + .alerts-summary-item {
  border-left: 1px solid var(--molto-border);
}

.alerts-summary-icon {
  align-items: center;
  background: var(--molto-bg-soft);
  border-radius: 9px;
  color: var(--molto-ink);
  display: inline-flex;
  flex: 0 0 auto;
  font-size: 1.05rem;
  height: 42px;
  justify-content: center;
  width: 42px;
}

.alerts-summary-icon.es-total {
  background: var(--molto-brand-soft);
  color: var(--molto-brand);
}

.alerts-summary-icon.es-danger {
  background: var(--molto-danger-soft);
  color: var(--molto-danger);
}

.alerts-summary-icon.es-warning {
  background: var(--molto-warning-soft);
  color: var(--molto-warning);
}

.alerts-summary-icon.es-info {
  background: var(--molto-info-soft);
  color: #2472a4;
}

.alerts-summary-item > div {
  min-width: 0;
}

.alerts-summary-item > div > span,
.alerts-summary-item small {
  color: var(--molto-muted);
  display: block;
  font-size: 0.67rem;
}

.alerts-summary-item strong {
  color: var(--molto-ink);
  display: block;
  font-size: 1.55rem;
  font-variant-numeric: tabular-nums;
  font-weight: 760;
  line-height: 1.15;
  margin: 0.15rem 0;
}

.alerts-live-card,
.alerts-history-card {
  border: 1px solid var(--molto-border);
  box-shadow: var(--molto-shadow-soft);
  margin-bottom: 1rem;
  overflow: hidden;
}

.alerts-section-heading {
  align-items: center;
  border-bottom: 1px solid var(--molto-border);
  display: flex;
  gap: 1rem;
  justify-content: space-between;
  padding: 1.2rem 1.25rem;
}

.alerts-section-heading h2 {
  font-size: 1rem;
  font-weight: 730;
  margin: 0;
}

.alerts-section-heading p {
  color: var(--molto-muted);
  font-size: 0.73rem;
  margin: 0.3rem 0 0;
}

.alerts-section-heading .dashboard-eyebrow {
  font-size: 0.61rem;
  margin-bottom: 0.25rem;
}

.alerts-section-heading > .status-pill {
  flex: 0 0 auto;
}

.alerts-section-heading > .status-pill > span {
  background: currentColor;
  border-radius: 50%;
  height: 5px;
  width: 5px;
}

.financial-alert-list {
  padding: 0 1.25rem;
}

.financial-alert-card {
  align-items: center;
  border-bottom: 1px solid var(--molto-border);
  display: grid;
  gap: 0.9rem;
  grid-template-columns: auto minmax(0, 1fr) auto;
  padding: 1.05rem 0;
}

.financial-alert-card:last-child {
  border-bottom: 0;
}

.financial-alert-icon {
  align-items: center;
  background: var(--molto-info-soft);
  border-radius: 9px;
  color: #2472a4;
  display: inline-flex;
  font-size: 0.95rem;
  height: 40px;
  justify-content: center;
  width: 40px;
}

.financial-alert-card.es-danger .financial-alert-icon {
  background: var(--molto-danger-soft);
  color: var(--molto-danger);
}

.financial-alert-card.es-warning .financial-alert-icon {
  background: var(--molto-warning-soft);
  color: var(--molto-warning);
}

.financial-alert-content {
  min-width: 0;
}

.financial-alert-content > div {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.financial-alert-content strong {
  color: var(--molto-ink);
  font-size: 0.78rem;
  font-weight: 710;
}

.financial-alert-content p {
  color: var(--molto-muted);
  font-size: 0.72rem;
  line-height: 1.55;
  margin: 0.3rem 0 0;
}

.financial-alert-content .status-pill {
  font-size: 0.58rem;
  margin: 0;
}

.financial-alert-action {
  align-items: center;
  color: var(--molto-brand);
  display: inline-flex;
  font-size: 0.69rem;
  font-weight: 690;
  gap: 0.35rem;
  text-decoration: none;
  white-space: nowrap;
}

.financial-alert-action:hover {
  color: var(--molto-brand-dark);
}

.financial-alert-action i {
  transition: transform 0.16s ease;
}

.financial-alert-action:hover i {
  transform: translateX(2px);
}

.alerts-empty-state {
  align-items: center;
  display: flex;
  gap: 0.85rem;
  min-height: 112px;
}

.alerts-empty-state > span {
  align-items: center;
  background: var(--molto-success-soft);
  border-radius: 50%;
  color: var(--molto-success);
  display: inline-flex;
  flex: 0 0 auto;
  font-size: 1.1rem;
  height: 44px;
  justify-content: center;
  width: 44px;
}

.alerts-empty-state strong {
  color: var(--molto-ink);
  display: block;
  font-size: 0.8rem;
}

.alerts-empty-state p {
  color: var(--molto-muted);
  font-size: 0.72rem;
  margin: 0.25rem 0 0;
}

.alerts-history-count {
  background: var(--molto-bg-soft);
  border: 1px solid var(--molto-border);
  border-radius: 5px;
  color: var(--molto-muted);
  flex: 0 0 auto;
  font-size: 0.64rem;
  font-weight: 650;
  padding: 0.35rem 0.5rem;
}

.alerts-history-table {
  margin: 0;
  min-width: 760px;
}

.alerts-history-table th {
  background: #fafbfc;
}

.alerts-history-table td {
  vertical-align: middle;
}

.alert-history-date strong,
.alert-history-date span {
  display: block;
  white-space: nowrap;
}

.alert-history-date strong {
  color: var(--molto-ink);
  font-size: 0.74rem;
  font-weight: 690;
  text-transform: capitalize;
}

.alert-history-date span {
  color: var(--molto-muted);
  font-size: 0.62rem;
  margin-top: 0.18rem;
}

.alert-history-type {
  align-items: center;
  display: flex;
  gap: 0.55rem;
  min-width: 165px;
}

.alert-history-type > span {
  align-items: center;
  background: var(--molto-info-soft);
  border-radius: 6px;
  color: #2472a4;
  display: inline-flex;
  flex: 0 0 auto;
  height: 28px;
  justify-content: center;
  width: 28px;
}

.alert-history-type > span.es-danger {
  background: var(--molto-danger-soft);
  color: var(--molto-danger);
}

.alert-history-type > span.es-warning {
  background: var(--molto-warning-soft);
  color: var(--molto-warning);
}

.alert-history-type strong {
  color: var(--molto-ink);
  font-size: 0.7rem;
  font-weight: 660;
}

.alert-history-message {
  color: var(--molto-muted) !important;
  font-size: 0.69rem;
  line-height: 1.5;
}

.alerts-table-empty {
  align-items: center;
  color: var(--molto-muted);
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  justify-content: center;
  min-height: 150px;
  text-align: center;
}

.alerts-table-empty i {
  color: var(--molto-border-strong);
  font-size: 1.45rem;
}

.alerts-table-empty strong {
  color: var(--molto-ink);
  font-size: 0.76rem;
}

.alerts-table-empty span {
  font-size: 0.67rem;
}

@media (min-width: 992px) {
  :root {
    --molto-sidebar-w: 264px;
    --molto-sidebar-compact-w: 76px;
  }
}

@media (max-width: 1199.98px) {
  .catalog-summary-grid,
  .catalog-summary-grid.es-three,
  .quality-summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .catalog-summary-grid > article:nth-child(3),
  .quality-summary-grid > article:nth-child(3) {
    border-left: 0;
  }

  .catalog-summary-grid > article:nth-child(n + 3),
  .quality-summary-grid > article:nth-child(n + 3) {
    border-top: 1px solid var(--molto-border);
  }

  .inventory-summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .inventory-summary-item:nth-child(3) {
    border-left: 0;
  }

  .inventory-summary-item:nth-child(n + 3) {
    border-top: 1px solid var(--molto-border);
  }

  .alerts-summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .alerts-summary-item:nth-child(3) {
    border-left: 0;
  }

  .alerts-summary-item:nth-child(n + 3) {
    border-top: 1px solid var(--molto-border);
  }

  .movement-summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .movement-summary-item:nth-child(3)::before {
    display: none;
  }

  .movement-summary-item:nth-child(n + 3) {
    border-top: 1px solid var(--molto-border);
  }

  .movement-filters {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .movement-filter-actions {
    justify-content: flex-end;
  }

  .payment-summary-grid,
  .project-summary-grid,
  .receivables-buckets {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .payment-summary-item:nth-child(3)::before,
  .project-summary-item:nth-child(3)::before {
    display: none;
  }

  .payment-summary-item:nth-child(n + 3),
  .project-summary-item:nth-child(n + 3),
  .receivable-bucket:nth-child(n + 3) {
    border-top: 1px solid var(--molto-border);
  }

  .receivable-bucket:nth-child(3) {
    border-left: 0;
  }

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

  .project-detail-kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .project-detail-kpis article:nth-child(3)::before {
    display: none;
  }

  .project-detail-kpis article:nth-child(n + 3) {
    border-top: 1px solid var(--molto-border);
  }

  .reconciliation-summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .reconciliation-summary-grid > div:nth-child(3)::before {
    display: none;
  }

  .reconciliation-summary-grid > div:nth-child(n + 3) {
    border-top: 1px solid var(--molto-border);
  }
}

@media (max-width: 991.98px) {
  .molto-workbar {
    display: none;
  }

  .molto-topbar {
    background: rgb(255 255 255 / 0.96);
  }

  main.molto-main {
    padding: 1.35rem 1rem 3rem;
  }

  .movement-page-header {
    align-items: stretch;
  }

  .movement-header-actions {
    justify-content: flex-start;
  }

  .payment-calendar-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 0.75rem;
  }

  .form-action-bar {
    align-items: flex-start;
    flex-direction: column;
    gap: 0.9rem;
  }

  .form-action-bar > div {
    justify-content: flex-end;
    width: 100%;
  }

  .project-detail-hero {
    align-items: flex-start;
    flex-direction: column;
    gap: 1rem;
  }

  .project-detail-actions {
    justify-content: flex-start;
  }

  .project-detail-overview {
    grid-template-columns: 1fr;
  }

  .reconciliation-balance-grid {
    grid-template-columns: 1fr;
  }

  .reconciliation-operator {
    display: none;
  }

  .reconciliation-progress-card {
    grid-template-columns: minmax(180px, auto) 1fr auto;
  }

  .reconciliation-action-bar,
  .invoice-action-bar {
    align-items: flex-start;
    flex-direction: column;
    gap: 0.8rem;
  }

  .reconciliation-action-bar > div:last-child,
  .invoice-action-bar > div:last-child {
    justify-content: flex-end;
    width: 100%;
  }

  .financial-alert-card {
    align-items: start;
  }

  .inventory-stock-alert {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .inventory-stock-alert .btn {
    margin-left: 44px;
  }

  .sat-search-grid {
    grid-template-columns: 1fr 1.4fr auto;
  }

  .sat-search-grid .btn-link {
    grid-column: 1 / -1;
    justify-self: start;
  }

  .document-filterbar, .security-filterbar { grid-template-columns: 1fr 1fr; }
  .document-filter-actions, .security-filterbar > div:last-child { grid-column: 1 / -1; }
}

@media (max-width: 575.98px) {
  .page-header {
    align-items: stretch;
    flex-direction: column;
  }

  .page-header-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    width: 100%;
  }

  .catalog-page-header > .btn,
  .catalog-page-header > form,
  .catalog-page-header > form .btn {
    width: 100%;
  }

  .invoice-link-notice {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .invoice-link-notice > a {
    margin-left: 41px;
  }

  .catalog-page-header > .btn,
  .catalog-page-header > form .btn {
    justify-content: center;
  }

  .catalog-summary-grid,
  .catalog-summary-grid.es-three,
  .quality-summary-grid {
    grid-template-columns: 1fr;
  }

  .catalog-summary-grid > article + article,
  .quality-summary-grid > article + article {
    border-left: 0;
    border-top: 1px solid var(--molto-border);
  }

  .catalog-table-heading,
  .quality-finding-heading {
    align-items: flex-start;
  }

  .sat-search-grid {
    grid-template-columns: 1fr;
  }

  .sat-search-grid .btn-link {
    grid-column: auto;
  }

  .catalog-form-actions {
    display: grid;
    grid-template-columns: 0.8fr 1.2fr;
  }

  .close-checklist { grid-template-columns: 1fr; }
  .close-checklist > a:nth-child(odd) { border-right: 0; }
  .close-checklist > a + a { border-top: 1px solid var(--molto-border); }
  .close-action-card form { align-items: stretch; flex-direction: column; }
  .close-action-card form .btn { justify-content: center; width: 100%; }
  .document-filterbar, .security-filterbar { grid-template-columns: 1fr; }
  .document-filter-actions, .security-filterbar > div:last-child { grid-column: auto; }

  .alerts-summary-grid {
    grid-template-columns: 1fr;
  }

  .inventory-summary-grid {
    grid-template-columns: 1fr;
  }

  .inventory-summary-item + .inventory-summary-item {
    border-left: 0;
  }

  .inventory-summary-item:nth-child(n + 2) {
    border-top: 1px solid var(--molto-border);
  }

  .inventory-section-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .inventory-section-heading > .btn,
  .inventory-section-actions {
    justify-content: center;
    width: 100%;
  }

  .inventory-section-actions {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
  }

  .inventory-section-actions .btn {
    justify-content: center;
  }

  .inventory-stock-alert .btn {
    margin-left: 0;
    width: 100%;
  }

  .alerts-summary-item + .alerts-summary-item {
    border-left: 0;
  }

  .alerts-summary-item:nth-child(n + 2) {
    border-top: 1px solid var(--molto-border);
  }

  .alerts-section-heading {
    align-items: flex-start;
  }

  .financial-alert-card {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .financial-alert-action {
    grid-column: 2;
  }

  .dash-quick-actions {
    display: grid !important;
    grid-template-columns: 1fr 1fr;
    width: 100%;
  }

  .dash-quick-actions .btn {
    justify-content: center;
  }

  .stat-grid {
    grid-template-columns: 1fr;
  }

  .movement-header-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    width: 100%;
  }

  .movement-header-actions .btn {
    justify-content: center;
  }

  .movement-summary-grid {
    grid-template-columns: 1fr;
  }

  .movement-summary-item + .movement-summary-item::before {
    display: none;
  }

  .movement-summary-item:nth-child(n + 2) {
    border-top: 1px solid var(--molto-border);
  }

  .movement-filters {
    grid-template-columns: 1fr;
  }

  .movement-filter-actions {
    display: grid;
    grid-template-columns: 0.75fr 1.25fr;
  }

  .movement-filter-actions .btn {
    justify-content: center;
  }

  .movement-table-heading {
    align-items: flex-start;
    gap: 0.75rem;
  }

  .payment-summary-grid,
  .project-summary-grid,
  .receivables-buckets {
    grid-template-columns: 1fr;
  }

  .payment-summary-item + .payment-summary-item::before,
  .project-summary-item + .project-summary-item::before {
    display: none;
  }

  .payment-summary-item:nth-child(n + 2),
  .project-summary-item:nth-child(n + 2),
  .receivable-bucket + .receivable-bucket {
    border-left: 0;
    border-top: 1px solid var(--molto-border);
  }

  .payment-list-heading,
  .entity-table-heading {
    align-items: flex-start;
    gap: 0.75rem;
  }

  .document-movement-context,
  .movement-edit-context {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .document-context-amount,
  .movement-edit-amount {
    flex-basis: 100%;
    margin-left: 53px;
  }

  .form-action-bar > div {
    display: grid !important;
    grid-template-columns: 1fr 1.35fr;
  }

  .account-grid {
    grid-template-columns: 1fr;
  }

  .accounts-total-card,
  .receivables-total {
    min-height: 135px;
    padding: 1.25rem;
  }

  .accounts-total-icon,
  .receivables-total-icon {
    font-size: 1.5rem;
    height: 58px;
    width: 58px;
  }

  .project-detail-title {
    align-items: flex-start;
  }

  .project-detail-statuses {
    margin-left: 0;
  }

  .project-detail-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    width: 100%;
  }

  .project-detail-actions .btn {
    justify-content: center;
  }

  .project-detail-kpis,
  .project-fiscal-strip {
    grid-template-columns: 1fr;
  }

  .project-detail-kpis article + article::before,
  .project-fiscal-strip > div + div::before {
    display: none;
  }

  .project-detail-kpis article:nth-child(n + 2),
  .project-fiscal-strip > div + div {
    border-top: 1px solid var(--molto-border);
  }

  .project-section-heading {
    align-items: flex-start;
    gap: 0.7rem;
  }

  .reconciliation-summary-grid {
    grid-template-columns: 1fr;
  }

  .reconciliation-summary-grid > div + div::before {
    display: none;
  }

  .reconciliation-summary-grid > div:nth-child(n + 2) {
    border-top: 1px solid var(--molto-border);
  }

  .reconciliation-detail-header {
    align-items: flex-start;
    flex-direction: column;
    gap: 0.9rem;
  }

  .reconciliation-progress-card {
    grid-template-columns: 1fr auto;
  }

  .reconciliation-progress-track {
    grid-column: 1 / -1;
    grid-row: 2;
  }

  .reconciliation-action-bar > div:last-child,
  .invoice-action-bar > div:last-child {
    display: grid;
    grid-template-columns: 1fr 1.25fr;
  }

  .reconciliation-action-bar .btn,
  .invoice-action-bar .btn {
    justify-content: center;
  }

  .invoice-review-heading,
  .invoice-section-heading {
    align-items: flex-start;
  }

  .invoice-review-meta,
  .invoice-form-grid {
    grid-template-columns: 1fr;
  }

  .rep-form .invoice-form-grid {
    grid-template-columns: 1fr;
  }

  .molto-filterbar {
    align-items: stretch;
  }

  .molto-filterbar::before {
    align-self: center;
  }
}

/* Expediente mensual */
.monthly-file-page {
  --archive-navy: #172033;
  --archive-muted: #708096;
}

.monthly-file-hero {
  align-items: center;
  background:
    radial-gradient(circle at 78% 22%, rgba(80, 126, 181, 0.09), transparent 22%),
    linear-gradient(120deg, #fff 0%, #fbfdff 65%, #f5f9fd 100%);
  border: 1px solid #dfe6ee;
  border-radius: 20px;
  box-shadow: 0 12px 36px rgba(23, 32, 51, 0.055);
  display: grid;
  gap: 2rem;
  grid-template-columns: minmax(0, 1fr) 350px;
  margin-bottom: 1rem;
  min-height: 228px;
  overflow: hidden;
  padding: 2rem 2.1rem;
  position: relative;
}

.monthly-file-hero::after {
  border: 1px solid rgba(70, 111, 158, 0.08);
  border-radius: 50%;
  content: "";
  height: 250px;
  position: absolute;
  right: -105px;
  top: -125px;
  width: 250px;
}

.monthly-file-hero-copy {
  max-width: 670px;
  position: relative;
  z-index: 1;
}

.monthly-file-hero h1 {
  color: var(--archive-navy);
  font-size: clamp(1.7rem, 3vw, 2.35rem);
  letter-spacing: -0.035em;
  line-height: 1.08;
  margin: 0.35rem 0 0.65rem;
}

.monthly-file-hero-copy > p {
  color: #64758a;
  font-size: 0.9rem;
  line-height: 1.65;
  margin: 0;
  max-width: 610px;
}

.monthly-file-hero-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin-top: 1rem;
}

.monthly-file-hero-tags span {
  align-items: center;
  background: #f4f7fa;
  border: 1px solid #e4eaf0;
  border-radius: 999px;
  color: #506176;
  display: inline-flex;
  font-size: 0.69rem;
  font-weight: 650;
  gap: 0.35rem;
  padding: 0.36rem 0.62rem;
}

.monthly-file-hero-tags i { color: #3474c5; }

.monthly-file-hero-control {
  align-items: center;
  background: rgba(255, 255, 255, 0.86);
  border: 1px solid #e1e8ef;
  border-radius: 16px;
  box-shadow: 0 10px 28px rgba(29, 54, 80, 0.07);
  display: flex;
  flex-direction: column;
  padding: 1rem;
  position: relative;
  z-index: 1;
}

.monthly-archive-mark {
  height: 58px;
  margin-bottom: 0.6rem;
  position: relative;
  width: 82px;
}

.monthly-archive-sheet,
.monthly-archive-folder {
  align-items: center;
  display: flex;
  justify-content: center;
  position: absolute;
}

.monthly-archive-sheet {
  background: #fff;
  border: 1px solid #dbe3ec;
  border-radius: 7px;
  color: #5e7894;
  font-size: 1.35rem;
  height: 43px;
  left: 13px;
  top: 0;
  transform: rotate(-6deg);
  width: 35px;
}

.monthly-archive-folder {
  color: #e9ad3e;
  font-size: 3.55rem;
  height: 52px;
  right: 3px;
  top: 8px;
  width: 58px;
}

.monthly-archive-zip {
  background: #203b56;
  border: 2px solid #fff;
  border-radius: 6px;
  bottom: -2px;
  color: #fff;
  font-size: 0.55rem;
  font-weight: 850;
  letter-spacing: 0.08em;
  padding: 0.2rem 0.3rem;
  position: absolute;
  right: 0;
}

.monthly-file-period-label {
  margin-bottom: 0.65rem;
  text-align: center;
}

.monthly-file-period-label span,
.monthly-file-period-label strong {
  display: block;
}

.monthly-file-period-label span {
  color: #8491a2;
  font-size: 0.63rem;
  font-weight: 750;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.monthly-file-period-label strong {
  color: #233248;
  font-size: 0.93rem;
  margin-top: 0.12rem;
}

.monthly-file-period {
  align-items: flex-end;
  display: flex;
  gap: 0.45rem;
}

.monthly-file-period form {
  min-width: 185px;
}

.monthly-file-period .form-control,
.monthly-file-period .btn {
  min-height: 39px;
}

.monthly-file-summary {
  display: grid;
  gap: 0.75rem;
  grid-template-columns: repeat(4, 1fr);
  margin-bottom: 1rem;
}

.monthly-file-summary article {
  align-items: center;
  background: #fff;
  border: 1px solid var(--molto-border);
  border-radius: 14px;
  box-shadow: 0 7px 22px rgba(15, 23, 42, 0.03);
  display: flex;
  gap: 0.85rem;
  min-height: 86px;
  padding: 1rem 1.25rem;
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.monthly-file-summary article:hover { border-color: #cbd7e3; box-shadow: 0 11px 28px rgba(15, 23, 42, 0.06); transform: translateY(-2px); }

.monthly-file-summary-icon {
  align-items: center;
  border-radius: 12px;
  display: inline-flex;
  flex: 0 0 42px;
  font-size: 1.05rem;
  height: 42px;
  justify-content: center;
}

.monthly-file-summary-icon.icon-blue { background: #eef5ff; color: #3474c5; }
.monthly-file-summary-icon.icon-teal { background: #eaf8f5; color: #16806f; }
.monthly-file-summary-icon.icon-violet { background: #f3f0ff; color: #7357b3; }
.monthly-file-summary-icon.icon-amber { background: #fff6e8; color: #b56c13; }

.monthly-file-summary strong,
.monthly-file-summary span {
  display: block;
}

.monthly-file-summary strong {
  color: var(--archive-navy);
  font-size: 1.35rem;
  line-height: 1.15;
}

.monthly-file-summary article div > span {
  color: var(--archive-muted);
  font-size: 0.78rem;
  margin-top: 0.17rem;
}

.monthly-file-layout {
  align-items: stretch;
  display: grid;
  gap: 1rem;
  grid-template-columns: minmax(0, 1fr) 330px;
}

.monthly-file-tree-card {
  border-radius: 18px;
  overflow: hidden;
}

.monthly-file-card-heading {
  align-items: center;
  border-bottom: 1px solid var(--molto-border);
  display: flex;
  justify-content: space-between;
  padding: 1.25rem 1.35rem;
}

.monthly-file-card-heading h2,
.monthly-download-card h2 {
  color: var(--archive-navy);
  font-size: 1.08rem;
  margin: 0.14rem 0 0;
}

.monthly-file-card-heading p {
  color: #8793a3;
  font-size: 0.7rem;
  margin: 0.28rem 0 0;
}

.monthly-file-root-meta {
  text-align: right;
}

.monthly-file-root-meta > span {
  color: #8a96a6;
  display: block;
  font-size: 0.65rem;
  margin-bottom: 0.25rem;
}

.monthly-file-root-meta > strong {
  background: #fff8e9;
  border: 1px solid #f2e2b8;
  border-radius: 999px;
  color: #8d681f;
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.42rem 0.72rem;
}

.monthly-file-root-meta i,
.monthly-folder-icon {
  color: #e8aa34;
}

.monthly-folder-tree {
  padding: 0 1.35rem;
}

.monthly-folder-item {
  border: 0;
}

.monthly-folder-item + .monthly-folder-item {
  border-top: 1px solid #edf0f4;
}

.monthly-folder-item > summary {
  list-style: none;
}

.monthly-folder-item > summary::-webkit-details-marker {
  display: none;
}

.monthly-folder-row {
  align-items: center;
  display: grid;
  gap: 0.8rem;
  cursor: pointer;
  grid-template-columns: 28px 38px minmax(0, 1fr) auto 20px;
  min-height: 82px;
  padding: 0.7rem 0.55rem;
  transition: background-color 150ms ease, transform 150ms ease;
}

.monthly-folder-row:hover { background: #fafbfd; border-radius: 11px; transform: translateX(2px); }

.monthly-folder-item[open] > .monthly-folder-row {
  background: #f8fafc;
  border-radius: 11px 11px 0 0;
}

.monthly-folder-item[open] .monthly-folder-icon {
  background: #fff1d3;
  color: #d99521;
}

.monthly-folder-number {
  color: #a4afbd;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.monthly-folder-icon {
  align-items: center;
  background: #fff8e9;
  border-radius: 10px;
  display: inline-flex;
  font-size: 1.12rem;
  height: 38px;
  justify-content: center;
  width: 38px;
}

.monthly-folder-row strong,
.monthly-folder-row div > span {
  display: block;
}

.monthly-folder-row strong {
  color: #28354a;
  font-size: 0.88rem;
  margin-bottom: 0.15rem;
}

.monthly-folder-row div > span {
  color: var(--archive-muted);
  font-size: 0.76rem;
  line-height: 1.45;
}

.monthly-file-type {
  background: #edf8f2;
  border-radius: 7px;
  color: #287b55;
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.035em;
  padding: 0.38rem 0.55rem;
  white-space: nowrap;
}

.monthly-file-type-mixed { background: #eef5ff; color: #376fae; }
.monthly-file-type-neutral { background: #f1f3f6; color: #687588; }

.monthly-folder-chevron {
  color: #a6b1be;
  font-size: 0.72rem;
  transition: transform 180ms ease, color 180ms ease;
}

.monthly-folder-item[open] .monthly-folder-chevron {
  color: #52687f;
  transform: rotate(180deg);
}

.monthly-folder-preview {
  background: #fbfcfe;
  border-left: 2px solid #dfe8f1;
  margin: 0 0 0.8rem 47px;
  padding: 0.35rem 0.75rem 0.45rem;
}

.monthly-folder-preview-scroll {
  max-height: 260px;
  overflow-y: auto;
  scrollbar-color: #cbd5df transparent;
  scrollbar-width: thin;
}

.monthly-preview-file {
  align-items: center;
  display: grid;
  gap: 0.65rem;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  min-height: 56px;
  padding: 0.4rem 0.25rem;
}

.monthly-preview-file + .monthly-preview-file {
  border-top: 1px dashed #e0e6ec;
}

.monthly-preview-file-icon {
  align-items: center;
  border-radius: 8px;
  display: inline-flex;
  font-size: 0.95rem;
  height: 34px;
  justify-content: center;
  width: 34px;
}

.monthly-preview-file-icon.excel { background: #eaf7f0; color: #247850; }
.monthly-preview-file-icon.xml { background: #edf4fd; color: #3d73ad; }
.monthly-preview-file-icon.attachment { background: #f2f3f6; color: #68778a; }

.monthly-preview-file div > strong,
.monthly-preview-file div > span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.monthly-preview-file div > strong {
  color: #304056;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.7rem;
  font-weight: 650;
}

.monthly-preview-file div > span {
  color: #8491a1;
  font-size: 0.66rem;
  margin-top: 0.15rem;
}

.monthly-preview-status {
  background: #eef2f6;
  border-radius: 999px;
  color: #677588;
  font-size: 0.57rem;
  font-weight: 800;
  letter-spacing: 0.045em;
  padding: 0.28rem 0.45rem;
  text-transform: uppercase;
}

.monthly-preview-empty {
  align-items: center;
  color: #8b98a8;
  display: flex;
  font-size: 0.7rem;
  gap: 0.5rem;
  min-height: 50px;
  padding: 0.5rem;
}

.monthly-file-note {
  align-items: flex-start;
  background: #f6f9fc;
  border-radius: 11px;
  color: #49708b;
  display: flex;
  gap: 0.65rem;
  margin: 0.45rem 1.35rem 1.25rem;
  padding: 0.8rem 0.9rem;
}

.monthly-file-note strong,
.monthly-file-note span {
  display: block;
  font-size: 0.75rem;
}

.monthly-file-note span { color: #718697; margin-top: 0.12rem; }

.monthly-download-card {
  background: linear-gradient(155deg, #17263d 0%, #1b334b 100%);
  border-radius: 18px;
  box-shadow: 0 14px 35px rgba(23, 38, 61, 0.14);
  color: #fff;
  display: flex;
  flex-direction: column;
  padding: 1.45rem;
  position: sticky;
  top: 84px;
}

.monthly-download-card .dashboard-eyebrow { color: #9eb6ca; }
.monthly-download-card h2 { color: #fff; font-size: 1.35rem; }
.monthly-download-card > p { color: #b9c8d5; font-size: 0.82rem; line-height: 1.6; margin: 0.55rem 0 1.1rem; }

.monthly-download-includes {
  display: grid;
  gap: 0.46rem;
  margin-bottom: 1rem;
}

.monthly-download-includes span {
  align-items: center;
  color: #c5d2dd;
  display: flex;
  font-size: 0.73rem;
  gap: 0.45rem;
}

.monthly-download-includes i {
  align-items: center;
  background: rgba(99, 210, 167, 0.13);
  border-radius: 50%;
  color: #82d9b8;
  display: inline-flex;
  height: 19px;
  justify-content: center;
  width: 19px;
}

.monthly-download-includes strong { color: #fff; }

.monthly-download-icon {
  align-items: center;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 14px;
  display: inline-flex;
  font-size: 1.45rem;
  height: 52px;
  justify-content: center;
  margin-bottom: 1rem;
  width: 52px;
}

.monthly-download-totals {
  border-bottom: 1px solid rgba(255, 255, 255, 0.11);
  border-top: 1px solid rgba(255, 255, 255, 0.11);
  margin-bottom: 1rem;
  padding: 0.6rem 0;
}

.monthly-download-totals div {
  align-items: center;
  display: flex;
  justify-content: space-between;
  padding: 0.38rem 0;
}

.monthly-download-totals span { color: #9fb3c4; font-size: 0.75rem; }
.monthly-download-totals strong { color: #fff; font-size: 0.86rem; }

.monthly-file-warning,
.monthly-file-ready {
  align-items: flex-start;
  border-radius: 10px;
  display: flex;
  font-size: 0.72rem;
  gap: 0.5rem;
  line-height: 1.45;
  margin-bottom: 1rem;
  padding: 0.72rem;
}

.monthly-file-warning { background: rgba(230, 165, 61, 0.14); color: #f0cb8b; }
.monthly-file-ready { background: rgba(70, 195, 149, 0.13); color: #9de1c7; }

.monthly-download-button {
  align-items: center;
  display: flex;
  font-weight: 750;
  gap: 0.5rem;
  justify-content: center;
  margin-top: auto;
  min-height: 46px;
  width: 100%;
}

.monthly-download-card > small {
  color: #93a8ba;
  display: block;
  font-size: 0.66rem;
  margin-top: 0.75rem;
  text-align: center;
}

@media (max-width: 991.98px) {
  .monthly-file-hero { grid-template-columns: 1fr 300px; }
  .monthly-file-layout { grid-template-columns: 1fr; }
  .monthly-download-card { min-height: 470px; position: static; }
}

@media (max-width: 767.98px) {
  .monthly-file-hero { gap: 1.25rem; grid-template-columns: 1fr; padding: 1.4rem; }
  .monthly-file-hero-control { width: 100%; }
  .monthly-file-period { width: 100%; }
  .monthly-file-period form { flex: 1; }
  .monthly-file-summary { grid-template-columns: 1fr 1fr; }
  .monthly-folder-row { grid-template-columns: 24px 34px minmax(0, 1fr) 18px; }
  .monthly-file-type { grid-column: 3; justify-self: start; }
  .monthly-folder-chevron { grid-column: 4; grid-row: 1 / span 2; }
  .monthly-folder-preview { margin-left: 0; }
  .monthly-file-card-heading { align-items: flex-start; flex-direction: column; gap: 0.7rem; }
  .monthly-file-root-meta { text-align: left; }
}

@media (max-width: 479.98px) {
  .monthly-file-summary { grid-template-columns: 1fr; }
  .monthly-file-hero-tags { align-items: flex-start; flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}
