/* IBPLAY web: shared look of the website, the reseller portal and the admin panel (same colours as the app). */
:root {
  --bg: #07070b; --surface: #101017; --surface2: #181822; --surface3: #20202d; --border: #262636; --border2: #34344a;
  --text: #f2f2f7; --muted: #a0a0b6; --dim: #6c6c82;
  --orange: #ff8c00; --pink: #ff2e7a; --purple: #9640ff; --green: #34c778; --red: #eb4852; --amber: #f5a524; --blue: #4a9dff;
  --grad: linear-gradient(90deg, var(--orange), var(--pink), var(--purple));
  --radius: 14px;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
a { color: inherit; }
img { max-width: 100%; height: auto; display: block; }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5em; }
h1 { font-size: clamp(28px, 5vw, 46px); letter-spacing: -.5px; }
h2 { font-size: clamp(22px, 3.4vw, 30px); }
h3 { font-size: 18px; }
p { margin: 0 0 1em; }
.muted { color: var(--muted); }
.dim { color: var(--dim); }
.small { font-size: 13px; }
.mono { font-family: ui-monospace, Menlo, Consolas, monospace; }
.grad-text { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hide { display: none !important; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.spread { display: flex; gap: 10px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }
.grid { display: grid; gap: 14px; }
.grid.c2 { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.grid.c3 { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.grid.c4 { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }

/* Cards, forms, buttons */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: 18px; padding: 20px; }
.card.tight { padding: 14px 16px; }
label { display: block; font-size: 13px; color: var(--muted); margin: 12px 0 5px; }
input, select, textarea {
  width: 100%; padding: 11px 13px; border-radius: 11px; border: 1px solid var(--border); background: var(--surface2);
  color: var(--text); font: inherit; font-size: 15px;
}
textarea { min-height: 90px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--pink); }
input.code { font-family: ui-monospace, Menlo, Consolas, monospace; letter-spacing: 1.5px; text-transform: uppercase; }
input[type=checkbox] { width: auto; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 11px 18px; border: 0; border-radius: 11px;
  background: var(--grad); color: #fff; font: inherit; font-weight: 700; cursor: pointer; text-decoration: none; white-space: nowrap;
}
.btn.block { width: 100%; }
.btn.ghost { background: var(--surface2); border: 1px solid var(--border2); color: var(--text); font-weight: 600; }
.btn.ghost:hover { border-color: var(--pink); }
.btn.danger { background: rgba(235,72,82,.14); border: 1px solid rgba(235,72,82,.55); color: #ff8a92; font-weight: 600; }
.btn.small { padding: 7px 12px; font-size: 13px; border-radius: 9px; }
.btn:disabled { opacity: .5; cursor: default; }
.link { background: none; border: 0; color: var(--pink); font: inherit; cursor: pointer; padding: 0; text-decoration: underline; }

/* Notices */
.msg { margin: 12px 0 0; padding: 11px 14px; border-radius: 11px; font-size: 14px; }
.msg.err { background: rgba(235,72,82,.12); border: 1px solid rgba(235,72,82,.5); }
.msg.ok { background: rgba(52,199,120,.12); border: 1px solid rgba(52,199,120,.5); }
.msg.info { background: rgba(74,157,255,.1); border: 1px solid rgba(74,157,255,.4); }
.badge { display: inline-block; padding: 2px 9px; border-radius: 20px; font-size: 12px; font-weight: 600; border: 1px solid var(--border2); background: var(--surface2); color: var(--muted); white-space: nowrap; }
.badge.green { color: #6fe0a2; border-color: rgba(52,199,120,.45); background: rgba(52,199,120,.1); }
.badge.red { color: #ff8a92; border-color: rgba(235,72,82,.45); background: rgba(235,72,82,.1); }
.badge.amber { color: #ffc35c; border-color: rgba(245,165,36,.45); background: rgba(245,165,36,.1); }
.badge.purple { color: #c9a2ff; border-color: rgba(150,64,255,.45); background: rgba(150,64,255,.12); }
.badge.blue { color: #8cc2ff; border-color: rgba(74,157,255,.45); background: rgba(74,157,255,.1); }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; vertical-align: 1px; }

/* Tables (scroll sideways on phones instead of breaking the page) */
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--border); white-space: nowrap; }
th { color: var(--dim); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: .4px; background: var(--surface2); position: sticky; top: 0; }
tr:last-child td { border-bottom: 0; }
tbody tr.click { cursor: pointer; }
tbody tr.click:hover td { background: var(--surface2); }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
.empty { padding: 28px; text-align: center; color: var(--dim); }

/* Stat tiles */
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; }
.stat .k { font-size: 12px; color: var(--dim); text-transform: uppercase; letter-spacing: .4px; }
.stat .v { font-size: 26px; font-weight: 800; margin-top: 2px; font-variant-numeric: tabular-nums; }
.stat .s { font-size: 13px; color: var(--muted); }

/* Modal */
.modal-back { position: fixed; inset: 0; background: rgba(0,0,0,.7); display: flex; align-items: flex-start; justify-content: center; padding: 40px 16px; overflow-y: auto; z-index: 50; }
.modal { width: 100%; max-width: 620px; background: var(--surface); border: 1px solid var(--border2); border-radius: 18px; padding: 22px; }
.modal.wide { max-width: 920px; }
.modal h2 { font-size: 22px; }
.modal .close { float: right; background: none; border: 0; color: var(--muted); font-size: 24px; line-height: 1; cursor: pointer; }

/* Toast */
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--surface3); border: 1px solid var(--border2); padding: 11px 18px; border-radius: 12px; z-index: 60; box-shadow: 0 8px 30px rgba(0,0,0,.5); max-width: calc(100% - 32px); }
.toast.err { border-color: rgba(235,72,82,.7); }

/* App shell of the portal and the panel: sidebar on wide screens, top bar + menu on phones */
.shell { display: flex; min-height: 100vh; }
.side { width: 236px; flex: none; background: var(--surface); border-right: 1px solid var(--border); padding: 18px 12px; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.side img.logo { height: 34px; margin: 4px 8px 20px; }
.side nav a { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 10px; color: var(--muted); text-decoration: none; font-weight: 600; margin-bottom: 2px; }
.side nav a:hover { background: var(--surface2); color: var(--text); }
.side nav a.on { background: var(--surface2); color: var(--text); box-shadow: inset 3px 0 0 var(--pink); }
.side nav a .n { margin-left: auto; font-size: 12px; background: var(--pink); color: #fff; border-radius: 10px; padding: 0 7px; }
.side .foot { margin-top: 18px; padding: 12px; border-top: 1px solid var(--border); font-size: 13px; color: var(--dim); }
.main { flex: 1; min-width: 0; padding: 26px 28px 60px; }
.main > header { margin-bottom: 18px; }
.topbar { display: none; }
@media (max-width: 860px) {
  .shell { display: block; }
  .side { position: fixed; z-index: 40; left: 0; top: 0; transform: translateX(-100%); transition: transform .2s; box-shadow: 0 0 40px rgba(0,0,0,.6); }
  .side.open { transform: none; }
  .topbar { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; border-bottom: 1px solid var(--border); background: var(--surface); position: sticky; top: 0; z-index: 30; }
  .topbar img { height: 28px; }
  .main { padding: 18px 16px 50px; }
}

/* Login box */
.login { max-width: 420px; margin: 8vh auto; padding: 0 16px; }
.login img { height: 46px; margin: 0 auto 22px; }

.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; }
.toolbar input, .toolbar select { width: auto; min-width: 150px; flex: 1 1 160px; }
.toolbar .btn { flex: none; }
.pager { display: flex; gap: 8px; align-items: center; justify-content: flex-end; margin-top: 12px; color: var(--muted); font-size: 14px; }
.kv { display: grid; grid-template-columns: minmax(120px, max-content) 1fr; gap: 6px 16px; font-size: 14px; }
.kv > :nth-child(odd) { color: var(--dim); }
.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin: 4px 0 14px; }
.tabs button { padding: 7px 13px; border-radius: 20px; border: 1px solid var(--border); background: var(--surface); color: var(--muted); font: inherit; font-size: 14px; cursor: pointer; }
.tabs button.on { color: var(--text); border-color: var(--pink); background: var(--surface2); }
.bar { height: 10px; border-radius: 5px; background: var(--grad); min-width: 2px; }
