/* ============================================================
   CUENTAS BANCARIAS — estilos compartidos por Consulta y Form.
   Reutiliza el ribbon / grid / dropdown / export de Home (mismas clases,
   en hoja global para que apliquen fuera del scoped de Home.razor.css)
   y agrega estilos propios (badges de estatus, chips de filtro, acciones).
   ============================================================ */

/* ===== Página con ribbon ===== */
.office-ribbon-page {
    min-height: 100vh;
    background: #e8e8e8;
    padding: 12px;
    box-sizing: border-box;
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
}

/* ===== Ribbon ===== */
.ribbon-outer-container {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    padding: 8px;
    margin-bottom: 12px;
    border: 1px solid rgba(255, 255, 255, 0.18);
}

.custom-ribbon {
    background: rgba(255, 255, 255, 0.5);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(209, 209, 209, 0.5);
    border-radius: 8px;
    width: 100%;
    overflow: hidden;
}

.ribbon-tabs {
    display: flex;
    background: rgba(240, 240, 240, 0.6);
    backdrop-filter: blur(5px);
    border-bottom: 1px solid rgba(209, 209, 209, 0.5);
    gap: 2px;
    overflow-x: auto;
    border-radius: 8px 8px 0 0;
}

.ribbon-tab {
    background: rgba(224, 224, 224, 0.5);
    border: 1px solid transparent;
    border-bottom: none;
    padding: 4px 16px;
    font-size: 11px;
    color: #444;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
    flex-shrink: 0;
}

.ribbon-tab.active {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(10px);
    border-color: rgba(209, 209, 209, 0.5);
    border-bottom-color: rgba(255, 255, 255, 0.8);
    font-weight: 500;
}

.ribbon-content {
    display: flex;
    padding: 8px;
    background: rgba(255, 255, 255, 0.4);
    backdrop-filter: blur(8px);
    min-height: 88px;
    gap: 3px;
    overflow-x: auto;
}

.ribbon-group {
    display: flex;
    flex-direction: column;
    border-right: 1px solid #d4d4d4;
    padding: 3px 6px;
    min-height: 80px;
    flex-shrink: 0;
}

.ribbon-group:last-child { border-right: none; }

.ribbon-group-right {
    margin-left: auto;
    border-right: none;
    border-left: 1px solid #d4d4d4;
}

.ribbon-group-items {
    display: flex;
    gap: 6px;
    flex: 1;
    align-items: flex-start;
    padding: 4px 0 2px 0;
}

.ribbon-group-label {
    font-size: 9px;
    color: #666;
    text-align: center;
    padding: 3px;
    border-top: 1px solid #e8e8e8;
    margin: 0 -6px;
    background: #f8f8f8;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.ribbon-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 4px;
    width: 80px;
    min-width: 80px;
    min-height: 62px;
    border: 1px solid transparent;
    background: transparent;
    border-radius: 3px;
    cursor: pointer;
    transition: all 0.2s;
    flex-shrink: 0;
    font-family: inherit;
}

.ribbon-btn i {
    font-size: 24px;
    margin-bottom: 4px;
    color: #444;
    line-height: 1;
}

.ribbon-btn span {
    font-size: 10px;
    color: #444;
    text-align: center;
    line-height: 1.4;
    word-wrap: break-word;
    white-space: normal;
    max-width: 76px;
}

.ribbon-btn:hover:not(:disabled) { background: #f8eef0; border-color: #e3c4cb; }
.ribbon-btn:active:not(:disabled) { background: #f0dfe4; border-color: #7a1f33; }

.ribbon-btn-active {
    background: #f8eef0;
    border-color: #7a1f33 !important;
    box-shadow: inset 0 -3px 0 #7a1f33;
}

.ribbon-btn-active i { color: #7a1f33 !important; }
.ribbon-btn-active span { color: #7a1f33 !important; font-weight: 600; }

.ribbon-btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* ===== Panel de contenido ===== */
.content-panel {
    background: #f5f5f5;
    border: 1px solid #e1dfdd;
    border-radius: 8px;
    padding: 16px 20px 20px 20px;
}

.content-panel-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 15px;
    font-weight: 600;
    color: #323130;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin: 0 0 16px 0;
}

.content-panel-title i { color: #7a1f33; font-size: 22px; }

.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 70px 24px;
    color: #605e5c;
    text-align: center;
    border: 1px dashed #d2d0ce;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.5);
}

.empty-state i { font-size: 56px; color: #c8c6c4; margin-bottom: 18px; }
.empty-state-message { font-size: 14px; color: #605e5c; }
.empty-state-message strong { color: #323130; }

.consulta-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 70px 24px;
    gap: 14px;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 8px;
    border: 1px solid #e1dfdd;
}

.consulta-loading .spinner-border { width: 32px; height: 32px; border-width: 3px; color: #7a1f33; }
.consulta-loading p { margin: 0; color: #605e5c; font-size: 14px; }

/* ===== Infobar ===== */
.info-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px;
    background: #f8eef0;
    border: 1px solid #e3c4cb;
    border-radius: 6px;
    margin-bottom: 12px;
    gap: 12px;
}

.info-bar-text {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #4a0f1d;
    font-size: 13px;
    font-weight: 500;
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.info-bar-text i { color: #7a1f33; font-size: 16px; flex-shrink: 0; }

.info-bar-badge {
    background: #7a1f33;
    color: white;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    flex-shrink: 0;
}

/* ===== Tabla de resultados ===== */
.results-container {
    background: #fff;
    border: 1px solid #d2d0ce;
    border-radius: 8px;
    overflow: hidden;
    animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(4px); }
    to   { opacity: 1; transform: translateY(0); }
}

.results-table-scroll { max-height: 58vh; overflow: auto; }

.results-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12.5px;
    color: #323130;
}

.results-table thead { position: sticky; top: 0; z-index: 2; }

.results-table thead tr:first-child th {
    background: linear-gradient(180deg, #f8f8f8 0%, #f0f0f0 100%);
    padding: 10px 12px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    color: #605e5c;
    border-bottom: 1px solid #d2d0ce;
    user-select: none;
    text-align: left;
    white-space: nowrap;
}

.results-table thead tr:first-child th.ordenable { cursor: pointer; }
.results-table thead tr:first-child th.ordenable:hover {
    background: linear-gradient(180deg, #e8e8e8 0%, #e1dfdd 100%);
}

.th-content { display: flex; align-items: center; gap: 6px; }
.sort-icon { font-size: 10px; color: #7a1f33; }

.results-table tbody tr { border-bottom: 1px solid #f3f2f1; cursor: pointer; }
.results-table tbody tr:nth-child(even) { background: rgba(0, 0, 0, 0.02); }
.results-table tbody tr:hover { background: rgba(122, 31, 51, 0.06); }
.results-table tbody tr.fila-sel { background: #f8eef0; }
.results-table tbody tr.fila-sel:hover { background: #f0dfe4; }

.results-table tbody td { padding: 8px 12px; color: #323130; white-space: nowrap; }

.no-results-cell {
    text-align: center !important;
    padding: 32px 16px !important;
    color: #a19f9d;
    font-style: italic;
}

/* ===== Badges de estatus ===== */
.estatus-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
}

.estatus-badge::before {
    content: "";
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: currentColor;
}

.estatus-activa    { background: #e8f5e9; color: #107c10; border: 1px solid #a5d6a7; }
.estatus-inactiva  { background: #fff3e0; color: #c67100; border: 1px solid #ffcc80; }
.estatus-cancelada { background: #fde7e9; color: #d13438; border: 1px solid #f1bcbe; }

/* ===== Botones de acción por fila ===== */
.celda-acciones { white-space: nowrap; }

.btn-fila {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 9px;
    margin-right: 4px;
    border: 1px solid #d2d0ce;
    border-radius: 5px;
    background: #fff;
    color: #7a1f33;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.12s;
}

.btn-fila:hover { background: #7a1f33; color: #fff; border-color: #7a1f33; }
.btn-fila:disabled { opacity: 0.4; cursor: not-allowed; }
.btn-fila:disabled:hover { background: #fff; color: #7a1f33; border-color: #d2d0ce; }

/* ===== Paginación ===== */
.results-pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px;
    border-top: 1px solid #e1dfdd;
    background: #fafafa;
    gap: 12px;
    flex-wrap: wrap;
    font-size: 12px;
    color: #605e5c;
}

.pager-info { flex: 1; min-width: 0; }
.pager-controls { display: flex; align-items: center; gap: 4px; }

.page-btn {
    width: 32px;
    height: 32px;
    border: 1px solid #d2d0ce;
    border-radius: 6px;
    background: #fff;
    color: #323130;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    transition: all 0.15s;
    font-family: inherit;
}

.page-btn:hover:not(:disabled) { background: #f3f2f1; border-color: #7a1f33; color: #7a1f33; }
.page-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.page-info { padding: 0 12px; font-size: 12px; color: #323130; font-weight: 500; }

.pager-size { display: flex; align-items: center; gap: 6px; }
.pager-size label { font-size: 12px; color: #605e5c; }
.pager-size select {
    padding: 4px 8px;
    border: 1px solid #d2d0ce;
    border-radius: 4px;
    font-size: 12px;
    background: #fff;
    color: #323130;
    cursor: pointer;
    font-family: inherit;
}
.pager-size select:focus { outline: none; border-color: #7a1f33; }

/* ===== Canvas de filtros — chips ===== */
.filtro-section-title {
    font-size: 14px;
    font-weight: 600;
    color: #323130;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.filtro-section-title i { color: #7a1f33; }

.filtro-group { margin-bottom: 18px; }

.filtro-group-label {
    display: block;
    font-weight: 600;
    color: #323130;
    font-size: 0.9rem;
    margin-bottom: 8px;
}

.filtro-chips { display: flex; flex-wrap: wrap; gap: 8px; }

.filtro-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border: 1px solid #d2d0ce;
    border-radius: 16px;
    background: #fff;
    color: #323130;
    font-size: 12.5px;
    cursor: pointer;
    transition: all 0.12s;
    user-select: none;
}

.filtro-chip:hover { border-color: #7a1f33; background: #f0f7ff; }

.filtro-chip.activo {
    background: #f8eef0;
    border-color: #7a1f33;
    color: #7a1f33;
    font-weight: 600;
}

.filtro-chip i { font-size: 13px; }

/* ===== Export cards (reutilizado del patrón de exportación) ===== */
.export-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; padding: 8px 0; }

.export-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 22px 16px;
    border: 1px solid #d2d0ce;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.85);
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
}

.export-card:hover {
    border-color: #7a1f33;
    background: rgba(122, 31, 51, 0.04);
    transform: translateY(-3px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.1);
}

.export-card.selected {
    border-color: #7a1f33;
    background: rgba(122, 31, 51, 0.08);
    box-shadow: 0 0 0 2px #7a1f33, 0 4px 12px rgba(122, 31, 51, 0.15);
}

.export-card i { font-size: 34px; }
.export-icon-excel { color: #217346; }
.export-card span { font-size: 14px; font-weight: 600; color: #323130; }
.export-card small { font-size: 11px; color: #605e5c; text-align: center; }

/* ============================================================
   FORMULARIO de Alta / Edición (Pantalla 1)
   ============================================================ */
.cta-section {
    background: #fff;
    border: 1px solid #d2d0ce;
    border-radius: 8px;
    margin-bottom: 14px;
    overflow: hidden;
}

.cta-section-title {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: linear-gradient(180deg, #f8f8f8 0%, #f0f0f0 100%);
    border-bottom: 1px solid #e1dfdd;
    font-size: 13px;
    font-weight: 600;
    color: #323130;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

.cta-section-title i { color: #7a1f33; font-size: 16px; }

.cta-section-title .cta-section-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #7a1f33;
    color: #fff;
    font-size: 12px;
    font-weight: 700;
}

.cta-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px 20px;
    padding: 16px;
}

.cta-field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.cta-field.col-span-2 { grid-column: 1 / -1; }

.cta-label {
    font-size: 0.86rem;
    font-weight: 600;
    color: #323130;
}

.cta-label .cta-required { color: #a4262c; margin-right: 3px; }
.cta-label .cta-hint { font-weight: 400; color: #797775; font-size: 0.78rem; margin-left: 4px; }

.cta-input,
.cta-select,
.cta-textarea {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #8a8886;
    border-radius: 4px;
    font-size: 0.9rem;
    font-family: inherit;
    color: #323130;
    background: #fff;
    box-sizing: border-box;
    transition: border-color 0.1s;
}

.cta-input:focus,
.cta-select:focus,
.cta-textarea:focus {
    outline: none;
    border-color: #7a1f33;
    box-shadow: 0 0 0 1px rgba(122, 31, 51, 0.3);
}

.cta-input:disabled,
.cta-select:disabled,
.cta-textarea:disabled {
    background: #f3f2f1;
    color: #605e5c;
    cursor: not-allowed;
}

.cta-input.invalido,
.cta-select.invalido,
.cta-textarea.invalido {
    border-color: #a4262c;
    box-shadow: 0 0 0 1px rgba(164, 38, 44, 0.3);
}

.cta-textarea { resize: vertical; min-height: 60px; }

.cta-readonly {
    padding: 8px 12px;
    background: #f3f2f1;
    border: 1px dashed #c8c6c4;
    border-radius: 4px;
    font-size: 0.9rem;
    color: #323130;
    font-weight: 600;
}

.cta-readonly.vacio { color: #a19f9d; font-weight: 400; font-style: italic; }

.cta-error {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 0.78rem;
    color: #a4262c;
}

.cta-ok-hint {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 0.78rem;
    color: #107c10;
}

/* Barra de acciones (footer) */
.cta-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 16px;
    background: #fafafa;
    border: 1px solid #e1dfdd;
    border-radius: 8px;
    position: sticky;
    bottom: 12px;
    margin-top: 4px;
    flex-wrap: wrap;
}

.cta-actions .spacer { flex: 1; }

.btn-cta {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 9px 20px;
    border-radius: 5px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    border: 1px solid transparent;
    transition: all 0.12s;
}

.btn-cta-primary { background: #7a1f33; color: #fff; border-color: #7a1f33; }
.btn-cta-primary:hover:not(:disabled) { background: #5c1726; border-color: #5c1726; }
.btn-cta-primary:disabled { background: #f3f2f1; color: #a19f9d; border-color: #edebe9; cursor: not-allowed; }

.btn-cta-secondary { background: #fff; color: #323130; border-color: #8a8886; }
.btn-cta-secondary:hover { background: #f3f2f1; border-color: #323130; }

.btn-cta-ghost { background: transparent; color: #7a1f33; border-color: transparent; }
.btn-cta-ghost:hover { background: #f8eef0; }

/* Aviso/banner dentro del formulario */
.cta-aviso {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border-radius: 6px;
    font-size: 0.85rem;
    margin-bottom: 14px;
}

.cta-aviso.info { background: #f8eef0; border: 1px solid #e3c4cb; color: #4a0f1d; }
.cta-aviso.warn { background: #fff8ec; border: 1px solid #ffcc80; color: #8a5200; }
.cta-aviso i { font-size: 1.1rem; }

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

/* ===== Bitácora ===== */
.bitacora-wrap { overflow-x: auto; }

.bitacora-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12.5px;
    color: #323130;
}

.bitacora-table thead th {
    background: linear-gradient(180deg, #f8f8f8 0%, #f0f0f0 100%);
    padding: 9px 12px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    color: #605e5c;
    border-bottom: 1px solid #d2d0ce;
    text-align: left;
    white-space: nowrap;
}

.bitacora-table tbody td {
    padding: 8px 12px;
    border-bottom: 1px solid #f3f2f1;
    vertical-align: middle;
}

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