/* GHOST · Control Platform — misma paleta que el panel de bots (GhostWeb). */
:root {
  --bg: #070a12; --bg-2: #0b1019;
  --panel: #0f1521; --panel-2: #131a28; --panel-3: #182130;
  --line: #1e2636; --line-strong: #2b3648;
  --text: #eaeff9; --text-dim: #aab6c9; --muted: #7d8aa1;
  --purple: #9a7dff; --purple-2: #b5a1ff; --purple-dim: #6f56d6; --purple-soft: #9a7dff22;
  --mint: #3ee0a6; --red: #ff6f8b; --gold: #f0bd6a; --blue: #66b2ff;
  --radius: 14px; --radius-sm: 10px;
  --shadow: 0 10px 30px -18px #000;
}
* { box-sizing: border-box; }
html, body { background: var(--bg); color: var(--text); font-family: Inter, "Segoe UI", Arial, sans-serif; -webkit-font-smoothing: antialiased; }
body { background-image: radial-gradient(1200px 500px at 85% -10%, #9a7dff14, transparent 60%), radial-gradient(900px 400px at -10% 110%, #3ee0a60c, transparent 60%); min-height: 100vh; }
a { color: var(--purple-2); text-decoration: none; }
a:hover { color: #fff; }
h1, h2, h3, h4 { letter-spacing: .2px; }
h1:focus { outline: none; }
.ico { flex-shrink: 0; }

/* Marca */
.gh-brand { display: flex; align-items: center; gap: 11px; color: var(--text); text-decoration: none; }
.gh-brand:hover { color: var(--text); }
.gh-brand-icon { width: 40px; height: 40px; border: 1px solid #6d5aa866; background: linear-gradient(140deg, #3a2a58, #1a1c30); border-radius: 12px; display: grid; place-items: center; box-shadow: 0 6px 20px -8px #9a7dff88; flex-shrink: 0; }
.gh-brand-icon img { width: 30px; height: 30px; }
.gh-brand-name { font-size: 20px; font-weight: 800; letter-spacing: 2.4px; line-height: 1; }
.gh-brand-sub { display: block; font-size: 8px; color: #6b7a93; letter-spacing: 2.6px; font-weight: 700; margin-top: 5px; }

/* Cabecera pública */
.sp-header { border-bottom: 1px solid var(--line); background: #070a12e6; position: sticky; top: 0; z-index: 20; backdrop-filter: blur(10px); }
.sp-nav { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 16px; flex-wrap: wrap; }
.sp-links { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.sp-links a { color: var(--text-dim); font-weight: 500; font-size: 14px; }
.sp-links a:hover { color: var(--text); }
.sp-main { padding: 34px 16px 64px; min-height: calc(100vh - 150px); }
.sp-footer { border-top: 1px solid var(--line); color: var(--muted); font-size: 13px; padding: 20px 0; }
.sp-footer .container { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }

/* Aplicación con barra lateral (zona de cliente y administración) */
.gh-shell { display: grid; grid-template-columns: 250px minmax(0, 1fr); min-height: 100vh; }
.gh-side { background: #080b13; border-right: 1px solid var(--line); padding: 20px 14px; display: flex; flex-direction: column; gap: 18px; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.gh-side .gh-brand { padding: 0 6px 6px; }
.gh-nav-group { display: flex; flex-direction: column; gap: 2px; }
.gh-nav-title { color: #55637b; font-size: 10.5px; font-weight: 700; letter-spacing: 1.6px; text-transform: uppercase; padding: 0 10px 6px; }
.gh-nav-group a { display: flex; align-items: center; gap: 11px; color: var(--text-dim); padding: 9px 10px; border-radius: 10px; font-size: 14px; font-weight: 500; border: 1px solid transparent; }
.gh-nav-group a:hover { background: var(--panel); color: var(--text); }
.gh-nav-group a.active { background: linear-gradient(90deg, #9a7dff26, #9a7dff08); color: #fff; border-color: #9a7dff40; }
.gh-nav-group a.active .ico { color: var(--purple-2); }
.gh-nav-group a.gh-admin { color: var(--gold); }
.gh-side-foot { margin-top: auto; border-top: 1px solid var(--line); padding-top: 14px; display: flex; flex-direction: column; gap: 10px; }
.gh-user { display: flex; align-items: center; gap: 10px; color: var(--text-dim); font-size: 13px; overflow: hidden; }
.gh-avatar { width: 34px; height: 34px; border-radius: 10px; background: linear-gradient(140deg, #3a2a58, #222a40); display: grid; place-items: center; font-weight: 700; color: var(--purple-2); flex-shrink: 0; }
.gh-user span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gh-content { padding: 26px 32px 64px; min-width: 0; }
.gh-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 22px; flex-wrap: wrap; }
.gh-top h1 { font-size: 24px; font-weight: 800; margin: 0; }
.gh-top p { color: var(--muted); margin: 4px 0 0; }
.gh-mobile-bar { display: none; }

/* Botones */
.btn { border-radius: 10px; font-weight: 600; }
.sp-btn-primary, .btn-primary { background: linear-gradient(135deg, var(--purple), var(--purple-dim)); border: 0; color: #fff; box-shadow: 0 8px 22px -12px #9a7dff; }
.sp-btn-primary:hover, .btn-primary:hover { background: linear-gradient(135deg, var(--purple-2), var(--purple)); color: #fff; }
.btn-ghost { background: var(--panel-2); border: 1px solid var(--line-strong); color: var(--text); }
.btn-ghost:hover { border-color: var(--purple); color: #fff; }

/* Tarjetas y KPIs */
.sp-card { background: linear-gradient(180deg, var(--panel), #0d1220); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow); }
.sp-card + .sp-card { margin-top: 18px; }
.sp-card h2 { font-size: 17px; font-weight: 700; }
.sp-card-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.sp-card-head h2 { margin: 0; display: flex; align-items: center; gap: 9px; }
.sp-card-head h2 .ico { color: var(--purple-2); }
.sp-muted { color: var(--muted); }
.sp-kpis { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); margin-bottom: 18px; }
.sp-kpi { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 16px; display: flex; flex-direction: column; gap: 2px; }
.sp-kpi.kpi-row { flex-direction: row; align-items: center; gap: 14px; }
.sp-kpi .kpi-ico { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; background: var(--purple-soft); color: var(--purple-2); flex-shrink: 0; }
.sp-kpi .kpi-ico.mint { background: #3ee0a61a; color: var(--mint); }
.sp-kpi .kpi-ico.gold { background: #f0bd6a1a; color: var(--gold); }
.sp-kpi .kpi-ico.blue { background: #66b2ff1a; color: var(--blue); }
.sp-kpi span { color: var(--muted); font-size: 12.5px; display: block; }
.sp-kpi strong { display: block; font-size: 24px; line-height: 1.2; }

/* Bienvenida */
.gh-welcome { position: relative; overflow: hidden; border: 1px solid #9a7dff40; background: radial-gradient(600px 220px at 100% 0%, #9a7dff2e, transparent 70%), linear-gradient(180deg, #141a2b, #0e1322); border-radius: 18px; padding: 26px 28px; margin-bottom: 18px; display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap; align-items: center; }
.gh-welcome h1 { font-size: 26px; font-weight: 800; margin: 0 0 6px; }
.gh-welcome p { color: var(--text-dim); margin: 0; max-width: 620px; }
.gh-welcome .gh-ghost-art { width: 92px; height: 92px; opacity: .95; filter: drop-shadow(0 12px 28px #9a7dff66); }

/* Licencias */
.gh-licenses { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.gh-license { background: var(--panel-2); border: 1px solid var(--line); border-radius: 14px; padding: 18px; display: flex; flex-direction: column; gap: 12px; }
.gh-license.trial { border-color: #66b2ff40; }
.gh-license-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.gh-license-head h3 { font-size: 16px; font-weight: 700; margin: 0; }
.gh-license-head small { color: var(--muted); }
.gh-meta { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.gh-meta div { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; }
.gh-meta span { display: block; color: var(--muted); font-size: 11px; }
.gh-meta b { font-size: 15px; }
.gh-progress { height: 8px; background: #1a2233; border-radius: 99px; overflow: hidden; }
.gh-progress i { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--purple-dim), var(--purple-2)); }
.gh-progress.warn i { background: linear-gradient(90deg, #c98a2b, var(--gold)); }
.gh-progress.bad i { background: linear-gradient(90deg, #b23b55, var(--red)); }
.gh-license-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* Pasos de puesta en marcha */
.gh-steps { display: grid; gap: 10px; }
.gh-step { display: flex; gap: 14px; align-items: center; background: var(--panel-2); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; }
.gh-step .num { width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; font-weight: 800; background: #1d2536; color: var(--muted); flex-shrink: 0; }
.gh-step.done .num { background: #3ee0a61f; color: var(--mint); }
.gh-step.now { border-color: #9a7dff55; }
.gh-step.now .num { background: var(--purple-soft); color: var(--purple-2); }
.gh-step b { display: block; font-size: 14px; }
.gh-step small { color: var(--muted); }
.gh-step .gh-step-tag { margin-left: auto; }

/* Tablas, píldoras y formularios */
.sp-table { width: 100%; border-collapse: collapse; }
.sp-table th, .sp-table td { padding: 11px 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; font-size: 14px; }
.sp-table th { color: var(--muted); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: .6px; }
.sp-table tbody tr:hover { background: #ffffff05; }
.sp-table-wrap { overflow-x: auto; }
.sp-pill { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; background: var(--panel-3); color: var(--text-dim); white-space: nowrap; }
.sp-pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .8; }
.sp-pill.ok { background: #3ee0a61a; color: var(--mint); }
.sp-pill.warn { background: #f0bd6a1a; color: var(--gold); }
.sp-pill.bad { background: #ff6f8b1a; color: var(--red); }
.sp-pill.accent { background: var(--purple-soft); color: var(--purple-2); }
.sp-pill.blue { background: #66b2ff1a; color: var(--blue); }
.form-control, .form-select { background: #0a0f1a; border: 1px solid var(--line-strong); color: var(--text); border-radius: 10px; }
.form-control:focus, .form-select:focus { background: #0c1220; color: var(--text); border-color: var(--purple); box-shadow: 0 0 0 3px var(--purple-soft); }
.form-control::placeholder { color: #55637b; }
.form-floating > label { color: var(--muted); }
.form-label { color: var(--text-dim); font-size: 13px; }
.sp-alert { border-radius: 12px; padding: 12px 14px; margin-bottom: 14px; }
.sp-alert.ok { background: #3ee0a614; border: 1px solid #3ee0a655; }
.sp-alert.bad { background: #ff6f8b14; border: 1px solid #ff6f8b55; }
.sp-alert.info { background: var(--purple-soft); border: 1px solid #9a7dff55; }
.validation-message, .text-danger { color: var(--red) !important; }
.sp-empty { text-align: center; padding: 26px 10px; color: var(--muted); }
.sp-empty .ico { color: var(--purple-2); margin-bottom: 8px; }

/* Portada */
.sp-hero { text-align: center; padding: 56px 0 36px; }
.sp-hero .gh-hero-logo { width: 88px; height: 88px; margin: 0 auto 18px; border-radius: 24px; }
.sp-hero .gh-hero-logo img { width: 64px; height: 64px; }
.sp-hero h1 { font-size: clamp(30px, 5vw, 50px); font-weight: 800; line-height: 1.12; }
.sp-hero h1 span { background: linear-gradient(90deg, var(--purple-2), var(--mint)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.sp-hero p { color: var(--text-dim); font-size: 18px; max-width: 720px; margin: 16px auto 26px; }
.sp-grid { display: grid; gap: 18px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.sp-feature .ico { color: var(--purple-2); margin-bottom: 10px; }
.sp-feature h3 { font-size: 17px; font-weight: 700; margin-bottom: 6px; }
.sp-plan { position: relative; display: flex; flex-direction: column; gap: 8px; }
.sp-plan.featured { border-color: var(--purple); box-shadow: 0 0 0 1px var(--purple) inset, 0 20px 50px -30px #9a7dff; }
.sp-plan .sp-badge { position: absolute; top: -11px; right: 16px; background: linear-gradient(135deg, var(--purple), var(--purple-dim)); color: #fff; font-size: 12px; padding: 3px 12px; border-radius: 999px; }
.sp-plan .price { font-size: 38px; font-weight: 800; }
.sp-plan .price small { font-size: 15px; color: var(--muted); font-weight: 500; }
.sp-plan ul { padding-left: 18px; color: var(--text-dim); margin: 6px 0 12px; }
.sp-section-title { font-size: 26px; font-weight: 800; margin: 44px 0 18px; }
.sp-choice { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.sp-choice label { background: var(--panel-2); border: 1px solid var(--line); border-radius: 12px; padding: 14px; cursor: pointer; display: block; }
.sp-choice input { margin-right: 8px; accent-color: var(--purple); }
.sp-choice label:has(input:checked) { border-color: var(--purple); box-shadow: 0 0 0 1px var(--purple) inset; background: #9a7dff10; }
.sp-auth { max-width: 470px; margin: 0 auto; }
.sp-admin-nav { display: none; }

#blazor-error-ui { background: #3a1f24; bottom: 0; display: none; left: 0; padding: .6rem 1.25rem; position: fixed; width: 100%; z-index: 1000; color: #fff; }
#blazor-error-ui .dismiss { cursor: pointer; position: absolute; right: .75rem; top: .5rem; }
.darker-border-checkbox.form-check-input { border-color: #929292; }

@media (max-width: 700px) {
  .gh-welcome .gh-ghost-art { display: none; }
  .sp-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sp-kpi.kpi-row { flex-direction: column; align-items: flex-start; gap: 8px; }
}
@media (max-width: 900px) {
  .gh-shell { grid-template-columns: 1fr; }
  .gh-side { position: static; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; gap: 10px; padding: 12px 16px; border-right: 0; border-bottom: 1px solid var(--line); }
  .gh-nav-title, .gh-side-foot .gh-user { display: none; }
  .gh-nav-group { flex-direction: row; flex-wrap: wrap; }
  .gh-side-foot { margin-top: 0; border-top: 0; padding-top: 0; flex-direction: row; }
  .gh-content { padding: 20px 16px 48px; }
  .gh-meta { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

.sp-grid > .sp-card + .sp-card, .gh-licenses > * + *, .row > * > .sp-card + .sp-card { margin-top: 0; }
