/* Actualizar Status — Material You (CSS puro) */
:root {
  --bg0: #e8f2ef;
  --bg1: #f3f7f5;
  --surface: #fffbfe;
  --surface-2: #eef5f2;
  --ink: #1a2e2a;
  --ink-soft: #4a635c;
  --primary: #0f766e;
  --primary-container: #99f6e4;
  --on-primary: #ffffff;
  --secondary: #3d5a54;
  --outline: #b7c9c3;
  --error: #b3261e;
  --warn: #9a6700;
  --ok: #0d7a4f;
  --console-bg: #10241f;
  --console-fg: #d7efe7;
  --shadow: 0 12px 40px rgba(15, 46, 40, 0.08);
  --radius: 28px;
  --radius-sm: 16px;
  --page-gutter: clamp(16px, 4vw, 40px);
  --fs-base: clamp(0.9375rem, 0.9rem + 0.25vw, 1.05rem);
  --fs-h1: clamp(1.75rem, 1.4rem + 1.6vw, 2.75rem);
  --fs-h2: clamp(1.15rem, 1.05rem + 0.5vw, 1.35rem);
  --font: "Figtree", "Segoe UI", sans-serif;
  --display: "Source Serif 4", Georgia, serif;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100dvh;
  font-family: var(--font);
  font-size: var(--fs-base);
  color: var(--ink);
  background:
    radial-gradient(1200px 600px at 10% -10%, #c7ebe3 0%, transparent 55%),
    radial-gradient(900px 500px at 100% 0%, #d7e8e2 0%, transparent 50%),
    linear-gradient(165deg, var(--bg0), var(--bg1) 45%, #e4eeea);
  line-height: 1.5;
  -webkit-tap-highlight-color: transparent;
}

.bg-orb {
  position: fixed;
  border-radius: 50%;
  filter: blur(40px);
  opacity: 0.45;
  pointer-events: none;
  z-index: 0;
  animation: float 18s var(--ease) infinite alternate;
}
.bg-orb-a {
  width: min(48vw, 420px);
  height: min(48vw, 420px);
  background: #9fd9cb;
  top: 8%;
  right: -8%;
}
.bg-orb-b {
  width: min(36vw, 300px);
  height: min(36vw, 300px);
  background: #b8cfc8;
  bottom: 10%;
  left: -6%;
  animation-delay: -6s;
}

@keyframes float {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to { transform: translate3d(-20px, 24px, 0) scale(1.06); }
}

.topbar, .page, .site-foot { position: relative; z-index: 1; }

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px var(--page-gutter);
  padding-top: max(16px, env(safe-area-inset-top));
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: inherit;
}
.brand-mark {
  width: 40px;
  height: 40px;
  border-radius: 14px;
  background:
    linear-gradient(145deg, #14b8a6, #0f766e 60%, #115e59);
  box-shadow: 0 8px 20px rgba(15, 118, 110, 0.28);
}
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-text strong { font-weight: 700; letter-spacing: -0.02em; }
.brand-text small { color: var(--ink-soft); font-size: 0.8rem; }

.page {
  width: min(1080px, 100% - 2 * var(--page-gutter));
  margin: 0 auto;
  padding-bottom: calc(48px + var(--safe-bottom));
}

.hero {
  padding: clamp(12px, 3vw, 28px) 0 clamp(28px, 5vw, 48px);
  animation: rise 0.55s var(--ease) both;
}
.eyebrow {
  margin: 0 0 8px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--primary);
}
.hero h1 {
  margin: 0;
  font-family: var(--display);
  font-size: var(--fs-h1);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.1;
}
.lede {
  margin: 12px 0 0;
  max-width: 42rem;
  color: var(--ink-soft);
  font-size: clamp(1rem, 0.95rem + 0.3vw, 1.125rem);
}

.module-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 230px), 1fr));
  gap: clamp(14px, 2.5vw, 20px);
}

.module-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: clamp(18px, 3vw, 24px);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--surface) 88%, #c5e8de);
  border: 1px solid color-mix(in srgb, var(--outline) 55%, transparent);
  box-shadow: var(--shadow);
  text-decoration: none;
  color: inherit;
  transition: transform 0.28s var(--ease), box-shadow 0.28s var(--ease), background 0.28s var(--ease);
  animation: rise 0.55s var(--ease) both;
  animation-delay: var(--delay, 0ms);
  min-height: 180px;
}
.module-card:hover,
.module-card:focus-visible {
  transform: translateY(-4px);
  box-shadow: 0 18px 48px rgba(15, 46, 40, 0.12);
  background: var(--surface);
  outline: none;
}
.module-icon {
  width: 48px;
  height: 48px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  color: var(--primary);
  background: var(--primary-container);
}
.module-card h2 {
  margin: 0;
  font-size: var(--fs-h2);
  letter-spacing: -0.02em;
}
.module-card p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.95rem;
}

.hint-panel {
  margin-top: clamp(28px, 5vw, 44px);
  padding: clamp(18px, 3vw, 24px);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--surface-2) 80%, transparent);
  border: 1px dashed var(--outline);
  animation: rise 0.6s var(--ease) 0.2s both;
}
.hint-panel h3 { margin: 0 0 10px; font-size: 1rem; }
.hint-panel ol { margin: 0; padding-left: 1.2rem; color: var(--ink-soft); }
.hint-panel code {
  font-family: ui-monospace, Consolas, monospace;
  font-size: 0.9em;
  background: var(--surface);
  padding: 0.1em 0.35em;
  border-radius: 6px;
}

.workbench-head {
  padding: 8px 0 22px;
  animation: rise 0.45s var(--ease) both;
}
.workbench-head h1 {
  margin: 0;
  font-family: var(--display);
  font-size: clamp(1.6rem, 1.3rem + 1.2vw, 2.2rem);
  letter-spacing: -0.02em;
}
.workbench-head p {
  margin: 8px 0 0;
  color: var(--ink-soft);
  max-width: 40rem;
}

.panel {
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid color-mix(in srgb, var(--outline) 50%, transparent);
  box-shadow: var(--shadow);
  padding: clamp(18px, 3vw, 28px);
  animation: rise 0.5s var(--ease) both;
}

.upload-panel {
  display: grid;
  gap: 16px;
}

.file-field, .text-field {
  display: grid;
  gap: 6px;
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  border: 1px solid transparent;
  transition: border-color 0.2s var(--ease), background 0.2s var(--ease);
}
.file-field:focus-within, .text-field:focus-within {
  border-color: var(--primary);
  background: #fff;
}
.file-label {
  font-weight: 600;
  font-size: 0.92rem;
}
.file-hint {
  font-size: 0.8rem;
  color: var(--ink-soft);
}
.file-field input[type="file"] {
  width: 100%;
  font: inherit;
}
.text-field input {
  width: 100%;
  border: 0;
  background: transparent;
  font: inherit;
  color: var(--ink);
  padding: 4px 0;
  outline: none;
}

.field-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 0 22px;
  border-radius: 999px;
  border: 0;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.2s var(--ease), box-shadow 0.2s var(--ease), opacity 0.2s;
}
.btn:active { transform: scale(0.98); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }
.btn-primary {
  background: var(--primary);
  color: var(--on-primary);
  box-shadow: 0 10px 24px rgba(15, 118, 110, 0.28);
}
.btn-primary:hover:not(:disabled) {
  box-shadow: 0 14px 28px rgba(15, 118, 110, 0.36);
}
.btn-ghost {
  background: color-mix(in srgb, var(--surface) 70%, transparent);
  color: var(--ink);
  border: 1px solid var(--outline);
}

.progress-panel {
  margin-top: 18px;
  display: grid;
  gap: 14px;
}
.progress-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}
.progress-stage {
  margin: 0;
  font-weight: 600;
}
.progress-elapsed {
  margin: 4px 0 0;
  font-size: 0.85rem;
  color: var(--ink-soft);
}
.progress-pct {
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  color: var(--primary);
  font-size: 1.25rem;
}

.progress-track {
  height: 12px;
  border-radius: 999px;
  background: #d7e5e0;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  width: 0%;
  border-radius: inherit;
  background: linear-gradient(90deg, #0f766e, #2dd4bf);
  transition: width 0.35s var(--ease);
}

.console {
  height: min(42vh, 360px);
  overflow: auto;
  border-radius: var(--radius-sm);
  background: var(--console-bg);
  color: var(--console-fg);
  font-family: ui-monospace, "Cascadia Code", Consolas, monospace;
  font-size: 0.82rem;
  line-height: 1.55;
  padding: 14px 16px;
  scroll-behavior: smooth;
}
.console-line { margin: 0 0 6px; white-space: pre-wrap; word-break: break-word; }
.console-line .time { color: #7eb8a8; margin-right: 8px; }
.console-line.is-error { color: #ffb4ab; }
.console-line.is-success { color: #7ddea5; }
.console-line.is-warn { color: #f5d565; }

.result-box {
  display: grid;
  gap: 10px;
  padding: 16px;
  border-radius: var(--radius-sm);
  background: color-mix(in srgb, var(--primary-container) 55%, white);
}
.result-title {
  margin: 0;
  font-weight: 700;
  font-size: 1.1rem;
}
.result-stats {
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.92rem;
}

.clients-panel {
  margin-top: 18px;
  display: grid;
  gap: 14px;
  animation: rise 0.45s var(--ease) both;
}
.clients-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}
.clients-head h2 {
  margin: 0;
  font-size: var(--fs-h2);
}
.clients-actions {
  display: flex;
  gap: 8px;
}
.clients-summary {
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.92rem;
}
.clients-list {
  display: grid;
  gap: 8px;
  max-height: min(50vh, 420px);
  overflow: auto;
  padding-right: 4px;
}
.client-item {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  cursor: pointer;
  border: 1px solid transparent;
}
.client-item:hover {
  border-color: var(--outline);
}
.client-item input {
  width: 18px;
  height: 18px;
  accent-color: var(--primary);
}
.client-name {
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.client-count {
  font-variant-numeric: tabular-nums;
  color: var(--ink-soft);
  font-size: 0.85rem;
}

.site-foot {
  text-align: center;
  padding: 24px var(--page-gutter) calc(24px + var(--safe-bottom));
  color: var(--ink-soft);
  font-size: 0.82rem;
}

@keyframes rise {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
  html { scroll-behavior: auto; }
}

@media (max-width: 560px) {
  .module-card { min-height: 0; }
  .console { height: 46vh; }
}
