:root {
  color-scheme: light;
  --bg: #f5f3ee;
  --ink: #17211f;
  --muted: #65706c;
  --line: #d9d4c8;
  --panel: #fffdfa;
  --panel-strong: #101820;
  --green: #2e7d5b;
  --teal: #1e6f78;
  --red: #b5493d;
  --amber: #ba7a22;
  --blue: #315f9f;
  --shadow: 0 18px 45px rgba(16, 24, 32, 0.08);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  background: var(--bg);
  color: var(--ink);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

button,
input,
textarea {
  font: inherit;
}

button {
  min-height: 40px;
  border: 0;
  border-radius: 8px;
  background: var(--panel-strong);
  color: #fffdfa;
  cursor: pointer;
  padding: 0 14px;
  font-weight: 750;
}

.user-chip {
  display: inline-flex;
  min-height: 40px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 800;
}

.ghost-button {
  border: 1px solid var(--line);
  background: transparent;
  color: var(--ink);
}

.login-screen {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 20px;
  background: var(--bg);
}

.login-panel {
  display: grid;
  gap: 24px;
  width: min(460px, 100%);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
  padding: clamp(22px, 5vw, 36px);
}

.login-brand small {
  color: var(--muted);
}

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

.login-form label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-weight: 800;
}

.login-form input {
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfaf7;
  color: var(--ink);
  padding: 0 12px;
}

.form-error {
  margin: 0;
  color: var(--red);
  font-weight: 800;
}

.shell {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 28px;
  padding: 26px 22px;
  background: #101820;
  color: #fffdfa;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 8px;
  background: #f1c453;
  color: #101820;
  font-weight: 900;
}

.brand strong,
.brand small {
  display: block;
}

.brand small,
.deploy-box small,
.deploy-box span {
  color: rgba(255, 253, 250, 0.68);
}

.nav {
  display: grid;
  gap: 6px;
}

.nav a {
  border-radius: 8px;
  color: rgba(255, 253, 250, 0.78);
  padding: 11px 12px;
  text-decoration: none;
  font-weight: 700;
}

.nav a.active,
.nav a:hover {
  background: rgba(255, 253, 250, 0.1);
  color: #fffdfa;
}

.deploy-box {
  margin-top: auto;
  display: grid;
  gap: 5px;
  border: 1px solid rgba(255, 253, 250, 0.16);
  border-radius: 8px;
  padding: 14px;
}

.main {
  width: min(1440px, 100%);
  margin: 0 auto;
  padding: 30px clamp(16px, 3vw, 44px) 54px;
}

.topbar,
.section-header,
.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.topbar {
  margin-bottom: 24px;
}

.actions,
.filter-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.eyebrow {
  margin: 0 0 5px;
  color: var(--teal);
  font-size: 0.75rem;
  font-weight: 850;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: clamp(2rem, 4vw, 4.4rem);
  line-height: 0.95;
}

h2 {
  margin-bottom: 0;
  font-size: clamp(1.25rem, 2vw, 1.8rem);
}

h3 {
  margin-bottom: 8px;
  font-size: 1.05rem;
}

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

.metric-card,
.panel,
.product-card,
.secondary-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.metric-card {
  padding: 17px;
}

.metric-card strong {
  display: block;
  margin-top: 8px;
  font-size: clamp(1.8rem, 4vw, 3rem);
  line-height: 1;
}

.metric-card span,
.product-card p,
.panel p,
.risk-list p,
.campaign-list p {
  color: var(--muted);
}

.board,
.two-column {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(320px, 0.55fr);
  gap: 16px;
}

.section {
  margin-top: 28px;
}

.panel {
  padding: 20px;
}

.focus-panel {
  background: #fff9e8;
}

.status-pill {
  display: inline-grid;
  place-items: center;
  min-height: 28px;
  border-radius: 999px;
  padding: 0 10px;
  font-size: 0.78rem;
  font-weight: 850;
  white-space: nowrap;
}

.live {
  background: rgba(46, 125, 91, 0.14);
  color: var(--green);
}

.draft {
  background: rgba(186, 122, 34, 0.16);
  color: var(--amber);
}

.build {
  background: rgba(49, 95, 159, 0.14);
  color: var(--blue);
}

.risk {
  background: rgba(181, 73, 61, 0.14);
  color: var(--red);
}

.progress-strip {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 8px;
  margin-top: 18px;
}

.progress-segment {
  min-height: 74px;
  border-radius: 8px;
  background: rgba(16, 24, 32, 0.08);
  padding: 10px;
}

.progress-segment span {
  display: block;
  height: 8px;
  border-radius: 999px;
  background: var(--green);
}

.progress-segment small {
  display: block;
  margin-top: 9px;
  color: var(--muted);
  font-weight: 750;
}

.stage-list {
  display: grid;
  gap: 12px;
  margin-top: 18px;
}

.stage-row {
  display: grid;
  grid-template-columns: 92px 1fr 28px;
  align-items: center;
  gap: 10px;
}

.bar {
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: #e8e2d4;
}

.bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--teal);
}

.filter-group button {
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--ink);
}

.filter-group button.active {
  background: var(--panel-strong);
  color: #fffdfa;
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-top: 14px;
}

.secondary-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 14px;
  margin-top: 14px;
}

.product-card,
.secondary-card {
  display: grid;
  gap: 15px;
  padding: 18px;
}

.product-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.product-card dl,
.secondary-card dl,
.integration-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 0;
}

.product-card dt,
.secondary-card dt,
.integration-list dt {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.product-card dd,
.secondary-card dd,
.integration-list dd {
  margin: 3px 0 0;
  font-weight: 800;
}

.score {
  display: grid;
  gap: 7px;
}

.score-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 800;
}

.timeline,
.risk-list,
.campaign-list {
  display: grid;
  gap: 12px;
  margin-top: 18px;
}

.timeline-item,
.risk-item,
.campaign-item {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: rgba(255, 253, 250, 0.6);
}

.timeline-item {
  display: grid;
  grid-template-columns: 84px 1fr;
  gap: 14px;
}

.quarter {
  color: var(--teal);
  font-weight: 900;
}

.campaign-item {
  display: flex;
  justify-content: space-between;
  gap: 14px;
}

.campaign-item small {
  color: var(--muted);
  font-weight: 800;
}

.agent-panel {
  background: #eef7f4;
}

dialog {
  width: min(820px, calc(100vw - 24px));
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0;
  background: var(--panel);
}

dialog::backdrop {
  background: rgba(16, 24, 32, 0.45);
}

.dialog-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--line);
  padding: 14px;
}

.dialog-header h2 {
  font-size: 1.2rem;
}

textarea {
  display: block;
  width: 100%;
  min-height: 460px;
  border: 0;
  padding: 14px;
  resize: vertical;
  background: #fbfaf7;
  color: var(--ink);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.86rem;
}

@media (max-width: 1080px) {
  .shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    height: auto;
  }

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

  .deploy-box {
    display: none;
  }

  .metric-grid,
  .product-grid,
  .secondary-grid,
  .board,
  .two-column {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .topbar,
  .section-header,
  .panel-header,
  .campaign-item {
    align-items: stretch;
    flex-direction: column;
  }

  .nav {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .metric-grid,
  .product-grid,
  .secondary-grid,
  .board,
  .two-column {
    grid-template-columns: 1fr;
  }

  .progress-strip {
    grid-template-columns: repeat(2, 1fr);
  }

  .product-card dl,
  .integration-list {
    grid-template-columns: 1fr;
  }
}

/* Cierre del día */
.section-sub { color: var(--muted, #8a8f98); font-size: 0.85rem; margin: 0.2rem 0 0; }
.daily-panel { margin-top: 0.75rem; }
.daily-closed {
  background: rgba(120, 200, 160, 0.12);
  border: 1px solid rgba(120, 200, 160, 0.3);
  border-radius: 10px; padding: 0.6rem 0.85rem; margin-bottom: 0.85rem; font-size: 0.9rem;
}
.daily-grid {
  display: grid; gap: 0.85rem;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
}
.daily-card {
  background: var(--card, #161a22); border: 1px solid var(--line, #232834);
  border-radius: 12px; padding: 0.85rem 1rem;
}
.daily-card-top { display: flex; justify-content: space-between; align-items: center; gap: 0.5rem; }
.daily-card-top h3 { margin: 0; font-size: 1rem; }
.daily-badges { display: flex; align-items: center; gap: 0.5rem; margin-top: 0.5rem; flex-wrap: wrap; }
.daily-meta { color: var(--muted, #8a8f98); font-size: 0.78rem; }
.daily-ai { margin: 0.55rem 0 0; font-size: 0.85rem; }
.daily-note { margin: 0.4rem 0 0; font-size: 0.82rem; color: var(--muted, #8a8f98); font-style: italic; }
.daily-err { margin: 0.4rem 0 0; font-size: 0.75rem; color: #d98a8a; }
