/* ============================================================
   DESIGN TOKENS
   ============================================================ */
:root {
  --sidebar-bg:       #0f172a;
  --sidebar-hover:    #1e293b;
  --sidebar-active:   #0891b2;
  --sidebar-active-bg:#164e63;
  --sidebar-text:     #94a3b8;
  --sidebar-heading:  #475569;
  --sidebar-width:    260px;
  --sidebar-collapsed:72px;

  --navbar-bg:        #ffffff;
  --navbar-border:    #e2e8f0;
  --navbar-height:    64px;

  --body-bg:          #f1f5f9;
  --card-bg:          #ffffff;
  --card-border:      #e2e8f0;
  --card-shadow:      0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.04);
  --card-radius:      12px;

  --primary:          #0891b2;
  --primary-light:    #e0f7fa;
  --success:          #10b981;
  --success-light:    #d1fae5;
  --warning:          #f59e0b;
  --warning-light:    #fef3c7;
  --danger:           #ef4444;
  --danger-light:     #fee2e2;
  --info:             #3b82f6;
  --info-light:       #dbeafe;

  --text-primary:     #0f172a;
  --text-secondary:   #64748b;
  --text-muted:       #94a3b8;
  --text-white:       #ffffff;

  --font:             'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --radius-sm:        6px;
  --radius-md:        10px;
  --radius-lg:        14px;
  --radius-xl:        20px;

  --transition:       0.2s ease;
}

/* ============================================================
   RESET & BASE
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 14px; }
body {
  font-family: var(--font);
  background: var(--body-bg);
  color: var(--text-primary);
  line-height: 1.5;
  min-height: 100vh;
}
a { text-decoration: none; color: inherit; }
button { cursor: pointer; border: none; background: none; font-family: inherit; }
input, select { font-family: inherit; }

/* ============================================================
   SCREENS MANAGER
   ============================================================ */
.screen { display: none; }
.screen.active { display: flex; }
/* Refresh with a stored token: show the shell immediately instead of flashing the
   login screen. restoreSession() removes .has-token once it validates/rejects. */
html.has-token #screen-login { display: none !important; }
html.has-token #screen-shell { display: flex; }

/* ============================================================
   SCREEN 1 — LOGIN PAGE
   ============================================================ */
#screen-login {
  min-height: 100vh;
  background: linear-gradient(135deg, #0f172a 0%, #0c2d3a 50%, #164e63 100%);
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}
#screen-login::before {
  content: '';
  position: absolute;
  width: 600px; height: 600px;
  background: radial-gradient(circle, rgba(8,145,178,0.15) 0%, transparent 70%);
  top: -200px; right: -200px;
  border-radius: 50%;
}
#screen-login::after {
  content: '';
  position: absolute;
  width: 400px; height: 400px;
  background: radial-gradient(circle, rgba(8,145,178,0.1) 0%, transparent 70%);
  bottom: -100px; left: -100px;
  border-radius: 50%;
}

.login-card {
  background: rgba(255,255,255,0.04);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: var(--radius-xl);
  padding: 48px 44px;
  width: 100%;
  max-width: 440px;
  position: relative;
  z-index: 1;
  box-shadow: 0 25px 50px rgba(0,0,0,0.4);
}
.login-logo {
  text-align: center;
  margin-bottom: 32px;
}
.login-logo .logo-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 56px; height: 56px;
  background: linear-gradient(135deg, #0891b2, #06b6d4);
  border-radius: 14px;
  margin-bottom: 16px;
  box-shadow: 0 8px 24px rgba(8,145,178,0.4);
}
.login-logo .logo-mark svg { width: 28px; height: 28px; color: white; }
.login-logo h1 {
  font-size: 1.5rem;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: -0.02em;
}
.login-logo p {
  color: #94a3b8;
  font-size: 0.875rem;
  margin-top: 4px;
}

.form-group { margin-bottom: 20px; }
.form-group label {
  display: block;
  color: #cbd5e1;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-bottom: 8px;
}
.input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}
.input-wrapper .input-icon {
  position: absolute;
  left: 14px;
  color: #64748b;
  width: 16px; height: 16px;
}
.input-wrapper input {
  width: 100%;
  padding: 12px 14px 12px 42px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: var(--radius-md);
  color: #ffffff;
  font-size: 0.9rem;
  transition: all var(--transition);
  outline: none;
}
.input-wrapper input::placeholder { color: #475569; }
.input-wrapper input:focus {
  border-color: #0891b2;
  background: rgba(255,255,255,0.08);
  box-shadow: 0 0 0 3px rgba(8,145,178,0.2);
}
.input-wrapper .toggle-pw {
  position: absolute;
  right: 14px;
  color: #64748b;
  cursor: pointer;
  transition: color var(--transition);
}
.input-wrapper .toggle-pw:hover { color: #94a3b8; }

.btn-primary {
  width: 100%;
  padding: 13px;
  background: linear-gradient(135deg, #0891b2, #06b6d4);
  color: white;
  font-size: 0.9rem;
  font-weight: 600;
  border-radius: var(--radius-md);
  transition: all var(--transition);
  box-shadow: 0 4px 15px rgba(8,145,178,0.35);
  margin-top: 8px;
  letter-spacing: 0.01em;
}
.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 25px rgba(8,145,178,0.45);
}
.btn-primary:active { transform: translateY(0); }

.login-footer {
  text-align: center;
  margin-top: 24px;
  color: #475569;
  font-size: 0.78rem;
}

/* ============================================================
   SCREEN 2 — GOOGLE 2FA PAGES (setup + verify)
   ============================================================ */
#screen-2fa-setup,
#screen-2fa-verify {
  min-height: 100vh;
  background: linear-gradient(135deg, #0f172a 0%, #0c2d3a 50%, #164e63 100%);
  align-items: center;
  justify-content: center;
  position: relative;
  overflow-y: auto;
  padding: 32px 16px;
}
#screen-2fa-setup::before,
#screen-2fa-verify::before {
  content: '';
  position: absolute;
  width: 600px; height: 600px;
  background: radial-gradient(circle, rgba(8,145,178,0.15) 0%, transparent 70%);
  top: -200px; right: -200px;
  border-radius: 50%;
  pointer-events: none;
}

.twofa-card {
  background: rgba(255,255,255,0.04);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: var(--radius-xl);
  padding: 48px 44px;
  width: 100%;
  max-width: 440px;
  position: relative;
  z-index: 1;
  box-shadow: 0 25px 50px rgba(0,0,0,0.4);
  text-align: center;
}
.twofa-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 64px; height: 64px;
  background: linear-gradient(135deg, #10b981, #059669);
  border-radius: 16px;
  margin-bottom: 20px;
  box-shadow: 0 8px 24px rgba(16,185,129,0.4);
}
.twofa-icon svg { width: 32px; height: 32px; color: white; }
.twofa-card h2 {
  font-size: 1.4rem;
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 8px;
}
.twofa-card p {
  color: #94a3b8;
  font-size: 0.875rem;
  margin-bottom: 32px;
  line-height: 1.6;
}
.twofa-card p span {
  color: #0891b2;
  font-weight: 600;
}

/* OTP Input */
.otp-inputs {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin-bottom: 28px;
}
.otp-inputs input {
  width: 52px; height: 60px;
  text-align: center;
  font-size: 1.5rem;
  font-weight: 700;
  background: rgba(255,255,255,0.06);
  border: 2px solid rgba(255,255,255,0.12);
  border-radius: var(--radius-md);
  color: #ffffff;
  outline: none;
  transition: all var(--transition);
  caret-color: #0891b2;
}
.otp-inputs input:focus {
  border-color: #0891b2;
  background: rgba(8,145,178,0.1);
  box-shadow: 0 0 0 3px rgba(8,145,178,0.2);
  transform: scale(1.05);
}
.otp-inputs input.filled {
  border-color: #0891b2;
  background: rgba(8,145,178,0.15);
}

.twofa-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}
.twofa-divider::before, .twofa-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: rgba(255,255,255,0.08);
}
.twofa-divider span { color: #475569; font-size: 0.78rem; white-space: nowrap; }

.resend-link {
  color: #0891b2;
  font-size: 0.85rem;
  cursor: pointer;
  font-weight: 500;
  transition: color var(--transition);
}
.resend-link:hover { color: #22d3ee; }

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #64748b;
  font-size: 0.82rem;
  margin-top: 20px;
  cursor: pointer;
  transition: color var(--transition);
}
.back-link:hover { color: #94a3b8; }

.setup-2fa-box {
  background: rgba(8,145,178,0.08);
  border: 1px solid rgba(8,145,178,0.2);
  border-radius: var(--radius-md);
  padding: 16px;
  margin-bottom: 24px;
}
.setup-2fa-box p {
  font-size: 0.8rem;
  color: #67e8f9;
  margin: 0;
  line-height: 1.5;
}
.setup-2fa-box strong { color: #a5f3fc; }

/* ============================================================
   SCREEN 3 — MAIN SHELL
   ============================================================ */
#screen-shell {
  min-height: 100vh;
  flex-direction: row;
}

/* SIDEBAR */
.sidebar {
  width: var(--sidebar-width);
  height: 100vh;               /* pin to viewport so .sidebar-nav can scroll when it overflows */
  background: var(--sidebar-bg);
  display: flex;
  flex-direction: column;
  position: fixed;
  left: 0; top: 0;
  z-index: 100;
  transition: width var(--transition);
  overflow: hidden;
}
.sidebar.collapsed { width: var(--sidebar-collapsed); }

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 20px 18px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  min-height: var(--navbar-height);
}
.sidebar-brand .brand-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px; height: 36px;
  min-width: 36px;
  background: linear-gradient(135deg, #0891b2, #06b6d4);
  border-radius: 9px;
  box-shadow: 0 4px 12px rgba(8,145,178,0.4);
}
.sidebar-brand .brand-icon svg { width: 18px; height: 18px; color: white; }
.sidebar-brand .brand-text {
  overflow: hidden;
  transition: opacity var(--transition), width var(--transition);
}
.sidebar-brand .brand-text h2 {
  font-size: 1rem;
  font-weight: 700;
  color: #ffffff;
  white-space: nowrap;
}
.sidebar-brand .brand-text span {
  font-size: 0.7rem;
  color: #475569;
  white-space: nowrap;
}
.sidebar.collapsed .brand-text { opacity: 0; width: 0; }

.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 12px 0;
  scrollbar-width: thin;
  scrollbar-color: #1e293b transparent;
}
.sidebar-nav::-webkit-scrollbar { width: 4px; }
.sidebar-nav::-webkit-scrollbar-track { background: transparent; }
.sidebar-nav::-webkit-scrollbar-thumb { background: #1e293b; border-radius: 4px; }

.nav-section-label {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--sidebar-heading);
  padding: 16px 20px 6px;
  white-space: nowrap;
  overflow: hidden;
  transition: opacity var(--transition);
}
.sidebar.collapsed .nav-section-label { opacity: 0; }

.nav-item {
  position: relative;
  margin: 1px 8px;
}
.nav-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  color: var(--sidebar-text);
  font-size: 0.85rem;
  font-weight: 500;
  transition: all var(--transition);
  cursor: pointer;
  white-space: nowrap;
  position: relative;
}
.nav-link:hover {
  background: var(--sidebar-hover);
  color: #e2e8f0;
}
.nav-link.active {
  background: var(--sidebar-active-bg);
  color: #ffffff;
}
.nav-link.active .nav-icon { color: #67e8f9; }
.nav-icon {
  width: 18px; height: 18px;
  min-width: 18px;
  color: #64748b;
  transition: color var(--transition);
}
.nav-link:hover .nav-icon { color: #94a3b8; }
.nav-label {
  flex: 1;
  overflow: hidden;
  transition: opacity var(--transition), width var(--transition);
}
.sidebar.collapsed .nav-label { opacity: 0; width: 0; }
.sidebar.collapsed .nav-chevron { display: none; }
.sidebar.collapsed .nav-badge { display: none; }

.nav-badge {
  background: var(--primary);
  color: white;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 20px;
  min-width: 20px;
  text-align: center;
}
.nav-badge.success { background: var(--success); }
.nav-badge.warning { background: var(--warning); }
.nav-badge.danger { background: var(--danger); }

.nav-chevron {
  width: 14px; height: 14px;
  color: #475569;
  transition: transform var(--transition);
}
.nav-item.open .nav-chevron { transform: rotate(90deg); }

/* Sub-menu */
.nav-submenu {
  display: none;
  padding-left: 20px;
  margin-top: 2px;
}
.nav-item.open .nav-submenu { display: block; }
.nav-submenu .nav-link {
  font-size: 0.82rem;
  color: #64748b;
  padding: 8px 12px;
}
.nav-submenu .nav-link::before {
  content: '';
  width: 6px; height: 6px;
  min-width: 6px;
  border-radius: 50%;
  background: #334155;
  margin-left: 3px;
  transition: background var(--transition);
}
.nav-submenu .nav-link:hover::before { background: #0891b2; }
.nav-submenu .nav-link.active::before { background: #67e8f9; }

/* Sidebar Footer */
.sidebar-footer {
  padding: 12px 8px;
  border-top: 1px solid rgba(255,255,255,0.06);
}
.user-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: background var(--transition);
}
.user-card:hover { background: var(--sidebar-hover); }
.user-avatar {
  width: 34px; height: 34px;
  min-width: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, #0891b2, #06b6d4);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.78rem;
  font-weight: 700;
  color: white;
}
.user-info { overflow: hidden; transition: opacity var(--transition); }
.user-info .user-name {
  font-size: 0.82rem;
  font-weight: 600;
  color: #e2e8f0;
  white-space: nowrap;
}
.user-info .user-role {
  font-size: 0.7rem;
  color: #475569;
  white-space: nowrap;
}
.sidebar.collapsed .user-info { opacity: 0; width: 0; }

/* TOPBAR */
.main-wrapper {
  margin-left: var(--sidebar-width);
  flex: 1;
  /* min-width:0 lets flex children shrink below their content width so a wide table scrolls inside
     its own overflow-x container instead of stretching the whole page (was pushing the filter bar /
     Timezone off-screen on the wide Bet Log table). */
  min-width: 0;
  display: flex;
  flex-direction: column;
  transition: margin-left var(--transition);
  min-height: 100vh;
}
.main-wrapper.collapsed { margin-left: var(--sidebar-collapsed); }

.topbar {
  height: var(--navbar-height);
  background: var(--navbar-bg);
  border-bottom: 1px solid var(--navbar-border);
  display: flex;
  align-items: center;
  padding: 0 24px;
  position: sticky;
  top: 0;
  z-index: 50;
  gap: 16px;
}
.topbar-toggle {
  width: 36px; height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  transition: all var(--transition);
  cursor: pointer;
}
.topbar-toggle:hover { background: #f1f5f9; color: var(--text-primary); }
.topbar-toggle svg { width: 20px; height: 20px; }

.topbar-breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
}
.topbar-breadcrumb span {
  font-size: 0.8rem;
  color: var(--text-muted);
}
.topbar-breadcrumb .crumb-current {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
}
.topbar-breadcrumb svg { width: 14px; height: 14px; color: var(--text-muted); }

.topbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
}
.topbar-btn {
  width: 38px; height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  position: relative;
  cursor: pointer;
  transition: all var(--transition);
}
.topbar-btn:hover { background: #f1f5f9; color: var(--text-primary); }
.topbar-btn svg { width: 19px; height: 19px; }
.topbar-badge {
  position: absolute;
  top: 6px; right: 6px;
  width: 8px; height: 8px;
  background: var(--danger);
  border-radius: 50%;
  border: 2px solid white;
}

.topbar-divider {
  width: 1px;
  height: 28px;
  background: var(--navbar-border);
  margin: 0 4px;
}

.topbar-datetime {
  font-size: 0.78rem;
  color: var(--text-secondary);
  text-align: right;
  line-height: 1.3;
}
.topbar-datetime .date { font-weight: 600; color: var(--text-primary); }

.topbar-user {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: background var(--transition);
}
.topbar-user:hover { background: #f1f5f9; }
.topbar-user .avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, #0891b2, #06b6d4);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  font-weight: 700;
  color: white;
}
.topbar-user .uname {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-primary);
}

/* CONTENT AREA */
.page-content {
  flex: 1;
  min-width: 0; /* see .main-wrapper — keep wide tables inside their overflow-x container */
  padding: 28px 28px;
}

/* ============================================================
   DASHBOARD CONTENT
   ============================================================ */
.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 16px;
}
.page-header h1 {
  font-size: 22px;   /* unified BO page-title size (was 1.3rem; some pages hard-coded 22px) */
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}
.page-header p {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-top: 2px;
}

/* Quick filter pills */
.filter-pills {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.pill {
  padding: 7px 16px;
  border-radius: 20px;
  font-size: 0.78rem;
  font-weight: 600;
  border: 1px solid var(--card-border);
  background: white;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition);
}
.pill:hover { border-color: var(--primary); color: var(--primary); }
.pill.active {
  background: var(--primary);
  border-color: var(--primary);
  color: white;
  box-shadow: 0 3px 10px rgba(8,145,178,0.3);
}

/* Filter bar */
.filter-bar {
  background: white;
  border: 1px solid var(--card-border);
  border-radius: var(--card-radius);
  padding: 18px 20px;
  margin-bottom: 24px;
  display: flex;
  align-items: flex-end;
  gap: 14px;
  flex-wrap: wrap;
  box-shadow: var(--card-shadow);
}
.filter-field { display: flex; flex-direction: column; gap: 6px; min-width: 150px; flex: 1; }
.filter-field label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.filter-field select, .filter-field input {
  padding: 9px 12px;
  border: 1px solid var(--card-border);
  border-radius: var(--radius-md);
  font-size: 0.83rem;
  color: var(--text-primary);
  background: #f8fafc;
  outline: none;
  transition: all var(--transition);
}
.filter-field select:focus, .filter-field input:focus {
  border-color: var(--primary);
  background: white;
  box-shadow: 0 0 0 3px rgba(8,145,178,0.1);
}

/* Callback Logging — per-provider MODE select: match the BO field style with a custom chevron
   (native <select> looked unstyled against the rest of the console). */
select.clm-prov {
  appearance: none; -webkit-appearance: none; -moz-appearance: none;
  min-width: 210px;
  padding: 8px 34px 8px 12px;
  border: 1px solid var(--card-border);
  border-radius: var(--radius-md);
  font-size: 0.82rem;
  color: var(--text-primary);
  background-color: #f8fafc;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  cursor: pointer;
  outline: none;
  transition: all var(--transition);
}
select.clm-prov:hover { border-color: var(--primary); }
select.clm-prov:focus {
  border-color: var(--primary);
  background-color: #fff;
  box-shadow: 0 0 0 3px rgba(8,145,178,0.1);
}
/* An active override (non-default value) reads as a chosen state: tinted + emphasised. */
select.clm-prov.is-override {
  color: var(--primary);
  font-weight: 600;
  border-color: var(--primary);
  background-color: rgba(8,145,178,0.06);
}
.btn-submit {
  padding: 10px 24px;
  background: var(--primary);
  color: white;
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  font-weight: 600;
  transition: all var(--transition);
  white-space: nowrap;
  box-shadow: 0 3px 10px rgba(8,145,178,0.3);
}
.btn-submit:hover {
  background: #5558e3;
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(8,145,178,0.35);
}

/* KPI Cards */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}
.kpi-card {
  background: white;
  border: 1px solid var(--card-border);
  border-radius: var(--card-radius);
  padding: 22px 22px 18px;
  box-shadow: var(--card-shadow);
  position: relative;
  overflow: hidden;
  transition: all var(--transition);
}
.kpi-card:hover { transform: translateY(-2px); box-shadow: 0 8px 25px rgba(0,0,0,0.1); }
.kpi-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
}
.kpi-card.blue::before  { background: linear-gradient(90deg, #0891b2, #06b6d4); }
.kpi-card.green::before { background: linear-gradient(90deg, #10b981, #059669); }
.kpi-card.amber::before { background: linear-gradient(90deg, #f59e0b, #d97706); }
.kpi-card.red::before   { background: linear-gradient(90deg, #ef4444, #dc2626); }

.kpi-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}
.kpi-label {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}
.kpi-icon {
  width: 38px; height: 38px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
}
.kpi-icon svg { width: 18px; height: 18px; }
.kpi-icon.blue  { background: var(--primary-light); color: var(--primary); }
.kpi-icon.green { background: var(--success-light); color: var(--success); }
.kpi-icon.amber { background: var(--warning-light); color: var(--warning); }
.kpi-icon.red   { background: var(--danger-light);  color: var(--danger); }

.kpi-value {
  font-size: 1.65rem;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.03em;
  margin-bottom: 8px;
  font-variant-numeric: tabular-nums;
}
.kpi-trend {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 0.75rem;
  font-weight: 600;
}
.kpi-trend svg { width: 14px; height: 14px; }
.kpi-trend.up   { color: var(--success); }
.kpi-trend.down { color: var(--danger); }
.kpi-trend.neutral { color: var(--text-muted); }
.kpi-trend span { color: var(--text-muted); font-weight: 400; }

/* Charts grid */
.charts-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 16px;
  margin-bottom: 24px;
}
.chart-card {
  background: white;
  border: 1px solid var(--card-border);
  border-radius: var(--card-radius);
  padding: 22px;
  box-shadow: var(--card-shadow);
}
.chart-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}
.chart-card-header h3 {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-primary);
}
.chart-card-header p {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 2px;
}
.chart-legend {
  display: flex;
  gap: 14px;
}
.legend-item {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 0.75rem;
  color: var(--text-secondary);
}
.legend-dot {
  width: 8px; height: 8px;
  border-radius: 2px;
}

/* Bar Chart (CSS) */
.bar-chart {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  height: 140px;
  padding-bottom: 8px;
  border-bottom: 1px solid #f1f5f9;
}
.bar-group {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  height: 100%;
  justify-content: flex-end;
}
.bar-wrap {
  width: 100%;
  display: flex;
  gap: 3px;
  align-items: flex-end;
  height: 120px;
}
.bar {
  flex: 1;
  border-radius: 4px 4px 0 0;
  transition: opacity var(--transition);
  min-height: 4px;
}
.bar:hover { opacity: 0.8; }
.bar.turnover { background: linear-gradient(180deg, #0891b2, #06b6d4); }
.bar.ggr      { background: linear-gradient(180deg, #10b981, #059669); }
.bar-label {
  font-size: 0.65rem;
  color: var(--text-muted);
  text-align: center;
}

/* Donut Chart (CSS) */
.donut-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}
.donut {
  position: relative;
  width: 130px; height: 130px;
}
.donut svg { transform: rotate(-90deg); }
.donut-center {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
}
.donut-center .val {
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--text-primary);
  display: block;
}
.donut-center .lbl {
  font-size: 0.65rem;
  color: var(--text-muted);
}
.donut-legend {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.donut-legend-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.donut-legend-left {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.78rem;
  color: var(--text-secondary);
}
.donut-legend-dot {
  width: 10px; height: 10px;
  border-radius: 3px;
}
.donut-legend-val {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-primary);
}

/* Tables */
.tables-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.table-card {
  background: white;
  border: 1px solid var(--card-border);
  border-radius: var(--card-radius);
  box-shadow: var(--card-shadow);
  overflow: hidden;
}
.table-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px 12px;
  border-bottom: 1px solid #f8fafc;
}
.table-card-header h3 {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-primary);
}
.badge {
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 0.7rem;
  font-weight: 700;
}
.badge.primary { background: var(--primary-light); color: var(--primary); }
.badge.success { background: var(--success-light); color: var(--success); }
.badge.warning { background: var(--warning-light); color: var(--warning); }
.badge.danger  { background: var(--danger-light);  color: var(--danger); }

table {
  width: 100%;
  border-collapse: collapse;
}
thead th {
  padding: 10px 20px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  text-align: left;
  background: #f8fafc;
}
tbody tr {
  border-top: 1px solid #f8fafc;
  transition: background var(--transition);
}
tbody tr:hover { background: #fafbfc; }
tbody td {
  padding: 12px 20px;
  font-size: 0.82rem;
  color: var(--text-secondary);
}
tbody td:first-child { color: var(--text-muted); font-weight: 600; }
.amount-positive { color: var(--success); font-weight: 700; }
.amount-negative { color: var(--danger); font-weight: 700; }
.product-name { display: flex; align-items: center; gap: 8px; }
.product-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
}

/* ============================================================
   NOTIFICATION DROPDOWN
   ============================================================ */
.notif-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 320px;
  background: white;
  border: 1px solid var(--card-border);
  border-radius: var(--card-radius);
  box-shadow: 0 10px 40px rgba(0,0,0,0.12);
  z-index: 200;
  display: none;
}
.notif-dropdown.open { display: block; }
.notif-dropdown-header {
  padding: 16px 18px 12px;
  border-bottom: 1px solid #f1f5f9;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.notif-dropdown-header h4 {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-primary);
}
.notif-dropdown-header span {
  font-size: 0.72rem;
  color: var(--primary);
  cursor: pointer;
  font-weight: 600;
}
.notif-item {
  display: flex;
  gap: 12px;
  padding: 14px 18px;
  border-bottom: 1px solid #f8fafc;
  transition: background var(--transition);
  cursor: pointer;
}
.notif-item:hover { background: #fafbfc; }
.notif-item.unread { background: #fafaff; }
.notif-dot {
  width: 8px; height: 8px; min-width: 8px;
  border-radius: 50%;
  margin-top: 5px;
}
.notif-content p {
  font-size: 0.8rem;
  color: var(--text-secondary);
  line-height: 1.4;
}
.notif-content span {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 3px;
  display: block;
}

/* ============================================================
   USER DROPDOWN
   ============================================================ */
.user-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 200px;
  background: white;
  border: 1px solid var(--card-border);
  border-radius: var(--card-radius);
  box-shadow: 0 10px 40px rgba(0,0,0,0.12);
  z-index: 200;
  display: none;
  overflow: hidden;
}
.user-dropdown.open { display: block; }
.user-dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 16px;
  font-size: 0.82rem;
  color: var(--text-secondary);
  cursor: pointer;
  transition: background var(--transition);
}
.user-dropdown-item:hover { background: #f8fafc; }
.user-dropdown-item svg { width: 15px; height: 15px; color: var(--text-muted); }
.user-dropdown-item.danger { color: var(--danger); }
.user-dropdown-item.danger svg { color: var(--danger); }
.user-dropdown-divider { height: 1px; background: #f1f5f9; }

/* ============================================================
   TOOLTIP (collapsed sidebar)
   ============================================================ */
.sidebar.collapsed .nav-item {
  position: relative;
}
.nav-tooltip {
  position: absolute;
  left: calc(var(--sidebar-collapsed) + 8px);
  top: 50%;
  transform: translateY(-50%);
  background: #1e293b;
  color: #e2e8f0;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity var(--transition);
  z-index: 999;
}
.sidebar.collapsed .nav-item:hover .nav-tooltip { opacity: 1; }

/* ============================================================
   2FA SETUP TAB
   ============================================================ */
.tab-switcher {
  display: flex;
  background: rgba(255,255,255,0.05);
  border-radius: var(--radius-md);
  padding: 4px;
  margin-bottom: 24px;
}
.tab-btn {
  flex: 1;
  padding: 8px;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  font-weight: 600;
  color: #64748b;
  cursor: pointer;
  transition: all var(--transition);
}
.tab-btn.active {
  background: rgba(8,145,178,0.2);
  color: #67e8f9;
}

.qr-box {
  background: white;
  border-radius: var(--radius-md);
  padding: 16px;
  display: inline-block;
  margin: 0 auto 20px;
}
.qr-placeholder {
  width: 140px; height: 140px;
  background: #f1f5f9;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 8px;
  color: #94a3b8;
  font-size: 0.72rem;
  text-align: center;
  border-radius: 4px;
}
.qr-placeholder svg { width: 40px; height: 40px; }

/* ============================================================
   SUCCESS TOAST
   ============================================================ */
/* ============================================================
   MODAL
   ============================================================ */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15,23,42,.45);
  backdrop-filter: blur(2px);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.modal-overlay.open { display: flex; }
.modal {
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 20px 60px rgba(0,0,0,.18);
  width: 100%;
  max-width: 640px;
  max-height: 90vh;
  overflow-y: auto;
  animation: modalIn .18s ease;
}
@keyframes modalIn {
  from { opacity:0; transform: translateY(-12px) scale(.97); }
  to   { opacity:1; transform: translateY(0) scale(1); }
}
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px 16px;
  border-bottom: 1px solid #f1f5f9;
}
.modal-header h2 { font-size: 16px; font-weight: 700; color: #0f172a; margin: 0; }
.modal-header p  { font-size: 12px; color: #64748b; margin: 2px 0 0; }
.modal-close {
  width: 32px; height: 32px;
  border-radius: 8px;
  border: none;
  background: #f1f5f9;
  color: #64748b;
  font-size: 18px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  line-height: 1;
}
.modal-close:hover { background: #e2e8f0; color: #0f172a; }
.modal-body   { padding: 20px 24px; }
.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 16px 24px;
  border-top: 1px solid #f1f5f9;
}
.modal-section-title {
  font-size: 11px;
  font-weight: 700;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: .06em;
  margin: 20px 0 10px;
}
.modal-section-title:first-child { margin-top: 0; }
.modal-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.modal-field { display: flex; flex-direction: column; gap: 5px; }
.modal-field.full { grid-column: 1 / -1; }
.modal-field label { font-size: 12px; font-weight: 600; color: #374151; }
.modal-field label .req { color: #ef4444; margin-left: 2px; }
.modal-field input,
.modal-field select,
.modal-field textarea {
  height: 38px;
  padding: 0 12px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  font-size: 13px;
  color: #0f172a;
  background: #fff;
  outline: none;
  transition: border-color .15s;
}
.modal-field input:focus,
.modal-field select:focus,
.modal-field textarea:focus { border-color: #0891b2; box-shadow: 0 0 0 3px rgba(8,145,178,.1); }
.modal-field textarea { height: 70px; padding: 8px 12px; resize: vertical; }

.toast {
  position: fixed;
  bottom: 28px;
  right: 28px;
  background: var(--text-primary);
  color: white;
  padding: 14px 20px;
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  font-weight: 500;
  box-shadow: 0 10px 40px rgba(0,0,0,0.2);
  z-index: 9999;
  display: flex;
  align-items: center;
  gap: 10px;
  transform: translateY(80px);
  opacity: 0;
  transition: all 0.3s ease;
}
.toast.show { transform: translateY(0); opacity: 1; }
.toast svg { width: 18px; height: 18px; color: var(--success); }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 768px) {
  .charts-grid { grid-template-columns: 1fr; }
  .tables-grid { grid-template-columns: 1fr; }
  .kpi-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 480px) {
  .kpi-grid { grid-template-columns: 1fr; }
  .page-content { padding: 16px; }
}

/* ============================================================
   REPORTS — SHARED STYLES
   ============================================================ */
.btn-export {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border: 1px solid var(--card-border);
  background: white;
  border-radius: var(--radius-md);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition);
}
.btn-export:hover { border-color: var(--primary); color: var(--primary); background: #f0fdff; }
.btn-export.danger-btn { border-color: #fecaca; color: var(--danger); }
.btn-export.danger-btn:hover { background: #fef2f2; }

/* Multi-row filter bar */
.filter-bar-grid { flex-direction: column; gap: 14px; }
.filter-row {
  display: flex;
  align-items: flex-end;
  gap: 14px;
  flex-wrap: wrap;
  width: 100%;
}
.filter-row .filter-field { min-width: 140px; flex: 1; }
.filter-row .btn-submit { flex-shrink: 0; }

/* Field hint tooltip */
.field-hint {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 14px; height: 14px;
  border-radius: 50%;
  background: #e2e8f0;
  color: #64748b;
  font-size: 0.6rem;
  font-weight: 700;
  cursor: help;
  margin-left: 4px;
  vertical-align: middle;
}
.field-hint:hover { background: var(--primary); color: white; }

/* Summary strip */
.summary-strip {
  display: flex;
  align-items: center;
  background: white;
  border: 1px solid var(--card-border);
  border-radius: var(--card-radius);
  padding: 16px 24px;
  gap: 0;
  box-shadow: var(--card-shadow);
  flex-wrap: wrap;
}
.summary-item { display: flex; flex-direction: column; gap: 4px; flex: 1; min-width: 120px; }
.summary-label { font-size: 0.7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--text-muted); }
.summary-val { font-size: 1.05rem; font-weight: 800; color: var(--text-primary); }
.summary-val.teal  { color: var(--primary); }
.summary-val.green { color: var(--success); }
.summary-val.amber { color: var(--warning); }
.summary-divider { width: 1px; height: 36px; background: var(--card-border); margin: 0 20px; }

/* Table search */
.table-search {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #f8fafc;
  border: 1px solid var(--card-border);
  border-radius: var(--radius-md);
  padding: 7px 12px;
}
.table-search input {
  border: none;
  background: transparent;
  font-size: 0.82rem;
  color: var(--text-primary);
  outline: none;
  width: 200px;
}

/* Sortable headers */
thead th.sortable { cursor: pointer; user-select: none; }
thead th.sortable:hover { color: var(--primary); background: #f0fdff; }
.sort-icon { font-size: 0.7rem; color: var(--text-muted); }

/* Table cell helpers */
.mono { font-family: 'SF Mono', 'Fira Code', monospace; font-size: 0.78rem; }
.teal-text { color: var(--primary); font-weight: 600; }
.amount { font-variant-numeric: tabular-nums; text-align: right; }
.amount-positive { color: var(--success); font-weight: 700; text-align: right; }
.amount-negative { color: var(--danger); font-weight: 700; text-align: right; }

/* Status badges */
.status-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 0.7rem;
  font-weight: 700;
}
.status-badge.settled  { background: var(--success-light); color: var(--success); }
.status-badge.active   { background: #dcfce7; color: #16a34a; }
.status-badge.pending  { background: var(--warning-light); color: var(--warning); }
.status-badge.risk     { background: var(--danger-light);  color: var(--danger); }
.status-badge.reviewed { background: #f1f5f9; color: #64748b; }

/* Operator tags inline */
.op-tags { display:flex; flex-wrap:wrap; gap:4px; align-items:center; }
.op-tag  { background:#f0f9ff; color:#0369a1; border:1px solid #bae6fd; border-radius:4px; padding:2px 7px; font-size:11px; font-weight:500; white-space:nowrap; }
.op-toggle { font-size:11px; color:#0891b2; cursor:pointer; background:none; border:none; padding:0; text-decoration:underline; white-space:nowrap; }
.op-extra  { display:none; }
.op-extra.open { display:contents; }

/* Risk badges */
.risk-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 4px;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.risk-badge.critical { background: #fee2e2; color: #dc2626; }
.risk-badge.high     { background: #fef3c7; color: #d97706; }
.risk-badge.medium   { background: #e0f2fe; color: #0369a1; }

/* Risk rows */
tbody tr.risk-row.critical { background: #fff5f5; }
tbody tr.risk-row.critical:hover { background: #fee2e2; }
tbody tr.risk-row.high { background: #fffbeb; }
tbody tr.risk-row.high:hover { background: #fef3c7; }
tbody tr.risk-row { background: #fffbeb; }

/* Totals row */
tbody tr.totals-row {
  background: #f8fafc;
  border-top: 2px solid var(--card-border);
}
tbody tr.totals-row td { color: var(--text-primary); }

/* Pagination */
.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  border-top: 1px solid #f1f5f9;
  flex-wrap: wrap;
  gap: 12px;
}
.page-info { font-size: 0.78rem; color: var(--text-muted); }
.page-controls { display: flex; align-items: center; gap: 4px; }
.page-btn {
  min-width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--card-border);
  border-radius: var(--radius-sm);
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-secondary);
  background: white;
  cursor: pointer;
  padding: 0 8px;
  transition: all var(--transition);
}
.page-btn:hover:not(:disabled) { border-color: var(--primary); color: var(--primary); }
.page-btn.active { background: var(--primary); border-color: var(--primary); color: white; }
.page-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.page-size-select { display: flex; align-items: center; gap: 6px; font-size: 0.78rem; color: var(--text-muted); margin-right: 8px; }
.page-size-select select { border: 1px solid var(--card-border); border-radius: var(--radius-sm); padding: 4px 8px; font-size: 0.78rem; }

/* Report tabs */
.report-tabs {
  display: flex;
  gap: 0;
  border-bottom: 2px solid var(--card-border);
  margin-bottom: 20px;
}
.report-tab {
  padding: 10px 20px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: all var(--transition);
}
.report-tab:hover { color: var(--primary); }
.report-tab.active { color: var(--primary); border-bottom-color: var(--primary); }

/* Brand cell */
.brand-cell { display: flex; align-items: center; gap: 8px; font-weight: 600; color: var(--text-primary); }
.brand-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }

/* Margin bar */
.margin-bar {
  display: inline-flex;
  width: 60px;
  height: 6px;
  background: #f1f5f9;
  border-radius: 3px;
  overflow: hidden;
  margin-right: 6px;
  vertical-align: middle;
}
.margin-bar span { background: var(--success); border-radius: 3px; display: block; }
.margin-bar.negative span { background: var(--danger); }

/* Action buttons */
.action-btn {
  padding: 4px 10px;
  border: 1px solid var(--card-border);
  border-radius: var(--radius-sm);
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-secondary);
  background: white;
  cursor: pointer;
  margin-right: 4px;
  transition: all var(--transition);
}
.action-btn:hover { border-color: var(--primary); color: var(--primary); }
.action-btn.danger { border-color: #fecaca; color: var(--danger); }
.action-btn.danger:hover { background: #fef2f2; }

/* Risk alert banner */
.risk-alert-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: var(--card-radius);
  padding: 14px 18px;
  margin-bottom: 20px;
  color: #ef4444;
  font-size: 0.82rem;
}

/* Breadcrumb update on page switch */
.crumb-current { transition: none; }

/* ============================================================
   SCROLLBAR
   ============================================================ */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #e2e8f0; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #cbd5e1; }

/* Bet Log (page-bet-history): keep header labels on one line (BET AMOUNT etc.); everything else
   uses the global table styling so row height matches Bet History. */
#page-bet-history thead th { white-space: nowrap; }

/* vanilla-datetimerange-picker (Bet History date range).
   Two problems this fixes:
   1. z-index — the popup must sit above the filter fields it overlaps (PLAYER/AGENT).
   2. TRANSPARENT BLEED-THROUGH — the library has NO clearfix, so its two floated month calendars
      escape the .daterangepicker box; the white background then covers nothing and page content shows
      through the gaps. `display: flow-root` makes the container a BFC that wraps the floats, so the
      white background covers the whole popup. We also neutralise BO's global table styling
      (`table{width:100%}`, `thead th{padding:10px 20px}`, `border-collapse:collapse`) inside the popup,
      which otherwise distorts the calendar grid. */
/* overflow:hidden contains the floated month calendars (BFC) WITHOUT touching display, so the library
   keeps its own show/hide toggle intact (a `display:flow-root !important` here overrode the closed-state
   `display:none` and left a stray always-open picker top-left, and swallowed clicks on Cancel/Apply). */
.daterangepicker {
  z-index: 99999 !important;
  background: #fff !important;
  overflow: hidden;
}
.daterangepicker .drp-calendar,
.daterangepicker .calendar-table,
.daterangepicker .drp-buttons { background: #fff; }
.daterangepicker table { width: auto; border-collapse: separate; }
.daterangepicker .calendar-table table { width: 100%; }
.daterangepicker th,
.daterangepicker td {
  padding: 0;
  text-transform: none;
  letter-spacing: normal;
  color: inherit;
  font-weight: 400;
}
.daterangepicker .calendar-table th,
.daterangepicker .calendar-table td { min-width: 32px; width: 32px; height: 24px; text-align: center; }
/* Centre the selected-range summary line, then lay Cancel + Apply out as two equal side-by-side buttons.
   (Apply carries the library's btn-primary class, which picks up BO's full-width login-button style — reset
   it here so the two buttons match.) */
.daterangepicker .drp-selected { display: block; padding: 0 0 8px; text-align: center; }
.daterangepicker .drp-buttons {
  display: flex;
  justify-content: center;
  gap: 8px;
}
.daterangepicker .drp-buttons .btn {
  flex: 0 0 auto;
  width: auto;
  min-width: 96px;
  margin: 0;
  padding: 7px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.78rem;
  font-weight: 600;
  box-shadow: none;
  transition: all var(--transition);
}
.daterangepicker .drp-buttons .cancelBtn {
  background: #fff;
  border: 1px solid var(--card-border);
  color: var(--text-secondary);
}
.daterangepicker .drp-buttons .cancelBtn:hover { border-color: var(--primary); color: var(--primary); }
.daterangepicker .drp-buttons .applyBtn {
  background: var(--primary);
  border: 1px solid var(--primary);
  color: #fff;
}
.daterangepicker .drp-buttons .applyBtn:hover:not([disabled]) { filter: brightness(1.05); }
.daterangepicker .drp-buttons .applyBtn[disabled] { opacity: 0.5; cursor: not-allowed; }

/* ============================================================
   FORM ERRORS + PASSWORD HELPER
   Used by Add Admin User and Reset Password. A failed create used to be reported
   with the same green-tick toast as a successful one, which read as "created".
   Errors now stay inside the dialog, next to the field that caused them.
   ============================================================ */

/* The toast carries both icons and shows one; .is-error swaps tick → cross. */
.toast svg.toast-err { display: none; color: #f87171; }
.toast.is-error svg.toast-ok  { display: none; }
.toast.is-error svg.toast-err { display: block; }

/* Error summary inside a modal. Lists EVERY validation message, not just the
   first one — the API returns an array and showing one at a time made the user
   fix the password twice. */
.modal-error {
  display: none;
  background: #fef2f2; border: 1px solid #fecaca; border-radius: 8px;
  padding: 10px 14px; margin-bottom: 14px; font-size: 12px; color: #b91c1c;
}
.modal-error.show { display: block; }
.modal-error ul { margin: 0; padding-left: 16px; }
.modal-error li + li { margin-top: 3px; }
.modal-field.has-error input,
.modal-field.has-error select { border-color: #ef4444; background: #fef2f2; }

/* Password box with generate / copy / show buttons sitting inside it. */
.pw-wrap { position: relative; display: flex; }
.pw-wrap input { flex: 1; width: 100%; padding-right: 88px; }
.pw-btns { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); display: flex; gap: 2px; }
.pw-btns button {
  width: 25px; height: 25px; padding: 0; display: flex; align-items: center; justify-content: center;
  border: none; border-radius: 6px; background: transparent; color: #64748b; cursor: pointer; font-size: 13px;
}
.pw-btns button:hover { background: #e2e8f0; color: #0f172a; }

/* Live rule checklist. Grey = not typed yet, green = met, red = typed but unmet. */
.pw-rules { list-style: none; margin: 6px 0 0; padding: 0; font-size: 11px; }
.pw-rules li { color: #94a3b8; display: flex; align-items: center; gap: 5px; line-height: 1.7; }
.pw-rules li::before { content: '○'; font-size: 10px; }
.pw-rules li.ok  { color: #15803d; }
.pw-rules li.bad { color: #dc2626; }
.pw-rules li.ok::before,
.pw-rules li.bad::before { content: '●'; }

/* Password suggestions — three candidates to choose from, like the generators operators
   already use elsewhere. Monospaced so 0/O and l/1 confusions are visible before the
   password is handed over (the generator avoids those glyphs, but a typed one may not). */
.pw-sugg { display: none; margin-top: 8px; border: 1px solid #e2e8f0; border-radius: 8px; overflow: hidden; }
.pw-sugg.show { display: block; }
.pw-sugg-head { display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 6px 10px; background: #f8fafc; border-bottom: 1px solid #e2e8f0; font-size: 11px; color: #64748b; }
.pw-sugg-head button { border: none; background: transparent; color: #0891b2; font-size: 11px; cursor: pointer; padding: 2px 4px; border-radius: 5px; }
.pw-sugg-head button:hover { background: #e0f2fe; }
.pw-sugg-row { display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 7px 10px; cursor: pointer; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px; color: #0f172a; }
.pw-sugg-row + .pw-sugg-row { border-top: 1px solid #f1f5f9; }
.pw-sugg-row:hover { background: #f0f9ff; }
.pw-sugg-row button { border: none; background: transparent; color: #64748b; font-size: 12px; cursor: pointer; padding: 2px 5px; border-radius: 5px; }
.pw-sugg-row button:hover { background: #e2e8f0; color: #0f172a; }

/* Two-step wizard header (Add Admin → Permissions). */
.wiz-steps { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; font-size: 12px; }
.wiz-step { display: flex; align-items: center; gap: 7px; color: #94a3b8; white-space: nowrap; }
.wiz-step .wiz-num { width: 20px; height: 20px; border-radius: 50%; border: 1px solid #cbd5e1;
  display: flex; align-items: center; justify-content: center; font-size: 11px; line-height: 1; }
.wiz-step.active { color: #0f172a; font-weight: 600; }
.wiz-step.active .wiz-num { background: #0891b2; border-color: #0891b2; color: #fff; }
.wiz-step.done { color: #15803d; }
.wiz-step.done .wiz-num { background: #15803d; border-color: #15803d; color: #fff; }
.wiz-line { flex: 1; height: 1px; background: #e2e8f0; min-width: 24px; }

/* Admin Users: one row per admin, however narrow the window is. Every cell holds a badge or a
   row of action buttons, so letting them wrap turned one admin into two or three stacked lines
   and the columns stopped lining up. Keep the cells on one line and let the table scroll
   sideways inside its own overflow-x container, exactly like Bet History's wide table. */
#page-mgmt-admin-users thead th,
#page-mgmt-admin-users tbody td { white-space: nowrap; }
/* Neutral toast: "Saving — please wait" is not a success and not a failure, so it shows the
   message alone — a green tick on it reads as "the dialog closed", which is the opposite. */
.toast.is-info svg { display: none; }
