/* Flujo TV — Panel de licencias */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@400;500;600;700&display=swap');

:root {
  --bg: #07070c;
  --bg2: #0e0e16;
  --bg3: #151522;
  --surface: #1a1a28;
  --border: #2a2a3a;
  --border-soft: #222233;
  --text: #e6e6ea;
  --muted: #8a8a99;
  --primary: #071265;
  --primary-hover: #0a1a88;
  --accent: #e11d2a;
  --accent-soft: rgba(225, 29, 42, 0.15);
  --orange: #ffa726;
  --success: #2ea043;
  --success-soft: rgba(46, 160, 67, 0.15);
  --danger: #da3633;
  --danger-soft: rgba(218, 54, 51, 0.15);
  --radius: 12px;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.45);
  --font: "Outfit", system-ui, sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  min-height: 100%;
}

body {
  font-family: var(--font);
  color: var(--text);
  background:
    radial-gradient(1200px 600px at 10% -10%, rgba(7, 18, 101, 0.45), transparent 55%),
    radial-gradient(900px 500px at 100% 0%, rgba(225, 29, 42, 0.18), transparent 50%),
    linear-gradient(180deg, #0a0a12 0%, var(--bg) 40%, #050508 100%);
  background-attachment: fixed;
}

a { color: var(--orange); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ——— Layout ——— */
.shell {
  width: min(1100px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 48px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 28px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-mark {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  background: linear-gradient(145deg, var(--accent), #8b0f18 55%, var(--primary));
  box-shadow: 0 0 0 1px rgba(255,255,255,0.06), 0 8px 24px rgba(225, 29, 42, 0.25);
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 0.02em;
}

.brand-text strong {
  display: block;
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.brand-text span {
  display: block;
  color: var(--muted);
  font-size: 0.82rem;
  margin-top: 2px;
}

/* ——— Cards ——— */
.card {
  background: linear-gradient(180deg, rgba(26, 26, 40, 0.95), rgba(14, 14, 22, 0.98));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 22px 24px;
}

.card + .card { margin-top: 18px; }

.card-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.card-head h2 {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 600;
}

.card-head p,
.hint {
  margin: 0;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.45;
}

.hint { margin-bottom: 14px; }

/* ——— Login ——— */
.login-wrap {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.login-card {
  width: min(420px, 100%);
  padding: 32px 28px 28px;
  position: relative;
  overflow: hidden;
}

.login-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 3px;
  background: linear-gradient(90deg, var(--accent), var(--primary), var(--orange));
}

.login-card .brand {
  margin-bottom: 22px;
}

.login-card h1 {
  margin: 0 0 6px;
  font-size: 1.45rem;
  font-weight: 700;
}

.login-card .sub {
  margin: 0 0 22px;
  color: var(--muted);
  font-size: 0.92rem;
}

/* ——— Forms ——— */
label {
  display: block;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--muted);
  margin: 12px 0 6px;
}

input[type="text"],
input[type="password"],
textarea {
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 12px 14px;
  color: var(--text);
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 10px;
  font: inherit;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}

textarea { resize: vertical; min-height: 72px; }

input:focus,
textarea:focus {
  border-color: #2a3a9a;
  box-shadow: 0 0 0 3px rgba(7, 18, 101, 0.35);
}

.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 16px;
}

@media (max-width: 720px) {
  .grid-2 { grid-template-columns: 1fr; }
  .topbar { flex-direction: column; align-items: flex-start; }
}

/* ——— Buttons ——— */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 0;
  padding: 11px 18px;
  width: auto;
  max-width: none;
  border: 0;
  border-radius: 10px;
  font: inherit;
  font-weight: 600;
  font-size: 0.92rem;
  cursor: pointer;
  transition: transform .12s, background .15s, opacity .15s;
}

.btn:active { transform: translateY(1px); }

.btn-primary {
  color: #fff;
  background: linear-gradient(180deg, #e83a45, var(--accent));
  box-shadow: 0 8px 20px rgba(225, 29, 42, 0.28);
}

.btn-primary:hover { filter: brightness(1.06); }

.btn-secondary {
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
}

.btn-secondary:hover { background: #222233; }

.btn-ghost {
  color: var(--muted);
  background: transparent;
  border: 1px solid var(--border);
}

.btn-ghost:hover { color: var(--text); border-color: #3a3a4a; }

.btn-success {
  color: #fff;
  background: var(--success);
}

.btn-danger {
  color: #fff;
  background: var(--danger);
}

.btn-block {
  width: 100%;
  margin-top: 18px;
}

.btn-sm {
  padding: 7px 12px;
  font-size: 0.8rem;
  border-radius: 8px;
}

/* ——— Alerts ——— */
.alert {
  padding: 12px 14px;
  border-radius: 10px;
  font-size: 0.9rem;
  margin-bottom: 16px;
  border: 1px solid transparent;
}

.alert-ok {
  color: #9be6a8;
  background: var(--success-soft);
  border-color: rgba(46, 160, 67, 0.35);
}

.alert-err {
  color: #ffb4b0;
  background: var(--danger-soft);
  border-color: rgba(218, 54, 51, 0.4);
}

/* ——— Table ——— */
.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border-soft);
  border-radius: 10px;
}

table {
  width: 100%;
  max-width: none;
  margin: 0;
  border-collapse: collapse;
}

th, td {
  border: 0;
  border-bottom: 1px solid var(--border-soft);
  padding: 12px 14px;
  text-align: left;
  font-size: 0.86rem;
  vertical-align: top;
}

th {
  background: rgba(7, 18, 101, 0.35);
  color: #c8c8d8;
  font-weight: 600;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

tr:last-child td { border-bottom: 0; }

tbody tr {
  background: transparent;
  transition: background .12s;
}

tbody tr:hover { background: rgba(255, 255, 255, 0.025); }

code, .mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.78rem;
  word-break: break-all;
  color: #d0d0e0;
}

.fp-cell small {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 0.82rem;
  word-break: break-word;
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.badge-on {
  color: #9be6a8;
  background: var(--success-soft);
  border: 1px solid rgba(46, 160, 67, 0.35);
}

.badge-off {
  color: #ffb4b0;
  background: var(--danger-soft);
  border: 1px solid rgba(218, 54, 51, 0.35);
}

.actions form {
  display: inline;
  margin: 0;
}

.action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.stats {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 18px;
}

.stat {
  flex: 1 1 140px;
  background: var(--bg3);
  border: 1px solid var(--border-soft);
  border-radius: 10px;
  padding: 12px 14px;
}

.stat b {
  display: block;
  font-size: 1.35rem;
  font-weight: 700;
}

.stat span {
  color: var(--muted);
  font-size: 0.78rem;
}

.footer-note {
  margin-top: 22px;
  color: var(--muted);
  font-size: 0.78rem;
  text-align: center;
}

/* ——— Modal ——— */
body.modal-open {
  overflow: hidden;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(4px);
}

.modal-backdrop[hidden] {
  display: none !important;
}

.modal {
  width: min(560px, 100%);
  max-height: min(90vh, 720px);
  overflow: auto;
  background: linear-gradient(180deg, #1a1a28, #101018);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: var(--shadow);
  padding: 20px 22px 22px;
}

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.modal-head h2 {
  margin: 0;
  font-size: 1.15rem;
}

.modal-close {
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
}

.modal-close:hover {
  color: var(--text);
  background: var(--surface);
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 18px;
}

.check-row {
  display: flex !important;
  align-items: center;
  gap: 10px;
  margin-top: 16px;
  color: var(--text);
  font-size: 0.92rem;
  cursor: pointer;
}

.check-row input {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
}
