/* Syndicate — lottery organiser. Plain CSS, no framework.
   Palette + components inspired by apps/quiz/frontend/css/styles.css so the
   baizeworks subdomains feel related. */

:root {
  --indigo:      #4f46e5;
  --indigo-dark: #3730a3;
  --indigo-soft: #eef2ff;
  --ink:         #1e1b30;
  --muted:       #6b7280;
  --line:        #e5e7eb;
  --bg:          #f4f4f8;
  --surface:     #ffffff;
  --green:       #16a34a;
  --green-soft:  #dcfce7;
  --red:         #dc2626;
  --red-soft:    #fee2e2;
  --amber:       #d97706;
  --amber-soft:  #fef3c7;
  --grey:        #9ca3af;
  --grey-soft:   #f1f1f4;
  --radius:      14px;
  --shadow:      0 1px 3px rgba(20, 16, 50, .08), 0 8px 24px rgba(20, 16, 50, .06);
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica,
               Arial, sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

.hidden { display: none !important; }

/* ---------- generic views ---------- */

.view-centered {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: linear-gradient(160deg, #4f46e5 0%, #7c3aed 55%, #2563eb 100%);
}

.card {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

/* ---------- auth ---------- */

.auth-card {
  width: 100%;
  max-width: 360px;
  padding: 32px 28px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.brand { font-size: 30px; font-weight: 800; letter-spacing: -.5px; color: var(--indigo); }
.brand-sub { margin: -6px 0 8px; color: var(--muted); font-size: 14px; }
.auth-card label {
  display: flex; flex-direction: column; gap: 5px;
  font-size: 13px; font-weight: 600; color: var(--muted);
}

input, select, textarea {
  font: inherit;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
  color: var(--ink);
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--indigo); outline-offset: -1px; }

.error-text { color: var(--red); font-size: 14px; min-height: 1.2em; margin: 0; }

/* ---------- buttons ---------- */

.btn {
  font: inherit;
  font-weight: 600;
  padding: 9px 16px;
  border-radius: 9px;
  border: 1px solid transparent;
  cursor: pointer;
  background: transparent;
}
.btn-primary {
  background: var(--indigo); color: #fff; border-color: var(--indigo);
}
.btn-primary:hover { background: var(--indigo-dark); border-color: var(--indigo-dark); }
.btn-outline {
  background: transparent; color: var(--indigo); border-color: var(--indigo);
}
.btn-outline:hover { background: var(--indigo-soft); }
.btn-ghost {
  background: transparent; color: var(--ink); border-color: transparent;
}
.btn-ghost:hover { background: var(--grey-soft); }
.btn-danger {
  background: var(--red); color: #fff; border-color: var(--red);
}
.btn-small { padding: 5px 10px; font-size: 13px; border-radius: 7px; }

/* ---------- top bar / tabs ---------- */

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 24px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}
.topbar-left, .topbar-right {
  display: flex; align-items: center; gap: 14px;
}
.brand-small { font-size: 20px; font-weight: 800; color: var(--indigo); }
.status-line { color: var(--muted); font-size: 13px; }
.who { color: var(--muted); font-size: 14px; }

.tabs {
  display: flex; gap: 4px;
  background: var(--surface);
  padding: 0 24px;
  border-bottom: 1px solid var(--line);
  overflow-x: auto;
}
.tab {
  font: inherit;
  background: transparent;
  border: none;
  padding: 14px 18px;
  cursor: pointer;
  color: var(--muted);
  font-weight: 600;
  border-bottom: 3px solid transparent;
  margin-bottom: -1px;
}
.tab:hover { color: var(--ink); }
.tab.active { color: var(--indigo); border-bottom-color: var(--indigo); }

.content { padding: 24px; max-width: 1100px; margin: 0 auto; }
.tab-panel { display: block; }
.tab-panel.hidden { display: none; }
.footer { padding: 24px; color: var(--muted); font-size: 12px; text-align: center; }

/* ---------- panels & sections ---------- */

.section {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px 22px;
  margin-bottom: 18px;
}
.section h2 { margin: 0 0 12px; font-size: 18px; }
.section h3 { margin: 18px 0 8px; font-size: 15px; color: var(--muted); }
.section .muted { color: var(--muted); font-size: 14px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row.spread { justify-content: space-between; }
.stack { display: flex; flex-direction: column; gap: 10px; }

/* ---------- tables ---------- */

table.data {
  width: 100%; border-collapse: collapse; font-size: 14px;
}
table.data th, table.data td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}
table.data th { color: var(--muted); font-weight: 600; font-size: 12px; text-transform: uppercase; }
table.data td.num { text-align: right; font-variant-numeric: tabular-nums; }
table.data tr:hover td { background: var(--grey-soft); }
table.data tfoot td { font-weight: 700; border-top: 2px solid var(--line); }
table.data.only-winners tbody tr:not(.winner) { display: none; }
table.data td.mm-cell { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; }
table.data td.mm-cell.mm-match { background: var(--green-soft); color: var(--green); font-weight: 700; }
.mm-jackpot { color: var(--green); font-weight: 700; }

.pill { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 12px; font-weight: 600; }
.pill.green { background: var(--green-soft); color: var(--green); }
.pill.red { background: var(--red-soft); color: var(--red); }
.pill.amber { background: var(--amber-soft); color: var(--amber); }
.pill.grey { background: var(--grey-soft); color: var(--muted); }

.balance-positive { color: var(--green); }
.balance-negative { color: var(--red); }

/* ---------- numbers display ---------- */

.ball-row { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.ball {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  height: 32px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--indigo-soft);
  color: var(--indigo-dark);
  font-weight: 700;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}
.ball.star { background: #fef3c7; color: #b45309; }
.ball.match { box-shadow: 0 0 0 2px var(--green); }
.sep { color: var(--muted); font-weight: 700; }

pre.js-preview {
  background: #1e1b30;
  color: #e0e0ff;
  padding: 14px;
  border-radius: 9px;
  font-size: 12px;
  max-height: 220px;
  overflow: auto;
}
