:root {
  --blue: #153f7a;
  --red: #d71920;
  --ink: #172033;
  --muted: #667085;
  --line: #d9dee8;
  --bg: #f5f7fb;
  --white: #fff;
  --green: #168a4a;
  --action-green: #3eb489;
  --yellow: #d99a00;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;
  font-size: .8rem;
  background: var(--bg);
  color: var(--ink);
}
a { color: var(--blue); text-decoration: none; }
.topbar {
  height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  background: var(--white);
  border-bottom: 1px solid var(--line);
}
.brand { display: inline-flex; align-items: center; gap: 12px; font-weight: 700; }
.brand img { height: 42px; width: auto; }
.topbar-right {
  display: grid;
  justify-items: end;
  gap: 7px;
}
.topbar nav {
  display: flex;
  align-items: center;
  gap: 18px;
  font-size: .76rem;
}
.menu-dropdown {
  position: relative;
}
.menu-dropdown summary {
  color: var(--blue);
  cursor: pointer;
  list-style: none;
}
.menu-dropdown summary::-webkit-details-marker { display: none; }
.dropdown-panel {
  position: absolute;
  right: 0;
  top: 28px;
  z-index: 20;
  min-width: 170px;
  display: grid;
  gap: 2px;
  padding: 8px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 14px 30px rgba(23,32,51,.14);
}
.dropdown-panel a {
  display: block;
  padding: 9px 10px;
  border-radius: 6px;
}
.dropdown-panel a:hover { background: #eef3f9; }
.user-strip {
  display: grid;
  justify-items: end;
  gap: 2px;
  color: var(--muted);
  font-size: .78rem;
}
.user-strip strong {
  color: var(--ink);
  font-size: .86rem;
}
.shell { width: min(1180px, calc(100% - 36px)); margin: 28px auto; }
.login-panel {
  width: min(430px, 100%);
  margin: 8vh auto;
  padding: 32px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 18px 40px rgba(23,32,51,.10);
}
.login-logo { width: 210px; display: block; margin: 0 auto 18px; }
h1, h2 { letter-spacing: 0; }
h1 { margin: 0 0 8px; color: var(--blue); font-size: 1.6rem; }
h2 { margin: 0 0 16px; font-size: .92rem; }
.section-head { margin-bottom: 22px; }
.section-head p, .hint { color: var(--muted); margin: 0; }
.panel {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 22px;
}
.map-panel { margin-bottom: 18px; padding: 12px; overflow: auto; }
.region-map { display: block; width: 100%; min-width: 760px; height: auto; }
.region-map svg { display: block; width: 100%; height: auto; }
.form { display: grid; gap: 16px; }
.form.wide { max-width: 980px; }
.form.compact { margin-top: 14px; gap: 10px; }
.form-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.form-row:has(label:nth-child(3)) { grid-template-columns: repeat(3, minmax(0, 1fr)); }
label { display: grid; gap: 7px; font-weight: 700; font-size: .74rem; }
input, select, textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 10px 12px;
  font: inherit;
  background: var(--white);
}
button, .button {
  border: 0;
  border-radius: 6px;
  background: var(--action-green);
  color: var(--white);
  padding: 11px 16px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  justify-content: center;
}
.secondary-button {
  background: #eef3f9;
  color: var(--blue);
  border: 1px solid var(--line);
}
.blue-button {
  background: var(--blue);
}
.danger-button {
  background: #b42318;
}
.small-button {
  padding: 7px 10px;
  font-size: .66rem;
}
.workspace-grid, .dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(280px, .65fr);
  gap: 18px;
  align-items: start;
}
.admin-dashboard {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 330px;
  gap: 28px;
  align-items: start;
}
.dashboard-main { min-width: 0; }
.admin-metrics {
  grid-template-columns: repeat(6, minmax(118px, 1fr));
}
.admin-kpi-groups {
  display: grid;
  gap: 18px;
  margin-bottom: 18px;
}
.kpi-group {
  display: grid;
  gap: 12px;
}
.kpi-group h2 {
  margin: 0;
  color: var(--blue);
}
.kpi-group .metric-grid {
  margin-bottom: 0;
}
.progress-panel {
  display: grid;
  gap: 18px;
  align-content: start;
  min-height: 360px;
}
.progress-ring {
  --pct: 0;
  width: min(220px, 100%);
  aspect-ratio: 1;
  justify-self: center;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at center, var(--white) 0 58%, transparent 59%),
    conic-gradient(var(--blue) calc(var(--pct) * 1%), #e5eaf3 0);
}
.progress-ring span {
  color: var(--blue);
  font-size: 2.1rem;
  font-weight: 800;
}
.goal-line {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.goal-line span,
.status-bars span { color: var(--muted); }
.goal-line strong,
.status-bars strong { color: var(--blue); }
.status-bars {
  display: grid;
  gap: 10px;
}
.status-bars div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #f9fbfe;
}
.status-bars .delay {
  border-color: #f1b8b8;
  background: #fff4f4;
}
.status-bars .delay strong { color: var(--red); }
.territory-map-grid {
  display: grid;
  grid-template-columns: minmax(360px, .95fr) minmax(520px, 1.25fr);
  gap: 22px;
  align-items: start;
  margin-top: 34px;
  padding-top: 28px;
  border-top: 1px solid var(--line);
}
.compact-head { margin-bottom: 18px; }
.dashboard-map {
  background: transparent;
  border: 0;
  padding: 0;
  overflow: visible;
}
.dashboard-map .region-map {
  min-width: 0;
}
.admin-map-panel .region-map {
  min-width: 0;
  max-width: 900px;
  margin: 0 auto;
}
.admin-filter-panel {
  display: grid;
  grid-template-columns: auto minmax(180px, 260px) minmax(180px, 260px) auto auto;
  gap: 14px;
  align-items: end;
  margin-bottom: 18px;
}
.admin-structure-filters {
  display: grid;
  grid-template-columns: repeat(5, minmax(140px, 1fr)) auto auto;
  gap: 14px;
  align-items: end;
  margin-bottom: 18px;
}
.audit-filters,
.activity-filters {
  display: grid;
  grid-template-columns: minmax(220px, 1.4fr) repeat(4, minmax(130px, 1fr)) auto auto;
  gap: 14px;
  align-items: end;
  margin-bottom: 18px;
}
.activity-filters {
  grid-template-columns: minmax(220px, 1.2fr) repeat(2, minmax(130px, 1fr)) auto auto;
}
.structure-jumbotron {
  border-top: 8px solid var(--blue);
}
.structure-jumbotron .collapsed-tabs {
  margin: 0 0 16px;
}
.progress-table tbody tr.progress-complete td {
  background: #efffe1;
}
.progress-table tbody tr.progress-low td {
  background: #f9f4f5;
}
.progress-table tbody tr.progress-mid td {
  background: #fffee0;
}
.progress-table tbody tr td:first-child {
  font-weight: 700;
}
.segmented-control,
.map-toggle {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #eef3f9;
}
.segmented-control a,
.map-toggle button {
  min-height: 38px;
  padding: 9px 13px;
  border-radius: 6px;
  background: transparent;
  color: var(--blue);
  border: 0;
  font-weight: 800;
}
.segmented-control a.active,
.map-toggle button.active {
  background: var(--blue);
  color: var(--white);
}
.admin-map-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 18px;
  align-items: start;
  margin-bottom: 18px;
}
.admin-map-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  margin-bottom: 14px;
}
.admin-map-head h2 { margin: 0; }
.region-list {
  display: grid;
  gap: 9px;
}
.region-chip {
  display: grid;
  grid-template-columns: 16px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--ink);
  background: #fbfcff;
  font-weight: 700;
}
.region-chip span {
  width: 16px;
  height: 16px;
  border-radius: 4px;
  background: var(--region-color);
  border: 1px solid rgba(23,32,51,.22);
}
.region-chip.active {
  border-color: var(--blue);
  box-shadow: 0 8px 20px rgba(21,63,122,.12);
}
.slicers { display: grid; gap: 12px; }
.chip {
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 10px 12px;
  color: var(--muted);
}
.chip.active { border-color: var(--blue); color: var(--blue); font-weight: 700; }
.assigned-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.scoped-dashboard { margin-top: 18px; }
.nested-panel {
  margin: 0 0 18px;
  background: #fbfcff;
}
.subsection {
  display: grid;
  gap: 14px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcff;
}
.compact-map-grid { margin-top: 12px; padding-top: 18px; }
.disabled-province {
  opacity: .28;
  cursor: not-allowed;
  pointer-events: none;
}
.legend { display: grid; gap: 8px; margin-top: 10px; color: var(--muted); }
.dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; margin-right: 8px; }
.dot.empty { background: var(--muted); }
.dot.progress { background: var(--yellow); }
.dot.approved { background: var(--green); }
.metric-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}
.metric {
  padding: 18px;
  background: var(--white);
  border: 1px solid var(--line);
  border-left: 5px solid var(--blue);
  border-radius: 8px;
  box-shadow: 0 8px 20px rgba(21,63,122,.06);
}
.metric-grid .metric:nth-child(6n+1) {
  border-left-color: var(--blue);
  background: linear-gradient(180deg, #fff 0%, #eef4ff 100%);
}
.metric-grid .metric:nth-child(6n+2) {
  border-left-color: #3eb489;
  background: linear-gradient(180deg, #fff 0%, #effbf6 100%);
}
.metric-grid .metric:nth-child(6n+3) {
  border-left-color: #d99a00;
  background: linear-gradient(180deg, #fff 0%, #fff8e3 100%);
}
.metric-grid .metric:nth-child(6n+4) {
  border-left-color: #256291;
  background: linear-gradient(180deg, #fff 0%, #eef8fc 100%);
}
.metric-grid .metric:nth-child(6n+5) {
  border-left-color: #7a4eb8;
  background: linear-gradient(180deg, #fff 0%, #f4efff 100%);
}
.metric-grid .metric:nth-child(6n+6) {
  border-left-color: #d71920;
  background: linear-gradient(180deg, #fff 0%, #fff0f0 100%);
}
.metric-button {
  display: block;
  text-align: left;
  color: var(--ink);
}
.metric-button:hover {
  border-color: var(--blue);
  box-shadow: 0 8px 20px rgba(21,63,122,.12);
}
.metric span { color: var(--muted); display: block; margin-bottom: 8px; }
.metric strong { color: var(--blue); font-size: 1.8rem; }
.metric-alert {
  border-color: #f1b8b8;
  background: #fff4f4;
}
.metric-alert strong { color: var(--red); }
.executive-grid {
  display: grid;
  grid-template-columns: minmax(260px, .8fr) minmax(300px, 1fr) minmax(300px, 1fr);
  gap: 18px;
  margin-bottom: 18px;
}
.executive-grid.lower {
  grid-template-columns: minmax(300px, .9fr) minmax(320px, 1.1fr) minmax(280px, .8fr);
}
.executive-card {
  display: grid;
  gap: 14px;
  align-content: start;
}
.executive-card h2 {
  margin: 0;
  color: var(--blue);
}
.donut-chart {
  --pct: 0;
  width: 170px;
  aspect-ratio: 1;
  justify-self: center;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at center, var(--white) 0 57%, transparent 58%),
    conic-gradient(var(--action-green) calc(var(--pct) * 1%), #e5eaf3 0);
}
.donut-chart strong {
  color: var(--blue);
  font-size: 1.9rem;
}
.chart-legend {
  display: grid;
  gap: 8px;
}
.chart-legend div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid #edf1f7;
}
.chart-legend i,
.mini-legend i {
  width: 10px;
  height: 10px;
  display: inline-block;
  border-radius: 3px;
  margin-right: 6px;
}
.funnel-chart {
  display: grid;
  gap: 10px;
  align-content: center;
  min-height: 180px;
}
.funnel-bar {
  min-width: 150px;
  height: 38px;
  border-radius: 7px;
  color: var(--white);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 12px;
  font-weight: 700;
}
.funnel-chart.compact {
  min-height: 132px;
}
.donut-chart.compact {
  width: 138px;
}
.donut-chart.compact strong {
  font-size: 1.55rem;
}
.scoped-visual-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(240px, 1fr));
  gap: 14px;
  margin: 18px 0;
}
.weekly-progress {
  display: grid;
  gap: 12px;
  align-content: center;
}
.weekly-progress strong {
  color: var(--blue);
  font-size: 2rem;
}
.weekly-progress span {
  color: var(--muted);
}
.funnel-bar.proposed { background: #256291; }
.funnel-bar.preapproved { background: #7a4eb8; }
.funnel-bar.ratified { background: var(--action-green); }
.ranking-bars {
  display: grid;
  gap: 10px;
}
.ranking-row {
  display: grid;
  grid-template-columns: 110px 1fr 42px;
  gap: 10px;
  align-items: center;
}
.ranking-track {
  height: 12px;
  background: #e8eef7;
  border-radius: 999px;
  overflow: hidden;
}
.ranking-track i {
  display: block;
  height: 100%;
}
.ranking-track i.complete { background: var(--action-green); }
.ranking-track i.mid { background: var(--yellow); }
.ranking-track i.low { background: var(--red); }
.weekly-chart {
  min-height: 210px;
  display: flex;
  gap: 14px;
  align-items: end;
}
.week-column {
  flex: 1;
  display: grid;
  gap: 6px;
  justify-items: center;
  color: var(--muted);
  text-align: center;
}
.week-bars {
  height: 145px;
  display: flex;
  align-items: end;
  justify-content: center;
  gap: 5px;
  width: 100%;
  border-bottom: 1px solid var(--line);
}
.week-bars span {
  width: 20px;
  min-height: 0;
  display: block;
  border-radius: 5px 5px 0 0;
}
.scheduled { background: #b8c7dd; }
.done { background: var(--action-green); }
.late { background: var(--red); }
.mini-legend {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  color: var(--muted);
}
.region-heatmap {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
}
.heat-cell {
  min-height: 76px;
  display: grid;
  align-content: center;
  gap: 4px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
}
.heat-cell strong { color: var(--blue); }
.heat-cell.complete { background: #efffe1; }
.heat-cell.mid { background: #fffee0; }
.heat-cell.low { background: #f9f4f5; }
.alert-list {
  display: grid;
  gap: 10px;
}
.alert-item {
  display: grid;
  gap: 4px;
  padding: 11px;
  border-left: 5px solid var(--yellow);
  border-radius: 8px;
  background: #fffaf0;
}
.alert-item.retraso {
  border-left-color: var(--red);
  background: #fff4f4;
}
.alert-item.aprobacion {
  border-left-color: var(--blue);
  background: #eef4ff;
}
.alert-item small { color: var(--muted); }
.actions { margin: 0 0 18px; }
table { width: 100%; border-collapse: collapse; font-size: .74rem; }
th, td { border-bottom: 1px solid var(--line); text-align: left; padding: 11px 9px; vertical-align: top; }
th { color: var(--muted); font-size: .62rem; text-transform: uppercase; }
.text-long { max-width: 260px; white-space: normal; line-height: 1.35; }
.big-date { font-size: 1.8rem; font-weight: 700; color: var(--blue); margin: 0 0 8px; }
.messages { display: grid; gap: 8px; margin-bottom: 18px; }
.message { padding: 12px 14px; border-radius: 6px; background: #e9eef8; border: 1px solid var(--line); }
.message.error { background: #fff0f0; color: #9f1d20; }
.message.success { background: #edf8f1; color: #126c3b; }
.grid-form { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
.inline-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.inline-actions form { margin: 0; }
.inline-actions button { padding: 7px 10px; }
.note { border-left: 4px solid var(--blue); padding: 8px 12px; background: #f7f9fd; margin-bottom: 8px; }
.minute-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 18px;
  margin-bottom: 18px;
}
.minute-tabs-panel {
  border-top: 8px solid #27ae4b;
}
.tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}
.collapsed-tabs {
  padding: 18px;
  margin: -14px -14px 16px;
  border-radius: 8px;
  background: linear-gradient(180deg, #f9fbff 0%, #eef3f9 100%);
  border: 1px solid var(--line);
}
.tab-button {
  background: #eef3f9;
  color: var(--blue);
  border: 1px solid var(--line);
  padding: 10px 14px;
  min-height: 46px;
  box-shadow: inset 0 -1px 0 rgba(23,32,51,.04);
}
.tab-button.active {
  background: var(--blue);
  color: var(--white);
}
.tab-button::after {
  content: "+";
  margin-left: 10px;
  font-weight: 800;
}
.tab-button.active::after {
  content: "-";
}
.tab-content { display: none; }
.tab-content.active {
  display: grid;
  gap: 16px;
}
.jumbotron-tab.active {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 16px 30px rgba(23,32,51,.07);
}
.minute-metrics {
  grid-template-columns: repeat(4, minmax(120px, 1fr));
}
.agreements-panel {
  border-top: 8px solid var(--red);
}
.table-wrap {
  width: 100%;
  overflow-x: auto;
}
.audit-table {
  max-height: 620px;
  overflow: auto;
}
.audit-detail {
  max-width: 460px;
  max-height: 120px;
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
  font-size: .78rem;
  color: var(--muted);
}
.muted {
  color: var(--muted);
  font-size: .66rem;
}
.limited-table-scroll {
  max-height: 360px;
  overflow: auto;
}
.limited-table-scroll thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--white);
}
.check-line {
  display: inline-flex;
  grid-template-columns: none;
  align-items: center;
  gap: 8px;
  font-weight: 700;
}
.check-line input {
  width: auto;
}
.switch {
  display: inline-flex;
  align-items: center;
  width: auto;
}
.switch input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.switch span {
  width: 46px;
  height: 24px;
  border-radius: 999px;
  background: #d9dee8;
  position: relative;
  transition: background .18s ease;
  cursor: pointer;
}
.switch span::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--white);
  box-shadow: 0 1px 4px rgba(23,32,51,.25);
  transition: transform .18s ease;
}
.switch input:checked + span {
  background: var(--blue);
}
.switch input:checked + span::after {
  transform: translateX(22px);
}
.assistance-form {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: #fbfcff;
}
.file-dropzone {
  position: relative;
  min-height: 132px;
  display: grid;
  place-items: center;
  gap: 8px;
  margin: 16px 0;
  padding: 22px;
  text-align: center;
  border: 2px dashed #aab6c8;
  border-radius: 8px;
  background: #fbfcff;
  color: var(--muted);
  cursor: pointer;
}
.file-dropzone strong {
  color: var(--blue);
  font-size: 1rem;
}
.file-dropzone input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}
.file-dropzone.dragover {
  border-color: var(--blue);
  background: #eef3f9;
}
.file-dropzone-icon {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: var(--blue);
  color: var(--white);
  font-size: 1.5rem;
  font-weight: 800;
}
.file-list {
  margin: -6px 0 18px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--white);
  color: var(--muted);
  font-size: .9rem;
}
.file-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 3px 6px 3px 0;
  padding: 5px 7px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #eef3f9;
  color: var(--ink);
  font-weight: 600;
}
.file-chip button {
  min-height: 0;
  padding: 3px 7px;
  border: 0;
  border-radius: 5px;
  background: #d92d20;
  color: var(--white);
  font-size: .78rem;
}
.photo-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 12px;
  margin-top: 14px;
}
.photo-card {
  margin: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
}
.photo-card img {
  width: 100%;
  aspect-ratio: 4 / 3;
  display: block;
  object-fit: cover;
  background: #eef3f9;
}
.photo-card figcaption {
  display: grid;
  gap: 4px;
  padding: 8px;
}
.photo-card strong {
  font-size: .82rem;
  line-height: 1.25;
}
.photo-card small {
  color: var(--muted);
  font-size: .76rem;
}
.search-results {
  display: grid;
  gap: 6px;
}
.search-results button {
  justify-content: flex-start;
  background: #eef3f9;
  color: var(--ink);
  border: 1px solid var(--line);
  padding: 8px 10px;
  font-weight: 600;
}
.lookup-line {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
}
.lookup-line button {
  min-height: 38px;
  padding: 8px 14px;
  background: var(--blue);
  color: var(--white);
}
.assignment-builder {
  margin-top: 10px;
}
.assignment-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-height: 36px;
  margin-top: 10px;
}
.assignment-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #eef3f9;
  color: var(--ink);
  font-weight: 700;
}
.assignment-chip button {
  min-height: 0;
  padding: 3px 7px;
  border: 0;
  border-radius: 5px;
  background: #d92d20;
  color: var(--white);
  font-size: .78rem;
}
.kpi-dialog {
  width: min(760px, calc(100% - 32px));
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 22px;
}
.kpi-dialog::backdrop {
  background: rgba(23,32,51,.45);
}
.dialog-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 16px;
}
.dialog-head h2 { margin: 0; }
.cargo-form {
  grid-template-columns: minmax(220px, 1fr) 110px 150px 120px 150px;
  align-items: end;
}
.panel-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: end;
  margin-bottom: 14px;
}
.panel-head h2 {
  margin: 0;
}
.inline-date-filter {
  display: grid;
  grid-template-columns: minmax(150px, 1fr) auto auto;
  gap: 8px;
  align-items: end;
}
.schedule-panel {
  display: grid;
  gap: 16px;
}
.schedule-list {
  display: grid;
  gap: 10px;
  max-height: 260px;
  overflow: auto;
}
.schedule-item {
  display: grid;
  gap: 3px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-left: 5px solid var(--yellow);
  border-radius: 6px;
  background: #fffaf0;
}
.schedule-item.done {
  border-left-color: var(--action-green);
  background: #effbf6;
}
.schedule-item span,
.schedule-item small {
  color: var(--muted);
}

@media (max-width: 850px) {
  .topbar { height: auto; padding: 14px 18px; gap: 12px; align-items: flex-start; }
  .topbar-right { justify-items: start; }
  .topbar nav { flex-wrap: wrap; gap: 12px; }
  .user-strip { justify-items: start; }
  .workspace-grid, .dashboard-grid, .metric-grid, .form-row, .grid-form,
  .admin-dashboard, .territory-map-grid, .minute-layout,
  .admin-filter-panel, .admin-map-layout, .admin-structure-filters, .audit-filters, .activity-filters,
  .executive-grid, .executive-grid.lower, .scoped-visual-grid {
    grid-template-columns: 1fr;
  }
  .panel-head, .inline-date-filter {
    display: grid;
    grid-template-columns: 1fr;
    align-items: stretch;
  }
  .admin-map-head { align-items: flex-start; flex-direction: column; }
  .minute-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .admin-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dashboard-map .region-map { min-width: 700px; }
}
