:root {
    --hotel: #1e3a5f;
    --hotel-oscuro: #152a45;
    --hotel-claro: #e6edf6;
    --acento: #c8963e;
    --acento-oscuro: #a87a2c;
    --fondo: #f4f6f9;
    --borde: #e2e8f0;
    --texto-suave: #64748b;
}

body { background: var(--fondo); font-size: .925rem; }
.bg-hotel { background: var(--hotel) !important; }
.btn-hotel { background: var(--hotel); border-color: var(--hotel); color: #fff; }
.btn-hotel:hover, .btn-hotel:focus { background: var(--hotel-oscuro); border-color: var(--hotel-oscuro); color: #fff; }
.btn-acento { background: var(--acento); border-color: var(--acento); color: #fff; }
.btn-acento:hover, .btn-acento:focus { background: var(--acento-oscuro); border-color: var(--acento-oscuro); color: #fff; }
.text-hotel { color: var(--hotel) !important; }

/* ------------------------------------------------ Menú lateral */
.sidebar { width: 230px; min-height: calc(100vh - 48px); background: #fff; border-right: 1px solid var(--borde); }
@media (min-width: 992px) { .sidebar { flex: 0 0 230px; width: 230px; position: sticky; top: 48px; height: calc(100vh - 48px); overflow-y: auto; } }
.sidebar .nav-link { color: #334155; padding: .45rem 1rem; display: flex; gap: .6rem; align-items: center; border-left: 3px solid transparent; }
.sidebar .nav-link:hover { background: #f1f5f9; }
.sidebar .nav-link.active { background: var(--hotel-claro); color: var(--hotel); border-left-color: var(--acento); font-weight: 600; }
.sidebar .nav-titulo { font-size: .7rem; text-transform: uppercase; letter-spacing: .05em; color: var(--texto-suave); padding: .9rem 1rem .25rem; }
.contenido { min-width: 0; }

/* ------------------------------------------------ Login */
.bg-login { background: linear-gradient(135deg, var(--hotel) 0%, #0b1a2e 100%); }
.login-card { width: 100%; max-width: 380px; border: 0; }
.login-logo { width: 56px; height: 56px; border-radius: 14px; background: var(--hotel-claro); color: var(--hotel); display: inline-flex; align-items: center; justify-content: center; font-size: 1.8rem; }
.btn-farma { background: var(--hotel); border-color: var(--hotel); color: #fff; }

/* ------------------------------------------------ Indicadores y tablas */
.kpi { border: 1px solid var(--borde); border-radius: .6rem; background: #fff; padding: 1rem; height: 100%; }
.kpi .valor { font-size: 1.5rem; font-weight: 600; line-height: 1.2; }
.kpi .etiqueta { color: var(--texto-suave); font-size: .8rem; }
.card { border-color: var(--borde); }
.table > :not(caption) > * > * { padding: .45rem .6rem; }
.table thead th { font-size: .75rem; text-transform: uppercase; letter-spacing: .03em; color: var(--texto-suave); font-weight: 600; background: #f8fafc; }
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.fila-link { cursor: pointer; }
.codigo-reserva { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .05em; font-weight: 600; }

/* ------------------------------------------------ Mapa de habitaciones (rack) */
.rack-piso { margin-bottom: 1.25rem; }
.rack-piso h2 { font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; color: var(--texto-suave); margin-bottom: .5rem; }
.rack { display: grid; grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); gap: .65rem; }
.hab { border-radius: .7rem; padding: .7rem .8rem; background: #fff; border: 1px solid var(--borde); border-top-width: 5px; cursor: pointer;
       transition: transform .08s ease, box-shadow .08s ease; display: flex; flex-direction: column; min-height: 118px; position: relative; text-align: left; width: 100%; }
.hab:hover { transform: translateY(-2px); box-shadow: 0 6px 16px rgba(15, 23, 42, .08); }
.hab .num-hab { font-size: 1.45rem; font-weight: 700; line-height: 1; }
.hab .tipo { font-size: .72rem; text-transform: uppercase; letter-spacing: .04em; color: var(--texto-suave); }
.hab .estado { font-size: .75rem; font-weight: 600; margin-top: auto; display: flex; align-items: center; gap: .3rem; }
.hab .huesped { font-size: .8rem; margin-top: .35rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hab .aviso { position: absolute; top: .55rem; right: .6rem; font-size: .7rem; }
.hab-libre { border-top-color: #16a34a; } .hab-libre .estado { color: #15803d; }
.hab-ocupada { border-top-color: #dc2626; background: #fff7f7; } .hab-ocupada .estado { color: #b91c1c; }
.hab-limpieza { border-top-color: #eab308; background: #fffdf2; } .hab-limpieza .estado { color: #a16207; }
.hab-mant { border-top-color: #64748b; background: #f8fafc; } .hab-mant .estado { color: #475569; }
.leyenda span { display: inline-flex; align-items: center; gap: .35rem; margin-right: 1rem; font-size: .8rem; color: var(--texto-suave); }
.leyenda i.punto { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }

/* ------------------------------------------------ Calendario */
.cal-wrap { overflow-x: auto; background: #fff; border: 1px solid var(--borde); border-radius: .5rem; }
.cal { border-collapse: separate; border-spacing: 0; min-width: 100%; font-size: .78rem; }
.cal th, .cal td { border-right: 1px solid #eef2f7; border-bottom: 1px solid #eef2f7; padding: 0; height: 36px; min-width: 46px; text-align: center; }
.cal thead th { background: #f8fafc; font-weight: 600; color: var(--texto-suave); padding: .3rem .2rem; position: sticky; top: 0; z-index: 2; }
.cal thead th.hoy { background: var(--hotel-claro); color: var(--hotel); }
.cal thead th.finde { color: #b45309; }
.cal th.hab-col { position: sticky; left: 0; background: #fff; z-index: 3; min-width: 110px; text-align: left; padding: 0 .6rem; }
.cal td.hoy { background: #f5f8fc; }
.cal .bloque { display: block; margin: 4px 2px; padding: 2px 6px; border-radius: 6px; color: #fff; font-weight: 600; white-space: nowrap;
               overflow: hidden; text-overflow: ellipsis; text-decoration: none; line-height: 22px; text-align: left; }
.bloque.b-CONFIRMADA { background: #2563eb; }
.bloque.b-HOSPEDADO { background: #16a34a; }
.bloque.b-PENDIENTE { background: #d97706; }
.bloque.b-FINALIZADA { background: #94a3b8; }

/* ------------------------------------------------ Cobro (multipago) */
.pago-fila { background: #f8fafc; border: 1px solid var(--borde); border-radius: .4rem; padding: .5rem; }
.vuelto { font-size: 1.4rem; font-weight: 700; color: var(--hotel); }
.total-cobro { background: #0f172a; color: #fff; border-radius: .5rem; padding: .8rem 1rem; }
.total-cobro .monto { font-size: 1.9rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.producto-btn { border: 1px solid var(--borde); background: #fff; border-radius: .5rem; padding: .55rem .6rem; text-align: left; width: 100%; height: 100%; }
.producto-btn:hover { border-color: var(--hotel); background: var(--hotel-claro); }
.producto-btn .precio { font-weight: 700; color: var(--hotel); }

/* ------------------------------------------------ Ticket térmico */
.ticket { font-family: "Courier New", monospace; font-size: 12px; color: #000; margin: 0 auto; background: #fff; padding: 4mm 3mm; }
.ticket.w80 { width: 80mm; }
.ticket.w58 { width: 58mm; font-size: 10.5px; }
.ticket .c { text-align: center; }
.ticket .r { text-align: right; }
.ticket hr { border: 0; border-top: 1px dashed #000; margin: 4px 0; opacity: 1; }
.ticket table { width: 100%; border-collapse: collapse; }
.ticket td { vertical-align: top; padding: 1px 0; }
.ticket .qr svg { width: 32mm; height: 32mm; }
@media print {
    @page { margin: 0; }
    body { background: #fff; }
    .no-print { display: none !important; }
}

.aviso-demo { background: #fef3c7; color: #78350f; border-bottom: 1px solid #fcd34d; font-size: .8rem; padding: .3rem 1rem; text-align: center; }

.foto-tipo { width: 72px; height: 54px; object-fit: cover; border-radius: .4rem; background: var(--hotel-claro); display: inline-flex; align-items: center; justify-content: center; color: var(--hotel); }

@media (max-width: 767.98px) {
    .form-control, .form-select { font-size: 16px; }
    .kpi .valor { font-size: 1.2rem; }
    h1.h4 { font-size: 1.15rem; }
    .card > table, .card > .card-body > table { display: block; overflow-x: auto; white-space: nowrap; }
    .card > .table-responsive > table { white-space: nowrap; }
    .rack { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
    .ticket.w80, .ticket.w58 { max-width: 100%; }
}
