:root {
  --bg: #f5f8fc;
  --panel: #ffffff;
  --line: #dce8f3;
  --line-soft: #edf5fb;
  --text: #111827;
  --muted: #5e6b7c;
  --muted-2: #8b99aa;

  /* Paleta Tibox */
  --blue: #0884d6;
  --blue-2: #1d9fe5;
  --cyan: #06b6d4;
  --accent: #0427df;
  --dark: #111827;
  --deep: #000E3D;

  --navy: #000E3D;
  --radius: 18px;
  --shadow: 0 10px 30px rgba(0, 14, 61, 0.075);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(8, 132, 214, .12), transparent 30%),
    radial-gradient(circle at top right, rgba(6, 182, 212, .10), transparent 24%),
    linear-gradient(180deg, #f8fcff 0%, var(--bg) 260px);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 13px;
  line-height: 1.45;
}

a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }

.app-shell {
  width: min(1480px, calc(100% - 32px));
  margin: 0 auto;
  padding: 22px 0 30px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 18px 20px;
  border: 1px solid rgba(230, 235, 242, .9);
  border-radius: 24px;
  background: rgba(255,255,255,.82);
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
}

.eyebrow {
  color: var(--blue);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .14em;
  text-transform: uppercase;
}

h1 {
  margin: 2px 0 0;
  font-size: 25px;
  line-height: 1.05;
  letter-spacing: -.04em;
}

h2 {
  margin: 0;
  font-size: 15px;
  line-height: 1.15;
  letter-spacing: -.02em;
}

h3 {
  margin: 0 0 10px;
  font-size: 13px;
}

p { margin: 0; }

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.global-status,
.source-state,
.pill,
.priority-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 28px;
  padding: 0 10px;
  border: 1px solid;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
}

.logout-link {
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: #fff;
  font-size: 12px;
  font-weight: 800;
}

.kpi-grid,
.source-grid,
.focus-grid,
.seo-grid {
  display: grid;
  gap: 14px;
}

.kpi-grid {
  grid-template-columns: repeat(4, 1fr);
  margin: 16px 0;
}

.source-grid {
  grid-template-columns: 1fr 1fr;
  margin-bottom: 16px;
}

.focus-grid {
  grid-template-columns: repeat(4, 1fr);
}

.seo-grid {
  grid-template-columns: repeat(5, 1fr);
}

.kpi,
.source-card,
.panel,
.focus-card,
.seo-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow);
}

.kpi {
  padding: 15px;
}

.kpi span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.kpi strong {
  display: block;
  margin-top: 6px;
  font-size: 26px;
  line-height: 1;
  letter-spacing: -.04em;
}

.kpi small {
  display: block;
  margin-top: 5px;
  color: var(--muted-2);
  font-size: 12px;
}

.source-card,
.panel {
  padding: 16px;
}

.source-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 13px;
}

.source-kicker {
  display: block;
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .11em;
  text-transform: uppercase;
}

.source-state {
  min-height: 24px;
  font-size: 10px;
}

.source-ok {
  color: #047857;
  border-color: #bbf7d0;
  background: #ecfdf3;
}

.source-bad {
  color: #b42318;
  border-color: #fecaca;
  background: #fff1f3;
}

.mini-kpis,
.source-subgrid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.mini-kpis div,
.source-subgrid span {
  padding: 10px;
  border: 1px solid var(--line-soft);
  border-radius: 14px;
  background: #fbfcfe;
}

.mini-kpis strong {
  display: block;
  font-size: 18px;
  letter-spacing: -.03em;
}

.mini-kpis span,
.source-subgrid span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.source-subgrid {
  margin-top: 8px;
}

.source-meta,
.source-error,
.source-path {
  margin-top: 10px;
  color: var(--muted);
  font-size: 12px;
}

.source-error {
  color: #d92d20;
  font-weight: 800;
}

.source-path {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  word-break: break-all;
}

.panel {
  margin-top: 16px;
}

.section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 13px;
}

.section-head p {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.btn {
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 12px;
  border: 1px solid transparent;
  border-radius: 11px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.btn-primary { color: #fff; background: linear-gradient(135deg, var(--blue), var(--blue-2)); }
.btn-primary:hover { filter: brightness(.96); }
.btn-secondary { color: var(--text); border-color: var(--line); background: #fff; }
.btn-dark { color: #fff; background: linear-gradient(135deg, var(--deep), var(--dark)); }

.focus-card,
.seo-card {
  padding: 12px;
  box-shadow: none;
}

.focus-title {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.focus-title strong {
  font-size: 12.5px;
}

.focus-card p,
.seo-card p {
  margin-top: 5px;
  color: var(--muted);
  font-size: 11px;
}

.focus-tags,
.seo-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.focus-tags span,
.seo-meta span {
  padding: 5px 7px;
  border-radius: 999px;
  background: #f4f7fb;
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 800;
}

.mini-link {
  display: inline-flex;
  margin-top: 10px;
  color: var(--blue);
  font-size: 11px;
  font-weight: 900;
}

.seo-card-title {
  display: flex;
  gap: 7px;
  align-items: center;
}

.seo-card-title strong {
  font-size: 12.5px;
}

.next-actions {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--line-soft);
}

.next-row {
  display: grid;
  grid-template-columns: 24px 1fr;
  gap: 8px;
  padding: 9px 0;
  border-bottom: 1px solid var(--line-soft);
}

.next-row strong {
  display: block;
  font-size: 12px;
}

.next-row small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 15px;
}

table {
  width: 100%;
  min-width: 1120px;
  border-collapse: collapse;
  text-align: left;
  font-size: 12px;
}

thead {
  color: var(--muted);
  background: #f8fafc;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .08em;
  text-transform: uppercase;
}

th, td {
  padding: 10px 11px;
  vertical-align: top;
  border-bottom: 1px solid var(--line-soft);
}

tbody tr:hover { background: #fbfdff; }
td strong { display: block; font-size: 12.5px; }
td small { display: block; margin-top: 3px; color: var(--muted-2); font-size: 11px; font-weight: 700; }
.wide-cell { max-width: 310px; }
.muted { color: var(--muted); }

.status-green { color: #047857; border-color: #a7f3d0; background: #ecfdf5; }
.status-yellow { color: #b54708; border-color: #fedf89; background: #fffaeb; }
.status-orange { color: #c2410c; border-color: #fed7aa; background: #fff7ed; }
.status-red { color: #b42318; border-color: #fecdca; background: #fff1f3; }

.priority-pill {
  color: var(--muted);
  border-color: var(--line);
  background: #f8fafc;
}

.progress-label {
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.progress {
  width: 86px;
  height: 7px;
  overflow: hidden;
  border-radius: 999px;
  background: #edf2f7;
}

.progress span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(135deg, var(--blue), var(--blue-2));
}

.actions,
.task-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.actions form,
.task-actions form { margin: 0; }

.link-action,
.task-actions a,
.task-actions button {
  min-height: 26px;
  display: inline-flex;
  align-items: center;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 9px;
  color: var(--muted);
  background: #fff;
  cursor: pointer;
  font-size: 11px;
  font-weight: 800;
}

.link-action:hover,
.task-actions a:hover { color: var(--blue); }
.link-action.danger:hover,
.task-actions button:hover { color: #d92d20; }

.grid-form {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.grid-form .full { grid-column: 1 / -1; }

label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .04em;
  text-transform: uppercase;
}

input, select, textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 9px 10px;
  outline: none;
  background: #fff;
  color: var(--text);
  font-size: 12px;
  text-transform: none;
  letter-spacing: 0;
}

textarea {
  min-height: 86px;
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, .10);
}

.form-actions {
  display: flex;
  gap: 9px;
  align-items: center;
}

.content-grid {
  display: grid;
  grid-template-columns: .85fr 1.15fr;
  gap: 16px;
  align-items: start;
}

.task-list {
  display: grid;
  gap: 9px;
}

.task {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 11px;
  border: 1px solid var(--line-soft);
  border-radius: 14px;
  background: #fbfcfe;
}

.task strong { display: block; font-size: 12.5px; }
.task small { display: block; margin-top: 3px; color: var(--muted); font-size: 11px; font-weight: 700; }

.priority-form {
  display: grid;
  gap: 11px;
  margin-top: 13px;
  padding-top: 13px;
  border-top: 1px solid var(--line-soft);
}

.status-text {
  width: 100%;
  height: 330px;
  border-radius: 14px;
  background: #fbfcfe;
  line-height: 1.55;
  font-size: 12px;
}

.footer {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  margin-top: 16px;
  padding: 13px 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.alert {
  margin: 14px 0;
  padding: 11px 12px;
  border: 1px solid #fecdca;
  border-radius: 13px;
  color: #b42318;
  background: #fff1f3;
  font-size: 12px;
  font-weight: 800;
}

.login-body {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(circle at top left, rgba(6,182,212,0.25), transparent 34%),
    radial-gradient(circle at bottom right, rgba(4,39,223,0.22), transparent 30%),
    linear-gradient(135deg, var(--deep), var(--dark));
}

.login-card {
  width: min(390px, 100%);
  padding: 26px;
  border: 1px solid rgba(255,255,255,.16);
  border-radius: 24px;
  color: #fff;
  background: rgba(15,23,42,.74);
  box-shadow: 0 30px 80px rgba(0,0,0,.28);
  backdrop-filter: blur(18px);
}

.login-badge {
  display: inline-flex;
  padding: 7px 10px;
  border: 1px solid rgba(255,255,255,.16);
  border-radius: 999px;
  color: #bfdbfe;
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .12em;
}

.login-card h1 {
  margin: 15px 0 6px;
  font-size: 28px;
  letter-spacing: -.05em;
}

.login-card p {
  margin-bottom: 18px;
  color: #cbd5e1;
}

.login-form {
  display: grid;
  gap: 13px;
}

.login-form label { color: #e2e8f0; }

.login-form input {
  border-color: rgba(255,255,255,.16);
  color: #fff;
  background: rgba(255,255,255,.08);
}

.login-form button {
  min-height: 42px;
  border: 0;
  border-radius: 12px;
  color: #fff;
  background: linear-gradient(135deg, var(--blue), var(--blue-2));
  cursor: pointer;
  font-weight: 900;
}

@media (max-width: 1240px) {
  .focus-grid,
  .seo-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 1080px) {
  .kpi-grid,
  .source-grid,
  .content-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .app-shell {
    width: min(100% - 20px, 1480px);
    padding: 10px 0 22px;
  }

  .topbar,
  .section-head,
  .footer,
  .task {
    flex-direction: column;
  }

  .topbar { align-items: flex-start; }

  .topbar-actions {
    width: 100%;
    justify-content: space-between;
  }

  .mini-kpis,
  .source-subgrid,
  .focus-grid,
  .seo-grid {
    grid-template-columns: 1fr;
  }

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


.tabs {
  display: flex;
  gap: 8px;
  margin: 14px 0 16px;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255,255,255,.75);
  box-shadow: var(--shadow);
  width: fit-content;
}

.tabs a {
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  padding: 0 13px;
  border-radius: 12px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.tabs a.active {
  color: var(--text);
  background: #fff;
  box-shadow: 0 4px 14px rgba(15, 23, 42, .08);
}

.home-title {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: flex-end;
  margin-bottom: 16px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: var(--shadow);
}

.home-title span {
  display: block;
  margin-bottom: 5px;
  color: var(--blue);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .11em;
  text-transform: uppercase;
}

.home-title h2 {
  font-size: 18px;
}

.home-title p {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.home-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.panel-link {
  margin-top: 12px;
}

@media (min-width: 1081px) {
  .source-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 760px) {
  .tabs {
    width: 100%;
  }

  .tabs a {
    flex: 1;
    justify-content: center;
  }

  .home-title {
    align-items: flex-start;
    flex-direction: column;
  }

  .home-actions {
    width: 100%;
    justify-content: flex-start;
  }
}


/* Ajustes visuales con paleta Tibox */
.topbar {
  border-top: 3px solid var(--cyan);
}

.tabs a.active {
  color: var(--deep);
  box-shadow: 0 5px 16px rgba(8, 132, 214, .13);
}

.global-status.status-yellow,
.pill.status-yellow {
  border-color: rgba(29, 159, 229, .28);
  background: rgba(29, 159, 229, .10);
  color: #075985;
}

.source-ok {
  color: #075985;
  border-color: rgba(6, 182, 212, .30);
  background: rgba(6, 182, 212, .10);
}

.kpi strong,
.mini-kpis strong {
  color: var(--deep);
}

.home-title span,
.source-kicker,
.eyebrow {
  color: var(--blue);
}

.progress span {
  background: linear-gradient(90deg, var(--blue), var(--cyan));
}

.login-form button {
  background: linear-gradient(135deg, var(--blue), var(--blue-2));
}
