:root {
  --bg: #070b16;
  --panel: rgba(255,255,255,0.08);
  --panel-strong: rgba(255,255,255,0.14);
  --text: #eef4ff;
  --muted: #9fb0cc;
  --line: rgba(255,255,255,0.12);
  --accent: #7c5cff;
  --accent-2: #00d4ff;
  --success: #32d583;
  --warning: #fdb022;
  --danger: #f97066;
  --shadow: 0 30px 80px rgba(0,0,0,0.45);
  --radius: 24px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(124,92,255,0.35), transparent 35%),
    radial-gradient(circle at top right, rgba(0,212,255,0.22), transparent 30%),
    linear-gradient(135deg, #050712 0%, #0b1022 50%, #060914 100%);
}

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

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

/* AUTH */

.auth-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 28px;
}

.auth-card {
  width: 100%;
  max-width: 460px;
  padding: 34px;
  border: 1px solid var(--line);
  border-radius: 32px;
  background: linear-gradient(135deg, rgba(255,255,255,0.14), rgba(255,255,255,0.05));
  box-shadow: var(--shadow);
  backdrop-filter: blur(24px);
}

.auth-brand {
  display: flex;
  gap: 16px;
  align-items: center;
  margin-bottom: 30px;
}

.auth-brand h1 {
  margin: 0;
  font-size: 28px;
  letter-spacing: -0.05em;
}

.auth-brand p {
  margin: 4px 0 0;
  color: var(--muted);
}

.auth-form {
  display: grid;
  gap: 18px;
}

.auth-form label,
.enterprise-form label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

/* FORM ELEMENTS */

.auth-form input,
.enterprise-form input,
.enterprise-form select,
.enterprise-form textarea {
  width: 100%;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 16px;
  padding: 14px 16px;
  color: var(--text);
  outline: none;
  background:
    linear-gradient(135deg, rgba(255,255,255,0.08), rgba(255,255,255,0.03));
  backdrop-filter: blur(20px);
  transition: all 0.2s ease;
}

.enterprise-form select {
  cursor: pointer;
  padding-right: 42px;
  background-image:
    linear-gradient(135deg, rgba(255,255,255,0.08), rgba(255,255,255,0.03)),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%23eef4ff' viewBox='0 0 16 16'%3E%3Cpath d='M3.204 5h9.592L8 11z'/%3E%3C/svg%3E");
  background-repeat: no-repeat, no-repeat;
  background-position: center, right 16px center;
  background-size: auto, 12px;
}

.enterprise-form option {
  background: #0f172a;
  color: #eef4ff;
}

.auth-form input:focus,
.enterprise-form input:focus,
.enterprise-form select:focus,
.enterprise-form textarea:focus {
  border-color: rgba(124,92,255,0.8);
  box-shadow:
    0 0 0 4px rgba(124,92,255,0.15),
    0 10px 30px rgba(124,92,255,0.25);
  transform: translateY(-1px);
}

#roleSelect,
#clubSelect {
  font-weight: 700;
}

/* SHELL */

.app-shell {
  display: grid;
  grid-template-columns: 290px 1fr;
  min-height: 100vh;
}

.sidebar {
  padding: 28px;
  border-right: 1px solid var(--line);
  background: rgba(5, 9, 20, 0.72);
  backdrop-filter: blur(24px);
  display: flex;
  flex-direction: column;
  gap: 28px;
}

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

.brand-mark {
  width: 48px;
  height: 48px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  font-weight: 900;
  font-size: 24px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 16px 40px rgba(124,92,255,0.45);
}

.brand h1 {
  margin: 0;
  font-size: 23px;
  letter-spacing: -0.04em;
}

.brand span,
.eyebrow,
.sidebar-footer span,
.sidebar-label {
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.sidebar-label {
  margin: 0 0 10px;
}

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

.nav-item {
  width: 100%;
  border: 0;
  color: var(--muted);
  background: transparent;
  text-align: left;
  padding: 13px 15px;
  border-radius: 15px;
  cursor: pointer;
  transition: 0.18s ease;
}

.nav-item:hover,
.nav-item.active {
  color: var(--text);
  background: var(--panel-strong);
}

.nav-item.disabled {
  opacity: 0.38;
  cursor: not-allowed;
}

.sidebar-footer {
  margin-top: auto;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--panel);
  overflow-wrap: anywhere;
}

.sidebar-footer strong {
  display: block;
  margin-top: 5px;
  font-size: 13px;
}

.main {
  padding: 30px;
  min-width: 0;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 26px;
  gap: 20px;
}

.topbar h2 {
  margin: 4px 0 0;
  font-size: 34px;
  letter-spacing: -0.05em;
}

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

.primary-btn,
.ghost-btn {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px 16px;
  cursor: pointer;
  color: var(--text);
}

.primary-btn {
  border: 0;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 14px 36px rgba(124,92,255,0.38);
}

.ghost-btn {
  background: var(--panel);
}

.content {
  display: grid;
  gap: 22px;
}

.hero {
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(135deg, rgba(255,255,255,0.12), rgba(255,255,255,0.04));
  box-shadow: var(--shadow);
}

.hero h3 {
  margin: 0;
  font-size: 30px;
  letter-spacing: -0.04em;
}

.hero p {
  color: var(--muted);
  max-width: 820px;
  line-height: 1.7;
}

.grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(180px, 1fr));
  gap: 18px;
}

.card {
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 22px;
  background: var(--panel);
  backdrop-filter: blur(20px);
}

.card span {
  color: var(--muted);
  font-size: 13px;
}

.card strong {
  display: block;
  margin-top: 12px;
  font-size: 30px;
  letter-spacing: -0.05em;
}

.module-panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255,255,255,0.07);
  overflow: hidden;
}

.panel-header {
  padding: 22px;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.panel-header h3 {
  margin: 0;
}

.table {
  width: 100%;
  border-collapse: collapse;
}

.table th,
.table td {
  padding: 16px 22px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.table th {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

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

code {
  color: #c7d2fe;
  background: rgba(124,92,255,0.14);
  padding: 4px 8px;
  border-radius: 8px;
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(50,213,131,0.15);
  color: var(--success);
  font-size: 12px;
  font-weight: 800;
}

.badge.warning {
  color: var(--warning);
  background: rgba(253,176,34,0.14);
}

.badge.danger {
  color: var(--danger);
  background: rgba(249,112,102,0.14);
}

/* FORMS */

.enterprise-form {
  padding: 24px;
  display: grid;
  gap: 22px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(220px, 1fr));
  gap: 18px;
}

.provision-preview {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: center;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(3, 7, 18, 0.38);
}

.provision-preview span {
  color: var(--muted);
  font-size: 13px;
}

.provision-preview strong {
  font-size: 18px;
}

.form-message {
  margin: 0;
  color: var(--muted);
  min-height: 22px;
}

/* RESPONSIVE */

@media (max-width: 1100px) {
  .grid {
    grid-template-columns: repeat(2, minmax(180px, 1fr));
  }

  .app-shell {
    grid-template-columns: 250px 1fr;
  }
}

@media (max-width: 860px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
  }

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

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

@media (max-width: 620px) {
  .grid {
    grid-template-columns: 1fr;
  }

  .main,
  .sidebar {
    padding: 18px;
  }

  .auth-card {
    padding: 24px;
  }

  .table {
    display: block;
    overflow-x: auto;
  }
}
select,
input[type="search"],
input[id*="Search"],
#memberSearch {
  width: 100%;
  min-height: 44px;
  padding: 11px 14px;
  border: 1px solid rgba(148, 163, 184, 0.35);
  border-radius: 12px;
  background: #ffffff;
  color: #0f172a;
  font-size: 14px;
  font-weight: 500;
  outline: none;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  cursor: pointer;
  padding-right: 42px;
  background-image:
    linear-gradient(45deg, transparent 50%, #475569 50%),
    linear-gradient(135deg, #475569 50%, transparent 50%);
  background-position:
    calc(100% - 20px) 19px,
    calc(100% - 14px) 19px;
  background-size:
    6px 6px,
    6px 6px;
  background-repeat: no-repeat;
}

select:hover,
input[type="search"]:hover,
input[id*="Search"]:hover,
#memberSearch:hover {
  border-color: rgba(59, 130, 246, 0.55);
  background: #f8fafc;
}

select:focus,
input[type="search"]:focus,
input[id*="Search"]:focus,
#memberSearch:focus {
  border-color: #2563eb;
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12);
  background: #ffffff;
}

select option {
  color: #0f172a;
  background: #ffffff;
  font-size: 14px;
  padding: 10px;
}

.top-actions input,
.panel-header input,
#memberSearch {
  max-width: 320px;
  border-radius: 999px;
}

.clickable-row {
  cursor: pointer;
}

.clickable-row:hover {
  background: rgba(37, 99, 235, 0.06);
}
html {
  scroll-behavior: smooth;
}

body {
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

#app {
  animation: pageFadeIn 180ms ease-out;
  will-change: opacity, transform;
}

@keyframes pageFadeIn {
  from {
    opacity: 0;
    transform: translateY(6px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.hero,
.card,
.module-panel,
.table,
.enterprise-form {
  transition:
    transform 160ms ease,
    box-shadow 160ms ease,
    border-color 160ms ease,
    background-color 160ms ease,
    opacity 160ms ease;
}

.card:hover,
.module-panel:hover {
  transform: translateY(-1px);
}

button,
.primary-btn,
.ghost-btn,
.badge,
input,
select,
textarea,
.clickable-row {
  transition:
    background-color 150ms ease,
    border-color 150ms ease,
    box-shadow 150ms ease,
    color 150ms ease,
    transform 120ms ease,
    opacity 150ms ease;
}

button:active,
.primary-btn:active,
.ghost-btn:active {
  transform: scale(0.98);
}

.clickable-row:hover {
  background: rgba(37, 99, 235, 0.06);
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
.config-table input[data-config-name] {
  width: 100%;
  min-height: 42px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid rgba(148, 163, 184, 0.25);
  background: rgba(15, 23, 42, 0.55);
  color: #f8fafc;
  font-size: 14px;
  outline: none;
}

.config-table input[data-config-name]:focus {
  border-color: rgba(59, 130, 246, 0.75);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.16);
}

.config-table input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: #2563eb;
}

.config-table td {
  vertical-align: middle;
}
.config-card {
  min-height: 96px;
  padding: 18px 20px;
  border-radius: 18px;
  background: rgba(15, 23, 42, 0.42);
  border: 1px solid rgba(148, 163, 184, 0.18);
  box-shadow: none;
  cursor: pointer;
}

.config-card:hover {
  transform: translateY(-2px);
  border-color: rgba(59, 130, 246, 0.45);
  background: rgba(30, 41, 59, 0.6);
}

.config-card span {
  display: block;
  margin-bottom: 10px;
  color: #94a3b8;
  font-size: 13px;
  font-weight: 600;
}

.config-card strong {
  color: #f8fafc;
  font-size: 20px;
  line-height: 1.2;
}

.module-panel .grid:has(.config-card) {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
  padding: 18px;
}
.checkbox-grid {
  display: grid;
  gap: 0.6rem;
  margin-top: 0.75rem;
}

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.65rem 0.75rem;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
}

.checkbox-row input {
  width: auto;
}
input[type="checkbox"] {
  width: 18px !important;
  height: 18px !important;
  min-width: 18px;
  min-height: 18px;
  margin: 0;
  cursor: pointer;
}

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
}

.checkbox-row span {
  font-weight: 500;
}

.checkbox-grid {
  display: grid;
  gap: 8px;
}
/* FINAL DARK FORM FIXES */

/* Dropdown dark mode fix */
.enterprise-form select,
.auth-form select {
  background-color: rgba(15, 23, 42, 0.92) !important;
  color: #eef4ff !important;
  border-color: rgba(148, 163, 184, 0.35) !important;
}

.enterprise-form select:hover,
.auth-form select:hover {
  background-color: rgba(30, 41, 59, 0.96) !important;
  color: #eef4ff !important;
}

.enterprise-form select:focus,
.auth-form select:focus {
  background-color: rgba(15, 23, 42, 0.98) !important;
  color: #eef4ff !important;
}

/* Dropdown options */
.enterprise-form select option,
.auth-form select option {
  background-color: #0f172a !important;
  color: #eef4ff !important;
}

/* Checkbox visibility fix */
.enterprise-form input[type="checkbox"],
input[type="checkbox"] {
  appearance: auto !important;
  -webkit-appearance: checkbox !important;
  -moz-appearance: checkbox !important;

  width: 18px !important;
  height: 18px !important;
  min-width: 18px !important;
  min-height: 18px !important;

  padding: 0 !important;
  margin: 0 !important;

  accent-color: #00d4ff;
  background: #0f172a !important;
  border: 1px solid rgba(238, 244, 255, 0.7) !important;
  border-radius: 4px !important;

  cursor: pointer;
}

/* Checkbox row layout */
.checkbox-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.checkbox-row {
  display: flex !important;
  grid-template-columns: none !important;
  align-items: center;
  gap: 10px;

  padding: 10px 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.35);

  color: #eef4ff !important;
}

.checkbox-row:hover {
  background: rgba(30, 41, 59, 0.75);
  border-color: rgba(0, 212, 255, 0.45);
}

.checkbox-row span {
  color: #eef4ff !important;
  font-weight: 600;
}
