:root {
  color-scheme: dark;
  --bg: #090b0f;
  --surface: rgba(18, 21, 28, 0.92);
  --surface-2: #171a22;
  --surface-3: #20242e;
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.14);
  --text: #f6f7f9;
  --muted: #8b919e;
  --red: #ee263f;
  --red-dark: #a81228;
  --green: #45d483;
  --yellow: #f4bf50;
  --blue: #6da8ff;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.45);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

[hidden] {
  display: none !important;
}

.admin-app.full-panel-mode {
  position: fixed;
  inset: 0;
  display: block;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  background: #05070d;
}

.admin-app.full-panel-mode > :not(.full-panel-frame) {
  display: none !important;
}

.full-panel-frame {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  background: #05070d;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
}

body {
  min-height: 100vh;
  overflow-x: hidden;
}

button, input, textarea, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { color: inherit; }

.ambient {
  position: fixed;
  z-index: 0;
  width: 38rem;
  height: 38rem;
  border-radius: 50%;
  pointer-events: none;
  filter: blur(100px);
  opacity: 0.12;
}

.ambient-one { top: -18rem; left: -14rem; background: var(--red); }
.ambient-two { right: -18rem; bottom: -20rem; background: #5d2335; }

.eyebrow {
  margin: 0 0 0.45rem;
  color: var(--red);
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.login-screen {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 2rem;
}

.login-card {
  width: min(31rem, 100%);
  padding: 2.3rem;
  border: 1px solid var(--border-strong);
  border-radius: 1.6rem;
  background:
    linear-gradient(145deg, rgba(238, 38, 63, 0.08), transparent 38%),
    rgba(15, 18, 24, 0.94);
  box-shadow: var(--shadow);
  backdrop-filter: blur(22px);
}

.brand-lockup, .sidebar-brand {
  display: flex;
  align-items: center;
  gap: 0.8rem;
}

.brand-lockup { margin-bottom: 3.5rem; }
.brand-lockup img, .sidebar-brand img { object-fit: contain; }
.brand-lockup img { width: 3rem; height: 3rem; }
.brand-lockup div, .sidebar-brand div { display: flex; flex-direction: column; }
.brand-lockup span, .sidebar-brand span {
  color: var(--muted);
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.18em;
}
.brand-lockup strong { font-size: 1.05rem; letter-spacing: 0.08em; }

.login-card h1 {
  margin: 0;
  max-width: 24rem;
  font-size: clamp(2rem, 6vw, 3.4rem);
  line-height: 1.03;
  letter-spacing: -0.055em;
}

.login-copy {
  margin: 1.3rem 0 1.7rem;
  color: #aab0bc;
  font-size: 0.96rem;
  line-height: 1.7;
}

.login-error {
  margin-bottom: 1rem;
  padding: 0.85rem 1rem;
  border: 1px solid rgba(238, 38, 63, 0.35);
  border-radius: 0.8rem;
  background: rgba(238, 38, 63, 0.1);
  color: #ff9eaa;
  font-size: 0.85rem;
}

.discord-login {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.7rem;
  width: 100%;
  padding: 0.95rem 1rem;
  border-radius: 0.85rem;
  background: #5865f2;
  color: white;
  font-weight: 800;
  text-decoration: none;
  box-shadow: 0 12px 30px rgba(88, 101, 242, 0.25);
  transition: transform 160ms ease, background 160ms ease;
}

.discord-login:hover { background: #6874f7; transform: translateY(-1px); }
.discord-mark {
  display: grid;
  width: 1.55rem;
  height: 1.55rem;
  place-items: center;
  border-radius: 0.45rem;
  background: rgba(255, 255, 255, 0.16);
  font-size: 0.75rem;
}

.security-note {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  margin-top: 1rem;
  color: var(--muted);
  font-size: 0.7rem;
}

.status-dot {
  display: inline-block;
  width: 0.55rem;
  height: 0.55rem;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 4px rgba(69, 212, 131, 0.09), 0 0 18px rgba(69, 212, 131, 0.5);
}

.status-dot.offline {
  background: var(--red);
  box-shadow: 0 0 0 4px rgba(238, 38, 63, 0.09), 0 0 18px rgba(238, 38, 63, 0.45);
}

.admin-app {
  position: relative;
  z-index: 1;
  min-height: 100vh;
}

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 10;
  width: 15.5rem;
  display: flex;
  flex-direction: column;
  padding: 1.4rem 1rem;
  border-right: 1px solid var(--border);
  background: rgba(11, 13, 18, 0.96);
  backdrop-filter: blur(20px);
}

.sidebar-brand {
  min-height: 3.8rem;
  padding: 0 0.7rem;
}
.sidebar-brand img { width: 2.3rem; height: 2.3rem; }
.sidebar-brand strong { font-size: 0.9rem; letter-spacing: 0.12em; }

.sidebar nav {
  display: grid;
  gap: 0.35rem;
  margin-top: 3.4rem;
}

.nav-button {
  position: relative;
  width: 100%;
  display: grid;
  grid-template-columns: 1.55rem 1fr auto;
  align-items: center;
  gap: 0.55rem;
  padding: 0.78rem 0.85rem;
  border: 0;
  border-radius: 0.7rem;
  background: transparent;
  color: var(--muted);
  text-align: left;
  cursor: pointer;
  transition: background 150ms ease, color 150ms ease;
}

.nav-button:hover { color: var(--text); background: rgba(255, 255, 255, 0.035); }
.nav-button.active {
  color: white;
  background: linear-gradient(90deg, rgba(238, 38, 63, 0.18), rgba(238, 38, 63, 0.04));
}
.nav-button.active::before {
  content: "";
  position: absolute;
  left: 0;
  width: 0.18rem;
  height: 1.55rem;
  border-radius: 1rem;
  background: var(--red);
  box-shadow: 0 0 18px rgba(238, 38, 63, 0.65);
}
.nav-icon { color: var(--red); text-align: center; font-size: 0.85rem; }
.nav-button span:nth-child(2) { font-size: 0.82rem; font-weight: 700; }
.nav-button em {
  min-width: 1.35rem;
  padding: 0.13rem 0.38rem;
  border-radius: 1rem;
  background: var(--surface-3);
  color: #aeb4bf;
  font-size: 0.62rem;
  font-style: normal;
  text-align: center;
}

.sidebar-footer { margin-top: auto; padding: 0.7rem; }
.connection-state { display: flex; align-items: center; gap: 0.75rem; }
.connection-state div { display: flex; flex-direction: column; gap: 0.1rem; }
.connection-state strong { font-size: 0.72rem; }
.connection-state span:last-child { color: var(--muted); font-size: 0.62rem; }

.workspace {
  min-height: 100vh;
  margin-left: 15.5rem;
  padding: 0 2.2rem 3rem;
}

.topbar {
  min-height: 7.2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  border-bottom: 1px solid var(--border);
}
.topbar h1 { margin: 0; font-size: 1.55rem; letter-spacing: -0.035em; }
.topbar-actions { display: flex; align-items: center; gap: 0.7rem; }

.icon-button, .logout-button, .secondary-button, .primary-button, .danger-button {
  border: 1px solid var(--border-strong);
  cursor: pointer;
  transition: transform 150ms ease, background 150ms ease, border 150ms ease;
}
.icon-button {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 0.7rem;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 1.15rem;
}
.icon-button:hover { color: white; border-color: rgba(238, 38, 63, 0.5); }
.icon-button.loading { animation: spin 800ms linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.user-chip {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  min-width: 14rem;
  padding: 0.45rem 0.55rem;
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  background: rgba(255, 255, 255, 0.025);
}
.user-chip img {
  width: 2rem;
  height: 2rem;
  border-radius: 0.55rem;
  object-fit: cover;
  background: var(--surface-3);
}
.user-chip div { display: flex; flex: 1; flex-direction: column; min-width: 0; }
.user-chip strong { overflow: hidden; font-size: 0.73rem; text-overflow: ellipsis; white-space: nowrap; }
.user-chip div span { color: var(--muted); font-size: 0.62rem; text-transform: uppercase; }
.duty-badge {
  padding: 0.2rem 0.42rem;
  border-radius: 0.35rem;
  background: rgba(238, 38, 63, 0.12);
  color: #ff8292;
  font-size: 0.55rem;
  font-weight: 800;
  letter-spacing: 0.06em;
}
.duty-badge.online { background: rgba(69, 212, 131, 0.12); color: var(--green); }

.logout-button {
  padding: 0.65rem 0.8rem;
  border-radius: 0.65rem;
  background: transparent;
  color: var(--muted);
  font-size: 0.72rem;
}
.logout-button:hover { color: white; background: rgba(238, 38, 63, 0.1); }

.loading-bar {
  position: fixed;
  z-index: 30;
  top: 0;
  left: 15.5rem;
  right: 0;
  height: 2px;
  overflow: hidden;
}
.loading-bar span {
  display: block;
  width: 35%;
  height: 100%;
  background: var(--red);
  box-shadow: 0 0 14px var(--red);
  animation: loading 1s ease-in-out infinite;
}
@keyframes loading { from { transform: translateX(-120%); } to { transform: translateX(400%); } }

.view { display: none; padding-top: 2rem; }
.view.active { display: block; animation: view-in 180ms ease; }
@keyframes view-in { from { opacity: 0; transform: translateY(4px); } }

.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.85rem;
}
.stat-card {
  min-height: 8.3rem;
  display: flex;
  flex-direction: column;
  padding: 1.15rem 1.25rem;
  border: 1px solid var(--border);
  border-radius: 1rem;
  background: var(--surface);
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.16);
}
.stat-card.accent {
  background:
    linear-gradient(135deg, rgba(238, 38, 63, 0.16), rgba(238, 38, 63, 0.025) 60%),
    var(--surface);
  border-color: rgba(238, 38, 63, 0.25);
}
.stat-card span { color: var(--muted); font-size: 0.7rem; font-weight: 700; }
.stat-card strong { margin: auto 0 0.1rem; font-size: 2rem; letter-spacing: -0.06em; }
.stat-card small { color: #696f7b; font-size: 0.62rem; }

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(20rem, 0.8fr);
  gap: 0.9rem;
  margin-top: 0.9rem;
}

.panel {
  border: 1px solid var(--border);
  border-radius: 1rem;
  background: var(--surface);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.15);
}
.panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.2rem 1.25rem;
  border-bottom: 1px solid var(--border);
}
.panel-heading h2, .section-toolbar h2 { margin: 0; font-size: 1rem; letter-spacing: -0.025em; }

.live-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.3rem 0.55rem;
  border-radius: 2rem;
  background: rgba(69, 212, 131, 0.08);
  color: var(--green);
  font-size: 0.56rem;
  font-weight: 800;
}
.live-pill i {
  width: 0.38rem;
  height: 0.38rem;
  border-radius: 50%;
  background: currentColor;
  animation: pulse 1.6s ease infinite;
}
@keyframes pulse { 50% { opacity: 0.3; } }

.duty-list {
  min-height: 12rem;
  display: grid;
  align-content: start;
  gap: 0.55rem;
  padding: 1rem;
}
.duty-entry {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.72rem;
  border-radius: 0.75rem;
  background: rgba(255, 255, 255, 0.025);
}
.duty-entry .avatar-letter {
  width: 2.1rem;
  height: 2.1rem;
  display: grid;
  place-items: center;
  border-radius: 0.6rem;
  background: rgba(238, 38, 63, 0.12);
  color: #ff8796;
  font-size: 0.75rem;
  font-weight: 800;
}
.duty-entry div { display: flex; flex: 1; flex-direction: column; }
.duty-entry strong { font-size: 0.76rem; }
.duty-entry span { color: var(--muted); font-size: 0.63rem; }
.duty-entry em { color: var(--green); font-size: 0.59rem; font-style: normal; font-weight: 800; }

.empty-state {
  color: var(--muted);
  font-size: 0.75rem;
  text-align: center;
}
.empty-state.large { padding: 5rem 1rem; }

.access-panel { overflow: hidden; }
.access-state {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 1.2rem;
}
.access-icon {
  width: 2.7rem;
  height: 2.7rem;
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 0.8rem;
  background: rgba(69, 212, 131, 0.1);
  color: var(--green);
  font-weight: 900;
}
.access-icon.blocked { background: rgba(244, 191, 80, 0.1); color: var(--yellow); }
.access-state strong { display: block; font-size: 0.82rem; }
.access-state p { margin: 0.25rem 0 0; color: var(--muted); font-size: 0.68rem; line-height: 1.5; }
.access-details { margin: 0; padding: 0 1.2rem 1.2rem; }
.access-details div {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.55rem 0;
  border-top: 1px solid var(--border);
  font-size: 0.66rem;
}
.access-details dt { color: var(--muted); }
.access-details dd { margin: 0; color: #cdd1d9; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }

.search-box {
  width: min(20rem, 100%);
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.55rem 0.7rem;
  border: 1px solid var(--border);
  border-radius: 0.7rem;
  background: #0e1117;
  color: var(--muted);
}
.search-box input {
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  color: white;
  font-size: 0.74rem;
}
.search-box input::placeholder { color: #5f6570; }

.table-wrap { overflow: auto; }
table { width: 100%; border-collapse: collapse; min-width: 760px; }
th, td { padding: 0.85rem 1rem; border-bottom: 1px solid var(--border); text-align: left; }
th { color: #6f7682; font-size: 0.58rem; letter-spacing: 0.08em; text-transform: uppercase; }
td { color: #c5cad3; font-size: 0.72rem; }
tbody tr { transition: background 130ms ease; }
tbody tr:hover { background: rgba(255, 255, 255, 0.018); }
.player-name { display: flex; flex-direction: column; gap: 0.1rem; }
.player-name strong { color: white; font-size: 0.73rem; }
.player-name span { color: var(--muted); font-size: 0.6rem; }
.state-pill {
  display: inline-flex;
  padding: 0.25rem 0.45rem;
  border-radius: 0.4rem;
  background: rgba(109, 168, 255, 0.08);
  color: var(--blue);
  font-size: 0.56rem;
  font-weight: 800;
}
.state-pill.duty { background: rgba(69, 212, 131, 0.08); color: var(--green); }
.state-pill.frozen { background: rgba(244, 191, 80, 0.08); color: var(--yellow); }

.row-actions { display: flex; flex-wrap: wrap; gap: 0.3rem; }
.action-button {
  padding: 0.32rem 0.5rem;
  border: 1px solid var(--border);
  border-radius: 0.42rem;
  background: var(--surface-2);
  color: #aeb4bf;
  font-size: 0.56rem;
  font-weight: 700;
  cursor: pointer;
}
.action-button:hover:not(:disabled) { color: white; border-color: rgba(238, 38, 63, 0.38); }
.action-button.danger { color: #ff8796; }
.action-button:disabled { cursor: not-allowed; opacity: 0.35; }

.section-toolbar {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}
.filter-chips { display: flex; gap: 0.35rem; }
.filter-chip {
  padding: 0.4rem 0.7rem;
  border: 1px solid var(--border);
  border-radius: 2rem;
  background: transparent;
  color: var(--muted);
  font-size: 0.64rem;
  cursor: pointer;
}
.filter-chip.active { border-color: rgba(238, 38, 63, 0.35); background: rgba(238, 38, 63, 0.1); color: #ff95a2; }

.report-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.8rem;
}
.report-card {
  display: flex;
  flex-direction: column;
  min-height: 16rem;
  padding: 1.1rem;
  border: 1px solid var(--border);
  border-radius: 0.9rem;
  background: var(--surface);
}
.report-top { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.report-number { color: var(--red); font: 700 0.64rem ui-monospace, monospace; }
.report-status {
  padding: 0.25rem 0.48rem;
  border-radius: 0.4rem;
  background: rgba(244, 191, 80, 0.08);
  color: var(--yellow);
  font-size: 0.55rem;
  font-weight: 800;
  text-transform: uppercase;
}
.report-status.claimed { background: rgba(109, 168, 255, 0.08); color: var(--blue); }
.report-card h3 { margin: 1rem 0 0.35rem; font-size: 0.92rem; }
.report-meta { color: var(--muted); font-size: 0.62rem; }
.report-content {
  display: -webkit-box;
  margin: 0.85rem 0;
  overflow: hidden;
  color: #aeb4bf;
  font-size: 0.7rem;
  line-height: 1.55;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 4;
}
.report-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-top: auto;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border);
}
.report-footer span { color: var(--muted); font-size: 0.6rem; }

.weather-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(20rem, 0.7fr);
  gap: 0.9rem;
}
.weather-current {
  padding: 0.35rem 0.6rem;
  border-radius: 0.45rem;
  background: rgba(238, 38, 63, 0.09);
  color: #ff8998;
  font: 700 0.65rem ui-monospace, monospace;
}
.weather-types {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.55rem;
  padding: 1rem;
}
.weather-type {
  min-height: 4.5rem;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: end;
  padding: 0.7rem;
  border: 1px solid var(--border);
  border-radius: 0.7rem;
  background: rgba(255, 255, 255, 0.018);
  color: var(--muted);
  cursor: pointer;
}
.weather-type strong { color: #d9dce2; font-size: 0.68rem; }
.weather-type span { margin-top: 0.12rem; font-size: 0.54rem; font-family: ui-monospace, monospace; }
.weather-type.active { border-color: rgba(238, 38, 63, 0.4); background: rgba(238, 38, 63, 0.09); color: #ff8998; }
.time-row {
  display: flex;
  align-items: end;
  justify-content: center;
  gap: 0.8rem;
  padding: 1rem 1rem 1.4rem;
  border-top: 1px solid var(--border);
}
.time-row label { display: flex; flex-direction: column; gap: 0.4rem; color: var(--muted); font-size: 0.62rem; }
.time-row input {
  width: 5.5rem;
  padding: 0.7rem;
  border: 1px solid var(--border);
  border-radius: 0.65rem;
  outline: none;
  background: #0e1117;
  color: white;
  font: 700 1.15rem ui-monospace, monospace;
  text-align: center;
}
.time-row input:focus { border-color: rgba(238, 38, 63, 0.5); }
.time-row > span { padding-bottom: 0.68rem; color: var(--muted); font-size: 1.2rem; }

.weather-options { padding-bottom: 1rem; }
.switch-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.9rem 1.1rem;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
}
.switch-row > span { display: flex; flex-direction: column; gap: 0.12rem; }
.switch-row strong { font-size: 0.7rem; }
.switch-row small { color: var(--muted); font-size: 0.58rem; }
.switch-row input { position: absolute; opacity: 0; pointer-events: none; }
.switch-row i {
  position: relative;
  width: 2rem;
  height: 1.1rem;
  flex: 0 0 auto;
  border-radius: 2rem;
  background: #30343d;
  transition: background 150ms ease;
}
.switch-row i::after {
  content: "";
  position: absolute;
  top: 0.18rem;
  left: 0.2rem;
  width: 0.74rem;
  height: 0.74rem;
  border-radius: 50%;
  background: #9298a3;
  transition: transform 150ms ease, background 150ms ease;
}
.switch-row input:checked + i { background: rgba(238, 38, 63, 0.35); }
.switch-row input:checked + i::after { transform: translateX(0.85rem); background: var(--red); }

.primary-button, .danger-button, .secondary-button {
  padding: 0.7rem 0.9rem;
  border-radius: 0.65rem;
  font-size: 0.7rem;
  font-weight: 800;
}
.primary-button {
  display: block;
  width: calc(100% - 2.2rem);
  margin: 1rem 1.1rem 0;
  border-color: var(--red);
  background: var(--red);
  color: white;
}
.primary-button:hover:not(:disabled) { background: #ff3850; transform: translateY(-1px); }
.primary-button:disabled { cursor: not-allowed; opacity: 0.38; }
.secondary-button { background: var(--surface-3); color: #c8ccd4; }
.danger-button { border-color: var(--red); background: var(--red); color: white; }
.permission-note { margin: 0.65rem 1.1rem 0; color: var(--yellow); font-size: 0.62rem; line-height: 1.45; }

.reason-dialog {
  width: min(28rem, calc(100% - 2rem));
  padding: 0;
  border: 1px solid var(--border-strong);
  border-radius: 1rem;
  background: #14171e;
  color: white;
  box-shadow: var(--shadow);
}
.reason-dialog::backdrop { background: rgba(3, 4, 7, 0.78); backdrop-filter: blur(6px); }
.reason-dialog form { padding: 1.3rem; }
.reason-dialog h2 { margin: 0; font-size: 1.15rem; }
.reason-dialog p:not(.eyebrow) { color: var(--muted); font-size: 0.72rem; line-height: 1.5; }
.reason-dialog label { display: flex; flex-direction: column; gap: 0.45rem; color: var(--muted); font-size: 0.65rem; }
.reason-dialog textarea {
  resize: vertical;
  padding: 0.75rem;
  border: 1px solid var(--border-strong);
  border-radius: 0.65rem;
  outline: 0;
  background: #0d1016;
  color: white;
  line-height: 1.5;
}
.reason-dialog textarea:focus { border-color: rgba(238, 38, 63, 0.55); }
.dialog-actions { display: flex; justify-content: flex-end; gap: 0.55rem; margin-top: 1rem; }

.toast-region {
  position: fixed;
  z-index: 100;
  right: 1rem;
  bottom: 1rem;
  width: min(22rem, calc(100% - 2rem));
  display: grid;
  gap: 0.5rem;
}
.toast {
  padding: 0.8rem 0.9rem;
  border: 1px solid var(--border-strong);
  border-left: 3px solid var(--green);
  border-radius: 0.65rem;
  background: #171a22;
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.4);
  color: #dfe2e7;
  font-size: 0.7rem;
  animation: toast-in 180ms ease;
}
.toast.error { border-left-color: var(--red); }
@keyframes toast-in { from { opacity: 0; transform: translateY(7px); } }

@media (max-width: 1100px) {
  .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dashboard-grid, .weather-layout { grid-template-columns: 1fr; }
  .weather-types { grid-template-columns: repeat(5, minmax(0, 1fr)); }
}

@media (max-width: 780px) {
  .sidebar {
    inset: auto 0 0;
    width: auto;
    height: 4.4rem;
    flex-direction: row;
    padding: 0.45rem;
    border-top: 1px solid var(--border);
    border-right: 0;
  }
  .sidebar-brand, .sidebar-footer { display: none; }
  .sidebar nav {
    width: 100%;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.2rem;
    margin: 0;
  }
  .nav-button {
    height: 3.45rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 0.15rem;
    padding: 0.3rem;
    text-align: center;
  }
  .nav-button.active::before { inset: auto 30% 0; width: 40%; height: 0.15rem; }
  .nav-button span:nth-child(2) { font-size: 0.55rem; }
  .nav-button em { position: absolute; top: 0.25rem; right: 20%; min-width: 1rem; font-size: 0.48rem; }
  .workspace { margin-left: 0; padding: 0 0.8rem 5.5rem; }
  .topbar { min-height: 6rem; }
  .topbar > div:first-child .eyebrow { display: none; }
  .topbar h1 { font-size: 1.2rem; }
  .user-chip { min-width: 0; padding: 0.35rem; }
  .user-chip div, .user-chip .duty-badge { display: none; }
  .logout-button { display: none; }
  .loading-bar { left: 0; }
  .report-grid { grid-template-columns: 1fr; }
  .weather-types { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 520px) {
  .login-screen { padding: 1rem; }
  .login-card { padding: 1.4rem; }
  .brand-lockup { margin-bottom: 2.5rem; }
  .stat-grid { grid-template-columns: 1fr 1fr; gap: 0.55rem; }
  .stat-card { min-height: 7.3rem; padding: 0.9rem; }
  .stat-card strong { font-size: 1.55rem; }
  .responsive-heading, .section-toolbar { align-items: stretch; flex-direction: column; }
  .search-box { width: 100%; }
  .filter-chips { overflow-x: auto; }
  .weather-types { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

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

/* Webes command center – az eredeti NUI-tól független kezelőfelület */
.sidebar nav {
  min-height: 0;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(238, 38, 63, 0.35) transparent;
}

.command-dock {
  position: sticky;
  z-index: 8;
  top: 0;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 1rem;
  margin: 1rem 0 0;
  padding: 0.75rem;
  border: 1px solid var(--border);
  border-radius: 1rem;
  background: rgba(12, 15, 21, 0.92);
  box-shadow: 0 15px 45px rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(18px);
}
.command-dock-copy { display: grid; gap: 0.15rem; min-width: 8.5rem; }
.command-dock-copy strong { font-size: 0.78rem; }
.command-kicker { color: var(--red); font-size: 0.52rem; font-weight: 900; letter-spacing: 0.16em; }
.quick-controls { display: flex; gap: 0.4rem; overflow-x: auto; scrollbar-width: none; }
.quick-controls::-webkit-scrollbar { display: none; }
.quick-control {
  min-width: 6.4rem;
  display: grid;
  grid-template-columns: 1.55rem 1fr;
  grid-template-rows: auto auto;
  align-items: center;
  column-gap: 0.45rem;
  padding: 0.5rem 0.58rem;
  border: 1px solid var(--border);
  border-radius: 0.7rem;
  background: rgba(255,255,255,.025);
  color: var(--muted);
  cursor: pointer;
}
.quick-control > span {
  grid-row: 1 / 3;
  width: 1.55rem;
  height: 1.55rem;
  display: grid;
  place-items: center;
  border-radius: 0.45rem;
  background: var(--surface-3);
  color: #d7dce4;
  font-size: 0.57rem;
  font-weight: 900;
}
.quick-control strong { align-self: end; color: #d4d8df; font-size: 0.62rem; text-align: left; }
.quick-control em { align-self: start; color: #68707c; font-size: 0.48rem; font-style: normal; font-weight: 800; text-align: left; }
.quick-control:hover { border-color: rgba(238,38,63,.32); transform: translateY(-1px); }
.quick-control.active { border-color: rgba(69,212,131,.3); background: rgba(69,212,131,.07); }
.quick-control.active > span { background: rgba(69,212,131,.14); color: var(--green); }
.quick-control.active em { color: var(--green); }
.bridge-state { display: flex; align-items: center; gap: 0.45rem; color: var(--muted); font-size: 0.58rem; white-space: nowrap; }
.bridge-state i { width: 0.42rem; height: 0.42rem; border-radius: 50%; background: var(--yellow); box-shadow: 0 0 14px currentColor; }
.bridge-state.online i { background: var(--green); }
.bridge-state.error i { background: var(--red); }

.catalog-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 20rem;
  gap: 0.9rem;
}
.catalog-panel { min-width: 0; }
.catalog-grid {
  max-height: calc(100vh - 20rem);
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(9.5rem, 1fr));
  gap: 0.55rem;
  overflow: auto;
  padding: 0.9rem;
}
.catalog-card {
  min-height: 6.2rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 0.6rem;
  padding: 0.8rem;
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  background: rgba(255,255,255,.02);
  color: #d5d9e0;
  text-align: left;
  cursor: pointer;
}
.catalog-card:hover, .catalog-card.active {
  border-color: rgba(238,38,63,.4);
  background: linear-gradient(140deg, rgba(238,38,63,.11), rgba(255,255,255,.02));
}
.catalog-card strong { font-size: 0.72rem; line-height: 1.35; }
.catalog-card span { color: #6f7681; font: 0.58rem ui-monospace, monospace; word-break: break-word; }
.catalog-card .catalog-mark {
  width: 2rem;
  height: 2rem;
  display: grid;
  place-items: center;
  border-radius: 0.55rem;
  background: rgba(238,38,63,.1);
  color: #ff8292;
  font-weight: 900;
}

.catalog-card .item-catalog-image {
  overflow: hidden;
}

.catalog-card .item-catalog-image img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.operation-panel {
  position: sticky;
  top: 6.5rem;
  height: fit-content;
  padding: 1.15rem;
}
.operation-panel h2 { margin: 0.2rem 0; font-size: 1rem; }
.muted-copy { margin: 0 0 1.1rem; color: var(--muted); font-size: 0.65rem; }
.operation-panel label, .dialog-fields label, .detail-form label {
  display: grid;
  gap: 0.38rem;
  margin-top: 0.75rem;
  color: #8d949f;
  font-size: 0.62rem;
  font-weight: 700;
}
.operation-panel input, .operation-panel select,
.dialog-fields input, .dialog-fields select, .dialog-fields textarea,
.detail-form input, .detail-form select {
  width: 100%;
  padding: 0.68rem 0.72rem;
  border: 1px solid var(--border);
  border-radius: 0.65rem;
  outline: 0;
  background: #0d1016;
  color: #eef0f4;
}
.operation-panel input:focus, .operation-panel select:focus,
.dialog-fields input:focus, .dialog-fields select:focus, .dialog-fields textarea:focus {
  border-color: rgba(238,38,63,.5);
  box-shadow: 0 0 0 3px rgba(238,38,63,.07);
}
.operation-buttons { display: grid; grid-template-columns: 1fr 1fr; gap: 0.55rem; margin-top: 1rem; }
.operation-buttons.stacked { grid-template-columns: 1fr; }
.operation-panel > .primary-button { width: 100%; margin-top: 1rem; }
.danger-outline { color: #ff8796 !important; border-color: rgba(238,38,63,.25) !important; }

.split-layout {
  display: grid;
  grid-template-columns: minmax(18rem, .8fr) minmax(24rem, 1.2fr);
  gap: 0.9rem;
}
.record-list { display: grid; gap: 0.55rem; padding: 0.9rem; }
.record-list.compact { max-height: calc(100vh - 18rem); overflow: auto; }
.record-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.8rem;
  align-items: center;
  padding: 0.8rem;
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  background: rgba(255,255,255,.02);
}
button.record-card { width: 100%; color: inherit; text-align: left; cursor: pointer; }
.record-card:hover, .record-card.active { border-color: rgba(238,38,63,.32); background: rgba(238,38,63,.045); }
.record-main { min-width: 0; display: grid; gap: 0.22rem; }
.record-main strong { overflow: hidden; color: #edf0f4; font-size: 0.73rem; text-overflow: ellipsis; white-space: nowrap; }
.record-main span { color: var(--muted); font-size: 0.61rem; line-height: 1.45; }
.record-meta { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 0.3rem; }
.record-pill { padding: 0.25rem 0.45rem; border-radius: .4rem; background: var(--surface-3); color: #adb3bd; font-size: .53rem; font-weight: 800; }
.record-pill.red { background: rgba(238,38,63,.1); color: #ff8494; }
.record-pill.green { background: rgba(69,212,131,.1); color: var(--green); }
.detail-panel { min-height: 22rem; padding: 1.1rem; }
.detail-head { display: flex; justify-content: space-between; gap: 1rem; padding-bottom: 1rem; border-bottom: 1px solid var(--border); }
.detail-head h2 { margin: .2rem 0; font-size: 1.05rem; }
.detail-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: .6rem; margin: 1rem 0; }
.detail-stat { padding: .7rem; border-radius: .65rem; background: rgba(255,255,255,.025); }
.detail-stat span { display: block; color: var(--muted); font-size: .55rem; }
.detail-stat strong { display: block; margin-top: .25rem; font-size: .72rem; word-break: break-word; }
.detail-actions { display: flex; flex-wrap: wrap; gap: .45rem; }
.detail-form { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: .55rem; margin-top: 1rem; }
.detail-form .full { grid-column: 1 / -1; }

.chat-panel { min-height: 30rem; display: flex; flex-direction: column; }
.chat-messages { flex: 1; min-height: 20rem; max-height: calc(100vh - 23rem); overflow: auto; display: grid; align-content: end; gap: .5rem; padding: 1rem; }
.chat-message { padding: .7rem; border-radius: .7rem; background: rgba(255,255,255,.025); }
.chat-message strong { display: block; color: #ff8998; font-size: .62rem; }
.chat-message p { margin: .3rem 0 0; color: #c7cbd2; font-size: .7rem; line-height: 1.5; }
.chat-message time { display: block; margin-top: .35rem; color: #5f6672; font-size: .52rem; }
.chat-compose { display: grid; grid-template-columns: 1fr auto; gap: .55rem; padding: .9rem; border-top: 1px solid var(--border); }
.chat-compose input { min-width: 0; padding: .7rem; border: 1px solid var(--border); border-radius: .65rem; outline: 0; background: #0d1016; color: white; }

.dialog-fields { display: grid; gap: .2rem; margin-top: .8rem; }
.action-dialog form { width: min(32rem, calc(100vw - 2rem)); }

@media (max-width: 1250px) {
  .command-dock { grid-template-columns: 1fr auto; }
  .command-dock-copy { display: none; }
  .quick-controls { grid-column: 1; }
}

@media (max-width: 1000px) {
  .catalog-layout, .split-layout { grid-template-columns: 1fr; }
  .operation-panel { position: static; }
  .catalog-grid { max-height: none; }
}

@media (max-width: 780px) {
  .sidebar { overflow-x: auto; }
  .sidebar nav {
    min-width: max-content;
    display: flex;
    overflow-x: auto;
    overflow-y: hidden;
  }
  .nav-button { width: 5rem; flex: 0 0 5rem; }
  .command-dock { top: .35rem; grid-template-columns: 1fr; }
  .bridge-state { display: none; }
  .quick-control { min-width: 5.7rem; }
  .catalog-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .detail-grid, .detail-form { grid-template-columns: 1fr; }
}

/* Eredeti NUI-hoz igazított, tömör desktop admin elrendezés */
.admin-app {
  --panel-radius: 0.28rem;
  background:
    linear-gradient(135deg, rgba(238, 38, 63, 0.025), transparent 38%),
    #080a0f;
}

.admin-app ~ .ambient,
.admin-app:not([hidden]) + .ambient {
  display: none;
}

.sidebar {
  width: 13.5rem;
  padding: 0.85rem 0.7rem;
  background: #0c0e13;
  backdrop-filter: none;
}

.sidebar-brand {
  min-height: 3.15rem;
  padding: 0 0.55rem 0.75rem;
  border-bottom: 1px solid var(--border);
}

.sidebar-brand img {
  width: 1.95rem;
  height: 1.95rem;
}

.sidebar nav {
  gap: 0.14rem;
  margin-top: 0.8rem;
  padding-right: 0.15rem;
}

.nav-button {
  grid-template-columns: 1.4rem 1fr auto;
  min-height: 2.55rem;
  gap: 0.45rem;
  padding: 0.55rem 0.62rem;
  border-radius: 0.18rem;
}

.nav-button:hover {
  background: #151820;
}

.nav-button.active {
  background: linear-gradient(90deg, rgba(238, 38, 63, 0.2), rgba(238, 38, 63, 0.035));
}

.nav-button.active::before {
  left: -0.02rem;
  width: 0.16rem;
  height: 100%;
  border-radius: 0;
}

.nav-icon {
  width: 1.15rem;
  color: #f04458;
  font-size: 0.78rem;
}

.nav-button span:nth-child(2) {
  font-size: 0.75rem;
}

.nav-button em {
  border-radius: 0.18rem;
}

.sidebar-footer {
  padding: 0.7rem 0.55rem 0.2rem;
  border-top: 1px solid var(--border);
}

.workspace {
  margin-left: 13.5rem;
  padding: 0 1.25rem 2rem;
}

.topbar {
  min-height: 4.65rem;
  gap: 1rem;
}

.topbar h1 {
  font-size: 1.25rem;
}

.topbar .eyebrow {
  margin-bottom: 0.2rem;
  font-size: 0.56rem;
}

.icon-button,
.logout-button,
.user-chip,
.discord-login,
.login-error,
.command-dock,
.stat-card,
.panel,
.search-box,
.filter-chip,
.catalog-card,
.catalog-card .catalog-mark,
.operation-panel input,
.operation-panel select,
.dialog-fields input,
.dialog-fields select,
.dialog-fields textarea,
.detail-form input,
.detail-form select,
.record-card,
.record-pill,
.detail-stat,
.chat-message,
.chat-compose input,
.toast,
.primary-button,
.secondary-button,
.danger-button,
.action-button,
.weather-type,
.report-card,
.player-card {
  border-radius: var(--panel-radius);
}

.icon-button {
  width: 2.2rem;
  height: 2.2rem;
  font-size: 0.82rem;
}

.user-chip {
  min-width: 12.5rem;
  padding: 0.32rem 0.42rem;
}

.user-chip img {
  width: 1.8rem;
  height: 1.8rem;
  border-radius: 0.18rem;
}

.logout-button {
  display: inline-flex;
  align-items: center;
  gap: 0.42rem;
  padding: 0.52rem 0.66rem;
}

.loading-bar {
  left: 13.5rem;
}

.command-dock {
  top: 0.35rem;
  gap: 0.65rem;
  margin-top: 0.75rem;
  padding: 0.52rem 0.58rem;
  background: rgba(12, 14, 19, 0.97);
  box-shadow: 0 8px 26px rgba(0, 0, 0, 0.3);
  backdrop-filter: none;
}

.command-dock-copy {
  min-width: 7.1rem;
}

.quick-controls {
  gap: 0.28rem;
}

.quick-control {
  min-width: 5.65rem;
  grid-template-columns: 1.35rem 1fr;
  column-gap: 0.36rem;
  padding: 0.36rem 0.42rem;
  border-radius: 0.2rem;
  background: #11141b;
}

.quick-control > span {
  width: 1.35rem;
  height: 1.35rem;
  border-radius: 0.16rem;
  font-size: 0.58rem;
}

.quick-control strong {
  font-size: 0.57rem;
}

.quick-control:hover {
  transform: none;
  background: #181b23;
}

.quick-control.active {
  background: rgba(69, 212, 131, 0.075);
}

.view {
  padding-top: 0.85rem;
}

.stat-grid {
  gap: 0.55rem;
}

.stat-card {
  min-height: 6.6rem;
  padding: 0.8rem 0.9rem;
  background: #10131a;
  box-shadow: none;
}

.stat-card strong {
  font-size: 1.65rem;
}

.dashboard-grid,
.catalog-layout,
.split-layout,
.report-grid {
  gap: 0.55rem;
  margin-top: 0.55rem;
}

.panel {
  background: #10131a;
  box-shadow: none;
}

.panel-heading,
.section-toolbar {
  padding: 0.82rem 0.9rem;
}

.catalog-grid {
  grid-template-columns: repeat(auto-fill, minmax(8.5rem, 1fr));
  gap: 0.38rem;
  padding: 0.65rem;
}

.catalog-card {
  min-height: 5.35rem;
  gap: 0.4rem;
  padding: 0.62rem;
}

.catalog-card .catalog-mark {
  width: 1.75rem;
  height: 1.75rem;
}

.record-list {
  gap: 0.35rem;
  padding: 0.65rem;
}

.record-card {
  padding: 0.62rem;
}

.operation-panel,
.detail-panel {
  padding: 0.85rem;
}

.live-pill,
.duty-badge,
.status-dot,
.bridge-state i {
  border-radius: 0.16rem;
}

@media (max-width: 760px) and (min-width: 641px) {
  .sidebar {
    width: 4.25rem;
    inset: 0 auto 0 0;
    height: auto;
    overflow: hidden;
  }

  .sidebar-brand {
    justify-content: center;
    padding-inline: 0;
  }

  .sidebar-brand div,
  .sidebar-footer,
  .nav-button span:nth-child(2),
  .nav-button em {
    display: none;
  }

  .sidebar nav {
    display: grid;
    min-width: 0;
    overflow-x: hidden;
    overflow-y: auto;
  }

  .nav-button {
    width: 100%;
    min-height: 2.75rem;
    display: grid;
    grid-template-columns: 1fr;
    place-items: center;
    padding: 0;
  }

  .nav-button.active::before {
    inset: 0 auto 0 -0.02rem;
    width: 0.16rem;
    height: 100%;
  }

  .nav-icon {
    width: auto;
    font-size: 0.88rem;
  }

  .workspace {
    margin-left: 4.25rem;
    padding: 0 0.8rem 1.4rem;
  }

  .loading-bar {
    left: 4.25rem;
  }
}

@media (max-width: 1000px) and (min-width: 841px) {
  .catalog-layout {
    grid-template-columns: minmax(0, 1fr) 17rem;
  }

  .operation-panel {
    position: sticky;
  }
}

/* A webadmin mindig a teljes böngészőablakot használja. A hosszabb nézetek
   a munkaterületen belül görgethetők, ezért a dokumentum nem nő túl a
   viewporton és nem marad kihasználatlan külső terület. */
html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
}

#admin-app:not([hidden]) {
  width: 100vw;
  height: 100dvh;
  min-height: 100dvh;
  overflow: hidden;
}

#admin-app:not([hidden]) .workspace {
  height: 100dvh;
  min-height: 0;
  max-width: none;
  overflow-x: hidden;
  overflow-y: auto;
}

@media (max-width: 640px) {
  .sidebar {
    inset: auto 0 0;
    width: auto;
    height: 4.25rem;
  }

  .workspace {
    margin-left: 0;
    padding: 0 0.65rem 5.15rem;
  }

  .loading-bar {
    left: 0;
  }

  .command-dock {
    top: 0.2rem;
  }
}
