:root {
  --ink: #15333d;
  --brand: #006983;
  --brand-hover: #00566e;
  --brand-tint: #e4f2f4;
  --sidebar: #0a4554;
  --sidebar-ink: #e7f4f6;
  --workspace: #f5f8f9;
  --muted: #506870;
  --surface: #fff;
  --surface-solid: #f7f8fa;
  --line: #dce7e9;
  --shadow: 0 1px 2px rgba(20, 61, 73, 0.04);
  --radius: 12px;
  --font-display: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  --font-body: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  --sidebar-w: 232px;
  --header-h: 60px;
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
}

*, *::before, *::after { box-sizing: border-box; }

html {
  height: 100%;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

html, body {
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--workspace);
}

body {
  margin: 0;
  min-height: 100%;
  min-height: 100dvh;
}

#app {
  isolation: isolate;
  min-height: 100%;
  min-height: 100dvh;
}

img, canvas, svg { max-width: 100%; height: auto; }

button, .btn-primary, .btn-ghost, .btn-danger, .nav-btn, .tab {
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.glass {
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  border-radius: var(--radius);
}

.brand-mark {
  font-family: var(--font-display);
  letter-spacing: 0.04em;
  font-weight: 800;
  color: var(--brand);
  text-transform: uppercase;
}

.btn-primary,
.btn-ghost,
.btn-danger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  min-height: 44px;
  font-size: 0.92rem;
  border-radius: 10px;
  cursor: pointer;
  padding: 0.65rem 1rem;
  white-space: nowrap;
}

.btn-primary {
  background: var(--brand);
  color: #fff;
  font-weight: 700;
  border: none;
}

.btn-ghost {
  background: #fff;
  color: var(--ink);
  border: 1px solid #ccdadd;
}

.btn-danger {
  background: #fff6f5;
  color: #a0272d;
  border: 1px solid #edc5c5;
}

.input, .select, .textarea {
  width: 100%;
  max-width: 100%;
  background: #fff;
  border: 1px solid #b7cbcf;
  color: var(--ink);
  border-radius: 10px;
  padding: 0.75rem 0.85rem;
  min-height: 44px;
  outline: none;
  font-size: 16px; /* evita zoom iOS */
}

.input:focus, .select:focus, .textarea:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(0, 105, 131, 0.15);
}

.nav-btn {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  width: 100%;
  text-align: left;
  padding: 0.85rem 0.95rem;
  min-height: 46px;
  border-radius: 10px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--sidebar-ink);
  cursor: pointer;
  font-size: 0.95rem;
}

.nav-btn.active {
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  border-color: transparent;
  box-shadow: inset 3px 0 0 #8fd8e6;
}

.kpi-card {
  padding: 1.1rem 1.2rem;
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
  border: 1px solid var(--line);
  min-width: 0;
}

.kpi-label {
  color: var(--muted);
  font-size: 0.88rem;
}

.kpi-value {
  font-size: clamp(1.25rem, 2.5vw, 1.65rem);
  font-weight: 800;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}

.table-wrap {
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, 0.2);
  max-width: 100%;
}

#lista-personal {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  align-items: start;
}

.personal-grupo {
  padding: 1rem;
}

.personal-grupo h3 {
  margin: 0 0 0.75rem;
}

.personal-miembros {
  list-style: none;
  margin: 0;
  padding: 0;
}

.personal-miembros li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.5rem 0;
}

.personal-miembros span {
  overflow-wrap: anywhere;
}

table.data {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
  min-width: 600px;
}

table.data th {
  text-align: left;
  padding: 0.75rem 0.85rem;
  background: #edf4f5;
  color: #37545e;
  white-space: nowrap;
}

table.data td {
  padding: 0.7rem 0.85rem;
  border-top: 1px solid var(--line);
  overflow-wrap: anywhere;
  vertical-align: middle;
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.55rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  border: 1px solid transparent;
  white-space: nowrap;
}

.badge-eval { background: #e9f4fa; color: #225874; }
.badge-sep { background: #fff1d7; color: #75541b; }
.badge-con { background: #e3f4f0; color: #24645b; }
.badge-aca { background: #f0ecfa; color: #605080; }
.badge-ent { background: #e6f4e9; color: #2b6343; }
.badge-pend { background: #fff1d7; color: #75541b; }
.badge-pag { background: #e6f4e9; color: #2b6343; }

.progress {
  height: 8px;
  background: rgba(148, 163, 184, 0.2);
  border-radius: 999px;
  overflow: hidden;
}

.progress > span {
  display: block;
  height: 100%;
  background: #49a59a;
}

.modal::backdrop { background: rgba(22, 58, 67, 0.37); }

.modal {
  position: fixed;
  inset: auto 0 0;
  z-index: 100;
  width: 100%;
  max-width: 560px;
  height: fit-content;
  max-height: 92vh;
  max-height: 92dvh;
  color: var(--ink);
  overflow: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  padding: 1.25rem 1.15rem calc(1.25rem + var(--safe-bottom));
  border-radius: 18px 18px 0 0;
  margin: 0 auto;
  box-shadow: 0 20px 72px rgba(11, 28, 45, 0.24);
}

.toast {
  position: fixed;
  left: 50%;
  right: auto;
  bottom: calc(1rem + var(--safe-bottom));
  transform: translateX(-50%);
  z-index: 90;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.9rem 1rem;
  border-radius: 12px;
  background: var(--ink);
  color: #fff;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  width: min(420px, calc(100vw - 1.5rem));
  max-width: calc(100vw - 1.5rem);
}

.hidden { display: none !important; }

.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-shell {
  min-height: 100%;
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: calc(1.25rem + var(--safe-top)) 1rem calc(1.25rem + var(--safe-bottom));
}

.login-card {
  width: min(420px, 100%);
  padding: clamp(1.35rem, 4vw, 2rem) clamp(1.1rem, 3vw, 1.6rem);
}

.login-hero-title {
  font-size: clamp(1.45rem, 4vw, 2rem);
  margin: 0.35rem 0 0.25rem;
}

.login-card .btn-primary { width: 100%; }

.grid-kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.85rem;
}

.grid-charts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.85rem;
}

.chart-box {
  display: flex;
  flex-direction: column;
  padding: clamp(1rem, 2vw, 1.5rem);
  min-width: 0;
}

.chart-box h2 {
  font-size: 1.05rem;
  margin: 0 0 1rem;
}

.chart-plot {
  position: relative;
  flex: 1;
  height: auto;
  min-height: clamp(220px, 24vw, 300px);
}

.revenue-card { container-type: inline-size; }

.revenue-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0.35rem 1.15rem;
  align-items: center;
  align-content: center;
  flex: 1;
  min-height: 0;
}

.revenue-donut {
  position: relative;
  width: min(100%, 264px);
  margin-inline: auto;
  container-type: inline-size;
}

.revenue-donut svg {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
}

.donut-track,
.donut-arc {
  fill: none;
  stroke-width: 14;
}

.donut-track { stroke: #e6eef0; }

.donut-arc {
  cursor: pointer;
  transition: opacity 160ms var(--ease-out);
}

.revenue-card.is-focused .donut-arc { opacity: 0.32; }
.revenue-card.is-focused .donut-arc.is-active { opacity: 1; }

.revenue-center {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 62%;
  transform: translate(-50%, -50%);
  display: grid;
  justify-items: center;
  gap: 0.2rem;
  text-align: center;
  pointer-events: none;
}

.revenue-center-value {
  font-size: clamp(0.78rem, 7.2cqi, 1.12rem);
  font-weight: 800;
  letter-spacing: -0.045em;
  line-height: 1.05;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}

.revenue-center-label {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 600;
  line-height: 1.25;
  max-width: 100%;
}

.revenue-legend {
  list-style: none;
  margin: 0;
  padding: 0;
  font-variant-numeric: tabular-nums;
}

.revenue-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 0.65rem;
  width: 100%;
  min-height: 44px;
  margin: 0;
  padding: 0.45rem 0.55rem;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: inherit;
  font: inherit;
  letter-spacing: inherit;
  text-align: left;
  cursor: pointer;
}

.revenue-item.is-zero { cursor: default; }

.revenue-item.is-active { background: #e7f3f4; }

.revenue-item:focus { outline: none; }
.revenue-item:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

.revenue-concept {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  min-width: 0;
  overflow-wrap: anywhere;
}

.revenue-concept::before {
  content: "";
  width: 0.55rem;
  height: 0.55rem;
  flex: none;
  border-radius: 50%;
  background: var(--segment-color);
}

.revenue-item strong {
  text-align: right;
  font-weight: 700;
  white-space: nowrap;
}

.revenue-share {
  min-width: 3.6rem;
  text-align: right;
  color: var(--muted);
  font-size: 0.77rem;
  white-space: nowrap;
}

@container (min-width: 560px) {
  .revenue-body {
    grid-template-columns: 240px minmax(0, 1fr);
  }

  .revenue-donut {
    width: 240px;
    margin-inline: 0;
  }
}

@media (prefers-reduced-motion: no-preference) {
  .revenue-donut.is-entering .donut-arc {
    stroke-dasharray: var(--arc-length);
    stroke-dashoffset: var(--arc-length);
    animation: donut-draw 520ms var(--ease-out) forwards;
    animation-delay: var(--arc-delay, 0ms);
  }
}

@keyframes donut-draw {
  to { stroke-dashoffset: 0; }
}

.grid-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr));
  gap: 0.85rem;
}

.layout {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  min-height: 100%;
  min-height: 100dvh;
}

.sidebar {
  padding: 1.2rem 1rem;
  border-right: 0;
  background: var(--sidebar);
  color: var(--sidebar-ink);
  position: sticky;
  top: 0;
  height: 100dvh;
  overflow-y: auto;
  z-index: 50;
  scrollbar-color: rgba(255, 255, 255, 0.35) transparent;
}

.sidebar::-webkit-scrollbar-track { background: transparent; }
.sidebar::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.28);
  border-color: transparent;
}

.sidebar-nav {
  display: grid;
  gap: 0.35rem;
}

.sidebar-footer { margin-top: 2rem; }

.main {
  padding: clamp(1.5rem, 4vw, 3.5rem);
  max-width: 94rem;
  margin-inline: auto;
  min-width: 0;
  width: 100%;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
  padding-bottom: 1.15rem;
  border-bottom: 1px solid var(--line);
}

.topbar-text { min-width: 0; }

.topbar-text h1 {
  margin: 0;
  font-size: clamp(1.75rem, 3.4vw, 2.75rem);
  letter-spacing: -0.045em;
  line-height: 1.11;
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.toolbar > * { flex: 0 1 auto; }

.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.tab {
  padding: 0.55rem 0.95rem;
  min-height: 42px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.25);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

.tab.active {
  background: var(--brand-tint);
  color: var(--brand);
  border-color: #cfe6ea;
}

/* Mobile chrome */
.mobile-header {
  display: none;
  position: sticky;
  top: 0;
  z-index: 55;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  min-height: calc(var(--header-h) + var(--safe-top));
  padding: var(--safe-top) 0.85rem 0;
  background: rgba(245, 248, 249, 0.96);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid #dce7e9;
}

.mobile-header-inner {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 0.65rem;
  width: 100%;
  min-height: var(--header-h);
}

.icon-btn {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, 0.3);
  background: var(--surface);
  color: var(--brand);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1.1rem;
}

.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(22, 58, 67, 0.32);
  z-index: 45;
}

body.nav-open, body:has(dialog[open]) {
  overflow: hidden;
}

body.nav-open .sidebar-overlay { display: block; }

.scroll-hint {
  display: none;
  color: var(--muted);
  font-size: 0.78rem;
  margin: 0 0 0.45rem;
}

/* ========== TABLET ========== */
@media (max-width: 1100px) {
  .grid-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-charts { grid-template-columns: 1fr 1fr; }
}

/* ========== MOBILE / TABLET NAV ========== */
@media (max-width: 900px) {
  .mobile-header { display: flex; }
  .sidebar-brand-block { padding-right: 3.2rem; }
  .sidebar-brand-block .sidebar-close { display: inline-flex; position: absolute; inset: 0 0 auto auto; }


  .layout {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: min(86vw, 300px);
    height: 100dvh;
    height: 100%;
    padding-top: calc(1rem + var(--safe-top));
    padding-bottom: calc(1rem + var(--safe-bottom));
    border-right: 0;
    background: var(--sidebar);
    transform: translateX(-105%);
    visibility: hidden;
    transition: transform 220ms var(--ease-out), visibility 220ms;
    box-shadow: none;
    z-index: 60;
  }

  body.nav-open .sidebar {
    transform: translateX(0);
    visibility: visible;
    box-shadow: 18px 0 40px rgba(20, 61, 73, 0.16);
  }

  .sidebar-overlay {
    z-index: 55;
  }

  .mobile-header {
    z-index: 52;
  }

  .main {
    padding: 1rem 0.85rem calc(1.5rem + var(--safe-bottom));
  }

  .topbar { margin-top: 0.35rem; }

  .scroll-hint { display: block; }

}

@media (min-width: 901px) {

  .modal {
    inset: 0;
    margin: auto;
    border-radius: var(--radius);
    padding: 1.25rem;
    width: min(560px, 100%);
  }

  .toast {
    left: auto;
    right: 1rem;
    transform: none;
    width: auto;
  }
}

/* ========== PHONE ========== */
@media (max-width: 640px) {
  #lista-personal {
    grid-template-columns: minmax(0, 1fr);
  }

  .grid-charts {
    grid-template-columns: 1fr;
  }

  .kpi-card { padding: 0.95rem 1rem; }

  .chart-box {
    padding: 1rem;
  }

  .toolbar .btn-primary,
  .toolbar .btn-ghost,
  .toolbar .btn-danger {
    padding-inline: 0.6rem;
    flex: 1 1 calc(50% - 0.5rem);
    min-width: calc(50% - 0.5rem);
  }

  .topbar {
    flex-direction: column;
    align-items: flex-start;
  }

  /* Tablas → cards en móvil */
  table.data {
    min-width: 0;
  }

  table.data thead {
    display: none;
  }

  table.data,
  table.data tbody,
  table.data tr,
  table.data td {
    display: block;
    width: 100%;
  }

  table.data tr {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 12px;
    margin-bottom: 0.75rem;
    padding: 0.35rem 0.15rem;
    overflow: hidden;
  }

  table.data td {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
    padding: 0.55rem 0.8rem;
    border-top: none;
    border-bottom: 1px solid rgba(148, 163, 184, 0.1);
    text-align: right;
  }

  table.data td:last-child { border-bottom: none; }

  table.data td::before {
    content: attr(data-label);
    color: var(--muted);
    font-weight: 600;
    font-size: 0.78rem;
    text-align: left;
    flex: 0 0 33%;
  }

  table.data td.td-check {
    justify-content: flex-start;
    gap: 0.6rem;
  }

  table.data td.td-check::before { flex: 0 0 auto; }

  table.data td.td-actions {
    justify-content: flex-end;
    flex-wrap: wrap;
  }

  table.data td.td-actions::before { display: none; }

  .entrega-rapida {
    min-width: 0 !important;
    width: 100%;
    max-width: 170px;
  }

  .scroll-hint { display: none; }

  .tabs { width: 100%; }
  .tab { flex: 1 1 auto; text-align: center; }
}

@media (max-width: 380px) {
  .kpi-value { font-size: 1.2rem; }
}

/* Preferencias de movimiento reducido */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
  }
}

/* Landscape phones */
@media (max-height: 480px) and (orientation: landscape) {
  .login-shell { align-items: flex-start; padding-top: 1rem; }
  .sidebar { padding-top: 0.75rem; }
  .chart-plot { height: 200px; }
}

button, input, select, textarea { font-family: inherit; }
button:focus-visible, .chk-eliminar:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 3px;
}

.sidebar button:focus-visible, .mobile-header button:focus-visible {
  outline-color: var(--brand);
}

.btn-primary, .btn-ghost, .btn-danger, .nav-btn, .tab, .icon-btn {
  font-weight: 650;
  transition: transform 130ms var(--ease-out);
}

:is(.btn-primary, .btn-ghost, .btn-danger, .nav-btn, .tab, .icon-btn):active {
  transform: scale(0.97);
}

@media (hover: hover) and (pointer: fine) {
  .btn-primary:hover { background: var(--brand-hover); }
  .btn-ghost:hover { background: #edf5f6; }
  .btn-danger:enabled:hover { background: #fde7e6; }
  .nav-btn:not(.active):hover { background: rgba(255, 255, 255, 0.08); color: #fff; }
  .sidebar .btn-ghost:hover { background: rgba(255, 255, 255, 0.08); color: #fff; }
  table.data tbody tr:hover td { background: #f4f9fa; }
  .revenue-item:not(.is-zero):hover { background: #f3f8f8; }
  .revenue-item.is-active:hover { background: #e7f3f4; }
}

.sidebar .icon-btn {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.18);
  color: #f4fbfc;
}
.sidebar .btn-ghost {
  background: transparent;
  color: var(--sidebar-ink);
  border-color: rgba(255, 255, 255, 0.22);
}
.sidebar button:focus-visible { outline-color: #d7f6fb; }
.sidebar-brand-block { position: relative; margin: 0 0 1.4rem; }
.sidebar-logo {
  position: relative;
  height: 4.8rem;
  overflow: hidden;
  border-radius: 9px;
  background: #004a65;
}
.sidebar-logo img {
  position: absolute;
  inset: 50% auto auto 50%;
  width: min(112%, 225px);
  max-width: none;
  height: auto;
  transform: translate(-50%, -50%);
}
.sidebar-close { display: none; }
.nav-btn i { width: 1.25rem; text-align: center; }
#page-description { color: var(--muted); margin: 0.5rem 0 0; }
#session-label { color: var(--muted); margin: 0.55rem 0 0; font-size: 0.78rem; }
#session-label:empty { display: none; }
.login-label { display: block; margin-bottom: 0.35rem; color: var(--muted); }
.login-error { color: #a0272d; font-size: 0.9rem; margin: 0; }
.kpi-icon { display: inline-grid; place-items: center; border-radius: 8px; flex: none; }
.local-notice { max-width: 34rem; margin: 4rem auto; padding: 1.5rem; }

.kpi-label {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-weight: 600;
}
.kpi-icon { width: 2rem; height: 2rem; background: #eaf4f5; color: var(--brand); }
.kpi-card:last-child .kpi-icon { background: #dbefeb; color: #246d63; }
.kpi-value { margin-top: 0.7rem; font-size: clamp(1.35rem, 2.1vw, 2.15rem); letter-spacing: -0.045em; }
.grid-charts { margin-top: 1rem; }
.grid-cards { grid-template-columns: repeat(auto-fit, minmax(min(100%, 270px), 1fr)); }

.project-card, .personal-grupo { padding: clamp(1rem, 2vw, 1.45rem); background: var(--surface); }
.project-card h3, .personal-grupo h3 { margin: 0; font-size: 1.1rem; overflow-wrap: anywhere; }
.project-location { color: var(--muted); margin: 0.35rem 0 1.2rem; overflow-wrap: anywhere; }
.project-progress { display: flex; justify-content: space-between; margin-bottom: 0.45rem; font-size: 0.9rem; }
.project-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 1rem; }
.personal-miembros li { border-top: 1px solid var(--line); }
.personal-grupo h3 { margin-bottom: 0.8rem; }

table.data td:first-child:not(.td-check), #tabla-clientes td:nth-child(2), #tabla-pagos td:nth-child(3) {
  font-weight: 650;
}
.entrega-rapida { min-width: 135px; }
.chk-eliminar { width: 1.15rem; height: 1.15rem; accent-color: var(--brand); }
.empty-state { color: var(--muted); padding: 1.35rem !important; }

.modal h2 { margin: 0 0 1.15rem; font-size: 1.35rem; letter-spacing: -0.025em; }
.modal .toast {
  position: static;
  transform: none;
  width: auto;
  margin-top: 0.85rem;
  background: #fff6f5;
  border-color: #edc5c5;
  color: #a0272d;
  box-shadow: none;
}
.record-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.9rem; }
.form-field { display: grid; align-content: start; gap: 0.35rem; min-width: 0; font-weight: 600; font-size: 0.88rem; }
.form-field-wide { grid-column: 1 / -1; }
.form-actions { grid-column: 1 / -1; display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 0.6rem; margin-top: 0.45rem; }
.input::placeholder { color: #596d80; }

@media (max-width: 640px) {
  .grid-kpis { gap: 0.6rem; }
  .kpi-card { padding: 0.75rem; }
  .kpi-label { align-items: flex-start; gap: 0.4rem; font-size: 0.79rem; }
  .kpi-icon { width: 1.45rem; height: 1.45rem; font-size: 0.7rem; }
  .kpi-value { font-size: clamp(1.05rem, 4.55vw, 1.6rem); }
  .table-wrap:has(table) { background: transparent; border: 0; box-shadow: none; }
  table.data tr:last-child { margin-bottom: 0; }
  table.data td.empty-state::before { display: none; }
  .entrega-rapida { min-width: 0; }
  .record-form { grid-template-columns: minmax(0, 1fr); }
  .form-actions > button { flex: 1; }
}

@media (prefers-reduced-motion: reduce) {
  :is(.btn-primary, .btn-ghost, .btn-danger, .nav-btn, .tab, .icon-btn):active { transform: none; }
  .donut-arc { transition: none; }
}

.btn-danger:disabled { background: #f3f6f6; color: #60737a; border-color: var(--line); cursor: default; }
.btn-danger:disabled:active { transform: none; }
.kpi-card:last-child { background: #eef8f6; border-color: #d2e8e4; }
#vista-clientes .td-check:has(input:checked) { background: var(--brand-tint); }

@media (max-width: 640px) {
  #page-description { font-size: 0.93rem; }
}
