:root {
  color-scheme: dark;
  --bg: #081512;
  --panel: #10251f;
  --panel-2: #163129;
  --text: #effbf6;
  --muted: #9fbab0;
  --green: #29c77f;
  --green-dark: #15945b;
  --danger: #f06d72;
  --border: rgba(255, 255, 255, 0.1);
  --shadow: 0 20px 60px rgba(0, 0, 0, 0.32);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }

html, body { min-height: 100%; }

body {
  margin: 0;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  color: var(--text);
  background:
    radial-gradient(circle at 15% 15%, rgba(41, 199, 127, 0.15), transparent 35%),
    radial-gradient(circle at 85% 80%, rgba(28, 116, 85, 0.18), transparent 30%),
    var(--bg);
}

button, input { font: inherit; }

.topbar {
  min-height: 72px;
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  border-bottom: 1px solid var(--border);
  background: rgba(8, 21, 18, 0.82);
  backdrop-filter: blur(14px);
}
.topbar-actions, .control-strip, .control-status { display: flex; align-items: center; }
.topbar-actions { justify-content: flex-end; gap: 14px; min-width: 0; }
.control-strip { gap: 10px; }
.control-status { gap: 9px; color: var(--muted); white-space: nowrap; }
.control-status strong { color: var(--text); }
.kiosk-label { padding: 3px 7px; border-radius: 999px; color: var(--muted); background: rgba(255,255,255,.07); font-size: .7rem; }
.control-strip button { padding: 9px 12px; }

.brand { display: flex; align-items: center; gap: 12px; }
.brand strong, .brand small { display: block; }
.brand small { color: var(--muted); margin-top: 2px; }
.brand-mark {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 13px;
  color: #062117;
  background: var(--green);
  font-weight: 900;
  box-shadow: 0 0 0 5px rgba(41, 199, 127, 0.1);
}

#app { flex: 1 1 auto; min-height: 0; padding: 32px; }
#app.desktop-app { display: grid; grid-template-rows: minmax(0, 1fr); padding: 12px; }

.centered { min-height: calc(100vh - 136px); display: grid; place-items: center; }

.card {
  width: min(100%, 520px);
  padding: 28px;
  border: 1px solid var(--border);
  border-radius: 22px;
  background: linear-gradient(150deg, rgba(22, 49, 41, 0.96), rgba(12, 31, 26, 0.96));
  box-shadow: var(--shadow);
}

.card.wide { width: min(100%, 760px); }
.card h1, .card h2 { margin: 0 0 10px; }
.card p { color: var(--muted); line-height: 1.55; }
.eyebrow { color: var(--green); text-transform: uppercase; letter-spacing: .12em; font-size: .75rem; font-weight: 800; }

form { display: grid; gap: 16px; margin-top: 24px; }
label { display: grid; gap: 7px; color: var(--muted); font-size: .9rem; }
input {
  width: 100%;
  padding: 12px 14px;
  color: var(--text);
  background: rgba(0, 0, 0, 0.22);
  border: 1px solid var(--border);
  border-radius: 11px;
  outline: none;
}
input:focus { border-color: var(--green); box-shadow: 0 0 0 3px rgba(41, 199, 127, 0.12); }

.actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 22px; }
button {
  cursor: pointer;
  border: 0;
  border-radius: 11px;
  padding: 11px 16px;
  font-weight: 750;
  color: #062117;
  background: var(--green);
}
button:hover { filter: brightness(1.08); }
button:disabled { cursor: wait; opacity: .55; }
button.secondary { color: var(--text); background: rgba(255, 255, 255, .09); }
button.danger { color: #fff; background: #a33f48; }
button.text-button { padding: 8px 11px; color: var(--muted); background: transparent; }

.error { color: #ffd0d2; background: rgba(240, 109, 114, .12); border: 1px solid rgba(240, 109, 114, .25); padding: 10px 12px; border-radius: 10px; }
.hidden { display: none !important; }

.loading-card { margin: 15vh auto; text-align: center; }
.spinner { width: 30px; height: 30px; margin: 0 auto; border: 3px solid rgba(255,255,255,.15); border-top-color: var(--green); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.user-pill { display: flex; align-items: center; gap: 8px; color: var(--muted); }
.user-pill strong { color: var(--text); }

.status-dot { width: 12px; height: 12px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 5px rgba(41, 199, 127, .12); }
.status-dot.busy { background: #f5b949; box-shadow: 0 0 0 5px rgba(245, 185, 73, .12); }
.occupant { display: flex; align-items: center; gap: 14px; padding: 16px; border-radius: 14px; background: rgba(0,0,0,.18); margin-top: 20px; }
.occupant strong, .occupant small { display: block; }
.occupant small { color: var(--muted); margin-top: 3px; }
.avatar { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 50%; background: #274c40; color: var(--green); font-weight: 900; }

.desktop-layout { min-height: 0; display: grid; }
.desktop-shell { min-height: 0; overflow: hidden; border: 1px solid var(--border); border-radius: 16px; background: #000; box-shadow: var(--shadow); }
.desktop-shell iframe { width: 100%; height: 100%; border: 0; display: block; }
.desktop-shell.viewer { position: relative; }
.viewer-badge { position: absolute; z-index: 2; top: 12px; right: 12px; padding: 7px 10px; border-radius: 999px; color: #2b1c00; background: #f5b949; font-size: .78rem; font-weight: 850; box-shadow: 0 6px 20px rgba(0,0,0,.25); pointer-events: none; }

.admin { margin-top: 28px; padding-top: 22px; border-top: 1px solid var(--border); }
.admin summary { cursor: pointer; color: var(--muted); font-weight: 750; }
.user-list { display: grid; gap: 8px; margin: 16px 0; }
.user-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 11px 12px; background: rgba(0,0,0,.16); border-radius: 10px; }
.user-row small { color: var(--muted); }
.compact-form { grid-template-columns: 1fr 1fr; }
.compact-form button, .compact-form .error { grid-column: 1 / -1; }

.modal-backdrop { position: fixed; z-index: 20; inset: 0; display: grid; place-items: center; padding: 20px; background: rgba(2, 10, 8, .78); backdrop-filter: blur(8px); }
.admin-modal-card { max-height: calc(100vh - 40px); overflow: auto; }
.modal-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; }
.modal-heading h2 { margin-top: 4px; }

.toast { position: fixed; right: 22px; bottom: 22px; max-width: 380px; padding: 13px 16px; border-radius: 11px; color: var(--text); background: #244b3f; box-shadow: var(--shadow); opacity: 0; transform: translateY(10px); pointer-events: none; transition: .2s ease; }
.toast.visible { opacity: 1; transform: translateY(0); }

@media (max-width: 700px) {
  .topbar { padding: 8px 14px; gap: 10px; flex-wrap: wrap; }
  .topbar-actions { flex: 1 1 100%; justify-content: space-between; gap: 8px; }
  .control-strip { flex-wrap: wrap; }
  .control-status { font-size: .82rem; }
  .control-strip button { padding: 8px 10px; font-size: .82rem; }
  #app { padding: 14px; }
  #app.desktop-app { padding: 8px; }
  .brand small, .user-pill span { display: none; }
  .card { padding: 22px; }
  .compact-form { grid-template-columns: 1fr; }
}
