:root {
  --ui-primary: #163a5f;
  --ui-primary-strong: #0f2c49;
  --ui-primary-soft: #eaf0f7;
  --ui-secondary: #5f7a98;
  --ui-bg: #f4f6fa;
  --ui-surface: #ffffff;
  --ui-border: #d9e1ea;
  --ui-text: #243447;
  --ui-muted: #68788a;
  --ui-success: #1f7a5f;
  --ui-danger: #b74b4b;
  --ui-warning: #c4911f;
  --ui-info: #3273a8;
  --ui-radius-sm: 0.45rem;
  --ui-radius: 0.75rem;
  --ui-shadow: 0 8px 24px rgba(17, 29, 45, 0.06);
}

* { box-sizing: border-box; }

body {
  font-size: 0.9rem;
  color: var(--ui-text);
  background: var(--ui-bg);
  font-family: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 268px 1fr;
}

.sidebar {
  background: var(--ui-primary-strong);
  color: #d9e6f5;
  padding: 1.1rem;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.35rem 0.4rem 1rem;
  margin-bottom: 0.4rem;
  border-bottom: 1px solid rgba(238, 247, 255, 0.14);
}

.sidebar-logo {
  width: 34px;
  height: 34px;
  border-radius: 0.65rem;
  background: rgba(143, 185, 233, 0.18);
  color: #f8fbff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
}

.sidebar-group {
  margin-bottom: 0.6rem;
}

.sidebar-nav {
  gap: 0.2rem;
}

.sidebar-nav .nav-link {
  color: rgba(235, 243, 255, 0.84);
  border-radius: 0.72rem;
  padding: 0.56rem 0.68rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.835rem;
  border: 1px solid transparent;
  transition: all 0.16s ease;
}

.sidebar-nav .nav-link i {
  width: 1rem;
  text-align: center;
  color: rgba(213, 229, 247, 0.9);
}

.sidebar-nav .nav-link:hover,
.sidebar-nav .nav-link:focus {
  color: #ffffff;
  background: rgba(109, 156, 210, 0.2);
  border-color: rgba(153, 188, 225, 0.26);
}

.sidebar-nav .nav-link.is-active {
  color: #ffffff;
  background: linear-gradient(90deg, rgba(101, 151, 206, 0.5) 0%, rgba(83, 133, 189, 0.35) 100%);
  border-color: rgba(172, 203, 236, 0.48);
  font-weight: 600;
  box-shadow: 0 6px 14px rgba(8, 24, 42, 0.2);
}


.sidebar-label {
  color: rgba(198, 220, 245, 0.68);
  font-size: 0.67rem;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  margin: 0.95rem 0 0.45rem 0.48rem;
  font-weight: 700;
}

.main-content {
  padding: 1rem 1.1rem 2rem;
}

.topbar {
  background: var(--ui-surface);
  border: 1px solid var(--ui-border);
  border-radius: var(--ui-radius);
  box-shadow: var(--ui-shadow);
  padding: 0.6rem 0.9rem;
  margin-bottom: 1rem;
}

.page-header h1 { font-size: 1.14rem; }
.page-header p { color: var(--ui-muted); }

.breadcrumb {
  --bs-breadcrumb-divider-color: #93a1b4;
  --bs-breadcrumb-item-active-color: #6f8096;
}

.card {
  border-radius: var(--ui-radius);
  border: 1px solid var(--ui-border);
  box-shadow: var(--ui-shadow);
  background: var(--ui-surface);
}

.card-header {
  background: #fcfdff;
  border-bottom-color: var(--ui-border);
  padding: 0.62rem 0.85rem;
}

.card-title {
  font-size: 0.88rem;
  letter-spacing: 0.02em;
}

.form-control,
.form-select {
  border-radius: var(--ui-radius-sm);
  border-color: #cfd8e3;
  min-height: 34px;
  font-size: 0.84rem;
}

.form-label {
  font-size: 0.76rem;
  margin-bottom: 0.28rem;
  color: #4f6074;
  font-weight: 600;
}

.form-control:focus,
.form-select:focus {
  box-shadow: 0 0 0 0.2rem rgba(22, 58, 95, 0.12);
  border-color: #9db4cd;
}

.btn {
  border-radius: 0.58rem;
  font-size: 0.8rem;
  padding: 0.34rem 0.72rem;
  font-weight: 600;
}

.btn-primary {
  background: var(--ui-primary);
  border-color: var(--ui-primary);
}

.btn-primary:hover,
.btn-primary:focus {
  background: #123251;
  border-color: #123251;
}

.btn-outline-secondary { border-color: #c8d3df; color: #3f556d; }
.btn-light { background: #f9fbfe; border-color: #dce6f1; }

.report-filters .filter-search .form-control { min-width: 220px; }
.report-filters .filter-status .form-select { min-width: 130px; }
.report-filters .filter-date .form-control { min-width: 145px; }
.report-filters .filter-periodo .form-select { min-width: 170px; }
.report-filters .filter-socio .form-select { min-width: 290px; }
.report-filters .filter-movimiento .form-select { min-width: 170px; }
.report-filters .filter-monto .form-control { min-width: 120px; }

@media (max-width: 768px) {
  .report-filters .col-sm-auto {
    width: 100%;
  }

  .report-filters .form-control,
  .report-filters .form-select {
    min-width: 0 !important;
    width: 100%;
  }
}

.egreso-flow-hint {
  border: 1px dashed #c8d8ea;
  background: #f7fbff;
  color: #38526c;
  border-radius: 0.55rem;
  padding: 0.55rem 0.7rem;
}

.table {
  --bs-table-striped-bg: #f7f9fc;
  --bs-table-hover-bg: #eef3f9;
  font-size: 0.78rem;
  line-height: 1.35;
}

.table thead th {
  font-size: 0.7rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: #4e6178;
  border-bottom-width: 1px;
  background: #f8fbff;
  font-weight: 500;
}

.table td,
.table th {
  padding: 0.5rem 0.6rem;
  vertical-align: middle;
}

.table td {
  font-weight: 400;
  color: #33485f;
}
.module-table-responsive {
  overflow-x: auto;
  overflow-y: visible;
}

.module-table-responsive .dropdown-menu {
  z-index: 1080;
}

.table-actions-dropdown {
  position: static;
}

.table-actions-dropdown .dropdown-menu {
  min-width: 9.5rem;
  border-radius: 0.6rem;
  border: 1px solid #d6e1ec;
  box-shadow: 0 10px 24px rgba(18, 44, 72, 0.16);
}

.modal-detail-header {
  background: linear-gradient(180deg, #f8fbff 0%, #f2f7fd 100%);
  border-bottom: 1px solid #dbe5f0;
}

.modal-detail-content {
  border-radius: 0.82rem;
  overflow: hidden;
}

.modal-detail-subtitle {
  font-size: 0.74rem;
  color: #6e8199;
}

.modal-detail-body {
  background: #f8fbff;
  padding: 0.7rem;
}

.record-detail-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.record-summary-chip {
  display: inline-flex;
  align-items: baseline;
  gap: 0.35rem;
  border: 1px solid #d6e3ef;
  background: #ffffff;
  border-radius: 999px;
  padding: 0.28rem 0.56rem;
}

.record-summary-chip-label {
  font-size: 0.66rem;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: #6d7f95;
  font-weight: 700;
}

.record-summary-chip-value {
  font-size: 0.74rem;
  color: #243e5c;
  font-weight: 700;
}

.record-detail-item {
  border: 1px solid #dbe5f0;
  border-radius: 0.52rem;
  background: #ffffff;
  padding: 0.45rem 0.58rem;
  min-height: 0;
}

.record-detail-label {
  color: #6a7d94;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  font-size: 0.64rem;
  margin-bottom: 0.12rem;
  font-weight: 700;
}

.record-detail-value {
  font-size: 0.78rem;
  color: #2a405a;
  font-weight: 500;
  line-height: 1.28;
  word-break: break-word;
}


.module-highlight {
  border: 1px solid #d5e1ee;
  border-radius: 0.75rem;
  background: linear-gradient(180deg, #f8fbff 0%, #f2f7fd 100%);
  padding: 0.68rem 0.82rem;
}

.module-highlight-title {
  color: #173a60;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  margin-bottom: 0.15rem;
}

.module-highlight-text {
  color: #4a617a;
  font-size: 0.76rem;
  line-height: 1.35;
}

.kpi-card { position: relative; overflow: hidden; }
.kpi-card .kpi-label { color: var(--ui-muted); font-size: 0.74rem; }
.kpi-card .kpi-value { font-size: 1.24rem; font-weight: 700; }
.kpi-card .kpi-trend { font-size: 0.73rem; color: #74869a; }

.badge-status {
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.68rem;
  letter-spacing: 0.01em;
  padding: 0.28rem 0.56rem;
}

.bg-status-active,.bg-status-pagada,.bg-status-aplicado,.bg-status-conciliado,.bg-status-rendida,.bg-status-cerrada { background: rgba(31, 122, 95, 0.15); color: #1c664f; }
.bg-status-inactive,.bg-status-anulada { background: rgba(183, 75, 75, 0.14); color: #8d3737; }
.bg-status-pendiente,.bg-status-pendiente_revision,.bg-status-sin_conciliar { background: rgba(196, 145, 31, 0.17); color: #896511; }
.bg-status-vencida { background: rgba(183, 75, 75, 0.14); color: #9a3a3a; }
.bg-status-abonada_parcial,.bg-status-info { background: rgba(50, 115, 168, 0.16); color: #2d638f; }

.alert {
  border-radius: var(--ui-radius-sm);
  border: 1px solid transparent;
  font-size: 0.8rem;
}

.alert-success { background: rgba(31, 122, 95, 0.1); border-color: rgba(31, 122, 95, 0.25); color: #225f4d; }
.alert-danger { background: rgba(183, 75, 75, 0.1); border-color: rgba(183, 75, 75, 0.25); color: #843535; }
.alert-warning { background: rgba(196, 145, 31, 0.12); border-color: rgba(196, 145, 31, 0.3); color: #7d5f16; }

.empty-state {
  padding: 2rem 1rem;
  text-align: center;
  color: #73849b;
}

.module-grid-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.75rem;
}

.quick-summary {
  border: 1px solid var(--ui-border);
  border-radius: 0.65rem;
  padding: 0.6rem 0.7rem;
  background: #fcfdff;
}

.quick-summary .label { font-size: 0.71rem; color: #6f8095; }
.quick-summary .value { font-size: 1.02rem; font-weight: 700; color: #23384f; }

@media (max-width: 1199px) {
  .module-grid-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 991px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { position: relative; height: auto; }
  .main-content { padding: 0.8rem; }
}

@media (max-width: 767px) {
  .module-grid-summary { grid-template-columns: 1fr; }
  .topbar form { width: 100%; }
}

.cuotas-layout .card { min-height: 0; }
.cuotas-card-compact .card-body { padding: 0.65rem 0.75rem; }
.cuotas-card-compact .card-header { padding: 0.5rem 0.75rem; }
.cuotas-search-form input { width: 230px; }
.cuotas-socios-scroll { max-height: 62vh; overflow-y: auto; }
.cuotas-otras-scroll { max-height: 180px; overflow-y: auto; }
.cuotas-sticky-panel { position: sticky; top: 0.9rem; }
.cuotas-kv-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.45rem;
}
.cuotas-kv-grid div {
  border: 1px solid var(--ui-border);
  border-radius: 0.45rem;
  padding: 0.4rem 0.5rem;
  background: #fcfdff;
}
.cuotas-kv-grid span {
  display: block;
  color: #688099;
  font-size: 0.69rem;
}
.cuotas-kv-grid strong {
  font-size: 0.78rem;
  line-height: 1.25;
}
@media (max-width: 991px) {
  .cuotas-sticky-panel { position: static; }
  .cuotas-socios-scroll { max-height: 340px; }
  .cuotas-search-form input { width: 100%; }
}


.cuotas-data-list { border: 1px solid var(--ui-border); border-radius: 0.55rem; background: #fcfdff; }
.cuotas-data-list div { display: flex; justify-content: space-between; gap: 0.75rem; padding: 0.38rem 0.55rem; border-bottom: 1px solid #e9eef4; }
.cuotas-data-list div:last-child { border-bottom: 0; }
.cuotas-data-list span { color: #6b8098; font-size: 0.7rem; }
.cuotas-data-list strong { font-size: 0.78rem; text-align: right; }


.landing-body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: #f2f4f7;
}

.landing-page {
  flex: 1 0 auto;
}

.landing-hero {
  background: linear-gradient(180deg, #2f3a46 0%, #242d37 100%);
  color: #eef2f6;
  border-bottom: 1px solid #d7dde4;
}

.landing-hero .lead {
  color: #d6dde6;
  max-width: 720px;
}

.landing-footer {
  background: #1f2730;
  color: #ced6df;
  border-top: 1px solid #394653;
}

.landing-footer a {
  color: #ffffff;
  text-decoration: none;
}

.landing-footer a:hover {
  text-decoration: underline;
}

.cuotas-table-compact td, .cuotas-table-compact th { padding-top: .22rem; padding-bottom: .22rem; font-size: .78rem; }

.pagination .page-link { color: var(--ui-primary); border-color: var(--ui-border); }
.pagination .page-item.active .page-link { background: var(--ui-primary); border-color: var(--ui-primary); color: #fff; }
.pagination .page-link:hover { background: var(--ui-primary-soft); color: var(--ui-primary-strong); }
