/* =====================================================================
   HostelHub — Admin console
   Dark rail + light workspace.
   ===================================================================== */

:root {
  --rail:      264px;
  --rail-bg:   #0c1224;
  --rail-bg-2: #111a33;
  --rail-line: rgba(255, 255, 255, .07);
  --rail-txt:  #97a3c2;
  --rail-txt-2:#5d6b8f;
  --topbar-h:  68px;
}

body.hh-admin { background: var(--bg); }

.hh-admin-shell { display: flex; min-height: 100vh; }

/* ---------------------------------------------------------------
   Sidebar
   --------------------------------------------------------------- */
.hh-sidebar {
  width: var(--rail); flex: none;
  position: fixed; inset: 0 auto 0 0; z-index: 1040;
  display: flex; flex-direction: column;
  background: linear-gradient(178deg, var(--rail-bg-2), var(--rail-bg) 55%);
  border-right: 1px solid var(--rail-line);
  transition: transform var(--base);
}
.hh-sidebar::after {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(520px 300px at 0% 0%, rgba(var(--brand-rgb), .22), transparent 66%);
}
.hh-sidebar > * { position: relative; z-index: 1; }

.hh-sidebar__brand {
  display: flex; align-items: center; gap: 12px;
  padding: 0 20px; height: var(--topbar-h); flex: none;
  border-bottom: 1px solid var(--rail-line);
}
.hh-sidebar__brand .mark {
  width: 36px; height: 36px; border-radius: 11px; flex: none;
  display: grid; place-items: center; font-size: 1.05rem; color: #fff;
  background: linear-gradient(140deg, var(--brand), rgba(var(--brand-rgb), .6));
  box-shadow: 0 8px 20px -8px rgba(var(--brand-rgb), .9);
}
.hh-sidebar__brand .txt { min-width: 0; }
.hh-sidebar__brand strong {
  display: block; color: #fff; font-family: var(--display); font-weight: 800;
  font-size: .98rem; letter-spacing: -.02em; line-height: 1.2;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.hh-sidebar__brand span {
  font-size: .64rem; font-weight: 700; letter-spacing: .12em;
  text-transform: uppercase; color: var(--rail-txt-2);
}

/* hostel context switcher */
.hh-hostel-switch { padding: 16px 16px 6px; }
.hh-hostel-switch__btn {
  width: 100%; display: flex; align-items: center; gap: 11px;
  background: rgba(255,255,255,.05); border: 1px solid var(--rail-line);
  border-radius: var(--r-sm); padding: 11px 13px; cursor: pointer;
  color: #fff; text-align: left; transition: all var(--fast);
}
.hh-hostel-switch__btn:hover { background: rgba(255,255,255,.09); border-color: rgba(var(--brand-rgb), .5); }
.hh-hostel-switch__dot { width: 10px; height: 10px; border-radius: 3px; flex: none; background: var(--brand); box-shadow: 0 0 0 3px rgba(var(--brand-rgb), .22); }
.hh-hostel-switch__btn .t { min-width: 0; flex: 1; }
.hh-hostel-switch__btn .t b { display: block; font-size: .84rem; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hh-hostel-switch__btn .t small { font-size: .66rem; color: var(--rail-txt-2); font-weight: 700; letter-spacing: .07em; text-transform: uppercase; }
.hh-hostel-switch__btn > i { color: var(--rail-txt-2); font-size: .8rem; }

.hh-hostel-switch .dropdown-menu { background: #151f3b; border-color: rgba(255,255,255,.1); width: 232px; }
.hh-hostel-switch .dropdown-item { color: var(--rail-txt); display: flex; align-items: center; gap: 10px; }
.hh-hostel-switch .dropdown-item:hover { background: rgba(255,255,255,.07); color: #fff; }
.hh-hostel-switch .dropdown-item .d { width: 9px; height: 9px; border-radius: 3px; flex: none; }
.hh-hostel-switch .dropdown-item.is-current { color: #fff; background: rgba(255,255,255,.05); }

.hh-sidebar__nav { flex: 1; overflow-y: auto; padding: 10px 12px 20px; }
.hh-sidebar__nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,.12); border-color: transparent; }

.hh-navgroup {
  font-size: .63rem; font-weight: 800; letter-spacing: .14em; text-transform: uppercase;
  color: var(--rail-txt-2); padding: 18px 12px 8px;
}
.hh-navlink {
  position: relative;
  display: flex; align-items: center; gap: 12px;
  padding: 10px 13px; border-radius: var(--r-sm);
  font-size: .875rem; font-weight: 600; color: var(--rail-txt);
  transition: all var(--fast); margin-bottom: 2px;
}
.hh-navlink i { font-size: 1.05rem; width: 20px; flex: none; }
.hh-navlink:hover { background: rgba(255,255,255,.06); color: #fff; }
.hh-navlink.is-active {
  background: linear-gradient(90deg, rgba(var(--brand-rgb), .26), rgba(var(--brand-rgb), .08));
  color: #fff;
}
.hh-navlink.is-active::before {
  content: ''; position: absolute; left: -12px; top: 50%; transform: translateY(-50%);
  width: 3px; height: 22px; border-radius: 0 4px 4px 0; background: var(--brand);
}
.hh-navlink__pill {
  margin-left: auto; font-size: .66rem; font-weight: 800;
  min-width: 20px; text-align: center; padding: 2px 7px; border-radius: 99px;
  background: var(--bad); color: #fff;
}
.hh-navlink__pill.is-soft { background: rgba(255,255,255,.12); color: var(--rail-txt); }

.hh-sidebar__foot { flex: none; padding: 14px; border-top: 1px solid var(--rail-line); }
.hh-sidebar__me {
  display: flex; align-items: center; gap: 11px;
  padding: 10px; border-radius: var(--r-sm);
  background: rgba(255,255,255,.05); transition: background var(--fast); cursor: pointer;
  width: 100%; border: none; text-align: left;
}
.hh-sidebar__me:hover { background: rgba(255,255,255,.09); }
.hh-sidebar__me .hh-avatar { background: linear-gradient(140deg, var(--brand), rgba(var(--brand-rgb), .55)); color: #fff; border: none; }
.hh-sidebar__me .t { min-width: 0; flex: 1; }
.hh-sidebar__me .t b { display: block; color: #fff; font-size: .84rem; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hh-sidebar__me .t small { font-size: .7rem; color: var(--rail-txt-2); }

/* ---------------------------------------------------------------
   Main column
   --------------------------------------------------------------- */
.hh-main { flex: 1; min-width: 0; margin-left: var(--rail); display: flex; flex-direction: column; }

.hh-topbar {
  position: sticky; top: 0; z-index: 1020;
  height: var(--topbar-h); flex: none;
  display: flex; align-items: center; gap: 16px;
  padding: 0 28px;
  background: rgba(255,255,255,.86);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--line);
}
.hh-topbar__title { min-width: 0; }
.hh-topbar__title h1 { font-size: 1.14rem; margin: 0; letter-spacing: -.025em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hh-topbar__title p { margin: 0; font-size: .78rem; color: var(--ink-400); }
.hh-topbar__right { margin-left: auto; display: flex; align-items: center; gap: 10px; }

.hh-iconbtn {
  position: relative; width: 38px; height: 38px; border-radius: var(--r-xs);
  display: grid; place-items: center; flex: none;
  background: var(--surface); border: 1px solid var(--line);
  color: var(--ink-500); font-size: 1.02rem; cursor: pointer; transition: all var(--fast);
}
.hh-iconbtn:hover { color: var(--brand); border-color: rgba(var(--brand-rgb), .4); background: rgba(var(--brand-rgb), .05); }
.hh-iconbtn__dot {
  position: absolute; top: 6px; right: 6px; min-width: 15px; height: 15px;
  border-radius: 99px; background: var(--bad); color: #fff;
  font-size: .58rem; font-weight: 800; display: grid; place-items: center;
  padding: 0 4px; border: 2px solid var(--surface);
}

.hh-burger { display: none; }
@media (max-width: 1099px) {
  .hh-sidebar { transform: translateX(-100%); box-shadow: var(--sh-3); }
  .hh-sidebar.is-open { transform: none; }
  .hh-main { margin-left: 0; }
  .hh-burger { display: grid; }
  .hh-topbar { padding: 0 16px; }
}
.hh-rail-scrim {
  position: fixed; inset: 0; z-index: 1035; background: rgba(11,16,32,.45);
  backdrop-filter: blur(2px); opacity: 0; pointer-events: none; transition: opacity var(--base);
}
.hh-rail-scrim.is-on { opacity: 1; pointer-events: auto; }

.hh-content { flex: 1; padding: 28px; }
@media (max-width: 767px) { .hh-content { padding: 18px 16px; } }

.hh-page-head {
  display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between;
  gap: 16px; margin-bottom: 24px;
}
.hh-page-head h2 { margin: 0 0 4px; font-size: 1.5rem; }
.hh-page-head p { margin: 0; color: var(--ink-400); font-size: .88rem; }

/* ---------------------------------------------------------------
   Dashboard widgets
   --------------------------------------------------------------- */
.hh-dash-cols { display: grid; grid-template-columns: 1.62fr 1fr; gap: 20px; align-items: start; }
@media (max-width: 1199px) { .hh-dash-cols { grid-template-columns: 1fr; } }

.hh-chart-box { position: relative; height: 268px; padding: 4px; }
.hh-chart-box--sm { height: 218px; }

.hh-feed { display: flex; flex-direction: column; }
.hh-feed__item { display: flex; gap: 13px; padding: 13px 24px; border-bottom: 1px solid var(--line-soft); }
.hh-feed__item:last-child { border-bottom: none; }
.hh-feed__dot {
  width: 32px; height: 32px; border-radius: 10px; flex: none;
  display: grid; place-items: center; font-size: .85rem;
  background: rgba(var(--brand-rgb), .10); color: var(--brand);
}
.hh-feed__dot.d-ok   { background: var(--ok-bg);   color: var(--ok); }
.hh-feed__dot.d-bad  { background: var(--bad-bg);  color: var(--bad); }
.hh-feed__dot.d-warn { background: var(--warn-bg); color: var(--warn); }
.hh-feed__txt { min-width: 0; flex: 1; }
.hh-feed__txt b { display: block; font-size: .86rem; color: var(--ink-800); font-weight: 700; }
.hh-feed__txt span { font-size: .8rem; color: var(--ink-400); }
.hh-feed__time { font-size: .72rem; color: var(--ink-300); font-weight: 600; white-space: nowrap; }

/* occupancy heat grid */
.hh-heat { display: grid; gap: 6px; grid-template-columns: repeat(auto-fill, minmax(38px, 1fr)); }
.hh-heat__cell {
  aspect-ratio: 1; border-radius: 8px; display: grid; place-items: center;
  font-size: .68rem; font-weight: 800; color: #fff;
  background: var(--ink-100); color: var(--ink-400);
  transition: transform var(--fast);
}
.hh-heat__cell:hover { transform: scale(1.12); z-index: 2; }
.hh-heat__cell.h-0 { background: var(--ok-bg);   color: var(--ok); }
.hh-heat__cell.h-1 { background: #b6ecd8; color: #067a55; }
.hh-heat__cell.h-2 { background: var(--warn-bg); color: var(--warn); }
.hh-heat__cell.h-3 { background: #fbd0d2; color: var(--bad); }
.hh-heat__cell.h-4 { background: var(--bad); color: #fff; }

/* room manager grid inside admin */
.hh-adm-room {
  border: 1px solid var(--line); border-radius: var(--r);
  background: var(--surface); overflow: hidden;
  transition: border-color var(--fast), box-shadow var(--fast);
}
.hh-adm-room:hover { border-color: rgba(var(--brand-rgb), .3); box-shadow: var(--sh-2); }
.hh-adm-room__head {
  display: flex; align-items: center; gap: 10px; padding: 13px 16px;
  border-bottom: 1px solid var(--line-soft); background: var(--bg-soft);
}
.hh-adm-room__head b { font-family: var(--display); font-size: .98rem; color: var(--ink-900); }
.hh-adm-room__body { padding: 14px 16px; }

/* filter bar */
.hh-filters {
  display: flex; flex-wrap: wrap; align-items: end; gap: 12px;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-lg); padding: 16px 18px; margin-bottom: 20px; box-shadow: var(--sh-1);
}
.hh-filters .hh-field { margin: 0; min-width: 140px; flex: 1 1 140px; }
.hh-filters .hh-label { font-size: .72rem; letter-spacing: .04em; text-transform: uppercase; color: var(--ink-400); }
.hh-filters .hh-input, .hh-filters .hh-select { padding: 9px 13px; font-size: .87rem; }
.hh-filters .hh-select { padding-right: 34px; }

/* receipt */
.hh-receipt { max-width: 620px; margin-inline: auto; }
.hh-receipt__head {
  display: flex; justify-content: space-between; gap: 20px; align-items: flex-start;
  padding-bottom: 20px; border-bottom: 2px dashed var(--line);
}
.hh-receipt__rows { padding: 20px 0; }
.hh-receipt__row { display: flex; justify-content: space-between; gap: 16px; padding: 9px 0; font-size: .9rem; }
.hh-receipt__row span { color: var(--ink-500); }
.hh-receipt__row b { color: var(--ink-900); font-variant-numeric: tabular-nums; }
.hh-receipt__total {
  display: flex; justify-content: space-between; gap: 16px; align-items: center;
  padding: 16px 0; border-top: 2px dashed var(--line); margin-top: 8px;
}
.hh-receipt__total b { font-family: var(--display); font-size: 1.5rem; color: var(--ink-900); }
.hh-stamp {
  display: inline-flex; align-items: center; gap: 8px;
  border: 2.5px solid var(--ok); color: var(--ok);
  font-family: var(--display); font-weight: 800; font-size: .9rem;
  letter-spacing: .1em; text-transform: uppercase;
  padding: 8px 18px; border-radius: var(--r-xs); transform: rotate(-5deg);
}

/* admin login */
.hh-adm-login {
  min-height: 100vh; display: grid; place-items: center; padding: 28px;
  background:
    radial-gradient(760px 460px at 16% 8%, rgba(var(--brand-rgb), .30), transparent 62%),
    radial-gradient(680px 420px at 88% 92%, rgba(14, 164, 114, .18), transparent 60%),
    linear-gradient(160deg, #0e1730, #070b16 70%);
  position: relative; overflow: hidden;
}
.hh-adm-login::before {
  content: ''; position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.045) 1px, transparent 1px);
  background-size: 52px 52px;
  mask-image: radial-gradient(ellipse 70% 60% at 50% 45%, #000, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse 70% 60% at 50% 45%, #000, transparent 75%);
}
.hh-adm-login__card {
  position: relative; z-index: 1; width: min(100%, 428px);
  background: rgba(255,255,255,.97);
  border: 1px solid rgba(255,255,255,.5);
  border-radius: var(--r-xl); padding: 38px 36px;
  box-shadow: 0 40px 90px -30px rgba(0,0,0,.7);
  animation: riseIn .55s var(--ease) both;
}
.hh-adm-login__logo {
  width: 52px; height: 52px; border-radius: 16px; margin-bottom: 20px;
  display: grid; place-items: center; font-size: 1.45rem; color: #fff;
  background: linear-gradient(140deg, var(--brand), rgba(var(--brand-rgb), .6));
  box-shadow: var(--sh-brand);
}
.hh-adm-login__demo {
  margin-top: 22px; padding: 14px 16px; border-radius: var(--r-sm);
  background: var(--bg-soft); border: 1px dashed var(--ink-200);
  font-size: .78rem; color: var(--ink-500);
}
.hh-adm-login__demo b { color: var(--ink-800); }
.hh-adm-login__demo button {
  background: none; border: none; color: var(--brand); font-weight: 700;
  cursor: pointer; padding: 0; font-size: .78rem; text-decoration: underline;
}

/* misc admin */
.hh-kv { display: grid; grid-template-columns: auto 1fr; gap: 10px 18px; font-size: .88rem; }
.hh-kv dt { color: var(--ink-400); font-weight: 600; }
.hh-kv dd { margin: 0; color: var(--ink-800); font-weight: 600; }

.hh-inline-form { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

/* =====================================================================
   Light console
   Appended override layer: the dark rail becomes a light, premium
   workspace, dropdowns stop being clipped, and the whole console gets
   one calm entrance animation. Nothing above this block needs editing —
   the cascade does the work.
   ===================================================================== */

:root {
  --rail-bg:    #ffffff;
  --rail-bg-2:  #fbfbfe;
  --rail-line:  rgba(16, 24, 40, .07);
  --rail-txt:   #5a6785;
  --rail-txt-2: #8592ad;
}

/* ---------------- sidebar, now in daylight ---------------- */
.hh-sidebar {
  background: linear-gradient(178deg, var(--rail-bg-2), var(--rail-bg) 55%);
  border-right: 1px solid var(--rail-line);
  box-shadow: 14px 0 34px -30px rgba(16, 24, 40, .18);
}

.hh-sidebar::after {
  background: radial-gradient(460px 260px at 0% 0%, rgba(var(--brand-rgb), .07), transparent 66%);
}

.hh-sidebar__brand strong { color: var(--ink-900); }
.hh-sidebar__brand span   { color: var(--ink-400); }

.hh-hostel-switch__btn {
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--ink-900);
  box-shadow: var(--sh-1);
}
.hh-hostel-switch__btn:hover { background: var(--surface); border-color: rgba(var(--brand-rgb), .4); }
.hh-hostel-switch__btn .t small { color: var(--ink-400); }

.hh-navgroup { color: var(--ink-300); }

.hh-navlink { color: var(--ink-500); }
.hh-navlink:hover { background: rgba(var(--brand-rgb), .06); color: var(--ink-900); }
.hh-navlink.is-active {
  background: linear-gradient(90deg, rgba(var(--brand-rgb), .14), rgba(var(--brand-rgb), .05));
  color: var(--brand-ink);
}
.hh-navlink__pill.is-soft { background: var(--muted-bg); color: var(--ink-500); }

.hh-sidebar__nav::-webkit-scrollbar-thumb { background: var(--ink-200); }

.hh-sidebar__foot { border-top: 1px solid var(--rail-line); }
.hh-sidebar__me { background: var(--bg-soft); border: 1px solid var(--line-soft); }
.hh-sidebar__me:hover { background: var(--muted-bg); }
.hh-sidebar__me .t b { color: var(--ink-900); }
.hh-sidebar__me .t small { color: var(--ink-400); }
.hh-sidebar__me > i { color: var(--ink-300) !important; }

/* ---------------- the clipping bug ----------------
   Room cards used overflow:hidden, which swallowed every dropdown that
   opened inside them — the three-dot room menu and all the bed controls
   looked dead. Menus escape now; the head keeps its own rounding. */
.hh-adm-room { overflow: visible; }
.hh-adm-room__head { border-radius: var(--r) var(--r) 0 0; }

/* hover-lift transforms create a new containing block and shove open
   menus around, so inside the console cards lift with light, not motion */
.hh-admin .lift3d:hover { transform: none; box-shadow: var(--sh-3); }

/* ---------------- premium chrome ---------------- */
.hh-topbar {
  background: rgba(255, 255, 255, .78);
  border-bottom: 1px solid var(--hairline);
}

.hh-admin .dropdown-menu {
  border: 1px solid var(--hairline);
  border-radius: var(--r-sm);
  box-shadow: var(--sh-3);
  padding: 6px;
}
.hh-admin .dropdown-item { border-radius: 9px; padding: 8px 12px; font-size: .86rem; }
.hh-admin .dropdown-item:hover { background: rgba(var(--brand-rgb), .07); }

.hh-admin .hh-card { border-color: var(--hairline); }

.hh-page-head h2 { letter-spacing: -.03em; }

/* bed control chips: quiet white pills — a dot carries the status, the
   letter carries the identity, nothing shouts */
.hh-adm-room .hh-bed {
  min-width: 56px !important;
  padding: 8px 12px !important;
  font-size: .8rem !important;
  border-radius: 11px;
  background: var(--surface) !important;
  border: 1px solid var(--line) !important;
  color: var(--ink-700) !important;
  box-shadow: var(--sh-1);
  transition: transform var(--fast), box-shadow var(--fast), border-color var(--fast);
}

.hh-adm-room .hh-bed:hover {
  transform: translateY(-2px);
  box-shadow: var(--sh-2);
  border-color: rgba(var(--brand-rgb), .35) !important;
}

/* the person/tools icon becomes a small status dot */
.hh-adm-room .hh-bed i {
  font-size: 0 !important;
  width: 9px;
  height: 9px;
  border-radius: 4px;
  background: var(--c, var(--ok));
  flex: none;
}

.hh-adm-room .hh-bed small { color: var(--ink-400); }

/* ---------------- entrance animation ----------------
   One quiet motion for the whole console: everything in the work area
   rises out of a soft blur, in reading order. Pure CSS, so it cannot
   strand content invisible if a script fails. */
@keyframes adminIn {
  from { opacity: 0; transform: translateY(12px); filter: blur(9px); }
  to   { opacity: 1; transform: none;             filter: blur(0);   }
}

.hh-content > * { animation: adminIn .55s var(--ease-out) backwards; }
.hh-content > *:nth-child(1) { animation-delay: .04s; }
.hh-content > *:nth-child(2) { animation-delay: .11s; }
.hh-content > *:nth-child(3) { animation-delay: .18s; }
.hh-content > *:nth-child(4) { animation-delay: .25s; }
.hh-content > *:nth-child(5) { animation-delay: .32s; }
.hh-content > *:nth-child(n+6) { animation-delay: .38s; }

.hh-sidebar .hh-navlink { animation: adminIn .5s var(--ease-out) backwards; }
.hh-sidebar .hh-navlink:nth-child(2) { animation-delay: .05s; }
.hh-sidebar .hh-navlink:nth-child(3) { animation-delay: .09s; }
.hh-sidebar .hh-navlink:nth-child(4) { animation-delay: .13s; }
.hh-sidebar .hh-navlink:nth-child(5) { animation-delay: .17s; }
.hh-sidebar .hh-navlink:nth-child(6) { animation-delay: .21s; }

/* admin pages don't run the public reveal script on every element, so
   anything still carrying data-reveal must never be left transparent */
.hh-admin [data-reveal] { opacity: 1 !important; transform: none !important; filter: none !important; }

@media (prefers-reduced-motion: reduce) {
  .hh-content > *, .hh-sidebar .hh-navlink { animation: none; }
}
