:root {
  /* Palette */
  --bg: #0e1116;
  --surface: #151a21;
  --surface2: #1c222c;
  --card: #121b2d;
  --card2: #182640;
  --border: #222a36;
  --text: #f4f6fb;
  --muted: #9aa3b5;
  --primary: #f0b90b;
  --accent: #f0b90b;
  --accent-hover: #ffcd45;
  --success: #34d399;
  --warning: #fbbf24;
  --danger: #ef4444;
  --info: #38bdf8;

  /* Typography */
  --font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --text-xs: 12px;
  --text-sm: 14px;
  --text-md: 16px;
  --text-lg: 18px;
  --text-xl: 20px;
  --text-2xl: 24px;
  --line-height: 1.4;

  /* Radius & shadow */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius: 16px;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  --shadow-sm: 0 2px 6px rgba(0,0,0,0.25);
  --shadow-md: 0 6px 20px rgba(0,0,0,0.28);

  /* Spacing */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;

  --transition: 180ms ease;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-family);
  line-height: var(--line-height);
  -webkit-font-smoothing: antialiased;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}

a { color: var(--accent); }
a:hover { color: var(--accent-hover); }

/* Layout shell */
.ds-shell { display:flex; min-height: 100vh; }
.ds-sidebar { width: 260px; background: var(--surface); border-right: 1px solid var(--border); padding: var(--space-4); }
.ds-main { flex:1; background: linear-gradient(180deg, #0f1319 0%, #0b0f14 100%); padding: var(--space-5); }
.ds-panel { width: 340px; background: var(--surface); border-left: 1px solid var(--border); }

.ds-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: var(--space-4); box-shadow: var(--shadow-sm); transition: transform var(--transition), border-color var(--transition); }
.ds-card:hover { transform: translateY(-1px); border-color: rgba(240,185,11,0.35); }

.ds-btn { display:inline-flex; align-items:center; justify-content:center; gap:6px; padding: 10px 14px; border-radius: var(--radius-md); font-weight: 600; border: 1px solid transparent; transition: background var(--transition), color var(--transition), border var(--transition), transform var(--transition); cursor:pointer; text-decoration:none; }
.ds-btn:focus-visible { outline:2px solid var(--accent); outline-offset:2px; }
.ds-btn.primary { background: var(--accent); color:#0c0c0c; }
.ds-btn.primary:hover { background: var(--accent-hover); }
.ds-btn.ghost { background: transparent; border:1px solid var(--border); color: var(--text); }
.ds-btn.ghost:hover { border-color: var(--accent); color: var(--accent); }
.ds-btn.surface { background: var(--surface2); color: var(--text); }
.ds-btn.surface:hover { background: #222a36; }
.ds-btn.danger { background: var(--danger); color: #fff; }

.ds-input { width:100%; background: var(--surface2); border:1px solid var(--border); color: var(--text); border-radius: var(--radius-md); padding: 10px 12px; }
.ds-input:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 2px rgba(240,185,11,0.15); }

.ds-tabs { display:flex; gap: var(--space-2); overflow-x:auto; padding-bottom: var(--space-2); }
.ds-tab { padding: 10px 14px; border-radius: var(--radius-md); background: var(--surface2); color: var(--muted); border:1px solid var(--border); cursor:pointer; white-space:nowrap; }
.ds-tab.active { color: var(--text); border-color: var(--accent); box-shadow: 0 0 0 1px rgba(240,185,11,0.35); }

.ds-badge { display:inline-flex; align-items:center; gap:6px; padding: 4px 8px; border-radius: 999px; font-size: 12px; background: var(--surface2); color: var(--muted); border:1px solid var(--border); }

.ds-skeleton { position: relative; overflow: hidden; background: var(--surface2); border-radius: var(--radius-md); }
.ds-skeleton::after { content:""; position:absolute; inset:0; background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.08) 50%, transparent 100%); animation: shimmer 1.2s infinite; }
@keyframes shimmer { 0%{transform: translateX(-100%);} 100%{transform: translateX(100%);} }

.event-card { display:flex; flex-direction:column; gap: var(--space-3); padding: var(--space-4); border-radius: var(--radius-lg); background: var(--surface); border:1px solid var(--border); box-shadow: var(--shadow-sm); }
.event-card__header { display:flex; justify-content:space-between; align-items:center; color: var(--muted); font-size: var(--text-sm); }
.event-card__teams { display:flex; justify-content:space-between; gap: var(--space-3); align-items:center; }
.event-card__team { flex:1; display:flex; align-items:center; gap: var(--space-2); font-weight:600; }
.event-card__odds { display:grid; grid-template-columns: repeat(3, 1fr); gap: var(--space-2); }
.odds-btn { background: var(--surface2); border:1px solid var(--border); border-radius: var(--radius-md); padding: 12px 10px; text-align:center; color: var(--text); font-weight:700; transition: var(--transition); cursor:pointer; }
.odds-btn:hover { border-color: var(--accent); color: var(--accent); transform: translateY(-1px); }
.odds-btn.active { border-color: var(--accent); background: rgba(240,185,11,0.08); color: var(--accent); box-shadow: 0 0 0 1px rgba(240,185,11,0.35); }

.virtual-pad { position: relative; }
.virtual-spacer { height: 0; }

.scroll-area { overflow-y:auto; }

.drawer { position:fixed; inset:0; background:rgba(0,0,0,0.55); display:flex; justify-content:flex-end; z-index:1100; opacity:0; pointer-events:none; transition: opacity var(--transition); }
.drawer.open { opacity:1; pointer-events:auto; }
.drawer__panel { width: 92vw; max-width: 400px; background: var(--surface); height:100%; box-shadow: var(--shadow-md); transform: translateX(100%); transition: transform var(--transition); padding: var(--space-4); overflow-y:auto; }
.drawer.open .drawer__panel { transform: translateX(0); }

.bottom-bar { position:fixed; bottom:12px; right:12px; z-index:1000; }

/* Table responsive cards */
.table-card { background: var(--surface); border:1px solid var(--border); border-radius: var(--radius-md); padding: var(--space-3); margin-bottom: var(--space-2); }
.table-card__row { display:flex; justify-content:space-between; color: var(--muted); font-size: var(--text-sm); }
.table-card__value { color: var(--text); font-weight:600; }

/* Global search */
.command-palette { position:fixed; inset:0; background:rgba(0,0,0,0.55); z-index:1200; display:flex; justify-content:center; align-items:flex-start; padding-top:80px; opacity:0; pointer-events:none; transition: opacity var(--transition); }
.command-palette.open { opacity:1; pointer-events:auto; }
.command-box { width: min(720px, 96vw); background: var(--surface); border:1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-md); padding: var(--space-4); }
.command-input { width:100%; padding:12px 14px; border-radius: var(--radius-md); border:1px solid var(--border); background: var(--surface2); color: var(--text); }
.command-item { padding:10px 12px; border-radius: var(--radius-md); display:flex; justify-content:space-between; color: var(--text); }
.command-item:hover { background: var(--surface2); }

@media (max-width: 991px) {
  .ds-sidebar { display:none; }
  .ds-panel { display:none; }
  .ds-main { padding: var(--space-4); }
}

/* Account/Auth premium */
.account-page {
  position: relative;
  padding: 10px 8px 20px;
  color: #dce7ff;
}

.account-page::before {
  content: "";
  position: absolute;
  inset: -40px -20px auto -20px;
  height: 260px;
  z-index: -2;
  background:
    radial-gradient(780px 220px at 8% 0%, rgba(84, 137, 255, 0.2), transparent 72%),
    radial-gradient(760px 240px at 84% -8%, rgba(240, 185, 11, 0.18), transparent 74%),
    linear-gradient(180deg, #0b1425 0%, #0a101b 75%, #090e17 100%);
  border-radius: 0 0 24px 24px;
}

.account-page::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image: radial-gradient(rgba(255, 255, 255, 0.04) 1px, transparent 1px);
  background-size: 3px 3px;
  opacity: 0.35;
}

.account-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.account-title-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.account-title-icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #10294a;
  background: linear-gradient(140deg, #f4c85a, #ef9f3f);
  box-shadow: 0 10px 20px rgba(239, 159, 63, 0.32);
}

.account-title h2,
.account-title h3,
.account-title h4 {
  margin: 0;
  color: #f3f7ff;
  font-size: 30px;
  line-height: 1.05;
  letter-spacing: -0.02em;
  font-weight: 800;
  text-transform: none;
}

.account-subtitle {
  margin: 4px 0 0;
  color: #9eb2d4;
  font-size: 12px;
}

.account-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: minmax(280px, 420px) minmax(0, 1fr);
  align-items: start;
}

.account-grid.single {
  grid-template-columns: minmax(0, 940px);
  justify-content: center;
}

.account-card {
  border-radius: 16px;
  border: 1px solid #2a3f63;
  background: linear-gradient(170deg, rgba(18, 29, 49, 0.96), rgba(10, 18, 32, 0.96));
  box-shadow: var(--shadow);
  backdrop-filter: blur(8px);
  overflow: hidden;
}

.account-card-header {
  padding: 12px 14px;
  border-bottom: 1px solid #213450;
  background: rgba(14, 25, 42, 0.72);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.account-card-title {
  font-size: 13px;
  font-weight: 700;
  color: #d4e4ff;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin: 0;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.account-card-body {
  padding: 14px;
}

.account-form-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 10px;
}

.field-span-12 { grid-column: span 12; }
.field-span-8 { grid-column: span 8; }
.field-span-6 { grid-column: span 6; }
.field-span-4 { grid-column: span 4; }

.field-label {
  display: block;
  margin: 0 0 6px;
  font-size: 12px;
  color: #9db0d2;
}

.input-wrap {
  position: relative;
}

.input-wrap > i {
  position: absolute;
  left: 11px;
  top: 50%;
  transform: translateY(-50%);
  color: #6d84ad;
  pointer-events: none;
}

.input-wrap .premium-input {
  padding-left: 34px;
}

.premium-input,
.premium-select,
.premium-textarea {
  width: 100%;
  min-height: 40px;
  border-radius: 12px;
  border: 1px solid #294064;
  background: #0c1526;
  color: #e8f0ff;
  padding: 9px 11px;
  font-size: 14px;
  line-height: 1.3;
  transition: border-color var(--transition), box-shadow var(--transition), transform var(--transition);
}

.premium-input::placeholder,
.premium-textarea::placeholder {
  color: #7d8fae;
}

.premium-input:hover,
.premium-select:hover,
.premium-textarea:hover {
  border-color: #456491;
}

.premium-input:focus,
.premium-select:focus,
.premium-textarea:focus {
  border-color: #5d82b9;
  box-shadow: 0 0 0 3px rgba(93, 130, 185, 0.2);
  outline: 0;
}

.premium-input.is-invalid,
.premium-select.is-invalid,
.premium-textarea.is-invalid {
  border-color: rgba(255, 93, 112, 0.8);
  box-shadow: 0 0 0 3px rgba(255, 93, 112, 0.16);
}

.field-hint,
.field-error {
  margin-top: 4px;
  font-size: 11px;
}

.field-hint { color: #8fa4c8; }
.field-error { color: #ff8792; }

.premium-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 12px;
}

.btn-premium,
.btn-premium-outline,
.btn-premium-danger {
  border-radius: 12px;
  min-height: 42px;
  border: 1px solid transparent;
  padding: 0 14px;
  font-size: 13px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  transition: transform var(--transition), filter var(--transition), border-color var(--transition), background var(--transition), color var(--transition);
}

.btn-premium {
  border: 0;
  background: linear-gradient(140deg, #f4c85a, #ef9f3f);
  color: #132846;
  box-shadow: 0 12px 22px rgba(239, 159, 63, 0.35);
}

.btn-premium:hover {
  transform: translateY(-1px);
  filter: brightness(1.04);
}

.btn-premium-outline {
  border-color: #35527d;
  background: #12233d;
  color: #d4e5ff;
}

.btn-premium-outline:hover {
  transform: translateY(-1px);
  border-color: #5b7db0;
  color: #eef5ff;
}

.btn-premium-danger {
  border-color: rgba(255, 104, 121, 0.44);
  background: rgba(143, 28, 43, 0.2);
  color: #ffbac2;
}

.btn-premium-danger:hover {
  background: rgba(143, 28, 43, 0.34);
  color: #ffe2e6;
}

.btn-premium:disabled,
.btn-premium-outline:disabled,
.btn-premium-danger:disabled {
  opacity: 0.65;
  cursor: not-allowed;
  transform: none;
  filter: none;
}

.btn-premium:focus-visible,
.btn-premium-outline:focus-visible,
.btn-premium-danger:focus-visible,
.premium-input:focus-visible,
.premium-select:focus-visible,
.premium-textarea:focus-visible {
  outline: 2px solid rgba(240, 185, 11, 0.9);
  outline-offset: 2px;
}

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.chip-row .chip-btn {
  border: 1px solid #2d4468;
  background: #12213a;
  color: #bed1f2;
  border-radius: 999px;
  min-height: 34px;
  padding: 0 12px;
  font-size: 12px;
  font-weight: 700;
  transition: transform var(--transition), border-color var(--transition), color var(--transition), background var(--transition);
}

.chip-row .chip-btn:hover {
  transform: translateY(-1px);
  border-color: #6d8fc4;
  color: #eff5ff;
}

.chip-row .chip-btn.active {
  border-color: #d7ad4f;
  color: #f9df9a;
  background: #1a2b45;
  box-shadow: 0 0 0 1px rgba(240, 185, 11, 0.24);
}

.premium-table-wrap {
  overflow-x: auto;
  border-radius: 14px;
  border: 1px solid #243858;
}

.premium-table {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
  margin: 0;
}

.premium-table thead th {
  background: #12223a;
  color: #d5e7ff;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  border-bottom: 1px solid #2a405f;
  padding: 11px 10px;
}

.premium-table tbody td {
  border-top: 1px solid rgba(44, 66, 97, 0.55);
  padding: 11px 10px;
  color: #d7e5ff;
  font-size: 13px;
  vertical-align: middle;
}

.premium-table tbody tr {
  background: rgba(11, 19, 33, 0.8);
  transition: background var(--transition);
}

.premium-table tbody tr:hover {
  background: rgba(22, 36, 60, 0.95);
}

.premium-table tfoot td,
.premium-table tfoot th {
  background: rgba(11, 19, 33, 0.84);
  border-top: 1px solid rgba(44, 66, 97, 0.8);
  color: #9db2d6;
  font-size: 12px;
}

.status-badge {
  border-radius: 999px;
  padding: 4px 8px;
  font-size: 11px;
  font-weight: 700;
  border: 1px solid #2f496f;
  background: #132641;
  color: #cfe0ff;
  white-space: nowrap;
}

.status-badge.success {
  border-color: rgba(38, 194, 129, 0.45);
  background: rgba(16, 82, 58, 0.35);
  color: #8af4c8;
}

.status-badge.warning {
  border-color: rgba(240, 185, 11, 0.45);
  background: rgba(89, 63, 18, 0.38);
  color: #f8d987;
}

.status-badge.danger {
  border-color: rgba(239, 68, 68, 0.5);
  background: rgba(124, 28, 33, 0.35);
  color: #ffb5bd;
}

.premium-kpi {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.premium-kpi .item {
  border: 1px solid #2a4265;
  border-radius: 12px;
  background: #10203a;
  padding: 10px;
}

.premium-kpi .label {
  margin: 0;
  color: #93a9cf;
  font-size: 11px;
  text-transform: uppercase;
}

.premium-kpi .value {
  margin: 4px 0 0;
  color: #f0f6ff;
  font-size: 18px;
  font-weight: 800;
  line-height: 1.1;
}

.empty-state,
.premium-alert {
  border: 1px dashed #324c75;
  border-radius: 12px;
  background: rgba(11, 21, 37, 0.8);
  color: #a8bcdd;
  font-size: 13px;
  padding: 12px 14px;
}

.premium-alert.error {
  border-style: solid;
  border-color: rgba(255, 101, 116, 0.56);
  color: #ffbdc5;
  background: rgba(94, 22, 31, 0.32);
}

.premium-alert.success {
  border-style: solid;
  border-color: rgba(38, 194, 129, 0.52);
  color: #9bf6d1;
  background: rgba(18, 89, 61, 0.28);
}

.premium-list {
  display: grid;
  gap: 10px;
}

.premium-list-item {
  border: 1px solid #2b4164;
  border-radius: 14px;
  background: rgba(15, 27, 45, 0.9);
  padding: 10px 12px;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.22);
}

.premium-list-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

.premium-list-id {
  font-size: 11px;
  color: #8ca3c9;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.premium-list-title {
  color: #eaf2ff;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.2;
}

.premium-list-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  color: #a9bddf;
  font-size: 12px;
}

.premium-pagination {
  margin-top: 10px;
  color: #9eb2d5;
  font-size: 12px;
}

#modal-login.modal-premium .modal-dialog {
  max-width: 380px;
  margin-top: 8vh;
}

#modal-login.modal-premium .modal-content {
  border-radius: 16px;
  border: 1px solid #2f466d;
  background: linear-gradient(180deg, rgba(18, 29, 49, 0.97), rgba(10, 18, 32, 0.98));
  box-shadow: 0 20px 46px rgba(0, 0, 0, 0.45);
  color: #dce9ff;
}

#modal-login.modal-premium .modal-header {
  border-bottom: 1px solid #243a5b;
  padding: 12px 14px;
}

#modal-login.modal-premium .modal-title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  text-transform: uppercase;
  color: #edf4ff;
}

#modal-login.modal-premium .modal-close {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  border: 1px solid #355077;
  background: #132541;
  color: #d5e4ff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

#modal-login.modal-premium .modal-body {
  padding: 14px;
}

#modal-login.modal-premium .modal-links {
  margin-top: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

#modal-login.modal-premium .modal-links a {
  color: #9fc4ff;
  font-size: 12px;
  text-decoration: none;
}

#modal-login.modal-premium .modal-links a:hover {
  color: #d8e9ff;
  text-decoration: underline;
}

#modal-login.modal-premium .modal-note {
  margin-top: 8px;
  color: #8ea3c9;
  font-size: 11px;
}

#modal-login.modal-premium .modal-content {
  animation: premiumModalIn .18s cubic-bezier(.2,.65,.2,1);
}

@keyframes premiumModalIn {
  from {
    opacity: 0;
    transform: translateY(8px) scale(.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.modal-backdrop.show {
  background-color: rgba(2, 8, 18, 0.66);
  backdrop-filter: blur(2px);
}

.account-modal .modal-dialog {
  max-width: 520px;
  margin-top: 8vh;
}

.account-modal .modal-content {
  border-radius: 16px;
  border: 1px solid #2d4468;
  background: linear-gradient(170deg, rgba(18, 29, 49, 0.98), rgba(10, 18, 32, 0.98));
  box-shadow: 0 24px 50px rgba(0, 0, 0, 0.48);
  color: #e5efff;
}

.account-modal .modal-header,
.account-modal .modal-footer {
  border-color: #243a5c;
}

.account-modal .modal-header {
  padding: 12px 14px;
}

.account-modal .modal-body {
  padding: 14px;
}

.account-modal .close {
  color: #d4e7ff;
  opacity: 1;
}

.account-modal .close:hover {
  color: #f5fbff;
}

.account-actions-inline {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.balance-highlight {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border-radius: 999px;
  border: 1px solid #3b5883;
  background: #142947;
  color: #f9d992;
  font-weight: 700;
  font-size: 12px;
  min-height: 36px;
  padding: 0 12px;
}

.account-mobile-cards {
  display: none;
}

@media (max-width: 1199px) {
  .account-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 991px) {
  .account-page {
    padding: 8px 4px 14px;
  }

  .account-title h2,
  .account-title h3,
  .account-title h4 {
    font-size: 26px;
  }

  .field-span-8,
  .field-span-6,
  .field-span-4 {
    grid-column: span 12;
  }
}

@media (max-width: 767px) {
  .account-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .premium-table-wrap {
    display: none;
  }

  .account-mobile-cards {
    display: block;
  }

  .premium-actions {
    justify-content: stretch;
    flex-direction: column;
    align-items: stretch;
  }

  .premium-actions .btn-premium,
  .premium-actions .btn-premium-outline,
  .premium-actions .btn-premium-danger {
    width: 100%;
  }

  #modal-login.modal-premium .modal-dialog,
  .account-modal .modal-dialog {
    margin-top: 4vh;
  }
}
