/* ============================================================
   SITW - Panel de cliente
   ============================================================ */

.sitw-client-panel {
  --scp-bg: #08080d;
  --scp-panel: rgba(255,255,255,0.045);
  --scp-panel-strong: rgba(255,255,255,0.075);
  --scp-border: rgba(255,255,255,0.09);
  --scp-border-strong: rgba(155,48,255,0.28);
  --scp-text: rgba(255,255,255,0.92);
  --scp-muted: rgba(255,255,255,0.58);
  --scp-dim: rgba(255,255,255,0.36);
  --scp-accent: #9b30ff;
  --scp-accent-soft: rgba(155,48,255,0.11);
  --scp-green: #78e0ad;
  --scp-yellow: #ffd166;
  min-height: 100vh;
  padding: clamp(22px, 4vw, 64px);
  background:
    radial-gradient(circle at 84% 8%, rgba(155,48,255,0.14), transparent 30%),
    radial-gradient(circle at 8% 50%, rgba(120,224,173,0.06), transparent 26%),
    linear-gradient(180deg, #08080d 0%, #0b0b12 100%);
  color: var(--scp-text);
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  overflow-x: clip;
}

.sitw-client-panel *,
.sitw-client-panel *::before,
.sitw-client-panel *::after {
  box-sizing: border-box;
}

.sitw-client-panel :where(h1, h2, h3, p) {
  margin-top: 0;
}

.scp-kicker {
  margin: 0 0 14px;
  color: var(--scp-accent);
  font-family: "Share Tech Mono", "Courier New", monospace;
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.scp-hero,
.scp-grid,
.scp-workbench,
.scp-history,
.scp-auth-shell,
.sitw-client-panel .sitw-panel-alert {
  width: min(1180px, 100%);
  margin-inline: auto;
}

.scp-hero,
.scp-auth-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: clamp(24px, 5vw, 56px);
  align-items: center;
  min-height: min(760px, 80vh);
  padding: clamp(34px, 6vw, 72px) 0;
}

.scp-hero h1,
.scp-auth-copy h1 {
  max-width: 780px;
  margin-bottom: 20px;
  color: #fff;
  font-size: clamp(42px, 7vw, 82px);
  line-height: 0.96;
  letter-spacing: -0.055em;
}

.scp-hero p,
.scp-auth-copy p,
.scp-workbench-copy p {
  max-width: 720px;
  color: var(--scp-muted);
  font-size: clamp(15px, 1.5vw, 18px);
  line-height: 1.72;
}

.scp-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 28px;
}

.scp-btn,
.scp-inline-action,
.scp-dialog-close {
  border: 0;
  font: inherit;
  cursor: pointer;
}

.scp-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0 24px;
  border-radius: 999px;
  text-decoration: none !important;
  font-size: 14px;
  font-weight: 700;
  transition: transform .22s ease, border-color .22s ease, background .22s ease, color .22s ease, opacity .22s ease;
}

.scp-btn-primary {
  background: #fff;
  color: #08080d !important;
  box-shadow: 0 18px 46px rgba(0,0,0,0.28);
}

.scp-btn-ghost {
  border: 1px solid var(--scp-border);
  background: rgba(255,255,255,0.035);
  color: var(--scp-text) !important;
}

.scp-btn:hover,
.scp-inline-action:hover {
  transform: translateY(-2px);
}

.scp-btn:disabled,
.scp-inline-action:disabled {
  cursor: not-allowed;
  opacity: .42;
  transform: none;
}

.scp-quota-card,
.scp-auth-card {
  position: relative;
  overflow: hidden;
  padding: 30px;
  border: 1px solid var(--scp-border);
  border-radius: 28px;
  background: linear-gradient(145deg, rgba(255,255,255,0.075), rgba(255,255,255,0.025));
  box-shadow: 0 28px 80px rgba(0,0,0,0.3);
}

.scp-quota-card::before,
.scp-auth-card::before {
  content: "";
  position: absolute;
  inset: -1px;
  pointer-events: none;
  background: radial-gradient(circle at 90% 0%, rgba(155,48,255,0.24), transparent 42%);
}

.scp-quota-card > *,
.scp-auth-card > * {
  position: relative;
  z-index: 1;
}

.scp-quota-card span,
.scp-auth-card span,
.scp-module-tag {
  display: inline-flex;
  width: fit-content;
  margin-bottom: 18px;
  color: var(--scp-dim);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.scp-quota-card strong {
  display: block;
  margin-bottom: 14px;
  color: #fff;
  font-size: clamp(48px, 7vw, 76px);
  line-height: 1;
  letter-spacing: -0.08em;
}

.scp-quota-card p,
.scp-auth-card li {
  color: var(--scp-muted);
  font-size: 14px;
  line-height: 1.65;
}

.scp-quota-available {
  border-color: rgba(120,224,173,0.28);
}

.scp-quota-used {
  border-color: rgba(255,209,102,0.3);
}

.scp-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 18px;
}

.scp-module,
.scp-workbench,
.scp-history {
  border: 1px solid var(--scp-border);
  border-radius: 24px;
  background: var(--scp-panel);
  backdrop-filter: blur(12px);
}

.scp-module {
  min-height: 270px;
  padding: 24px;
}

.scp-module-featured {
  grid-column: span 2;
  background: linear-gradient(145deg, rgba(155,48,255,0.12), rgba(255,255,255,0.035));
}

.scp-module h2,
.scp-workbench h2,
.scp-history h2,
.scp-change-dialog h2 {
  margin-bottom: 12px;
  color: #fff;
  font-size: clamp(23px, 2.4vw, 34px);
  line-height: 1.06;
  letter-spacing: -0.035em;
}

.scp-module p,
.scp-module small,
.scp-history span {
  color: var(--scp-muted);
  font-size: 14px;
  line-height: 1.6;
}

.scp-site-row {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  margin-top: 28px;
  padding: 16px;
  border: 1px solid var(--scp-border);
  border-radius: 16px;
  background: rgba(0,0,0,0.16);
}

.scp-site-row strong,
.scp-site-row small {
  display: block;
}

.scp-site-row span {
  align-self: flex-start;
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(120,224,173,0.12);
  color: var(--scp-green);
  font-size: 12px;
  font-weight: 700;
}

.scp-mini-list,
.scp-auth-card ul {
  list-style: none;
  display: grid;
  gap: 10px;
  margin: 22px 0 0;
  padding: 0;
}

.scp-mini-list li,
.scp-auth-card li {
  position: relative;
  padding-left: 18px;
}

.scp-mini-list li::before,
.scp-auth-card li::before {
  content: "";
  position: absolute;
  left: 0;
  top: .68em;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--scp-accent);
}

.scp-inline-action {
  margin-top: 18px;
  padding: 0;
  background: transparent;
  color: #fff;
  font-weight: 800;
  text-decoration: underline;
  text-underline-offset: 5px;
}

.scp-workbench {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 380px;
  gap: 30px;
  align-items: center;
  padding: clamp(26px, 4vw, 44px);
  margin-bottom: 18px;
}

.scp-workbench-steps {
  display: grid;
  gap: 10px;
}

.scp-workbench-steps span {
  padding: 14px 16px;
  border: 1px solid var(--scp-border);
  border-radius: 14px;
  background: rgba(255,255,255,0.035);
  color: var(--scp-text);
  font-size: 14px;
}

.scp-history {
  padding: clamp(24px, 4vw, 38px);
}

.scp-history-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.scp-history-list article {
  padding: 16px;
  border: 1px solid var(--scp-border);
  border-radius: 16px;
  background: rgba(255,255,255,0.035);
}

.scp-history-list strong,
.scp-history-list span {
  display: block;
}

.sitw-panel-alert {
  margin-bottom: 18px;
  padding: 15px 18px;
  border-radius: 16px;
  font-size: 14px;
  line-height: 1.5;
}

.sitw-panel-alert-success {
  border: 1px solid rgba(120,224,173,0.28);
  background: rgba(120,224,173,0.1);
  color: rgba(220,255,236,0.95);
}

.sitw-panel-alert-warning {
  border: 1px solid rgba(255,209,102,0.32);
  background: rgba(255,209,102,0.1);
  color: rgba(255,240,198,0.95);
}

.scp-change-dialog {
  width: min(920px, calc(100% - 28px));
  max-height: min(840px, calc(100vh - 28px));
  padding: 0;
  border: 1px solid var(--scp-border-strong);
  border-radius: 28px;
  background: #101018;
  color: var(--scp-text);
  box-shadow: 0 34px 120px rgba(0,0,0,0.62);
}

.scp-change-dialog::backdrop {
  background: rgba(0,0,0,0.72);
  backdrop-filter: blur(6px);
}

.scp-change-form {
  padding: clamp(22px, 4vw, 38px);
}

.scp-dialog-head {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 24px;
}

.scp-dialog-head p {
  max-width: 620px;
  color: var(--scp-muted);
  line-height: 1.6;
}

.scp-dialog-close {
  align-self: flex-start;
  padding: 10px 14px;
  border: 1px solid var(--scp-border);
  border-radius: 999px;
  background: rgba(255,255,255,0.045);
  color: var(--scp-text);
  font-size: 13px;
}

.scp-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.scp-change-form label {
  display: grid;
  gap: 8px;
  color: rgba(255,255,255,0.78);
  font-size: 13px;
  font-weight: 700;
}

.scp-change-form input,
.scp-change-form select,
.scp-change-form textarea {
  width: 100%;
  border: 1px solid var(--scp-border);
  border-radius: 14px;
  background: rgba(0,0,0,0.24);
  color: #fff;
  font: inherit;
  font-size: 14px;
  outline: none;
}

.scp-change-form input,
.scp-change-form select {
  min-height: 48px;
  padding: 0 14px;
}

.scp-change-form textarea {
  min-height: 150px;
  padding: 14px;
  resize: vertical;
}

.scp-change-form input:focus,
.scp-change-form select:focus,
.scp-change-form textarea:focus {
  border-color: rgba(155,48,255,0.62);
  box-shadow: 0 0 0 3px rgba(155,48,255,0.12);
}

.scp-full-label,
.scp-confirmation {
  margin-top: 14px;
}

.scp-confirmation {
  display: flex !important;
  grid-template-columns: auto 1fr;
  align-items: flex-start;
  gap: 12px !important;
  padding: 15px;
  border: 1px solid rgba(255,209,102,0.28);
  border-radius: 16px;
  background: rgba(255,209,102,0.08);
}

.scp-confirmation input {
  width: 18px;
  min-height: 18px;
  margin-top: 2px;
}

.scp-confirmation span {
  color: rgba(255,244,210,0.9);
  font-size: 13px;
  line-height: 1.55;
}

.scp-dialog-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 20px;
}

@media (max-width: 980px) {
  .scp-hero,
  .scp-auth-shell,
  .scp-workbench {
    grid-template-columns: 1fr;
  }

  .scp-grid {
    grid-template-columns: 1fr 1fr;
  }

  .scp-module-featured {
    grid-column: span 2;
  }

  .scp-history-list {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .sitw-client-panel {
    padding: 18px;
  }

  .scp-hero,
  .scp-auth-shell {
    min-height: auto;
  }

  .scp-grid,
  .scp-form-grid {
    grid-template-columns: 1fr;
  }

  .scp-module-featured {
    grid-column: auto;
  }

  .scp-module,
  .scp-quota-card,
  .scp-auth-card,
  .scp-workbench,
  .scp-history {
    border-radius: 20px;
  }

  .scp-site-row,
  .scp-dialog-head {
    flex-direction: column;
  }

  .scp-btn {
    width: 100%;
  }
}

/* ============================================================
   Integración con el tema (full-bleed) + iconos de módulos
   ============================================================ */

/* El panel ocupa todo el ancho aunque Astra lo encajone */
body.sitw-client-panel-page .entry-header,
body.sitw-client-panel-page .ast-breadcrumbs,
body.sitw-client-panel-page .ast-breadcrumbs-wrapper { display: none !important; }

body.sitw-client-panel-page #content,
body.sitw-client-panel-page #content .ast-container,
body.sitw-client-panel-page #primary,
body.sitw-client-panel-page .entry-content {
  max-width: 100% !important;
  width: 100% !important;
  margin: 0 !important;
  padding: 0 !important;
}

body.sitw-client-panel-page .site-content { padding-top: 0 !important; }

/* Refuerzo: si algún contenedor mantiene ancho, rompemos a viewport completo */
.sitw-client-panel {
  width: 100vw;
  max-width: 100vw;
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);
}

/* Iconos de los módulos (coherentes con el lenguaje visual del sitio) */
.scp-module-ico {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  margin-bottom: 16px;
  border: 1px solid var(--scp-border);
  border-radius: 14px;
  color: rgba(255,255,255,0.92);
  background: linear-gradient(150deg, rgba(155,48,255,0.12), rgba(255,255,255,0.02));
  transition: transform .3s ease, border-color .3s ease, box-shadow .3s ease, background .3s ease;
}
.scp-module-ico svg { width: 24px; height: 24px; display: block; }
.scp-module-ico .scp-ico-accent { color: var(--scp-accent); }

/* Micro-interacciones de tarjetas (igual que el resto del sitio) */
.scp-module { transition: transform .3s ease, border-color .3s ease, box-shadow .3s ease; }
.scp-module:hover {
  transform: translateY(-4px);
  border-color: var(--scp-border-strong);
  box-shadow: 0 22px 50px -26px rgba(155,48,255,0.55);
}
.scp-module:hover .scp-module-ico {
  transform: translateY(-2px) scale(1.05);
  border-color: rgba(155,48,255,0.5);
  box-shadow: 0 0 0 4px rgba(155,48,255,0.09);
  background: linear-gradient(150deg, rgba(155,48,255,0.22), rgba(255,255,255,0.03));
}

@media (prefers-reduced-motion: reduce) {
  .scp-module, .scp-module-ico { transition: none; }
  .scp-module:hover { transform: none; }
  .scp-module:hover .scp-module-ico { transform: none; }
}
