/*!
 * Bonataula · estilos del panel de gestión (restaurante y superadmin).
 * Hoja propia, sin dependencias externas. Mantiene los nombres de clase más
 * habituales de Bootstrap (row, col-*, btn, form-control, table, badge, alert…)
 * para que las páginas se lean igual, con el aspecto de la marca Bonataula.
 */

/* ---------- Marca y tokens ---------- */
:root {
    --bt-granate: #89023e;
    --bt-granate-osc: #6c0231;
    --bt-granate-suave: #f8ebf1;
    --bt-granate-borde: #ecc9d8;
    --bt-mostaza: #f8b233;
    --bt-mostaza-suave: #fff5e0;

    --bt-fondo: #f6f4f5;
    --bt-superficie: #ffffff;
    --bt-borde: #e7e2e5;
    --bt-borde-fuerte: #d3ccd0;
    --bt-texto: #221c20;
    --bt-texto-2: #4a4247;
    --bt-apagado: #756c72;

    --bt-verde: #1e7d52;
    --bt-verde-suave: #e6f4ec;
    --bt-ambar: #9a5b00;
    --bt-ambar-suave: #fff3d6;
    --bt-rojo: #b42318;
    --bt-rojo-suave: #fdecea;
    --bt-azul: #1d5fa8;
    --bt-azul-suave: #e8f0fb;
    --bt-gris-suave: #efedee;

    --bt-radio: 10px;
    --bt-radio-s: 7px;
    --bt-sombra: 0 1px 2px rgba(34, 28, 32, .05), 0 1px 3px rgba(34, 28, 32, .06);
    --bt-sombra-g: 0 10px 30px rgba(34, 28, 32, .12);
    --bt-lateral: 248px;
    --bt-fuente: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
    margin: 0;
    font-family: var(--bt-fuente);
    font-size: 15px;
    line-height: 1.5;
    color: var(--bt-texto);
    background: var(--bt-fondo);
    -webkit-font-smoothing: antialiased;
}
a { color: var(--bt-granate); text-decoration: none; }
a:hover { color: var(--bt-granate-osc); text-decoration: underline; }
img, svg { vertical-align: middle; }
h1, h2, h3, h4, h5 { margin: 0 0 .5rem; font-weight: 650; line-height: 1.25; color: var(--bt-texto); letter-spacing: -.01em; }
h1, .h1 { font-size: 1.6rem; }
h2, .h2 { font-size: 1.3rem; }
h3, .h3 { font-size: 1.15rem; }
.h4 { font-size: 1.1rem; }
.h5 { font-size: 1rem; }
p { margin: 0 0 1rem; }
small, .small { font-size: .85em; }
strong { font-weight: 650; }
hr { border: 0; border-top: 1px solid var(--bt-borde); margin: 1.5rem 0; }
:focus-visible { outline: 3px solid rgba(137, 2, 62, .35); outline-offset: 2px; }
.icono { width: 18px; height: 18px; flex-shrink: 0; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.icono-s { width: 15px; height: 15px; }

/* ---------- Estructura: menú lateral + contenido ---------- */
.bt-app { min-height: 100vh; }
.bt-lateral {
    position: fixed; inset: 0 auto 0 0; z-index: 1040;
    width: var(--bt-lateral);
    display: flex; flex-direction: column;
    background: var(--bt-superficie);
    border-right: 1px solid var(--bt-borde);
}
.bt-marca { display: flex; align-items: center; height: 68px; padding: 0 22px; border-bottom: 1px solid var(--bt-borde); }
.bt-marca img { height: 34px; width: auto; }
.bt-marca:hover { text-decoration: none; }
.bt-local { padding: 16px 22px 6px; }
.bt-local-etq { font-size: .72rem; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--bt-apagado); }
.bt-local-nombre { font-weight: 650; color: var(--bt-texto); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bt-local-web { font-size: .82rem; display: inline-flex; align-items: center; gap: 4px; }
.bt-menu { list-style: none; margin: 0; padding: 10px 12px; flex: 1; overflow-y: auto; }
.bt-menu-grupo { padding: 16px 10px 6px; font-size: .72rem; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--bt-apagado); }
.bt-menu a {
    display: flex; align-items: center; gap: 11px;
    padding: 9px 12px; margin-bottom: 2px;
    border-radius: var(--bt-radio-s);
    color: var(--bt-texto-2); font-weight: 500;
}
.bt-menu a:hover { background: var(--bt-gris-suave); color: var(--bt-texto); text-decoration: none; }
.bt-menu a.activo { background: var(--bt-granate-suave); color: var(--bt-granate); font-weight: 600; }
.bt-menu .contador {
    margin-left: auto; min-width: 22px; padding: 1px 7px; border-radius: 20px;
    background: var(--bt-mostaza); color: #3b2600; font-size: .75rem; font-weight: 700; text-align: center;
}
.bt-usuario { display: flex; align-items: center; gap: 10px; padding: 14px 18px; border-top: 1px solid var(--bt-borde); }
.bt-avatar {
    text-decoration: none !important;
    width: 34px; height: 34px; border-radius: 50%; flex-shrink: 0;
    display: grid; place-items: center;
    background: var(--bt-granate); color: #fff; font-weight: 700; font-size: .9rem; text-transform: uppercase;
}
.bt-usuario-datos { color: inherit; text-decoration: none !important; min-width: 0; flex: 1; line-height: 1.25; }
.bt-usuario-nombre { font-weight: 600; font-size: .9rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bt-usuario-rol { font-size: .78rem; color: var(--bt-apagado); }
.bt-salir { color: var(--bt-apagado); padding: 6px; border-radius: 6px; display: inline-flex; }
.bt-salir:hover { color: var(--bt-rojo); background: var(--bt-rojo-suave); }

/* Superadmin: lateral oscuro para distinguirlo de un restaurante */
.bt-super .bt-lateral { background: #231b20; border-right-color: #231b20; }
.bt-super .bt-marca { border-bottom-color: rgba(255,255,255,.08); }
.bt-super .bt-marca img { filter: brightness(0) invert(1); }
.bt-super .bt-menu a { color: #cfc7cc; }
.bt-super .bt-menu a:hover { background: rgba(255,255,255,.07); color: #fff; }
.bt-super .bt-menu a.activo { background: var(--bt-granate); color: #fff; }
.bt-super .bt-menu-grupo, .bt-super .bt-local-etq, .bt-super .bt-usuario-rol { color: #8f858b; }
.bt-super .bt-local-nombre, .bt-super .bt-usuario-nombre { color: #fff; }
.bt-super .bt-usuario { border-top-color: rgba(255,255,255,.08); }
.bt-super .bt-salir { color: #a89fa5; }

.bt-principal { margin-left: var(--bt-lateral); min-height: 100vh; display: flex; flex-direction: column; min-width: 0; }
.bt-barra-movil { display: none; }
.bt-contenido { min-width: 0; width: 100%; max-width: 1320px; padding: 30px 36px 60px; }
.bt-velo { display: none; }

/* Cabecera de cada página */
.bt-cabecera { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 14px 20px; margin-bottom: 24px; }
.bt-cabecera h1 { margin: 0; }
.bt-cabecera .bt-sub { margin: 4px 0 0; color: var(--bt-apagado); }
.bt-cabecera-acciones { display: flex; flex-wrap: wrap; gap: 8px; }
.bt-migas { font-size: .85rem; margin-bottom: 6px; }
.bt-migas a { display: inline-flex; align-items: center; gap: 4px; color: var(--bt-apagado); }
.bt-migas a:hover { color: var(--bt-granate); }

/* Móvil y tablet vertical: el lateral se esconde y se abre con el botón */
@media (max-width: 991.98px) {
    .bt-lateral { transform: translateX(-100%); transition: transform .22s ease; box-shadow: var(--bt-sombra-g); }
    .bt-menu-abierto .bt-lateral { transform: none; }
    .bt-menu-abierto .bt-velo { display: block; position: fixed; inset: 0; z-index: 1030; background: rgba(20, 14, 18, .45); }
    .bt-principal { margin-left: 0; }
    .bt-barra-movil {
        display: flex; align-items: center; gap: 12px;
        position: sticky; top: 0; z-index: 1020;
        height: 58px; padding: 0 14px;
        background: var(--bt-superficie); border-bottom: 1px solid var(--bt-borde);
    }
    .bt-barra-movil img { height: 28px; }
    .bt-barra-movil .bt-barra-titulo { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 1; }
    .bt-boton-menu { border: 0; background: transparent; padding: 8px; border-radius: 8px; color: var(--bt-texto); display: inline-flex; cursor: pointer; }
    .bt-boton-menu:hover { background: var(--bt-gris-suave); }
    .bt-contenido { padding: 20px 16px 48px; }
    h1, .h1 { font-size: 1.35rem; }
}

/* ---------- Tarjetas ---------- */
.card { background: var(--bt-superficie); border: 1px solid var(--bt-borde); border-radius: var(--bt-radio); box-shadow: var(--bt-sombra); }
.card + .card { margin-top: 20px; }
.card-cabecera { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; padding: 16px 20px; border-bottom: 1px solid var(--bt-borde); }
.card-cabecera h2 { font-size: 1.05rem; margin: 0; }
.card-cabecera p { margin: 2px 0 0; color: var(--bt-apagado); font-size: .88rem; }
.card-cuerpo { padding: 20px; }
.card-pie { padding: 14px 20px; border-top: 1px solid var(--bt-borde); background: #fbfafb; border-radius: 0 0 var(--bt-radio) var(--bt-radio); display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.card > .tabla-envoltorio { border: 0; border-radius: 0; box-shadow: none; }
.card > .tabla-envoltorio:last-child { border-radius: 0 0 var(--bt-radio) var(--bt-radio); }
.estrecho { max-width: 760px; }
.muy-estrecho { max-width: 480px; }

/* Indicadores (KPI) */
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 24px; }
.kpi { display: flex; gap: 14px; align-items: center; padding: 16px 18px; background: var(--bt-superficie); border: 1px solid var(--bt-borde); border-radius: var(--bt-radio); box-shadow: var(--bt-sombra); color: inherit; }
a.kpi:hover { text-decoration: none; border-color: var(--bt-granate-borde); }
.kpi-icono { width: 42px; height: 42px; border-radius: 10px; display: grid; place-items: center; background: var(--bt-granate-suave); color: var(--bt-granate); flex-shrink: 0; }
.kpi-icono .icono { width: 21px; height: 21px; }
.kpi-valor { font-size: 1.55rem; font-weight: 700; line-height: 1.1; letter-spacing: -.02em; }
.kpi-etq { font-size: .84rem; color: var(--bt-apagado); }
.kpi.aviso .kpi-icono { background: var(--bt-mostaza-suave); color: var(--bt-ambar); }
.kpi.aviso { border-color: #f3d58f; }
@media (max-width: 991.98px) { .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; } .kpi { padding: 12px 14px; } .kpi-icono { width: 36px; height: 36px; } .kpi-valor { font-size: 1.3rem; } }

/* ---------- Rejilla (subconjunto de Bootstrap) ---------- */
.row { display: flex; flex-wrap: wrap; margin-left: calc(var(--g, 1.5rem) * -.5); margin-right: calc(var(--g, 1.5rem) * -.5); margin-top: calc(var(--g-y, 0) * -1); }
.row > * { flex-shrink: 0; width: 100%; max-width: 100%; padding-left: calc(var(--g, 1.5rem) * .5); padding-right: calc(var(--g, 1.5rem) * .5); margin-top: var(--g-y, 0); }
.g-2 { --g: .75rem; --g-y: .75rem; }
.g-3 { --g: 1.1rem; --g-y: 1.1rem; }
.col-12 { flex: 0 0 auto; width: 100%; }
@media (min-width: 576px) {
    .col-sm-2 { flex: 0 0 auto; width: 16.6667%; } .col-sm-3 { flex: 0 0 auto; width: 25%; } .col-sm-4 { flex: 0 0 auto; width: 33.3333%; }
    .col-sm-5 { flex: 0 0 auto; width: 41.6667%; } .col-sm-6 { flex: 0 0 auto; width: 50%; }
}
@media (min-width: 768px) {
    .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%; }
}
@media (min-width: 1200px) { .col-xl-4 { flex: 0 0 auto; width: 33.3333%; } .col-xl-8 { flex: 0 0 auto; width: 66.6667%; } }
.align-items-end { align-items: flex-end !important; }
.align-items-center { align-items: center !important; }

/* ---------- Formularios ---------- */
.form-label { display: block; margin-bottom: 6px; font-size: .88rem; font-weight: 600; color: var(--bt-texto-2); }
.form-control, .form-select {
    display: block; width: 100%;
    padding: 9px 12px;
    font: inherit; font-size: .95rem; color: var(--bt-texto);
    background-color: #fff;
    border: 1px solid var(--bt-borde-fuerte);
    border-radius: var(--bt-radio-s);
    transition: border-color .15s, box-shadow .15s;
    min-height: 40px;
}
.form-control:focus, .form-select:focus { outline: 0; border-color: var(--bt-granate); box-shadow: 0 0 0 3px rgba(137, 2, 62, .15); }
.form-control::placeholder { color: #a39aa0; }
.form-control[type=file] { padding: 7px 10px; }
.form-control[type=file]::file-selector-button { font: inherit; font-size: .88rem; margin-right: 10px; padding: 4px 10px; border: 1px solid var(--bt-borde-fuerte); border-radius: 6px; background: var(--bt-gris-suave); color: var(--bt-texto); cursor: pointer; }
textarea.form-control { min-height: 70px; resize: vertical; }
.form-select {
    appearance: none; padding-right: 36px;
    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='%23756c72' 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 12px center; background-size: 14px 10px;
}
.form-control-sm { min-height: 34px; padding: 5px 9px; font-size: .9rem; }
.form-text { margin-top: 5px; font-size: .82rem; color: var(--bt-apagado); }
.form-text.text-danger { color: var(--bt-rojo); }
.input-group { display: flex; align-items: stretch; width: 100%; }
.input-group .form-control { border-top-right-radius: 0; border-bottom-right-radius: 0; min-width: 0; flex: 1; }
.input-group-text { display: flex; align-items: center; padding: 0 12px; font-size: .9rem; color: var(--bt-apagado); background: var(--bt-gris-suave); border: 1px solid var(--bt-borde-fuerte); border-left: 0; border-radius: 0 var(--bt-radio-s) var(--bt-radio-s) 0; white-space: nowrap; }
.form-check { display: flex; align-items: flex-start; gap: 10px; }
.form-check-input { width: 18px; height: 18px; margin: 2px 0 0; flex-shrink: 0; accent-color: var(--bt-granate); cursor: pointer; }
.form-check-label { cursor: pointer; }
.caja-opcion { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border: 1px solid var(--bt-borde); border-radius: var(--bt-radio-s); background: #fbfafb; }
.caja-opcion .form-check-label { font-weight: 500; }
.caja-opcion .form-text { margin-top: 2px; }
.seccion-form { font-size: .8rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--bt-apagado); margin: 28px 0 14px; padding-top: 22px; border-top: 1px solid var(--bt-borde); }
.seccion-form:first-child { margin-top: 0; padding-top: 0; border-top: 0; }
.vista-imagen { margin-top: 10px; max-width: 160px; max-height: 90px; border-radius: 6px; border: 1px solid var(--bt-borde); padding: 4px; background: #fff; }

/* ---------- Botones ---------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 7px;
    padding: 9px 16px; min-height: 40px;
    font: inherit; font-size: .92rem; font-weight: 600; line-height: 1.2; white-space: nowrap;
    color: var(--bt-texto); background: #fff;
    border: 1px solid var(--bt-borde-fuerte); border-radius: var(--bt-radio-s);
    cursor: pointer; text-decoration: none; user-select: none;
    transition: background-color .15s, border-color .15s, color .15s, box-shadow .15s;
}
.btn:hover { text-decoration: none; background: var(--bt-gris-suave); color: var(--bt-texto); }
.btn:focus-visible { outline: 0; box-shadow: 0 0 0 3px rgba(137, 2, 62, .25); }
.btn .icono { width: 16px; height: 16px; }
.btn-primary, .btn-success { background: var(--bt-granate); border-color: var(--bt-granate); color: #fff; }
.btn-primary:hover, .btn-success:hover { background: var(--bt-granate-osc); border-color: var(--bt-granate-osc); color: #fff; }
.btn-confirmar { background: var(--bt-verde); border-color: var(--bt-verde); color: #fff; }
.btn-confirmar:hover { background: #17643f; border-color: #17643f; color: #fff; }
.btn-danger { background: var(--bt-rojo); border-color: var(--bt-rojo); color: #fff; }
.btn-danger:hover { background: #8f1c13; border-color: #8f1c13; color: #fff; }
.btn-secondary, .btn-outline-secondary, .btn-warning, .btn-outline-primary { background: #fff; color: var(--bt-texto); border-color: var(--bt-borde-fuerte); }
.btn-outline-danger { background: #fff; color: var(--bt-rojo); border-color: #efc2bd; }
.btn-outline-danger:hover { background: var(--bt-rojo-suave); color: var(--bt-rojo); border-color: #e3a39b; }
.btn-outline-success { background: #fff; color: var(--bt-verde); border-color: #b9dcc8; }
.btn-outline-success:hover { background: var(--bt-verde-suave); color: var(--bt-verde); }
.btn-fantasma { background: transparent; border-color: transparent; color: var(--bt-texto-2); }
.btn-fantasma:hover { background: var(--bt-gris-suave); }
.btn-link { background: none; border: 0; min-height: 0; padding: 0; color: var(--bt-granate); font-weight: 500; }
.btn-link:hover { background: none; text-decoration: underline; color: var(--bt-granate-osc); }
.btn-sm { min-height: 32px; padding: 5px 11px; font-size: .84rem; border-radius: 6px; }
.btn-icono { padding: 0; width: 32px; min-height: 32px; }
.w-100 { width: 100% !important; }
.acciones { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.acciones form { display: inline-flex; margin: 0; }

/* ---------- Tablas ---------- */
.tabla-envoltorio, .table-responsive { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; background: var(--bt-superficie); border: 1px solid var(--bt-borde); border-radius: var(--bt-radio); box-shadow: var(--bt-sombra); }
.table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.table th, .table td { padding: 12px 16px; text-align: left; vertical-align: middle; border-bottom: 1px solid var(--bt-borde); }
.table thead th { font-size: .74rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--bt-apagado); background: #fbfafb; white-space: nowrap; }
.table tbody tr:last-child td, .table tbody tr:last-child th { border-bottom: 0; }
.table tbody tr:hover { background: #fcfafb; }
.table .apagada td { color: var(--bt-apagado); }
.table .col-num { text-align: right; font-variant-numeric: tabular-nums; }
.table .col-acc { text-align: right; width: 1%; white-space: nowrap; }
.table .col-acc .acciones { justify-content: flex-end; flex-wrap: nowrap; }
.celda-principal { font-weight: 600; color: var(--bt-texto); }
.celda-sub { display: block; font-size: .82rem; color: var(--bt-apagado); }
.fecha-corta { color: var(--bt-apagado); font-size: .85rem; margin-right: 6px; }
.hora-grande { font-weight: 700; font-size: 1rem; font-variant-numeric: tabular-nums; }
.nota { display: flex; gap: 6px; align-items: flex-start; margin-top: 6px; padding: 5px 9px; border-radius: 6px; background: var(--bt-mostaza-suave); color: #6b4300; font-size: .82rem; max-width: 360px; }
.nota .icono { width: 14px; height: 14px; margin-top: 2px; }
.pax { white-space: nowrap; display: inline-flex; align-items: center; gap: 4px; font-weight: 600; font-variant-numeric: tabular-nums; }

/* Tablas que en el móvil pasan a tarjetas: cada celda lleva data-etq */
@media (max-width: 767.98px) {
    .tabla-tarjetas { border: 0; background: transparent; box-shadow: none; overflow: visible; }
    .card > .tabla-tarjetas { padding: 12px; }
    .tabla-tarjetas table, .tabla-tarjetas tbody, .tabla-tarjetas tr, .tabla-tarjetas td { display: block; width: 100%; }
    .tabla-tarjetas thead { display: none; }
    .tabla-tarjetas tr { display: flex; flex-direction: column; background: var(--bt-superficie); border: 1px solid var(--bt-borde); border-radius: var(--bt-radio); box-shadow: var(--bt-sombra); padding: 12px 14px; margin-bottom: 12px; }
    .tabla-tarjetas tbody tr:hover { background: var(--bt-superficie); }
    .tabla-tarjetas td { border: 0; padding: 5px 0; display: flex; gap: 12px; justify-content: space-between; align-items: flex-start; text-align: right; }
    .tabla-tarjetas td::before { content: attr(data-etq); flex-shrink: 0; font-size: .78rem; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--bt-apagado); text-align: left; padding-top: 2px; }
    .tabla-tarjetas td.td-titulo { order: -1; display: block; text-align: left; padding-bottom: 8px; margin-bottom: 4px; border-bottom: 1px solid var(--bt-borde); }
    .tabla-tarjetas td.td-titulo::before { display: none; }
    .tabla-tarjetas td.col-acc { width: 100%; display: block; padding-top: 10px; }
    .tabla-tarjetas td.col-acc::before { display: none; }
    .tabla-tarjetas td.col-acc .acciones { justify-content: stretch; flex-wrap: wrap; }
    .tabla-tarjetas td.col-acc .acciones > .btn, .tabla-tarjetas td.col-acc .acciones > form { flex: 1 1 auto; }
    .tabla-tarjetas td.col-acc .acciones form .btn { width: 100%; }
    .tabla-tarjetas td .form-control { max-width: 60%; }
    .tabla-tarjetas .nota { margin-left: auto; }
}

/* ---------- Etiquetas de estado ---------- */
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 20px; font-size: .76rem; font-weight: 600; line-height: 1.4; white-space: nowrap; background: var(--bt-gris-suave); color: var(--bt-texto-2); }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .85; }
.badge.sin-punto::before { display: none; }
.text-bg-success { background: var(--bt-verde-suave); color: var(--bt-verde); }
.text-bg-warning { background: var(--bt-ambar-suave); color: var(--bt-ambar); }
.text-bg-danger { background: var(--bt-rojo-suave); color: var(--bt-rojo); }
.text-bg-info, .text-bg-primary { background: var(--bt-azul-suave); color: var(--bt-azul); }
.text-bg-secondary, .text-bg-dark, .text-bg-light { background: var(--bt-gris-suave); color: var(--bt-texto-2); }
.etiqueta-origen { display: inline-flex; align-items: center; gap: 4px; margin-left: 6px; padding: 1px 7px; border-radius: 5px; font-size: .72rem; font-weight: 600; color: var(--bt-apagado); background: var(--bt-gris-suave); vertical-align: 1px; }
.etiqueta-origen .icono { width: 12px; height: 12px; }

/* ---------- Avisos ---------- */
.alert { display: flex; gap: 10px; align-items: flex-start; padding: 12px 16px; margin-bottom: 20px; border: 1px solid transparent; border-radius: var(--bt-radio-s); font-size: .93rem; }
.alert .icono { margin-top: 1px; }
.alert-success { background: var(--bt-verde-suave); border-color: #bfe0cd; color: #155a3b; }
.alert-danger { background: var(--bt-rojo-suave); border-color: #f2c3be; color: #8a1c13; }
.alert-warning { background: var(--bt-ambar-suave); border-color: #f1d48f; color: #6b4300; }
.alert-info { background: var(--bt-azul-suave); border-color: #c5d8f1; color: #174a82; }
.alert a { font-weight: 600; color: inherit; text-decoration: underline; }

/* ---------- Pestañas ---------- */
.pestanas { display: flex; gap: 4px; border-bottom: 1px solid var(--bt-borde); margin-bottom: 18px; overflow-x: auto; scrollbar-width: none; }
.pestanas::-webkit-scrollbar { display: none; }
.pestana {
    display: inline-flex; align-items: center; gap: 8px; flex-shrink: 0;
    padding: 10px 14px; margin-bottom: -1px;
    font: inherit; font-weight: 600; font-size: .93rem; color: var(--bt-apagado);
    background: none; border: 0; border-bottom: 2px solid transparent; cursor: pointer;
}
.pestana:hover { color: var(--bt-texto); }
.pestana.activa { color: var(--bt-granate); border-bottom-color: var(--bt-granate); }
.pestana .badge { font-size: .72rem; padding: 1px 8px; }
.pestana .badge::before { display: none; }
.panel-pestana { display: none; }
.panel-pestana.activa { display: block; }

/* ---------- Estado vacío ---------- */
.vacio { text-align: center; padding: 42px 20px; color: var(--bt-apagado); background: var(--bt-superficie); border: 1px dashed var(--bt-borde-fuerte); border-radius: var(--bt-radio); }
.card .vacio { border: 0; border-radius: 0; background: transparent; }
.vacio .icono { width: 30px; height: 30px; color: #b8aeb4; margin-bottom: 8px; }
.vacio p { margin: 0; }

/* ---------- Calendario de reservas ---------- */
.cal-barra { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--bt-borde); }
.cal-barra h2 { margin: 0; font-size: 1.1rem; text-transform: capitalize; }
.cal-nav { display: flex; gap: 6px; }
.calendario { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.cal-cab { padding: 9px 10px; font-size: .74rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--bt-apagado); background: #fbfafb; border-bottom: 1px solid var(--bt-borde); }
.cal-dia {
    min-height: 118px; padding: 6px 6px 8px; text-align: left;
    border: 0; border-radius: 0;
    border-right: 1px solid var(--bt-borde); border-bottom: 1px solid var(--bt-borde);
    background: #fff; font: inherit; color: inherit; cursor: pointer; min-width: 0;
    display: flex; flex-direction: column; gap: 3px;
}
.cal-dia:nth-child(7n) { border-right: 0; }
.cal-dia:hover { background: #fcf7f9; }
.cal-dia.fuera { background: #faf9fa; cursor: default; }
.cal-dia.pasado .cal-num { color: #b0a7ac; }
.cal-dia.seleccionado { box-shadow: inset 0 0 0 2px var(--bt-granate); }
.cal-num { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; font-size: .85rem; font-weight: 600; color: var(--bt-texto-2); }
.cal-dia.hoy .cal-num { background: var(--bt-granate); color: #fff; }
.cal-ev { display: block; padding: 2px 6px; border-radius: 5px; font-size: .76rem; line-height: 1.35; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; background: var(--bt-verde-suave); color: #155a3b; border-left: 3px solid var(--bt-verde); }
.cal-ev.pendiente { background: var(--bt-ambar-suave); color: #6b4300; border-left-color: var(--bt-mostaza); }
.cal-ev.pasada { background: var(--bt-gris-suave); color: var(--bt-apagado); border-left-color: #c5bdc2; }
.cal-mas { font-size: .74rem; font-weight: 600; color: var(--bt-apagado); padding-left: 4px; }
.cal-resumen { display: none; }
.cal-leyenda { display: flex; flex-wrap: wrap; gap: 14px; padding: 12px 18px; border-top: 1px solid var(--bt-borde); font-size: .8rem; color: var(--bt-apagado); }
.cal-leyenda span { display: inline-flex; align-items: center; gap: 6px; }
.cal-leyenda i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.cal-detalle { border-top: 1px solid var(--bt-borde); }
.cal-detalle-tit { padding: 14px 18px 4px; font-weight: 650; }
.cal-lista { list-style: none; margin: 0; padding: 4px 10px 12px; }
.cal-lista li { display: flex; gap: 12px; align-items: center; padding: 9px 8px; border-bottom: 1px solid var(--bt-borde); }
.cal-lista li:last-child { border-bottom: 0; }
.cal-lista .hora-grande { width: 50px; }
.cal-lista .quien { flex: 1; min-width: 0; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 767.98px) {
    .cal-dia { min-height: 56px; padding: 4px 2px; align-items: center; }
    .cal-ev, .cal-mas { display: none; }
    .cal-resumen { display: block; min-width: 20px; padding: 0 6px; border-radius: 10px; background: var(--bt-verde-suave); color: var(--bt-verde); font-size: .72rem; font-weight: 700; text-align: center; }
    .cal-resumen.pendiente { background: var(--bt-ambar-suave); color: var(--bt-ambar); }
    .cal-cab { padding: 8px 2px; text-align: center; font-size: .68rem; }
    .cal-lista li { flex-wrap: wrap; gap: 6px 10px; }
    .cal-lista .quien { flex: 1 1 calc(100% - 62px); }
    .cal-lista .pax { margin-left: 62px; }
    .cal-lista .btn { margin-left: auto; }
}

/* ---------- Horario semanal ---------- */
.horario-envoltorio { max-height: 70vh; overflow: auto; }
@media (min-width: 992px) { .horario-envoltorio { max-height: none; overflow: visible; } }
.horario { border-collapse: separate; border-spacing: 0; width: 100%; font-size: .88rem; }
.horario th, .horario td { padding: 6px 8px; text-align: center; border-bottom: 1px solid var(--bt-borde); }
.horario thead th { position: sticky; top: 0; z-index: 2; background: #fbfafb; font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; color: var(--bt-texto-2); vertical-align: bottom; }
.horario tbody th { position: sticky; left: 0; z-index: 1; background: #fff; font-weight: 600; font-variant-numeric: tabular-nums; color: var(--bt-texto-2); text-align: left; padding-left: 16px; width: 70px; }
.horario .dia-acc { display: block; margin-top: 3px; font-size: .74rem; font-weight: 500; text-transform: none; letter-spacing: 0; white-space: nowrap; }
.horario .dia-acc button { background: none; border: 0; padding: 0 2px; font: inherit; color: var(--bt-granate); cursor: pointer; }
.horario .dia-acc button:hover { text-decoration: underline; }
.hueco { position: relative; display: inline-block; cursor: pointer; }
.hueco input { position: absolute; opacity: 0; pointer-events: none; }
.hueco span { display: inline-block; width: 34px; height: 24px; border-radius: 6px; border: 1px solid var(--bt-borde-fuerte); background: #fff; transition: background .12s, border-color .12s; }
.hueco:hover span { border-color: var(--bt-granate); }
.hueco input:checked + span { background: var(--bt-granate); border-color: var(--bt-granate); 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='%23fff' stroke-linecap='round' stroke-linejoin='round' stroke-width='2.4' d='m4 8.5 2.5 2.5L12 5.5'/%3e%3c/svg%3e"); background-repeat: no-repeat; background-position: center; background-size: 14px; }
.hueco input:focus-visible + span { box-shadow: 0 0 0 3px rgba(137, 2, 62, .25); }
.horario tr.cambio-franja th, .horario tr.cambio-franja td { border-top: 2px solid var(--bt-borde-fuerte); }
.horario tfoot td, .horario tfoot th { position: sticky; bottom: 0; background: #fbfafb; font-size: .78rem; color: var(--bt-apagado); font-weight: 600; border-top: 1px solid var(--bt-borde); border-bottom: 0; }

/* ---------- Resumen de una reserva (confirmar / cancelar) ---------- */
.ficha-reserva { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 24px; }
.ficha-reserva dt { font-size: .76rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--bt-apagado); margin-bottom: 2px; }
.ficha-reserva dd { margin: 0; font-weight: 600; }
.ficha-reserva .ancho { grid-column: 1 / -1; }
@media (max-width: 575.98px) { .ficha-reserva { grid-template-columns: 1fr; } }

/* ---------- Inicio de sesión ---------- */
.bt-login { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); background: var(--bt-superficie); }
.bt-login-marca {
    position: relative; overflow: hidden;
    display: flex; flex-direction: column; justify-content: space-between;
    padding: 48px 56px; color: #fff;
    background: radial-gradient(circle at 85% 15%, rgba(248, 178, 51, .28), transparent 42%), linear-gradient(150deg, #9c0a49 0%, var(--bt-granate) 45%, #4d0123 100%);
}
.bt-login-marca img { height: 40px; width: auto; filter: brightness(0) invert(1); align-self: flex-start; }
.bt-login-marca h2 { color: #fff; font-size: 2rem; line-height: 1.2; max-width: 420px; margin-bottom: 14px; letter-spacing: -.02em; }
.bt-login-marca p { color: rgba(255,255,255,.8); max-width: 400px; font-size: 1.02rem; }
.bt-login-marca small { color: rgba(255,255,255,.6); }
.bt-login-form { display: flex; align-items: center; justify-content: center; padding: 40px 24px; }
.bt-login-caja { width: 100%; max-width: 380px; }
.bt-login-caja h1 { font-size: 1.6rem; margin-bottom: 6px; }
.bt-login-caja .bt-sub { color: var(--bt-apagado); margin-bottom: 26px; }
.bt-login-caja .form-control { min-height: 46px; }
.bt-login-caja .btn { min-height: 46px; font-size: 1rem; }
.bt-login-logo-movil { display: none; }
@media (max-width: 860px) {
    .bt-login { grid-template-columns: 1fr; }
    .bt-login-marca { display: none; }
    .bt-login-logo-movil { display: block; height: 38px; margin-bottom: 28px; }
    .bt-login-form { align-items: flex-start; padding-top: 12vh; }
}

/* ---------- Utilidades (subconjunto de Bootstrap) ---------- */
.d-flex { display: flex !important; }
.d-inline { display: inline !important; }
.d-inline-flex { display: inline-flex !important; }
.d-none { display: none !important; }
.d-block { display: block !important; }
.flex-wrap { flex-wrap: wrap !important; }
.justify-content-between { justify-content: space-between !important; }
.justify-content-end { justify-content: flex-end !important; }
.gap-1 { gap: .25rem !important; } .gap-2 { gap: .5rem !important; } .gap-3 { gap: 1rem !important; }
.text-muted { color: var(--bt-apagado) !important; }
.text-danger { color: var(--bt-rojo) !important; }
.text-success { color: var(--bt-verde) !important; }
.text-center { text-align: center !important; }
.text-end { text-align: right !important; }
.text-nowrap { white-space: nowrap !important; }
.fw-bold { font-weight: 700 !important; }
.m-0 { margin: 0 !important; }
.mb-0 { margin-bottom: 0 !important; } .mb-1 { margin-bottom: .25rem !important; } .mb-2 { margin-bottom: .5rem !important; } .mb-3 { margin-bottom: 1rem !important; } .mb-4 { margin-bottom: 1.5rem !important; }
.mt-0 { margin-top: 0 !important; } .mt-1 { margin-top: .25rem !important; } .mt-2 { margin-top: .5rem !important; } .mt-3 { margin-top: 1rem !important; } .mt-4 { margin-top: 1.5rem !important; } .mt-5 { margin-top: 2.5rem !important; }
.ms-auto { margin-left: auto !important; }
.visually-hidden { position: absolute !important; width: 1px !important; height: 1px !important; overflow: hidden !important; clip: rect(0,0,0,0) !important; white-space: nowrap !important; border: 0 !important; }
.nota-ancha { max-width: none; }
.card-cuerpo.con-borde { border-top: 1px solid var(--bt-borde); }
.campo-corto { max-width: 90px; }
.horario thead th.col-hora { text-align: left; padding-left: 16px; }
.medio { max-width: 960px; }
