:root {
  color-scheme: dark;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #000000;
  color: #ffffff;
  --panel: #242424;
  --panel-soft: #4b4b4b;
  --line: #535353;
  --gold: #f5c400;
  --gold-dark: #9d7220;
  --muted: #b1b1b1;
  --danger: #ef6a6a;
  --success: #55c58a;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: #000;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

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

.auth-card,
.panel {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--panel);
}

.auth-card {
  width: min(440px, 100%);
  padding: 34px;
}

.brand {
  color: var(--gold);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 8px 0;
}

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

.stack,
.form-grid {
  display: grid;
  gap: 16px;
}

.stack {
  margin-top: 28px;
}

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

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

.field.full {
  grid-column: 1 / -1;
}

label {
  color: #d8deea;
  font-size: 0.84rem;
  font-weight: 700;
}

input,
select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  outline: none;
  background: var(--panel-soft);
  color: #fff;
  padding: 11px 12px;
}

input:focus,
select:focus {
  border-color: var(--gold-dark);
}

.button {
  border: 1px solid var(--gold);
  border-radius: 10px;
  background: var(--gold);
  color: #181818;
  font-weight: 800;
  padding: 11px 16px;
}

.button.secondary {
  border-color: var(--line);
  background: var(--panel-soft);
  color: #fff;
}

.button.danger {
  border-color: #633;
  background: #32191d;
  color: #ffb2b2;
}

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

.badge.suspended {
  background: #f59e0b;
  color: #fff;
}

.badge.banned {
  background: #dc2626;
  color: #fff;
}

.contact-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 12px;
}

.contact-row input {
  flex: 1 1 160px;
}

.contact-row .contact-link {
  flex-basis: 240px;
}


.message {
  min-height: 1.25rem;
  color: var(--danger);
  font-size: 0.9rem;
}

.message.success {
  color: var(--success);
}

.app-shell {
  display: grid;
  grid-template-columns: 230px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  border-right: 1px solid var(--line);
  background: #000000;
  padding: 28px 18px;
}

.nav {
  display: grid;
  gap: 7px;
  margin-top: 34px;
}

.nav a,
.nav button {
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--muted);
  padding: 11px 12px;
  text-align: left;
}

.nav a:hover,
.nav a.active,
.nav button:hover {
  background: var(--panel-soft);
  color: #fff;
}

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

.page-header,
.actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.actions-group {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.page-header {
  justify-content: space-between;
  margin-bottom: 24px;
}

.panel {
  margin-bottom: 22px;
  padding: 22px;
}

.table-wrap {
  overflow-x: auto;
}

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

th,
td {
  border-bottom: 1px solid var(--line);
  padding: 13px 10px;
  text-align: left;
  vertical-align: middle;
}

th {
  color: var(--muted);
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.badge {
  display: inline-flex;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 8px;
  font-size: 0.76rem;
  font-weight: 800;
}

.badge.completed,
.badge.active {
  border-color: #275a42;
  color: #78dda6;
}

.badge.revealing {
  border-color: var(--gold-dark);
  color: var(--gold);
}

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

.next-slot {
  margin-bottom: 24px;
}

.next-slot-label {
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  margin-bottom: 10px;
  text-transform: uppercase;
}

.next-slot-card {
  border: 1px solid var(--gold-dark);
  border-radius: 14px;
  background: var(--panel);
  padding: 20px 22px;
}

.next-slot-time {
  color: var(--gold);
  font-size: 1.3rem;
  font-weight: 800;
  margin-bottom: 16px;
}

.slot-inputs {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.slot-inputs .field {
  flex: 1;
  min-width: 100px;
}

.slot-inputs select,
.slot-inputs input {
  padding: 9px 10px;
}

.no-upcoming {
  color: var(--muted);
  font-size: 0.9rem;
  padding: 12px 0;
}

.draw-results-title {
  margin-bottom: 16px;
}

.result-value {
  font-weight: 700;
}

.confirm-text {
  color: var(--danger);
  font-size: 0.82rem;
  font-weight: 600;
}

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

  .sidebar {
    border-bottom: 1px solid var(--line);
    border-right: 0;
    padding: 18px;
  }

  .nav {
    grid-template-columns: repeat(3, auto);
    margin-top: 16px;
    overflow-x: auto;
  }

  .main {
    padding: 22px 16px;
  }

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

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

/* Additional CSS for edit modal and contacts */
.contacts-column {
  min-width: 240px;
}

.contact-chip {
  background: var(--panel-soft);
  padding: 6px 10px;
  border-radius: 8px;
  margin-bottom: 6px;
  font-size: 14px;
}

.modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.75);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.modal.hidden {
  display: none;
}

.modal-card {
  width: min(700px, 95vw);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 24px;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.modal-header button {
  border: none;
  background: none;
  color: white;
  font-size: 24px;
}
