/* CRM Nexus — rediseño “cómodo” (referencia aprobada 2026-10-24):
   contenido claro y amplio, tarjetas grandes redondeadas, números enormes,
   sombras suaves; identidad Nexus en la barra lateral negra con dorado. */
:root {
  --black: #050505;
  --ink: #1a1710;
  --bg: #f5f1e8;
  --card: #ffffff;
  --card-soft: #fbf9f3;
  --line: #e6dfcc;
  --line-soft: #efe8d5;
  --text: #1a1710;
  --muted: #6f6a5c;
  --gold: #b08a1e;
  --gold-bright: #d4af37;
  --gold-2: #f3d677;
  --gold-dark: #7a5c12;
  --danger: #b3362c;
  --danger-bg: #fdecea;
  --success: #1d7a46;
  --success-bg: #e7f6ec;
  --radius: 24px;
  --shadow: 0 12px 34px rgb(26 23 16 / 7%);
  --shadow-lg: 0 22px 55px rgb(26 23 16 / 10%);
  --sidebar-line: #343026;
  --sidebar-text: #ece7d8;
}

* {
  box-sizing: border-box;
}

html {
  color-scheme: light;
}

/* Temas oscuros: base negra compartida y un acento por tema. Se activan
   con data-theme en <html>; el tema claro (Blanco) es el de :root.
   El acento vive en las variables --gold* que usa todo el diseño. */
html[data-theme="negro-dorado"],
html[data-theme="negro-blanco"],
html[data-theme="negro-morado"],
html[data-theme="negro-rojo"] {
  color-scheme: dark;
  --bg: #100f0c;
  --card: #1a1812;
  --card-soft: #221f18;
  --line: #3b372b;
  --line-soft: #2d2a21;
  --text: #f2ecdc;
  --muted: #aca38d;
  --danger: #e58a7d;
  --danger-bg: #40231e;
  --success: #63cf96;
  --success-bg: #173829;
  --shadow: 0 12px 34px rgb(0 0 0 / 45%);
  --shadow-lg: 0 22px 55px rgb(0 0 0 / 55%);
}

html[data-theme="negro-dorado"] {
  --gold: #b08a1e;
  --gold-bright: #d4af37;
  --gold-2: #f3d677;
  --gold-dark: #e6c96a;
}

html[data-theme="negro-blanco"] {
  --bg: #0c0c0c;
  --card: #171717;
  --card-soft: #1f1f1f;
  --line: #383838;
  --line-soft: #292929;
  --text: #f5f5f5;
  --muted: #a3a3a3;
  --gold: #d4d4d4;
  --gold-bright: #ffffff;
  --gold-2: #ffffff;
  --gold-dark: #f5f5f5;
}

html[data-theme="negro-morado"] {
  --bg: #0e0b12;
  --card: #1a1424;
  --card-soft: #221a30;
  --line: #3a2f4d;
  --line-soft: #2b2338;
  --text: #f1ebfa;
  --muted: #a99cc4;
  --gold: #a855f7;
  --gold-bright: #c084fc;
  --gold-2: #d8b4fe;
  --gold-dark: #d8b4fe;
}

html[data-theme="negro-rojo"] {
  --bg: #110c0c;
  --card: #1f1414;
  --card-soft: #291a1a;
  --line: #472c2c;
  --line-soft: #332020;
  --text: #faeeee;
  --muted: #c0a3a3;
  --gold: #ef4444;
  --gold-bright: #f87171;
  --gold-2: #fca5a5;
  --gold-dark: #fca5a5;
}

/* El medidor (gauge) sigue el acento del tema activo. */
.gauge stop[offset="0%"] {
  stop-color: var(--gold-2);
}

.gauge stop[offset="100%"] {
  stop-color: var(--gold);
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-system, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.55;
}

a {
  color: var(--gold-dark);
  font-weight: 650;
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

button,
input,
select,
textarea {
  font: inherit;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--card);
  color: var(--text);
  padding: 0.8rem 0.95rem;
  outline: none;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--gold-bright);
  box-shadow: 0 0 0 4px rgb(212 175 55 / 20%);
}

textarea {
  resize: vertical;
}

label {
  display: grid;
  gap: 0.45rem;
  color: var(--muted);
  font-size: 0.95rem;
  font-weight: 650;
}

fieldset {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card-soft);
  margin: 1.5rem 0;
  padding: 1.25rem;
}

legend {
  color: var(--gold-dark);
  font-weight: 800;
  padding: 0 0.4rem;
}

/* ---------- Estructura: sidebar Nexus + contenido amplio ---------- */

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

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  padding: 1.6rem 1.4rem;
  border-right: 1px solid var(--sidebar-line);
  background: linear-gradient(180deg, #0b0b0a, #050505);
  color: var(--sidebar-text);
}

.brand {
  display: block;
  border-radius: 18px;
  background: #000;
  padding: 0.7rem;
}

.brand img,
.login-card img {
  display: block;
  width: 100%;
  height: auto;
}

.sidebar-kicker,
.eyebrow {
  color: var(--gold);
  font-size: 0.74rem;
  font-weight: 900;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.sidebar-kicker {
  color: var(--gold-bright);
  margin: 0;
}

.main-nav {
  display: grid;
  gap: 0.5rem;
}

.main-nav a {
  border: 1px solid transparent;
  border-radius: 999px;
  color: var(--sidebar-text);
  padding: 0.85rem 1.05rem;
  font-weight: 700;
}

.main-nav a:hover {
  border-color: var(--sidebar-line);
  text-decoration: none;
}

.main-nav a.active {
  background: linear-gradient(135deg, var(--gold-2), var(--gold-bright));
  color: #141005;
}

.sidebar-footer {
  display: grid;
  gap: 0.8rem;
  margin-top: auto;
  color: #b8b0a0;
}

.sidebar-footer form {
  margin: 0;
}

.sidebar-footer .button-ghost {
  border-color: var(--sidebar-line);
  color: var(--sidebar-text);
}

.main-content {
  min-width: 0;
  padding: 2.25rem 2.5rem 3rem;
  max-width: 1560px;
  width: 100%;
  margin: 0 auto;
}

/* ---------- Selector de temas de color (en la barra lateral) -------- */
.theme-picker {
  margin-bottom: 0.9rem;
}

.theme-picker-label {
  display: block;
  margin-bottom: 0.5rem;
  color: #b8b0a0;
  font-size: 0.85rem;
}

.theme-picker-label strong {
  color: var(--sidebar-text);
}

.theme-swatches {
  display: flex;
  gap: 0.5rem;
}

.theme-swatch {
  width: 30px;
  height: 30px;
  border: 2px solid var(--sidebar-line);
  border-radius: 50%;
  background: radial-gradient(circle at center, var(--sw-accent) 0 34%, var(--sw-bg) 36% 100%);
  padding: 0;
  cursor: pointer;
}

.theme-swatch.is-active {
  border-color: var(--sw-accent);
  box-shadow: 0 0 0 2px rgb(0 0 0 / 55%), 0 0 0 4px var(--sw-accent);
  transform: scale(1.08);
}

/* ---------- Barra superior: vista + buscador ---------- */

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow: var(--shadow);
  padding: 0.85rem 1.25rem;
  margin-bottom: 1.75rem;
}

.topbar-title {
  display: grid;
  line-height: 1.2;
}

.topbar-crumb {
  color: var(--gold);
  font-size: 0.7rem;
  font-weight: 900;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.topbar-title strong {
  font-size: 1.2rem;
  letter-spacing: -0.01em;
}

.topbar-search {
  display: flex;
  align-items: center;
  gap: 0.55rem;
}

.topbar-search input {
  width: 250px;
  border-radius: 999px;
  background: var(--card-soft);
  padding: 0.6rem 1rem;
}

/* ---------- Encabezados y textos ---------- */

.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1.5rem;
  margin-bottom: 1.75rem;
}

.page-header h1,
.login-card h1,
.panel h1 {
  margin: 0.2rem 0 0.4rem;
  font-size: clamp(2.1rem, 4vw, 3.3rem);
  line-height: 1.04;
  letter-spacing: -0.04em;
}

.panel h2 {
  margin: 0.15rem 0 0.8rem;
  font-size: 1.45rem;
  letter-spacing: -0.02em;
}

.panel h3 {
  margin: 1.4rem 0 0.5rem;
  color: var(--gold-dark);
}

.muted {
  color: var(--muted);
}

.flash {
  border: 1px solid rgb(212 175 55 / 60%);
  border-radius: 16px;
  background: #fdf6dd;
  color: var(--gold-dark);
  margin-bottom: 1.25rem;
  padding: 0.9rem 1.1rem;
  font-weight: 700;
}

.alert.error {
  border: 1px solid rgb(179 54 44 / 40%);
  border-radius: 14px;
  background: var(--danger-bg);
  color: var(--danger);
  padding: 0.85rem 1rem;
}

/* ---------- Botones ---------- */

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #f3edda;
  color: var(--ink);
  cursor: pointer;
  padding: 0.75rem 1.15rem;
  font-weight: 800;
  white-space: nowrap;
}

.button:hover {
  text-decoration: none;
  filter: brightness(1.04);
}

.button-gold {
  border-color: var(--gold-bright);
  background: linear-gradient(135deg, var(--gold-2), var(--gold-bright));
  color: #141005;
  box-shadow: 0 8px 20px rgb(212 175 55 / 30%);
}

.button-secondary {
  background: var(--card);
}

.button-ghost {
  width: 100%;
  background: transparent;
}

.button-small {
  padding: 0.5rem 0.85rem;
  font-size: 0.9rem;
}

.button-danger {
  border-color: rgb(179 54 44 / 45%);
  background: var(--danger-bg);
  color: var(--danger);
  margin-top: 1.2rem;
}

.button-row,
.inline-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.55rem;
}

.inline-actions form {
  margin: 0;
}

.text-danger {
  border: 0;
  background: transparent;
  color: var(--danger);
  cursor: pointer;
  font-weight: 700;
  padding: 0;
}

/* ---------- Tarjetas KPI: grandes y con aire ---------- */

.cards-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}

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

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

.metric-card {
  padding: 1.9rem 1.75rem;
}

.metric-card span {
  display: block;
  color: var(--gold);
  font-size: 0.88rem;
  font-weight: 900;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.metric-card strong {
  display: block;
  margin: 0.55rem 0 0.35rem;
  color: var(--ink);
  font-size: clamp(2.6rem, 4vw, 3.6rem);
  font-weight: 850;
  line-height: 1;
  letter-spacing: -0.035em;
}

.metric-card small {
  color: var(--muted);
  font-size: 0.95rem;
}

/* ---------- Paneles del dashboard ---------- */

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}

.dashboard-grid.wide-left {
  grid-template-columns: minmax(0, 1.9fr) minmax(300px, 1fr);
}

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

.panel {
  padding: 1.8rem;
}

.panel-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.panel-heading .eyebrow {
  margin: 0;
}

.panel-note {
  color: var(--muted);
  font-weight: 700;
}

.panel-big {
  color: var(--gold);
  font-size: 1.9rem;
  line-height: 1;
  letter-spacing: -0.03em;
}

/* Gráfica de crecimiento: más alta y limpia */
.bar-chart {
  display: grid;
  grid-template-columns: repeat(12, minmax(28px, 1fr));
  align-items: end;
  gap: 0.7rem;
  height: 320px;
  padding-top: 1.25rem;
}

.bar-column {
  display: grid;
  grid-template-rows: auto 1fr auto;
  align-items: end;
  gap: 0.45rem;
  height: 100%;
  text-align: center;
}

.bar-column strong {
  color: var(--gold-dark);
  font-size: 0.85rem;
}

.bar-column span {
  color: var(--muted);
  font-size: 0.74rem;
  text-transform: capitalize;
}

.bar-track {
  display: flex;
  align-items: end;
  height: 100%;
  min-height: 140px;
  border-radius: 999px;
  background: #f0ead6;
  overflow: hidden;
}

.bar-fill {
  width: 100%;
  border-radius: 999px;
  background: linear-gradient(180deg, var(--gold-2), var(--gold-bright) 60%, var(--gold));
}

/* Gauge “Salud del negocio” */
.gauge-panel {
  display: flex;
  flex-direction: column;
  align-items: stretch;
}

.gauge {
  display: block;
  width: min(235px, 72vw);
  margin: 0.5rem auto 0.25rem;
}

.gauge-track {
  fill: none;
  stroke: #eee3c2;
  stroke-width: 17;
}

.gauge-value {
  fill: none;
  stroke: url(#gaugeGrad);
  stroke-width: 17;
  stroke-linecap: round;
  transform: rotate(-90deg);
  transform-origin: center;
}

.gauge-number {
  fill: var(--ink);
  font-size: 56px;
  font-weight: 850;
  letter-spacing: -0.03em;
  text-anchor: middle;
}

.gauge-caption {
  fill: var(--muted);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-anchor: middle;
  text-transform: uppercase;
}

.gauge-note {
  text-align: center;
  margin: 0.4rem 0 0;
}

/* Barra dividida cobrado / pendiente */
.split-bar {
  display: flex;
  height: 26px;
  border-radius: 999px;
  background: #f0ead6;
  overflow: hidden;
  margin: 0.6rem 0 1.1rem;
}

.split-paid {
  background: linear-gradient(90deg, var(--gold), var(--gold-bright));
  min-width: 0;
}

.split-pending {
  background: #ddd2ae;
  min-width: 0;
}

.split-legend {
  display: grid;
  gap: 0.6rem;
  list-style: none;
  margin: 0 0 1rem;
  padding: 0;
}

.split-legend li {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  color: var(--muted);
  font-weight: 650;
}

.split-legend strong {
  margin-left: auto;
  color: var(--ink);
}

.dot {
  width: 12px;
  height: 12px;
  border-radius: 999px;
  flex: none;
}

.dot-paid {
  background: var(--gold-bright);
}

.dot-pending {
  background: #ddd2ae;
}

.result-list,
.detail-list {
  display: grid;
  gap: 0.85rem;
  margin: 0;
}

.result-list div,
.detail-list div {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  border-bottom: 1px solid var(--line-soft);
  padding-bottom: 0.85rem;
}

.result-list dt,
.detail-list dt {
  color: var(--muted);
}

.result-list dd,
.detail-list dd {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 850;
  text-align: right;
}

.progress-track {
  height: 16px;
  border-radius: 999px;
  background: #f0ead6;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--gold), var(--gold-2));
}

.task-list,
.compact-list {
  display: grid;
  gap: 0.8rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.task-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  border: 1px solid var(--line-soft);
  border-radius: 16px;
  background: var(--card-soft);
  padding: 0.9rem 1rem;
}

.task-list strong,
.task-list span {
  display: block;
}

.task-list div span,
.compact-list span {
  color: var(--muted);
  font-size: 0.9rem;
}

.badge {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #f7f2df;
  color: var(--muted);
  padding: 0.28rem 0.65rem;
  font-size: 0.8rem;
  font-weight: 850;
  white-space: nowrap;
}

.badge.gold {
  border-color: rgb(212 175 55 / 55%);
  background: #fdf6dd;
  color: var(--gold-dark);
}

.badge.success {
  border-color: rgb(29 122 70 / 35%);
  background: var(--success-bg);
  color: var(--success);
}

.badge.danger {
  border-color: rgb(179 54 44 / 35%);
  background: var(--danger-bg);
  color: var(--danger);
}

/* ---------- Filtros y tablas ---------- */

.filter-bar {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) 240px auto;
  align-items: end;
  gap: 1rem;
  margin-bottom: 1.5rem;
  padding: 1.4rem 1.6rem;
}

.table-panel {
  overflow-x: auto;
  padding: 0.6rem 0;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 760px;
}

th,
td {
  border-bottom: 1px solid var(--line-soft);
  padding: 1.1rem 1.25rem;
  text-align: left;
  vertical-align: top;
}

th {
  color: var(--gold-dark);
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

tbody tr:hover {
  background: #faf6ea;
}

.table-main {
  display: block;
  color: var(--text);
  font-weight: 850;
}

.table-sub {
  display: block;
  color: var(--muted);
  font-size: 0.9rem;
  margin-top: 0.15rem;
}

.score-stack {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.score-chip {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--card-soft);
  padding: 0.22rem 0.55rem;
  font-size: 0.82rem;
  white-space: nowrap;
}

.delta {
  font-weight: 900;
}

.delta.positive {
  color: var(--success);
}

.delta.negative {
  color: var(--danger);
}

/* ---------- Formularios ---------- */

.form-panel {
  max-width: 1080px;
}

.form-panel.narrow,
.panel.narrow {
  max-width: 780px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.1rem;
}

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

.form-grid.four {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.form-grid .span-2 {
  grid-column: span 2;
}

.stack-form,
.form-panel.narrow {
  display: grid;
  gap: 1rem;
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 1.4rem;
}

.checkbox {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.checkbox input {
  width: auto;
}

/* ---------- Pipeline tipo Kanban ---------- */

.pipeline-board {
  display: grid;
  grid-auto-columns: minmax(300px, 340px);
  grid-auto-flow: column;
  gap: 1.4rem;
  overflow-x: auto;
  padding: 0.25rem 0.25rem 1.4rem;
}

.pipeline-column {
  border: 1px solid var(--line);
  border-top: 5px solid var(--gold-bright);
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: var(--shadow);
  padding: 1.2rem;
}

.pipeline-column.stage-1 {
  border-top-color: var(--gold);
}

.pipeline-column.stage-2 {
  border-top-color: var(--gold-dark);
}

.pipeline-column.stage-3 {
  border-top-color: #3d382a;
}

.pipeline-column header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.pipeline-column h2 {
  font-size: 1.08rem;
  margin: 0;
  letter-spacing: -0.01em;
}

.column-count {
  display: grid;
  place-items: center;
  min-width: 2.1rem;
  height: 2.1rem;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--gold-2), var(--gold-bright));
  color: #141005;
  font-weight: 900;
}

.pipeline-cards {
  display: grid;
  gap: 0.9rem;
}

.pipeline-card {
  display: grid;
  gap: 0.75rem;
  border: 1px solid var(--line-soft);
  border-radius: 18px;
  background: var(--card-soft);
  box-shadow: 0 6px 18px rgb(26 23 16 / 5%);
  padding: 1.05rem;
}

.pipeline-card > a {
  color: var(--text);
  font-size: 1.04rem;
  font-weight: 900;
}

.pipeline-value {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.pipeline-value strong {
  color: var(--gold-dark);
}

.pipeline-card form {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.5rem;
}

.row-done {
  opacity: 0.6;
}

.empty {
  color: var(--muted);
  padding: 1.4rem;
}

.empty.small {
  padding: 0.5rem;
}

.preserve-lines {
  white-space: pre-line;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ---------- Login: momento de marca, oscuro ---------- */

.login-body {
  display: grid;
  place-items: center;
  min-height: 100vh;
  padding: 1rem;
  background:
    radial-gradient(circle at 80% -10%, rgb(212 175 55 / 16%), transparent 32rem),
    var(--black);
  color: #f7f2e7;
}

.login-card {
  width: min(100%, 470px);
  border: 1px solid var(--sidebar-line);
  border-radius: 28px;
  background: linear-gradient(160deg, #171713, #090909);
  box-shadow: 0 24px 70px rgb(0 0 0 / 45%);
  padding: 1.8rem;
}

.login-card .eyebrow {
  color: var(--gold-bright);
  margin-top: 1.2rem;
}

.login-card .muted {
  color: #b8b0a0;
}

.login-card label {
  color: #b8b0a0;
}

.login-card input {
  background: #0a0a09;
  border-color: var(--sidebar-line);
  color: #f7f2e7;
}

/* ---------- Responsive ---------- */

@media (max-width: 1200px) {
  .dashboard-grid.three-cols {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 1050px) {
  .cards-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .dashboard-grid,
  .dashboard-grid.wide-left {
    grid-template-columns: 1fr;
  }
}

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

  .sidebar {
    position: static;
    height: auto;
    padding: 1.1rem;
  }

  .brand {
    max-width: 250px;
  }

  .main-nav {
    display: flex;
    overflow-x: auto;
    padding-bottom: 0.25rem;
  }

  .main-nav a {
    white-space: nowrap;
  }

  .sidebar-footer {
    margin-top: 0;
  }

  .main-content {
    padding: 1.1rem 1rem 2rem;
  }

  .topbar {
    flex-direction: column;
    align-items: stretch;
  }

  .topbar-search input {
    flex: 1;
    width: auto;
  }

  .page-header,
  .panel-heading {
    flex-direction: column;
  }

  .panel {
    padding: 1.3rem;
  }

  .metric-card {
    padding: 1.4rem 1.25rem;
  }

  .cards-grid,
  .cards-grid.three-cards,
  .form-grid,
  .form-grid.three,
  .form-grid.four,
  .filter-bar {
    grid-template-columns: 1fr;
  }

  .form-grid .span-2 {
    grid-column: span 1;
  }

  .bar-chart {
    gap: 0.3rem;
    height: 260px;
  }
}
