/* Roomly admin. Status colours live in the --s-* tokens; every status-aware component reads them. */
@view-transition { navigation: auto; }

:root {
  --ink: #0d1526;
  --ink-2: #39435a;
  --muted: #6b7489;
  --line: #e3e7ef;
  --paper: #ffffff;
  --canvas: #f3f5f9;
  --sidebar: #0a1633;
  --sidebar-ink: #c3cde6;
  --brand: #0064ff;
  --brand-dark: #004fcc;
  --brand-soft: #e6f0ff;
  --focus: #7fb2ff;

  --s-available: #2f8a63;   --s-available-soft: #e5f4ec;
  --s-upcoming: #c98a1e;    --s-upcoming-soft: #fbf1de;
  --s-occupied: #d0533f;    --s-occupied-soft: #fbe9e5;
  --s-maintenance: #3b6fb6; --s-maintenance-soft: #e6eef9;
  --s-out_of_service: #66727e; --s-out_of_service-soft: #eceef0;

  --radius: 16px;
  --radius-sm: 10px;
  --shadow-sm: 0 1px 2px rgba(13, 21, 38, .06);
  --shadow: 0 1px 2px rgba(13, 21, 38, .05), 0 8px 24px -12px rgba(13, 21, 38, .18);
  --shadow-lg: 0 2px 4px rgba(13, 21, 38, .05), 0 24px 48px -20px rgba(13, 21, 38, .32);
  --ease-out: cubic-bezier(.22, 1, .36, 1);
  --ease-spring: cubic-bezier(.34, 1.56, .64, 1);
  --font: 'Plus Jakarta Sans', 'Segoe UI', system-ui, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--canvas);
  color: var(--ink);
  font: 14px/1.5 var(--font);
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { margin: 0; letter-spacing: -.02em; }
p { margin: 0; }
a { color: inherit; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 6px; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.nowrap { white-space: nowrap; }
.block-sm { display: block; font-size: 12px; }

.icon {
  font-family: 'Material Symbols Rounded';
  font-size: 20px;
  line-height: 1;
  font-weight: 450;
  font-variation-settings: 'FILL' 0, 'opsz' 24;
  display: inline-block;
  vertical-align: middle;
  user-select: none;
  flex: none;
}
.icon--muted { color: var(--muted); }

/* ------------------------------------------------------------------ Motion */
@keyframes rise { from { opacity: 0; transform: translateY(14px) scale(.985); } }
@keyframes fade { from { opacity: 0; } }
@keyframes slide-down { from { opacity: 0; transform: translateY(-12px); } }
@keyframes breathe { 0%, 100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--c) 45%, transparent); } 50% { box-shadow: 0 0 0 5px color-mix(in srgb, var(--c) 0%, transparent); } }
@keyframes ping { 0% { transform: scale(1); opacity: .6; } 80%, 100% { transform: scale(2.6); opacity: 0; } }
@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: .25; } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }
@keyframes drift { 0%, 100% { transform: translate(0, 0) scale(1); } 50% { transform: translate(-4%, 3%) scale(1.08); } }
@keyframes pop { 0% { transform: scale(.6); opacity: 0; } 70% { transform: scale(1.06); } 100% { transform: scale(1); opacity: 1; } }
@keyframes shake { 10%, 90% { transform: translateX(-1px); } 20%, 80% { transform: translateX(3px); } 30%, 50%, 70% { transform: translateX(-5px); } 40%, 60% { transform: translateX(5px); } }

.reveal { animation: rise .6s var(--ease-out) both; animation-delay: calc(var(--i, 0) * 60ms); }

/* ------------------------------------------------------------------ Brand */
.brand { display: inline-flex; align-items: center; gap: 11px; text-decoration: none; color: #fff; }
.brand-icon { width: 40px; height: 40px; flex: none; animation: bubble 6s var(--ease-out) infinite; transform-origin: 30% 90%; filter: drop-shadow(0 6px 14px rgba(0, 100, 255, .45)); }
@keyframes bubble { 0%, 78%, 100% { transform: none; } 84% { transform: rotate(-9deg) scale(1.06); } 90% { transform: rotate(5deg); } 95% { transform: rotate(-2deg); } }
.brand-text { display: grid; line-height: 1; }
.brand-name { font-weight: 800; font-size: 23px; letter-spacing: -.045em; }
.brand-name span { color: #00a3ff; }
.brand-by { margin-top: 4px; font-size: 10.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: #7d8bb0; }
.brand-by b { color: #fff; font-weight: 800; letter-spacing: .02em; text-transform: none; font-size: 11.5px; }

/* ------------------------------------------------------------------ Shell */
.shell { display: flex; min-height: 100vh; }
.sidebar {
  position: fixed; inset: 0 auto 0 0; z-index: 30;
  width: 256px; padding: 26px 16px 16px;
  display: flex; flex-direction: column;
  background: var(--sidebar);
  color: var(--sidebar-ink);
  transition: transform .35s var(--ease-out);
}
.sidebar .brand { margin: 0 8px 28px; }
.nav-label { margin: 18px 12px 8px; font-size: 11px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: #7d8bb0; }
.nav { display: grid; gap: 2px; }
.nav-link {
  position: relative; display: flex; align-items: center; gap: 12px;
  padding: 10px 12px; border-radius: 10px;
  text-decoration: none; font-weight: 600;
  transition: background .2s, color .2s;
}
.nav-link:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.nav-link.is-active { background: rgba(0, 163, 255, .14); color: #fff; }
.nav-link.is-active::before {
  content: ''; position: absolute; left: -16px; top: 9px; bottom: 9px; width: 4px;
  border-radius: 0 4px 4px 0; background: #00a3ff;
  animation: slide-in-bar .4s var(--ease-spring);
}
@keyframes slide-in-bar { from { transform: scaleY(0); } }
.nav-link.is-active .icon { font-variation-settings: 'FILL' 1; color: #00a3ff; }

.sidebar-foot {
  margin-top: auto; display: flex; align-items: center; gap: 10px;
  padding: 12px 8px 4px; border-top: 1px solid rgba(255, 255, 255, .08);
}
.avatar {
  width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; flex: none;
  background: #00a3ff; color: var(--sidebar); font-weight: 800; font-size: 13px;
}
.who { min-width: 0; flex: 1; display: grid; line-height: 1.3; }
.who strong { color: #fff; font-size: 13px; }
.who small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; color: #8b97b8; }
.sidebar .icon-btn { color: var(--sidebar-ink); }
.sidebar .icon-btn:hover { background: rgba(255, 255, 255, .08); color: #fff; }

.main { flex: 1; min-width: 0; margin-left: 256px; }
.topbar {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; gap: 14px;
  padding: 18px 32px;
  background: color-mix(in srgb, var(--canvas) 82%, transparent);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid transparent;
}
.topbar-title { flex: 1; min-width: 0; }
.topbar h1 { font-size: 24px; font-weight: 800; view-transition-name: page-title; }
.date { color: var(--muted); font-size: 13px; }
.clock {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 14px; border-radius: 999px;
  background: var(--paper); box-shadow: var(--shadow-sm); border: 1px solid var(--line);
  font-weight: 700; font-variant-numeric: tabular-nums;
}
.live-dot { position: relative; width: 8px; height: 8px; border-radius: 50%; background: var(--s-available); }
.live-dot::after { content: ''; position: absolute; inset: 0; border-radius: 50%; background: inherit; animation: ping 2s ease-out infinite; }
.icon-btn.menu-btn { display: none; }
.scrim { display: none; }
.content { padding: 8px 32px 48px; display: grid; gap: 22px; view-transition-name: content; }

::view-transition-old(content) { animation: .18s ease both fade reverse; }
::view-transition-new(content) { animation: .4s var(--ease-out) both rise; }

/* ------------------------------------------------------------------ Controls */
.icon-btn {
  display: inline-grid; place-items: center; width: 36px; height: 36px; flex: none;
  border: 0; border-radius: 10px; background: transparent; color: var(--ink-2);
  transition: background .2s, transform .2s var(--ease-spring);
}
.icon-btn:hover { background: rgba(13, 21, 38, .06); }
.icon-btn:active { transform: scale(.9); }
.icon-btn--glass { background: rgba(255, 255, 255, .78); backdrop-filter: blur(6px); box-shadow: var(--shadow-sm); }
.icon-btn--glass:hover { background: #fff; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 42px; padding: 0 18px; border-radius: 12px; border: 1px solid transparent;
  font-weight: 700; text-decoration: none; white-space: nowrap;
  transition: background .2s, box-shadow .2s, transform .2s var(--ease-spring), opacity .2s;
}
.btn:active:not(:disabled) { transform: scale(.97); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn--primary { background: var(--brand); color: #fff; box-shadow: 0 6px 16px -8px var(--brand); }
.btn--primary:hover:not(:disabled) { background: var(--brand-dark); box-shadow: 0 10px 22px -10px var(--brand); }
.btn--primary .icon:last-child:not(:first-child) { transition: transform .25s var(--ease-out); }
.btn--primary:hover .icon:last-child:not(:first-child) { transform: translateX(4px); }
.btn--ghost { background: var(--paper); border-color: var(--line); color: var(--ink-2); }
.btn--ghost:hover:not(:disabled) { border-color: #cdd4e1; background: #f9fafc; }
.btn--sm { height: 34px; padding: 0 12px; font-size: 13px; border-radius: 10px; }
.btn--sm .icon { font-size: 18px; }
.btn--block { width: 100%; }
.btn.is-loading { pointer-events: none; }
.btn.is-loading > .icon { animation: spin .8s linear infinite; }
.link { color: var(--brand); font-weight: 700; text-decoration: none; font-size: 13px; }
.link:hover { text-decoration: underline; }

.field { display: grid; gap: 6px; font-weight: 600; font-size: 13px; color: var(--ink-2); }
.field input, .input-wrap {
  width: 100%; height: 46px; border-radius: 12px;
  border: 1.5px solid var(--line); background: var(--paper);
  transition: border-color .2s, box-shadow .2s;
}
.field > input { padding: 0 14px; font-weight: 500; color: var(--ink); }
.input-wrap { display: flex; align-items: center; gap: 4px; padding: 0 6px 0 14px; }
.input-wrap > .icon { color: var(--muted); transition: color .2s; }
.input-wrap input { flex: 1; min-width: 0; height: 100%; border: 0; outline: 0; background: transparent; padding: 0 6px; font-weight: 500; color: var(--ink); }
.field input:focus, .input-wrap:focus-within { outline: 0; border-color: var(--brand); box-shadow: 0 0 0 4px var(--brand-soft); }
.input-wrap:focus-within > .icon { color: var(--brand); }
[aria-invalid="true"], .input-wrap:has([aria-invalid="true"]) { border-color: var(--s-occupied) !important; }
.field-error { display: flex; align-items: center; gap: 6px; color: var(--s-occupied); font-size: 12.5px; font-weight: 600; animation: slide-down .3s var(--ease-out); }
.field-error .icon { font-size: 16px; }

/* ------------------------------------------------------------------ Status pill */
.pill {
  --c: var(--muted); --soft: var(--line);
  display: inline-flex; align-items: center; gap: 7px;
  padding: 4px 10px 4px 8px; border-radius: 999px;
  background: var(--soft); color: color-mix(in srgb, var(--c) 82%, #000);
  font-size: 12px; font-weight: 700; white-space: nowrap;
}
.pill-dot { position: relative; width: 8px; height: 8px; border-radius: 50%; background: var(--c); flex: none; }
.pill--available, .chip--available { --c: var(--s-available); --soft: var(--s-available-soft); }
.pill--upcoming, .chip--upcoming { --c: var(--s-upcoming); --soft: var(--s-upcoming-soft); }
.pill--occupied, .chip--occupied { --c: var(--s-occupied); --soft: var(--s-occupied-soft); }
.pill--maintenance, .chip--maintenance { --c: var(--s-maintenance); --soft: var(--s-maintenance-soft); }
.pill--out_of_service, .chip--out_of_service { --c: var(--s-out_of_service); --soft: var(--s-out_of_service-soft); }
/* Each status dot moves differently, echoing its Lottie animation. */
.pill--available .pill-dot { animation: breathe 2.4s ease-in-out infinite; }
.pill--occupied .pill-dot::after { content: ''; position: absolute; inset: 0; border-radius: 50%; background: inherit; animation: ping 1.6s ease-out infinite; }
.pill--upcoming .pill-dot { animation: blink 1.2s ease-in-out infinite; }
.pill--maintenance .pill-dot { border-radius: 2px; animation: spin 2.4s linear infinite; }
.pill--out_of_service .pill-dot { background: transparent; border: 2px solid var(--c); }

.tag {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 8px; border-radius: 6px; background: #eff2f7; color: var(--ink-2);
  font-size: 12px; font-weight: 600;
}
.tag .icon { font-size: 15px; }
.tag--live { background: var(--s-occupied-soft); color: var(--s-occupied); animation: blink 2s ease-in-out infinite; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; }

/* ------------------------------------------------------------------ Lottie slot */
.lottie { position: relative; width: 100%; aspect-ratio: 5 / 3; }
.lottie canvas { display: block; width: 100% !important; height: 100% !important; }
.lottie:not(.is-ready)::before {
  content: ''; position: absolute; inset: 18% 30%; border-radius: 50%;
  background: color-mix(in srgb, currentColor 10%, transparent);
  animation: blink 1.4s ease-in-out infinite;
}
.lottie.is-ready { animation: fade .5s ease both; }
.lottie.is-swapping { animation: lottie-out .25s ease forwards; }
@keyframes lottie-out { to { opacity: 0; transform: scale(.94); } }

/* ------------------------------------------------------------------ Panels */
.panel {
  background: var(--paper); border-radius: var(--radius);
  border: 1px solid var(--line); box-shadow: var(--shadow);
  padding: 22px;
}
.panel--flush { padding: 0; overflow: hidden; }
.panel-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 16px; }
.panel-head--pad { padding: 20px 22px 0; }
.panel-head h2 { font-size: 17px; font-weight: 800; }
.panel-head p { font-size: 13px; margin-top: 2px; max-width: 60ch; }

.notice {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 12px; border-radius: 10px; background: var(--brand-soft); color: var(--brand-dark);
  font-weight: 600; font-size: 13px; text-decoration: none;
}
.notice--warn { margin-top: 14px; background: var(--s-upcoming-soft); color: #7a5410; }
.notice--warn:hover { text-decoration: underline; }

.toast {
  display: flex; align-items: center; gap: 10px;
  margin: 0 32px 6px; padding: 12px 12px 12px 16px; border-radius: 12px;
  background: var(--sidebar); color: #fff; box-shadow: var(--shadow-lg); font-weight: 600;
  animation: toast-in .5s var(--ease-spring) both;
}
.toast > span:not(.icon) { flex: 1; }
.toast--success > .icon:first-child { color: #00a3ff; }
.toast .icon-btn { color: #fff; width: 30px; height: 30px; }
.toast.is-leaving { animation: toast-out .3s ease forwards; }
@keyframes toast-in { from { opacity: 0; transform: translateY(-16px) scale(.96); } }
@keyframes toast-out { to { opacity: 0; transform: translateY(-10px); height: 0; margin: 0 32px; padding-block: 0; } }

/* ------------------------------------------------------------------ Dashboard */
.stats { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 14px; }
.stat {
  --c: var(--muted); --soft: var(--line);
  position: relative; overflow: hidden;
  display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; column-gap: 12px; align-items: center;
  padding: 16px 18px; border-radius: var(--radius);
  background: var(--paper); border: 1px solid var(--line); box-shadow: var(--shadow);
  text-decoration: none;
  transition: transform .3s var(--ease-out), box-shadow .3s;
}
.stat::after {
  content: ''; position: absolute; right: -30px; top: -30px; width: 100px; height: 100px; border-radius: 50%;
  background: var(--soft); transition: transform .5s var(--ease-out);
}
.stat:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.stat:hover::after { transform: scale(1.6); }
.stat > * { position: relative; z-index: 1; }
.stat-icon { grid-row: span 2; width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; background: var(--soft); color: var(--c); }
.stat-icon .icon { font-variation-settings: 'FILL' 1; }
.stat-value { font-size: 26px; font-weight: 800; line-height: 1.1; font-variant-numeric: tabular-nums; }
.stat-label { font-size: 12.5px; color: var(--muted); font-weight: 600; }
.stat--available { --c: var(--s-available); --soft: var(--s-available-soft); }
.stat--upcoming { --c: var(--s-upcoming); --soft: var(--s-upcoming-soft); }
.stat--occupied { --c: var(--s-occupied); --soft: var(--s-occupied-soft); }
.stat--maintenance { --c: var(--s-maintenance); --soft: var(--s-maintenance-soft); }
.stat--out_of_service { --c: var(--s-out_of_service); --soft: var(--s-out_of_service-soft); }
.stat--maintenance .stat-icon .icon { animation: wrench 2.4s ease-in-out infinite; }
@keyframes wrench { 0%, 60%, 100% { transform: rotate(0); } 70% { transform: rotate(-25deg); } 85% { transform: rotate(15deg); } }

.dash-grid { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 22px; align-items: start; }
.side-col { display: grid; gap: 22px; position: sticky; top: 92px; }

.board { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 16px; }
.room-card {
  --c: var(--muted); --soft: var(--line);
  display: flex; flex-direction: column;
  border-radius: 14px; overflow: hidden; text-decoration: none;
  border: 1px solid var(--line); background: var(--paper);
  transition: transform .35s var(--ease-out), box-shadow .35s, border-color .35s;
}
.room-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); border-color: color-mix(in srgb, var(--c) 35%, var(--line)); }
.room-card-art { position: relative; overflow: hidden; background: var(--soft); color: var(--c); }
.room-card-art::before {
  content: ''; position: absolute; width: 70%; aspect-ratio: 1; left: 15%; top: 0; border-radius: 50%;
  background: radial-gradient(circle, color-mix(in srgb, var(--c) 22%, transparent), transparent 70%);
  animation: drift 9s ease-in-out infinite;
}
.room-card-art .lottie { transition: transform .5s var(--ease-out); }
.room-card:hover .room-card-art .lottie { transform: scale(1.05); }
.room-card-body { padding: 14px 16px 16px; display: grid; gap: 6px; }
.room-card-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.room-card h3 { font-size: 15px; font-weight: 800; }
.room-meta { display: flex; align-items: center; gap: 3px; font-size: 12.5px; }
.room-meta .icon { font-size: 16px; }
.room-meta .sep { margin: 0 4px; }
.room-line { display: flex; align-items: center; gap: 6px; font-size: 13.5px; color: var(--ink-2); }
.room-line .icon { font-size: 17px; color: var(--c); }
.room-sub { font-size: 12.5px; color: var(--muted); }
.room-card--available, .hero--available, .room-thumb--available, .anim-card--available, .device-screen--available { --c: var(--s-available); --soft: var(--s-available-soft); }
.room-card--upcoming, .hero--upcoming, .room-thumb--upcoming, .anim-card--upcoming, .device-screen--upcoming { --c: var(--s-upcoming); --soft: var(--s-upcoming-soft); }
.room-card--occupied, .hero--occupied, .room-thumb--occupied, .anim-card--occupied, .device-screen--occupied { --c: var(--s-occupied); --soft: var(--s-occupied-soft); }
.room-card--maintenance, .hero--maintenance, .room-thumb--maintenance, .anim-card--maintenance, .device-screen--maintenance { --c: var(--s-maintenance); --soft: var(--s-maintenance-soft); }
.room-card--out_of_service, .hero--out_of_service, .room-thumb--out_of_service, .anim-card--out_of_service, .device-screen--out_of_service { --c: var(--s-out_of_service); --soft: var(--s-out_of_service-soft); }
.room-card--out_of_service .room-card-art .lottie { filter: saturate(.85); }

.progress { --c-bar: var(--c, var(--brand)); height: 6px; border-radius: 6px; background: #eceff5; overflow: hidden; }
.progress > span {
  display: block; height: 100%; width: var(--p); border-radius: inherit;
  background: linear-gradient(90deg, var(--c-bar), color-mix(in srgb, var(--c-bar) 55%, #fff), var(--c-bar));
  background-size: 200% 100%;
  animation: grow 1.1s var(--ease-out) both, shimmer 2.6s linear infinite;
  transform-origin: left;
}
@keyframes grow { from { width: 0; } }
.progress--light { background: rgba(255, 255, 255, .5); }

.agenda { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.agenda-item {
  position: relative; display: flex; align-items: center; gap: 14px;
  padding: 10px 10px; border-radius: 10px; transition: background .2s;
}
.agenda-item:hover { background: #f5f7fb; }
.agenda-time { display: grid; width: 46px; font-weight: 800; font-variant-numeric: tabular-nums; font-size: 13.5px; line-height: 1.25; }
.agenda-time small { color: var(--muted); font-weight: 600; font-size: 12px; }
.agenda-body { flex: 1; min-width: 0; display: grid; line-height: 1.35; padding-left: 14px; border-left: 3px solid var(--line); }
.agenda-body strong { font-size: 13.5px; }
.agenda-body small { color: var(--muted); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.agenda-item.is-live .agenda-body { border-color: var(--s-occupied); }
.agenda-item.is-past { opacity: .5; }

.facts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 0; }
.facts div { padding: 12px; border-radius: 12px; background: #f5f7fb; }
.facts dt { font-size: 12px; color: var(--muted); font-weight: 600; }
.facts dd { margin: 2px 0 0; font-size: 20px; font-weight: 800; }
.facts dd.is-warn { color: var(--s-upcoming); }
.facts--list { grid-template-columns: 1fr; gap: 0; }
.facts--list div { display: grid; grid-template-columns: 130px 1fr; gap: 12px; background: none; padding: 12px 0; border-radius: 0; border-top: 1px solid var(--line); }
.facts--list div:first-child { border-top: 0; padding-top: 0; }
.facts--list dd { font-size: 14px; font-weight: 600; margin: 0; }
.facts--mini { grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 12px; }
.facts--mini div { padding: 8px 10px; }
.facts--mini dd { font-size: 13px; }

/* ------------------------------------------------------------------ Rooms list */
.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  --c: var(--ink-2); --soft: #e8ebf2;
  display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 14px;
  border-radius: 999px; background: var(--paper); border: 1px solid var(--line);
  font-weight: 700; font-size: 13px; text-decoration: none; color: var(--ink-2);
  transition: background .2s, border-color .2s, color .2s, transform .2s var(--ease-spring);
}
.chip:hover { border-color: color-mix(in srgb, var(--c) 40%, var(--line)); transform: translateY(-1px); }
.chip.is-active { background: var(--soft); border-color: color-mix(in srgb, var(--c) 40%, transparent); color: color-mix(in srgb, var(--c) 80%, #000); }
.chip:first-child.is-active { background: var(--sidebar); color: #fff; border-color: var(--sidebar); }

.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 700; padding: 14px 18px; border-bottom: 1px solid var(--line); background: #f9fafd; }
.table td { padding: 12px 18px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tr.is-past { opacity: .55; }
.table a { text-decoration: none; }
.table a:hover { text-decoration: underline; }
.row-link { cursor: pointer; transition: background .2s; }
.row-link:hover { background: #f6f8fc; }
.row-link:hover .cell-end .icon { transform: translateX(4px); color: var(--ink); }
.cell-end { text-align: right; }
.cell-end .icon { transition: transform .25s var(--ease-out), color .2s; }
.room-cell { display: flex; align-items: center; gap: 14px; }
.room-cell > span:last-child { display: grid; line-height: 1.35; }
.room-thumb { width: 84px; flex: none; border-radius: 10px; overflow: hidden; background: var(--soft); color: var(--c); }
.device-state { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; color: var(--muted); }
.device-state::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: #b5bccb; }
.device-state.is-online { color: var(--s-available); }
.device-state.is-online::before { background: var(--s-available); --c: var(--s-available); animation: breathe 2.4s ease-in-out infinite; }

.empty-state { display: grid; justify-items: center; text-align: center; gap: 8px; padding: 56px 24px; }
.empty-icon { font-size: 44px; color: var(--muted); animation: pop .6s var(--ease-spring) both; }

/* ------------------------------------------------------------------ Room detail */
.back-link { display: inline-flex; align-items: center; gap: 6px; width: max-content; color: var(--muted); text-decoration: none; font-weight: 700; font-size: 13px; }
.back-link:hover { color: var(--ink); }
.back-link .icon { transition: transform .25s var(--ease-out); }
.back-link:hover .icon { transform: translateX(-4px); }
.room-detail { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 22px; align-items: start; }
.room-detail .hero { grid-column: 1 / -1; }

.hero {
  position: relative; overflow: hidden;
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: center; gap: 24px;
  padding: 26px 34px; border-radius: 22px;
  background: var(--soft); border: 1px solid color-mix(in srgb, var(--c) 18%, transparent);
  color: var(--c);
}
.hero::before, .hero::after {
  content: ''; position: absolute; border-radius: 50%; pointer-events: none;
  background: radial-gradient(circle, color-mix(in srgb, var(--c) 18%, transparent), transparent 68%);
}
.hero::before { width: 520px; height: 520px; left: -140px; top: -180px; animation: drift 12s ease-in-out infinite; }
.hero::after { width: 380px; height: 380px; right: -100px; bottom: -200px; animation: drift 10s ease-in-out infinite reverse; }
.hero > * { position: relative; z-index: 1; }
.hero-art { max-width: 460px; width: 100%; justify-self: center; view-transition-name: hero-art; }
.hero-copy { display: grid; gap: 10px; justify-items: start; color: var(--ink); }
.hero-copy .pill { background: var(--paper); box-shadow: var(--shadow-sm); }
.hero h2 { font-size: clamp(26px, 3.2vw, 38px); font-weight: 800; letter-spacing: -.035em; line-height: 1.1; }
.hero-desc { font-size: 16px; color: var(--ink-2); max-width: 40ch; }
.hero-meeting { font-size: 14px; }
.hero .progress { width: min(340px, 100%); --c-bar: var(--c); }
.hero-sub { color: var(--ink-2); font-size: 13px; font-weight: 600; }

.status-form { display: grid; gap: 18px; }
.status-options { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.status-option { --c: var(--brand); --soft: var(--brand-soft); position: relative; }
.status-option--maintenance { --c: var(--s-maintenance); --soft: var(--s-maintenance-soft); }
.status-option--out_of_service { --c: var(--s-out_of_service); --soft: var(--s-out_of_service-soft); }
.status-option input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.status-option-card {
  height: 100%; display: grid; gap: 4px; align-content: start;
  padding: 14px; border-radius: 14px; border: 1.5px solid var(--line); background: var(--paper);
  transition: border-color .25s, background .25s, transform .3s var(--ease-spring), box-shadow .25s;
}
.status-option-card .icon { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: var(--soft); color: var(--c); margin-bottom: 4px; transition: transform .4s var(--ease-spring); }
.status-option-card strong { font-size: 14px; }
.status-option-card small { font-size: 12px; color: var(--muted); line-height: 1.4; }
.status-option:hover .status-option-card { border-color: color-mix(in srgb, var(--c) 40%, var(--line)); }
.status-option input:checked + .status-option-card {
  border-color: var(--c); background: var(--soft);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--c) 14%, transparent);
}
.status-option input:checked + .status-option-card .icon { transform: scale(1.12) rotate(-8deg); background: var(--c); color: #fff; }
.status-option input:focus-visible + .status-option-card { outline: 3px solid var(--focus); outline-offset: 2px; }
.status-extra { display: grid; grid-template-columns: 1.6fr 1fr; gap: 12px; animation: slide-down .35s var(--ease-out); }
.form-actions { display: flex; justify-content: flex-end; }

/* ------------------------------------------------------------------ Schedule */
.timeline { padding: 18px 22px 22px; overflow-x: auto; }
.timeline-head, .timeline-row { display: grid; grid-template-columns: 200px minmax(calc(var(--hours) * 90px), 1fr); }
.timeline-head .timeline-track { height: 26px; }
.hour { position: absolute; top: 0; transform: translateX(-50%); font-size: 11.5px; font-weight: 700; color: var(--muted); font-variant-numeric: tabular-nums; }
.timeline-row { min-height: 66px; border-top: 1px solid var(--line); }
.timeline-label { display: grid; align-content: center; justify-items: start; gap: 4px; padding-right: 14px; text-decoration: none; }
.timeline-label strong { font-size: 13.5px; }
.timeline-label .pill { font-size: 11px; padding: 2px 8px 2px 6px; }
.timeline-track { position: relative; }
.gridline { position: absolute; top: 0; bottom: 0; width: 1px; background: var(--line); }
.event {
  --accent: var(--brand);
  position: absolute; top: 9px; bottom: 9px;
  display: grid; align-content: center; padding: 0 10px; min-width: 0; overflow: hidden;
  border-radius: 10px; border-left: 4px solid var(--accent);
  background: color-mix(in srgb, var(--accent) 13%, #fff);
  line-height: 1.25; white-space: nowrap;
  transform-origin: left; animation: event-in .7s var(--ease-out) both; animation-delay: calc(var(--i, 0) * 60ms + 200ms);
  transition: transform .25s var(--ease-out), box-shadow .25s;
}
.event:hover { transform: translateY(-2px); box-shadow: var(--shadow); z-index: 2; }
.event strong { font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; }
.event small { font-size: 11.5px; color: var(--ink-2); }
.event--past { opacity: .5; }
.event--live { box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 40%, transparent); }
.event--live::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(100deg, transparent 30%, rgba(255, 255, 255, .55) 50%, transparent 70%);
  background-size: 250% 100%; animation: shimmer 2.8s linear infinite;
}
@keyframes event-in { from { opacity: 0; transform: scaleX(.3); } }
.block {
  position: absolute; top: 9px; bottom: 9px; border-radius: 10px;
  display: grid; place-items: center; font-size: 12px; font-weight: 700;
  color: color-mix(in srgb, var(--c) 85%, #000);
  background: repeating-linear-gradient(-45deg, var(--soft) 0 10px, color-mix(in srgb, var(--soft) 50%, #fff) 10px 20px);
  background-size: 200% 100%;
  animation: stripes 6s linear infinite;
}
.block--maintenance { --c: var(--s-maintenance); --soft: var(--s-maintenance-soft); }
.block--out_of_service { --c: var(--s-out_of_service); --soft: var(--s-out_of_service-soft); }
@keyframes stripes { to { background-position: 56px 0; } }
.now-line { position: absolute; top: -4px; bottom: -4px; width: 2px; background: var(--s-occupied); z-index: 3; }
.timeline-row:first-of-type .now-line::before {
  content: 'Now'; position: absolute; top: -22px; left: 50%; transform: translateX(-50%);
  padding: 1px 6px; border-radius: 6px; background: var(--s-occupied); color: #fff; font-size: 10.5px; font-weight: 800;
}

/* ------------------------------------------------------------------ Animations library */
.lead { font-size: 15px; color: var(--ink-2); max-width: 70ch; }
.anim-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 18px; }
.anim-card {
  border-radius: var(--radius); overflow: hidden; background: var(--paper);
  border: 1px solid var(--line); box-shadow: var(--shadow);
  transition: transform .35s var(--ease-out), box-shadow .35s;
}
.anim-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.anim-stage { position: relative; background: var(--soft); color: var(--c); padding: 10px; }
.anim-controls { position: absolute; right: 10px; bottom: 10px; display: flex; gap: 6px; opacity: 0; transform: translateY(6px); transition: opacity .25s, transform .3s var(--ease-out); }
.anim-card:hover .anim-controls, .anim-card:focus-within .anim-controls { opacity: 1; transform: none; }
.anim-body { padding: 16px 18px 18px; display: grid; gap: 10px; justify-items: start; }
.anim-title { display: flex; align-items: center; justify-content: space-between; width: 100%; gap: 8px; font-size: 12.5px; }
.anim-body p { color: var(--ink-2); font-size: 13.5px; }
.file { display: flex; align-items: center; gap: 6px; font-size: 12.5px !important; }
.file .icon { font-size: 17px; color: var(--muted); }
.file code { font-family: ui-monospace, 'Cascadia Code', Consolas, monospace; background: #f0f3f8; padding: 2px 6px; border-radius: 6px; }
.hint { font-size: 12.5px !important; }

/* ------------------------------------------------------------------ Devices */
.device-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 18px; }
.device {
  display: grid; border-radius: var(--radius); overflow: hidden; background: var(--paper);
  border: 1px solid var(--line); box-shadow: var(--shadow);
  transition: transform .35s var(--ease-out), box-shadow .35s;
}
.device:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.device-frame { padding: 20px 26px 0; background: linear-gradient(180deg, #edf1f8, #f6f8fb); }
.device-screen {
  position: relative; aspect-ratio: 16 / 10; border-radius: 14px 14px 0 0; overflow: hidden;
  border: 10px solid #0d1526; border-bottom: 0;
  background: var(--soft, #222); color: var(--c);
  display: grid; place-items: center;
}
.device.is-offline .device-screen { background: #0a0f1c; }
.device-screen .lottie { position: absolute; inset: 0; aspect-ratio: auto; height: 100%; }
.device-dark { color: #4a5470; }
.device-dark .icon { font-size: 34px; animation: blink 2.4s ease-in-out infinite; }
.device-signal { position: absolute; top: 6px; right: 8px; color: var(--ink-2); }
.device-signal .icon { font-size: 16px; }
.device.is-offline .device-signal { color: #e0796b; animation: blink 1.4s ease-in-out infinite; }
.device-body { padding: 16px 18px 18px; display: grid; gap: 6px; }
.device-top { display: flex; align-items: center; justify-content: space-between; }
.device-top h3 { font-size: 16px; font-weight: 800; }
.device-body .muted { font-size: 13px; }
.device-body a { text-decoration: none; font-weight: 600; color: var(--ink-2); }
.battery { display: flex; align-items: center; gap: 10px; font-size: 12.5px; font-weight: 600; color: var(--ink-2); margin-top: 6px; }
.battery-bar { position: relative; width: 44px; height: 18px; border-radius: 5px; border: 2px solid #b8c0d0; padding: 2px; }
.battery-bar::after { content: ''; position: absolute; right: -5px; top: 4px; width: 3px; height: 6px; border-radius: 0 2px 2px 0; background: #b8c0d0; }
.battery-bar > span { display: block; height: 100%; width: var(--p); border-radius: 2px; background: var(--s-available); animation: grow 1.2s var(--ease-out) both; }
.battery.is-low .battery-bar > span { background: var(--s-occupied); animation: grow 1.2s var(--ease-out) both, blink 1.6s ease-in-out 1.2s infinite; }
.charging { color: var(--s-upcoming); font-variation-settings: 'FILL' 1; animation: blink 1.8s ease-in-out infinite; }
.plain-list { list-style: none; margin: 0; padding: 0; }
.plain-list li { display: flex; align-items: center; gap: 8px; padding: 10px 0; border-top: 1px solid var(--line); }
.plain-list li:first-child { border-top: 0; }
.plain-list .btn { margin-left: auto; }

/* ------------------------------------------------------------------ Sign in */
.auth-body { background: var(--paper); }
.auth { display: grid; grid-template-columns: 1.1fr 1fr; min-height: 100vh; }
.auth-showcase {
  position: relative; overflow: hidden;
  display: grid; grid-template-rows: auto 1fr auto; gap: 20px;
  padding: 36px 48px 48px;
  background: var(--sidebar); color: #fff;
}
.auth-showcase::before {
  content: ''; position: absolute; width: 640px; height: 640px; right: -220px; top: -180px; border-radius: 50%;
  background: radial-gradient(circle, rgba(0, 163, 255, .28), transparent 65%);
  animation: drift 14s ease-in-out infinite;
}
.auth-showcase::after {
  content: ''; position: absolute; width: 520px; height: 520px; left: -200px; bottom: -240px; border-radius: 50%;
  background: radial-gradient(circle, rgba(0, 100, 255, .35), transparent 65%);
  animation: drift 11s ease-in-out infinite reverse;
}
.auth-showcase > * { position: relative; }
.showcase-stage { position: relative; display: grid; place-items: center; }
.showcase-slide {
  grid-area: 1 / 1; margin: 0; width: min(560px, 100%);
  display: grid; gap: 18px; justify-items: center;
  opacity: 0; transform: translateY(20px) scale(.96);
  transition: opacity .7s ease, transform .9s var(--ease-out);
  pointer-events: none;
}
.showcase-slide.is-active { opacity: 1; transform: none; }
.showcase-slide .lottie { border-radius: 24px; background: rgba(255, 255, 255, .96); box-shadow: 0 30px 60px -30px rgba(0, 0, 0, .6); }
.showcase-slide figcaption { display: flex; align-items: center; gap: 12px; color: #c3cde6; font-size: 14px; }
.showcase-copy h2 { font-size: 30px; font-weight: 800; letter-spacing: -.035em; }
.showcase-copy p { margin-top: 8px; color: #a7b3d1; max-width: 46ch; font-size: 15px; }

.auth-panel { display: grid; place-items: center; padding: 32px; }
.auth-card { width: min(400px, 100%); display: grid; gap: 18px; }
.auth-card h1 { font-size: 30px; font-weight: 800; }
.auth-card h1 .dot { color: var(--brand); }
.auth-logo { width: 150px; height: auto; margin-bottom: 8px; animation: rise .7s var(--ease-out) both; }
.auth-card > .muted { margin-top: -14px; }
.auth-card .btn { height: 50px; margin-top: 6px; font-size: 15px; }
.auth-card.has-error { animation: shake .5s ease; }
.reveal-pass { width: 34px; height: 34px; }

/* ------------------------------------------------------------------ Responsive */
@media (max-width: 1280px) {
  .stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .dash-grid { grid-template-columns: 1fr; }
  .side-col { position: static; grid-template-columns: 1fr 1fr; }
}
@media (max-width: 1000px) {
  .sidebar { transform: translateX(-100%); box-shadow: var(--shadow-lg); }
  body.nav-open .sidebar { transform: none; }
  body.nav-open .scrim { display: block; position: fixed; inset: 0; z-index: 25; background: rgba(6, 12, 28, .4); animation: fade .3s ease; }
  .main { margin-left: 0; }
  .icon-btn.menu-btn { display: inline-grid; }
  .room-detail { grid-template-columns: 1fr; }
  .auth { grid-template-columns: 1fr; }
  .auth-showcase { display: none; }
}
@media (max-width: 720px) {
  .topbar { padding: 12px 16px; }
  .topbar h1 { font-size: 20px; }
  .content { padding: 4px 16px 32px; gap: 16px; }
  .toast { margin: 0 16px 6px; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .side-col { grid-template-columns: 1fr; }
  .hero { grid-template-columns: 1fr; padding: 20px; }
  .status-options, .status-extra { grid-template-columns: 1fr; }
  .hide-sm { display: none; }
  .room-thumb { width: 60px; }
  .table td, .table th { padding: 10px 12px; }
  .timeline-head, .timeline-row { grid-template-columns: 130px minmax(calc(var(--hours) * 80px), 1fr); }
  .clock { padding: 6px 10px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  @view-transition { navigation: none; }
}
