/* =========================================================
   CronFast — Design tokens
   Paleta "sala de monitoreo": fondo tinta, acento señal viva,
   tipografía técnica. Pensado para transmitir precisión.
   ========================================================= */
:root {
  --ink:          #0B0F14;
  --panel:        #121821;
  --panel-2:      #1A222D;
  --line:         #232C38;
  --text:         #E7ECEF;
  --muted:        #8A95A1;
  --signal:       #00D9A3;
  --signal-dim:   #0A4F40;
  --amber:        #F5A623;
  --red:          #FF5D5D;

  --display: 'Space Grotesk', 'Inter', sans-serif;
  --body:    'Inter', -apple-system, sans-serif;
  --mono:    'JetBrains Mono', ui-monospace, monospace;

  --radius: 10px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--ink);
  color: var(--text);
  font-family: var(--body);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--signal); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 {
  font-family: var(--display);
  font-weight: 700;
  margin: 0 0 .5em;
  letter-spacing: -0.01em;
}
p { color: var(--muted); }
.container { max-width: 1120px; margin: 0 auto; padding: 0 24px; }
.mono { font-family: var(--mono); }
:focus-visible { outline: 2px solid var(--signal); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }
}

/* ---------- Topbar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 50;
  background: rgba(11,15,20,0.85);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.topbar .container { display: flex; align-items: center; justify-content: space-between; height: 68px; }
.brand { display: flex; align-items: center; gap: 10px; font-family: var(--display); font-weight: 700; font-size: 1.15rem; color: var(--text); }
.brand .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--signal); box-shadow: 0 0 0 0 rgba(0,217,163,.6); animation: pulse-dot 2s infinite; }
@keyframes pulse-dot {
  0% { box-shadow: 0 0 0 0 rgba(0,217,163,.55); }
  70% { box-shadow: 0 0 0 8px rgba(0,217,163,0); }
  100% { box-shadow: 0 0 0 0 rgba(0,217,163,0); }
}
.nav-links { display: flex; gap: 28px; align-items: center; }
.nav-links a { color: var(--muted); font-size: .95rem; }
.nav-links a:hover { color: var(--text); text-decoration: none; }
.nav-cta { display: flex; gap: 10px; align-items: center; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--body); font-weight: 600; font-size: .92rem;
  padding: 10px 18px; border-radius: 8px; border: 1px solid transparent;
  cursor: pointer; transition: transform .12s ease, opacity .12s ease;
}
.btn:hover { text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn-signal { background: var(--signal); color: #06231C; }
.btn-signal:hover { opacity: .9; }
.btn-ghost { background: transparent; color: var(--text); border-color: var(--line); }
.btn-ghost:hover { background: var(--panel-2); }
.btn-danger { background: transparent; color: var(--red); border-color: rgba(255,93,93,.35); }
.btn-danger:hover { background: rgba(255,93,93,.08); }
.btn-sm { padding: 6px 12px; font-size: .82rem; }
.btn-block { width: 100%; justify-content: center; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }

/* ---------- Hero ---------- */
.hero { padding: 90px 0 70px; }
.hero-grid { display: grid; grid-template-columns: 1.1fr 1fr; gap: 60px; align-items: center; }
.eyebrow { font-family: var(--mono); color: var(--signal); font-size: .82rem; letter-spacing: .08em; text-transform: uppercase; margin-bottom: 18px; display: inline-block; }
.hero h1 { font-size: 3rem; line-height: 1.08; color: #fff; }
.hero h1 span { color: var(--signal); }
.hero p.lead { font-size: 1.1rem; max-width: 480px; margin-bottom: 30px; }
.hero-actions { display: flex; gap: 14px; flex-wrap: wrap; }

/* signature element: pulse monitor */
.pulse-card { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 26px; }
.pulse-card .ticks { font-family: var(--mono); color: var(--muted); font-size: .78rem; display: flex; justify-content: space-between; margin-bottom: 10px; }
.pulse-card .ticks b { color: var(--signal); }
.pulse-line { width: 100%; height: 120px; }
.pulse-path { fill: none; stroke: var(--signal); stroke-width: 2; }
.pulse-dot { fill: var(--signal); filter: drop-shadow(0 0 6px rgba(0,217,163,.9)); }
.pulse-foot { display: flex; justify-content: space-between; margin-top: 14px; font-family: var(--mono); font-size: .78rem; color: var(--muted); }
.pulse-foot b { color: var(--text); }

/* stat strip */
.stat-strip { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 22px 0; margin: 10px 0 60px; }
.stat-strip .container { display: flex; gap: 50px; flex-wrap: wrap; }
.stat-item .num { font-family: var(--mono); font-size: 1.6rem; color: var(--signal); display: block; }
.stat-item .label { font-size: .82rem; color: var(--muted); }

/* ---------- Sections ---------- */
.section { padding: 70px 0; }
.section-head { max-width: 620px; margin-bottom: 44px; }
.section-head .eyebrow { display: block; }
.section-head h2 { font-size: 2rem; color: #fff; }

.feat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.feat-item { background: var(--panel); padding: 30px 26px; }
.feat-item .metric { font-family: var(--mono); color: var(--signal); font-size: 1.4rem; display: block; margin-bottom: 10px; }
.feat-item h3 { font-size: 1.05rem; color: #fff; }
.feat-item p { margin: 0; font-size: .92rem; }

@media (max-width: 860px) {
  .hero-grid { grid-template-columns: 1fr; }
  .feat-grid { grid-template-columns: 1fr; }
}

/* ---------- Pricing ---------- */
.plans { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.plan { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 30px; display: flex; flex-direction: column; }
.plan.featured { border-color: var(--signal); box-shadow: 0 0 0 1px var(--signal-dim) inset; }
.plan .tag { font-family: var(--mono); color: var(--signal); font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; }
.plan h3 { color: #fff; font-size: 1.3rem; margin-top: 6px; }
.plan ul { list-style: none; padding: 0; margin: 20px 0 26px; flex: 1; }
.plan li { padding: 7px 0; border-top: 1px solid var(--line); font-size: .92rem; color: var(--text); }
.plan li:first-child { border-top: none; }
@media (max-width: 860px) { .plans { grid-template-columns: 1fr; } }

/* ---------- Forms / cards ---------- */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 28px; }
.form-group { margin-bottom: 18px; }
label { display: block; font-size: .85rem; color: var(--muted); margin-bottom: 6px; }
input, select, textarea {
  width: 100%; background: var(--ink); border: 1px solid var(--line); color: var(--text);
  padding: 11px 13px; border-radius: 8px; font-family: var(--body); font-size: .95rem;
}
input:focus, select:focus, textarea:focus { border-color: var(--signal); outline: none; }
.help { font-size: .78rem; color: var(--muted); margin-top: 6px; }
.error-box { background: rgba(255,93,93,.08); border: 1px solid rgba(255,93,93,.3); color: var(--red); padding: 12px 14px; border-radius: 8px; font-size: .9rem; margin-bottom: 18px; }

.auth-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 40px 20px; }
.auth-card { width: 100%; max-width: 400px; }
.auth-card .brand { justify-content: center; margin-bottom: 26px; }

/* ---------- App shell (panel + admin) ---------- */
.app-shell { display: grid; grid-template-columns: 250px 1fr; min-height: 100vh; }
.app-sidebar { background: var(--panel); border-right: 1px solid var(--line); padding: 26px 20px; display: flex; flex-direction: column; }
.app-sidebar .brand { margin-bottom: 30px; }
.who { background: var(--panel-2); border: 1px solid var(--line); border-radius: 10px; padding: 14px; margin-bottom: 24px; }
.who .name { font-weight: 600; font-size: .92rem; }
.who .email { color: var(--muted); font-size: .8rem; word-break: break-all; }
.who .meta { margin-top: 10px; font-family: var(--mono); font-size: .76rem; color: var(--muted); display: flex; justify-content: space-between; }
.who .meta b { color: var(--text); }
.side-nav { display: flex; flex-direction: column; gap: 4px; }
.side-nav a { color: var(--muted); padding: 9px 12px; border-radius: 8px; font-size: .9rem; }
.side-nav a:hover { background: var(--panel-2); color: var(--text); text-decoration: none; }
.side-nav a.active { background: var(--signal-dim); color: var(--signal); }
.side-foot { margin-top: auto; padding-top: 16px; border-top: 1px solid var(--line); }

.app-main { padding: 34px 40px; }
.app-head { display: flex; align-items: flex-end; justify-content: space-between; margin-bottom: 26px; flex-wrap: wrap; gap: 14px; }
.app-head h1 { font-size: 1.6rem; color: #fff; }
.app-head .sub { color: var(--muted); font-size: .9rem; margin-top: 4px; }

.stat-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 28px; }
.stat-box { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 18px; }
.stat-box .v { font-family: var(--mono); font-size: 1.5rem; color: var(--signal); }
.stat-box .l { font-size: .8rem; color: var(--muted); margin-top: 4px; }
@media (max-width: 760px) { .stat-row { grid-template-columns: repeat(2,1fr); } }

/* table */
.table-wrap { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
table { width: 100%; border-collapse: collapse; }
thead th { text-align: left; font-size: .76rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); padding: 14px 16px; border-bottom: 1px solid var(--line); background: var(--panel-2); }
tbody td { padding: 14px 16px; border-bottom: 1px solid var(--line); font-size: .9rem; vertical-align: middle; }
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: rgba(255,255,255,.02); }
.url-cell { max-width: 280px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: var(--mono); font-size: .82rem; }
.actions-cell { display: flex; gap: 6px; flex-wrap: wrap; }
.actions-cell .icon-btn { background: var(--panel-2); border: 1px solid var(--line); color: var(--text); width: 32px; height: 32px; border-radius: 7px; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; font-size: .85rem; }
.actions-cell .icon-btn:hover { border-color: var(--signal); color: var(--signal); }
.actions-cell .icon-btn.danger:hover { border-color: var(--red); color: var(--red); }

.badge { font-family: var(--mono); font-size: .72rem; padding: 4px 9px; border-radius: 20px; display: inline-flex; align-items: center; gap: 5px; text-transform: uppercase; letter-spacing: .03em; }
.badge .d { width: 6px; height: 6px; border-radius: 50%; }
.badge-active { background: rgba(0,217,163,.12); color: var(--signal); }
.badge-active .d { background: var(--signal); }
.badge-disabled { background: rgba(138,149,161,.14); color: var(--muted); }
.badge-disabled .d { background: var(--muted); }
.badge-error { background: rgba(255,93,93,.12); color: var(--red); }
.badge-error .d { background: var(--red); }
.badge-completed { background: rgba(245,166,35,.12); color: var(--amber); }
.badge-completed .d { background: var(--amber); }

.empty-state { padding: 70px 20px; text-align: center; }
.empty-state h3 { color: #fff; }
.empty-state p { max-width: 380px; margin: 0 auto 20px; }

/* modal */
.modal-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,.6); display: none; align-items: center; justify-content: center; z-index: 100; padding: 20px; }
.modal-backdrop.open { display: flex; }
.modal-box { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; width: 100%; max-width: 460px; max-height: 90vh; overflow-y: auto; }
.modal-head { display: flex; justify-content: space-between; align-items: center; padding: 20px 22px; border-bottom: 1px solid var(--line); }
.modal-head h3 { margin: 0; font-size: 1.1rem; color: #fff; }
.modal-close { background: none; border: none; color: var(--muted); font-size: 1.3rem; cursor: pointer; line-height: 1; }
.modal-body { padding: 22px; }
.modal-foot { padding: 16px 22px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 10px; }

.toast-wrap { position: fixed; top: 20px; right: 20px; z-index: 200; display: flex; flex-direction: column; gap: 10px; }
.toast { background: var(--panel); border: 1px solid var(--line); border-left: 3px solid var(--signal); padding: 12px 16px; border-radius: 8px; font-size: .88rem; min-width: 240px; box-shadow: 0 8px 20px rgba(0,0,0,.4); animation: toast-in .2s ease; }
.toast.error { border-left-color: var(--red); }
@keyframes toast-in { from { transform: translateY(-8px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

footer.site-footer { border-top: 1px solid var(--line); padding: 40px 0; }
footer.site-footer .container { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 16px; color: var(--muted); font-size: .85rem; }

@media (max-width: 900px) {
  .app-shell { grid-template-columns: 1fr; }
  .app-sidebar { display: none; }
  .app-main { padding: 20px; }
}
