/* ===== XStreamers — base compartilhada (loja + painel) ===== */
:root {
  --bg: #07080c;
  --bg-2: #0b0d13;
  --s1: #0f1118;
  --s2: #151925;
  --s3: #1c2130;
  --s4: #262c3e;
  --line: rgba(255, 255, 255, .07);
  --line-2: rgba(255, 255, 255, .12);
  --tx: #eef0f6;
  --tx-2: #a9afc2;
  --tx-3: #6c7389;
  --brand: #ff5a3c;
  --amber: #ffb020;
  --brand-soft: #ff8a5c;
  --grad: linear-gradient(120deg, #ff4a2e 0%, #ff7a2a 45%, #ffb020 100%);
  --grad-soft: linear-gradient(120deg, rgba(255, 74, 46, .18), rgba(255, 176, 32, .12));
  --ok: #35d399;
  --warn: #f7b955;
  --bad: #f2637a;
  --info: #5aa9ff;
  --r: 14px;
  --r-lg: 22px;
  --shadow: 0 20px 60px -20px rgba(0, 0, 0, .7);
  --glow: 0 0 0 1px rgba(255, 90, 60, .45), 0 14px 40px -12px rgba(255, 90, 60, .55);
  --f-display: "Chakra Petch", "Segoe UI", system-ui, sans-serif;
  --f-body: "Manrope", "Segoe UI", system-ui, sans-serif;
  --f-mono: "JetBrains Mono", "Cascadia Mono", Consolas, monospace;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0; background: var(--bg); color: var(--tx);
  font-family: var(--f-body); font-size: 15px; line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
::selection { background: rgba(255, 90, 60, .35); }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--s4); border-radius: 10px; border: 2px solid var(--bg); }

h1, h2, h3, h4 { font-family: var(--f-display); letter-spacing: .01em; line-height: 1.1; margin: 0; font-weight: 700; }
.mono { font-family: var(--f-mono); }
.muted { color: var(--tx-2); }
.dim { color: var(--tx-3); }
.grad-text { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hidden { display: none !important; }

/* ---------- botões ---------- */
.btn {
  --b: var(--s3);
  display: inline-flex; align-items: center; justify-content: center; gap: .55em;
  height: 44px; padding: 0 20px; border-radius: 12px; border: 1px solid var(--line-2);
  background: var(--b); font-weight: 700; font-size: 14px; cursor: pointer; white-space: nowrap;
  transition: transform .15s, box-shadow .2s, background .2s, border-color .2s, opacity .2s;
}
.btn:hover { border-color: rgba(255, 255, 255, .22); transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn[disabled] { opacity: .5; pointer-events: none; }
.btn-primary { background: var(--grad); border: 0; color: #1a0a04; box-shadow: 0 10px 30px -10px rgba(255, 90, 60, .7); }
.btn-primary:hover { box-shadow: 0 14px 38px -10px rgba(255, 110, 50, .9); }
.btn-ghost { background: transparent; }
.btn-dark { background: rgba(0, 0, 0, .45); backdrop-filter: blur(10px); }
.btn-danger { background: rgba(242, 99, 122, .12); border-color: rgba(242, 99, 122, .35); color: #ff9aab; }
.btn-ok { background: rgba(53, 211, 153, .12); border-color: rgba(53, 211, 153, .35); color: #7befc2; }
.btn-sm { height: 34px; padding: 0 13px; font-size: 13px; border-radius: 10px; }
.btn-lg { height: 54px; padding: 0 28px; font-size: 16px; border-radius: 14px; }
.btn-block { width: 100%; }
.icon-btn {
  width: 40px; height: 40px; border-radius: 11px; display: grid; place-items: center;
  background: var(--s2); border: 1px solid var(--line); cursor: pointer; position: relative; transition: .2s;
}
.icon-btn:hover { border-color: var(--line-2); background: var(--s3); }
svg.i { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }

/* ---------- formulários ---------- */
.field { display: flex; flex-direction: column; gap: 7px; margin-bottom: 16px; }
.field > label, .lbl { font-size: 13px; font-weight: 700; color: var(--tx-2); }
.field .hint { font-size: 12px; color: var(--tx-3); }
.input, select.input, textarea.input {
  width: 100%; height: 46px; padding: 0 14px; border-radius: 12px; outline: none;
  background: var(--bg-2); border: 1px solid var(--line-2); transition: border-color .2s, box-shadow .2s;
}
textarea.input { height: auto; min-height: 110px; padding: 12px 14px; resize: vertical; line-height: 1.5; }
.input:focus { border-color: rgba(255, 122, 60, .7); box-shadow: 0 0 0 4px rgba(255, 90, 60, .14); }
select.input { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23a9afc2' stroke-width='2' fill='none'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; padding-right: 36px; }
.check { display: flex; align-items: center; gap: 10px; cursor: pointer; font-weight: 600; font-size: 14px; }
.check input { width: 18px; height: 18px; accent-color: var(--brand); }

/* ---------- chips e badges ---------- */
.chip {
  display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 12px; border-radius: 999px;
  background: var(--s2); border: 1px solid var(--line); font-size: 13px; font-weight: 600; color: var(--tx-2);
  cursor: pointer; transition: .2s; white-space: nowrap;
}
.chip:hover { color: var(--tx); border-color: var(--line-2); }
.chip.on { background: var(--grad-soft); border-color: rgba(255, 120, 60, .55); color: #ffd2bf; }
.badge {
  display: inline-flex; align-items: center; gap: 5px; height: 23px; padding: 0 9px; border-radius: 7px;
  font-size: 11.5px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase;
  background: var(--s3); color: var(--tx-2);
}
.badge.brand { background: var(--grad); color: #1a0a04; }
.badge.ok { background: rgba(53, 211, 153, .14); color: var(--ok); }
.badge.warn { background: rgba(247, 185, 85, .14); color: var(--warn); }
.badge.bad { background: rgba(242, 99, 122, .14); color: var(--bad); }
.badge.info { background: rgba(90, 169, 255, .14); color: var(--info); }

/* ---------- toasts / modal ---------- */
#toasts { position: fixed; z-index: 9999; right: 20px; bottom: 20px; display: flex; flex-direction: column; gap: 10px; }
.toast {
  min-width: 260px; max-width: 380px; padding: 13px 16px; border-radius: 12px; background: var(--s2);
  border: 1px solid var(--line-2); box-shadow: var(--shadow); font-weight: 600; font-size: 14px;
  display: flex; gap: 10px; align-items: flex-start; animation: toastIn .25s ease-out;
}
.toast.ok { border-color: rgba(53, 211, 153, .4); }
.toast.bad { border-color: rgba(242, 99, 122, .45); }
.toast .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--brand); margin-top: 7px; flex: none; }
.toast.ok .dot { background: var(--ok); }
.toast.bad .dot { background: var(--bad); }
@keyframes toastIn { from { opacity: 0; transform: translateY(10px) scale(.98); } }

.modal-bg {
  position: fixed; inset: 0; z-index: 900; background: rgba(3, 4, 8, .72); backdrop-filter: blur(6px);
  display: grid; place-items: center; padding: 20px; animation: fade .2s;
}
.modal {
  width: min(560px, 100%); max-height: 90vh; overflow: auto; background: var(--s1); border: 1px solid var(--line-2);
  border-radius: var(--r-lg); box-shadow: var(--shadow); animation: pop .22s ease-out;
}
.modal.wide { width: min(980px, 100%); }
.modal-h { display: flex; align-items: center; justify-content: space-between; padding: 20px 22px; border-bottom: 1px solid var(--line); }
.modal-h h3 { font-size: 20px; }
.modal-b { padding: 22px; }
.modal-f { display: flex; justify-content: flex-end; gap: 10px; padding: 16px 22px; border-top: 1px solid var(--line); }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: translateY(12px) scale(.98); } }

.spinner { width: 22px; height: 22px; border-radius: 50%; border: 3px solid rgba(255, 255, 255, .15); border-top-color: var(--amber); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.skel { background: linear-gradient(90deg, var(--s2), var(--s3), var(--s2)); background-size: 200% 100%; animation: sk 1.3s infinite; border-radius: 12px; }
@keyframes sk { to { background-position: -200% 0; } }

.empty { text-align: center; padding: 60px 20px; color: var(--tx-2); }
.empty .em-ico { width: 64px; height: 64px; margin: 0 auto 16px; border-radius: 18px; display: grid; place-items: center; background: var(--grad-soft); border: 1px solid rgba(255, 120, 60, .3); color: var(--amber); }
.empty .em-ico svg { width: 28px; height: 28px; }
.empty h3 { color: var(--tx); font-size: 20px; margin-bottom: 6px; }

table.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--tx-3); font-weight: 800; padding: 12px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl td { padding: 13px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl tr:hover td { background: rgba(255, 255, 255, .015); }
.keybox {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 11px; background: var(--bg);
  border: 1px dashed rgba(255, 176, 32, .4); font-family: var(--f-mono); font-size: 14px; letter-spacing: .06em; color: #ffd48a;
}
.keybox span { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.note { padding: 14px 16px; border-radius: 12px; background: rgba(90, 169, 255, .08); border: 1px solid rgba(90, 169, 255, .25); color: #b8d8ff; font-size: 14px; }
.note.warn { background: rgba(247, 185, 85, .08); border-color: rgba(247, 185, 85, .3); color: #ffe0a8; }

select.input option { background: #151925; color: #eef0f6; }
