:root {
  --primary: #000000;
  --accent:  #FFCC33;
  --header-h: 145px;
  --header-base-h: 145px;
  --sidebar-w: 120px;
  --mobile-nav-h: 38px;
}

/* Larger date inputs site-wide */
input[type="date"] {
  font-size: 15px !important;
  padding: 6px 10px !important;
  height: auto !important;
  min-width: 160px;
}

body {
  background: #f4f6f9;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 14px;
  padding-top: var(--header-h);
  padding-left: var(--sidebar-w);
}

/* ── Header ────────────────────────────── */
#db-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--header-base-h);
  background: #000;
  color: #FFCC33;
  padding: 14px 24px;
  z-index: 1000;
  border-bottom: 3px solid #FFCC33;
}
#db-header-sitename { font-size: 13px; color: rgba(255,255,255,.65); letter-spacing: .02em; }
#db-header-company  { font-size: 42px; font-weight: bold; line-height: 1.1; color: #FFCC33; }
#db-header-user     { font-size: 13px; font-weight: bold; color: #fff; margin-top: 4px; }

/* ── Sidebar ───────────────────────────── */
#db-sidebar {
  position: fixed;
  top: var(--header-h);
  left: 0;
  width: var(--sidebar-w);
  height: calc(100vh - var(--header-h));
  background: #fff;
  border-right: 2px solid #000;
  padding: 6px 4px;
  overflow-y: auto;
  z-index: 999;
}
.db-sidebar-title {
  font-weight: bold;
  font-size: 14px;
  text-align: center;
  padding: 4px 0;
}
.db-sidebar-hr { border-color: #000; margin: 4px 0; }

.db-nav-btn {
  display: block;
  width: 100%;
  padding: 6px 4px;
  text-align: center;
  font-size: 12px;
  font-weight: bold;
  font-family: Arial, Helvetica, sans-serif;
  color: #000;
  background: #fff;
  border: none;
  cursor: pointer;
  text-decoration: none;
  border-radius: 4px;
  margin-bottom: 2px;
}
.db-nav-btn:hover, .db-nav-btn.active {
  background: #4CAF50;
  color: #000;
  text-decoration: none;
}

/* ── Admin page tabs (shared) ──────────── */
.admin-tab-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; margin-bottom: 24px; }
.admin-tabs { border-bottom: 2px solid #dee2e6; display: flex; flex-wrap: nowrap; min-width: max-content; margin-bottom: 0; }
.admin-tab  { background: none; border: 1px solid transparent; border-bottom: none; border-radius: 4px 4px 0 0;
              padding: 10px 20px; font-weight: 600; color: #0d6efd; cursor: pointer;
              margin-bottom: -2px; white-space: nowrap; font-size: 14px; font-family: Arial, Helvetica, sans-serif; }
.admin-tab:hover  { color: #0a58ca; background: #f8f9fa; }
.admin-tab.active { color: #212529; background: #fff; border-color: #dee2e6 #dee2e6 #fff; }

/* Tab style overrides — applied via body.tab-style-N set from localStorage */
body.tab-style-1 .admin-tabs { background: var(--primary); border-radius: 8px; padding: 4px; border-bottom: none; display: inline-flex; gap: 3px; min-width: unset; }
body.tab-style-1 .admin-tab  { background: transparent; color: rgba(255,255,255,.6); border: none; border-radius: 6px; margin-bottom: 0; }
body.tab-style-1 .admin-tab:hover  { background: rgba(255,255,255,.12); color: #fff; }
body.tab-style-1 .admin-tab.active { background: #fff; color: var(--primary); border: none; }

body.tab-style-2 .admin-tabs { background: #e9ecef; border-radius: 8px; padding: 4px; border-bottom: none; display: inline-flex; gap: 3px; }
body.tab-style-2 .admin-tab  { background: transparent; color: #555; border: none; border-radius: 6px; margin-bottom: 0; }
body.tab-style-2 .admin-tab:hover  { background: rgba(0,0,0,.06); color: #222; }
body.tab-style-2 .admin-tab.active { background: #fff; color: #222; box-shadow: 0 1px 4px rgba(0,0,0,.18); border: none; }

body.tab-style-4 .admin-tabs { background: #1c2833; border-radius: 5px; padding: 5px; border-bottom: none; display: inline-flex; gap: 4px; }
body.tab-style-4 .admin-tab  { background: transparent; color: #aaa; border: none; border-radius: 4px; margin-bottom: 0; }
body.tab-style-4 .admin-tab:hover  { background: rgba(255,255,255,.06); color: #ddd; }
body.tab-style-4 .admin-tab.active { background: #c8a84b; color: #1c2833; border: none; }

/* ── Page header ───────────────────────── */
.page-header {
  background: var(--primary);
  color: var(--accent);
  padding: 1rem 1.5rem;
  margin-bottom: 1.5rem;
  border-radius: 0 0 .5rem .5rem;
}
.page-header h1 { font-size: 1.4rem; margin: 0; }

/* ── Cards ─────────────────────────────── */
.card { border: 1px solid #ccc; box-shadow: 0 1px 4px rgba(0,0,0,.1); border-radius: .5rem; }
.card-header { background: var(--primary); color: var(--accent); font-weight: 600; border-radius: .5rem .5rem 0 0 !important; }

.stat-card { text-align: center; padding: 1.5rem; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.stat-card .stat-num { font-size: 2.5rem; font-weight: 700; color: var(--primary); }
.stat-card .stat-label { color: #666; font-size: .85rem; text-transform: uppercase; letter-spacing: .05em; }

/* ── Badges ────────────────────────────── */
.badge-rank-a { background: #28a745; color: #fff; }
.badge-rank-b { background: #007bff; color: #fff; }
.badge-rank-c { background: #fd7e14; color: #fff; }
.badge-rank-t { background: #6c757d; color: #fff; }

/* ── Status ────────────────────────────── */
.status-filled  { color: #28a745; font-weight: 600; }
.status-partial { color: #fd7e14; font-weight: 600; }
.status-open    { color: #dc3545; font-weight: 600; }

/* ── Bookings ──────────────────────────── */
.booking-pending    { background: #fff3cd; }
.booking-confirmed  { background: #d4edda; }
.booking-waitlisted { background: #cce5ff; }
.booking-cancelled  { background: #f8d7da; text-decoration: line-through; opacity: .7; }

/* ── Tables ────────────────────────────── */
table.table-hover tbody tr:hover { background: #FFFF99; cursor: pointer; }
thead th { background: #000; color: #fff; }

/* ── Mobile Mode ────────────────────────── */
body.mobile-mode {
  --header-h: 90px;
  --header-base-h: 90px;
  --sidebar-w: 0px;
  padding-left: 0;
  padding-top: calc(var(--header-h) + var(--mobile-nav-h));
}

body.mobile-mode #db-header {
  height: var(--header-base-h);
}

body.mobile-mode #db-header-company {
  font-size: 24px;
}

body.mobile-mode #db-sidebar {
  display: none;
}

#db-mobile-nav {
  display: none;
}

body.mobile-mode #db-mobile-nav {
  display: flex;
  position: fixed;
  top: var(--header-h);
  left: 0; right: 0;
  height: var(--mobile-nav-h);
  background: #111;
  border-bottom: 2px solid #FFCC33;
  overflow-x: auto;
  white-space: nowrap;
  z-index: 998;
  flex-direction: row;
  align-items: center;
  gap: 2px;
  padding: 0 4px;
  -webkit-overflow-scrolling: touch;
}

#db-mobile-nav .db-nav-btn {
  display: inline-block;
  width: auto;
  white-space: nowrap;
  padding: 5px 10px;
  font-size: 11px;
  color: #FFCC33;
  background: transparent;
  border: 1px solid #333;
  border-radius: 4px;
}

#db-mobile-nav .db-nav-btn:hover,
#db-mobile-nav .db-nav-btn.active {
  background: #4CAF50;
  color: #000;
}

/* ── Dark Mode ─────────────────────────── */
body.dark-mode {
  background: #1a1c20;
}
body.dark-mode #db-sidebar {
  background: #1a1c20;
  border-right-color: #FFCC33;
}
body.dark-mode .db-sidebar-title { color: #FFCC33; }
body.dark-mode .db-sidebar-hr    { border-color: #444; }
body.dark-mode .db-nav-btn       { color: #ccc; background: transparent; }
body.dark-mode .db-nav-btn:hover,
body.dark-mode .db-nav-btn.active { background: #FFCC33; color: #000; }
body.dark-mode .card              { background: #23262b; border-color: #3a3d42; color: #ddd; }
body.dark-mode .card-header       { background: #111; }
body.dark-mode .modal-content     { background: #23262b; color: #ddd; }
body.dark-mode .modal-body        { background: #23262b; }
body.dark-mode .form-control,
body.dark-mode .form-select       { background: #2d3035; border-color: #555; color: #ddd; }
body.dark-mode .form-control::placeholder { color: #888; }
body.dark-mode .table             { color: #ddd; }
body.dark-mode .table-hover tbody tr:hover { background: #2d3035; }
body.dark-mode thead th           { background: #111; }
body.dark-mode .text-muted        { color: #888 !important; }
body.dark-mode .dc-stat-lbl       { color: #aaa; }
body.dark-mode .page-header       { background: #111; }
body.dark-mode .form-label        { color: #ddd; }
body.dark-mode label              { color: #ddd; }
body.dark-mode h1, body.dark-mode h2, body.dark-mode h3,
body.dark-mode h4, body.dark-mode h5, body.dark-mode h6 { color: #ddd; }

/* ── Dark mode: named class overrides ── */
body.dark-mode .game-count           { color: #ddd; }
body.dark-mode .dealer-email,
body.dark-mode .parties-past         { color: #999; }
body.dark-mode .parties-total        { color: #ccc; }
body.dark-mode .games-list           { color: #aaa; }
body.dark-mode .days-lbl             { color: #aaa; }
body.dark-mode .venue-name,
body.dark-mode .party-addr,
body.dark-mode .party-times,
body.dark-mode .party-contact        { color: #ccc; }
body.dark-mode .status-positions,
body.dark-mode .status-counts        { color: #ccc; }
body.dark-mode .info-tbl .lbl        { color: #aaa; }
body.dark-mode #dealerHeadline .hl-meta,
body.dark-mode #partyHeadline .hl-days { color: #aaa; }
body.dark-mode .rank-row .rank-info   { color: #aaa; }
body.dark-mode .perm-card ul          { color: #ccc; }
body.dark-mode .pref-desc,
body.dark-mode .pick-tile .pt-desc    { color: #aaa; }

/* ── Dark mode: inline color overrides (JS-generated HTML) ── */
body.dark-mode [style^="color:#555"],
body.dark-mode [style*=";color:#555"] { color: #aaa !important; }
body.dark-mode [style^="color:#666"],
body.dark-mode [style*=";color:#666"] { color: #aaa !important; }
body.dark-mode [style^="color:#444"],
body.dark-mode [style*=";color:#444"] { color: #bbb !important; }
body.dark-mode [style^="color:#333"],
body.dark-mode [style*=";color:#333"] { color: #ccc !important; }
body.dark-mode [style^="color:#000"],
body.dark-mode [style*=";color:#000"] { color: #ddd !important; }
/* dark text on light-colored badges/pills */
body.dark-mode [style*="color:#155724"] { color: #6fcf8a !important; }
body.dark-mode [style*="color:#856404"] { color: #f0c96a !important; }
body.dark-mode [style*="color:#6f42c1"] { color: #c39df5 !important; }
body.dark-mode [style*="color:#6c757d"] { color: #adb5bd !important; }

/* ── Dark mode: inline background overrides ── */
body.dark-mode [style*="background:#f8f9fa"] { background: #2d3035 !important; }
body.dark-mode [style*="background:#fafafa"]  { background: #2d3035 !important; }
body.dark-mode [style*="background:#f0f4ff"]  { background: #1e2535 !important; }
body.dark-mode [style*="background:#f0f0f0"]  { background: #2d3035 !important; }
body.dark-mode [style*="background:#e9ecef"]  { background: #3a3d42 !important; }
body.dark-mode [style*="background:#d4edda"]  { background: #1a3a27 !important; }
body.dark-mode [style*="background:#fff3cd"]  { background: #3a2e00 !important; }
body.dark-mode [style*="background:#fffbea"]  { background: #2e2a00 !important; }
body.dark-mode [style*="background:#e8d5f5"]  { background: #2d1f3d !important; }
body.dark-mode [style*="background:#c8d4f8"]  { background: #1e2a4a !important; }
body.dark-mode [style*="background:#dee2e6"]  { background: #3a3d42 !important; }

/* ── Dark mode: Bootstrap alert/badge overrides ── */
body.dark-mode .alert-success { background: #1a3a27; border-color: #2a6040; color: #6fcf8a; }
body.dark-mode .alert-info    { background: #1a2a3a; border-color: #2a4060; color: #7ec8e3; }
body.dark-mode .alert-warning { background: #3a2e00; border-color: #5a4800; color: #f0c96a; }
body.dark-mode .alert-danger  { background: #3a1a1a; border-color: #5a2a2a; color: #f08080; }
body.dark-mode .list-group-item { background: #23262b; border-color: #3a3d42; color: #ddd; }
body.dark-mode .border, body.dark-mode [class*="border-"] { border-color: #3a3d42 !important; }
body.dark-mode .bg-light { background: #2d3035 !important; color: #ddd; }
body.dark-mode .progress-bar { background-color: #c8a951; }
body.dark-mode .progress     { background-color: #3a3d42; }
body.dark-mode p { color: #ddd; }
body.dark-mode td, body.dark-mode th { color: #ddd; }
body.dark-mode small { color: #aaa; }
body.dark-mode strong { color: #eee; }
body.dark-mode code { background: #2d3035; color: #f08080; }

/* ── Density: Compact ──────────────────── */
body.density-compact .card-body               { padding: 0.5rem !important; }
body.density-compact .dealer-card .card-body  { gap: 0.25rem !important; }
body.density-compact .table td,
body.density-compact .table th                { padding: 0.2rem 0.5rem !important; font-size: 12px; }
body.density-compact .roster-row              { padding: 3px 8px !important; font-size: 13px; }
body.density-compact .dc-stat                 { padding: 0.25rem 0 !important; }

/* ── Login ─────────────────────────────── */
.login-wrap { max-width: 420px; margin: 8vh auto; }
.login-wrap .card-header { text-align: center; padding: 1.5rem; font-size: 1.1rem; }

/* ── Buttons ───────────────────────────── */
.btn-primary       { background: var(--primary); border-color: var(--primary); }
.btn-primary:hover { background: #333; border-color: #333; }
.btn-gold          { background: var(--accent); border-color: var(--accent); color: #000; font-weight: 600; }
.btn-gold:hover    { background: #e6b800; border-color: #e6b800; color: #000; }

.nav-pills .nav-link.active { background: var(--primary); color: var(--accent) !important; }

/* ── Time Group ────────────────────────── */
.time-group { border: 1px solid #ccc; border-radius: 6px; padding: 6px 8px; background: #fff; }
.time-group label { font-size: 11px; font-weight: 700; color: #555; text-transform: uppercase; letter-spacing: .04em; margin-bottom: 4px; display: block; }
.time-group select { width: 100% !important; margin-bottom: 3px; }

/* ── Misc ──────────────────────────────── */
.party-row td { vertical-align: middle; }
body.dark-mode .party-row td { color: #ccc; background-color: transparent; }
body.dark-mode .party-row strong { color: #ddd; }
body.dark-mode tbody tr { background-color: transparent !important; }
body.dark-mode .table > :not(caption) > * > * { background-color: transparent; color: #ccc; }
.games-list   { font-size: .8rem; color: #555; }
.past-party   { opacity: .65; }

#toast-container { position: fixed; bottom: 1.5rem; right: 1.5rem; z-index: 9999; }

/* ── Feedback Button ───────────────────── */
#feedbackBtn {
  background: var(--accent); border: none; color: #000;
  font-size: 13px; font-weight: 700; cursor: pointer;
  padding: 5px 14px; border-radius: 20px; white-space: nowrap;
  position: absolute; right: 16px; bottom: 10px;
}
#feedbackBtn:active { opacity: .8; }
#supportBtn {
  background: var(--accent); border: none; color: #000;
  font-size: 13px; font-weight: 700; cursor: pointer;
  padding: 5px 14px; border-radius: 20px; white-space: nowrap;
  position: absolute; right: 112px; bottom: 10px;
}
#supportBtn:active { opacity: .8; }
#feedbackOverlay {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,.5); z-index: 1050;
}
#feedbackPanel {
  display: none;
  position: fixed; left: 50%; bottom: 0;
  transform: translateX(-50%);
  width: min(480px, 96vw);
  background: #fff; border-radius: 16px 16px 0 0;
  padding: 20px 20px calc(20px + env(safe-area-inset-bottom,0));
  z-index: 1051;
}
body.dark-mode #feedbackPanel { background: #1e1e1e; color: #ddd; }
#feedbackPanel h6 { margin: 0 0 12px; font-weight: 800; font-size: 15px; }
#feedbackText {
  width: 100%; border: 1px solid #ddd; border-radius: 8px;
  padding: 10px 12px; font-size: 14px; resize: none;
  margin-bottom: 10px;
}
body.dark-mode #feedbackText { background: #2a2d32; color: #ddd; border-color: #444; }
#feedbackSend {
  width: 100%; background: var(--primary); color: var(--accent);
  border: none; border-radius: 8px; padding: 11px;
  font-size: 14px; font-weight: 700; cursor: pointer;
}
