:root {
  --theme-bg: #f6f9ff;
  --theme-surface: #ffffff;
  --theme-surface-soft: #eef4ff;
  --theme-primary: #0b4ecf;
  --theme-primary-strong: #083b9c;
  --theme-accent: #1d6bff;
  --theme-border: #c8d8ff;
  --theme-text: #0f2a5a;
  --theme-text-soft: #36558f;
}

html,
body {
  background: var(--theme-bg) !important;
  color: var(--theme-text) !important;
}

* {
  border-color: var(--theme-border);
}

a,
a:visited {
  color: var(--theme-primary) !important;
}

a:hover,
a:focus {
  color: var(--theme-primary-strong) !important;
}

header,
nav,
.navbar,
.top-bar,
.sidebar,
.footer,
.app-header,
.page-header,
.admin-nav,
.main-nav {
  background: linear-gradient(135deg, var(--theme-primary), var(--theme-primary-strong)) !important;
  color: #ffffff !important;
}

header a,
nav a,
.navbar a,
.top-bar a,
.sidebar a,
.footer a,
.app-header a,
.page-header a,
.admin-nav a,
.main-nav a {
  color: #ffffff !important;
}

main,
.main,
.container,
.content,
.dashboard,
.card,
.panel,
.section,
.widget,
.modal-content,
.table-wrapper,
.form-container,
.auth-container,
.hero,
.search-section,
.results-section,
.stats-card {
  background: var(--theme-surface) !important;
  color: var(--theme-text) !important;
}

.card,
.panel,
.section,
.widget,
.modal-content,
.table,
.table-wrapper,
.results-section,
.form-container,
.auth-container,
.stats-card,
.search-section,
.hero {
  border: 1px solid var(--theme-border) !important;
  box-shadow: 0 10px 30px rgba(8, 59, 156, 0.08) !important;
}

button,
.btn,
input[type="submit"],
input[type="button"] {
  background: linear-gradient(135deg, var(--theme-primary), var(--theme-accent)) !important;
  color: #ffffff !important;
  border: 1px solid var(--theme-primary) !important;
}

button:hover,
.btn:hover,
input[type="submit"]:hover,
input[type="button"]:hover {
  background: linear-gradient(135deg, var(--theme-primary-strong), var(--theme-primary)) !important;
}

.btn-outline,
.btn-secondary,
button.secondary {
  background: #ffffff !important;
  color: var(--theme-primary) !important;
  border: 1px solid var(--theme-primary) !important;
}

input,
select,
textarea {
  background: #ffffff !important;
  color: var(--theme-text) !important;
  border: 1px solid var(--theme-border) !important;
}

table,
th,
td {
  border-color: var(--theme-border) !important;
}

th {
  background: var(--theme-surface-soft) !important;
  color: var(--theme-primary-strong) !important;
}

tr:nth-child(even) {
  background: #f7fbff !important;
}

.badge,
.tag,
.status,
.pill {
  background: var(--theme-surface-soft) !important;
  color: var(--theme-primary-strong) !important;
  border: 1px solid var(--theme-border) !important;
}

.alert,
.notice,
.message {
  background: #e9f1ff !important;
  color: var(--theme-primary-strong) !important;
  border: 1px solid var(--theme-border) !important;
}

/* Dashboard polish for admin/director pages */
.container {
  max-width: 1280px !important;
  padding: 32px 20px !important;
}

.header h1 {
  color: var(--theme-primary-strong) !important;
  letter-spacing: 0.2px;
}

.header p,
.user-info,
.loading,
.no-results,
.no-teams,
.no-tournaments {
  color: var(--theme-text-soft) !important;
}

.tabs {
  display: flex !important;
  flex-wrap: wrap !important;
  gap: 8px !important;
  border-bottom: 1px solid var(--theme-border) !important;
  margin-bottom: 24px !important;
  padding-bottom: 8px !important;
}

.tab,
.tab-btn {
  background: #ffffff !important;
  color: var(--theme-primary) !important;
  border: 1px solid var(--theme-border) !important;
  border-radius: 10px !important;
  margin: 0 !important;
}

.tab:hover,
.tab-btn:hover,
.tab.active,
.tab-btn.active {
  background: var(--theme-surface-soft) !important;
  color: var(--theme-primary-strong) !important;
  border-color: var(--theme-primary) !important;
}

.tab-content,
.section,
.players-table,
.tournament-card,
.team-card,
.player-card,
.create-tournament-form {
  background: #ffffff !important;
  border: 1px solid var(--theme-border) !important;
  border-radius: 12px !important;
}

.section h2,
.stat-value,
.player-rating {
  color: var(--theme-primary) !important;
}

.admin-badge,
.role-badge,
.member-count,
.badge-limited,
.role-tournament-director {
  background: #eaf2ff !important;
  color: var(--theme-primary-strong) !important;
  border: 1px solid var(--theme-border) !important;
}

.message.success,
.message.error {
  background: #eaf2ff !important;
  color: var(--theme-primary-strong) !important;
  border: 1px solid var(--theme-border) !important;
}

.btn-promote,
.btn-demote,
.btn-delete,
.btn-action {
  background: #0b4ecf !important;
  color: #ffffff !important;
  border: 1px solid #0b4ecf !important;
}

.btn-promote:hover,
.btn-demote:hover,
.btn-delete:hover,
.btn-action:hover {
  background: #083b9c !important;
}

/* Override inline dark/orange styles used in dashboard templates */
[style*="background: #0a0a0a"],
[style*="background:#0a0a0a"],
[style*="background: #111"],
[style*="background:#111"],
[style*="background: #1a1a1a"],
[style*="background:#1a1a1a"] {
  background: #ffffff !important;
}

[style*="border: 2px solid #2a2a2a"],
[style*="border:2px solid #2a2a2a"],
[style*="border: 1px solid #2a2a2a"] {
  border-color: var(--theme-border) !important;
}

[style*="color: #fff"],
[style*="color:#fff"],
[style*="color: #e2e8f0"],
[style*="color:#e2e8f0"] {
  color: var(--theme-text) !important;
}

[style*="color: #94a3b8"],
[style*="color:#94a3b8"] {
  color: var(--theme-text-soft) !important;
}

[style*="color: #f59e0b"],
[style*="color:#f59e0b"],
[style*="color: #fbbf24"],
[style*="color:#fbbf24"] {
  color: var(--theme-primary) !important;
}
