@import url('https://fonts.googleapis.com/css2?family=Fraunces:wght@500;600&family=Space+Grotesk:wght@400;500;600&display=swap');

:root {
  --ink: #1f2933;
  --ink-soft: #4b5563;
  --sand: #f6f4f0;
  --paper: #ffffff;
  --surface: #ffffff;
  --surface-2: #f2f4f7;
  --surface-3: #e9edf2;
  --accent: #e07a5f;
  --sea: #3a6b8a;
  --moss: #2a7f62;
  --border: rgba(31, 41, 51, 0.14);
  --shadow: 0 16px 32px rgba(31, 41, 51, 0.12);
  --shadow-soft: 0 8px 18px rgba(31, 41, 51, 0.08);
  --shadow-strong: 0 24px 48px rgba(31, 41, 51, 0.16);
  --overlay: rgba(24, 33, 45, 0.45);
  --btn-shadow: 0 10px 18px rgba(31, 41, 51, 0.18);
}

* {
  box-sizing: border-box;
}

html {
  background: linear-gradient(180deg, #f7f5f2 0%, #eef2f6 100%);
  background-color: #eef2f6;
  min-height: 100%;
  min-height: 100svh;
  min-height: 100dvh;
  width: 100%;
  overflow-x: hidden;
}

body {
  margin: 0;
  font-family: 'Space Grotesk', sans-serif;
  color: var(--ink);
  background: transparent;
  min-height: 100vh;
  min-height: 100svh;
  min-height: 100dvh;
  width: 100%;
  overflow-x: hidden;
}

body.nav-open {
  overflow: hidden;
}

.hidden {
  display: none !important;
}

h1, h2, h3 {
  font-family: 'Fraunces', serif;
  margin: 0 0 8px;
}

h1 {
  font-size: 2.2rem;
}

h2 {
  font-size: 1.6rem;
}

h3 {
  font-size: 1.2rem;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 0.7rem;
  margin: 0 0 8px;
  color: var(--ink-soft);
}

.sub {
  margin: 0;
  font-size: 1rem;
  color: var(--ink-soft);
}

.login-view {
  display: grid;
  place-items: center;
  min-height: 100vh;
  min-height: 100svh;
  min-height: 100dvh;
  padding: 32px 20px;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

.loading-view {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(246, 244, 240, 0.96);
  backdrop-filter: blur(6px);
  z-index: 200;
  padding: 24px;
}

.loading-card {
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: 22px;
  padding: 24px;
  box-shadow: var(--shadow);
  display: flex;
  align-items: center;
  gap: 16px;
}

.loading-spinner {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 3px solid var(--border);
  border-top-color: var(--ink);
  animation: spin 0.8s linear infinite;
}

.login-card {
  width: min(520px, 100%);
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: 22px;
  padding: 32px;
  box-shadow: var(--shadow);
  animation: liftIn 0.6s ease;
}

.login-brand {
  display: flex;
  gap: 16px;
  align-items: center;
  margin-bottom: 24px;
}

.logo {
  width: 56px;
  height: 56px;
  border-radius: 18px;
  background: linear-gradient(140deg, #1f2933, #3a6b8a);
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 600;
  font-size: 1.4rem;
  letter-spacing: 0.04em;
  box-shadow: var(--shadow-soft);
  overflow: hidden;
}

.logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: none;
}

.logo.has-image {
  background: var(--surface);
}

.logo.has-image img {
  display: block;
}

.logo.has-image .logo-text {
  display: none;
}

.logo.small {
  width: 40px;
  height: 40px;
  font-size: 1rem;
  border-radius: 14px;
}

.login-note {
  font-size: 0.85rem;
  color: var(--ink-soft);
  margin-top: 16px;
}

.app-shell {
  display: grid;
  grid-template-columns: 260px 1fr;
  min-height: 100vh;
  min-height: 100svh;
  min-height: 100dvh;
}

.sidebar {
  background: linear-gradient(180deg, #f7f9fc 0%, #eef2f7 100%);
  border-right: 1px solid rgba(51, 65, 85, 0.14);
  padding: 24px 20px;
  display: flex;
  flex-direction: column;
  gap: 24px;
  position: sticky;
  top: 16px;
  max-height: calc(100vh - 32px);
  height: auto;
  backdrop-filter: blur(10px);
  box-shadow: inset -1px 0 0 rgba(255, 255, 255, 0.7);
  overflow: hidden;
}

.sidebar-top {
  display: grid;
  gap: 12px;
}

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

.tagline {
  font-size: 0.85rem;
  color: var(--ink-soft);
  margin: 0;
}

.nav {
  display: grid;
  gap: 10px;
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding-right: 4px;
  align-content: start;
  grid-auto-rows: max-content;
}

.nav-group {
  display: grid;
  gap: 6px;
  padding: 8px;
  border-radius: 14px;
  border: 1px solid rgba(51, 65, 85, 0.12);
  background: #ffffff;
  box-shadow: 0 10px 18px rgba(31, 41, 51, 0.08);
}

.nav-group.hidden {
  display: none;
}

.nav-group-toggle {
  border: 1px solid rgba(58, 107, 138, 0.18);
  background: #f2f6fb;
  color: #2f3b49;
  text-align: left;
  padding: 8px 14px;
  border-radius: 12px;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.22em;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.nav-group-toggle:hover {
  background: #e7edf5;
  border-color: rgba(58, 107, 138, 0.3);
}

.nav-group.active .nav-group-toggle {
  color: #2f5c7a;
  background: #e9f1fa;
  border-color: rgba(58, 107, 138, 0.35);
}

.nav-caret {
  width: 0;
  height: 0;
  border-left: 6px solid currentColor;
  border-top: 5px solid transparent;
  border-bottom: 5px solid transparent;
  transform: rotate(90deg);
  transition: transform 0.2s ease;
  opacity: 0.6;
}

.nav-group.collapsed .nav-caret {
  transform: rotate(0deg);
}

.nav-submenu {
  display: grid;
  gap: 6px;
  padding: 6px;
  border-radius: 12px;
  border: 1px solid rgba(31, 41, 51, 0.08);
  background: #f7f9fc;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
  max-height: 400px;
  overflow: hidden;
  opacity: 1;
  transform: translateY(0);
  transition: max-height 0.25s ease, opacity 0.2s ease, transform 0.2s ease;
}

.nav-group.collapsed .nav-submenu {
  max-height: 0;
  opacity: 0;
  transform: translateY(-4px);
  pointer-events: none;
  padding: 0;
  border-color: transparent;
}

.nav-subitem {
  font-size: 0.92rem;
  padding-left: 16px;
  border-left: 2px solid rgba(58, 107, 138, 0.28);
  border-radius: 10px;
}

.nav-item {
  border: none;
  background: transparent;
  color: var(--ink);
  text-align: left;
  padding: 10px 14px;
  border-radius: 12px;
  font-size: 0.95rem;
  cursor: pointer;
  transition: 0.2s ease;
  border: 1px solid transparent;
}

.nav-item:hover {
  background: #eef4fb;
  border-color: rgba(58, 107, 138, 0.24);
  color: #243646;
}

.nav-item.active {
  background: linear-gradient(120deg, #2f5c7a, #3a6b8a);
  color: #fff;
  border-color: rgba(47, 92, 122, 0.55);
  box-shadow: 0 16px 28px rgba(58, 107, 138, 0.28);
}

.nav-item.hidden {
  display: none;
}

.menu-button {
  display: none;
}

.sidebar-footer {
  margin-top: 8px;
  display: grid;
  gap: 10px;
}

.user-badge {
  padding: 10px 12px;
  border-radius: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  font-size: 0.85rem;
  display: grid;
  gap: 4px;
}

.user-badge-main {
  font-weight: 600;
  line-height: 1.2;
}

.main {
  padding: 28px 32px 48px;
}

.topbar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 18px;
}

.topbar {
  display: none;
}

.topbar-brand {
  display: none;
  align-items: center;
  gap: 10px;
}

.topbar-brand-text strong {
  font-size: 1rem;
}

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

.topbar-actions .menu-button {
  margin: 0;
}

.menu-button .btn-icon-svg {
  display: none;
}

.menu-label {
  white-space: nowrap;
}

.section {
  display: none;
  animation: fadeIn 0.4s ease;
}

.section.active {
  display: block;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.section-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.section-actions button {
  margin: 0;
}

.section-toolbar {
  margin-bottom: 16px;
  overflow: visible;
  flex-wrap: wrap;
}

.footer-watermark {
  position: fixed;
  right: calc(16px + env(safe-area-inset-right));
  bottom: calc(16px + env(safe-area-inset-bottom));
  z-index: 10;
  pointer-events: none;
  opacity: 0.7;
}

.footer-watermark img {
  width: 140px;
  max-width: 35vw;
  height: auto;
  display: block;
}

@media (max-width: 720px) {
  .footer-watermark {
    right: calc(10px + env(safe-area-inset-right));
    bottom: calc(10px + env(safe-area-inset-bottom));
  }

  .footer-watermark img {
    width: 110px;
  }
}

@media (max-width: 480px) {
  .footer-watermark img {
    width: 90px;
  }
}

.btn-new {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}

.btn-icon-left {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.6);
  background: rgba(255, 255, 255, 0.25);
  font-weight: 600;
  line-height: 1;
}

.metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}

.metric {
  background: var(--surface);
  border-radius: 16px;
  padding: 14px 16px;
  border: 1px solid var(--border);
  display: grid;
  gap: 4px;
  box-shadow: var(--shadow);
}

.metric-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--ink-soft);
}

.metric-value {
  font-size: 1.6rem;
  font-weight: 600;
}

.metric-sub {
  font-size: 0.8rem;
  color: var(--ink-soft);
}

.metric.is-disabled {
  opacity: 0.55;
}

.overview-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  gap: 16px;
  padding: 20px;
  background: linear-gradient(135deg, rgba(58, 107, 138, 0.16), rgba(224, 122, 95, 0.12));
  border: 1px solid var(--border);
  border-radius: 22px;
  margin-bottom: 20px;
  box-shadow: var(--shadow);
}

.overview-hero > * {
  min-width: 0;
}

.overview-intro .meta {
  margin: 0;
}

.overview-group {
  display: grid;
  gap: 12px;
  margin-bottom: 24px;
}

.overview-group-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.overview-group-header .meta {
  margin: 0;
}

.overview-hero-right {
  display: grid;
  gap: 14px;
  align-content: center;
}

.overview-actions {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  flex-wrap: wrap;
}

.overview-stats {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
}

.stat-chip {
  padding: 10px 12px;
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: 14px;
  display: grid;
  gap: 4px;
  box-shadow: var(--shadow-soft);
}

.stat-chip.is-disabled {
  opacity: 0.6;
}

.stat-label {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--ink-soft);
}

.stat-value {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--ink);
}

.overview-charts {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-bottom: 12px;
}

.chart-card {
  display: grid;
  gap: 12px;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.chart-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-strong);
}

.chart-card:active {
  transform: translateY(0);
}

.chart-card:focus-visible {
  outline: 2px solid rgba(58, 107, 138, 0.6);
  outline-offset: 2px;
}

.chart-card.is-disabled {
  cursor: default;
  opacity: 0.7;
  box-shadow: var(--shadow);
}

.chart-card.is-disabled:hover {
  transform: none;
  box-shadow: var(--shadow);
}

.chart-card.is-loading {
  cursor: default;
}

.chart-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.chart-bars {
  display: block;
  width: 100%;
  min-height: 140px;
}

.chart-body {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  gap: 16px;
  align-items: center;
  width: 100%;
  animation: chartFadeIn 0.4s ease;
}

.chart-pie-box {
  position: relative;
  width: 150px;
  height: 150px;
}

.chart-pie {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  box-shadow: inset 0 0 0 1px var(--border);
}

.chart-pie-center {
  position: absolute;
  inset: 18px;
  border-radius: 50%;
  background: var(--paper);
  box-shadow: inset 0 0 0 1px var(--border);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 2px;
}

.chart-total {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--ink);
}

.chart-total-label {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--ink-soft);
}

.chart-body-stack,
.chart-body-rank {
  grid-template-columns: 1fr;
}

.chart-stack {
  height: 12px;
  background: var(--surface-3);
  border-radius: 999px;
  overflow: hidden;
  display: flex;
}

.chart-stack-segment {
  height: 100%;
}

.chart-stack-total {
  font-size: 0.8rem;
  color: var(--ink-soft);
  font-weight: 600;
}

.chart-rank {
  display: grid;
  gap: 10px;
}

.chart-rank-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 1fr auto;
  gap: 10px;
  align-items: center;
}

.chart-rank-label {
  font-size: 0.85rem;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chart-rank-track {
  height: 8px;
  background: var(--surface-3);
  border-radius: 999px;
  overflow: hidden;
}

.chart-rank-bar {
  height: 100%;
  border-radius: 999px;
}

.chart-rank-value {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--ink-soft);
}

.chart-rank-total {
  font-size: 0.8rem;
  color: var(--ink-soft);
  font-weight: 600;
}

.chart-legend {
  display: grid;
  gap: 8px;
}

.chart-legend-row {
  display: grid;
  grid-template-columns: 12px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
}

.chart-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.chart-legend-label {
  font-size: 0.85rem;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chart-legend-value {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--ink-soft);
}

.chart-empty {
  font-size: 0.85rem;
  color: var(--ink-soft);
}

.chart-pie-loading {
  background: conic-gradient(var(--surface-3) 0 100%);
  animation: chartPulse 1.4s ease-in-out infinite;
}

.chart-legend-loading .chart-legend-row {
  grid-template-columns: 1fr;
}

.chart-skeleton {
  display: block;
  height: 10px;
  border-radius: 999px;
  background: var(--surface-3);
  position: relative;
  overflow: hidden;
}

.chart-skeleton::after {
  content: '';
  position: absolute;
  top: 0;
  left: -40%;
  height: 100%;
  width: 40%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.7), transparent);
  animation: chartShimmer 1.4s ease-in-out infinite;
}

.chart-detail {
  display: grid;
  gap: 12px;
}

.chart-detail-total {
  font-weight: 600;
  color: var(--ink);
}

.chart-detail-list {
  display: grid;
  gap: 8px;
}

.chart-detail-row {
  display: grid;
  grid-template-columns: 12px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
}

@keyframes chartPulse {
  0%,
  100% {
    opacity: 0.7;
  }
  50% {
    opacity: 1;
  }
}

@keyframes chartShimmer {
  0% {
    transform: translateX(0);
  }
  100% {
    transform: translateX(250%);
  }
}

@keyframes chartFadeIn {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

@media (max-width: 720px) {
  .overview-hero {
    grid-template-columns: 1fr;
    text-align: left;
  }

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

  .overview-actions {
    justify-content: flex-start;
  }

  .overview-stats {
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  }

  .chart-body {
    grid-template-columns: 1fr;
    justify-items: stretch;
    text-align: left;
  }

  .chart-body .chart-pie-box {
    justify-self: center;
  }

  .chart-body .chart-legend,
  .chart-body .chart-stack,
  .chart-body .chart-rank {
    width: 100%;
  }

  .chart-legend-row,
  .chart-detail-row,
  .chart-rank-row {
    grid-template-columns: 12px minmax(0, 1fr) auto;
  }
}

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

.section-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.panel-card {
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 18px;
  box-shadow: var(--shadow);
}

.block-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

button.tab,
.tab {
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--ink-soft);
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 0.85rem;
  margin: 0;
}

button.tab:hover,
.tab:hover {
  filter: none;
  background: var(--surface-3);
}

button.tab.is-active,
.tab.is-active {
  background: var(--ink);
  color: #fff;
  border-color: transparent;
}

.status {
  color: var(--sea);
  font-size: 0.9rem;
  margin-bottom: 12px;
}

.status-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 10px 0;
}

.pill {
  display: inline-flex;
  align-items: center;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(42, 127, 98, 0.18);
  color: #1f5e49;
  font-size: 0.85rem;
  font-weight: 600;
}

.mini-list {
  padding-left: 18px;
  margin: 8px 0 0;
  color: var(--ink-soft);
  font-size: 0.9rem;
}

.quick-actions {
  display: grid;
  gap: 10px;
}

.stack > label {
  display: block;
  margin-bottom: 12px;
  font-size: 0.95rem;
}

.form-section {
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 14px;
  background: var(--surface-2);
  margin-bottom: 14px;
}

.form-section h4 {
  margin: 0 0 12px;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--ink-soft);
}

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

.form-grid label {
  margin-bottom: 0;
}

.required-mark {
  color: #c0392b;
  margin-left: 4px;
  font-weight: 700;
}

.field-error {
  color: #c5533d;
  font-size: 0.78rem;
  margin-top: 4px;
}

input.is-invalid,
select.is-invalid,
textarea.is-invalid {
  border-color: #e07a5f;
  box-shadow: 0 0 0 2px rgba(224, 122, 95, 0.2);
}

.combo-field.is-invalid input {
  border-color: #e07a5f;
  box-shadow: 0 0 0 2px rgba(224, 122, 95, 0.2);
}

.select-field.is-invalid .select-trigger {
  border-color: #e07a5f;
  box-shadow: 0 0 0 2px rgba(224, 122, 95, 0.2);
}

.form-grid > label:last-child:nth-child(odd) {
  grid-column: 1 / -1;
}

.form-grid > .full-row {
  grid-column: 1 / -1;
}

.combo-field {
  position: relative;
  display: grid;
  gap: 6px;
  z-index: 20;
}

.combo-dropdown,
.select-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  max-height: 220px;
  overflow-y: auto;
  border: 1px solid #cbd2d9;
  border-radius: 10px;
  background: #fff;
  box-shadow: none;
  z-index: 60;
  padding: 6px;
}

.combo-option,
.select-option {
  width: 100%;
  border: 0;
  background: transparent;
  padding: 8px 10px;
  text-align: left;
  border-radius: 8px;
  border-bottom: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  cursor: pointer;
  color: var(--ink);
  margin: 0;
  font-family: inherit;
  box-shadow: none;
}

.combo-name {
  min-width: 0;
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.combo-cedula {
  color: var(--ink-soft);
  font-size: 0.82rem;
  white-space: nowrap;
}

.combo-option:hover,
.combo-option:focus,
.select-option:hover,
.select-option:focus {
  background: #1967d2;
  color: #fff;
  outline: none;
}

.combo-option:hover .combo-cedula,
.combo-option:focus .combo-cedula {
  color: #fff;
}

.select-option.is-selected {
  background: #1967d2;
  color: #fff;
}

.select-option.is-selected:hover,
.select-option.is-selected:focus {
  background: #1b6fd8;
}

.select-field {
  position: relative;
  display: grid;
  gap: 6px;
  z-index: 20;
}

.select-trigger {
  width: 100%;
  padding: 10px 12px;
  margin-top: 6px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: #fff;
  font-size: 0.95rem;
  font-family: inherit;
  color: var(--ink);
  text-align: left;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  cursor: pointer;
  box-shadow: none;
}

.select-trigger:disabled {
  background: var(--surface-2);
  color: var(--ink-soft);
  cursor: not-allowed;
}

.select-value {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.select-caret {
  width: 0;
  height: 0;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 6px solid currentColor;
  opacity: 0.6;
}

.select-native {
  position: absolute;
  opacity: 0;
  pointer-events: none;
  width: 0;
  height: 0;
  margin: 0;
  padding: 0;
}

.select-dropdown.hidden {
  display: none;
}
  color: #fff;
}

.combo-empty {
  padding: 10px;
  color: var(--ink-soft);
  font-size: 0.85rem;
}

.detail-section {
  margin-bottom: 16px;
}

.detail-section h4 {
  margin: 0 0 8px;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--ink-soft);
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.detail-item {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px 12px;
  background: var(--surface);
  display: grid;
  gap: 4px;
}

.detail-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-soft);
}

.detail-value {
  font-size: 0.95rem;
  color: var(--ink);
  word-break: break-word;
}

.detail-value.with-action {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.detail-text {
  min-width: 0;
}

.detail-action {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
}

.whatsapp-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  border: 1px solid rgba(42, 127, 98, 0.25);
  color: #2a7f62;
  background: #e8f5ef;
  text-decoration: none;
}

.whatsapp-link:hover {
  background: #dff0e7;
}

.whatsapp-icon {
  width: 16px;
  height: 16px;
}

.map-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 10px;
}

.doc-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.doc-action {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.doc-action .pdf-icon {
  width: 16px;
  height: 16px;
}

.doc-status {
  font-size: 0.9rem;
  color: var(--ink-soft);
}

.geo-search-row {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-top: 6px;
}

.geo-search-row input {
  flex: 1;
  margin-top: 0;
}

.geo-results {
  margin-top: 10px;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 8px;
  background: var(--surface);
  display: grid;
  gap: 6px;
  max-height: 160px;
  overflow: auto;
}

.pac-container {
  border-radius: 10px;
  border: 1px solid #cbd2d9;
  box-shadow: none;
  background: #fff;
  font-family: inherit;
  z-index: 1200;
}

.pac-item {
  padding: 8px 10px;
  color: var(--ink);
  font-size: 0.9rem;
}

.pac-item .pac-item-query {
  color: var(--ink);
  font-weight: 600;
}

.pac-item span {
  color: var(--ink-soft);
}

.pac-item:hover,
.pac-item-selected {
  background: #1967d2;
  color: #fff;
}

.pac-item:hover .pac-item-query,
.pac-item-selected .pac-item-query,
.pac-item:hover span,
.pac-item-selected span {
  color: #fff;
}

.geo-result {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 8px 10px;
  text-align: left;
  background: var(--surface-2);
  cursor: pointer;
  display: grid;
  gap: 4px;
}

.geo-result:hover {
  background: var(--surface-3);
}

.geo-map {
  height: 240px;
  border-radius: 16px;
  border: 1px solid var(--border);
  overflow: hidden;
  margin-top: 10px;
}

.geo-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 10px;
}

.geo-hint {
  margin-top: 6px;
  font-size: 0.82rem;
  color: var(--ink-soft);
}

label {
  display: block;
  margin-bottom: 12px;
  font-size: 0.95rem;
}

input,
select,
textarea {
  width: 100%;
  padding: 10px 12px;
  margin-top: 6px;
  border-radius: 12px;
  border: 1px solid var(--border);
  font-size: 0.95rem;
  font-family: inherit;
}

input[readonly] {
  background: var(--surface-2);
  color: var(--ink-soft);
}

button {
  background: linear-gradient(120deg, #2f3b49, #3a6b8a);
  color: white;
  border: none;
  padding: 10px 18px;
  border-radius: 999px;
  font-size: 0.95rem;
  cursor: pointer;
  margin-right: 8px;
  margin-top: 8px;
  transition: 0.2s ease;
  box-shadow: var(--btn-shadow);
}

button:hover {
  filter: brightness(1.1);
}

button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  box-shadow: none;
}

.btn-primary {
  background: linear-gradient(120deg, #2a7f62, #3c9a7a);
}

button.btn-ghost,
.btn-ghost {
  background: var(--surface);
  border: 1px solid rgba(31, 41, 51, 0.2);
  color: var(--ink);
  box-shadow: var(--shadow-soft);
}

button.btn-ghost:hover,
.btn-ghost:hover {
  filter: none;
  background: var(--surface-2);
}

.btn-danger {
  background: linear-gradient(120deg, #b5473d, #d35b4d);
}

button.geo-result {
  background: var(--surface-2);
  color: var(--ink);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 8px 10px;
  text-align: left;
  margin: 0;
  font-weight: 500;
  line-height: 1.3;
}

button.geo-result:hover {
  filter: none;
  background: var(--surface-3);
}

button.geo-result .meta {
  color: var(--ink-soft);
}

.btn-icon {
  background: transparent;
  border: none;
  color: var(--ink);
  font-size: 1.2rem;
  padding: 4px 8px;
  cursor: pointer;
}

.btn-with-icon {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.btn-icon-only {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border-radius: 12px;
}

.btn-icon-svg {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
}

.btn-icon-svg svg {
  width: 16px;
  height: 16px;
}

.inline {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: nowrap;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  max-width: 100%;
  min-width: 0;
}

.toolbar.section-toolbar {
  overflow: visible;
  flex-wrap: wrap;
}

.section-toolbar > * {
  min-width: 0;
}

.section-toolbar input[type="date"] {
  flex: 0 0 160px;
  width: 160px;
  max-width: 160px;
}

.section-toolbar input[type="search"] {
  flex: 1 1 320px;
  width: 100%;
  max-width: none;
}

.section-toolbar .combo-field {
  flex: 1 1 320px;
  width: 100%;
}

.section-toolbar .combo-field input[type="search"] {
  width: 100%;
}

.section-toolbar button {
  flex: 0 0 auto;
}

.pagination {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: nowrap;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  max-width: 100%;
  min-width: 0;
}

.toolbar > *,
.pagination > * {
  flex: 0 0 auto;
}

.toolbar input,
.toolbar select,
.toolbar button {
  width: auto;
  margin: 0;
}

.toolbar .select-field {
  align-self: center;
}

.toolbar .select-trigger {
  margin-top: 0;
}

.toolbar input[type="search"] {
  width: 240px;
  max-width: 60vw;
}

.toolbar button,
.pagination button,
.pagination .meta {
  white-space: nowrap;
}

.simple-list {
  list-style: none;
  padding: 0;
  margin: 12px 0 0;
  display: grid;
  gap: 10px;
}

.simple-list li {
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.ingresos-list li {
  align-items: flex-start;
}

.ingresos-list li.ingreso-pending {
  background: rgba(250, 214, 116, 0.2);
  border-color: rgba(245, 188, 65, 0.45);
}

.ingresos-list li.ingreso-closed {
  background: rgba(166, 214, 164, 0.2);
  border-color: rgba(118, 191, 118, 0.45);
}

.ingreso-main {
  display: grid;
  gap: 4px;
}

.ingreso-note {
  font-size: 0.82rem;
  color: var(--ink-soft);
}

.ingreso-meta {
  text-align: right;
  font-size: 0.8rem;
  color: var(--ink-soft);
  display: grid;
  gap: 2px;
}

.ingreso-side {
  display: grid;
  gap: 6px;
  text-align: right;
}

.ingreso-actions {
  display: flex;
  justify-content: flex-end;
}

.ingreso-actions button {
  margin: 0;
}

.list-table {
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
  background: var(--surface);
  width: 100%;
  max-width: 100%;
}

.list-row {
  display: grid;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  align-items: center;
  word-break: break-word;
  min-width: 0;
}

.list-row.is-ok {
  background: rgba(166, 214, 164, 0.22);
}

.list-row.is-expiring {
  background: rgba(250, 214, 116, 0.28);
}

.list-row.is-expired {
  background: rgba(239, 162, 150, 0.28);
}

.list-row.is-pending-exit {
  background: rgba(255, 201, 138, 0.32);
}

.list-row.is-ronda-completed {
  background: rgba(168, 219, 173, 0.28);
  box-shadow: inset 4px 0 0 rgba(74, 158, 104, 0.45);
}

.list-row.is-ronda-far {
  background: rgba(170, 202, 229, 0.2);
  box-shadow: inset 4px 0 0 rgba(90, 132, 168, 0.35);
}

.list-row.is-ronda-upcoming {
  background: rgba(255, 229, 153, 0.26);
  box-shadow: inset 4px 0 0 rgba(211, 162, 74, 0.4);
}

.list-row.is-ronda-soon {
  background: rgba(255, 196, 132, 0.3);
  box-shadow: inset 4px 0 0 rgba(209, 122, 65, 0.45);
}

.list-row.is-ronda-overdue {
  background: rgba(240, 160, 150, 0.3);
  box-shadow: inset 4px 0 0 rgba(187, 84, 74, 0.5);
}

.list-row.is-extra-pending {
  background: rgba(58, 107, 138, 0.18);
  box-shadow: inset 4px 0 0 rgba(58, 107, 138, 0.55);
}

.list-row.list-group-header {
  grid-template-columns: 1fr;
  background: var(--surface-3);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.72rem;
  color: var(--ink-soft);
}

.list-row.list-group-header .list-cell {
  grid-column: 1 / -1;
}

.list-row.list-group-header .list-cell::before {
  display: none;
}

.list-row:last-child {
  border-bottom: none;
}

.list-header {
  background: var(--surface-2);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-soft);
}

.list-body {
  display: grid;
}

.list-cell {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.list-cell::before {
  content: attr(data-label);
  display: none;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-soft);
}

.cell-value {
  flex: 1;
  min-width: 0;
  overflow-wrap: anywhere;
}

.list-table.users .list-row {
  grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) minmax(0, 2fr) auto;
}

.list-table.personas .list-row {
  grid-template-columns: minmax(0, 2fr) minmax(0, 2fr) minmax(0, 1fr) auto;
}

.list-table.guardias .list-row {
  grid-template-columns: minmax(0, 2fr) minmax(0, 1.3fr) minmax(0, 1.3fr) auto;
}

.list-table.administrativos .list-row {
  grid-template-columns: minmax(0, 2fr) minmax(0, 1.5fr) minmax(0, 1fr) auto;
}

.list-table.roles .list-row {
  grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) auto;
}

.list-table.permissions .list-row {
  grid-template-columns: minmax(0, 3fr) auto;
}

.list-table.settings .list-row {
  grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) auto;
}

.list-table.areas .list-row {
  grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) minmax(0, 1fr) auto;
}

.list-table.area-contactos .list-row {
  grid-template-columns: minmax(0, 2fr) minmax(0, 2fr) minmax(0, 1fr) minmax(0, 1fr) auto;
}

.list-table.puestos .list-row {
  grid-template-columns: minmax(0, 2fr) minmax(0, 2fr) minmax(0, 1fr) minmax(0, 1fr) auto;
}

.list-table.ubicaciones .list-row {
  grid-template-columns: minmax(0, 2fr) minmax(0, 2fr) minmax(0, 1fr) minmax(0, 1fr) auto;
}


.list-table.asignaciones .list-row {
  grid-template-columns: minmax(0, 2fr) minmax(0, 2fr) minmax(0, 1.5fr) minmax(0, 1fr) auto;
}

.list-table.consignas .list-row {
  grid-template-columns: minmax(0, 2fr) minmax(0, 1.5fr) minmax(0, 1fr) auto;
}

.list-table.bitacora .list-row {
  grid-template-columns: minmax(0, 2fr) minmax(0, 1.4fr) minmax(0, 1.5fr) minmax(0, 1fr) auto;
}

.list-table.ronda-zonas .list-row {
  grid-template-columns: minmax(0, 2fr) minmax(0, 1.2fr) minmax(0, 1fr) minmax(0, 1fr) auto;
}

.list-table.ronda-programaciones .list-row {
  grid-template-columns: minmax(0, 2fr) minmax(0, 1.3fr) minmax(0, 1.2fr) minmax(0, 1fr) minmax(0, 0.8fr) minmax(0, 1fr) auto;
}

.list-table.rondas .list-row {
  grid-template-columns: minmax(0, 2fr) minmax(0, 1.3fr) minmax(0, 1.3fr) minmax(0, 1fr) minmax(0, 1fr) auto;
}

.list-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: flex-start;
  min-width: 0;
}

.list-actions .action-row {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
  min-width: 0;
  max-width: 100%;
  width: 100%;
  overflow: visible;
  row-gap: 6px;
}

.list-actions .action-row > * {
  flex: 0 0 auto;
}

.list-actions button,
.list-actions a {
  max-width: 100%;
  white-space: normal;
}

.list-actions button,
.list-actions a {
  margin: 0;
}

.preview-image {
  width: 54px;
  height: 36px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  display: grid;
  place-items: center;
  overflow: hidden;
}

.preview-image img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.evidence-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: flex-start;
}

.evidence-item {
  position: relative;
  width: 96px;
  height: 72px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  overflow: hidden;
}

.evidence-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.evidence-preview {
  width: 100%;
  height: 100%;
  border: none;
  background: transparent;
  padding: 0;
  cursor: pointer;
  display: block;
}

.evidence-preview:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.evidence-remove {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: none;
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  font-size: 14px;
  line-height: 1;
  display: grid;
  place-items: center;
  cursor: pointer;
}

.evidence-remove:hover {
  background: rgba(0, 0, 0, 0.8);
}

.evidence-lightbox {
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: rgba(9, 12, 18, 0.72);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.evidence-lightbox.hidden {
  display: none;
}

.evidence-lightbox img {
  max-width: min(900px, 92vw);
  max-height: 82vh;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.35);
}

.evidence-lightbox-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.5);
  background: rgba(17, 24, 39, 0.7);
  color: #fff;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
}

.evidence-lightbox-close:hover {
  background: rgba(17, 24, 39, 0.85);
}

.qr-preview {
  display: grid;
  place-items: center;
  padding: 16px;
  border-radius: 16px;
  border: 1px dashed var(--border);
  background: var(--surface-2);
  min-height: 220px;
}

.qr-preview img {
  width: 220px;
  max-width: 100%;
  height: auto;
}

.scan-panel {
  display: grid;
  gap: 16px;
}

.scan-wait {
  display: grid;
  gap: 12px;
  justify-items: center;
  text-align: center;
  padding: 16px;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: var(--surface-2);
}

.scan-wait-status {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.scan-spinner {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid rgba(58, 107, 138, 0.25);
  border-top-color: #3a6b8a;
  animation: scanSpin 0.8s linear infinite;
}

.scan-video {
  position: relative;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: #0f172a;
  overflow: hidden;
  min-height: 220px;
}

.scan-video video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.scan-overlay {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 12px;
  background: rgba(15, 23, 42, 0.75);
  color: #fff;
  padding: 8px 12px;
  border-radius: 10px;
  font-size: 0.85rem;
  text-align: center;
}

.scan-actions {
  display: grid;
  gap: 10px;
}

.scan-actions label {
  display: grid;
  gap: 6px;
}

.scan-actions input {
  width: 100%;
}

.scan-feedback {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--ink);
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.scan-feedback.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.scan-feedback.is-success {
  background: rgba(44, 160, 120, 0.14);
  border-color: rgba(44, 160, 120, 0.4);
  color: #1f5e49;
}

.scan-feedback.is-error {
  background: rgba(224, 122, 95, 0.16);
  border-color: rgba(224, 122, 95, 0.4);
  color: #7d2f2f;
}

.scan-feedback.is-info {
  background: rgba(59, 130, 246, 0.12);
  border-color: rgba(59, 130, 246, 0.4);
  color: #1d4ed8;
}

.scan-feedback-icon {
  width: 28px;
  height: 28px;
  flex: 0 0 auto;
}

.scan-feedback-icon svg {
  width: 28px;
  height: 28px;
}

.scan-check-circle,
.scan-check-path {
  stroke-dasharray: 60;
  stroke-dashoffset: 60;
  transition: stroke-dashoffset 0.6s ease;
}

.scan-check-path {
  stroke-dasharray: 30;
  stroke-dashoffset: 30;
  transition: stroke-dashoffset 0.4s ease 0.2s;
}

.scan-feedback.is-animate .scan-check-circle {
  stroke-dashoffset: 0;
}

.scan-feedback.is-animate .scan-check-path {
  stroke-dashoffset: 0;
}

.scan-result {
  display: grid;
  place-items: center;
  text-align: center;
  gap: 12px;
  padding: 16px;
}

.scan-result-icon {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgba(44, 160, 120, 0.12);
  color: #1f5e49;
}

.scan-result-icon svg {
  width: 38px;
  height: 38px;
}

.scan-result-text {
  font-size: 1rem;
  color: var(--ink);
}

.scan-result.is-error .scan-result-icon {
  background: rgba(224, 122, 95, 0.14);
  color: #7d2f2f;
}

.scan-result.is-animate .scan-check-circle {
  stroke-dashoffset: 0;
}

.scan-result.is-animate .scan-check-path {
  stroke-dashoffset: 0;
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.8rem;
  background: rgba(31, 41, 51, 0.08);
  color: var(--ink);
}

.badge.success {
  background: rgba(42, 127, 98, 0.18);
  color: #1f5e49;
}

.badge.danger {
  background: rgba(224, 122, 95, 0.2);
  color: #8f2f1c;
}

.modal {
  position: fixed;
  inset: 0;
  background: var(--overlay);
  display: grid;
  place-items: center;
  z-index: 90;
  padding: 20px;
}

.modal.hidden {
  display: none;
}

.modal-card {
  width: min(560px, 100%);
  background: var(--surface);
  border-radius: 20px;
  padding: 20px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  max-height: 90vh;
  display: flex;
  flex-direction: column;
}

@media (min-width: 1024px) {
  .modal-card {
    width: min(760px, 92vw);
  }
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.modal-body {
  margin-top: 12px;
  overflow-y: auto;
  padding-right: 6px;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 16px;
  flex-wrap: wrap;
}

.checklist {
  display: grid;
  gap: 8px;
  padding: 10px 0 0;
}

.checklist-section {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px 12px;
  background: var(--surface);
  display: grid;
  gap: 8px;
}

.checklist-section-title {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--ink-soft);
}

.checklist-group {
  display: grid;
  gap: 8px;
}

.checklist label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
}

.checklist input {
  width: auto;
  margin-top: 0;
}

.help-text {
  font-size: 0.85rem;
  color: var(--ink-soft);
  margin-top: 6px;
}

.toggle-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  font-weight: 500;
}

.toggle-row input[type='checkbox'] {
  width: 18px;
  height: 18px;
}

.doc-link {
  color: var(--ink);
  text-decoration: underline;
  font-weight: 500;
}

.pdf-icon {
  width: 16px;
  height: 16px;
}

.meta {
  font-size: 0.82rem;
  color: var(--ink-soft);
}

pre {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: break-word;
  background: var(--surface-2);
  border-radius: 12px;
  padding: 12px;
  border: 1px dashed var(--border);
}

.hint {
  font-size: 0.85rem;
  color: var(--ink-soft);
}

.gate {
  position: fixed;
  inset: 0;
  background: var(--overlay);
  backdrop-filter: blur(6px);
  display: grid;
  place-items: center;
  z-index: 100;
  padding: 24px;
}

.nav-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(24, 33, 45, 0.35);
  z-index: 60;
}

.nav-backdrop.hidden {
  display: none;
}

.gate.hidden {
  display: none;
}

.gate-card {
  width: min(520px, 100%);
  background: var(--surface);
  border-radius: 20px;
  padding: 24px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
}

.skeleton-line {
  height: 10px;
  border-radius: 999px;
  background: linear-gradient(90deg, #e6eaf0, #f4f6fa, #e6eaf0);
  background-size: 200% 100%;
  animation: shimmer 1.4s ease infinite;
  margin-bottom: 8px;
}

.skeleton-line.w-40 {
  width: 40%;
}

.skeleton-line.w-60 {
  width: 60%;
}

.skeleton-line.w-80 {
  width: 80%;
}


button.is-loading {
  color: transparent;
  position: relative;
}

button.is-loading::after {
  content: '';
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.6);
  border-top-color: #fff;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  animation: spin 0.8s linear infinite;
}

@keyframes shimmer {
  0% { background-position: 0% 50%; }
  100% { background-position: 200% 50%; }
}

@keyframes liftIn {
  from { transform: translateY(16px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes spin {
  from { transform: translate(-50%, -50%) rotate(0deg); }
  to { transform: translate(-50%, -50%) rotate(360deg); }
}

@media (max-width: 1080px) {
  .list-table.users .list-row {
    grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) auto;
  }

  .list-table.users .list-header div:nth-child(3),
  .list-table.users .list-body .list-row div:nth-child(3) {
    display: none;
  }
}

@media (max-width: 960px) {
  .topbar {
    display: flex;
  }

  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: min(320px, 86vw);
    height: 100vh;
    height: 100svh;
    height: 100dvh;
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
    padding: 20px;
    max-height: none;
    top: 0;
    transform: translateX(-110%);
    transition: transform 0.3s ease;
    z-index: 70;
  }

  .nav {
    width: 100%;
    display: grid;
    gap: 6px;
    padding-right: 4px;
    overflow-y: auto;
  }

  .sidebar-footer {
    margin-top: 0;
    width: 100%;
    display: grid;
    gap: 8px;
  }

  .tagline {
    display: none;
  }

  .main {
    padding: 20px;
  }

  .topbar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    column-gap: 12px;
  }

  .topbar-brand {
    display: flex;
    align-items: flex-start;
    min-width: 0;
  }

  .topbar-brand .logo {
    width: 36px;
    height: 36px;
    border-radius: 12px;
    font-size: 0.95rem;
  }

  .topbar-brand-text {
    max-width: 100%;
    overflow: visible;
    text-overflow: clip;
    white-space: normal;
    overflow-wrap: anywhere;
  }

  .topbar-brand-text strong {
    display: block;
    line-height: 1.2;
  }

  .topbar-actions {
    margin-left: 0;
    flex-wrap: nowrap;
    justify-self: end;
  }

  .menu-button {
    display: inline-flex;
  }

  .menu-button .btn-icon-svg {
    display: inline-flex;
  }

  body.nav-open .sidebar {
    transform: translateX(0);
  }

  body.nav-open .nav-backdrop {
    display: block;
  }
}

@media (min-width: 961px) {
  .topbar-brand {
    display: none !important;
  }
}

@media (max-width: 720px) {
  .form-grid {
    grid-template-columns: 1fr;
  }

  .detail-grid {
    grid-template-columns: 1fr;
  }

  .geo-search-row {
    flex-direction: column;
    align-items: stretch;
  }

  .geo-search-row button {
    width: 100%;
  }

  .geo-map {
    height: 200px;
  }

  .geo-results {
    max-height: 140px;
  }

  .simple-list {
    gap: 6px;
  }

  .simple-list li {
    padding: 8px 10px;
    gap: 8px;
  }

  .ingresos-list li {
    flex-direction: column;
    align-items: flex-start;
  }

  .ingreso-meta {
    text-align: left;
  }

  .ingreso-side {
    width: 100%;
    text-align: left;
  }

  .ingreso-actions {
    justify-content: flex-start;
  }

  .toolbar {
    gap: 6px;
  }

  .toolbar input[type="search"] {
    width: 200px;
  }

  .toolbar button,
  .toolbar select,
  .pagination button {
    padding: 8px 12px;
    font-size: 0.85rem;
  }

  .list-table.users .list-row,
  .list-table.personas .list-row,
  .list-table.guardias .list-row,
  .list-table.administrativos .list-row,
  .list-table.areas .list-row,
  .list-table.area-contactos .list-row,
  .list-table.puestos .list-row,
  .list-table.ubicaciones .list-row,
  .list-table.asignaciones .list-row,
  .list-table.consignas .list-row,
  .list-table.bitacora .list-row,
  .list-table.roles .list-row,
  .list-table.permissions .list-row,
  .list-table.settings .list-row,
  .list-table.ronda-zonas .list-row,
  .list-table.ronda-programaciones .list-row,
  .list-table.rondas .list-row {
    grid-template-columns: 1fr;
  }

  .list-header {
    display: none;
  }

  .list-row {
    padding: 10px 12px;
    gap: 10px;
    align-items: flex-start;
  }

  .list-cell {
    display: grid;
    grid-template-columns: minmax(90px, 34%) 1fr;
    align-items: start;
    gap: 6px;
    background: transparent;
  }

  .list-cell::before {
    display: block;
    font-size: 0.65rem;
    line-height: 1.1;
  }


  .list-table .list-row.is-ok {
    background: rgba(166, 214, 164, 0.22);
  }

  .list-table .list-row.is-expiring {
    background: rgba(250, 214, 116, 0.28);
  }

  .list-table .list-row.is-expired {
    background: rgba(239, 162, 150, 0.28);
  }

  .list-table .list-row.is-pending-exit {
    background: rgba(255, 201, 138, 0.32);
  }

  .list-table .list-row.is-ronda-completed {
    background: rgba(168, 219, 173, 0.28);
    box-shadow: inset 4px 0 0 rgba(74, 158, 104, 0.45);
  }

  .list-table .list-row.is-ronda-far {
    background: rgba(170, 202, 229, 0.2);
    box-shadow: inset 4px 0 0 rgba(90, 132, 168, 0.35);
  }

  .list-table .list-row.is-ronda-upcoming {
    background: rgba(255, 229, 153, 0.26);
    box-shadow: inset 4px 0 0 rgba(211, 162, 74, 0.4);
  }

  .list-table .list-row.is-ronda-soon {
    background: rgba(255, 196, 132, 0.3);
    box-shadow: inset 4px 0 0 rgba(209, 122, 65, 0.45);
  }

  .list-table .list-row.is-ronda-overdue {
    background: rgba(240, 160, 150, 0.3);
    box-shadow: inset 4px 0 0 rgba(187, 84, 74, 0.5);
  }

  .list-table .list-row.is-extra-pending {
    background: rgba(58, 107, 138, 0.18);
    box-shadow: inset 4px 0 0 rgba(58, 107, 138, 0.55);
  }

  .cell-value {
    min-width: 0;
  }

  .list-actions {
    justify-content: flex-start;
    width: 100%;
    gap: 4px;
  }

  .list-actions button {
    padding: 8px 12px;
    font-size: 0.85rem;
    margin-top: 0;
  }

  .list-cell.list-actions {
    display: grid;
    align-items: center;
    grid-template-columns: minmax(90px, 34%) 1fr;
    gap: 6px;
  }

  .list-cell.list-actions::before {
    display: block;
  }

  .list-cell.list-actions .action-row {
    grid-column: 2;
    flex-wrap: wrap;
    gap: 4px;
    overflow: visible;
  }

  .list-actions .btn-icon-only {
    width: 32px;
    height: 32px;
    border-radius: 10px;
    padding: 0;
  }
}

@media (max-width: 840px) {
  .section-header,
  .block-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .status-row {
    flex-wrap: wrap;
  }

  .metrics {
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  }

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

@media (max-width: 600px) {
  .topbar {
    align-items: flex-start;
  }

  h1 {
    font-size: 1.8rem;
  }

  .main {
    padding: 16px;
  }

  .panel-card {
    padding: 14px;
  }

  .metric-value {
    font-size: 1.4rem;
  }

  .form-section {
    padding: 12px;
  }

  .form-grid {
    gap: 10px 12px;
  }

  .modal-card {
    padding: 16px;
  }

  .modal-body {
    padding-right: 0;
  }
}

@media (max-width: 480px) {
  .list-row {
    padding: 8px 10px;
    gap: 8px;
  }

  .list-cell {
    grid-template-columns: minmax(70px, 32%) 1fr;
    gap: 6px;
  }

  .list-cell::before {
    font-size: 0.6rem;
  }

  .toolbar input[type="search"] {
    width: 160px;
  }

  .toolbar button,
  .toolbar select,
  .pagination button,
  .list-actions button {
    padding: 6px 10px;
    font-size: 0.8rem;
  }

  .geo-map {
    height: 180px;
  }

  .modal-footer button {
    flex: 1;
  }
}
.main,
.section,
.panel-card,
.section-header,
.block-header {
  max-width: 100%;
  min-width: 0;
}

img,
svg,
video,
canvas {
  max-width: 100%;
  height: auto;
}
