:root {
  color-scheme: light;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #eef5f8;
  color: #102033;
  --ink: #102033;
  --muted: #637486;
  --line: #d7e4ec;
  --panel: #ffffff;
  --soft: #f6fbfd;
  --brand: #006fba;
  --brand-dark: #00528f;
  --teal: #00a1a8;
  --mint: #e4f8f4;
  --amber: #f5a623;
  --danger: #c02626;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background:
    linear-gradient(180deg, #f8fcff 0%, #eef5f8 44%, #eaf2f5 100%);
}

button,
input,
textarea {
  font: inherit;
}

.shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.topbar {
  min-height: 112px;
  padding: 20px clamp(18px, 3vw, 42px);
  background: rgba(255, 255, 255, 0.94);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 10px 30px rgba(16, 32, 51, 0.06);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 18px;
}

.brandLogo {
  width: clamp(190px, 22vw, 330px);
  height: auto;
  display: block;
}

.eyebrow {
  margin: 0 0 5px;
  color: var(--teal);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: clamp(26px, 3vw, 38px);
  line-height: 1;
  letter-spacing: 0;
}

h2 {
  font-size: 20px;
  letter-spacing: 0;
}

.status {
  padding: 10px 13px;
  border-radius: 8px;
  background: var(--mint);
  color: #08736f;
  font-weight: 800;
  white-space: nowrap;
}

.topActions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.hidden {
  display: none !important;
}

.loginWrap {
  flex: 1;
  min-height: calc(100vh - 112px);
  display: grid;
  place-items: center;
  padding: 24px;
}

.loginPanel {
  width: min(460px, 100%);
  box-shadow: 0 24px 60px rgba(16, 32, 51, 0.12);
}

.errorText {
  min-height: 20px;
  margin: 10px 0 0;
  color: var(--danger);
  font-weight: 800;
}

.layout {
  flex: 1;
  display: grid;
  grid-template-columns: 360px 1fr;
  gap: 20px;
  padding: 20px clamp(18px, 3vw, 42px) 26px;
}

.layout.superMode {
  display: block;
  padding-bottom: 118px;
}

.panel {
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: clamp(18px, 2vw, 26px);
  box-shadow: 0 18px 45px rgba(16, 32, 51, 0.07);
}

.mainArea {
  display: grid;
  gap: 20px;
}

.superMode .mainArea {
  min-height: calc(100vh - 250px);
}

.superMode #userPanel,
.superMode #recordPanel,
.superMode #detailPanel {
  min-height: calc(100vh - 276px);
}

label {
  display: grid;
  gap: 7px;
  margin-bottom: 13px;
  color: #31465b;
  font-size: 13px;
  font-weight: 800;
}

input,
textarea {
  width: 100%;
  border: 1px solid #c8d8e2;
  border-radius: 8px;
  padding: 11px 12px;
  color: var(--ink);
  background: #ffffff;
  outline: none;
}

input:focus,
textarea:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(0, 111, 186, 0.12);
}

textarea {
  min-height: 92px;
  resize: vertical;
}

.grid2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.grid3 {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 10px;
}

button {
  min-height: 42px;
  border: 0;
  border-radius: 8px;
  padding: 0 14px;
  color: #ffffff;
  background: linear-gradient(180deg, var(--brand), var(--brand-dark));
  font-weight: 900;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(0, 111, 186, 0.18);
}

button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

button.secondary {
  color: var(--ink);
  background: #eaf2f6;
  box-shadow: none;
}

button:hover {
  filter: brightness(0.98);
}

.sectionHeader,
.roomRow,
.summaryGrid {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.roomList {
  display: grid;
  gap: 10px;
}

.userList {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.roomRow {
  min-height: 64px;
  border: 1px solid #dbe8ef;
  border-radius: 8px;
  padding: 14px;
  background: linear-gradient(180deg, #ffffff 0%, var(--soft) 100%);
}

.roomRow:hover {
  border-color: rgba(0, 111, 186, 0.35);
  box-shadow: 0 10px 24px rgba(16, 32, 51, 0.08);
}

.userActions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.inlineInput {
  max-width: 180px;
  min-height: 38px;
}

.roomRow strong {
  display: block;
  margin-bottom: 4px;
}

.muted {
  color: var(--muted);
}

.code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-weight: 900;
  letter-spacing: 0;
}

.detailGrid {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 18px;
}

.qr {
  width: 200px;
  height: 200px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.summaryGrid {
  align-items: stretch;
  flex-wrap: wrap;
  margin: 12px 0;
}

.metric {
  min-width: 140px;
  flex: 1;
  border-radius: 8px;
  padding: 12px;
  background: #eef7fa;
  border: 1px solid #d9ebf0;
}

.metric small {
  display: block;
  color: var(--muted);
  font-weight: 800;
}

.metric b {
  display: block;
  margin-top: 5px;
  font-size: 20px;
}

table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 14px;
}

th,
td {
  border-bottom: 1px solid #e1ebf0;
  padding: 10px;
  text-align: left;
  font-size: 14px;
}

th {
  color: #455b70;
  background: #f2f8fb;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.bottomTabs {
  position: fixed;
  left: 50%;
  bottom: 22px;
  z-index: 20;
  width: min(760px, calc(100vw - 36px));
  transform: translateX(-50%);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  padding: 10px;
  border: 1px solid rgba(215, 228, 236, 0.95);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 20px 50px rgba(16, 32, 51, 0.18);
  backdrop-filter: blur(12px);
}

.tabControl {
  min-height: 58px;
  color: #41566c;
  background: #eef5f8;
  box-shadow: none;
  font-size: 18px;
}

.tabControl.active {
  color: #ffffff;
  background: linear-gradient(180deg, var(--brand), #0087c6);
  box-shadow: 0 10px 24px rgba(0, 111, 186, 0.22);
}

@media (max-width: 920px) {
  .layout,
  .detailGrid {
    grid-template-columns: 1fr;
  }

  .grid3 {
    grid-template-columns: 1fr;
  }

  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .topActions {
    width: 100%;
    justify-content: space-between;
  }

  .brandLogo {
    width: min(230px, 52vw);
  }

  .roomRow {
    align-items: flex-start;
    flex-direction: column;
  }
}
