/* ============================================================
   DashMovilidad – Minimalista Pro
   ============================================================ */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  /* Palette OXXO */
  --brand: #E0192A;
  --brand-l: rgba(224, 25, 42, .12);
  --brand2: #FFC600;
  --brand2-l: rgba(255, 198, 0, .15);
  --green: #10b981;
  --green-l: rgba(16, 185, 129, .1);
  --yellow: #f59e0b;
  --yellow-l: rgba(245, 158, 11, .1);
  --red: #ef4444;
  --red-l: rgba(239, 68, 68, .1);
  --blue: #3b82f6;
  --blue-l: rgba(59, 130, 246, .1);
  --purple: #8b5cf6;

  /* Surface */
  --bg: #f4f6f8;
  --surface: #ffffff;
  --surface2: #f8fafc;
  --border: rgba(0, 0, 0, .1);

  /* Text */
  --t1: #111827;
  --t2: #4b5563;
  --t3: #9ca3af;

  /* Spacing & shape */
  --r: 10px;
  --r-s: 6px;
  --gap: 14px;
}

/* --- App Navigation --- */
.app-nav {
  max-width: 820px;
  margin: 32px auto 0;
  padding: 0 20px;
  display: flex;
  gap: 8px;
}

.nav-tab {
  flex: 1;
  padding: 12px;
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: var(--r) var(--r) 0 0;
  font-size: .85rem;
  font-weight: 700;
  color: var(--t2);
  cursor: pointer;
  text-align: center;
  transition: all .2s;
  border-bottom: none;
}

.nav-tab.active {
  background: var(--brand);
  color: #fff;
  border-color: var(--brand);
}

.nav-tab:hover:not(.active) {
  background: var(--surface2);
  color: var(--t1);
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', system-ui, sans-serif;
  background: var(--bg);
  color: var(--t1);
  min-height: 100vh;
  font-size: 14px;
}

::-webkit-scrollbar {
  width: 4px;
}

::-webkit-scrollbar-thumb {
  background: rgba(99, 102, 241, .25);
  border-radius: 9px;
}

/* ─────────────────────────────────────────
   FORM VIEW
───────────────────────────────────────── */
#form-view, #factors-view {
  max-width: 820px;
  margin: 0 auto;
  padding: 0 20px 120px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 0 0 var(--r) var(--r);
  box-shadow: 0 10px 30px rgba(0,0,0,.05);
}

#factors-view {
  display: none;
}

.view-header {
  padding: 32px 18px 24px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 24px;
}

/* Top brand strip */
.view-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 32px;
  padding: 32px 18px 24px;
  border-bottom: 1px solid var(--border);
}

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

.logo-icon {
  width: 40px;
  height: 40px;
  background: var(--brand);
  border-radius: 9px;
  display: grid;
  place-items: center;
}

.logo-icon svg {
  width: 20px;
  height: 20px;
  color: #fff;
}

.logo-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--t1);
  display: block;
}

.logo-sub {
  font-size: .72rem;
  color: var(--t2);
  display: block;
}

.form-headline {
  flex: 1;
  font-size: 1.45rem;
  font-weight: 800;
  color: var(--t1);
  letter-spacing: -.02em;
}

.form-subhead {
  display: none;
}

/* minimal: no subhead in header */

/* Section */
.form-section {
  margin-bottom: 16px;
  border: 1px solid var(--border);
  border-radius: var(--r);
  overflow: hidden;
  background: var(--surface2);
}

.fs-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  cursor: default;
}

.fs-num {
  width: 22px;
  height: 22px;
  background: var(--brand-l);
  border: 1px solid var(--brand);
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: .65rem;
  font-weight: 800;
  color: var(--brand);
  flex-shrink: 0;
}

.fs-header > div {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
}

.fs-title {
  font-size: .9rem;
  font-weight: 700;
  color: var(--t1);
  white-space: nowrap;
}

.fs-desc {
  font-size: .73rem;
  color: var(--t2);
  text-align: right;
  overflow: hidden;
  text-overflow: ellipsis;
}

.form-section>.form-grid,
.form-section>.fg,
.form-section>div:not(.fs-header) {
  padding: 16px 18px;
  background: var(--surface2);
}

/* Override for direct children that are grids */
.form-section .form-grid {
  padding: 16px 18px;
  background: var(--surface2);
}

.form-section .form-grid+.form-grid {
  border-top: 1px solid var(--border);
}

.form-grid {
  display: grid;
  gap: var(--gap);
  background: var(--surface2);
  padding: 16px 18px;
}

.col-1 {
  grid-template-columns: 1fr;
  max-width: 260px;
}

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

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

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

.form-device-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-s);
}

.fdc-title {
  font-size: .78rem;
  font-weight: 700;
  color: var(--t1);
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

/* Field */
.fg {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 0;
}

.fl {
  font-size: .7rem;
  font-weight: 600;
  color: var(--t2);
  letter-spacing: .03em;
  text-transform: uppercase;
}

.fi-wrap {
  display: flex;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: var(--r-s);
  background: var(--surface);
  transition: border-color .15s;
}

.fi-wrap:focus-within {
  border-color: var(--brand);
}

.fi-wrap.fi-green {
  border-left: 2px solid var(--green);
}

.fi-wrap.fi-red {
  border-left: 2px solid var(--red);
}

.fi-wrap.fi-orange {
  border-left: 2px solid var(--yellow);
}

.fi-wrap.fi-blue {
  border-left: 2px solid var(--blue);
}

.fi-wrap.fi-purple {
  border-left: 2px solid var(--purple);
}

.si-auth-wrap {
  border-left: 2px solid var(--yellow);
}

.si-ok-wrap {
  border-left: 2px solid var(--green);
}

.si-wait-wrap {
  border-left: 2px solid var(--blue);
}

.si-recv-wrap {
  border-left: 2px solid #06b6d4;
}

.fi-prefix {
  display: grid;
  place-items: center;
  width: 32px;
  font-size: .78rem;
  color: var(--t3);
  flex-shrink: 0;
}

.si-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
  margin: 0 10px;
}

.si-dot-auth {
  background: var(--yellow);
}

.si-dot-ok {
  background: var(--green);
}

.si-dot-wait {
  background: var(--blue);
}

.si-dot-recv {
  background: #06b6d4;
}

.fi {
  flex: 1;
  width: 100%;
  min-width: 0;
  padding: 9px 10px 9px 0;
  background: transparent;
  border: none;
  outline: none;
  color: var(--t1);
  font-size: .9rem;
  font-weight: 600;
  font-family: 'Inter', sans-serif;
}

.fi::placeholder {
  color: var(--t3);
  font-weight: 400;
}

.fi.fi-lg {
  font-size: 1.15rem;
  padding: 12px 12px 12px 0;
}

select.fi {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' stroke='%234b5563' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' viewBox='0 0 24 24'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 16px;
  padding-right: 38px !important;
  cursor: pointer;
}

/* CSV Drop Zone */
.csv-drop-zone {
  margin: 16px 18px;
  border: 1.5px dashed var(--border);
  border-radius: var(--r);
  padding: 28px 24px;
  text-align: center;
  transition: border-color .15s, background .15s;
  cursor: pointer;
  background: var(--surface2);
}

.csv-drop-zone:hover,
.csv-drop-zone.over {
  border-color: var(--brand);
  background: var(--brand-l);
}

.csv-icon {
  margin-bottom: 12px;
}

.csv-icon svg {
  width: 36px;
  height: 36px;
  color: var(--t3);
}

.csv-drop-zone:hover .csv-icon svg,
.csv-drop-zone.over .csv-icon svg {
  color: var(--brand);
}

.csv-main-text {
  font-size: .88rem;
  font-weight: 600;
  color: var(--t1);
  margin-bottom: 4px;
}

.csv-sub-text {
  font-size: .75rem;
  color: var(--t2);
  margin-bottom: 14px;
}

.csv-sub-text code {
  background: rgba(0, 0, 0, .03);
  padding: 1px 5px;
  border-radius: 4px;
  font-size: .7rem;
  color: var(--brand);
}

.btn-browse {
  padding: 7px 18px;
  border-radius: var(--r-s);
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--t1);
  font-size: .8rem;
  font-weight: 600;
  cursor: pointer;
  font-family: 'Inter', sans-serif;
  transition: all .15s;
}

.btn-browse:hover {
  border-color: var(--brand);
  color: var(--brand);
}

.csv-loaded-content {
  display: flex;
  align-items: center;
  gap: 14px;
  justify-content: center;
}

.csv-loaded-icon {
  font-size: 1.6rem;
}

.csv-file-name {
  font-size: .88rem;
  font-weight: 700;
  color: var(--t1);
}

.csv-file-rows {
  font-size: .73rem;
  color: var(--t2);
  margin-top: 2px;
}

.btn-remove-csv {
  background: none;
  border: 1px solid var(--border);
  color: var(--t2);
  border-radius: var(--r-s);
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  cursor: pointer;
  font-size: .75rem;
  transition: all .15s;
}

.btn-remove-csv:hover {
  border-color: var(--red);
  color: var(--red);
}

.csv-preview {
  margin: 8px 18px 16px;
  padding: 12px 14px;
  background: var(--surface);
  border-radius: var(--r-s);
  border: 1px solid var(--border);
}

.csv-preview-title {
  font-size: .68rem;
  font-weight: 600;
  color: var(--t2);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: .04em;
}

.csv-columns-list {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.csv-col-tag {
  padding: 2px 8px;
  border-radius: 4px;
  font-size: .68rem;
  font-weight: 600;
  background: var(--surface2);
  color: var(--t2);
  border: 1px solid var(--border);
}

.csv-col-tag.required {
  background: var(--green-l);
  color: var(--green);
  border-color: rgba(16, 185, 129, .2);
}

.csv-warning {
  margin-top: 8px;
  font-size: .75rem;
  color: var(--yellow);
}

/* Submit */
.form-submit-area {
  display: flex;
  justify-content: center;
  padding: 24px 0 0;
}

.btn-generate {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 36px;
  background: var(--brand);
  color: #fff;
  border: none;
  border-radius: var(--r);
  font-size: .9rem;
  font-weight: 700;
  cursor: pointer;
  font-family: 'Inter', sans-serif;
  letter-spacing: -.01em;
  transition: opacity .15s, transform .15s;
}

.btn-generate:hover {
  opacity: .9;
  transform: translateY(-1px);
}

.btn-generate:active {
  transform: translateY(0);
}

.btn-generate svg {
  width: 18px;
  height: 18px;
}

/* ─────────────────────────────────────────
   DASHBOARD TOOLBAR (no se exporta)
───────────────────────────────────────── */
.dash-toolbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, .92);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  padding: 10px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.btn-back {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: var(--r-s);
  background: none;
  border: 1px solid var(--border);
  color: var(--t2);
  font-size: .8rem;
  font-weight: 600;
  cursor: pointer;
  font-family: 'Inter', sans-serif;
  transition: all .15s;
}

.btn-back:hover {
  color: var(--t1);
  border-color: var(--t2);
}

.btn-back svg {
  width: 14px;
  height: 14px;
}

.toolbar-title {
  font-size: .88rem;
  font-weight: 700;
  color: var(--t1);
}

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

.btn-exp {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: var(--r-s);
  font-size: .78rem;
  font-weight: 600;
  cursor: pointer;
  font-family: 'Inter', sans-serif;
  border: 1px solid;
  transition: all .15s;
}

.btn-exp svg {
  width: 14px;
  height: 14px;
}

.btn-jpg {
  background: none;
  color: var(--green);
  border-color: rgba(16, 185, 129, .3);
}

.btn-jpg:hover {
  background: var(--green-l);
}

.btn-pdf {
  background: none;
  color: var(--t2);
  border-color: var(--border);
}

.btn-pdf:hover {
  color: var(--t1);
  border-color: var(--t2);
}

/* ─────────────────────────────────────────
   DASHBOARD PAGE (exportable)
───────────────────────────────────────── */
.dashboard-page {
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px 24px 40px;
  background: var(--bg);
}

/* ── HEADER ─── */
.dp-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px;
  border: 1px solid var(--border);
  border-radius: var(--r);
  margin-bottom: 20px;
  background: var(--surface);
}

.dp-header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.dp-brand-icon {
  width: 36px;
  height: 36px;
  background: var(--brand);
  border-radius: var(--r-s);
  display: grid;
  place-items: center;
}

.dp-brand-icon svg {
  width: 18px;
  height: 18px;
  color: #fff;
}

.dp-brand-name {
  font-size: .95rem;
  font-weight: 800;
  color: var(--t1);
  letter-spacing: -.01em;
}

.dp-report-label {
  font-size: .7rem;
  color: var(--t2);
  margin-top: 1px;
}

.dp-header-right {
  display: flex;
  align-items: center;
  gap: 28px;
}

.dp-header-stores {
  text-align: center;
}

.dp-stores-num {
  display: block;
  font-size: 1.8rem;
  font-weight: 900;
  color: var(--brand);
  line-height: 1;
}

.dp-stores-label {
  font-size: .68rem;
  color: var(--t2);
}

.dp-header-date {
  text-align: right;
}

.dp-date-label {
  font-size: .65rem;
  color: var(--t3);
  text-transform: uppercase;
  letter-spacing: .05em;
}

.dp-date-val {
  font-size: .82rem;
  color: var(--t1);
  font-weight: 600;
  margin-top: 2px;
}

/* ── SECTION LABEL ─── */
.dp-section-label {
  font-size: .65rem;
  font-weight: 700;
  letter-spacing: .08em;
  color: var(--t3);
  text-transform: uppercase;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.dp-section-sublabel {
  font-weight: 600;
  color: var(--brand);
  font-size: .7rem;
  letter-spacing: 0;
  text-transform: none;
}

/* ── KPI SECTION ─── */
.dp-kpi-section {
  margin-bottom: 20px;
}

.dp-kpi-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--gap);
}

.dp-kpi-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 16px;
}

.dp-kpi-device {
  font-size: .78rem;
  font-weight: 700;
  color: var(--t1);
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}

.dp-kpi-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.dp-stat {
  padding: 8px 6px;
  border-radius: var(--r-s);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  border: 1px solid var(--border);
}

.dp-stat.green {
  background: var(--green-l);
  border-color: rgba(16, 185, 129, .15);
}

.dp-stat.red {
  background: var(--red-l);
  border-color: rgba(239, 68, 68, .15);
}

.dp-stat.orange {
  background: var(--yellow-l);
  border-color: rgba(245, 158, 11, .15);
}

.dp-stat.blue {
  background: var(--blue-l);
  border-color: rgba(59, 130, 246, .15);
}

.dp-stat-v {
  font-size: 1.4rem;
  font-weight: 900;
  line-height: 1;
}

.dp-stat.green .dp-stat-v {
  color: var(--green);
}

.dp-stat.red .dp-stat-v {
  color: var(--red);
}

.dp-stat.orange .dp-stat-v {
  color: var(--yellow);
}

.dp-stat.blue .dp-stat-v {
  color: var(--blue);
}

.dp-stat-l {
  font-size: .58rem;
  color: var(--t2);
  font-weight: 500;
  text-align: center;
}

/* SI card */
.dp-kpi-si {
  justify-content: space-between;
}

.dp-si-big {
  font-size: 3rem;
  font-weight: 900;
  color: var(--purple);
  text-align: center;
  line-height: 1;
  padding: 10px 0;
}

.dp-si-statuses {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.dp-si-st {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: .72rem;
  font-weight: 500;
  color: var(--t2);
  padding: 4px 8px;
  border-radius: var(--r-s);
  background: var(--surface2);
}

.dp-si-st span {
  font-weight: 800;
  color: var(--t1);
}

.si-st-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}

.si-st-auth .si-st-dot {
  background: var(--yellow);
}

.si-st-ok .si-st-dot {
  background: var(--green);
}

.si-st-wait .si-st-dot {
  background: var(--blue);
}

.si-st-recv .si-st-dot {
  background: #06b6d4;
}

/* ── CHARTS ─── */
.dp-charts-section {
  display: grid;
  grid-template-columns: 220px 1fr 220px;
  gap: var(--gap);
  margin-bottom: 20px;
}

.dp-chart-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 16px;
}

.dp-chart-title {
  font-size: .72rem;
  font-weight: 700;
  color: var(--t2);
  text-transform: uppercase;
  letter-spacing: .05em;
  margin-bottom: 10px;
}

.dp-chart-wrap {
  position: relative;
  height: 160px;
}

.dp-chart-wrap-bar {
  height: 160px;
}

/* ── CONNECTIVITY ─── */
.dp-connectivity-section {
  margin-bottom: 20px;
}

.dp-conn-cards {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr 200px;
  gap: var(--gap);
}

.dp-conn-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 18px;
  border-top: 2px solid;
}

.dp-conn-green {
  border-top-color: var(--green);
}

.dp-conn-yellow {
  border-top-color: var(--yellow);
}

.dp-conn-red {
  border-top-color: var(--red);
}

.dp-conn-status {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 10px;
}

.dp-conn-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.dp-conn-green .dp-conn-dot {
  background: var(--green);
}

.dp-conn-yellow .dp-conn-dot {
  background: var(--yellow);
}

.dp-conn-red .dp-conn-dot {
  background: var(--red);
}

.dp-conn-status-label {
  font-size: .78rem;
  font-weight: 700;
  color: var(--t1);
}

.dp-conn-time-hint {
  margin-left: auto;
  font-size: .65rem;
  color: var(--t3);
  font-style: italic;
}

.dp-conn-big {
  font-size: 2.8rem;
  font-weight: 900;
  line-height: 1;
  margin-bottom: 12px;
}

.dp-conn-green .dp-conn-big {
  color: var(--green);
}

.dp-conn-yellow .dp-conn-big {
  color: var(--yellow);
}

.dp-conn-red .dp-conn-big {
  color: var(--red);
}

.dp-conn-breakdown {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.dp-conn-type {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: .74rem;
  padding: 5px 8px;
  border: 1px solid var(--border);
  border-radius: var(--r-s);
  background: var(--surface2);
}

.dp-conn-type-icon {
  font-size: .8rem;
}

.dp-conn-type-label {
  color: var(--t2);
  flex: 1;
}

.dp-conn-type-val {
  font-weight: 800;
  color: var(--t1);
}

.dp-conn-other-row {
  display: none;
}

.dp-conn-other-row.visible {
  display: flex;
}

.dp-conn-chart-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 16px;
  display: flex;
  flex-direction: column;
}

.dp-conn-chart-wrap {
  flex: 1;
  position: relative;
  min-height: 120px;
}

/* ── FOOTER ─── */
.dp-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border: 1px solid var(--border);
  border-radius: var(--r);
  margin-top: 20px;
  background: var(--surface);
}

.dp-footer-brand {
  font-size: .72rem;
  color: var(--t2);
  font-weight: 500;
}

.dp-footer-date {
  font-size: .68rem;
  color: var(--t3);
}

/* ── EXPORT LOADING ─── */
.export-loading {
  position: fixed;
  inset: 0;
  z-index: 999;
  background: rgba(255, 255, 255, .8);
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

.export-loading.active {
  display: flex;
}

.export-spinner {
  width: 36px;
  height: 36px;
  border: 3px solid rgba(99, 102, 241, .2);
  border-top-color: var(--brand);
  border-radius: 50%;
  animation: spin .7s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.export-loading p {
  color: var(--t2);
  font-size: .82rem;
}

/* ── PRINT ─── */
@media print {

  .dash-toolbar,
  .no-export {
    display: none !important;
  }

  body {
    background: #fff;
    color: #000;
  }

  .dashboard-page {
    padding: 0;
    max-width: 100%;
  }

  :root {
    --bg: #fff;
    --surface: #f8f8f8;
    --surface2: #f0f0f0;
    --t1: #111;
    --t2: #555;
    --t3: #888;
    --border: #e0e0e0;
  }

  .dp-kpi-card,
  .dp-conn-card,
  .dp-chart-box {
    break-inside: avoid;
  }
}

/* ── RESPONSIVE ─── */
@media (max-width: 1100px) {
  .dp-kpi-row {
    grid-template-columns: repeat(2, 1fr);
  }

  .dp-charts-section {
    grid-template-columns: 1fr 1fr;
  }

  .dp-conn-cards {
    grid-template-columns: 1fr 1fr;
  }
}

/* --- Factors Specific --- */
.factor-card {
  display: grid;
  grid-template-columns: 1fr 120px;
  align-items: center;
  gap: 20px;
  padding: 20px !important;
  background: var(--surface2);
  border-radius: var(--r);
  border: 1px solid var(--border);
  margin-bottom: 12px;
}

.factor-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.factor-name {
  font-weight: 700;
  font-size: .95rem;
  color: var(--t1);
}

.factor-tag {
  font-size: .7rem;
  color: var(--t3);
  text-transform: uppercase;
  letter-spacing: .05em;
}

.score-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.score-input {
  width: 100%;
  padding: 10px 14px;
  border-radius: var(--r-s);
  border: 2px solid var(--border);
  text-align: center;
  font-size: 1.2rem;
  font-weight: 800;
  background: var(--surface);
  color: var(--t1);
  outline: none;
  transition: all .2s;
}

.score-input:focus {
  border-color: var(--brand);
  background: #fff;
}

.score-pct {
  position: absolute;
  right: -25px;
  font-weight: 700;
  color: var(--t3);
}

/* --- Factors Dashboard --- */
.factors-onepage {
  display: block;
  padding: 0;
}

#chart-factors-radar {
  max-width: 100%;
}

#factors-summary-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

@media (max-width: 880px) {
  #factors-summary-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 880px) {

  .col-3,
  .col-4 {
    grid-template-columns: 1fr 1fr;
  }

  .col-2 {
    grid-template-columns: 1fr;
  }

  .dp-kpi-row {
    grid-template-columns: 1fr 1fr;
  }

  .dp-charts-section {
    grid-template-columns: 1fr;
  }

  .dp-conn-cards {
    grid-template-columns: 1fr;
  }

  .dash-toolbar {
    flex-wrap: wrap;
  }

  .dp-header {
    flex-direction: column;
    gap: 14px;
    align-items: flex-start;
  }
}

@media (max-width: 480px) {

  .col-3,
  .col-4,
  .col-2 {
    grid-template-columns: 1fr;
  }

  #form-view {
    padding: 24px 14px 80px;
  }

  .dp-conn-cards,
  .dp-kpi-row {
    grid-template-columns: 1fr;
  }
}