:root {
  color-scheme: light;
  --bg: #f6f7f9;
  --panel: #ffffff;
  --text: #1b1f27;
  --muted: #637083;
  --line: #dfe4ea;
  --brand: #17624a;
  --accent: #b7313c;
  --warn: #b47600;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Arial, Helvetica, sans-serif;
}

button,
input,
textarea,
select {
  font: inherit;
}

button {
  border: 0;
  border-radius: 6px;
  background: var(--brand);
  color: #fff;
  cursor: pointer;
  min-height: 38px;
  padding: 0 14px;
}

button.secondary {
  background: #eef2f4;
  color: var(--text);
}

button.danger {
  background: var(--accent);
}

button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

input,
textarea,
select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--text);
  min-height: 38px;
  padding: 8px 10px;
}

textarea {
  min-height: 90px;
  resize: vertical;
}

.shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
}

.sidebar {
  background: #17221f;
  color: #edf7f3;
  padding: 18px 14px;
}

.brand {
  font-weight: 700;
  margin: 4px 8px 18px;
}

.nav {
  display: grid;
  gap: 6px;
}

.nav a,
.logout {
  display: block;
  width: 100%;
  text-align: left;
  color: #edf7f3;
  text-decoration: none;
  border-radius: 6px;
  padding: 10px 12px;
  background: transparent;
}

.nav a.active,
.nav a:hover,
.logout:hover {
  background: rgba(255, 255, 255, 0.12);
}

.content {
  min-width: 0;
}

.topbar {
  height: 58px;
  border-bottom: 1px solid var(--line);
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 22px;
}

.page {
  padding: 22px;
  max-width: 1120px;
}

.login-wrap,
.public-wrap {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
}

.login-panel {
  width: min(420px, 100%);
}

.grid {
  display: grid;
  gap: 14px;
}

.grid.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

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

.grid.four {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.modules {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
}

.module {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
}

.muted {
  color: var(--muted);
}

.status {
  margin-top: 12px;
  color: var(--warn);
  white-space: pre-wrap;
}

.table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
}

.table th,
.table td {
  border-bottom: 1px solid var(--line);
  padding: 10px;
  text-align: left;
  vertical-align: top;
}

.dashboard-workspace {
  display: grid;
  gap: 14px;
  width: min(1420px, 100%);
}

.dashboard-panel {
  display: grid;
  gap: 16px;
  padding: 16px;
}

.dashboard-heading {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
}

.dashboard-heading-actions {
  display: grid;
  gap: 10px;
  justify-items: end;
}

.dashboard-heading h1 {
  margin: 0 0 4px;
  font-size: 24px;
}

.dashboard-heading p {
  margin: 0;
}

.dashboard-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.dashboard-tab {
  background: #ffffff;
  border: 1px solid var(--line);
  color: var(--text);
  display: grid;
  gap: 2px;
  min-width: 150px;
  text-align: left;
}

.dashboard-tab small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
}

.dashboard-tab.active,
.dashboard-tab:hover {
  background: var(--brand);
  border-color: var(--brand);
  color: #ffffff;
}

.dashboard-tab.active small,
.dashboard-tab:hover small {
  color: #e6f4ef;
}

.dashboard-upload-panel {
  display: grid;
  grid-template-columns: minmax(320px, 1fr) minmax(320px, 1fr);
  gap: 18px;
}

.dashboard-upload-panel p {
  margin: 4px 0 0;
}

.dashboard-upload-block,
.dashboard-local-source {
  display: grid;
  gap: 10px;
}

.dashboard-upload-form {
  display: grid;
  grid-template-columns: minmax(140px, 180px) minmax(220px, 1fr) auto;
  gap: 10px;
  align-items: center;
  min-width: min(520px, 100%);
}

.dashboard-local-year {
  max-width: 220px;
}

.dashboard-loaded-files {
  grid-column: 1 / -1;
  display: grid;
  gap: 10px;
}

.dashboard-warning-row td {
  color: #92400e;
  background: #fffbeb;
}

@media (max-width: 760px) {
  .dashboard-upload-form {
    grid-template-columns: 1fr;
  }
}

.dashboard-toolbar {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  align-items: end;
}

.dashboard-control-strip {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
  padding: 10px 12px;
}

.dashboard-defaults-note {
  color: var(--muted);
  font-size: 13px;
}

.switch-control {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text);
  font-weight: 700;
  white-space: nowrap;
}

.switch-control input {
  width: 18px;
  height: 18px;
}

.switch-control strong {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #ffffff;
  color: var(--muted);
  font-size: 12px;
  padding: 3px 8px;
}

.money-toggle {
  min-height: 42px;
}

.dashboard-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  justify-content: flex-end;
  color: var(--muted);
  font-size: 13px;
}

.dashboard-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.legend-color {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 1px solid #cbd5e1;
  border-radius: 3px;
}

.legend-color.verde,
.cell-verde {
  background: #16a34a;
  color: #ffffff;
}

.legend-color.amarillo,
.cell-amarillo {
  background: #facc15;
  color: #1b1f27;
}

.legend-color.rojo,
.cell-rojo {
  background: #dc2626;
  color: #ffffff;
}

.legend-color.sin-datos,
.cell-sin-datos {
  background: #ffffff;
  color: #637083;
}

.cell-sin-objetivo {
  background: #e5e7eb;
  color: #334155;
}

.dashboard-table-scroll {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.dashboard-table-scroll .table {
  min-width: 760px;
}

.nominas-panel {
  display: grid;
  gap: 18px;
}

.nominas-panel .actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.payroll-preview {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
  color: var(--text);
  padding: 12px;
}

.nominas-result-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
  align-items: start;
}

.warnings {
  color: #92400e;
}

.dc3-workspace {
  display: grid;
  gap: 18px;
}

.sirce-workspace {
  display: grid;
  gap: 14px;
  width: min(1320px, 100%);
}

.sirce-entity-selector {
  display: grid;
  font-weight: 700;
  gap: 6px;
  margin-top: 12px;
  max-width: 360px;
}

.sirce-entity-selector select {
  border: 2px solid #2563eb;
  font-size: 1rem;
}

.sirce-check-option {
  align-items: center;
  display: flex;
  gap: 10px;
  grid-column: 1 / -1;
}

.sirce-check-option input {
  flex: 0 0 auto;
  width: auto;
}

.sirce-hidden-file {
  height: 1px;
  opacity: 0;
  overflow: hidden;
  position: absolute;
  width: 1px;
}

.sirce-replace-button {
  font-weight: 800;
  letter-spacing: 0.04em;
}

.sirce-admin-table {
  min-width: 1180px;
}

.sirce-admin-table .actions {
  flex-wrap: nowrap;
}

.table tr.is-inactive td {
  color: #64748b;
  opacity: 0.72;
}

.sirce-catalog-grid,
.sirce-review-list {
  display: grid;
  gap: 12px;
}

.sirce-catalog,
.sirce-review-card,
.sirce-result {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: #fff;
}

.sirce-catalog {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: start;
}

.sirce-catalog.ready {
  border-left: 4px solid #16a34a;
}

.sirce-catalog.missing {
  border-left: 4px solid #f59e0b;
}

.sirce-catalog.error {
  border-left: 4px solid #dc2626;
}

.sirce-review-card {
  display: grid;
  gap: 12px;
}

.dc3-section-head,
.dc3-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: end;
}

.dc3-section-head {
  align-items: center;
}

.dc3-section-head h2 {
  margin: 0;
}

.semaforo-table {
  min-width: 980px;
}

.semaforo-table th {
  background: #f8fafc;
  position: sticky;
  top: 0;
  z-index: 1;
}

.semaforo-table tbody th {
  position: sticky;
  left: 0;
  z-index: 1;
  background: #ffffff;
  min-width: 190px;
}

.semaforo-cell {
  font-weight: 700;
  text-align: center;
  min-width: 110px;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 92px;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 700;
}

.chart-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  padding: 12px;
  min-width: 0;
  overflow: hidden;
}

.chart-scroll {
  overflow-x: auto;
  overflow-y: hidden;
}

.chart-scroll-container {
  width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
}

.chart-scroll-inner {
  flex: 0 0 auto;
}

.chart-wrapper {
  position: relative;
  width: 100%;
  height: clamp(360px, 42vh, 520px);
  min-height: 360px;
  min-width: 0;
}

.chart-wrapper canvas {
  display: block;
  width: 100% !important;
  height: 100% !important;
}

.chart-wrapper.wide {
  min-width: 900px;
  height: clamp(390px, 46vh, 560px);
}

.chart-wrapper.small {
  height: clamp(300px, 34vh, 430px);
  min-height: 300px;
}

.dashboard-split {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(320px, 0.8fr);
  gap: 18px;
  align-items: start;
}

.dashboard5-trends-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.dashboard5-trends-chart-card,
.dashboard5-trends-table-below {
  width: 100%;
  min-width: 0;
}

.dashboard5-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.dashboard5-main-chart-card,
.dashboard5-composition-card,
.dashboard5-table-below {
  width: 100%;
  min-width: 0;
}

.dashboard5-main-chart-card {
  grid-column: 1 / -1;
}

.dashboard5-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
}

.dashboard-colorimetry-note,
.dashboard5-summary-note {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.dashboard5-summary-note {
  grid-column: 1 / -1;
}

.dashboard5-kpi {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  padding: 12px;
  display: grid;
  gap: 6px;
}

.dashboard5-kpi span {
  color: var(--muted);
  font-size: 12px;
}

.dashboard5-kpi strong {
  font-size: 18px;
}

.dashboard5-status {
  border-width: 2px;
  color: var(--text);
}

.dashboard5-status .status-value {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 26px;
}

.dashboard5-status .status-dot {
  display: inline-block;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  flex: 0 0 14px;
  background: #cbd5e1;
  border: 1px solid #94a3b8;
}

.dashboard5-status.status-green {
  border-color: #16a34a;
}

.dashboard5-status.status-yellow {
  border-color: #facc15;
}

.dashboard5-status.status-red {
  border-color: #dc2626;
}

.dashboard5-status.status-no-data {
  border-color: #cbd5e1;
}

.status-green .status-dot {
  background: #16a34a;
  border-color: #16a34a;
}

.status-yellow .status-dot {
  background: #facc15;
  border-color: #facc15;
}

.status-red .status-dot {
  background: #dc2626;
  border-color: #dc2626;
}

.status-no-data .status-dot {
  background: #cbd5e1;
  border-color: #94a3b8;
}

.climate-dashboard-kpi {
  background: #f8fafc;
  border-color: #cbd5e1;
}

.climate-dashboard-kpi small {
  color: #64748b;
  display: block;
  margin-top: 0.35rem;
}

.public-climate {
  background: #eef4f8;
  display: grid;
  min-height: 100vh;
  padding: 24px 14px;
  place-items: start center;
}

.public-climate-card {
  background: #ffffff;
  border: 1px solid #dbe4ea;
  border-radius: 8px;
  box-shadow: 0 12px 36px rgba(15, 23, 42, 0.08);
  padding: clamp(18px, 4vw, 36px);
  width: min(920px, 100%);
}

.public-climate-card h1 {
  font-size: clamp(1.65rem, 3vw, 2.4rem);
  margin-top: 0;
}

.privacy-note {
  background: #ecfeff;
  border-left: 4px solid #0891b2;
  color: #164e63;
  line-height: 1.5;
  padding: 14px;
}

.hidden {
  display: none !important;
}

.climate-survey {
  display: grid;
  gap: 18px;
}

.climate-question {
  border: 1px solid #dbe4ea;
  border-radius: 8px;
  margin: 0;
  padding: 18px;
}

.climate-question legend {
  font-weight: 700;
  padding: 0 8px;
}

.choice-grid {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.choice-pill {
  align-items: center;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  gap: 10px;
  min-height: 48px;
  padding: 10px 12px;
}

.choice-pill input {
  width: auto;
}

.climate-admin {
  display: grid;
  gap: 18px;
}

.climate-campaign {
  align-items: start;
  border: 1px solid #dbe4ea;
  border-radius: 8px;
  display: grid;
  gap: 12px;
  grid-template-columns: 1fr auto;
  margin-bottom: 12px;
  padding: 14px;
}

.climate-campaign.selected {
  border-color: #2563eb;
  box-shadow: inset 4px 0 0 #2563eb;
}

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

.file-action {
  cursor: pointer;
  display: inline-flex;
  overflow: hidden;
  position: relative;
}

.file-action input {
  inset: 0;
  opacity: 0;
  position: absolute;
}

.summary-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}

.summary-grid article {
  border: 1px solid #dbe4ea;
  border-radius: 8px;
  padding: 14px;
}

.summary-grid span {
  color: #64748b;
  display: block;
  font-size: 0.86rem;
}

.summary-grid strong {
  display: block;
  font-size: 1.35rem;
  margin-top: 4px;
}

.climate-chart-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.climate-chart-card {
  border: 1px solid #dbe4ea;
  border-radius: 8px;
  padding: 12px;
}

.climate-chart-card canvas {
  height: 240px !important;
  width: 100% !important;
}

.public-page {
  width: min(760px, 100%);
}

@media (max-width: 760px) {
  .shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
  }

  .grid.two,
  .grid.three,
  .grid.four {
    grid-template-columns: 1fr;
  }

  .dashboard-heading,
  .dashboard-upload-panel {
    display: grid;
  }

  .dashboard-heading-actions {
    justify-items: start;
  }

  .dashboard-upload-form,
  .dashboard-upload-panel,
  .dashboard-split,
  .sirce-catalog,
  .dc3-row,
  .dc3-section-head,
  .climate-campaign,
  .dashboard5-trends-layout,
  .dashboard5-layout {
    grid-template-columns: 1fr;
  }

  .public-climate {
    padding: 10px;
  }

  .dashboard-legend {
    justify-content: flex-start;
  }
}
/* Base visual del modulo Workflow. */
.workflow-home {
  max-width: 980px;
}

.workflow-placeholder {
  display: grid;
  gap: 0.5rem;
  margin: 1.5rem 0;
  padding: 2rem;
  border: 1px dashed #94a3b8;
  border-radius: 14px;
  background: #f8fafc;
}

.workflow-placeholder strong {
  font-size: 1.15rem;
}
