/* =====================================================================
   Panel de recepción — tinta índigo + latón de llavero
   ===================================================================== */
:root {
  --ink: #1C2440;
  --ink-2: #2A3458;
  --ink-3: #3B4670;
  --canvas: #EEF1F4;
  --surface: #FFFFFF;
  --line: #DCE1E8;
  --line-2: #E8ECF1;
  --text: #1E2433;
  --muted: #667085;
  --brass: #B8892E;
  --brass-ink: #6E4F12;
  --brass-soft: #F4E9CF;
  --danger: #B83A3A;
  --danger-soft: #F8E1E1;
  --ok: #1F7A5F;

  --st-pendiente: #B57A0C;  --st-pendiente-bg: #FBEFD3;
  --st-confirmada: #2C64A3; --st-confirmada-bg: #DDE9F7;
  --st-checkin: #1F7A5F;    --st-checkin-bg: #D5EFE6;
  --st-checkout: #6F7A8C;   --st-checkout-bg: #E6E9EE;
  --st-cancelada: #9A4545;  --st-cancelada-bg: #F3E2E2;
  --st-no_show: #8A5A9A;    --st-no_show-bg: #EEE3F3;

  --display: 'Bricolage Grotesque', 'Segoe UI', system-ui, sans-serif;
  --body: 'Instrument Sans', 'Segoe UI', system-ui, sans-serif;

  --r-sm: 6px;
  --r: 10px;
  --r-lg: 16px;
  --shadow-pop: 0 18px 50px -12px rgba(28, 36, 64, .35);
  --cell: 46px;
  --side: 232px;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font: 15px/1.5 var(--body);
  color: var(--text);
  background: var(--canvas);
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--ink-3); }
h1, h2, h3 { font-family: var(--display); font-weight: 650; line-height: 1.2; margin: 0; letter-spacing: -0.01em; }
h1 { font-size: 1.6rem; }
h2 { font-size: 1.15rem; }
h3 { font-size: 1rem; }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
:focus-visible { outline: 2px solid var(--brass); outline-offset: 2px; }
[hidden] { display: none !important; }

/* ---------------- Shell ---------------- */
.shell { display: grid; grid-template-columns: var(--side) 1fr; min-height: 100vh; }
.side {
  background: var(--ink);
  color: #C9CFE0;
  padding: 22px 14px;
  display: flex; flex-direction: column; gap: 22px;
  position: sticky; top: 0; height: 100vh;
}
.brand { display: flex; gap: 12px; align-items: center; padding: 0 8px; }
.brand .tag-icon { width: 30px; height: 40px; flex: none; }
.brand b { font-family: var(--display); font-weight: 650; color: #fff; font-size: 1.05rem; display: block; line-height: 1.15; }
.brand span { font-size: .78rem; color: #8D96B3; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a {
  display: flex; align-items: center; gap: 12px;
  padding: 9px 12px; border-radius: var(--r-sm);
  color: #C9CFE0; text-decoration: none; font-weight: 500;
}
.nav a svg { width: 18px; height: 18px; flex: none; opacity: .8; }
.nav a:hover { background: var(--ink-2); color: #fff; }
.nav a[aria-current="page"] { background: var(--ink-2); color: #fff; box-shadow: inset 3px 0 0 var(--brass); }
.side-foot { margin-top: auto; padding: 0 8px; font-size: .85rem; }
.side-foot button { background: none; border: 0; color: #8D96B3; padding: 0; cursor: pointer; text-decoration: underline; }

.main { min-width: 0; padding: 26px 32px 60px; }
.topbar { display: flex; align-items: center; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.topbar h1 { margin-right: auto; }
.topbar .sub { font-size: .9rem; color: var(--muted); font-family: var(--body); font-weight: 400; margin-left: 4px; }

/* ---------------- Botones y campos ---------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 38px; padding: 0 16px; border-radius: var(--r-sm);
  border: 1px solid var(--line); background: var(--surface);
  font-weight: 600; font-size: .92rem; cursor: pointer; white-space: nowrap;
  text-decoration: none; color: var(--text);
}
.btn:hover { border-color: #C3CAD5; background: #F8F9FB; }
.btn svg { width: 16px; height: 16px; }
.btn.primary { background: var(--ink); border-color: var(--ink); color: #fff; }
.btn.primary:hover { background: var(--ink-2); }
.btn.brass { background: var(--brass); border-color: var(--brass); color: #fff; }
.btn.brass:hover { background: #A57A27; }
.btn.danger { color: var(--danger); }
.btn.danger:hover { background: var(--danger-soft); border-color: #E7BCBC; }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.ghost:hover { background: rgba(28,36,64,.06); }
.btn.sm { height: 30px; padding: 0 11px; font-size: .84rem; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

label.f { display: flex; flex-direction: column; gap: 5px; font-size: .84rem; font-weight: 600; color: #3E465A; }
label.f > span.hint { font-weight: 400; color: var(--muted); }
.in, select.in, textarea.in {
  height: 38px; padding: 0 11px; border: 1px solid var(--line); border-radius: var(--r-sm);
  background: var(--surface); font-weight: 400; font-size: .95rem; width: 100%; min-width: 0;
}
textarea.in { height: auto; min-height: 72px; padding: 9px 11px; resize: vertical; }
.in:focus { outline: none; border-color: var(--ink-3); box-shadow: 0 0 0 3px rgba(59,70,112,.15); }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 14px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px 14px; }
.grid4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px 14px; }
.span2 { grid-column: span 2; }
.span-all { grid-column: 1 / -1; }
.check { display: flex; gap: 8px; align-items: center; font-size: .92rem; cursor: pointer; }

/* ---------------- Superficies ---------------- */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); }
.panel > header { display: flex; align-items: center; gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--line-2); }
.panel > header h2 { margin-right: auto; }
.panel > .body { padding: 16px 18px; }
.panel > .body.flush { padding: 0; }

.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 2px 9px; border-radius: 999px; font-size: .78rem; font-weight: 600; white-space: nowrap;
}
.chip::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.chip.pendiente  { color: var(--st-pendiente);  background: var(--st-pendiente-bg); }
.chip.confirmada { color: var(--st-confirmada); background: var(--st-confirmada-bg); }
.chip.checkin    { color: var(--st-checkin);    background: var(--st-checkin-bg); }
.chip.checkout   { color: var(--st-checkout);   background: var(--st-checkout-bg); }
.chip.cancelada  { color: var(--st-cancelada);  background: var(--st-cancelada-bg); }
.chip.no_show    { color: var(--st-no_show);    background: var(--st-no_show-bg); }
.chip.plain::before { display: none; }
.chip.plain { background: var(--line-2); color: #4A5368; }

/* ---------------- Tablas ---------------- */
table.t { width: 100%; border-collapse: collapse; font-size: .92rem; }
table.t th { text-align: left; font-weight: 600; font-size: .8rem; color: var(--muted); padding: 10px 14px; border-bottom: 1px solid var(--line); background: #FAFBFC; white-space: nowrap; }
table.t td { padding: 10px 14px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
table.t tr.click { cursor: pointer; }
table.t tr.click:hover td { background: #F7F9FB; }
table.t td.r, table.t th.r { text-align: right; }
.table-wrap { overflow-x: auto; }
.empty { padding: 34px 18px; text-align: center; color: var(--muted); }
.empty .btn { margin-top: 12px; }

/* ---------------- Hoy ---------------- */
.today-head { display: grid; grid-template-columns: 300px 1fr; gap: 18px; margin-bottom: 18px; }
.occ-card { padding: 20px; display: flex; gap: 20px; align-items: center; }
.ring { --p: 0; width: 112px; height: 112px; border-radius: 50%; flex: none;
  background: conic-gradient(var(--brass) calc(var(--p) * 1%), var(--line-2) 0);
  display: grid; place-items: center; }
.ring > div { width: 84px; height: 84px; border-radius: 50%; background: var(--surface); display: grid; place-items: center; text-align: center; }
.ring b { font-family: var(--display); font-size: 1.7rem; font-weight: 750; line-height: 1; }
.ring small { display: block; font-size: .72rem; color: var(--muted); }
.occ-card dl { margin: 0; display: grid; grid-template-columns: auto auto; gap: 4px 14px; font-size: .9rem; }
.occ-card dt { color: var(--muted); }
.occ-card dd { margin: 0; font-weight: 600; text-align: right; }
.week-bars { padding: 16px 18px 12px; display: grid; grid-template-columns: repeat(14, 1fr); gap: 6px; align-items: end; height: 170px; }
.week-bars .bar { display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; justify-content: flex-end; }
.week-bars .bar .fill { max-height: calc(100% - 48px); }
.week-bars .fill { width: 100%; max-width: 30px; background: var(--ink-3); border-radius: 4px 4px 2px 2px; min-height: 3px; }
.week-bars .bar.today .fill { background: var(--brass); }
.week-bars .bar.wknd span { color: var(--ink); font-weight: 600; }
.week-bars span { font-size: .72rem; color: var(--muted); line-height: 1.1; text-align: center; }
.week-bars em { font-style: normal; font-size: .72rem; font-weight: 600; }
.cols3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin-bottom: 18px; }
.mini-list { list-style: none; margin: 0; padding: 0; }
.mini-list li { display: flex; align-items: center; gap: 12px; padding: 11px 18px; border-bottom: 1px solid var(--line-2); cursor: pointer; }
.mini-list li:last-child { border-bottom: 0; }
.mini-list li:hover { background: #F7F9FB; }
.mini-list .who { flex: 1; min-width: 0; }
.mini-list .who b { display: block; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mini-list .who span { font-size: .82rem; color: var(--muted); }
.count { font-family: var(--display); font-weight: 650; color: var(--muted); font-size: .95rem; }

/* Etiqueta tipo llavero de hotel */
.keytag {
  position: relative; flex: none;
  width: 44px; height: 54px; border-radius: 10px 10px 14px 14px;
  background: var(--brass-soft); border: 1px solid #E2CFA2; color: var(--brass-ink);
  display: flex; align-items: flex-end; justify-content: center; padding-bottom: 7px;
  font-family: var(--display); font-weight: 750; font-size: .95rem; letter-spacing: -.02em;
}
.keytag::before { content: ''; position: absolute; top: 8px; left: 50%; width: 9px; height: 9px; margin-left: -4.5px; border-radius: 50%; background: var(--canvas); border: 1px solid #E2CFA2; }
.keytag.sm { width: 34px; height: 42px; font-size: .8rem; padding-bottom: 5px; border-radius: 8px 8px 11px 11px; }
.keytag.sm::before { top: 6px; width: 7px; height: 7px; margin-left: -3.5px; }
.keytag.off { background: #E9EBEF; border-color: #D3D7DE; color: #79808F; }
.keytag.off::before { border-color: #D3D7DE; }

.hk-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; padding: 16px 18px; }
.hk { display: flex; gap: 12px; align-items: center; padding: 10px; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--surface); cursor: pointer; text-align: left; }
.hk:hover { border-color: #C3CAD5; }
.hk b { display: block; font-weight: 600; font-size: .9rem; }
.hk-state { font-size: .8rem; display: inline-flex; gap: 6px; align-items: center; }
.hk-state::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.hk-state.limpia { color: var(--ok); }
.hk-state.sucia { color: var(--danger); }
.hk-state.inspeccion { color: var(--st-pendiente); }

/* ---------------- Mapa de disponibilidad ---------------- */
.map-tools { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.map-tools .range { font-family: var(--display); font-weight: 650; font-size: 1.05rem; min-width: 210px; text-align: center; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: var(--r-sm); overflow: hidden; background: var(--surface); }
.seg button { border: 0; background: none; height: 36px; padding: 0 12px; cursor: pointer; font-weight: 600; font-size: .85rem; color: var(--muted); }
.seg button[aria-pressed="true"] { background: var(--ink); color: #fff; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; margin-left: auto; font-size: .8rem; color: var(--muted); }
.legend i { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }

.map { overflow: auto; max-height: calc(100vh - 190px); border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); position: relative; user-select: none; -webkit-user-select: none; }
.map-grid { display: grid; grid-template-columns: max-content max-content; position: relative; }
.map-head { display: flex; position: sticky; top: 0; z-index: 3; background: var(--surface); }
.map-lane { display: flex; position: relative; }
.map-corner, .map-day, .map-room, .map-cell { border-right: 1px solid var(--line-2); border-bottom: 1px solid var(--line-2); }
.map-corner { position: sticky; left: 0; top: 0; z-index: 6; background: var(--surface); padding: 10px 14px; font-size: .78rem; color: var(--muted); display: flex; align-items: flex-end; }
.map-day { position: relative; flex: none; background: var(--surface); text-align: center; padding: 6px 0 7px; width: var(--cell); }
.map-day .season { position: absolute; left: 0; right: 0; top: 0; height: 4px; }
.map-day small { display: block; font-size: .68rem; color: var(--muted); text-transform: lowercase; }
.map-day b { font-family: var(--display); font-weight: 650; font-size: 1rem; line-height: 1.1; }
.map-day.wknd { background: #F6F7F9; }
.map-day.today b { color: #fff; background: var(--brass); border-radius: 6px; padding: 0 6px; }
.map-day.month-start { border-left: 2px solid var(--ink-3); }
.map-room {
  position: sticky; left: 0; z-index: 4; background: var(--surface);
  display: flex; gap: 10px; align-items: center; padding: 6px 12px 6px 10px; min-width: 176px; height: 64px;
}
.map-room .info b { display: block; font-size: .88rem; font-weight: 600; line-height: 1.2; }
.map-room .info span { font-size: .75rem; color: var(--muted); }
.map-cell { height: 64px; width: var(--cell); flex: none; cursor: cell; }
.map-cell.wknd { background: #FAFBFC; }
.map-cell.today { background: rgba(184,137,46,.07); }
.map-cell.sel { background: rgba(59,70,112,.16); }
.map-cell.month-start { border-left: 2px solid var(--ink-3); }

.bk {
  position: absolute; height: 44px; margin-top: 10px; z-index: 2;
  border-radius: 8px; padding: 4px 9px; overflow: hidden; cursor: pointer;
  display: flex; flex-direction: column; justify-content: center;
  font-size: .8rem; line-height: 1.2; border: 1px solid transparent;
  transition: box-shadow .12s;
}
.bk:hover { box-shadow: 0 6px 16px -6px rgba(28,36,64,.45); z-index: 3; }
.bk b { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bk span { font-size: .72rem; opacity: .85; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bk.pendiente  { background: var(--st-pendiente-bg); color: #6B4A08; border-color: #EBCF8F; border-style: dashed; }
.bk.confirmada { background: var(--st-confirmada); color: #fff; }
.bk.checkin    { background: var(--st-checkin); color: #fff; }
.bk.checkout   { background: var(--st-checkout-bg); color: #4A5263; border-color: #D3D8E0; }
.bk.owes::after { content: ''; position: absolute; right: 7px; top: 7px; width: 7px; height: 7px; border-radius: 50%; background: #F2B544; box-shadow: 0 0 0 2px rgba(255,255,255,.7); }
.bk.cut-l { border-top-left-radius: 0; border-bottom-left-radius: 0; }
.bk.cut-r { border-top-right-radius: 0; border-bottom-right-radius: 0; }
.blk {
  position: absolute; height: 44px; margin-top: 10px; z-index: 2; border-radius: 8px; cursor: pointer;
  background: repeating-linear-gradient(135deg, #E6E9EE 0 6px, #F3F4F7 6px 12px);
  border: 1px solid #D3D8E0; color: #5A6274; font-size: .76rem; padding: 4px 9px; display: flex; align-items: center; overflow: hidden; white-space: nowrap;
}

/* ---------------- Drawer y modal ---------------- */
.scrim { position: fixed; inset: 0; background: rgba(20, 26, 46, .38); z-index: 40; animation: fade .15s ease-out; }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; width: min(560px, 100vw); z-index: 41;
  background: var(--canvas); box-shadow: var(--shadow-pop); display: flex; flex-direction: column;
  animation: slide .2s ease-out;
}
.drawer > header { background: var(--surface); padding: 18px 22px 16px; border-bottom: 1px solid var(--line); }
.drawer .dh-top { display: flex; gap: 10px; align-items: center; margin-bottom: 6px; }
.drawer .code { font-family: var(--display); font-weight: 650; letter-spacing: .04em; color: var(--muted); font-size: .9rem; }
.drawer .close { margin-left: auto; }
.drawer h2 { font-size: 1.35rem; }
.drawer .stay-line { color: var(--muted); font-size: .9rem; margin-top: 2px; }
.drawer .actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; }
.drawer .scroll { overflow-y: auto; padding: 16px 22px 40px; display: flex; flex-direction: column; gap: 14px; }
.drawer .panel > header { padding: 12px 16px; }
.drawer .panel > .body { padding: 14px 16px; }
.kv { display: grid; grid-template-columns: 130px 1fr; gap: 6px 12px; font-size: .92rem; margin: 0; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; }
.folio-lines { width: 100%; border-collapse: collapse; font-size: .9rem; }
.folio-lines td { padding: 6px 0; border-bottom: 1px dashed var(--line-2); }
.folio-lines td.r { text-align: right; white-space: nowrap; }
.folio-lines td.x { width: 28px; text-align: right; }
.folio-lines .group td { padding-top: 12px; font-size: .78rem; color: var(--muted); font-weight: 600; border-bottom: 0; }
.totals { margin-top: 12px; display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; font-size: .92rem; }
.totals .big { font-family: var(--display); font-weight: 750; font-size: 1.3rem; }
.totals .neg { color: var(--ok); }
.totals .pos { color: var(--danger); }
.inline-form { display: grid; gap: 8px; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line-2); }
.inline-form .row { display: grid; grid-template-columns: 2fr 1fr 1fr auto; gap: 8px; }
.icon-x { border: 0; background: none; color: var(--muted); cursor: pointer; padding: 2px 4px; border-radius: 4px; font-size: 1rem; line-height: 1; }
.icon-x:hover { background: var(--danger-soft); color: var(--danger); }
.alert { padding: 10px 14px; border-radius: var(--r-sm); font-size: .88rem; background: var(--brass-soft); color: var(--brass-ink); border: 1px solid #E7D4A6; }
.alert.danger { background: var(--danger-soft); color: var(--danger); border-color: #EBC4C4; }

.modal-wrap { position: fixed; inset: 0; z-index: 50; display: grid; place-items: start center; overflow-y: auto; padding: 5vh 16px; }
.modal { background: var(--surface); border-radius: var(--r-lg); width: min(760px, 100%); box-shadow: var(--shadow-pop); animation: pop .16s ease-out; position: relative; z-index: 51; }
.modal.narrow { width: min(460px, 100%); }
.modal > header { display: flex; align-items: center; padding: 18px 22px; border-bottom: 1px solid var(--line-2); }
.modal > header h2 { margin-right: auto; font-size: 1.25rem; }
.modal > .body { padding: 20px 22px; display: flex; flex-direction: column; gap: 18px; }
.modal > footer { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 22px; border-top: 1px solid var(--line-2); background: #FAFBFC; border-radius: 0 0 var(--r-lg) var(--r-lg); }
.modal fieldset { border: 0; padding: 0; margin: 0; }
.modal legend { font-family: var(--display); font-weight: 650; font-size: .98rem; margin-bottom: 10px; padding: 0; }

.room-pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.room-opt { display: flex; gap: 10px; align-items: center; padding: 8px 10px; border: 1px solid var(--line); border-radius: var(--r-sm); cursor: pointer; background: var(--surface); text-align: left; }
.room-opt:hover { border-color: #C3CAD5; }
.room-opt[aria-pressed="true"] { border-color: var(--ink); box-shadow: 0 0 0 2px var(--ink) inset; }
.room-opt b { display: block; font-size: .88rem; }
.room-opt span { font-size: .76rem; color: var(--muted); }
.quote-box { display: flex; align-items: baseline; gap: 14px; padding: 12px 14px; border-radius: var(--r-sm); background: var(--canvas); flex-wrap: wrap; }
.quote-box .total { font-family: var(--display); font-weight: 750; font-size: 1.35rem; }
.suggest { position: relative; }
.suggest ul { position: absolute; z-index: 5; left: 0; right: 0; top: 100%; margin: 4px 0 0; padding: 4px; list-style: none; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-sm); box-shadow: var(--shadow-pop); max-height: 240px; overflow-y: auto; }
.suggest li { padding: 8px 10px; border-radius: 5px; cursor: pointer; font-size: .9rem; }
.suggest li:hover, .suggest li.on { background: var(--canvas); }
.guest-picked { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--r-sm); background: #FAFBFC; }
.guest-picked div { flex: 1; }

/* ---------------- Habitaciones / tarifas / ajustes ---------------- */
.room-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; }
.room-card { padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.room-card .top { display: flex; gap: 12px; align-items: center; }
.room-card .top div { flex: 1; }
.room-card .top b { display: block; font-weight: 600; }
.season-dot { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: 0; }
.rate-in { width: 110px; text-align: right; }
.token-box { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: .85rem; background: var(--ink); color: #F4E9CF; padding: 12px 14px; border-radius: var(--r-sm); word-break: break-all; user-select: all; }
.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 18px; }
.kpi { padding: 16px 18px; }
.kpi span { font-size: .82rem; color: var(--muted); }
.kpi b { display: block; font-family: var(--display); font-weight: 750; font-size: 1.6rem; line-height: 1.2; margin-top: 2px; }
.daybars { display: flex; align-items: flex-end; gap: 2px; height: 160px; padding: 16px 18px 8px; }
.daybars div { flex: 1; background: var(--ink-3); border-radius: 2px 2px 0 0; min-height: 2px; position: relative; }
.daybars div:hover { background: var(--brass); }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.stack { display: flex; flex-direction: column; gap: 18px; }

/* ---------------- Login ---------------- */
.login { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; }
.login .art { background: var(--ink); position: relative; overflow: hidden; display: flex; flex-direction: column; justify-content: flex-end; padding: 48px; color: #C9CFE0; }
.login .art h1 { color: #fff; font-size: clamp(2rem, 4vw, 3.2rem); font-weight: 750; max-width: 12ch; line-height: 1.05; }
.login .art p { max-width: 38ch; margin: 12px 0 0; }
.key-board { position: absolute; top: 48px; left: 48px; right: 48px; display: grid; grid-template-columns: repeat(7, 1fr); gap: 14px; max-width: 520px; }
.key-board .hook { display: flex; flex-direction: column; align-items: center; gap: 0; }
.key-board .hook::before { content: ''; width: 10px; height: 10px; border-radius: 50%; background: #3B4670; margin-bottom: 4px; }
.key-board .keytag { transform-origin: 50% -6px; animation: swing 2.6s ease-in-out 1; }
.key-board .hook:nth-child(3) .keytag, .key-board .hook:nth-child(6) .keytag { visibility: hidden; }
.login form { align-self: center; justify-self: center; width: min(360px, 90vw); display: flex; flex-direction: column; gap: 16px; }
.login form h2 { font-size: 1.5rem; }
.login .err { color: var(--danger); font-size: .9rem; min-height: 1.2em; }

/* ---------------- Toasts ---------------- */
#toasts { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); z-index: 90; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast { background: var(--ink); color: #fff; padding: 10px 16px; border-radius: var(--r-sm); font-size: .9rem; box-shadow: var(--shadow-pop); animation: pop .16s ease-out; pointer-events: auto; max-width: 90vw; }
.toast.err { background: var(--danger); }

@keyframes fade { from { opacity: 0; } }
@keyframes slide { from { transform: translateX(30px); opacity: 0; } }
@keyframes pop { from { transform: translateY(6px) scale(.98); opacity: 0; } }
@keyframes swing { 0% { transform: rotate(0); } 20% { transform: rotate(9deg); } 45% { transform: rotate(-6deg); } 70% { transform: rotate(3deg); } 100% { transform: rotate(0); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---------------- Responsive ---------------- */
@media (max-width: 1180px) {
  .cols3 { grid-template-columns: 1fr 1fr; }
  .kpis { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 900px) {
  :root { --cell: 40px; }
  .shell { grid-template-columns: 1fr; }
  .side { position: fixed; top: auto; bottom: 0; left: 0; right: 0; height: auto; z-index: 30; padding: 6px 8px calc(6px + env(safe-area-inset-bottom)); flex-direction: row; }
  .brand, .side-foot { display: none; }
  .nav { flex-direction: row; justify-content: space-around; width: 100%; overflow-x: auto; }
  .nav a { flex-direction: column; gap: 2px; font-size: .68rem; padding: 6px 8px; }
  .nav a[aria-current="page"] { box-shadow: inset 0 -3px 0 var(--brass); }
  .main { padding: 18px 16px 90px; }
  .today-head, .cols3, .two-col { grid-template-columns: 1fr; }
  .grid3, .grid4 { grid-template-columns: 1fr 1fr; }
  .map-room { min-width: 120px; }
  .map-room .info span { display: none; }
  .login { grid-template-columns: 1fr; }
  .login .art { min-height: 260px; padding: 28px; }
  .key-board { top: 24px; left: 24px; right: 24px; }
  .inline-form .row { grid-template-columns: 1fr 1fr; }
  .legend { margin-left: 0; }
}
@media (max-width: 520px) {
  .grid2 { grid-template-columns: 1fr; }
  .span2 { grid-column: auto; }
  .kv { grid-template-columns: 1fr; gap: 0 0; }
  .kv dt { margin-top: 8px; }
}

/* ---------------- Impresión del comprobante ---------------- */
@media print {
  body { background: #fff; }
}

/* Ajustes finos */
.map-room .info span.hk-state.limpia { color: var(--ok); }
.map-room .info span.hk-state.sucia { color: var(--danger); }
.map-room .info span.hk-state.inspeccion { color: var(--st-pendiente); }
.occ-card dd { white-space: nowrap; }
.panel > header h3 { margin-right: auto; }
.quote-box { margin-top: 10px; }
.inline-form .row { grid-template-columns: 1.2fr 1fr 1fr auto; }
@media (max-width: 900px) {
  .key-board { gap: 6px; }
  .key-board .keytag { width: 36px; height: 46px; font-size: .8rem; }
}
