/* =========================================================
   Panel Control Cloud — Estilos
   ========================================================= */

:root {
  --bg:        #0f172a;
  --bg-soft:   #1e293b;
  --bg-card:   #ffffff;
  --primary:   #6366f1;
  --primary-d: #4f46e5;
  --accent:    #f59e0b;
  --text:      #0f172a;
  --text-mut:  #6b7280;
  --text-lt:   #9ca3af;
  --border:    #e5e7eb;
  --ok:        #10b981;
  --ok-bg:     #d1fae5;
  --warn:      #f59e0b;
  --warn-bg:   #fef3c7;
  --err:       #dc2626;
  --err-bg:    #fee2e2;
  --radius:    10px;
  --radius-lg: 14px;
  --shadow:    0 1px 3px rgba(15, 23, 42, 0.06), 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow-lg: 0 10px 25px rgba(15, 23, 42, 0.08), 0 4px 10px rgba(15, 23, 42, 0.04);
}

* { box-sizing: border-box; }
html, body {
  margin: 0; padding: 0;
  font-family: 'Inter', -apple-system, 'Segoe UI', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
}
body { min-height: 100vh; }

/* ============ Login ============ */
body.login-page {
  background: linear-gradient(160deg, #0f172a 0%, #1e293b 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.login-card {
  background: #fff;
  border-radius: var(--radius-lg);
  padding: 36px 32px;
  width: 100%;
  max-width: 380px;
  box-shadow: var(--shadow-lg);
}
.login-logo {
  font-size: 32px;
  text-align: center;
  font-weight: 800;
  color: var(--primary);
  margin-bottom: 4px;
  letter-spacing: -0.02em;
}
.login-sub {
  text-align: center;
  color: var(--text-mut);
  font-size: 13px;
  margin-bottom: 28px;
}
.login-card label {
  display: block;
  font-weight: 600;
  font-size: 13px;
  color: var(--text);
  margin: 14px 0 6px;
}
.login-card input {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 14px;
  background: #f9fafb;
}
.login-card input:focus { outline: none; border-color: var(--primary); background: #fff; }
.login-card button {
  width: 100%;
  margin-top: 22px;
  padding: 12px;
  border: 0;
  border-radius: var(--radius);
  background: var(--primary);
  color: #fff;
  font-weight: 600;
  cursor: pointer;
  font-size: 14px;
}
.login-card button:hover { background: var(--primary-d); }
.login-card .err {
  margin-top: 14px;
  background: var(--err-bg);
  color: var(--err);
  border: 1px solid var(--err);
  padding: 10px 12px;
  border-radius: var(--radius);
  font-size: 13px;
  display: none;
}

/* ============ App layout ============ */
body.app-page { background: #f8fafc; }
.topbar {
  background: var(--bg);
  color: #fff;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
  position: sticky; top: 0; z-index: 50;
}
.topbar .brand { display: flex; align-items: center; gap: 10px; font-weight: 700; }
.topbar .brand-mark {
  width: 32px; height: 32px;
  background: linear-gradient(135deg, var(--primary), var(--primary-d));
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 800; font-size: 13px;
}
.topbar .brand-title { font-size: 15px; }
.topbar .brand-sub { font-size: 11px; color: rgba(255,255,255,0.6); margin-left: 6px; }
.topbar nav { display: flex; gap: 4px; }
.topbar nav a {
  color: rgba(255,255,255,0.7);
  text-decoration: none;
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
}
.topbar nav a:hover { background: rgba(255,255,255,0.06); color: #fff; }
.topbar nav a.active { background: rgba(255,255,255,0.1); color: #fff; }
.topbar .actions a {
  color: rgba(255,255,255,0.65);
  text-decoration: none;
  font-size: 13px;
  padding: 8px 12px;
  border-radius: 8px;
  background: rgba(255,255,255,0.06);
}
.topbar .actions a:hover { background: rgba(255,255,255,0.12); color: #fff; }

main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 28px 24px 60px;
}

h1, h2, h3 { color: var(--text); margin: 0 0 16px; font-weight: 700; }
h1 { font-size: 22px; }
h2 { font-size: 18px; }
h3 { font-size: 15px; }

.btn-primary {
  background: var(--primary); color: #fff; border: 0;
  padding: 10px 18px; border-radius: var(--radius);
  font-weight: 600; cursor: pointer; font-size: 13px;
  text-decoration: none; display: inline-block;
}
.btn-primary:hover { background: var(--primary-d); }
.btn-sec {
  background: #fff; color: var(--text); border: 1px solid var(--border);
  padding: 10px 18px; border-radius: var(--radius);
  font-weight: 600; cursor: pointer; font-size: 13px;
  text-decoration: none; display: inline-block;
}
.btn-sec:hover { background: #f9fafb; }
.btn-danger {
  background: var(--err); color: #fff; border: 0;
  padding: 10px 18px; border-radius: var(--radius);
  font-weight: 600; cursor: pointer; font-size: 13px;
}
.btn-danger:hover { background: #b91c1c; }
.btn-mini {
  background: #fff; color: var(--text); border: 1px solid var(--border);
  padding: 4px 10px; border-radius: 6px;
  font-size: 12px; cursor: pointer;
}
.btn-mini:hover { background: #f9fafb; }
button:disabled { opacity: 0.5; cursor: not-allowed; }

/* ============ Tabla ============ */
.card-list {
  background: #fff;
  border-radius: var(--radius-lg);
  padding: 16px;
  box-shadow: var(--shadow);
}
table.data { width: 100%; border-collapse: collapse; font-size: 14px; }
table.data thead th {
  text-align: left;
  padding: 10px 12px;
  font-weight: 600;
  color: var(--text-mut);
  border-bottom: 1px solid var(--border);
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
table.data tbody td { padding: 14px 12px; border-bottom: 1px solid var(--border); }
table.data tbody tr:hover { background: #f9fafb; cursor: pointer; }
table.data tbody tr:last-child td { border-bottom: 0; }
.empty { color: var(--text-lt); padding: 30px; text-align: center; }

/* Status pills */
.pill { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 11px; font-weight: 600; }
.pill-ok    { background: var(--ok-bg);   color: #065f46; }
.pill-warn  { background: var(--warn-bg); color: #92400e; }
.pill-err   { background: var(--err-bg);  color: #991b1b; }
.pill-mut   { background: #f3f4f6;        color: #4b5563; }

/* Page header con acciones */
.page-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 22px;
}

/* ============ Form crear ============ */
.wizard {
  background: #fff;
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow);
  max-width: 720px;
  margin: 0 auto;
}
.wizard-step { display: none; }
.wizard-step.active { display: block; }
.wizard-progress {
  display: flex; gap: 8px;
  margin-bottom: 24px;
  font-size: 12px;
  color: var(--text-mut);
}
.wizard-progress .step {
  flex: 1;
  padding: 6px 10px;
  background: #f3f4f6;
  border-radius: 6px;
  text-align: center;
}
.wizard-progress .step.active {
  background: var(--primary);
  color: #fff;
  font-weight: 600;
}

.wizard label {
  display: block; font-weight: 600; font-size: 13px; color: var(--text);
  margin: 16px 0 6px;
}
.wizard input[type="text"], .wizard input[type="url"], .wizard textarea {
  width: 100%; padding: 11px 14px;
  border: 1px solid var(--border); border-radius: var(--radius);
  font-size: 14px; background: #f9fafb;
}
.wizard input:focus, .wizard textarea:focus { outline: none; border-color: var(--primary); background: #fff; }

.wizard-buttons { display: flex; justify-content: space-between; gap: 10px; margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--border); }
.row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

/* Color pickers */
.color-row { display: flex; align-items: center; gap: 10px; }
.color-row input[type="color"] {
  width: 50px; height: 38px;
  border: 1px solid var(--border);
  border-radius: 6px; padding: 2px; cursor: pointer;
}
.color-row input[type="text"] {
  flex: 1; font-family: 'SFMono-Regular', Consolas, monospace;
  font-size: 13px; text-transform: uppercase;
}

/* Análisis del sitio web (resultado) */
.analizar-result {
  margin-top: 14px;
  padding: 14px;
  background: #fef9e7;
  border: 1px solid #fde68a;
  border-radius: var(--radius);
  font-size: 13px;
}
.analizar-result h4 { margin: 0 0 10px; font-size: 14px; }
.analizar-result .colores-grid { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.color-chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 8px; background: #fff;
  border: 1px solid var(--border); border-radius: 999px;
  font-family: monospace; font-size: 11px; cursor: pointer;
}
.color-chip:hover { border-color: var(--primary); }
.color-chip .swatch {
  width: 12px; height: 12px; border-radius: 50%;
  border: 1px solid rgba(0,0,0,0.15);
}

/* Mensajes */
.msg {
  margin-top: 16px; padding: 12px 14px;
  border-radius: var(--radius); font-size: 14px;
  display: none;
}
.msg.show { display: block; }
.msg.ok   { background: var(--ok-bg);  color: #065f46; border: 1px solid var(--ok); }
.msg.err  { background: var(--err-bg); color: #991b1b; border: 1px solid var(--err); }
.msg.warn { background: var(--warn-bg); color: #92400e; border: 1px solid var(--warn); }

/* Resultado final de creación */
.result-card {
  background: #fff; border: 2px solid var(--ok); border-radius: var(--radius-lg);
  padding: 22px; margin-top: 20px;
}
.result-card h3 { color: var(--ok); }
.cred-line {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px; background: #f9fafb;
  border-radius: var(--radius); margin-top: 10px;
  font-family: monospace; font-size: 14px;
}
.cred-line strong { color: var(--text-mut); font-family: inherit; }
.cred-line .copy-btn { margin-left: auto; }

/* Vista previa branding (mock) */
.brand-preview {
  margin-top: 18px;
  border: 1px solid var(--border); border-radius: var(--radius);
  overflow: hidden;
  background: #fff;
}
.brand-preview-head {
  background: var(--bp-primary, #1f2937);
  color: #fff;
  padding: 12px 14px;
  display: flex; gap: 10px; align-items: center;
}
.brand-preview-head img { width: 36px; height: 36px; object-fit: contain; background: rgba(255,255,255,0.1); border-radius: 6px; padding: 3px; }
.brand-preview-head .name { font-weight: 700; font-size: 14px; }
.brand-preview-head .tagline { font-size: 11px; opacity: 0.8; }
.brand-preview-body {
  padding: 18px 14px; text-align: center;
  background: var(--bp-bg, #f3f4f8);
}
.brand-preview-body button {
  background: var(--bp-accent, #3b82f6); color: #fff;
  border: 0; padding: 10px 18px; border-radius: 8px;
  font-weight: 600; cursor: default; font-size: 13px;
}

/* Detalle cliente */
.detail-grid {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 14px; margin-bottom: 24px;
}
.stat-box {
  background: #fff; border-radius: var(--radius);
  padding: 14px; box-shadow: var(--shadow);
}
.stat-box .label { color: var(--text-mut); font-size: 11px; text-transform: uppercase; letter-spacing: 0.05em; }
.stat-box .value { font-size: 18px; font-weight: 700; margin-top: 4px; }

@media (max-width: 700px) {
  .row-2 { grid-template-columns: 1fr; }
  .detail-grid { grid-template-columns: 1fr; }
  .topbar .brand-sub { display: none; }
}
