/* Motiva Player — Panel de Revendedor (panel.motivatv.click). Marca Motiva, sin dependencias externas. */
:root {
  --brand: #00AEEF;
  --brand-dark: #0090c8;
  --bg: #0b0f14;
  --surface: #131a22;
  --surface-2: #1b242e;
  --border: #26313d;
  --text: #eaf2f8;
  --muted: #8fa3b3;
  --success: #34d399;
  --warning: #fbbf24;
  --danger: #f87171;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: radial-gradient(1200px 600px at 50% -10%, #12202b 0%, var(--bg) 60%);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.5;
}
.hidden { display: none !important; }
.mono { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; }
.muted { color: var(--muted); font-size: 14px; }

/* Marca */
.brand { font-weight: 800; letter-spacing: 1px; font-size: 22px; }
.brand.sm { font-size: 16px; }
.brand-mark { color: var(--brand); }

/* Botones */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 1px solid transparent; border-radius: 10px; padding: 11px 16px;
  font-size: 15px; font-weight: 600; cursor: pointer; transition: .15s;
}
.btn-primary { background: var(--brand); color: #04222e; }
.btn-primary:hover { background: var(--brand-dark); }
.btn-primary:disabled { opacity: .6; cursor: default; }
.btn-ghost { background: transparent; color: var(--text); border-color: var(--border); }
.btn-ghost:hover { background: var(--surface-2); }
.btn-sm { padding: 7px 12px; font-size: 13px; }

/* Card */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 20px; margin-bottom: 18px; }
.card h2 { margin: 0 0 6px; font-size: 18px; }

/* ===== Login ===== */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; }
.login-card { width: 100%; max-width: 380px; text-align: center; }
.login-card .subtitle { color: var(--muted); margin: 2px 0 20px; }
.login-card label { display: block; text-align: left; font-size: 13px; color: var(--muted); margin: 12px 0 6px; }
.login-card input {
  width: 100%; background: var(--surface-2); border: 1px solid var(--border); color: var(--text);
  border-radius: 10px; padding: 12px; font-size: 15px;
}
.login-card input:focus { outline: none; border-color: var(--brand); }
.login-card .btn { width: 100%; margin-top: 20px; }
.login-card .hint { color: var(--muted); font-size: 12px; margin-top: 16px; }
.error { color: var(--danger); font-size: 14px; margin-top: 12px; }

/* ===== Topbar ===== */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 20px; border-bottom: 1px solid var(--border); background: rgba(11,15,20,.7);
  position: sticky; top: 0; backdrop-filter: blur(8px); z-index: 5;
}
.topbar-right { display: flex; align-items: center; gap: 14px; }
.who { color: var(--muted); font-size: 14px; }

/* ===== Container ===== */
.container { max-width: 860px; margin: 0 auto; padding: 22px 18px 60px; }

/* KPIs */
.kpis { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 18px; }
.kpi { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 18px; text-align: center; }
.kpi-value { font-size: 34px; font-weight: 800; color: var(--brand); }
.kpi-label { color: var(--muted); font-size: 13px; margin-top: 4px; }

/* Packs */
.packs { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 12px; margin-top: 12px; }
.pack { background: var(--surface-2); border: 1px solid var(--border); border-radius: 12px; padding: 16px; text-align: center; }
.pack .n { font-size: 26px; font-weight: 800; color: var(--brand); }
.pack .l { font-size: 12px; color: var(--muted); }
.pack .price { font-size: 15px; font-weight: 600; margin: 6px 0 10px; }
.pack .btn { width: 100%; }

/* Form grid */
.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 12px; }
.field { display: flex; flex-direction: column; }
.field label { font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.field input, .field select {
  background: var(--surface-2); border: 1px solid var(--border); color: var(--text);
  border-radius: 10px; padding: 11px; font-size: 15px;
}
.field input:focus, .field select:focus { outline: none; border-color: var(--brand); }
.field-btn { justify-content: flex-end; }
.field-btn .btn { margin-top: auto; }

/* Devices */
.devices { display: flex; flex-direction: column; gap: 10px; margin-top: 8px; }
.device { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px;
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px; }
.device .info { min-width: 0; }
.device .mac { font-family: ui-monospace, Menlo, monospace; color: var(--brand); font-size: 14px; }
.device .sub { color: var(--muted); font-size: 12px; }
.device .actions { display: flex; align-items: center; gap: 8px; }
.device select { background: var(--surface); border: 1px solid var(--border); color: var(--text); border-radius: 8px; padding: 7px; font-size: 13px; }
.badge { display: inline-block; border-radius: 999px; padding: 2px 9px; font-size: 12px; font-weight: 600; }
.badge.ACTIVE { background: rgba(52,211,153,.16); color: var(--success); }
.badge.EXPIRED { background: var(--surface); color: var(--muted); border: 1px solid var(--border); }
.badge.PENDING, .badge.SUSPENDED, .badge.BLOCKED { background: rgba(251,191,36,.16); color: var(--warning); }

/* Panel de listas por dispositivo */
.lists-panel { flex-basis: 100%; width: 100%; margin-top: 12px; border-top: 1px dashed var(--border); padding-top: 12px; }
.lists-head, .al-head { font-size: 13px; color: var(--muted); font-weight: 600; margin-bottom: 8px; }
.list-rows { display: flex; flex-direction: column; gap: 8px; margin-bottom: 14px; }
.list-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap;
  background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 8px 12px; }
.list-row .ln { font-weight: 600; }
.list-row .lk { color: var(--muted); font-size: 12px; }
.list-acts { display: flex; gap: 6px; }
.add-list { display: grid; grid-template-columns: 1fr 1fr; gap: 8px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 12px; }
.add-list .al-head { grid-column: 1 / -1; }
.add-list select, .add-list input {
  background: var(--surface-2); border: 1px solid var(--border); color: var(--text);
  border-radius: 8px; padding: 9px; font-size: 14px; width: 100%;
}
.add-list select:focus, .add-list input:focus { outline: none; border-color: var(--brand); }
.add-list .al-m3u, .add-list .al-add { grid-column: 1 / -1; }
@media (max-width: 560px) { .add-list { grid-template-columns: 1fr; } }

/* Toast */
.toast {
  position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%);
  background: var(--surface-2); border: 1px solid var(--border); color: var(--text);
  padding: 12px 18px; border-radius: 12px; font-size: 14px; box-shadow: 0 10px 30px rgba(0,0,0,.4); z-index: 20; max-width: 90vw;
}
.toast.ok { border-color: rgba(52,211,153,.5); }
.toast.err { border-color: rgba(248,113,113,.5); }

@media (max-width: 560px) {
  .grid { grid-template-columns: 1fr; }
  .kpis { grid-template-columns: 1fr 1fr; }
}
