/* ============================================================
   CondoMax · capa de marca y refinamientos sobre WowDash
   Carga DESPUÉS de style.css
   ============================================================ */

/* ---------- 1. Paleta de marca (violeta CondoMax) ---------- */
:root {
  --primary-50:  #F1EFFD;
  --primary-100: #E2DEFB;
  --primary-200: #C5BDF7;
  --primary-300: #A79CF2;
  --primary-400: #8A7BEC;
  --primary-500: #6C5CE7;
  --primary-600: #5B4BD6;
  --primary-700: #4A3CBE;
  --primary-800: #3B2F9E;
  --primary-900: #2D2479;
  --brand: var(--primary-600);

  /* Fallbacks de info (parcial) por si el tema no los define */
  --info-main: #2E7DFF;
  --info-focus: rgba(46, 125, 255, 0.13);
}

/* Botones en violeta de marca (el tema base los trae en azul fijo) */
.btn-primary {
  background-color: var(--primary-600) !important;
  border-color: var(--primary-600) !important;
  color: #fff !important;
}
.btn-primary:hover, .btn-primary:focus, .btn-primary:active {
  background-color: var(--primary-700) !important;
  border-color: var(--primary-700) !important;
}
.btn-outline-primary {
  color: var(--primary-600) !important;
  border-color: var(--primary-600) !important;
  background-color: transparent;
}
.btn-outline-primary:hover, .btn-outline-primary:focus, .btn-outline-primary:active {
  background-color: var(--primary-600) !important;
  border-color: var(--primary-600) !important;
  color: #fff !important;
}
.btn-primary:focus-visible, .btn-outline-primary:focus-visible {
  box-shadow: 0 0 0 3px var(--primary-100) !important;
}

/* Densidad de tablas: más columnas visibles sin scroll */
.table.bordered-table > :not(caption) > * > * { padding: 13px 14px; }

/* ---------- 2. Tarjetas KPI del dashboard ---------- */
.kpi-icon {
  width: 52px; height: 52px; border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  font-size: 26px; color: #fff; flex-shrink: 0;
}
.bg-tint-success { background: linear-gradient(135deg, rgba(69,179,105,.14), rgba(69,179,105,.02)); }
.bg-tint-warning { background: linear-gradient(135deg, rgba(255,159,41,.16), rgba(255,159,41,.02)); }
.bg-tint-danger  { background: linear-gradient(135deg, rgba(239,74,0,.13),  rgba(239,74,0,.02)); }
.bg-tint-primary { background: linear-gradient(135deg, rgba(108,92,231,.14), rgba(108,92,231,.02)); }
.bg-tint-info    { background: linear-gradient(135deg, rgba(46,125,255,.13), rgba(46,125,255,.02)); }

.kpi-card { transition: transform .15s ease, box-shadow .15s ease; }
.kpi-card:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(45,36,121,.10); }

.stat-mini .icon-chip {
  width: 40px; height: 40px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center; font-size: 20px;
}

/* ---------- 3. Avatares por iniciales ---------- */
.avatar-initials {
  width: 40px; height: 40px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 14px; color: #fff; flex-shrink: 0;
  letter-spacing: .3px;
}
.avatar-initials.sm { width: 32px; height: 32px; font-size: 12px; }
.avatar-initials.lg { width: 52px; height: 52px; font-size: 18px; }

/* ---------- 4. Tablas ---------- */
.table-amount { font-variant-numeric: tabular-nums; white-space: nowrap; }
.table > :not(caption) > * > * { vertical-align: middle; }
.row-actions .btn-icon {
  width: 34px; height: 34px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 17px; border: none; transition: filter .12s ease;
}
.row-actions .btn-icon:hover { filter: brightness(.92); }

/* Chips de filtro (bandeja de pagos, etc.) */
.filter-chip {
  border: 1px solid var(--neutral-300); background: var(--white);
  color: var(--text-secondary-light, #6b7280);
  border-radius: 999px; padding: 8px 18px; font-size: 14px; font-weight: 600;
  display: inline-flex; align-items: center; gap: 8px; cursor: pointer;
  transition: all .12s ease; line-height: 1;
}
.filter-chip .count {
  background: var(--neutral-200); border-radius: 999px; padding: 2px 9px;
  font-size: 12px; font-weight: 700;
}
.filter-chip.active { background: var(--primary-600); border-color: var(--primary-600); color: #fff; }
.filter-chip.active .count { background: rgba(255,255,255,.25); color: #fff; }

/* ---------- 5. Formularios ---------- */
.form-section-title {
  display: flex; align-items: center; gap: 10px;
  font-size: 12px; font-weight: 700; letter-spacing: 1.2px; text-transform: uppercase;
  color: var(--primary-600); margin-bottom: 4px;
}
.form-section-title::after { content: ""; flex: 1; height: 1px; background: var(--neutral-200); }
.form-label { font-weight: 600; }
.req::after { content: " *"; color: var(--danger-main); }
.form-hint { font-size: 12.5px; color: var(--text-secondary-light, #6b7280); margin-top: 4px; }

.input-icon-group .input-group-text {
  background: var(--neutral-50); border-color: var(--neutral-300);
  color: var(--text-secondary-light, #6b7280);
}

/* Placeholders en gris MUY claro.
   El tema base los pinta con --text-secondary-light (#4B5563), casi tan
   oscuros como el texto real, y se confunden con datos ya capturados.
   Ajustable: subir el valor del color = más tenue. */
.form-control::placeholder,
.form-select::placeholder,
textarea::placeholder,
input::placeholder {
  color: #C2C8D2 !important;
  opacity: 1 !important;            /* Firefox baja la opacidad por defecto */
}
.form-control::-webkit-input-placeholder,
textarea::-webkit-input-placeholder,
input::-webkit-input-placeholder { color: #C2C8D2 !important; }
.form-control:-ms-input-placeholder,
textarea:-ms-input-placeholder,
input:-ms-input-placeholder { color: #C2C8D2 !important; }
.form-control::-ms-input-placeholder,
textarea::-ms-input-placeholder,
input::-ms-input-placeholder { color: #C2C8D2 !important; }

/* ---------- 6. Estados vacíos / dropzone ---------- */
.dashed-card {
  border: 2px dashed var(--neutral-300); border-radius: 12px;
  background: transparent; transition: all .15s ease;
}
.dashed-card:hover { border-color: var(--primary-400); background: var(--primary-50); }

/* Zona drag-and-drop reutilizable (motor en condomax.js).
   Se usa junto con .dashed-card:  <div class="cm-dz dashed-card p-16 text-center"> */
.cm-dz { cursor: pointer; transition: all .15s ease; }
.cm-dz.cm-dz-over { border-color: var(--primary-500); background: var(--primary-50); }
.cm-dz-disabled { opacity: .65; cursor: not-allowed; pointer-events: none; background: var(--neutral-50); }
.cm-dz-list li { border-top: 1px dashed var(--neutral-200); padding-top: 6px; margin-top: 6px; }
.cm-dz-list li:first-child { border-top: 0; margin-top: 10px; }

/* ---------- 7. Plantillas de mensajes ---------- */
.template-var {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  background: var(--primary-50); color: var(--primary-700);
  border-radius: 6px; padding: 1px 7px; font-size: .85em; font-weight: 600;
  white-space: nowrap;
}

/* ---------- 8. Documentos ---------- */
.doc-tile {
  width: 48px; height: 48px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center; font-size: 24px; flex-shrink: 0;
}

/* ---------- 9. Login ---------- */
.auth-wrap { min-height: 100vh; }
.auth-brand-panel {
  background: url('../images/Fondo_index.jpg') center / cover no-repeat;
  color: #fff;
}
.auth-brand-panel .point-icon {
  width: 42px; height: 42px; border-radius: 12px; flex-shrink: 0;
  background: rgba(255,255,255,.14); display: flex; align-items: center; justify-content: center;
  font-size: 21px;
}
.auth-card { max-width: 440px; width: 100%; }

/* ---------- 10. Estado de cuenta / impresión ---------- */
.statement-summary-box { border: 1px solid var(--neutral-200); border-radius: 12px; padding: 16px 20px; }
@media print {
  .sidebar, .navbar-header, .d-footer, .no-print { display: none !important; }
  .dashboard-main { margin-left: 0 !important; }
  .dashboard-main-body { padding: 0 !important; background: #fff !important; }
  .card { box-shadow: none !important; border: 1px solid #ddd !important; }
  body { background: #fff !important; }
  a[href]::after { content: "" !important; }
}

/* ---------- 11. Detalles generales ---------- */
:focus-visible { outline: 2px solid var(--primary-400); outline-offset: 2px; }
.text-balance { text-wrap: balance; }
.cursor-pointer { cursor: pointer; }
.progress-thin { height: 7px; border-radius: 99px; background: var(--neutral-200); }
.progress-thin .progress-bar { border-radius: 99px; }

@media (max-width: 575.98px) {
  .dashboard-main-body { padding: 16px 12px; }
  .row-actions { white-space: nowrap; }
}

/* Toasts demo */
.toast-cm { border-left: 4px solid var(--primary-600); }
.toast-cm.toast-success { border-left-color: var(--success-main); }
.toast-cm.toast-danger { border-left-color: var(--danger-main); }

/* ============================================================
   TABLAS UNIFICADAS CondoMax  (diseño consistente + responsivo)
   ============================================================ */

/* --- Look unificado de todas las tablas de datos --- */
.dashboard-main-body table.table {
    --cmx-border: #eef0f4;
    margin-bottom: 0;
    border-collapse: separate;
    border-spacing: 0;
}
.dashboard-main-body table.table > thead > tr > th {
    background: #f8f9fc;
    color: #6b7280;
    font-size: .78rem;
    font-weight: 600;
    text-transform: none;
    letter-spacing: .01em;
    padding: 12px 16px;
    border-bottom: 1px solid var(--cmx-border);
    white-space: nowrap;
    vertical-align: middle;
}
.dashboard-main-body table.table > tbody > tr > td {
    padding: 14px 16px;
    border-bottom: 1px solid var(--cmx-border);
    vertical-align: middle;
    font-size: .875rem;
    color: #374151;
}
.dashboard-main-body table.table > tbody > tr:last-child > td { border-bottom: 0; }
.dashboard-main-body table.table > tbody > tr:hover > td { background: #fbfbfe; }

/* Alineaciones estándar: dinero a la derecha, estatus y acciones centrados */
.dashboard-main-body table.table th.text-end,
.dashboard-main-body table.table td.text-end,
.dashboard-main-body table.table td.table-amount { text-align: right; }
.dashboard-main-body table.table th.text-center,
.dashboard-main-body table.table td.text-center { text-align: center; }
.dashboard-main-body table.table td.table-amount { font-variant-numeric: tabular-nums; font-weight: 600; white-space: nowrap; }
/* La columna de Acciones no se estira: solo lo que ocupa el botón */
.dashboard-main-body table.table th:last-child,
.dashboard-main-body table.table td:last-child { white-space: nowrap; }

/* --- Menú de acciones unificado (dropdown ⋮) --- */
.cmx-acciones { display: inline-block; }
.cmx-acc-btn {
    width: 34px; height: 34px;
    display: inline-flex; align-items: center; justify-content: center;
    border: 1px solid #e5e7eb; background: #fff; color: #4b5563;
    border-radius: 9px; cursor: pointer; font-size: 18px; line-height: 1;
    transition: background .15s, border-color .15s, color .15s;
}
.cmx-acc-btn:hover, .cmx-acc-btn[aria-expanded="true"] {
    background: var(--primary-50, #EEF0FF); border-color: var(--primary-300, #b9b2f0); color: var(--primary-600, #5B4BD6);
}
.cmx-acc-menu {
    min-width: 200px; padding: 6px; border: 1px solid #eef0f4; border-radius: 12px;
    box-shadow: 0 12px 34px rgba(31,35,48,.12);
}
.cmx-acc-item {
    display: flex; align-items: center; gap: 10px;
    padding: 9px 12px; border-radius: 8px; font-size: .85rem; color: #374151;
    width: 100%; border: 0; background: transparent; text-align: left; cursor: pointer;
}
.cmx-acc-item i { font-size: 17px; color: #6b7280; width: 20px; text-align: center; flex-shrink: 0; }
.cmx-acc-item:hover { background: var(--primary-50, #EEF0FF); color: var(--primary-700, #4536b8); }
.cmx-acc-item:hover i { color: var(--primary-600, #5B4BD6); }
.cmx-acc-danger { color: #d8493f; }
.cmx-acc-danger i { color: #d8493f; }
.cmx-acc-danger:hover { background: #fef2f2; color: #b91c1c; }
.cmx-acc-danger:hover i { color: #b91c1c; }
.cmx-acc-item.disabled { opacity: .45; pointer-events: none; }
.cmx-acc-menu form { width: 100%; }



/* --- Columna de numeración de fila (#) --- */
.dashboard-main-body table.table th.cm-numcol,
.dashboard-main-body table.table td.cm-rownum {
    width: 44px; text-align: center; color: #9ca3af;
    font-variant-numeric: tabular-nums; font-size: .8rem; padding-left: 8px; padding-right: 8px;
}
.dashboard-main-body table.table td.cm-rownum { font-weight: 600; }
/* En móvil (card-stack), la # se muestra como una etiqueta más */
@media (max-width: 767.98px) {
    .tabla-movil td.cm-rownum { color: #6b7280; }
    .tabla-movil td.cm-rownum::before { content: "#"; }
}

/* ============================================================
   VALIDACIÓN DE CAMPOS OBLIGATORIOS (rojo cuando faltan)
   ============================================================ */
/* Campo marcado como faltante */
.form-control.cm-invalid,
.form-select.cm-invalid,
textarea.cm-invalid {
    border-color: var(--danger-main, #d8493f) !important;
    background-color: #fef4f3;
}
.form-control.cm-invalid:focus,
.form-select.cm-invalid:focus,
textarea.cm-invalid:focus {
    box-shadow: 0 0 0 .2rem rgba(216, 73, 63, .18) !important;
    border-color: var(--danger-main, #d8493f) !important;
}
/* Grupos de input (con prefijo $) también en rojo */
.input-group.cm-invalid > .form-control,
.input-group.cm-invalid > .input-group-text {
    border-color: var(--danger-main, #d8493f) !important;
}
/* Mensajito bajo el campo */
.cm-invalid-msg {
    display: block;
    color: var(--danger-main, #d8493f);
    font-size: .78rem;
    font-weight: 500;
    margin-top: 4px;
}
.cm-invalid-msg i { font-size: .85rem; vertical-align: -1px; margin-right: 3px; }
/* El label de un campo faltante se resalta */
label.cm-label-invalid { color: var(--danger-main, #d8493f) !important; }
/* Aviso general arriba del formulario cuando hay campos faltantes */
.cm-form-alerta {
    display: none;
    align-items: center;
    gap: 8px;
    background: #fef4f3;
    border: 1px solid #f3c9c4;
    color: #b3352c;
    border-radius: 10px;
    padding: 10px 14px;
    font-size: .85rem;
    font-weight: 500;
    margin-bottom: 16px;
}
.cm-form-alerta.show { display: flex; }

/* ============================================================
   ACORDEÓN de formularios (pasos plegables) — CondoMax
   ============================================================ */
.cm-acc { display: flex; flex-direction: column; gap: 14px; }
.cm-acc-item {
    border: 1px solid #e9eaf0;
    border-radius: 14px;
    background: #fff;
    overflow: hidden;
    transition: box-shadow .2s, border-color .2s;
}
.cm-acc-item.open {
    border-color: var(--primary-300, #c3bcf2);
    box-shadow: 0 8px 26px rgba(91, 75, 214, .10);
}
.cm-acc-head {
    display: flex;
    align-items: center;
    gap: 14px;
    width: 100%;
    border: 0;
    background: transparent;
    padding: 16px 18px;
    cursor: pointer;
    text-align: left;
    transition: background .15s;
}
.cm-acc-head:hover { background: #faf9ff; }
.cm-acc-item.open .cm-acc-head { background: linear-gradient(90deg, #f5f3ff 0%, #ffffff 70%); }
/* Círculo numerado del paso */
.cm-acc-num {
    flex-shrink: 0;
    width: 38px; height: 38px;
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: 50%;
    background: #eef0f7; color: #8b90a3;
    font-weight: 700; font-size: 15px;
    transition: background .2s, color .2s, transform .2s;
}
.cm-acc-item.open .cm-acc-num {
    background: var(--primary-600, #5B4BD6); color: #fff;
    box-shadow: 0 4px 12px rgba(91, 75, 214, .35);
}
.cm-acc-item.cm-done .cm-acc-num { background: var(--success-main, #22a06b); color: #fff; }
.cm-acc-titco { flex: 1; min-width: 0; }
.cm-acc-title {
    display: flex; align-items: center; gap: 8px;
    font-size: 15px; font-weight: 700; color: #2b2f3a; margin: 0;
}
.cm-acc-title i { color: var(--primary-600, #5B4BD6); font-size: 18px; }
.cm-acc-item.open .cm-acc-title { color: var(--primary-700, #4536b8); }
.cm-acc-sub { font-size: 12.5px; color: #9096a5; margin: 2px 0 0; font-weight: 400; }
/* Flecha */
.cm-acc-chevron {
    flex-shrink: 0; color: #b6bac7; font-size: 22px;
    transition: transform .25s, color .2s;
}
.cm-acc-item.open .cm-acc-chevron { transform: rotate(180deg); color: var(--primary-600, #5B4BD6); }
/* Panel plegable (animado) */
.cm-acc-panel {
    max-height: 0;
    overflow: hidden;
    transition: max-height .32s cubic-bezier(.4,0,.2,1);
}
.cm-acc-panel.open { max-height: 1600px; }
.cm-acc-body { padding: 4px 18px 20px; border-top: 1px solid #f0f1f6; }
.cm-acc-body-inner { padding-top: 16px; }
/* Palomita de "sección con datos" */
.cm-acc-check {
    display: none; flex-shrink: 0; color: var(--success-main, #22a06b); font-size: 20px;
}
.cm-acc-item.cm-done .cm-acc-check { display: inline-block; }
@media (max-width: 575.98px) {
    .cm-acc-head { padding: 14px; gap: 10px; }
    .cm-acc-num { width: 32px; height: 32px; font-size: 13px; }
    .cm-acc-title { font-size: 14px; }
    .cm-acc-body { padding: 4px 14px 16px; }
}

/* ============================================================
   TARJETA DE SECCIÓN ESTÁTICA (mismo look del acordeón, sin plegar)
   Para formularios que quieren el header bonito con borde violeta
   pero SIN comportamiento de acordeón.
   ============================================================ */
.cm-sec {
    border: 1px solid var(--primary-300, #c3bcf2);
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 8px 26px rgba(91, 75, 214, .10);
    margin-bottom: 18px;
    overflow: hidden;
}
.cm-sec-head {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px 18px;
    background: linear-gradient(90deg, #f5f3ff 0%, #ffffff 70%);
}
.cm-sec-num {
    flex-shrink: 0;
    width: 38px; height: 38px;
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: 50%;
    background: var(--primary-600, #5B4BD6); color: #fff;
    font-weight: 700; font-size: 15px;
    box-shadow: 0 4px 12px rgba(91, 75, 214, .35);
}
.cm-sec-num i { font-size: 19px; line-height: 1; }
.cm-sec-titco { flex: 1; min-width: 0; }
.cm-sec-title {
    display: flex; align-items: center; gap: 8px;
    font-size: 15px; font-weight: 700; color: var(--primary-700, #4536b8); margin: 0;
}
.cm-sec-title i { color: var(--primary-600, #5B4BD6); font-size: 18px; }
.cm-sec-sub { font-size: 12.5px; color: #9096a5; margin: 2px 0 0; font-weight: 400; }
.cm-sec-body { padding: 20px 18px; border-top: 1px solid #f0f1f6; }
@media (max-width: 575.98px) {
    .cm-sec-head { padding: 14px; gap: 10px; }
    .cm-sec-num { width: 32px; height: 32px; font-size: 13px; }
    .cm-sec-title { font-size: 14px; }
    .cm-sec-body { padding: 16px 14px; }
}

/* ============================================================
   Header "bonito" para modales (estilo tarjeta cm-sec):
   badge de icono en círculo de color + título + subtítulo,
   tinte degradado en el header y orilla de color en el modal.
   Variante .is-danger para confirmaciones de borrado.
   ============================================================ */
.modal-header.cm-mhead { gap: 14px; padding: 16px 24px; background: linear-gradient(90deg, #f5f3ff 0%, #ffffff 72%); border-bottom: 1px solid #ece9fb; }
.cm-mhead-badge { flex-shrink: 0; width: 40px; height: 40px; display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; background: var(--primary-600, #5B4BD6); color: #fff; box-shadow: 0 4px 12px rgba(91, 75, 214, .35); }
.cm-mhead-badge i { font-size: 20px; line-height: 1; }
.cm-mhead-tt { min-width: 0; }
.cm-mhead-title { font-size: 15.5px; font-weight: 700; color: var(--primary-700, #4536b8); margin: 0; line-height: 1.25; }
.cm-mhead-sub { font-size: 12.5px; color: #9096a5; margin: 2px 0 0; font-weight: 400; }
.modal-content.cm-modal-edge { border: 1px solid #c9c0f2; box-shadow: 0 12px 34px rgba(91, 75, 214, .16); }
.modal-header.cm-mhead.is-danger { background: linear-gradient(90deg, #fef2f2 0%, #ffffff 72%); border-bottom-color: #fbdcdc; }
.cm-mhead.is-danger .cm-mhead-badge { background: #e5484d; box-shadow: 0 4px 12px rgba(229, 72, 77, .30); }
.cm-mhead.is-danger .cm-mhead-title { color: #c0343a; }
.modal-content.cm-modal-edge.is-danger { border-color: #f3c6c8; box-shadow: 0 12px 34px rgba(229, 72, 77, .16); }
@media (max-width: 575.98px) {
    .cm-mhead-badge { width: 34px; height: 34px; }
    .cm-mhead-badge i { font-size: 18px; }
    .cm-mhead-title { font-size: 14.5px; }
}
