:root {
  color-scheme: dark;
  font-family: "Inter", system-ui, sans-serif;
  background: #071426;
  color: #f5f7fb;
  --navy-950: #06101e;
  --navy-900: #071426;
  --navy-850: #0b1a2c;
  --navy-800: #102238;
  --navy-700: #1b3149;
  --line: #29425e;
  --muted: #9fb0c4;
  --green: #10d982;
  --green-dark: #08ad67;
  --coral: #ff6b62;
  --gold: #f6c64b;
  --white: #f5f7fb;
  --danger: #ff6b62;
}

* { box-sizing: border-box; }
html, body { min-height: 100%; margin: 0; background: var(--navy-900); overflow-x: hidden; }
body { min-width: 0; }
button, input, select { font: inherit; }
button { letter-spacing: 0; }

.auth-shell {
  min-height: 100dvh;
  display: grid;
  grid-template-columns: minmax(320px, 520px) minmax(420px, 1fr);
  background: var(--navy-900);
}

.auth-panel { padding: 40px clamp(24px, 5vw, 72px); display: flex; flex-direction: column; justify-content: center; }
.auth-visual {
  position: relative;
  min-height: 100dvh;
  background: #0d2035 url("./assets/icon-512.png") center 36% / min(38vw, 460px) no-repeat;
  border-left: 1px solid var(--line);
  display: flex;
  align-items: flex-end;
  padding: 54px;
}
.auth-visual::after { content: ""; position: absolute; inset: 0; background: rgba(7, 20, 38, .28); }
.auth-visual-copy { position: relative; z-index: 1; max-width: 620px; }
.auth-visual h2 { font-size: 34px; line-height: 1.15; margin: 0 0 12px; }
.auth-visual p { color: #d2deec; font-size: 17px; line-height: 1.6; }

.brand { display: inline-flex; align-items: center; gap: 11px; margin-bottom: 36px; }
.brand img { width: 42px; height: 42px; border-radius: 8px; }
.brand-word { font-size: 25px; font-weight: 800; font-style: italic; }
.brand-word span { color: var(--green); }
.eyebrow { margin: 0 0 8px; color: var(--green); font-size: 13px; font-weight: 700; text-transform: uppercase; }
h1 { font-size: 30px; margin: 0 0 9px; line-height: 1.2; }
.subtitle { color: var(--muted); line-height: 1.55; margin: 0 0 26px; }
.auth-card { width: 100%; max-width: 460px; }
.auth-tabs { display: grid; grid-template-columns: 1fr 1fr; border-bottom: 1px solid var(--line); margin-bottom: 26px; }
.auth-tab { border: 0; border-bottom: 2px solid transparent; background: transparent; color: var(--muted); padding: 12px; cursor: pointer; font-weight: 700; }
.auth-tab.active { color: var(--white); border-bottom-color: var(--green); }
.bonus-banner { display: flex; align-items: center; gap: 12px; border: 1px solid var(--coral); background: #13243a; padding: 13px 15px; border-radius: 6px; margin-bottom: 18px; }
.bonus-banner strong { display: block; }
.bonus-banner small { color: var(--muted); }
.link-banner { border-color: var(--green); }

.field { margin-bottom: 16px; }
.field label { display: block; font-size: 13px; font-weight: 700; margin-bottom: 7px; }
.input-wrap { position: relative; }
.input-wrap i { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--muted); width: 19px; }
.input-wrap .icon-button { position: absolute; right: 6px; top: 5px; }
input {
  width: 100%; min-height: 48px; border: 1px solid var(--line); border-radius: 6px;
  background: #0b1a2c; color: var(--white); padding: 11px 44px; outline: none;
}
.auth-input-wrap input { padding-left: 14px; padding-right: 14px; }
.auth-input-wrap.has-action input { padding-right: 44px; }
input:focus { border-color: var(--green); box-shadow: 0 0 0 3px rgba(16, 217, 130, .12); }
.hint { font-size: 12px; color: var(--muted); margin: -8px 0 14px; }
.button { min-height: 46px; border: 0; border-radius: 6px; padding: 11px 16px; font-weight: 800; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 9px; }
.button:disabled { opacity: .5; cursor: not-allowed; }
.button-primary { background: var(--green); color: #03160e; }
.button-primary:hover { background: #24e495; }
.button-secondary { background: var(--navy-800); color: var(--white); border: 1px solid var(--line); }
.button-danger { background: var(--coral); color: #250402; }
.button-block { width: 100%; }
.link-button { border: 0; background: transparent; color: var(--green); cursor: pointer; padding: 8px 0; font-weight: 700; }
.auth-footer { display: flex; justify-content: space-between; align-items: center; margin-top: 10px; }
.icon-button { width: 38px; height: 38px; border: 0; background: transparent; color: var(--muted); border-radius: 6px; display: grid; place-items: center; cursor: pointer; }
.icon-button.bordered { border: 1px solid var(--line); background: var(--navy-850); }

.boot-screen { min-height: 100dvh; display: grid; place-items: center; text-align: center; }
.boot-screen .brand { justify-content: center; margin-bottom: 20px; }
.loading-line { height: 4px; width: 100%; overflow: hidden; border-radius: 4px; background: var(--navy-700); margin: 14px 0; position: relative; }
.loading-line::after { content: ""; position: absolute; inset: 0 auto 0 0; width: 42%; background: var(--green); animation: loading 1.1s ease-in-out infinite; }
@keyframes loading { from { transform: translateX(-110%); } to { transform: translateX(260%); } }

.app-shell { min-height: 100dvh; display: grid; grid-template-columns: 232px minmax(0, 1fr); background: var(--navy-950); }
.sidebar { position: sticky; top: 0; height: 100dvh; border-right: 1px solid var(--line); background: #081526; padding: 26px 18px; display: flex; flex-direction: column; }
.sidebar .brand { margin: 0 8px 32px; }
.nav-list { display: grid; gap: 6px; }
.nav-button { min-height: 46px; border: 0; border-radius: 6px; background: transparent; color: var(--muted); display: flex; gap: 12px; align-items: center; padding: 10px 13px; cursor: pointer; font-weight: 700; text-align: left; }
.nav-button.active, .nav-button:hover { background: var(--navy-800); color: var(--white); }
.nav-button.active i { color: var(--green); }
.sidebar-footer { margin-top: auto; }
.install-button { width: 100%; margin-bottom: 10px; }

.main { min-width: 0; padding: 28px clamp(20px, 4vw, 54px) 46px; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 28px; }
.topbar h1 { font-size: 26px; }
.balance-pill { display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--green); border-radius: 6px; padding: 10px 13px; background: #0b2030; color: var(--white); font-weight: 800; white-space: nowrap; }
.balance-pill i { color: var(--gold); }
.section-header { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin: 26px 0 14px; }
.section-header h2 { margin: 0; font-size: 20px; }
.section-header p { margin: 5px 0 0; color: var(--muted); }
.sport-tabs { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 5px; }
.sport-tab { min-width: 116px; border: 1px solid var(--line); background: var(--navy-850); color: var(--muted); border-radius: 6px; padding: 12px; display: flex; justify-content: center; align-items: center; gap: 8px; cursor: pointer; font-weight: 700; }
.sport-tab.active { background: var(--green); color: #04160e; border-color: var(--green); }
.calendar-toolbar { display: grid; grid-template-columns: minmax(220px, 1fr) auto; align-items: end; gap: 14px; margin: 12px 0; }
.select-field { display: grid; gap: 6px; color: var(--muted); font-size: 12px; font-weight: 700; }
select { width: 100%; min-height: 46px; border: 1px solid var(--line); border-radius: 6px; background: var(--navy-850); color: var(--white); padding: 10px 12px; outline: none; }
select:focus { border-color: var(--green); box-shadow: 0 0 0 3px rgba(16, 217, 130, .12); }
.date-nav { min-height: 46px; display: grid; grid-template-columns: 38px minmax(92px, auto) 38px; align-items: center; justify-items: center; gap: 6px; }
.match-list { display: grid; gap: 10px; }
.match-row { width: 100%; display: grid; grid-template-columns: minmax(170px, 1fr) auto auto; align-items: center; gap: 22px; border: 1px solid var(--line); background: var(--navy-850); color: var(--white); border-radius: 6px; padding: 16px 18px; cursor: pointer; text-align: left; }
.match-row:hover { border-color: #3b5b7c; background: var(--navy-800); }
.league { color: var(--muted); font-size: 12px; margin-bottom: 7px; }
.teams { font-weight: 800; line-height: 1.55; }
.kickoff { text-align: right; font-weight: 700; }
.countdown { color: var(--green); font-size: 12px; margin-top: 4px; }
.chevron { color: var(--muted); }

.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.panel { border: 1px solid var(--line); background: var(--navy-850); border-radius: 6px; padding: 18px; }
.panel h2, .panel h3 { margin-top: 0; }
.muted { color: var(--muted); }
.match-hero { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 20px; text-align: center; padding: 28px 18px; }
.team-name { font-size: 20px; font-weight: 800; }
.versus { color: var(--muted); font-weight: 800; }
.status-badge { display: inline-flex; padding: 5px 9px; border-radius: 4px; background: rgba(255, 107, 98, .14); color: var(--coral); font-size: 12px; font-weight: 800; }
.data-status { display: grid; gap: 10px; }
.data-line { display: flex; align-items: center; gap: 10px; color: #d7e1ec; }
.data-line i { color: var(--green); width: 18px; }
.stake-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 14px; }
.stake-button { min-height: 72px; flex-direction: column; }
.stake-button small { font-weight: 600; opacity: .75; }
.responsible-note { display: flex; gap: 10px; margin-top: 14px; padding: 13px; color: var(--muted); border-left: 3px solid var(--green); background: #0b192a; }
.back-button { margin-bottom: 18px; }
.empty-state { min-height: 160px; display: grid; place-items: center; align-content: center; gap: 8px; text-align: center; }
.empty-state > i { color: var(--green); }
.empty-state p { margin: 0; }

.wallet-total { display: flex; justify-content: space-between; align-items: end; gap: 20px; }
.wallet-number { font-size: 42px; font-weight: 800; color: var(--gold); }
.action-row { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 18px; }
.movement-list { display: grid; }
.movement { display: grid; grid-template-columns: 1fr auto; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.movement:last-child { border-bottom: 0; }
.movement strong { display: block; }
.movement small { color: var(--muted); }
.amount-positive { color: var(--green); font-weight: 800; }
.amount-negative { color: var(--coral); font-weight: 800; }

.report-header { border-left: 4px solid var(--coral); }
.report-parts { display: grid; gap: 14px; margin-top: 14px; }
.report-copy { white-space: pre-wrap; line-height: 1.55; overflow-wrap: anywhere; }
.report-copy strong { color: var(--white); }
.report-copy code { color: var(--gold); font-family: ui-monospace, SFMono-Regular, Consolas, monospace; }
.report-loading { margin-top: 14px; text-align: center; padding: 28px; }
.report-loading h2 { margin: 18px 0 8px; }
.report-loading p { margin-bottom: 0; }
.probability-list { display: grid; gap: 13px; }
.probability-row { display: grid; grid-template-columns: 150px minmax(100px, 1fr) 52px; gap: 12px; align-items: center; }
.bar { height: 8px; border-radius: 6px; background: #263a51; overflow: hidden; }
.bar > span { display: block; height: 100%; background: var(--green); }
.market-list { display: grid; }
.market-row { display: grid; grid-template-columns: 1fr auto; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.market-row:last-child { border-bottom: 0; }
.market-rate { color: var(--green); font-weight: 800; }
.status-text { align-self: center; color: var(--muted); font-size: 12px; font-weight: 800; text-transform: uppercase; }
.status-text.completed { color: var(--green); }
.status-text.refunded { color: var(--coral); }
.profile-session { margin-top: 14px; }
.admin-profile-button { margin-top: 18px; }
.admin-metrics { display: grid; grid-template-columns: repeat(5, minmax(130px, 1fr)); gap: 10px; margin-bottom: 14px; }
.metric { display: grid; gap: 7px; min-width: 0; }
.metric i { color: var(--green); }
.metric span { color: var(--muted); font-size: 12px; }
.metric strong { font-size: 24px; overflow-wrap: anywhere; }
.admin-tools { display: grid; grid-template-columns: minmax(220px, .8fr) minmax(320px, 1.2fr); gap: 18px; }
.admin-tools form { display: grid; gap: 8px; align-content: start; }
.admin-tools label { font-size: 13px; font-weight: 700; }
.admin-inline { display: flex; gap: 8px; }
.admin-inline input { min-width: 0; padding: 11px 13px; }
.admin-table-wrap { overflow-x: auto; padding: 0; }
.admin-table { width: 100%; border-collapse: collapse; min-width: 620px; }
.admin-table th, .admin-table td { padding: 13px 15px; border-bottom: 1px solid var(--line); text-align: left; }
.admin-table th { color: var(--muted); font-size: 12px; }
.admin-table td small { display: block; color: var(--muted); margin-top: 3px; }
.admin-table tr:last-child td { border-bottom: 0; }

.modal-backdrop { position: fixed; inset: 0; background: rgba(1, 7, 14, .76); display: grid; place-items: center; padding: 20px; z-index: 20; }
.modal { width: min(440px, 100%); border: 1px solid var(--line); background: var(--navy-850); border-radius: 8px; padding: 22px; box-shadow: 0 18px 60px rgba(0,0,0,.4); }
.modal h2 { margin-top: 0; }
.modal-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 20px; }
.quote-box { display: grid; grid-template-columns: 1fr auto; gap: 6px 14px; align-items: center; border: 1px solid var(--green); background: #0b2030; padding: 14px; border-radius: 6px; }
.quote-box strong { color: var(--gold); font-size: 20px; }
.quote-box small { grid-column: 1 / -1; color: var(--muted); }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 18px); opacity: 0; pointer-events: none; background: #f5f7fb; color: #071426; border-radius: 6px; padding: 12px 16px; font-weight: 700; z-index: 30; transition: .2s ease; }
.toast.visible { opacity: 1; transform: translate(-50%, 0); }
.mobile-nav { display: none; }

@media (max-width: 860px) {
  .auth-shell { grid-template-columns: 1fr; }
  .auth-visual { display: none; }
  .auth-panel { min-height: 100dvh; padding: 28px 20px; }
  .auth-card { margin: auto; }
  .app-shell { display: block; padding-bottom: 76px; }
  .sidebar { display: none; }
  .main { padding: 22px 16px 28px; }
  .mobile-nav { position: fixed; display: grid; grid-template-columns: repeat(4, 1fr); bottom: 0; left: 0; right: 0; height: 68px; padding-bottom: env(safe-area-inset-bottom); background: #081526; border-top: 1px solid var(--line); z-index: 10; }
  .mobile-nav button { border: 0; background: transparent; color: var(--muted); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; font-size: 11px; }
  .mobile-nav button.active { color: var(--green); }
  .topbar { align-items: flex-start; }
  .topbar h1 { font-size: 23px; }
  .match-row { grid-template-columns: 1fr auto; gap: 12px; }
  .chevron { display: none; }
  .grid-2 { grid-template-columns: 1fr; }
  .calendar-toolbar { grid-template-columns: 1fr; align-items: stretch; }
  .date-nav { justify-content: space-between; }
  .admin-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .admin-tools { grid-template-columns: 1fr; }
}

@media (max-width: 520px) {
  .brand { margin-bottom: 24px; }
  .topbar { gap: 10px; }
  .balance-pill { padding: 8px 10px; font-size: 13px; }
  .match-row { padding: 14px; }
  .kickoff { font-size: 13px; }
  .stake-grid { grid-template-columns: 1fr; }
  .match-hero { grid-template-columns: 1fr; gap: 7px; }
  .versus { margin: 2px 0; }
  .probability-row { grid-template-columns: 108px 1fr 44px; font-size: 13px; }
  .modal-actions { grid-template-columns: 1fr; }
  .wallet-total { align-items: flex-start; flex-direction: column; }
  .admin-inline { flex-direction: column; }
}
