/* ============================================================================
   componentes.css — piezas propias en lugar de Bootstrap (2026-11-22)
   ----------------------------------------------------------------------------
   Facturación, Reimpresión, Correspondencia, el ingreso, Cambiar clave y la
   verificación en dos pasos (layout/base.twig) cargaban Bootstrap 5.3 desde
   cdn.jsdelivr.net. Aquí está solo lo que esas pantallas usan, con los
   colores de la casa (variables --marca-* de marca.css), con los mismos
   nombres de clase para no tocar las vistas:
     base (márgenes de títulos, párrafos y listas), cuadrícula (row, col-*),
     card, badge, alert, btn, formularios, table, list-group, pagination,
     modal (con public/assets/js/ventana-modal.js) y utilidades de espacio
     y alineación.
   Las ventanas emergentes ya no usan la animación «fade» de Bootstrap.
   ============================================================================ */

/* ---------------------------------------------------------------------------
   Base: app.css pone márgenes en 0; Bootstrap los devolvía
   --------------------------------------------------------------------------- */
body { line-height: 1.5; }
h1, h2, h3, h4, h5, h6 { margin: 0 0 0.5rem; font-weight: 600; line-height: 1.2; }
h1 { font-size: calc(1.375rem + 1.5vw); }
h2 { font-size: calc(1.325rem + 0.9vw); }
h3 { font-size: calc(1.3rem + 0.6vw); }
h4 { font-size: calc(1.275rem + 0.3vw); }
h5 { font-size: 1.25rem; }
h6 { font-size: 1rem; }
@media (min-width: 1200px) {
    h1 { font-size: 2.5rem; }
    h2 { font-size: 2rem; }
    h3 { font-size: 1.75rem; }
    h4 { font-size: 1.5rem; }
}
p { margin: 0 0 1rem; }
ul, ol { margin: 0 0 1rem; padding-left: 2rem; }
ul ul, ol ol, ul ol, ol ul { margin-bottom: 0; }
dl { margin: 0 0 1rem; }
dt { font-weight: 700; }
dd { margin: 0 0 0.5rem; }
hr { margin: 1rem 0; border: 0; border-top: 1px solid var(--marca-borde); opacity: 1; }
small, .small { font-size: 0.875em; }
label { display: inline-block; }
button, input, select, textarea { font-family: inherit; font-size: inherit; line-height: inherit; }
table { border-collapse: collapse; caption-side: bottom; }
th { text-align: inherit; }
img, svg { vertical-align: middle; }

/* ---------------------------------------------------------------------------
   Cuadrícula
   --------------------------------------------------------------------------- */
.row {
    --separacion: 1.5rem;
    display: flex;
    flex-wrap: wrap;
    margin-left: calc(var(--separacion) * -0.5);
    margin-right: calc(var(--separacion) * -0.5);
}
.row > * {
    flex-shrink: 0;
    width: 100%;
    max-width: 100%;
    padding-left: calc(var(--separacion) * 0.5);
    padding-right: calc(var(--separacion) * 0.5);
}
.col-12 { flex: 0 0 auto; width: 100%; }
@media (min-width: 768px) {
    .col-md-2 { flex: 0 0 auto; width: 16.6667%; }
    .col-md-3 { flex: 0 0 auto; width: 25%; }
    .col-md-4 { flex: 0 0 auto; width: 33.3333%; }
    .col-md-6 { flex: 0 0 auto; width: 50%; }
    .col-md-8 { flex: 0 0 auto; width: 66.6667%; }
    .col-md-12 { flex: 0 0 auto; width: 100%; }
}

/* ---------------------------------------------------------------------------
   Tarjetas
   --------------------------------------------------------------------------- */
.card {
    position: relative;
    display: flex;
    flex-direction: column;
    min-width: 0;
    background: var(--marca-superficie);
    border: 1px solid var(--marca-borde);
    border-radius: 10px;
}
.card-header {
    padding: 0.75rem 1rem;
    background: #f7f9fb;
    border-bottom: 1px solid var(--marca-borde-suave);
    border-radius: 10px 10px 0 0;
}
.card-header > :last-child { margin-bottom: 0; }
.card-body { flex: 1 1 auto; padding: 1rem; }
.card-title { margin-bottom: 0.5rem; }

/* ---------------------------------------------------------------------------
   Insignias y fondos
   --------------------------------------------------------------------------- */
.badge {
    display: inline-block;
    padding: 0.3em 0.6em;
    font-size: 0.78em;
    font-weight: 700;
    line-height: 1;
    color: #fff;
    text-align: center;
    white-space: nowrap;
    vertical-align: baseline;
    border-radius: 6px;
}
.rounded-pill { border-radius: 999px !important; }
.bg-primary { background-color: var(--marca-azul) !important; color: #fff; }
.bg-secondary { background-color: #5a6778 !important; color: #fff; }
.bg-success { background-color: var(--marca-verde) !important; color: #fff; }
.bg-danger { background-color: var(--marca-rojo) !important; color: #fff; }
.bg-warning { background-color: #f2c94c !important; color: var(--marca-tinta) !important; }
.bg-info { background-color: #cfe0f1 !important; color: var(--marca-tinta) !important; }
.badge.bg-warning, .badge.bg-info { color: var(--marca-tinta); }

/* ---------------------------------------------------------------------------
   Avisos
   --------------------------------------------------------------------------- */
.alert {
    position: relative;
    padding: 0.85rem 1rem;
    margin-bottom: 1rem;
    border: 1px solid transparent;
    border-left-width: 5px;
    border-radius: 8px;
}
.alert-success { color: #14532d; background: #ecf6f0; border-color: #b7dcc6; border-left-color: var(--marca-verde); }
.alert-info { color: var(--marca-tinta); background: var(--marca-azul-suave); border-color: #bccbdd; border-left-color: var(--marca-azul); }
.alert-warning { color: #5c3d00; background: #fff8e1; border-color: #f0dca0; border-left-color: #b7791f; }
.alert-danger,
.alert-error { color: #6b1510; background: #fbeceb; border-color: #f0c2bf; border-left-color: var(--marca-rojo); }

/* ---------------------------------------------------------------------------
   Botones (los colores principales los pone marca.css)
   --------------------------------------------------------------------------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.45rem 0.9rem;
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.5;
    text-align: center;
    text-decoration: none;
    vertical-align: middle;
    cursor: pointer;
    user-select: none;
    border: 1px solid transparent;
    border-radius: 6px;
}
.btn:disabled, .btn.disabled { opacity: 0.6; pointer-events: none; }
.btn-sm { padding: 0.25rem 0.55rem; font-size: 0.875rem; }
.btn-lg { padding: 0.6rem 1.2rem; font-size: 1.15rem; }
.btn-info {
    background: var(--marca-superficie);
    border-color: #b6c2d1;
    color: var(--marca-azul);
}
.btn-info:hover { background: var(--marca-azul-suave); border-color: var(--marca-azul); }
.btn-outline-primary { background: transparent; border-color: var(--marca-azul); color: var(--marca-azul); }
.btn-outline-primary:hover { background: var(--marca-azul); color: #fff; }
.btn-outline-secondary { background: transparent; border-color: #b6c2d1; color: var(--marca-tenue); }
.btn-outline-secondary:hover { background: #eef2f6; color: var(--marca-texto); }
.btn-group, .btn-group-sm { display: inline-flex; vertical-align: middle; }
.btn-group > .btn { border-radius: 0; }
.btn-group > .btn:first-child { border-radius: 6px 0 0 6px; }
.btn-group > .btn:last-child { border-radius: 0 6px 6px 0; }
.btn-group > .btn:only-child { border-radius: 6px; }
.btn-group > .btn + .btn { margin-left: -1px; }
.btn-group-sm > .btn { padding: 0.25rem 0.5rem; font-size: 0.875rem; }
.btn-close {
    width: 2rem;
    height: 2rem;
    padding: 0;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: var(--marca-tenue);
    cursor: pointer;
    font-size: 1.4rem;
    line-height: 1;
}
.btn-close::before { content: "\00d7"; }
.btn-close:hover { background: #eef2f6; color: var(--marca-texto); }

/* ---------------------------------------------------------------------------
   Formularios
   --------------------------------------------------------------------------- */
.form-label { display: inline-block; margin-bottom: 0.4rem; font-weight: 600; }
.form-text { margin-top: 0.25rem; font-size: 0.875em; color: var(--marca-tenue); }
.form-control,
.form-select {
    display: block;
    width: 100%;
    padding: 0.45rem 0.75rem;
    font-size: 1rem;
    line-height: 1.5;
    color: var(--marca-texto);
    background-color: var(--marca-superficie);
    border: 1px solid var(--marca-borde-campo, #768396);
    border-radius: 6px;
    appearance: none;
}
.form-select {
    padding-right: 2.25rem;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23566375' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 14px 10px;
}
textarea.form-control { min-height: 4.5rem; }
.form-control[type="file"] { overflow: hidden; }
.form-control::file-selector-button {
    margin: -0.45rem 0.75rem -0.45rem -0.75rem;
    padding: 0.45rem 0.75rem;
    border: 0;
    border-right: 1px solid #b6c2d1;
    background: #eef2f6;
    color: var(--marca-texto);
    font: inherit;
    cursor: pointer;
}
.form-control:hover::file-selector-button { background: #e2e8ef; }
.form-control:disabled, .form-select:disabled, .form-control[readonly] { background-color: #eef2f6; }
.form-check { display: block; min-height: 1.5rem; padding-left: 1.6em; margin-bottom: 0.25rem; }
.form-check-input { float: left; margin-left: -1.6em; margin-top: 0.3em; width: 1em; height: 1em; }
.form-check-label { cursor: pointer; }

/* ---------------------------------------------------------------------------
   Tablas
   --------------------------------------------------------------------------- */
.table thead, .table tbody, .table tfoot, .table tr, .table td, .table th { vertical-align: inherit; }
.table {
    width: 100%;
    margin-bottom: 1rem;
    vertical-align: top;
    border-color: var(--marca-borde-suave);
}
.table > :not(caption) > * > * {
    padding: 0.55rem 0.6rem;
    border-bottom: 1px solid var(--marca-borde-suave);
}
.table > thead th,
.table-light > tr > th,
.table-light th {
    background: #eef2f6;
    color: var(--marca-tinta);
    font-weight: 600;
    border-bottom: 1px solid var(--marca-borde);
}
.table-sm > :not(caption) > * > * { padding: 0.3rem 0.4rem; }
.table-bordered > :not(caption) > * > * { border: 1px solid var(--marca-borde-suave); }
.table-hover > tbody > tr:hover > * { background: #f7f9fb; }
.table-responsive { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.align-middle { vertical-align: middle !important; }

/* ---------------------------------------------------------------------------
   Listas y paginación
   --------------------------------------------------------------------------- */
.list-group { display: flex; flex-direction: column; padding-left: 0; margin-bottom: 0; border-radius: 8px; }
.list-group-item {
    position: relative;
    display: block;
    padding: 0.6rem 1rem;
    color: var(--marca-texto);
    text-decoration: none;
    background: var(--marca-superficie);
    border: 1px solid var(--marca-borde-suave);
}
.list-group-item + .list-group-item { border-top-width: 0; }
.list-group-item:first-child { border-radius: 8px 8px 0 0; }
.list-group-item:last-child { border-radius: 0 0 8px 8px; }
.list-group-item:only-child { border-radius: 8px; }
.list-group-item-action:hover { background: #f7f9fb; }
.list-group-item.active { background: var(--marca-azul); border-color: var(--marca-azul); color: #fff; }

.pagination { display: flex; flex-wrap: wrap; gap: 0.25rem; padding-left: 0; list-style: none; margin: 0 0 1rem; }
.page-link {
    display: block;
    padding: 0.35rem 0.75rem;
    color: var(--marca-azul);
    text-decoration: none;
    background: var(--marca-superficie);
    border: 1px solid var(--marca-borde);
    border-radius: 6px;
}
.page-link:hover { background: var(--marca-azul-suave); }
.page-item.active .page-link { background: var(--marca-azul); border-color: var(--marca-azul); color: #fff; }
.page-item.disabled .page-link { color: var(--marca-tenue); pointer-events: none; background: #f3f5f8; }

/* ---------------------------------------------------------------------------
   Ventanas emergentes (ventana-modal.js)
   --------------------------------------------------------------------------- */
.modal {
    position: fixed;
    inset: 0;
    z-index: 1055;
    display: none;
    overflow-x: hidden;
    overflow-y: auto;
    padding: 1rem;
    background: rgba(15, 39, 71, 0.55);
}
.modal.show { display: block; }
body.modal-open { overflow: hidden; }
.modal-dialog { max-width: 500px; margin: 1.75rem auto; }
.modal-content {
    display: flex;
    flex-direction: column;
    background: var(--marca-superficie);
    border: 1px solid var(--marca-borde);
    border-radius: 12px;
    box-shadow: 0 12px 32px rgba(15, 39, 71, 0.25);
}
.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--marca-borde-suave);
}
.modal-title { margin: 0; font-size: 1.15rem; color: var(--marca-tinta); }
.modal-body { padding: 1.25rem; }
.modal-footer {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 0.5rem;
    padding: 0.85rem 1.25rem;
    border-top: 1px solid var(--marca-borde-suave);
}

/* ---------------------------------------------------------------------------
   Utilidades
   --------------------------------------------------------------------------- */
.d-flex { display: flex !important; }
.d-block { display: block !important; }
.d-grid { display: grid !important; }
.flex { display: flex; }
.block { display: block; }
.justify-content-between { justify-content: space-between !important; }
.justify-content-center { justify-content: center !important; }
.align-items-center { align-items: center !important; }
.gap-2 { gap: 0.5rem !important; }
.gap-4 { gap: 1.5rem !important; }
.w-100, .w-full { width: 100% !important; }
.p-0 { padding: 0 !important; }
.py-4 { padding-top: 1.5rem !important; padding-bottom: 1.5rem !important; }
.mb-0 { margin-bottom: 0 !important; }
.mb-2 { margin-bottom: 0.5rem !important; }
.mb-3 { margin-bottom: 1rem !important; }
.mb-4 { margin-bottom: 1.5rem !important; }
.mt-2 { margin-top: 0.5rem !important; }
.mt-3 { margin-top: 1rem !important; }
.mt-4 { margin-top: 1.5rem !important; }
.me-2 { margin-right: 0.5rem !important; }
.text-center { text-align: center !important; }
.text-end, .text-right { text-align: right !important; }
.text-nowrap { white-space: nowrap !important; }
.text-muted, .text-secondary { color: var(--marca-tenue) !important; }
.text-success { color: var(--marca-verde) !important; }
.text-danger { color: var(--marca-rojo) !important; }
.text-white { color: #fff !important; }
.text-sm { font-size: 0.875rem; }
.fs-5 { font-size: 1.25rem !important; }
.fw-bold, .font-bold { font-weight: 700 !important; }
.link-secondary { color: var(--marca-tenue); }
.link-secondary:hover { color: var(--marca-texto); }
