/*
 * sports-modern.css
 * Modern, compact, sleek sports-management theme
 * Layered on top of Bootstrap 3 + sb-admin-2
 */

/* ── Palette ─────────────────────────────────────────────────────────────── */
:root {
  --sport-dark:    #0d1b2a;
  --sport-navy:    #1a2e44;
  --sport-accent:  #1976d2;
  --sport-gold:    #f4a800;
  --sport-green:   #2e7d32;
  --sport-red:     #c62828;
  --sport-orange:  #e65100;
  --sport-teal:    #00838f;
  --sport-bg:      #f0f2f5;
  --sport-card:    #ffffff;
  --sport-border:  #d0d7e2;
  --sport-text:    #1a2340;
  --sport-muted:   #6b7a99;
  --radius-sm:     4px;
  --radius-md:     8px;
  --shadow-sm:     0 1px 4px rgba(0,0,0,.12);
  --shadow-md:     0 3px 10px rgba(0,0,0,.14);
}

/* ── Base ────────────────────────────────────────────────────────────────── */
body {
  background: var(--sport-bg);
  font-family: 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
  font-size: 13px;
  color: var(--sport-text);
  line-height: 1.4;
}

/* ── Typography ──────────────────────────────────────────────────────────── */
h1, h2, h3, h4, h5 {
  font-weight: 700;
  letter-spacing: -.01em;
  line-height: 1.25;
  margin-top: 4px;
  margin-bottom: 4px;
}
h1 { font-size: 1.6rem; }
h2 { font-size: 1.3rem; }
h3 { font-size: 1.1rem; }
h4 { font-size: .95rem; }
h5 { font-size: .85rem; }

strong { font-weight: 700; }

/* ── Row / grid tightening ───────────────────────────────────────────────── */
.row { margin-left: -6px; margin-right: -6px; }
[class*="col-"] { padding-left: 6px; padding-right: 6px; }

/* ── Cards (btn used as card containers) ────────────────────────────────── */
.btn.btn-default,
div.btn.btn-default {
  background: var(--sport-card);
  border: 1px solid var(--sport-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  color: var(--sport-text);
  padding: 8px 10px;
  margin-bottom: 6px;
  transition: box-shadow .15s, border-color .15s;
}
.btn.btn-default:hover,
div.btn.btn-default:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--sport-accent);
}

/* ── Action buttons ──────────────────────────────────────────────────────── */
.btn {
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 600;
  padding: 5px 10px;
  letter-spacing: .02em;
  border-width: 1px;
  transition: filter .12s, box-shadow .12s;
}
.btn:hover  { filter: brightness(1.08); box-shadow: 0 2px 6px rgba(0,0,0,.18); }
.btn:active { filter: brightness(.95); }

/* Primary variants */
.btn-primary,
a .btn-primary {
  background: var(--sport-accent);
  border-color: #1565c0;
  color: #fff;
}
.btn-success,
a .btn-success {
  background: var(--sport-green);
  border-color: #1b5e20;
  color: #fff;
}
.btn-danger,
a .btn-danger {
  background: var(--sport-red);
  border-color: #b71c1c;
  color: #fff;
}
.btn-warning,
a .btn-warning {
  background: var(--sport-gold);
  border-color: #e69500;
  color: #fff;
}
.btn-info,
a .btn-info {
  background: var(--sport-teal);
  border-color: #006064;
  color: #fff;
}

/* Outline variants */
.btn-success.btn-outline { background: transparent; color: var(--sport-green); border-color: var(--sport-green); }
.btn-danger.btn-outline  { background: transparent; color: var(--sport-red);   border-color: var(--sport-red);   }
.btn-warning.btn-outline { background: transparent; color: var(--sport-orange); border-color: var(--sport-gold);  }
.btn-info.btn-outline    { background: transparent; color: var(--sport-teal);  border-color: var(--sport-teal);  }
.btn-default.btn-outline { background: transparent; color: var(--sport-muted); border-color: var(--sport-border); }

.btn-success.btn-outline:hover { background: var(--sport-green); color: #fff; }
.btn-danger.btn-outline:hover  { background: var(--sport-red);   color: #fff; }
.btn-warning.btn-outline:hover { background: var(--sport-gold);  color: #fff; }
.btn-info.btn-outline:hover    { background: var(--sport-teal);  color: #fff; }

/* ── Player / entry cards ────────────────────────────────────────────────── */
.btn.col-lg-2,
.btn.col-md-3,
.btn.col-sm-4 {
  min-height: auto !important;
  padding: 8px 6px;
}

/* Profile images */
img[src*="images/150/"] {
  border-radius: var(--radius-sm);
  border: 2px solid var(--sport-border);
  display: block;
  width: 100%;
  max-width: 100%;
}

/* Level badge (btn-success small badge) */
.btn-success.btn-outline.col-sm-3,
.btn-danger.btn-lg[style*="float"] {
  font-size: 1rem;
  font-weight: 800;
  min-width: 48px;
  padding: 4px 6px;
}

/* ── Large action buttons (format selection) ─────────────────────────────── */
.btn-lg {
  font-size: 14px;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
}

/* ── Match / challenge rows ─────────────────────────────────────────────── */
.bg,
div.bg {
  background: transparent;
}

/* Highlighted (lightsalmon = has active match) */
[style*="lightsalmon"] {
  background: #fff3e0 !important;
  border-left: 3px solid var(--sport-gold) !important;
}

/* ── Tables ──────────────────────────────────────────────────────────────── */
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}
table th {
  background: var(--sport-navy);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  padding: 6px 8px;
}
table td {
  padding: 5px 8px;
  border-bottom: 1px solid var(--sport-border);
  vertical-align: middle;
}
table tr:nth-child(even) td { background: #f7f8fb; }
table tr:hover td { background: #eef2ff; }

/* ── Pool play tables / sections ────────────────────────────────────────── */
.pool-header,
.btn.btn-warning[style*="color"],
h3 strong {
  color: var(--sport-text);
}

/* Pool dividers */
.btn.btn-default.col-xs-12,
.btn.btn-default.col-lg-3 {
  border-top: 2px solid var(--sport-accent);
}

/* ── Navigation / top bar overrides ──────────────────────────────────────── */
.navbar-default,
.navbar {
  background: var(--sport-dark) !important;
  border: none;
  box-shadow: 0 2px 8px rgba(0,0,0,.25);
}
.navbar-default .navbar-brand,
.navbar-default .navbar-nav > li > a {
  color: #e0e6f0 !important;
  font-weight: 600;
}
.navbar-default .navbar-nav > li > a:hover {
  color: var(--sport-gold) !important;
  background: transparent !important;
}

/* ── Sidebar ─────────────────────────────────────────────────────────────── */
.sidebar-nav,
#sidebar-wrapper {
  background: var(--sport-dark);
}
.sidebar-nav li a,
.sidebar-nav .nav li a {
  color: #b0bec5;
  font-size: 12px;
  padding: 8px 16px;
}
.sidebar-nav li a:hover {
  background: var(--sport-navy);
  color: #fff;
}
.sidebar-nav .active > a {
  background: var(--sport-accent);
  color: #fff !important;
}

/* ── Page header strip ───────────────────────────────────────────────────── */
.btn.btn-default.col-xs-12:first-child,
.btn.btn-default.col-lg-8,
.btn.btn-default.col-lg-12:first-child {
  background: var(--sport-navy);
  color: #e8edf5;
  border-color: var(--sport-navy);
  border-radius: var(--radius-sm);
  box-shadow: none;
}

/* ── Forms / inputs ──────────────────────────────────────────────────────── */
input[type="text"],
input[type="number"],
input[type="email"],
select,
textarea {
  border: 1px solid var(--sport-border);
  border-radius: var(--radius-sm);
  padding: 4px 8px;
  font-size: 12px;
  color: var(--sport-text);
  background: #fff;
  transition: border-color .15s;
}
input[type="text"]:focus,
select:focus {
  border-color: var(--sport-accent);
  outline: none;
  box-shadow: 0 0 0 2px rgba(25,118,210,.18);
}

/* ── Checkbox ────────────────────────────────────────────────────────────── */
input[type="checkbox"] {
  width: 16px;
  height: 16px;
  cursor: pointer;
  accent-color: var(--sport-accent);
}

/* ── Icons ───────────────────────────────────────────────────────────────── */
.fa { vertical-align: middle; }

/* ── Kiosk / pool-play special ───────────────────────────────────────────── */
.btn.btn-success.btn-lg,
.btn.btn-info.btn-lg {
  letter-spacing: .03em;
  text-transform: none;
}

/* ── Countdown / timer ───────────────────────────────────────────────────── */
#countdown,
#timer {
  font-size: 2rem;
  font-weight: 800;
  color: var(--sport-red);
  font-variant-numeric: tabular-nums;
}

/* ── Responsive tweaks ───────────────────────────────────────────────────── */
@media (max-width: 767px) {
  h3 { font-size: 1rem; }
  h4 { font-size: .9rem; }
  .btn { font-size: 12px; padding: 5px 8px; }
  .btn-lg { font-size: 13px; padding: 9px 12px; }
  table th, table td { padding: 4px 6px; }
}

/* ── Utility ─────────────────────────────────────────────────────────────── */
.text-muted { color: var(--sport-muted) !important; }
.white      { color: #fff !important; }
.subtext1   { font-size: 12px; }

/* ── sm-page-header: dark navy title strip ───────────────────────────────── */
.sm-page-header {
  background: var(--sport-navy) !important;
  color: #dce7f5 !important;
  border-color: transparent !important;
  border-radius: var(--radius-sm);
  padding: 10px 14px !important;
  box-shadow: none !important;
}
.sm-page-header strong,
.sm-page-header h2,
.sm-page-header h3,
.sm-page-header a { color: #dce7f5 !important; }

/* ── sm-player-card: compact grid card ───────────────────────────────────── */
.sm-player-card {
  min-height: 130px;
  padding: 8px !important;
  border-radius: var(--radius-md) !important;
}
.sm-player-card > .row,
.sm-player-card > div > .row { margin: 0 !important; }
.sm-player-card img {
  border-radius: var(--radius-sm);
  border: 2px solid var(--sport-border);
  width: 100%;
}

/* ── Consistent button heights within player card action rows ─────────────── */
/* Name row: stretch name link and level badge to the same height */
.sm-player-card .row:first-child {
  display: flex !important;
  align-items: stretch;
}
.sm-player-card .row:first-child > a.btn,
.sm-player-card .row:first-child > .btn {
  display: flex !important;
  align-items: center;
  min-height: 34px;
  box-sizing: border-box;
  height: auto;
}
/* Action-button rows: uniform height for all btns */
.sm-player-card .row + .row {
  display: flex !important;
  align-items: stretch;
}
.sm-player-card .row + .row > a.btn,
.sm-player-card .row + .row > .btn,
.sm-player-card .row + .row > div.btn {
  display: flex !important;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  height: auto;
  box-sizing: border-box;
}
/* Keep checkbox centred */
.sm-player-card input[type="checkbox"] {
  margin: auto;
  display: block;
}

/* level badge inside player card (view_levels) */
.sm-player-card .level-badge {
  display: inline-block;
  font-size: 13px;
  font-weight: 800;
  color: #fff;
  background: var(--sport-accent);
  border-radius: var(--radius-sm);
  padding: 2px 7px;
  float: right;
  margin-left: 6px;
}

/* ── sm-results-panel: main results wrapper ──────────────────────────────── */
.sm-results-panel {
  background: var(--sport-card) !important;
  border: 1px solid var(--sport-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  padding: 12px 10px !important;
}

/* ── sm-result-row: one finisher row in results list ────────────────────── */
.sm-result-row {
  display: flex !important;
  align-items: center;
  justify-content: space-between;
  padding: 6px 10px !important;
  margin-bottom: 3px;
  border-bottom: 1px solid #edf0f7;
  background: #fff;
  border-radius: var(--radius-sm);
  font-weight: 600;
  min-height: auto !important;
  width: 100% !important;
  box-sizing: border-box;
  border-top: none;
  border-left: none;
  border-right: none;
  box-shadow: none !important;
}
.sm-result-row:hover { background: #f2f5ff; }
.sm-result-row:last-child { border-bottom: none; margin-bottom: 0; }
.sm-result-row .sm-score-pair {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
  margin-left: 8px;
}
.sm-result-row .sm-score-pair input[type="text"] {
  width: 40px;
  text-align: center;
  padding: 2px 4px;
  font-size: 12px;
}
/* toolbar: coordinator admin buttons at top of page */
.sm-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 8px 0;
  align-items: center;
}
.sm-toolbar .btn { margin: 0; }

/* ── sm-admin-form: inline coordinator forms ─────────────────────────────── */
.sm-admin-form {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  background: #f7f8fb;
  border: 1px solid var(--sport-border);
  border-radius: var(--radius-sm);
  font-size: 12px;
}
.sm-admin-form input[type="text"] { width: 50px; }

/* ── No-BR spacing helper ────────────────────────────────────────────────── */
.sm-result-row + .sm-result-row { margin-top: 0; }

/* ── Score inputs inside result rows/header: consistent width ─────────────── */
.sm-results-panel input[type="text"][style*="float:right"],
.sm-results-panel input[type="text"][style*="float: right"] {
  float: none !important;
  display: inline-block;
  width: 40px !important;
  margin-left: 3px;
  text-align: center;
  vertical-align: middle;
  padding: 2px 4px;
  font-size: 12px;
}
/* Push score inputs to the right; let the player-name text fill the remaining space */
.sm-result-row input[type="text"]:first-of-type { margin-left: auto !important; }

/* ── sm-match-row: flex wrapper for equal-height match cards ─────────────── */
.sm-match-row {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
}
.sm-match-row > .sm-match-card {
  box-sizing: border-box;
}

/* ── Coordinator inline forms (strength/factor/step) ─────────────────────── */
.sm-results-panel form > .btn { margin-bottom: 4px; }
.sm-results-panel .btn-info,
.sm-results-panel .btn-warning,
.sm-results-panel .btn-success { border-radius: var(--radius-sm); font-size: 12px; }
.sm-results-panel label { margin-right: 4px; font-weight: 600; font-size: 11px; }
