/**
 * PaddleScoreByNawaaz — operator dashboard styles
 * ----------------------------------------------------
 * Clean, light, "boring on purpose" admin UI. The broadcast graphics carry
 * all the visual flair — this panel just needs to be fast and unambiguous
 * for a non-technical scorekeeper working live, often on a tablet.
 */

body {
  font-family: var(--ps-font-ui);
  background: var(--ps-bg);
  color: var(--ps-text);
  margin: 0;
}

.app {
  display: flex;
  min-height: 100vh;
}

/* ---- Sidebar navigation ------------------------------------------------ */

.sidebar {
  width: 220px;
  flex-shrink: 0;
  background: var(--ps-surface);
  border-right: 1px solid var(--ps-border);
  padding: var(--ps-space-4);
  display: flex;
  flex-direction: column;
  gap: var(--ps-space-2);
}

.sidebar__brand {
  font-family: var(--ps-font-display);
  font-size: 20px;
  margin: 0 0 var(--ps-space-5);
  color: var(--ps-text);
}
.sidebar__brand span {
  color: var(--ps-red);
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--ps-radius-sm);
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  color: var(--ps-text-muted);
  border: none;
  background: none;
  text-align: left;
  width: 100%;
}
.nav-item:hover {
  background: var(--ps-surface-alt);
}
.nav-item.active {
  background: var(--ps-navy-950);
  color: #fff;
}

.sidebar__match {
  margin-top: auto;
  padding-top: var(--ps-space-4);
  border-top: 1px solid var(--ps-border);
  font-size: 12px;
  color: var(--ps-text-muted);
}
.sidebar__match select {
  width: 100%;
  margin-top: 6px;
}

/* ---- Main content -------------------------------------------------------*/

.main {
  flex: 1;
  padding: var(--ps-space-6);
  max-width: 1100px;
}

.panel {
  display: none;
}
.panel.active {
  display: block;
}

h1 {
  font-family: var(--ps-font-display);
  font-size: 26px;
  margin: 0 0 4px;
}
.panel-subtitle {
  color: var(--ps-text-muted);
  margin: 0 0 var(--ps-space-5);
  font-size: 14px;
}

.card {
  background: var(--ps-surface);
  border: 1px solid var(--ps-border);
  border-radius: var(--ps-radius-md);
  box-shadow: var(--ps-shadow-ui);
  padding: var(--ps-space-5);
  margin-bottom: var(--ps-space-5);
}

.card h2 {
  font-size: 16px;
  margin: 0 0 var(--ps-space-4);
}

.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--ps-space-4);
}
.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--ps-space-4);
}

label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--ps-text-muted);
  margin-bottom: 4px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

input[type="text"],
input[type="number"],
input[type="date"],
select,
textarea {
  width: 100%;
  padding: 9px 10px;
  border: 1px solid var(--ps-border);
  border-radius: var(--ps-radius-sm);
  font-size: 14px;
  font-family: var(--ps-font-ui);
  background: #fff;
  color: var(--ps-text);
  margin-bottom: var(--ps-space-3);
}

.field {
  margin-bottom: var(--ps-space-3);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 16px;
  border-radius: var(--ps-radius-sm);
  border: 1px solid var(--ps-border);
  background: #fff;
  color: var(--ps-text);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}
.btn:hover {
  background: var(--ps-surface-alt);
}
.btn-primary {
  background: var(--ps-navy-950);
  border-color: var(--ps-navy-950);
  color: #fff;
}
.btn-primary:hover {
  background: var(--ps-navy-800);
}
.btn-danger {
  background: var(--ps-red);
  border-color: var(--ps-red);
  color: #fff;
}
.btn-sm {
  padding: 5px 10px;
  font-size: 12px;
}
.btn-block {
  width: 100%;
}
.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.row {
  display: flex;
  gap: var(--ps-space-3);
  align-items: center;
}
.row-between {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 14px;
  user-select: none;
}
.toggle input {
  width: 36px;
  height: 20px;
  appearance: none;
  background: var(--ps-border);
  border-radius: 999px;
  position: relative;
  cursor: pointer;
  outline: none;
  transition: background 0.15s;
}
.toggle input::before {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  background: #fff;
  border-radius: 50%;
  transition: transform 0.15s;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}
.toggle input:checked {
  background: var(--ps-green);
}
.toggle input:checked::before {
  transform: translateX(16px);
}

.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.badge-live { background: #e6f9f1; color: var(--ps-green); }
.badge-pending { background: #fff4e0; color: #a86400; }
.badge-done { background: #eef0f5; color: var(--ps-text-muted); }

/* ---- Live scoring panel ------------------------------------------------- */

.score-team {
  border: 1px solid var(--ps-border);
  border-radius: var(--ps-radius-md);
  padding: var(--ps-space-4);
  margin-bottom: var(--ps-space-4);
  border-left: 6px solid var(--team-color, var(--ps-red));
}

.score-team__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--ps-space-3);
}
.score-team__name {
  font-family: var(--ps-font-display);
  font-size: 18px;
}

.score-readout {
  display: flex;
  gap: var(--ps-space-3);
  align-items: center;
  margin-bottom: var(--ps-space-3);
}
.readout-block {
  text-align: center;
  min-width: 64px;
}
.readout-block__value {
  font-family: var(--ps-font-display);
  font-size: 30px;
}
.readout-block__label {
  font-size: 10px;
  text-transform: uppercase;
  color: var(--ps-text-muted);
  letter-spacing: 0.05em;
}

.stepper {
  display: flex;
  gap: 6px;
}
.stepper .btn {
  min-width: 40px;
}

.big-point-btn {
  font-family: var(--ps-font-display);
  font-size: 20px;
  padding: 18px;
  width: 100%;
  border-radius: var(--ps-radius-md);
  background: var(--team-color, var(--ps-navy-950));
  color: #fff;
  border: none;
  cursor: pointer;
  margin-top: var(--ps-space-2);
}
.big-point-btn:active {
  transform: scale(0.98);
}

.list-item {
  display: flex;
  align-items: center;
  gap: var(--ps-space-3);
  padding: var(--ps-space-3);
  border: 1px solid var(--ps-border);
  border-radius: var(--ps-radius-sm);
  margin-bottom: var(--ps-space-2);
}
.list-item img {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--ps-surface-alt);
}
.list-item__body {
  flex: 1;
}
.list-item__title {
  font-weight: 600;
  font-size: 14px;
}
.list-item__subtitle {
  font-size: 12px;
  color: var(--ps-text-muted);
}

.overlay-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--ps-space-3);
  padding: var(--ps-space-3);
  border: 1px solid var(--ps-border);
  border-radius: var(--ps-radius-sm);
  margin-bottom: var(--ps-space-2);
  font-size: 13px;
}
.overlay-link code {
  background: var(--ps-surface-alt);
  padding: 3px 6px;
  border-radius: 4px;
  word-break: break-all;
}

.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: var(--ps-navy-950);
  color: #fff;
  padding: 10px 16px;
  border-radius: var(--ps-radius-sm);
  font-size: 13px;
  box-shadow: var(--ps-shadow-broadcast);
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.2s, transform 0.2s;
  pointer-events: none;
  z-index: 50;
}
.toast.show {
  opacity: 1;
  transform: translateY(0);
}

.connection-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
  background: #c9cfdc;
}
.connection-dot.online { background: var(--ps-green); }
.connection-dot.offline { background: var(--ps-red); }
