* {
  box-sizing: border-box;
}

:root {
  color-scheme: dark;
  --bg: #07111f;
  --bg-deep: #030712;
  --bg-end: #0c1628;
  --panel: rgba(10, 18, 32, 0.72);
  --panel-strong: rgba(13, 24, 42, 0.88);
  --line: rgba(160, 174, 196, 0.16);
  --line-strong: rgba(160, 174, 196, 0.28);
  --text: #f5f7fb;
  --muted: #9eabc3;
  --accent: #73e0a9;
  --accent-2: #6bc5ff;
  --danger: #ff6b6b;
  --warning: #ffcf66;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.34);
  --field-bg: rgba(7, 16, 30, 0.86);
  --field-border: rgba(255,255,255,0.12);
  --control-bg: rgba(10, 18, 32, 0.75);
  --surface-soft: rgba(255,255,255,0.04);
  --surface-strong: rgba(255,255,255,0.06);
  --surface-border: rgba(255,255,255,0.08);
  --list-line: rgba(255,255,255,0.08);
  --grid-line: rgba(255,255,255,0.03);
  --card-highlight: linear-gradient(135deg, rgba(255,255,255,0.08), transparent 32%);
  --hero-badge-bg: rgba(115, 224, 169, 0.08);
  --hero-badge-border: rgba(115, 224, 169, 0.18);
  --hero-badge-text: #c4f8de;
  --generated-output-bg: rgba(255,255,255,0.04);
  --generated-output-border: rgba(255,255,255,0.08);
  --chip-bg: rgba(255,255,255,0.06);
  --chip-border: rgba(255,255,255,0.08);
  --status-good: #88f0be;
  --status-warn: #ffe08a;
  --status-alert: #ffb1b1;
  --log-success: #88f0be;
  --log-error: #ff9c9c;
  --log-info: #8bd8ff;
  --log-warning: #ffe08a;
}

:root[data-theme="light"] {
  color-scheme: light;
  --bg: #edf3ff;
  --bg-deep: #f8fbff;
  --bg-end: #dce7f7;
  --panel: rgba(255, 255, 255, 0.9);
  --panel-strong: rgba(255, 255, 255, 0.97);
  --line: rgba(69, 88, 118, 0.16);
  --line-strong: rgba(69, 88, 118, 0.28);
  --text: #0f1c2f;
  --muted: #55657c;
  --accent: #0c8d60;
  --accent-2: #0f79e8;
  --danger: #e24d63;
  --warning: #e2a11a;
  --shadow: 0 20px 56px rgba(32, 56, 95, 0.14);
  --field-bg: rgba(255, 255, 255, 0.98);
  --field-border: rgba(80, 100, 132, 0.24);
  --control-bg: rgba(255, 255, 255, 0.94);
  --surface-soft: rgba(236, 242, 250, 0.92);
  --surface-strong: rgba(228, 236, 247, 0.94);
  --surface-border: rgba(84, 103, 135, 0.17);
  --list-line: rgba(84, 103, 135, 0.16);
  --grid-line: rgba(41, 61, 95, 0.06);
  --card-highlight: linear-gradient(135deg, rgba(255,255,255,0.74), rgba(17, 136, 255, 0.04) 28%, transparent 52%);
  --hero-badge-bg: rgba(12, 141, 96, 0.14);
  --hero-badge-border: rgba(12, 141, 96, 0.22);
  --hero-badge-text: #0a7a53;
  --generated-output-bg: rgba(236, 242, 250, 0.96);
  --generated-output-border: rgba(84, 103, 135, 0.2);
  --chip-bg: rgba(231, 238, 248, 0.92);
  --chip-border: rgba(84, 103, 135, 0.18);
  --status-good: #0f7a54;
  --status-warn: #9b6510;
  --status-alert: #b4233a;
  --log-success: #0f7a54;
  --log-error: #b4233a;
  --log-info: #0d68c7;
  --log-warning: #9b6510;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: 'IBM Plex Sans', sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(107, 197, 255, 0.2), transparent 30%),
    radial-gradient(circle at 80% 10%, rgba(115, 224, 169, 0.16), transparent 24%),
    radial-gradient(circle at bottom right, rgba(255, 207, 102, 0.12), transparent 20%),
    linear-gradient(145deg, var(--bg-deep) 0%, var(--bg) 52%, var(--bg-end) 100%);
  position: relative;
}

:root[data-theme="light"] body {
  background:
    radial-gradient(circle at top left, rgba(17, 136, 255, 0.12), transparent 30%),
    radial-gradient(circle at 80% 10%, rgba(14, 167, 111, 0.12), transparent 24%),
    radial-gradient(circle at bottom right, rgba(226, 161, 26, 0.08), transparent 20%),
    linear-gradient(145deg, var(--bg-deep) 0%, var(--bg) 52%, var(--bg-end) 100%);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: 80px 80px;
  mask-image: radial-gradient(circle at center, black 35%, transparent 85%);
  opacity: 0.45;
}

body {
  padding-bottom: env(safe-area-inset-bottom, 0);
}

h1, h2, h3 {
  font-family: 'Space Grotesk', sans-serif;
}

ul {
  margin: 0;
  padding: 0;
}

.hidden {
  display: none !important;
}

.auth-shell {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.auth-card {
  width: min(100%, 460px);
  padding: 28px;
  border-radius: 30px;
  border: 1px solid var(--line);
  background:
    radial-gradient(circle at top right, rgba(107, 197, 255, 0.14), transparent 28%),
    radial-gradient(circle at bottom left, rgba(115, 224, 169, 0.12), transparent 24%),
    linear-gradient(180deg, rgba(255,255,255,0.05), rgba(255,255,255,0.02)),
    var(--panel-strong);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.logo-mark {
  width: 78px;
  height: 78px;
  object-fit: contain;
  filter: drop-shadow(0 18px 40px rgba(107, 197, 255, 0.18));
}

.auth-header {
  margin-bottom: 22px;
}

.auth-title {
  margin: 10px 0 8px;
  font-size: clamp(28px, 5vw, 38px);
  letter-spacing: -0.04em;
}

.auth-subtitle {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.auth-form input {
  width: 100%;
  min-height: 52px;
  padding: 0 16px;
  border-radius: 16px;
  border: 1px solid var(--field-border);
  background: var(--field-bg);
  color: var(--text);
  font-family: 'IBM Plex Sans', sans-serif;
  font-size: 15px;
  outline: none;
}

.auth-form input::placeholder,
.field-grid input::placeholder {
  color: var(--muted);
  opacity: 0.88;
}

.auth-form input:focus {
  border-color: rgba(107, 197, 255, 0.55);
  box-shadow: 0 0 0 4px rgba(107, 197, 255, 0.12);
}

.auth-error {
  min-height: 22px;
  color: var(--danger);
  font-size: 14px;
}

.logout-button {
  min-height: 44px;
  padding: 10px 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--control-bg);
  color: var(--text);
  box-shadow: none;
  font-size: 13px;
  font-family: 'IBM Plex Sans', sans-serif;
  font-weight: 600;
}

.user-chip {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 10px 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--control-bg);
  color: var(--text);
  font-size: 13px;
}

.user-chip strong {
  font-weight: 600;
}

.user-chip span {
  color: var(--muted);
}

.topbar {
  position: relative;
  z-index: 8;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 28px 28px 0;
}

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

.brand-mark {
  width: 46px;
  height: 46px;
  object-fit: contain;
  filter: drop-shadow(0 14px 30px rgba(107, 197, 255, 0.24));
}

.brand-copy {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.eyebrow {
  font-size: 11px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--muted);
}

.brand-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 18px;
  font-weight: 600;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.menu-button {
  min-height: 44px;
  width: 44px;
  padding: 0;
  border-radius: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--control-bg);
  border: 1px solid var(--line);
  color: var(--text);
  box-shadow: none;
}

.menu-button span {
  display: block;
  width: 18px;
  height: 2px;
  background: currentColor;
  border-radius: 999px;
  position: relative;
}

.menu-button span::before,
.menu-button span::after {
  content: "";
  position: absolute;
  left: 0;
  width: 18px;
  height: 2px;
  background: currentColor;
  border-radius: 999px;
}

.menu-button span::before {
  top: -6px;
}

.menu-button span::after {
  top: 6px;
}

.menu-drawer {
  position: absolute;
  top: 78px;
  right: 28px;
  min-width: 220px;
  padding: 12px;
  border-radius: 22px;
  border: 1px solid var(--line);
  background: var(--panel-strong);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
  z-index: 6;
}

.menu-drawer nav {
  display: grid;
  gap: 8px;
}

.menu-link {
  width: 100%;
  text-align: left;
  color: var(--text);
  background: var(--surface-soft);
  border-color: var(--surface-border);
  box-shadow: none;
}

.menu-link.active {
  background: linear-gradient(135deg, var(--accent-2), #9af0d1);
  color: #04111b;
}

.app-shell {
  position: relative;
  z-index: 1;
  padding: 20px 28px 34px;
}

.system-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--control-bg);
  backdrop-filter: blur(14px);
}

.status-indicator {
  position: relative;
  min-height: 0;
  width: 18px;
  height: 18px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  box-shadow: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.status-indicator:hover,
.status-indicator:focus,
.status-indicator:focus-visible {
  transform: none;
  filter: none;
  box-shadow: none;
}

.status-indicator:focus-visible {
  outline: 2px solid rgba(107, 197, 255, 0.5);
  outline-offset: 4px;
}

.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--warning);
  box-shadow: 0 0 16px rgba(255, 207, 102, 0.65);
  transition: transform 180ms ease, box-shadow 180ms ease, background 180ms ease;
}

.status-indicator.is-online .status-dot {
  background: var(--accent);
  box-shadow: 0 0 16px rgba(115, 224, 169, 0.72);
}

.status-indicator.is-offline .status-dot {
  background: var(--danger);
  box-shadow: 0 0 16px rgba(255, 107, 107, 0.7);
}

.status-indicator:hover .status-dot,
.status-indicator:focus .status-dot,
.status-indicator:focus-visible .status-dot {
  transform: scale(1.15);
}

.status-popover {
  position: absolute;
  top: calc(100% + 12px);
  right: 0;
  min-width: 220px;
  display: grid;
  gap: 8px;
  padding: 12px 14px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background:
    linear-gradient(180deg, rgba(255,255,255,0.04), rgba(255,255,255,0.01)),
    var(--panel-strong);
  color: var(--text);
  text-align: left;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-4px);
  transition: opacity 160ms ease, transform 160ms ease;
  z-index: 12;
}

.status-popover strong {
  font-size: 13px;
  font-family: 'Space Grotesk', sans-serif;
}

.status-popover small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.status-lines {
  display: grid;
  gap: 4px;
}

.status-line {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.status-indicator:hover .status-popover,
.status-indicator:focus .status-popover,
.status-indicator:focus-visible .status-popover {
  opacity: 1;
  transform: translateY(0);
}

.theme-toggle {
  min-height: 44px;
  padding: 10px 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--control-bg);
  color: var(--text);
  box-shadow: none;
  font-size: 13px;
  font-family: 'IBM Plex Sans', sans-serif;
  font-weight: 600;
}

:root[data-theme="light"] .theme-toggle,
:root[data-theme="light"] .menu-button,
:root[data-theme="light"] .logout-button,
:root[data-theme="light"] .system-status,
:root[data-theme="light"] .status-popover,
:root[data-theme="light"] .user-chip {
  background: var(--control-bg);
  color: var(--text);
  box-shadow: 0 10px 26px rgba(46, 73, 112, 0.08);
}

.dashboard {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(360px, 1.05fr);
  gap: 24px;
  align-items: start;
}

.page {
  display: none;
}

.page.active {
  display: block;
}

.left {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.card {
  position: relative;
  overflow: hidden;
  padding: 24px;
  border-radius: 28px;
  border: 1px solid var(--line);
  background:
    linear-gradient(180deg, rgba(255,255,255,0.04), rgba(255,255,255,0.01)),
    var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

:root[data-theme="light"] .card {
  background:
    linear-gradient(180deg, rgba(255,255,255,0.88), rgba(246, 249, 253, 0.98)),
    var(--panel);
}

.card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--card-highlight);
  pointer-events: none;
}

.hero-card {
  background:
    radial-gradient(circle at top right, rgba(107, 197, 255, 0.16), transparent 28%),
    radial-gradient(circle at bottom left, rgba(115, 224, 169, 0.16), transparent 24%),
    linear-gradient(180deg, rgba(255,255,255,0.04), rgba(255,255,255,0.01)),
    var(--panel-strong);
}

:root[data-theme="light"] .auth-card {
  background:
    radial-gradient(circle at top right, rgba(17, 136, 255, 0.12), transparent 28%),
    radial-gradient(circle at bottom left, rgba(12, 141, 96, 0.1), transparent 24%),
    linear-gradient(180deg, rgba(255,255,255,0.92), rgba(245, 248, 252, 0.98)),
    var(--panel-strong);
}

:root[data-theme="light"] .hero-card {
  background:
    radial-gradient(circle at top right, rgba(17, 136, 255, 0.14), transparent 28%),
    radial-gradient(circle at bottom left, rgba(12, 141, 96, 0.12), transparent 24%),
    linear-gradient(180deg, rgba(255,255,255,0.86), rgba(244, 248, 252, 0.98)),
    var(--panel-strong);
}

.hero-brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}

.hero-brand img {
  width: 40px;
  height: 40px;
  object-fit: contain;
}

.hero-brand span {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 15px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

.hero-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 24px;
}

.hero-title {
  margin: 8px 0 10px;
  font-size: clamp(30px, 4vw, 44px);
  line-height: 0.95;
  letter-spacing: -0.04em;
}

.hero-subtitle {
  max-width: 42ch;
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.hero-badge {
  padding: 10px 14px;
  border-radius: 999px;
  border: 1px solid var(--hero-badge-border);
  background: var(--hero-badge-bg);
  color: var(--hero-badge-text);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

.field-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  align-items: end;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.email-field {
  margin-top: 16px;
}

.field-label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--muted);
}

.field-help {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.generated-output {
  margin-top: 18px;
  min-height: 74px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 8px;
  padding: 16px 18px;
  border-radius: 22px;
  background: var(--generated-output-bg);
  border: 1px solid var(--generated-output-border);
}

.generated-output-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.generated-output small {
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.14em;
}

.generated-code {
  margin: 0;
  font-size: clamp(26px, 5vw, 38px);
  letter-spacing: 0.18em;
  color: #f7fbff;
}

:root[data-theme="light"] .generated-code {
  color: #11233c;
}

.generated-meta {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
}

.delivery-status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--chip-bg);
  border: 1px solid var(--chip-border);
  color: var(--text);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

.delivery-status.success {
  color: var(--status-good);
}

.delivery-status.warning {
  color: var(--status-alert);
}

.card-title {
  margin: 0;
  font-size: 21px;
  letter-spacing: -0.03em;
}

.section-copy {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 18px;
}

.section-copy p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.logs {
  min-height: 760px;
  overflow-y: auto;
}

.lockers {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.locker {
  min-height: 200px;
  padding: 18px;
  border-radius: 24px;
  border: 1px solid rgba(255,255,255,0.08);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  text-align: left;
  gap: 14px;
  transition: transform 180ms ease, border-color 180ms ease;
}

.locker:hover {
  transform: translateY(-2px);
}

.ok {
  background: linear-gradient(180deg, rgba(115, 224, 169, 0.18), rgba(115, 224, 169, 0.08));
  border-color: rgba(115, 224, 169, 0.2);
}

.bad {
  background: linear-gradient(180deg, rgba(255, 107, 107, 0.16), rgba(255, 107, 107, 0.06));
  border-color: rgba(255, 107, 107, 0.18);
}

.locker-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.locker-name {
  margin: 0;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 20px;
}

.locker-state {
  display: grid;
  gap: 8px;
}

.locker-badge {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  padding: 7px 11px;
  border-radius: 999px;
  border: 1px solid var(--chip-border);
  background: var(--chip-bg);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.locker-badge.warn {
  color: var(--status-warn);
}

.locker-badge.alert {
  color: var(--status-alert);
}

.locker-badge.good {
  color: var(--status-good);
}

.locker-copy {
  color: var(--muted);
  line-height: 1.5;
  font-size: 14px;
}

.locker-actions {
  display: flex;
  gap: 10px;
}

.locker-actions button,
.locker-toolbar button {
  flex: 1;
}

.secondary-button {
  color: var(--text);
  background: var(--surface-strong);
  border-color: var(--line);
  box-shadow: none;
}

.secondary-button:hover {
  box-shadow: 0 18px 38px rgba(32, 56, 95, 0.14);
}

.locker-toolbar {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

li {
  list-style: none;
  padding: 14px 0;
  border-bottom: 1px solid var(--list-line);
}

button {
  min-height: 48px;
  padding: 12px 18px;
  border-radius: 16px;
  border: 1px solid rgba(107, 197, 255, 0.16);
  cursor: pointer;
  color: #04111b;
  background: linear-gradient(135deg, var(--accent-2), #9af0d1);
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  letter-spacing: 0.01em;
  box-shadow: 0 14px 30px rgba(107, 197, 255, 0.18);
  transition: transform 180ms ease, box-shadow 180ms ease, filter 180ms ease;
}

button:hover {
  transform: translateY(-1px);
  box-shadow: 0 18px 38px rgba(107, 197, 255, 0.24);
  filter: saturate(1.04);
}

button:disabled {
  cursor: wait;
  transform: none;
  filter: none;
  opacity: 0.72;
  box-shadow: none;
}

.danger {
  color: #fff2f2;
  background: linear-gradient(135deg, #ff7b7b, #ff4f6f);
  border-color: rgba(255, 107, 107, 0.24);
  box-shadow: 0 14px 30px rgba(255, 79, 111, 0.2);
}

select,
.field-grid input,
.email-field input {
  width: 100%;
  min-height: 52px;
  padding: 0 16px;
  border-radius: 16px;
  border: 1px solid var(--field-border);
  background: var(--field-bg);
  color: var(--text);
  font-family: 'IBM Plex Sans', sans-serif;
  font-size: 15px;
  outline: none;
}

select:focus,
.field-grid input:focus,
.email-field input:focus {
  border-color: rgba(107, 197, 255, 0.55);
  box-shadow: 0 0 0 4px rgba(107, 197, 255, 0.12);
}

.toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  padding: 16px 18px;
  border-radius: 18px;
  border: 1px solid var(--line-strong);
  background: rgba(6, 14, 25, 0.92);
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 180ms ease, transform 180ms ease;
  backdrop-filter: blur(14px);
  box-shadow: var(--shadow);
  z-index: 4;
}

:root[data-theme="light"] .toast {
  background: rgba(255, 255, 255, 0.92);
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

.code-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.code-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.section-header h2 {
  margin: 0;
  font-size: 22px;
}

.users-layout {
  display: grid;
  grid-template-columns: minmax(320px, 0.9fr) minmax(0, 1.1fr);
  gap: 24px;
  align-items: start;
}

.users-sidebar,
.users-main {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.checkbox-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.checkbox-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: var(--surface-soft);
  min-height: 64px;
  cursor: pointer;
}

.checkbox-card input {
  accent-color: var(--accent-2);
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  margin: 0;
}

.checkbox-card span {
  display: block;
  min-width: 0;
  font-size: 14px;
  line-height: 1.35;
  word-break: break-word;
}

.users-list {
  display: grid;
  gap: 14px;
}

.user-card {
  padding: 18px;
  border-radius: 22px;
  border: 1px solid var(--line);
  background: var(--surface-soft);
}

.user-card-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 12px;
}

.user-card-title {
  margin: 0 0 6px;
  font-size: 20px;
}

.user-tag-chip,
.user-locker-chip {
  display: inline-flex;
  align-items: center;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid var(--chip-border);
  background: var(--chip-bg);
  font-size: 12px;
  font-weight: 600;
}

.user-lockers {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.user-card-actions {
  display: flex;
  gap: 10px;
  margin-top: 16px;
}

.timer {
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border-radius: 999px;
  background: var(--chip-bg);
  color: var(--muted);
  font-size: 13px;
}

.code-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 999px;
  background: var(--chip-bg);
  border: 1px solid var(--chip-border);
  font-family: 'Space Grotesk', sans-serif;
  letter-spacing: 0.05em;
}

.code-chip.is-success {
  color: var(--status-good);
}

.code-chip.is-warning {
  color: var(--status-alert);
}

.log-success { color: var(--log-success); }
.log-error { color: var(--log-error); }
.log-info { color: var(--log-info); }
.log-warning { color: var(--log-warning); }

:root[data-theme="light"] .menu-drawer,
:root[data-theme="light"] .toast {
  box-shadow: 0 18px 44px rgba(39, 63, 99, 0.14);
}

:root[data-theme="light"] .checkbox-card,
:root[data-theme="light"] .user-card,
:root[data-theme="light"] .menu-link,
:root[data-theme="light"] .secondary-button {
  border-color: var(--surface-border);
}

:root[data-theme="light"] .ok {
  background: linear-gradient(180deg, rgba(12, 141, 96, 0.16), rgba(12, 141, 96, 0.07));
  border-color: rgba(12, 141, 96, 0.2);
}

:root[data-theme="light"] .bad {
  background: linear-gradient(180deg, rgba(226, 77, 99, 0.14), rgba(226, 77, 99, 0.05));
  border-color: rgba(226, 77, 99, 0.18);
}

.muted-empty {
  color: var(--muted);
  padding: 16px 0 4px;
}

@media (max-width: 900px) {
  .topbar {
    padding: 22px 18px 0;
    align-items: flex-start;
    flex-direction: column;
  }

  .topbar-actions {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr;
  }

  .auth-shell {
    padding: 16px;
  }

  .auth-card {
    padding: 22px;
    border-radius: 24px;
  }

  .app-shell {
    padding: 16px 18px 24px;
  }

  .dashboard {
    grid-template-columns: 1fr;
    gap: 18px;
  }

  .users-layout,
  .checkbox-grid {
    grid-template-columns: 1fr;
  }

  .field-grid,
  .lockers {
    grid-template-columns: 1fr;
  }

  .brand {
    width: 100%;
    align-items: flex-start;
  }

  .brand-mark {
    width: 42px;
    height: 42px;
  }

  .brand-title {
    font-size: 17px;
  }

  .hero-header,
  .section-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .user-card-header,
  .user-card-actions {
    flex-direction: column;
  }

  .locker-top,
  .locker-actions,
  .locker-toolbar {
    width: 100%;
    flex-direction: column;
  }

  .locker-state {
    width: 100%;
  }

  .hero-title {
    font-size: clamp(28px, 10vw, 38px);
  }

  .hero-subtitle {
    max-width: none;
    font-size: 14px;
  }

  .hero-badge,
  .theme-toggle,
  .system-status {
    width: 100%;
    justify-content: center;
  }

  .status-popover {
    right: auto;
    left: 50%;
    transform: translate(-50%, -4px);
  }

  .status-indicator:hover .status-popover,
  .status-indicator:focus .status-popover,
  .status-indicator:focus-visible .status-popover {
    transform: translate(-50%, 0);
  }

  .card {
    padding: 20px;
    border-radius: 24px;
  }

  .generated-output {
    min-height: 88px;
  }

  .section-copy {
    margin-bottom: 14px;
  }

  .section-copy p {
    font-size: 13px;
    line-height: 1.55;
  }

  .generated-output-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .code-row {
    flex-direction: column;
    align-items: stretch;
  }

  .code-meta {
    align-items: flex-start;
  }

  .code-chip,
  .timer {
    width: 100%;
    justify-content: center;
  }

  #activeCodes button,
  .section-header .danger {
    width: 100%;
  }

  li {
    padding: 12px 0;
  }

  .logs {
    min-height: 0;
    max-height: 52vh;
  }

  .toast {
    right: 16px;
    left: 16px;
    bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  }
}

@media (max-width: 560px) {
  .topbar {
    padding: 16px 14px 0;
    gap: 12px;
  }

  .menu-drawer {
    top: 68px;
    right: 14px;
    left: 14px;
    min-width: 0;
  }

  .app-shell {
    padding: 12px 14px 20px;
  }

  .dashboard {
    gap: 14px;
  }

  .field-grid {
    gap: 10px;
  }

  .card {
    padding: 18px;
    border-radius: 22px;
  }

  button,
  select {
    min-height: 50px;
  }

  .generated-code {
    font-size: 28px;
    letter-spacing: 0.14em;
  }

  .logs {
    max-height: 48vh;
  }
}
