:root {
  --bg: #edf4ff;
  --panel: rgba(248, 252, 255, 0.94);
  --panel-strong: #ffffff;
  --line: rgba(28, 71, 145, 0.14);
  --text: #12233f;
  --muted: #56709a;
  --brand: #20408f;
  --brand-soft: #dbe8ff;
  --accent: #4f84d9;
  --danger: #b03a48;
  --shadow: 0 22px 60px rgba(24, 61, 126, 0.16);
  --radius: 24px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  background:
    radial-gradient(circle at top left, rgba(79, 132, 217, 0.22), transparent 28%),
    radial-gradient(circle at top right, rgba(32, 64, 143, 0.18), transparent 25%),
    linear-gradient(180deg, #f6faff, #dceafc);
  color: var(--text);
  min-height: 100vh;
}

button,
input,
select,
textarea {
  font: inherit;
}

.shell {
  max-width: 1680px;
  margin: 0 auto;
  padding: 20px 18px 28px;
}

.hero,
.panel,
.card {
  background: var(--panel);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  border-radius: var(--radius);
}

.hero {
  padding: 20px 22px;
  display: grid;
  gap: 16px;
}

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

.hero-brand {
  display: flex;
  align-items: center;
  gap: 16px;
  min-width: 0;
}

.brand h1,
.brand h2 {
  margin: 0;
}

.brand p,
.muted {
  color: var(--muted);
}

.stats {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}

.card {
  padding: 14px 16px;
}

.card strong {
  font-size: 1.6rem;
  display: block;
  margin-top: 6px;
}

.layout {
  margin-top: 16px;
  display: grid;
  gap: 16px;
  grid-template-columns: 220px minmax(0, 1fr);
}

.sidebar,
.content {
  min-width: 0;
}

.panel {
  padding: 18px;
}

.menu {
  display: grid;
  gap: 8px;
}

.menu button,
.toolbar button,
.form-grid button,
.login button {
  border: none;
  border-radius: 14px;
  padding: 10px 14px;
  cursor: pointer;
  transition: transform 0.2s ease, opacity 0.2s ease, background 0.2s ease;
}

.menu button {
  text-align: left;
  background: #edf4ff;
  color: var(--text);
}

.menu button.active,
.toolbar button,
.form-grid button[type="submit"],
.login button {
  background: linear-gradient(135deg, var(--brand), #2f64c5);
  color: white;
}

.toolbar button.secondary,
.ghost {
  background: #e5efff;
  color: var(--text);
}

button:hover {
  transform: translateY(-1px);
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.toolbar.compact {
  margin-bottom: 6px;
}

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

.refresh-wrap {
  display: grid;
  gap: 4px;
}

.refresh-note {
  margin-top: 0;
  font-size: 0.78rem;
}

.table-wrap {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.65);
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 620px;
}

th,
td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
  line-height: 1.35;
}

.table-wrap td .muted {
  font-size: 0.82rem;
}

.table-wrap td .status {
  white-space: nowrap;
}

th {
  background: #edf4ff;
  color: var(--muted);
  font-weight: 600;
}

.status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 0.88rem;
  background: var(--brand-soft);
  color: var(--brand);
}

.status.alert {
  background: #f8ddd6;
  color: var(--danger);
}

.split {
  display: grid;
  gap: 16px;
  grid-template-columns: minmax(360px, 0.92fr) minmax(0, 1.08fr);
}

.form-grid {
  display: grid;
  gap: 10px;
}

.form-grid.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.field {
  display: grid;
  gap: 4px;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(101, 72, 40, 0.18);
  background: rgba(255, 255, 255, 0.82);
}

.field textarea {
  min-height: 98px;
  resize: vertical;
}

.login-wrap {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.login-brand {
  display: flex;
  justify-content: center;
  width: 100%;
}

.login-copy {
  text-align: center;
}

.login-copy .pill {
  margin-inline: auto;
}

.login {
  width: min(460px, 100%);
  padding: 34px;
}

.pill-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.pill {
  background: #dfeaff;
  color: #214697;
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 0.82rem;
}

.notice {
  padding: 10px 12px;
  border-radius: 16px;
  background: #eef5ff;
  border: 1px solid rgba(79, 132, 217, 0.22);
}

.photo-panel {
  padding: 14px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: rgba(241, 247, 255, 0.96);
  display: grid;
  gap: 14px;
}

.webcam-tools {
  display: grid;
  gap: 12px;
}

.controlid-tools {
  display: grid;
  gap: 8px;
}

.webcam-tools video {
  width: 100%;
  max-height: 280px;
  object-fit: cover;
  border-radius: 18px;
  background: #1d1a16;
}

.photo-preview-wrap {
  display: grid;
  gap: 12px;
  justify-items: start;
}

.photo-preview {
  width: 160px;
  height: 160px;
  border-radius: 20px;
  object-fit: cover;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  background: linear-gradient(180deg, #f5f9ff, #d9e8ff);
}

.controlid-live-note {
  font-size: 0.84rem;
}

.person-thumb {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  object-fit: cover;
  display: grid;
  place-items: center;
  background: #d6e6ff;
  color: #214697;
  font-weight: 700;
}

.person-thumb.placeholder {
  border: 1px solid var(--line);
}

.code-block {
  background: #241f19;
  color: #f7efe4;
  border-radius: 18px;
  padding: 14px 16px;
  overflow: auto;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.code-block pre {
  margin: 0;
  font-family: Consolas, "Courier New", monospace;
  font-size: 0.88rem;
  line-height: 1.45;
}

.footer-note {
  margin-top: 12px;
  color: var(--muted);
  font-size: 0.84rem;
}

.credit-note {
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.sidebar.panel {
  position: sticky;
  top: 16px;
  align-self: start;
}

.dashboard-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: minmax(0, 1.2fr) minmax(320px, 0.8fr);
}

.dashboard-stack {
  display: grid;
  gap: 12px;
}

.dashboard-block {
  background: rgba(244, 249, 255, 0.94);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 14px;
}

.recent-access-list {
  display: grid;
  gap: 10px;
  max-height: 420px;
  overflow-y: auto;
  padding-right: 4px;
}

.recent-access-item {
  padding: 12px 14px;
  border-radius: 16px;
  border: 1px solid rgba(79, 132, 217, 0.16);
  background: rgba(255, 255, 255, 0.88);
}

.recent-access-top,
.recent-access-bottom {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.recent-access-top strong {
  display: block;
  font-size: 1rem;
  color: var(--text);
}

.recent-access-meta,
.recent-access-bottom {
  color: var(--muted);
  font-size: 0.84rem;
}

.recent-access-meta {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 4px;
}

.recent-access-bottom {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid rgba(79, 132, 217, 0.12);
}

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

.dashboard-mini {
  background: #edf4ff;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 12px;
}

.dashboard-mini strong {
  display: block;
  margin-top: 4px;
  font-size: 1.3rem;
}

.content.panel {
  overflow: hidden;
}

.table-wrap table button.ghost,
.table-wrap .ghost {
  white-space: nowrap;
}

.field span {
  font-size: 0.86rem;
  color: var(--muted);
}

.sticky-form {
  position: sticky;
  top: 16px;
  align-self: start;
  max-height: calc(100vh - 32px);
  overflow: auto;
  padding-right: 4px;
}

.logo-card {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px;
  border-radius: 22px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(233, 242, 255, 0.96));
  border: 1px solid rgba(34, 80, 162, 0.14);
  box-shadow: 0 14px 36px rgba(31, 68, 138, 0.12);
}

.club-logo {
  width: 180px;
  max-width: 100%;
  display: block;
}

.login-logo {
  width: 220px;
}

.hero-logo-card {
  flex: 0 0 auto;
}

@media (max-width: 980px) {
  .layout,
  .split,
  .dashboard-grid,
  .form-grid.two {
    grid-template-columns: 1fr;
  }

  .recent-access-top,
  .recent-access-bottom {
    flex-direction: column;
    align-items: flex-start;
  }

  .sidebar.panel {
    position: static;
  }

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

  .sticky-form {
    position: static;
    max-height: none;
    overflow: visible;
    padding-right: 0;
  }
}
