/* Palette, type, and component language pulled directly from bluetree.tv */
:root {
  --bg:      #050C1C;
  --bg2:     #0B1428;
  --bg3:     #101E3A;
  --blue:    #1A5FD8;
  --blue-lt: #2E7FFF;
  --cyan:    #00CFFF;
  --coral:   #FF4060;
  --teal:    #00C8A0;
  --text:    #EEF4FF;
  --muted:   #6B7FA8;
  --border:  rgba(255, 255, 255, 0.08);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 5%;
  background: rgba(5, 12, 28, 0.9);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}

.topbar .brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--text);
  text-decoration: none;
  font-weight: 700;
}
.topbar .brand img { height: 36px; width: auto; }
.topbar .brand span {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 1.4rem;
  letter-spacing: 1px;
  color: var(--muted);
}

.topbar .logout {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  transition: color 0.2s;
}
.topbar .logout:hover { color: var(--text); }

.content {
  max-width: 900px;
  margin: 0 auto;
  padding: 2.5rem 5%;
}

h1 {
  font-family: 'Bebas Neue', sans-serif;
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  letter-spacing: 1.5px;
  line-height: 1;
  margin: 0 0 0.5rem;
}

h2 {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 1.1rem;
  letter-spacing: 1px;
  margin: 1.75rem 0 0;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border);
  color: var(--muted);
}
h2:first-of-type { border-top: none; padding-top: 0; margin-top: 0; }

.subtitle { color: var(--muted); margin: 0 0 1.5rem; }

.flashes {
  list-style: none;
  padding: 0;
  margin: 0 0 1.5rem;
}
.flashes li {
  background: rgba(0, 200, 160, 0.1);
  border: 1px solid rgba(0, 200, 160, 0.35);
  color: var(--teal);
  padding: 0.7rem 1rem;
  border-radius: 8px;
  margin-bottom: 0.5rem;
  font-size: 0.92rem;
}

.tile-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1rem;
}

.tile {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.3rem;
  min-height: 84px;
  padding: 1.4rem 1.5rem;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--blue), var(--blue-lt));
  border: none;
  color: #fff;
  text-decoration: none;
  font-family: 'Bebas Neue', sans-serif;
  font-size: 1.3rem;
  letter-spacing: 0.5px;
  box-shadow: 0 0 24px rgba(26, 95, 216, 0.4);
  transition: transform 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease;
}
.tile:nth-child(3n+2) { background: linear-gradient(135deg, #0091a8, var(--cyan)); box-shadow: 0 0 24px rgba(0, 145, 168, 0.4); }
.tile:nth-child(3n+3) { background: linear-gradient(135deg, #00947c, var(--teal)); box-shadow: 0 0 24px rgba(0, 148, 124, 0.4); }
.tile:hover {
  transform: translateY(-3px);
  filter: brightness(1.12);
  box-shadow: 0 8px 32px rgba(46, 127, 255, 0.5);
}
.tile:active { transform: translateY(-1px); }
.tile-disabled {
  color: var(--muted);
  cursor: default;
  background: var(--bg2);
  box-shadow: none;
  opacity: 0.55;
}
.tile-disabled:hover { transform: none; filter: none; box-shadow: none; }
.tile small {
  font-family: 'Inter', sans-serif;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.85);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.tile-disabled small { color: var(--muted); }

.login-card {
  max-width: 360px;
  margin: 12vh auto 0;
  padding: 2rem;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 20px;
}
.login-card h1 { text-align: center; margin-bottom: 1.5rem; }

.form, form {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-width: 480px;
}

label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--muted);
  margin-top: 10px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

input, textarea {
  padding: 0.65rem 0.8rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 1rem;
  font-family: inherit;
  background: var(--bg3);
  color: var(--text);
}
input::placeholder, textarea::placeholder { color: var(--muted); }
input:focus, textarea:focus {
  outline: none;
  border-color: var(--blue-lt);
  box-shadow: 0 0 0 3px rgba(46, 127, 255, 0.2);
}

button, .button-secondary {
  margin-top: 1.1rem;
  padding: 0.85rem 1.6rem;
  border-radius: 8px;
  border: none;
  font-size: 1.05rem;
  font-weight: 700;
  cursor: pointer;
  text-align: center;
  text-decoration: none;
  font-family: inherit;
  min-height: 48px;
}

button {
  background: linear-gradient(135deg, var(--blue), var(--blue-lt));
  color: #fff;
  box-shadow: 0 0 24px rgba(26, 95, 216, 0.4);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
button:hover { transform: translateY(-1px); box-shadow: 0 0 36px rgba(46, 127, 255, 0.55); }

.form-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}

.button-secondary {
  background: var(--bg3);
  color: var(--text);
  border: 1px solid rgba(255, 255, 255, 0.16);
}
.button-secondary:hover { border-color: var(--muted); background: #16274a; }

.hint {
  color: var(--muted);
  font-size: 0.8rem;
  margin-top: 2px;
}

.field-row {
  display: flex;
  gap: 16px;
}
.field-row > div {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.checkbox-label, .radio-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 500;
  color: var(--text);
  margin-top: 12px;
  font-size: 0.95rem;
  text-transform: none;
}
.checkbox-label input, .radio-label input {
  width: auto;
  accent-color: var(--blue-lt);
}

.pairing-fields {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 14px;
  margin-top: 10px;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 10px;
}

.match-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: 480px;
}

.match-row {
  display: flex;
  align-items: baseline;
  gap: 12px;
  padding: 12px 16px;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 10px;
  text-decoration: none;
  color: var(--text);
  transition: border-color 0.2s ease;
}
.match-row:hover { border-color: var(--blue-lt); }
.match-row .hint { margin-left: auto; }

.readonly-block {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 10px 20px;
  padding: 14px 16px;
  margin-bottom: 20px;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 12px;
  max-width: 480px;
}
.readonly-block > div { display: flex; flex-direction: column; }
.readonly-block label {
  margin-top: 0;
  font-size: 0.72rem;
}
.readonly-block span {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.88rem;
  color: var(--text);
  word-break: break-all;
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 12px;
}

.report-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--bg2);
  font-size: 0.9rem;
}
.report-table th, .report-table td {
  text-align: left;
  padding: 10px 14px;
  white-space: nowrap;
}
.report-table thead th {
  background: var(--bg3);
  color: var(--muted);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-bottom: 1px solid var(--border);
}
.report-table tbody tr:not(:last-child) td {
  border-bottom: 1px solid var(--border);
}
.report-table tbody tr:hover { background: var(--bg3); }

/* ── Mobile ──────────────────────────────── */
@media (max-width: 640px) {
  .content { padding: 1.5rem 5%; }

  .topbar { padding: 0.65rem 5%; }
  .topbar .brand img { height: 30px; }
  .topbar .brand span { font-size: 1.15rem; }

  .tile-grid { grid-template-columns: 1fr; gap: 0.85rem; }
  .tile { min-height: 72px; font-size: 1.15rem; padding: 1.2rem 1.3rem; }

  .form, form { max-width: 100%; }
  input, textarea { font-size: 16px; } /* prevents iOS auto-zoom on focus */

  .field-row { flex-direction: column; gap: 0; }

  .form-actions { flex-direction: column-reverse; align-items: stretch; }
  .form-actions button, .form-actions .button-secondary { width: 100%; margin-top: 0.6rem; }

  .readonly-block { grid-template-columns: 1fr; }

  .report-table { font-size: 0.85rem; }
  .report-table th, .report-table td { padding: 8px 10px; }
}
