:root {
  --sis-navy-950: #07182b;
  --sis-navy-900: #0b3157;
  --sis-navy-800: #114a78;
  --sis-blue-700: #17628f;
  --sis-cyan-600: #009bb5;
  --sis-cyan-500: #12b7ca;
  --sis-green-600: #2f976f;
  --sis-yellow-500: #f2bd25;
  --sis-orange-500: #ee7c3b;
  --sis-surface: #ffffff;
  --sis-canvas: #f5f7fb;
  --sis-cream: #fffcf5;
  --sis-text: #162334;
  --sis-muted: #6f7a88;
  --sis-line: #dde3ea;
  --sis-shadow: 0 18px 50px rgba(20, 48, 78, 0.11);
  --navy: var(--sis-navy-950);
  --blue: var(--sis-blue-700);
  --teal: var(--sis-cyan-600);
  --ink: var(--sis-text);
  --muted: var(--sis-muted);
  --border: var(--sis-line);
  --shadow-sm: 0 8px 28px rgba(24, 50, 76, 0.06);
  --radius-lg: 20px;
  --sidebar-width: 278px;
  color-scheme: light;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.remote-control-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(360px, .75fr);
  gap: 18px;
  margin-top: 18px;
}

.remote-command-panel,
.command-history-panel {
  overflow: hidden;
}

.remote-command-form {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(190px, 1fr);
  gap: 14px;
  padding: 18px;
}

.remote-command-form label {
  display: grid;
  gap: 7px;
}

.remote-command-form label > span {
  color: var(--muted);
  font-size: .74rem;
  font-weight: 800;
  letter-spacing: .05em;
  text-transform: uppercase;
}

.remote-command-form select,
.remote-command-form input {
  width: 100%;
  min-height: 46px;
  border: 1px solid #cbd8e4;
  border-radius: 12px;
  background: #fff;
  color: var(--ink);
  padding: 0 13px;
  outline: none;
}

.remote-command-form select:focus,
.remote-command-form input:focus {
  border-color: #0b8ca5;
  box-shadow: 0 0 0 3px rgba(11, 140, 165, .12);
}

.remote-reason {
  grid-column: 1 / -1;
}

.primary-action {
  min-height: 46px;
  border: 0;
  border-radius: 12px;
  background: linear-gradient(135deg, #0b3f68, #0d7096);
  color: #fff;
  font-weight: 800;
  padding: 0 22px;
  cursor: pointer;
  justify-self: start;
}

.primary-action:hover {
  filter: brightness(1.06);
  transform: translateY(-1px);
}

.primary-action:disabled {
  cursor: wait;
  filter: none;
  opacity: .68;
  transform: none;
}

.form-help {
  margin: 0;
  padding: 0 18px 18px;
  color: var(--muted);
  font-size: .82rem;
}

[data-command-feedback] {
  margin: 0 18px 14px;
}

.command-history {
  display: grid;
  max-height: 310px;
  overflow: auto;
}

.command-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 12px;
  align-items: center;
  padding: 13px 16px;
  border-top: 1px solid #e4ebf1;
}

.command-row div {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.command-row strong,
.command-row span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.command-row div span,
.command-row time {
  color: var(--muted);
  font-size: .75rem;
}

.command-state {
  border-radius: 999px;
  background: #edf2f6;
  color: #405366;
  font-size: .67rem;
  font-weight: 900;
  padding: 5px 8px;
}

.command-state.state-ejecutado { background: #e1f6ea; color: #18754a; }
.command-state.state-error,
.command-state.state-rechazado,
.command-state.state-vencido { background: #ffe8e8; color: #a22d35; }
.command-state.state-pendiente,
.command-state.state-entregado,
.command-state.state-recibido { background: #fff3cf; color: #846300; }
.command-state.state-esperando_gps,
.command-state.state-esperandogps { background: #fff0c2; color: #7a5700; }

.empty-compact {
  padding: 26px 18px;
  color: var(--muted);
  text-align: center;
}

@media (max-width: 980px) {
  .remote-control-grid {
    grid-template-columns: 1fr;
  }
}

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

  .remote-reason {
    grid-column: auto;
  }

  .command-row {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .command-row time {
    grid-column: 1 / -1;
  }
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--sis-text);
  background: var(--sis-canvas);
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
}

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

button,
a {
  -webkit-tap-highlight-color: transparent;
}

a {
  color: inherit;
  text-decoration: none;
}

svg {
  display: block;
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--sis-cyan-600);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.primary-button,
.secondary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 48px;
  padding: 0 20px;
  border-radius: 14px;
  font-weight: 750;
  cursor: pointer;
  transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.primary-button {
  border: 0;
  color: #fff;
  background: linear-gradient(135deg, var(--sis-navy-900), #176293);
  box-shadow: 0 14px 30px rgba(11, 49, 87, 0.22);
}

.secondary-button {
  border: 1px solid rgba(11, 49, 87, 0.18);
  color: var(--sis-navy-900);
  background: #fff;
}

.primary-button:hover,
.secondary-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 30px rgba(11, 49, 87, 0.15);
}

/* Acceso */
.auth-body {
  background: #edf3f8;
}

.login-page {
  display: grid;
  grid-template-columns: minmax(420px, 1.08fr) minmax(470px, 0.92fr);
  min-height: 100vh;
}

.login-brand-panel {
  position: relative;
  display: flex;
  min-height: 100vh;
  overflow: hidden;
  color: #fff;
  background:
    linear-gradient(135deg, rgba(5, 28, 52, 0.97), rgba(11, 65, 105, 0.88)),
    url("/img/branding/login-background.jpg") center / cover;
}

.login-brand-panel::before,
.login-brand-panel::after {
  position: absolute;
  content: "";
  border-radius: 999px;
  pointer-events: none;
}

.login-brand-panel::before {
  width: 520px;
  height: 520px;
  right: -260px;
  top: -160px;
  border: 1px solid rgba(255, 255, 255, 0.13);
  box-shadow: 0 0 0 70px rgba(255, 255, 255, 0.025), 0 0 0 150px rgba(255, 255, 255, 0.02);
}

.login-brand-panel::after {
  width: 260px;
  height: 260px;
  left: -100px;
  bottom: -110px;
  background: rgba(15, 183, 202, 0.13);
  filter: blur(2px);
}

.login-brand-content {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  width: min(100%, 760px);
  min-height: 100%;
  padding: clamp(34px, 5vw, 74px);
}

.product-lockup {
  display: flex;
  align-items: center;
  gap: 16px;
}

.product-lockup img {
  width: 76px;
  height: 76px;
  padding: 8px;
  border: 1px solid rgba(8, 93, 138, 0.12);
  border-radius: 22px;
  object-fit: contain;
  background: #fff;
}

.product-lockup div {
  display: grid;
  gap: 2px;
}

.product-lockup strong {
  color: var(--sis-navy-950);
  font-size: 1.65rem;
  line-height: 1;
}

.product-lockup span {
  color: #435267;
  font-size: 0.88rem;
}

.product-lockup small {
  color: var(--sis-cyan-600);
  font-size: 0.75rem;
  font-weight: 800;
}

.product-lockup-light strong,
.product-lockup-light span {
  color: #fff;
}

.product-lockup-light small {
  color: #5dd5e2;
}

.login-message {
  max-width: 680px;
  margin: auto 0;
  padding: 70px 0 38px;
}

.login-message .eyebrow {
  color: #62d9e5;
}

.login-message h1 {
  max-width: 650px;
  margin: 0;
  font-size: clamp(2.45rem, 4.5vw, 4.5rem);
  line-height: 1.04;
  letter-spacing: -0.045em;
}

.login-message > p:last-child {
  max-width: 620px;
  margin: 24px 0 0;
  color: rgba(255, 255, 255, 0.76);
  font-size: 1.08rem;
  line-height: 1.75;
}

.login-feature-list {
  display: flex;
  flex-wrap: wrap;
  gap: 13px 24px;
  padding-top: 26px;
  border-top: 1px solid rgba(255, 255, 255, 0.14);
  color: rgba(255, 255, 255, 0.82);
  font-size: 0.86rem;
}

.login-feature-list span {
  display: flex;
  align-items: center;
  gap: 8px;
}

.login-feature-list i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #4cd2df;
  box-shadow: 0 0 0 5px rgba(76, 210, 223, 0.12);
}

.login-form-panel {
  display: grid;
  place-items: center;
  min-height: 100vh;
  padding: clamp(24px, 5vw, 72px);
  background:
    radial-gradient(circle at 85% 12%, rgba(18, 183, 202, 0.12), transparent 28%),
    #f7f9fc;
}

.login-card {
  width: min(100%, 520px);
  padding: clamp(28px, 4vw, 52px);
  border: 1px solid rgba(11, 49, 87, 0.1);
  border-radius: 28px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: var(--sis-shadow);
}

.mobile-lockup {
  display: none;
  margin-bottom: 34px;
}

.login-heading h2 {
  margin: 0;
  color: var(--sis-navy-950);
  font-size: clamp(2rem, 4vw, 2.7rem);
  letter-spacing: -0.035em;
}

.login-heading > p:last-child {
  margin: 12px 0 0;
  color: var(--sis-muted);
  line-height: 1.65;
}

.login-form {
  margin-top: 30px;
}

.field-label {
  display: block;
  margin: 18px 0 8px;
  color: #2e3c4e;
  font-size: 0.82rem;
  font-weight: 750;
}

.field-shell {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) auto;
  align-items: center;
  min-height: 58px;
  padding: 0 14px;
  border: 1px solid #d7dee7;
  border-radius: 16px;
  background: #fff;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

.field-shell:focus-within {
  border-color: var(--sis-blue-700);
  box-shadow: 0 0 0 4px rgba(23, 98, 143, 0.1);
}

.field-shell > svg {
  color: #7a8798;
}

.field-shell input {
  width: 100%;
  min-width: 0;
  height: 56px;
  padding: 0 10px;
  border: 0;
  outline: 0;
  color: var(--sis-text);
  background: transparent;
}

.field-shell input::placeholder {
  color: #9aa4b0;
}

.password-toggle {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 10px;
  color: #718095;
  background: transparent;
  cursor: pointer;
}

.password-toggle:hover {
  color: var(--sis-navy-900);
  background: #edf4f8;
}

.field-error {
  display: block;
  min-height: 18px;
  margin-top: 5px;
  color: #b73d48;
  font-size: 0.76rem;
}

.form-alert:empty {
  display: none;
}

.form-alert {
  margin-bottom: 18px;
  padding: 12px 14px;
  border-left: 4px solid #ce4451;
  border-radius: 10px;
  color: #8c2934;
  background: #fff0f1;
  font-size: 0.84rem;
}

.form-alert ul {
  margin: 0;
  padding-left: 18px;
}

.login-options {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 8px 0 24px;
  color: var(--sis-muted);
  font-size: 0.82rem;
}

.check-control {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  cursor: pointer;
}

.check-control input {
  position: absolute;
  opacity: 0;
}

.check-control span {
  position: relative;
  width: 19px;
  height: 19px;
  border: 1px solid #b9c4d0;
  border-radius: 5px;
  background: #fff;
}

.check-control input:checked + span {
  border-color: var(--sis-navy-800);
  background: var(--sis-navy-800);
}

.check-control input:checked + span::after {
  position: absolute;
  width: 8px;
  height: 4px;
  left: 5px;
  top: 5px;
  content: "";
  border-left: 2px solid #fff;
  border-bottom: 2px solid #fff;
  transform: rotate(-45deg);
}

.secure-label {
  color: var(--sis-green-600);
  font-weight: 700;
}

.login-submit {
  width: 100%;
  min-height: 56px;
}

.login-footer {
  display: flex;
  align-items: center;
  gap: 15px;
  margin-top: 30px;
  padding-top: 24px;
  border-top: 1px solid #e8edf2;
}

.login-footer img {
  width: 92px;
  height: 52px;
  object-fit: contain;
}

.login-footer p {
  margin: 0;
  color: #8a94a0;
  font-size: 0.74rem;
  line-height: 1.55;
}

/* Aplicación */
.dashboard-body {
  overflow-x: hidden;
}

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

.sidebar {
  position: fixed;
  z-index: 30;
  inset: 0 auto 0 0;
  display: flex;
  flex-direction: column;
  width: var(--sidebar-width);
  min-height: 100vh;
  padding: 24px 18px 18px;
  color: rgba(255, 255, 255, 0.78);
  background: linear-gradient(180deg, #0b3157 0%, #082742 100%);
  box-shadow: 10px 0 35px rgba(6, 24, 43, 0.12);
}

.sidebar-brand {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 0 8px 22px;
}

.sidebar-brand img {
  width: 54px;
  height: 54px;
  padding: 5px;
  border-radius: 50%;
  object-fit: contain;
  background: #fff;
}

.sidebar-brand div {
  display: grid;
  gap: 2px;
}

.sidebar-brand strong {
  color: #fff;
  font-size: 1.32rem;
}

.sidebar-brand span {
  color: #55d4df;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.sidebar-close {
  display: none;
  width: 34px;
  height: 34px;
  border: 0;
  color: #fff;
  background: transparent;
  font-size: 1.7rem;
  cursor: pointer;
}

.sidebar-search {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  min-height: 45px;
  padding: 0 13px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.07);
}

.sidebar-search svg {
  width: 18px;
  height: 18px;
  color: rgba(255, 255, 255, 0.5);
}

.sidebar-search input {
  width: 100%;
  min-width: 0;
  height: 42px;
  border: 0;
  outline: 0;
  color: #fff;
  background: transparent;
  font-size: 0.8rem;
}

.sidebar-search input::placeholder {
  color: rgba(255, 255, 255, 0.46);
}

.sidebar-nav {
  display: grid;
  gap: 5px;
  margin-top: 22px;
  overflow-y: auto;
  scrollbar-width: thin;
}

.nav-label {
  margin: 18px 12px 5px;
  color: rgba(255, 255, 255, 0.36);
  font-size: 0.64rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.nav-label:first-child {
  margin-top: 0;
}

.nav-link {
  display: grid;
  grid-template-columns: 25px minmax(0, 1fr) auto;
  align-items: center;
  gap: 11px;
  min-height: 48px;
  padding: 0 13px;
  border-radius: 13px;
  color: rgba(255, 255, 255, 0.69);
  font-size: 0.83rem;
  font-weight: 650;
  transition: color 150ms ease, background 150ms ease, transform 150ms ease;
}

.nav-link svg {
  width: 20px;
  height: 20px;
}

.nav-link:hover,
.nav-link.is-active {
  color: #fff;
  background: linear-gradient(90deg, rgba(22, 143, 175, 0.55), rgba(22, 143, 175, 0.18));
  transform: translateX(2px);
}

.nav-link.is-active {
  box-shadow: inset 3px 0 #50d5df;
}

.nav-link.is-filtered {
  display: none;
}

.live-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #42d79b;
  box-shadow: 0 0 0 5px rgba(66, 215, 155, 0.12);
}

.sidebar-company {
  display: grid;
  justify-items: center;
  gap: 8px;
  margin-top: auto;
  padding-top: 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.09);
  text-align: center;
}

.sidebar-company img {
  width: 95px;
  height: 52px;
  object-fit: contain;
  filter: brightness(0) invert(1);
  opacity: 0.82;
}

.sidebar-company span {
  color: rgba(255, 255, 255, 0.44);
  font-size: 0.67rem;
  line-height: 1.5;
}

.sidebar-backdrop {
  display: none;
}

.app-main {
  grid-column: 2;
  min-width: 0;
}

.topbar {
  position: sticky;
  z-index: 20;
  top: 0;
  display: flex;
  align-items: center;
  gap: 18px;
  min-height: 82px;
  padding: 13px 30px;
  border-bottom: 1px solid rgba(14, 53, 86, 0.08);
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(14px);
}

.menu-button,
.icon-button,
.panel-tools button {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 1px solid #dfe6ed;
  border-radius: 12px;
  color: #526274;
  background: #fff;
  cursor: pointer;
}

.menu-button {
  display: none;
}

.topbar-context {
  display: grid;
  min-width: 0;
  gap: 1px;
}

.topbar-context > span {
  color: var(--sis-muted);
  font-size: 0.68rem;
  text-transform: uppercase;
}

.topbar-context strong {
  max-width: 440px;
  overflow: hidden;
  color: var(--sis-navy-950);
  font-size: 0.91rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.topbar-context small {
  color: #8c96a2;
  font-size: 0.68rem;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 13px;
  margin-left: auto;
}

.system-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 11px;
  border: 1px solid #cde9dc;
  border-radius: 999px;
  color: #277859;
  background: #effaf5;
  font-size: 0.72rem;
  font-weight: 750;
}

.system-status i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #3bb27f;
}

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

.user-avatar {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 13px;
  color: #fff;
  background: linear-gradient(135deg, var(--sis-navy-900), var(--sis-cyan-600));
  font-size: 0.78rem;
  font-weight: 850;
}

.user-menu > div {
  display: grid;
  gap: 2px;
}

.user-menu strong {
  max-width: 190px;
  overflow: hidden;
  color: #263444;
  font-size: 0.78rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-menu span:not(.user-avatar) {
  color: #8a94a0;
  font-size: 0.66rem;
}

.user-menu form {
  margin: 0;
}

.logout-link {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 10px;
  color: #6d7886;
  background: transparent;
  cursor: pointer;
}

.logout-link:hover {
  color: #b23b48;
  background: #fff1f2;
}

.dashboard-content {
  width: min(100%, 1660px);
  margin: 0 auto;
  padding: 30px clamp(20px, 3vw, 42px) 22px;
}

.dashboard-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
}

.dashboard-header h1 {
  margin: 0;
  color: var(--sis-navy-950);
  font-size: clamp(1.9rem, 3vw, 2.55rem);
  letter-spacing: -0.035em;
}

.dashboard-header > div > p:last-child {
  max-width: 700px;
  margin: 9px 0 0;
  color: var(--sis-muted);
  line-height: 1.55;
}

.secondary-button svg,
.primary-button svg {
  width: 19px;
  height: 19px;
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-top: 26px;
}

.kpi-card {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr);
  align-items: center;
  gap: 15px;
  min-height: 134px;
  padding: 20px;
  border: 1px solid var(--sis-line);
  border-radius: 19px;
  background: #fff;
  box-shadow: 0 8px 28px rgba(24, 50, 76, 0.055);
}

.kpi-icon {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border-radius: 16px;
}

.kpi-icon svg {
  width: 25px;
  height: 25px;
}

.kpi-blue .kpi-icon { color: #176293; background: #e9f3fa; }
.kpi-green .kpi-icon { color: #2e956e; background: #e9f7f0; }
.kpi-yellow .kpi-icon { color: #a97b08; background: #fff7da; }
.kpi-orange .kpi-icon { color: #d3652f; background: #fff0e8; }

.kpi-card > div:last-child {
  display: grid;
  gap: 3px;
}

.kpi-card span {
  color: var(--sis-muted);
  font-size: 0.76rem;
  font-weight: 680;
}

.kpi-card strong {
  color: var(--sis-navy-950);
  font-size: 2rem;
  line-height: 1;
}

.kpi-card small {
  color: #9aa3ad;
  font-size: 0.68rem;
}

.operations-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) minmax(300px, 0.75fr);
  gap: 18px;
  margin-top: 18px;
}

.panel {
  overflow: hidden;
  border: 1px solid var(--sis-line);
  border-radius: 20px;
  background: #fff;
  box-shadow: 0 8px 28px rgba(24, 50, 76, 0.05);
}

.map-panel.is-expanded {
  position: fixed;
  z-index: 80;
  inset: 18px;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  box-shadow: 0 30px 90px rgba(5, 24, 43, 0.35);
}

.map-panel.is-expanded .map-empty {
  min-height: 0;
}

body.has-expanded-map::after {
  position: fixed;
  z-index: 70;
  inset: 0;
  content: "";
  background: rgba(5, 24, 43, 0.55);
}

.toast-message {
  position: fixed;
  z-index: 100;
  right: 22px;
  bottom: 22px;
  max-width: min(390px, calc(100vw - 32px));
  padding: 13px 17px;
  border-radius: 13px;
  color: #fff;
  background: #10263b;
  box-shadow: 0 14px 35px rgba(5, 24, 43, 0.28);
  font-size: 0.8rem;
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 180ms ease, transform 180ms ease;
}

.toast-message.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 76px;
  padding: 16px 20px;
  border-bottom: 1px solid #e9edf2;
}

.panel-kicker {
  display: block;
  margin-bottom: 3px;
  color: var(--sis-cyan-600);
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.panel-header h2 {
  margin: 0;
  color: var(--sis-navy-950);
  font-size: 1rem;
}

.panel-tools {
  display: flex;
  align-items: center;
  gap: 9px;
}

.panel-tools button {
  width: 36px;
  height: 36px;
}

.panel-tools button svg {
  width: 17px;
  height: 17px;
}

.source-chip {
  padding: 6px 10px;
  border-radius: 999px;
  color: #29785a;
  background: #edf9f3;
  font-size: 0.65rem;
  font-weight: 750;
}

.map-empty {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 390px;
  overflow: hidden;
  background:
    linear-gradient(rgba(27, 94, 126, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(27, 94, 126, 0.045) 1px, transparent 1px),
    #edf3ef;
  background-size: 42px 42px;
}

.map-road {
  position: absolute;
  height: 20px;
  border: 5px solid rgba(255, 255, 255, 0.92);
  border-right: 0;
  border-left: 0;
  opacity: 0.85;
  transform-origin: center;
}

.road-one { width: 120%; transform: rotate(-12deg); }
.road-two { width: 90%; transform: rotate(48deg); }
.road-three { width: 80%; transform: rotate(91deg); }

.map-empty-message {
  position: relative;
  z-index: 2;
  display: grid;
  justify-items: center;
  width: min(88%, 390px);
  padding: 24px;
  border: 1px solid rgba(11, 49, 87, 0.1);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 15px 35px rgba(34, 65, 89, 0.12);
  text-align: center;
  backdrop-filter: blur(6px);
}

.map-empty-message > span,
.empty-activity > span {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  margin-bottom: 12px;
  border-radius: 15px;
  color: var(--sis-cyan-600);
  background: #e6f6f8;
}

.map-empty-message strong,
.empty-activity strong {
  color: var(--sis-navy-950);
}

.map-empty-message p,
.empty-activity p {
  margin: 7px 0 0;
  color: var(--sis-muted);
  font-size: 0.78rem;
  line-height: 1.55;
}

.map-attribution {
  position: absolute;
  right: 8px;
  bottom: 6px;
  color: #7d8790;
  font-size: 0.58rem;
}

.text-button {
  border: 0;
  color: var(--sis-blue-700);
  background: transparent;
  font-size: 0.72rem;
  font-weight: 750;
  cursor: pointer;
}

.activity-panel {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
}

.empty-activity {
  display: grid;
  align-content: center;
  justify-items: center;
  min-height: 280px;
  padding: 30px;
  text-align: center;
}

.activity-footer {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 18px;
  border-top: 1px solid #edf0f3;
  color: #89939e;
  background: #fafbfd;
  font-size: 0.67rem;
}

.activity-footer i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--sis-green-600);
}

.module-section {
  margin-top: 32px;
  scroll-margin-top: 100px;
}

.section-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
}

.section-heading h2 {
  margin: 0;
  color: var(--sis-navy-950);
  font-size: 1.35rem;
}

.section-heading > p {
  max-width: 480px;
  margin: 0;
  color: var(--sis-muted);
  font-size: 0.78rem;
  line-height: 1.55;
  text-align: right;
}

.module-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 15px;
  margin-top: 16px;
}

.module-card {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr) auto;
  align-items: center;
  gap: 13px;
  min-height: 118px;
  padding: 18px;
  border: 1px solid var(--sis-line);
  border-radius: 18px;
  background: #fff;
  transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
}

.module-card:hover {
  border-color: rgba(23, 98, 143, 0.25);
  box-shadow: 0 14px 32px rgba(24, 50, 76, 0.09);
  transform: translateY(-2px);
}

.module-icon {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 14px;
}

.module-icon svg { width: 22px; height: 22px; }
.module-icon.blue { color: #176293; background: #e9f3fa; }
.module-icon.cyan { color: #0b95ab; background: #e5f6f8; }
.module-icon.green { color: #2f926e; background: #e8f7ef; }
.module-icon.yellow { color: #a87906; background: #fff5d4; }

.module-card > div {
  display: grid;
  gap: 5px;
}

.module-card strong {
  color: var(--sis-navy-950);
  font-size: 0.86rem;
}

.module-card p {
  margin: 0;
  color: var(--sis-muted);
  font-size: 0.7rem;
  line-height: 1.45;
}

.module-card > b {
  color: #9aa5b1;
  font-size: 1.1rem;
}

.dashboard-footer {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  margin-top: 32px;
  padding: 22px 2px 4px;
  border-top: 1px solid #dde3ea;
  color: #8b95a0;
  font-size: 0.7rem;
}

.dashboard-footer strong {
  color: var(--sis-cyan-600);
}

.status-page {
  display: grid;
  place-items: center;
  min-height: 100vh;
  padding: 24px;
  background: radial-gradient(circle at top, #eef9fb, #eef2f6 60%);
}

.status-card {
  display: grid;
  justify-items: center;
  width: min(100%, 470px);
  padding: 45px;
  border: 1px solid var(--sis-line);
  border-radius: 26px;
  background: #fff;
  box-shadow: var(--sis-shadow);
  text-align: center;
}

.status-card img {
  width: 76px;
  height: 76px;
  object-fit: contain;
}

.status-card h1 {
  margin: 0;
  color: var(--sis-navy-950);
}

.status-card > p:not(.eyebrow) {
  margin: 12px 0 25px;
  color: var(--sis-muted);
}

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

  .operations-grid {
    grid-template-columns: minmax(0, 1.35fr) minmax(280px, 0.85fr);
  }
}

@media (max-width: 980px) {
  .login-page {
    grid-template-columns: 1fr;
  }

  .login-brand-panel {
    display: none;
  }

  .mobile-lockup {
    display: flex;
  }

  .login-form-panel {
    min-height: 100vh;
  }

  .app-shell {
    display: block;
  }

  .sidebar {
    width: min(86vw, 310px);
    transform: translateX(-105%);
    transition: transform 200ms ease;
  }

  .app-shell.sidebar-open .sidebar {
    transform: translateX(0);
  }

  .sidebar-close,
  .menu-button {
    display: grid;
  }

  .sidebar-backdrop {
    position: fixed;
    z-index: 25;
    inset: 0;
    background: rgba(4, 18, 32, 0.48);
    opacity: 0;
    pointer-events: none;
    transition: opacity 200ms ease;
  }

  .app-shell.sidebar-open .sidebar-backdrop {
    display: block;
    opacity: 1;
    pointer-events: auto;
  }

  .app-main {
    grid-column: auto;
  }

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

  .activity-panel {
    min-height: 390px;
  }
}

@media (max-width: 720px) {
  .login-form-panel {
    align-items: start;
    padding: 16px;
  }

  .login-card {
    margin: auto;
    padding: 25px 21px;
    border-radius: 22px;
  }

  .product-lockup img {
    width: 64px;
    height: 64px;
    border-radius: 18px;
  }

  .product-lockup strong {
    font-size: 1.45rem;
  }

  .topbar {
    min-height: 72px;
    padding: 10px 15px;
  }

  .topbar-context,
  .system-status,
  .icon-button,
  .user-menu > div {
    display: none;
  }

  .topbar-actions {
    margin-left: auto;
  }

  .dashboard-content {
    padding: 22px 15px 18px;
  }

  .dashboard-header,
  .section-heading,
  .dashboard-footer {
    align-items: flex-start;
    flex-direction: column;
  }

  .dashboard-header .secondary-button {
    width: 100%;
  }

  .kpi-grid,
  .module-grid {
    grid-template-columns: 1fr;
  }

  .kpi-card {
    min-height: 112px;
  }

  .map-empty {
    min-height: 340px;
  }

  .panel-header {
    align-items: flex-start;
  }

  .source-chip {
    display: none;
  }

  .section-heading > p {
    text-align: left;
  }

  .dashboard-footer {
    gap: 6px;
  }
}

@media (max-width: 430px) {
  .login-options {
    align-items: flex-start;
    flex-direction: column;
  }

  .login-footer {
    align-items: flex-start;
    flex-direction: column;
  }

  .panel-header {
    padding: 15px;
  }

  .module-card {
    grid-template-columns: 44px minmax(0, 1fr);
  }

  .module-card > b {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}

/* Módulos administrativos funcionales */
.company-avatar { width: 42px; height: 42px; border: 2px solid #d7edf3; border-radius: 50%; overflow: hidden; background: #fff; flex: 0 0 auto; }
.company-avatar img { width: 100%; height: 100%; object-fit: cover; }
.flash-message { position: fixed; top: 82px; right: 24px; z-index: 1200; max-width: 430px; padding: 14px 18px; color: #fff; border-radius: 12px; box-shadow: 0 14px 32px rgba(8, 35, 57, .22); transition: opacity .25s, transform .25s; }
.flash-message.success { background: #258b68; }
.flash-message.error { background: #be3c46; }
.flash-message.is-hidden { opacity: 0; transform: translateY(-10px); pointer-events: none; }
.inline-alert { margin: 0 0 18px; padding: 13px 16px; border-radius: 10px; font-weight: 650; }
.inline-alert.error { color: #8c2530; background: #fff0f1; border: 1px solid #f3c8cd; }
.api-error-card { display: flex; align-items: center; gap: 22px; padding: 28px; max-width: 760px; }
.api-error-icon { display: grid; place-items: center; width: 58px; height: 58px; flex: 0 0 auto; border-radius: 18px; color: #fff; background: #be3c46; font-size: 32px; font-weight: 900; }
.api-error-card h2 { margin: 0 0 7px; }
.api-error-card p { margin: 0 0 16px; color: var(--muted); }

.admin-map { position: relative; min-height: 430px; width: 100%; z-index: 1; background: #e9eef1; }
.admin-map.large { min-height: 650px; }
.admin-map.route { min-height: 560px; }
.admin-map.journeys { min-height: 570px; }
.admin-map.map-unavailable { display: grid; place-items: center; padding: 32px; color: var(--muted); font-weight: 700; text-align: center; }
.map-panel, .tracking-map-panel, .route-panel { position: relative; overflow: hidden; }
.map-panel { display: grid; grid-template-rows: auto minmax(430px, 1fr); }
.map-panel .admin-map { min-height: 100%; height: 100%; border-radius: 0 0 var(--radius-lg) var(--radius-lg); }
.route-panel .admin-map { border-radius: 0 0 var(--radius-lg) var(--radius-lg); }
.map-overlay-empty { position: absolute; inset: 105px 20px auto; z-index: 450; display: flex; flex-direction: column; align-items: center; gap: 5px; max-width: 430px; margin: auto; padding: 18px; text-align: center; background: rgba(255,255,255,.92); border: 1px solid #dbe3e7; border-radius: 14px; box-shadow: 0 10px 30px rgba(10,45,70,.12); }
.map-overlay-empty span { color: var(--muted); }
.nexotrack-map-marker { background: transparent; border: 0; }
.nexotrack-map-marker span { display: block; width: 20px; height: 20px; border: 4px solid #fff; border-radius: 50%; background: var(--marker-color); box-shadow: 0 3px 10px rgba(7,36,57,.38); }
.leaflet-popup-content strong { color: var(--navy); }

.activity-list { display: grid; }
.activity-row { display: grid; grid-template-columns: 12px minmax(0,1fr) auto; gap: 12px; align-items: center; padding: 14px 20px; border-top: 1px solid #edf0f2; }
.activity-row > i { width: 9px; height: 9px; border-radius: 50%; background: #24996f; }
.activity-row.warning > i { background: #f0b526; }
.activity-row.error > i { background: #dc4650; }
.activity-row div { display: flex; flex-direction: column; min-width: 0; }
.activity-row span, .activity-row time { color: var(--muted); font-size: .84rem; }
.activity-summary-row .event-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--sis-cyan-600); }
.activity-summary-row > strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.activity-summary-row .event-count { padding: 5px 9px; color: var(--sis-blue-700); background: #eaf4fb; border-radius: 999px; font-weight: 800; white-space: nowrap; }
.activity-footer { display: flex; align-items: center; justify-content: flex-end; gap: 7px; padding: 12px 20px; color: var(--muted); border-top: 1px solid #edf0f2; font-size: .82rem; }
.activity-footer i { width: 7px; height: 7px; background: #29966f; border-radius: 50%; }

.tracking-layout { display: grid; grid-template-columns: minmax(0,1.55fr) minmax(330px,.75fr); gap: 20px; align-items: start; }
.tracking-map-panel { position: sticky; top: 88px; }
.tracking-list { display: grid; gap: 14px; }
.tracking-user-card { padding: 17px; background: #fff; border: 1px solid var(--border); border-radius: 16px; box-shadow: var(--shadow-sm); }
.tracking-user-card header { display: grid; grid-template-columns: 42px minmax(0,1fr) auto; gap: 11px; align-items: center; }
.tracking-user-card header div { min-width: 0; }
.tracking-user-card header strong, .tracking-user-card header small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tracking-user-card header small { margin-top: 3px; color: var(--muted); }
.status-avatar { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 50%; color: #fff; background: var(--blue); font-weight: 800; }
.status-pill, .state-badge { display: inline-flex; align-items: center; width: fit-content; padding: 5px 9px; border-radius: 999px; font-size: .7rem; font-weight: 850; letter-spacing: .04em; }
.status-pill.online, .state-badge.aprobado, .state-badge.activa, .state-badge.finalizada { color: #237555; background: #e9f7f1; }
.status-pill.offline, .state-badge.rechazado, .state-badge.inactivo { color: #ad3540; background: #fff0f1; }
.state-badge.pendiente, .state-badge.en_curso { color: #8c6706; background: #fff7da; }
.telemetry-grid { display: grid; grid-template-columns: repeat(2,1fr); gap: 8px; margin: 15px 0; }
.telemetry-grid div { padding: 10px; background: #f6f8fa; border-radius: 9px; }
.telemetry-grid span, .telemetry-grid strong { display: block; }
.telemetry-grid span { color: var(--muted); font-size: .75rem; }
.telemetry-grid strong { margin-top: 2px; font-size: .92rem; }
.tracking-user-card footer { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; padding-top: 12px; color: var(--muted); border-top: 1px solid #edf0f2; font-size: .76rem; }
.map-status { position: absolute; z-index: 450; left: 16px; bottom: 16px; display: grid; grid-template-columns: auto auto; gap: 0 7px; align-items: center; padding: 11px 14px; color: #fff; background: rgba(7,46,74,.88); border-radius: 11px; backdrop-filter: blur(8px); }
.map-status strong { font-size: 1.35rem; }
.map-status time { grid-column: 1 / -1; opacity: .74; font-size: .74rem; }
.live-badge { display: inline-flex; gap: 8px; align-items: center; padding: 9px 13px; color: #26775a; background: #e9f7f1; border-radius: 999px; font-weight: 750; }
.live-badge i { width: 8px; height: 8px; background: #28a476; border-radius: 50%; box-shadow: 0 0 0 5px rgba(40,164,118,.12); }

.filter-bar { display: flex; flex-wrap: wrap; align-items: end; gap: 12px; margin: 0 0 20px; padding: 16px; background: #fff; border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow-sm); }
.filter-bar label { display: grid; gap: 5px; min-width: 150px; flex: 1 1 170px; }
.filter-bar label span { color: var(--muted); font-size: .78rem; font-weight: 750; }
.filter-bar input, .filter-bar select { min-height: 43px; padding: 0 12px; color: var(--ink); background: #fff; border: 1px solid #ccd7dd; border-radius: 9px; font: inherit; }
.table-panel { overflow: hidden; }
.responsive-table { width: 100%; border-collapse: collapse; }
.responsive-table th, .responsive-table td { padding: 13px 15px; text-align: left; border-bottom: 1px solid #e9edef; vertical-align: middle; }
.responsive-table th { color: var(--muted); background: #f7f9fa; font-size: .76rem; text-transform: uppercase; letter-spacing: .04em; }
.responsive-table td { font-size: .9rem; }
.responsive-table tr:last-child td { border-bottom: 0; }
.responsive-table small { display: block; margin-top: 2px; color: var(--muted); }
.audit-filter label { min-width: 135px; }
.audit-filter label:nth-child(3) { min-width: 210px; }
.audit-panel { overflow: visible; }
.audit-retention { color: var(--muted); font-size: .78rem; }
.audit-table-wrap { overflow-x: auto; }
.audit-table { min-width: 980px; }
.audit-table td { vertical-align: top; }
.audit-browser { max-width: 230px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.audit-details { position: relative; }
.audit-details summary { color: var(--blue); cursor: pointer; font-weight: 800; list-style: none; }
.audit-details summary::-webkit-details-marker { display: none; }
.audit-details[open] > div { position: absolute; z-index: 20; right: 0; top: 26px; display: grid; gap: 7px; width: min(440px, 75vw); padding: 14px; color: var(--ink); background: #fff; border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow-md); overflow-wrap: anywhere; }
.audit-details span { display: block; font-size: .78rem; }
.audit-details .audit-error { color: #a22f3b; }
.row-action { color: var(--blue); font-weight: 750; text-decoration: none; }
.pagination { display: flex; justify-content: center; align-items: center; gap: 12px; margin-top: 18px; }
.pagination a { padding: 9px 14px; color: var(--blue); background: #fff; border: 1px solid var(--border); border-radius: 9px; text-decoration: none; }
.pagination span { color: var(--muted); }
.journeys-map-panel { position: relative; margin-bottom: 20px; }
.journeys-map-totals { display: grid; grid-template-columns: auto auto auto auto; gap: 4px 8px; align-items: baseline; }
.journeys-map-totals strong { color: var(--sis-navy-950); font-size: 1rem; }
.journeys-map-totals span { color: var(--muted); font-size: .72rem; }
.journeys-map-footer { display: flex; justify-content: space-between; gap: 14px; padding: 12px 18px; color: var(--muted); background: #fafbfd; border-top: 1px solid #edf0f2; font-size: .75rem; }
.route-map-header { align-items: flex-start; gap: 24px; }
.route-map-header p {
  max-width: 720px;
  margin: 5px 0 0;
  color: var(--muted);
  font-size: .78rem;
  line-height: 1.45;
}
.route-map-status { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.processing-chip {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 5px 10px;
  border: 1px solid #d9e3ed;
  border-radius: 999px;
  background: #f7f9fb;
  color: #526173;
  font-size: .67rem;
  font-weight: 800;
  letter-spacing: .02em;
  text-transform: uppercase;
}
.processing-chip.server {
  border-color: #b9e2d2;
  background: #edf9f4;
  color: #167350;
}
.processing-chip.local {
  border-color: #f0d79b;
  background: #fff9e9;
  color: #8b6410;
}
.processing-chip.none {
  border-color: #d9e0e6;
  background: #f5f7f9;
  color: #6c7987;
}
.route-layer-toolbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  padding: 10px 16px;
  border-top: 1px solid #edf1f4;
  border-bottom: 1px solid #dce4ea;
  background: #f8fafc;
}
.route-layer-title {
  margin-right: 2px;
  color: #607084;
  font-size: .68rem;
  font-weight: 900;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.route-layer-toggle {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 32px;
  padding: 6px 10px;
  border: 1px solid #d4dee7;
  border-radius: 9px;
  background: #fff;
  color: #526173;
  font: inherit;
  font-size: .72rem;
  font-weight: 750;
  cursor: pointer;
  transition: border-color .16s ease, background .16s ease, color .16s ease, box-shadow .16s ease;
}
.route-layer-toggle:hover {
  border-color: #8eb1d0;
  color: var(--sis-navy-900);
}
.route-layer-toggle:focus-visible {
  outline: 3px solid rgba(0, 103, 216, .2);
  outline-offset: 2px;
}
.route-layer-toggle.is-active {
  border-color: #8fb8db;
  background: #edf6ff;
  color: #073f74;
  box-shadow: inset 0 0 0 1px rgba(0, 103, 216, .06);
}
.route-layer-toggle:disabled {
  opacity: .45;
  cursor: not-allowed;
}
.route-layer-key {
  display: inline-block;
  flex: 0 0 auto;
  width: 18px;
  height: 4px;
  border-radius: 999px;
}
.route-layer-key.processed {
  height: 5px;
  background: #0067d8;
  box-shadow: 0 0 0 2px #fff, 0 0 0 3px rgba(0, 103, 216, .18);
}
.route-layer-key.raw {
  width: 17px;
  height: 8px;
  background: radial-gradient(circle, #00a1b4 0 2px, transparent 2.5px) 0 0 / 8px 8px;
}
.route-layer-key.interruption {
  width: 10px;
  height: 10px;
  border: 2px solid #fff;
  border-radius: 50%;
  background: #f47a32;
  box-shadow: 0 0 0 1px #d96220;
}
.route-layer-help,
.route-processing-source {
  margin-left: auto;
  color: #69798b;
  font-size: .7rem;
}
.route-processing-source {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.route-processing-source::before {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #38a47b;
  content: "";
}
.route-map-caption {
  padding: 11px 16px;
  border-top: 1px solid #e7edf2;
  background: #fbfcfd;
  color: #66778a;
  font-size: .72rem;
  line-height: 1.45;
}
.route-gap-popup,
.route-point-popup {
  display: grid;
  gap: 4px;
  min-width: 190px;
  margin-top: 7px;
  padding-top: 7px;
  border-top: 1px solid #e6ebef;
}
.route-gap-popup strong { color: #a1430d; }
.route-gap-popup span,
.route-gap-popup small,
.route-point-popup span { color: #5d6a78; line-height: 1.35; }
.route-panel .admin-map { border-radius: 0; }
.journey-map-popup { min-width: 190px; }
.journey-map-popup strong, .journey-map-popup span { display: block; }
.journey-map-popup span { margin-top: 3px; color: #657481; }
.journey-map-popup a { display: inline-block; margin-top: 9px; color: var(--sis-blue-700); font-weight: 800; text-decoration: none; }

.journey-summary-grid, .report-kpis { display: grid; grid-template-columns: repeat(6,minmax(0,1fr)); gap: 12px; margin-bottom: 20px; }
.journey-summary-grid article, .report-kpis article { padding: 16px; background: #fff; border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow-sm); }
.journey-summary-grid span, .report-kpis span { display: block; color: var(--muted); font-size: .76rem; }
.journey-summary-grid strong, .report-kpis strong { display: block; margin-top: 5px; color: var(--navy); font-size: 1.12rem; }
.detail-columns { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 20px; margin-top: 20px; }
.simple-list > div { position: relative; display: grid; gap: 3px; padding: 14px 18px; border-top: 1px solid #edf0f2; }
.simple-list span, .simple-list small { color: var(--muted); }
.severity { position: absolute; top: 14px; right: 18px; padding: 4px 8px; border-radius: 999px; font-size: .68rem; background: #eef3f6; }

.evidence-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 18px; }
.evidence-card { overflow: hidden; background: #fff; border: 1px solid var(--border); border-radius: 17px; box-shadow: var(--shadow-sm); }
.evidence-photo { display: block; height: 240px; overflow: hidden; background: #e9eef1; }
.evidence-photo img { width: 100%; height: 100%; object-fit: cover; transition: transform .25s; }
.evidence-photo:hover img { transform: scale(1.025); }
.evidence-no-photo { display: grid; place-items: center; height: 140px; color: var(--muted); background: #f1f4f6; }
.evidence-content { padding: 16px; }
.evidence-content header { display: flex; justify-content: space-between; gap: 10px; }
.evidence-content header strong, .evidence-type { display: block; }
.evidence-type { color: var(--teal); font-size: .72rem; font-weight: 850; text-transform: uppercase; }
.evidence-content time { color: var(--muted); font-size: .75rem; white-space: nowrap; }
.evidence-content > p { color: #465764; }
.evidence-content dl { display: grid; gap: 7px; margin: 12px 0; }
.evidence-content dl div { display: grid; grid-template-columns: 95px 1fr; gap: 8px; }
.evidence-content dt { color: var(--muted); font-size: .75rem; }
.evidence-content dd { margin: 0; font-size: .82rem; overflow-wrap: anywhere; }
.evidence-content footer { display: flex; flex-wrap: wrap; gap: 13px; padding-top: 12px; border-top: 1px solid #edf0f2; }
.evidence-content footer a { color: var(--blue); font-size: .82rem; font-weight: 750; text-decoration: none; }

.user-admin-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 16px; }
.user-admin-card { padding: 18px; background: #fff; border: 1px solid var(--border); border-radius: 16px; box-shadow: var(--shadow-sm); }
.user-admin-card header { display: grid; grid-template-columns: 48px minmax(0,1fr) auto; gap: 12px; align-items: center; }
.user-admin-card .status-avatar { width: 48px; height: 48px; }
.user-admin-card header strong, .user-admin-card header small { display: block; }
.user-admin-card header small { color: var(--muted); }
.user-group-heading { display: flex; justify-content: space-between; gap: 20px; align-items: end; margin: 28px 0 12px; }
.user-group-heading h2 { margin: 3px 0 0; font-size: 1.15rem; }
.user-group-heading > small { max-width: 520px; color: var(--muted); text-align: right; }
.user-group-heading.mobile-users-heading { margin-top: 32px; }
.user-admin-grid.administrators { grid-template-columns: minmax(0,1fr); }
.administrator-card { border-left: 4px solid var(--cyan); background: linear-gradient(135deg,#fff 0%,#f7fcfd 100%); }
.user-data { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 9px; margin: 16px 0; }
.user-data > div { padding: 9px 10px; background: #f6f8fa; border-radius: 8px; }
.user-data span, .user-data strong { display: block; }
.user-data span { color: var(--muted); font-size: .72rem; }
.user-data strong { margin-top: 2px; font-size: .85rem; overflow-wrap: anywhere; }
.device-health { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 14px; }
.device-health span { padding: 5px 8px; border-radius: 999px; color: #52636f; background: #f2f5f7; font-size: .72rem; font-weight: 700; }
.device-health span.ok { color: #237555; background: #e9f7f1; }
.device-health span.warn { color: #8c6706; background: #fff7da; }
.user-admin-card footer.administrator-note { padding-top: 12px; border-top: 1px solid #e4eef1; color: var(--muted); font-size: .8rem; }
.user-admin-card dl { display: grid; grid-template-columns: repeat(2,1fr); gap: 9px; margin: 16px 0; }
.user-admin-card dl div { padding: 9px 10px; background: #f6f8fa; border-radius: 8px; }
.user-admin-card dt { color: var(--muted); font-size: .72rem; }
.user-admin-card dd { margin: 2px 0 0; font-size: .85rem; font-weight: 700; }
.user-admin-card footer { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.user-admin-card form { display: inline-flex; }
.action-button { min-height: 36px; padding: 0 11px; border: 1px solid #cbd7dd; border-radius: 8px; color: var(--blue); background: #fff; font-weight: 750; cursor: pointer; }
.action-button.danger { color: #b1323d; border-color: #efc5ca; }

.company-layout { display: grid; grid-template-columns: minmax(300px,.8fr) minmax(0,1.2fr); gap: 20px; }
.company-profile { padding: 24px; }
.company-identity { display: flex; gap: 18px; align-items: center; margin-bottom: 22px; }
.company-identity img { width: 86px; height: 86px; object-fit: cover; background: #fff; border: 1px solid var(--border); border-radius: 20px; }
.company-identity h2 { margin: 0; }
.company-identity p { margin: 5px 0 0; color: var(--muted); }
.company-data { display: grid; gap: 10px; }
.company-data div { padding: 11px 12px; background: #f6f8fa; border-radius: 9px; }
.company-data dt { color: var(--muted); font-size: .74rem; }
.company-data dd { margin: 3px 0 0; font-weight: 700; overflow-wrap: anywhere; }
.agency-list { display: grid; gap: 10px; padding: 0 18px 18px; }
.agency-list article { display: grid; grid-template-columns: auto minmax(0,1fr) auto; gap: 12px; align-items: center; padding: 14px; border: 1px solid var(--border); border-radius: 11px; }
.agency-code { display: grid; place-items: center; min-width: 45px; height: 35px; color: #fff; background: var(--blue); border-radius: 8px; font-size: .78rem; font-weight: 850; }
.agency-list p { margin: 3px 0 0; color: var(--muted); font-size: .82rem; }

.bar-chart { display: grid; gap: 15px; padding: 20px; }
.bar-row { display: grid; grid-template-columns: minmax(120px,.8fr) minmax(180px,2fr) 90px; gap: 14px; align-items: center; }
.bar-row > div { height: 13px; overflow: hidden; background: #e9eef1; border-radius: 999px; }
.bar-row i { display: block; width: 0; height: 100%; background: linear-gradient(90deg,var(--blue),var(--teal)); border-radius: inherit; transition: width .5s ease; }
.bar-row span { color: var(--muted); text-align: right; font-size: .82rem; }
.empty-card { display: grid; justify-items: center; gap: 6px; padding: 34px 22px; color: var(--muted); text-align: center; background: #fff; border: 1px dashed #ccd8de; border-radius: 14px; }
.empty-card strong { color: var(--ink); }
.empty-card p { margin: 0; }
.empty-card.compact { padding: 22px; border: 0; }

@media (max-width: 1180px) {
  .tracking-layout, .company-layout { grid-template-columns: 1fr; }
  .tracking-map-panel { position: relative; top: auto; }
  .admin-map.large { min-height: 500px; }
  .journey-summary-grid, .report-kpis { grid-template-columns: repeat(3,1fr); }
  .evidence-grid { grid-template-columns: repeat(2,1fr); }
}

@media (max-width: 760px) {
  .tracking-layout, .detail-columns, .user-admin-grid { grid-template-columns: 1fr; }
  .user-group-heading { display: block; }
  .user-group-heading > small { display: block; margin-top: 6px; text-align: left; }
  .user-data { grid-template-columns: 1fr; }
  .journey-summary-grid, .report-kpis { grid-template-columns: repeat(2,1fr); }
  .evidence-grid { grid-template-columns: 1fr; }
  .admin-map, .admin-map.large, .admin-map.route, .admin-map.journeys { min-height: 400px; }
  .responsive-table thead { display: none; }
  .responsive-table, .responsive-table tbody, .responsive-table tr, .responsive-table td { display: block; width: 100%; }
  .responsive-table tr { padding: 10px 14px; border-bottom: 1px solid var(--border); }
  .responsive-table td { display: flex; justify-content: space-between; gap: 12px; padding: 7px 0; border: 0; text-align: right; }
  .responsive-table td::before { content: attr(data-label); color: var(--muted); font-size: .74rem; font-weight: 750; text-transform: uppercase; text-align: left; }
  .bar-row { grid-template-columns: 1fr 70px; }
  .bar-row > div { grid-column: 1 / -1; grid-row: 2; }
  .company-avatar, .system-status { display: none; }
  .journeys-map-footer { flex-direction: column; }
  .route-map-header { display: grid; }
  .route-map-status { justify-content: flex-start; }
  .route-layer-toolbar { align-items: stretch; }
  .route-layer-title { flex-basis: 100%; }
  .route-layer-help,
  .route-processing-source { flex-basis: 100%; margin: 3px 0 0; }
}

@media (max-width: 480px) {
  .journey-summary-grid, .report-kpis { grid-template-columns: 1fr; }
  .telemetry-grid { grid-template-columns: 1fr 1fr; }
  .tracking-user-card header { grid-template-columns: 42px minmax(0,1fr); }
  .tracking-user-card .status-pill { grid-column: 1 / -1; }
  .filter-bar label { flex-basis: 100%; }
  .filter-bar .primary-small { width: 100%; }
  .route-layer-toggle { flex: 1 1 calc(50% - 8px); justify-content: center; }
}

/* Acciones y controles consistentes */
.primary-small,
.text-button,
.row-action,
.action-button,
.approve-button,
.danger-link,
.evidence-content footer a,
.user-admin-card footer > a,
.pagination a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 38px;
  padding: 0 14px;
  border: 1px solid transparent;
  border-radius: 11px;
  font-size: 0.79rem;
  font-weight: 800;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease, box-shadow 160ms ease, color 160ms ease;
}

.primary-small {
  min-height: 43px;
  padding: 0 18px;
  border-color: #0f527f;
  color: #fff;
  background: linear-gradient(135deg, var(--sis-navy-900), var(--sis-blue-700));
  box-shadow: 0 10px 22px rgba(11, 49, 87, 0.19);
}

.secondary-button {
  border-color: #cddae4;
  background: linear-gradient(180deg, #fff, #f8fbfd);
  box-shadow: 0 7px 18px rgba(20, 48, 78, 0.06);
}

.text-button,
.row-action,
.user-admin-card footer > a,
.evidence-content footer a {
  border-color: #d6e4ec;
  color: var(--sis-blue-700);
  background: #f5fafc;
}

.text-button {
  min-height: 34px;
  padding: 0 12px;
}

.row-action {
  min-height: 35px;
  padding: 0 12px;
}

.action-button {
  border-color: #ccd9e2;
  color: var(--sis-blue-700);
  background: #fff;
}

.approve-button {
  border-color: #bfe4d3;
  color: #237555;
  background: #edf9f3;
}

.danger-link,
.action-button.danger {
  border-color: #efcbd0;
  color: #a9323e;
  background: #fff3f4;
}

.pagination a {
  min-height: 40px;
  border-color: #d6e0e7;
  color: var(--sis-navy-900);
  background: #fff;
  box-shadow: 0 5px 14px rgba(20, 48, 78, 0.05);
}

.primary-button:hover,
.secondary-button:hover,
.primary-small:hover,
.text-button:hover,
.row-action:hover,
.action-button:hover,
.approve-button:hover,
.danger-link:hover,
.evidence-content footer a:hover,
.user-admin-card footer > a:hover,
.pagination a:hover {
  transform: translateY(-1px);
}

.primary-small:hover {
  border-color: var(--sis-cyan-600);
  background: linear-gradient(135deg, var(--sis-navy-800), var(--sis-cyan-600));
  box-shadow: 0 13px 26px rgba(11, 49, 87, 0.22);
}

.text-button:hover,
.row-action:hover,
.user-admin-card footer > a:hover,
.evidence-content footer a:hover {
  border-color: #a9cfde;
  color: var(--sis-navy-900);
  background: #eaf5f9;
  box-shadow: 0 7px 17px rgba(23, 98, 143, 0.09);
}

.approve-button:hover {
  border-color: #8fd0b1;
  background: #e3f6ec;
}

.danger-link:hover,
.action-button.danger:hover {
  border-color: #e5aeb5;
  background: #ffe9ec;
}

.primary-button:focus-visible,
.secondary-button:focus-visible,
.primary-small:focus-visible,
.text-button:focus-visible,
.row-action:focus-visible,
.action-button:focus-visible,
.approve-button:focus-visible,
.danger-link:focus-visible,
.evidence-content footer a:focus-visible,
.user-admin-card footer > a:focus-visible,
.pagination a:focus-visible,
.password-toggle:focus-visible,
.menu-button:focus-visible,
.sidebar-close:focus-visible,
.logout-link:focus-visible,
.panel-tools button:focus-visible {
  outline: 0;
  box-shadow: 0 0 0 4px rgba(18, 183, 202, 0.18);
}

button:disabled,
.pagination a.disabled,
[aria-disabled="true"] {
  opacity: 0.5;
  pointer-events: none;
  box-shadow: none;
  transform: none;
}

.password-toggle,
.menu-button,
.sidebar-close,
.logout-link,
.panel-tools button {
  transition: color 150ms ease, background 150ms ease, border-color 150ms ease, transform 150ms ease, box-shadow 150ms ease;
}

.password-toggle:hover,
.menu-button:hover,
.panel-tools button:hover {
  border-color: #bcd4e1;
  color: var(--sis-navy-900);
  background: #eef7fa;
  transform: translateY(-1px);
}

.filter-bar input:focus,
.filter-bar select:focus {
  outline: 0;
  border-color: var(--sis-cyan-600);
  box-shadow: 0 0 0 4px rgba(18, 183, 202, 0.11);
}

.sidebar-nav {
  overflow-x: hidden;
}

/* Empresa y agencias */
.company-page-header {
  align-items: center;
}

.company-layout {
  align-items: start;
  margin-top: 24px;
}

.company-profile {
  position: relative;
  padding: 28px;
}

.company-profile::before {
  position: absolute;
  inset: 0 0 auto;
  height: 5px;
  content: "";
  background: linear-gradient(90deg, var(--sis-cyan-600), var(--sis-blue-700), var(--sis-navy-900));
}

.company-identity {
  min-width: 0;
  padding-top: 6px;
}

.company-logo-shell {
  position: relative;
  flex: 0 0 auto;
}

.company-identity .company-logo-shell img {
  display: block;
  width: 104px;
  height: 104px;
  padding: 9px;
  object-fit: contain;
  border: 1px solid #d7e5ec;
  border-radius: 24px;
  background: linear-gradient(145deg, #fff, #f1f8fb);
  box-shadow: 0 12px 28px rgba(20, 48, 78, 0.1);
}

.company-image-status {
  position: absolute;
  right: -3px;
  bottom: 2px;
  width: 18px;
  height: 18px;
  border: 4px solid #fff;
  border-radius: 50%;
  background: var(--sis-green-600);
  box-shadow: 0 4px 10px rgba(47, 151, 111, 0.3);
}

.company-identity > div:last-child {
  min-width: 0;
}

.company-identity h2 {
  overflow-wrap: anywhere;
  color: var(--sis-navy-950);
  font-size: clamp(1.2rem, 2vw, 1.55rem);
  line-height: 1.2;
}

.company-data {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin: 0;
}

.company-data div {
  min-height: 76px;
  padding: 13px 14px;
  border: 1px solid #e5ebef;
  border-radius: 13px;
  background: #f8fafc;
}

.company-data dt {
  color: var(--sis-muted);
  font-size: 0.7rem;
  font-weight: 750;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.company-data dd {
  margin-top: 7px;
  color: var(--sis-navy-950);
}

.company-verification {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 18px;
  padding: 14px;
  border: 1px solid #cae8da;
  border-radius: 14px;
  background: #f0faf5;
}

.company-verification-icon,
.company-note-icon {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 38px;
  height: 38px;
  border-radius: 12px;
  color: #237555;
  background: #dcf3e8;
}

.company-verification-icon svg,
.company-note-icon svg {
  width: 19px;
  height: 19px;
}

.company-verification div {
  display: grid;
  gap: 3px;
}

.company-verification strong {
  color: #205f48;
  font-size: 0.84rem;
}

.company-verification small {
  color: #5e7d70;
  line-height: 1.45;
}

.company-agencies {
  min-width: 0;
}

.agency-count {
  display: grid;
  place-items: center;
  min-width: 38px;
  height: 38px;
  padding: 0 10px;
  border-radius: 12px;
  color: var(--sis-navy-900);
  background: #eaf4fa;
  font-size: 0.9rem;
  font-weight: 850;
}

.agency-list {
  gap: 12px;
  padding: 18px;
}

.agency-list article {
  padding: 17px;
  border-radius: 16px;
  background: linear-gradient(145deg, #fff, #fbfcfd);
  transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.agency-list article:hover {
  border-color: #bfd9e4;
  box-shadow: 0 10px 24px rgba(20, 48, 78, 0.08);
  transform: translateY(-1px);
}

.agency-code {
  min-width: 54px;
  height: 44px;
  border-radius: 13px;
  background: linear-gradient(135deg, var(--sis-navy-900), var(--sis-cyan-600));
  box-shadow: 0 8px 16px rgba(11, 49, 87, 0.16);
}

.agency-copy {
  min-width: 0;
}

.agency-copy strong {
  display: block;
  overflow: hidden;
  color: var(--sis-navy-950);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.agency-list .agency-copy p {
  overflow-wrap: anywhere;
  line-height: 1.5;
}

.agency-meta {
  display: grid;
  justify-items: end;
  gap: 7px;
}

.agency-meta small {
  color: var(--sis-muted);
  font-size: 0.7rem;
  white-space: nowrap;
}

.company-empty {
  margin: 18px;
}

.inline-alert.info.company-note {
  display: flex;
  align-items: center;
  gap: 13px;
  margin: 20px 0 0;
  border: 1px solid #cce3ec;
  border-radius: 16px;
  color: var(--sis-navy-900);
  background: #f2f9fc;
}

.company-note-icon {
  color: var(--sis-blue-700);
  background: #e1f1f7;
}

.company-note > div {
  display: grid;
  gap: 3px;
}

.company-note > div > span {
  color: var(--sis-muted);
  font-size: 0.79rem;
  font-weight: 500;
  line-height: 1.45;
}

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

  .company-identity {
    align-items: flex-start;
  }

  .agency-list article {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .agency-meta {
    grid-column: 2;
    justify-items: start;
  }

  .company-page-header .state-badge {
    margin-top: 4px;
  }
}

/* Registro empresarial y edición de usuarios */
.login-register-link {
  width: 100%;
  margin-top: 10px;
}

.registration-body {
  min-height: 100vh;
  background:
    radial-gradient(circle at 92% 6%, rgba(18, 183, 202, .14), transparent 28rem),
    #f4f7fb;
}

.registration-page {
  min-height: 100vh;
}

.registration-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 86px;
  padding: 16px clamp(22px, 5vw, 76px);
  color: #fff;
  background: linear-gradient(120deg, var(--sis-navy-950), var(--sis-navy-800));
}

.registration-topbar .product-lockup {
  display: flex;
  align-items: center;
  gap: 12px;
}

.registration-topbar .product-lockup img {
  width: 52px;
  height: 52px;
  border-radius: 15px;
  object-fit: contain;
  background: #fff;
}

.registration-topbar .product-lockup span {
  display: grid;
}

.registration-topbar .product-lockup strong {
  font-size: 1.35rem;
}

.registration-topbar .product-lockup small,
.registration-topbar .product-lockup em {
  font-size: .72rem;
  font-style: normal;
}

.registration-topbar .product-lockup em {
  color: #5ce0ed;
  font-weight: 700;
}

.registration-shell {
  display: grid;
  grid-template-columns: minmax(300px, 420px) minmax(560px, 820px);
  justify-content: center;
  gap: clamp(28px, 5vw, 72px);
  padding: clamp(36px, 5vw, 70px) 24px 80px;
}

.registration-intro {
  align-self: start;
  position: sticky;
  top: 30px;
  padding-top: 28px;
}

.registration-intro h1 {
  margin: 0 0 20px;
  color: var(--sis-navy-950);
  font-size: clamp(2.1rem, 4vw, 3.5rem);
  line-height: 1.04;
}

.registration-intro > p:not(.eyebrow) {
  color: var(--sis-muted);
  line-height: 1.7;
}

.registration-benefits {
  display: grid;
  gap: 18px;
  margin: 32px 0 0;
  padding: 0;
  list-style: none;
}

.registration-benefits li {
  display: flex;
  gap: 14px;
  align-items: flex-start;
}

.registration-benefits li > b,
.editor-step {
  display: grid;
  flex: 0 0 34px;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 11px;
  color: var(--sis-navy-900);
  background: #dff5f7;
}

.registration-benefits span {
  display: grid;
  gap: 3px;
  color: var(--sis-muted);
  font-size: .88rem;
}

.registration-benefits strong {
  color: var(--sis-text);
}

.registration-card,
.registration-result-card,
.admin-editor-card {
  overflow: hidden;
  border: 1px solid var(--sis-line);
  border-radius: 24px;
  background: #fff;
  box-shadow: var(--sis-shadow);
}

.registration-heading {
  padding: 30px 34px 20px;
}

.registration-heading h2 {
  margin: 0 0 8px;
  font-size: 1.75rem;
}

.registration-heading > p:last-child {
  margin: 0;
  color: var(--sis-muted);
}

.registration-form fieldset {
  margin: 0;
  padding: 28px 34px;
  border: 0;
  border-top: 1px solid var(--sis-line);
}

.registration-form legend {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  margin-bottom: 22px;
  color: var(--sis-navy-950);
  font-size: 1.05rem;
  font-weight: 800;
}

.registration-form legend span {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border-radius: 10px;
  color: #fff;
  background: var(--sis-navy-900);
}

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

.lookup-grid {
  align-items: end;
  margin-bottom: 20px;
}

.form-grid label,
.lookup-grid label {
  display: grid;
  gap: 7px;
  min-width: 0;
}

.form-grid label > span:first-child,
.lookup-grid label > span:first-child {
  color: var(--sis-text);
  font-size: .78rem;
  font-weight: 750;
}

.form-grid input,
.lookup-grid input,
.admin-editor-form input,
.admin-editor-form select {
  width: 100%;
  min-height: 48px;
  border: 1px solid #cad7e3;
  border-radius: 13px;
  padding: 0 14px;
  color: var(--sis-text);
  background: #fff;
  outline: 0;
}

.form-grid input:focus,
.lookup-grid input:focus,
.admin-editor-form input:focus,
.admin-editor-form select:focus {
  border-color: var(--sis-cyan-600);
  box-shadow: 0 0 0 3px rgba(0, 155, 181, .12);
}

.form-grid input[readonly],
.admin-editor-form input[readonly] {
  color: #526170;
  background: #f4f7fa;
}

.form-grid label > small:not(.field-error) {
  color: var(--sis-muted);
  font-size: .73rem;
}

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

.lookup-control {
  display: flex;
  gap: 8px;
}

.lookup-control button {
  min-width: 108px;
  border: 0;
  border-radius: 12px;
  color: #fff;
  background: var(--sis-navy-900);
  font-weight: 750;
  cursor: pointer;
}

.lookup-control button:disabled {
  cursor: wait;
  opacity: .65;
}

.lookup-status {
  min-height: 48px;
  padding: 11px 14px;
  border: 1px solid #dbe5ec;
  border-radius: 13px;
  color: var(--sis-muted);
  background: #f6f9fb;
  font-size: .8rem;
  line-height: 1.4;
}

.lookup-status.success {
  border-color: #bce4d4;
  color: #1d7555;
  background: #effaf5;
}

.lookup-status.error {
  border-color: #f1c6c6;
  color: #a62424;
  background: #fff5f5;
}

.lookup-status.compact {
  margin-top: 14px;
}

.file-field > input[type="file"] {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
}

.file-picker {
  display: flex;
  min-height: 70px;
  padding: 14px 17px;
  border: 1px dashed #8fb9c7;
  border-radius: 15px;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  cursor: pointer;
  background: #f8fcfd;
}

.file-picker strong {
  color: var(--sis-navy-900);
}

.file-picker small {
  color: var(--sis-muted);
}

.file-field > span:first-child b {
  margin-left: 6px;
  color: var(--sis-cyan-600);
  font-size: .65rem;
  text-transform: uppercase;
}

.internal-note,
.invitation-note {
  margin: 20px 0 0;
  padding: 15px 17px;
  border-radius: 15px;
  color: #5d4d13;
  background: #fff8dc;
  font-size: .82rem;
  line-height: 1.5;
}

.invitation-note {
  display: grid;
  gap: 4px;
}

.registration-submit {
  width: calc(100% - 68px);
  margin: 28px 34px 8px;
}

.privacy-copy {
  margin: 0;
  padding: 8px 34px 30px;
  color: var(--sis-muted);
  font-size: .72rem;
  text-align: center;
}

.registration-form .form-alert {
  margin: 0 34px 20px;
}

.registration-result-page {
  display: grid;
  min-height: 100vh;
  padding: 28px;
  place-items: center;
}

.registration-result-card {
  display: grid;
  width: min(100%, 520px);
  padding: 42px;
  justify-items: center;
  text-align: center;
}

.registration-result-card > img {
  width: 72px;
  height: 72px;
  object-fit: contain;
}

.result-check {
  display: grid;
  width: 54px;
  height: 54px;
  margin: 20px 0;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: var(--sis-green-600);
  font-size: 1.6rem;
}

.registration-result-card h1 {
  margin: 0 0 10px;
}

.result-email {
  margin: 8px 0 18px;
  color: var(--sis-navy-900);
}

.result-help {
  margin-bottom: 24px;
  padding: 14px;
  border-radius: 13px;
  color: var(--sis-muted);
  background: #f4f7fa;
  font-size: .82rem;
}

.header-action {
  white-space: nowrap;
}

.users-header-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.users-header-actions .primary-button,
.users-header-actions .secondary-button {
  min-height: 42px;
  white-space: nowrap;
}

.admin-editor-card {
  width: min(100%, 980px);
  margin: 0 auto;
}

.admin-editor-form {
  display: grid;
}

.editor-section {
  padding: 25px 28px;
  border-bottom: 1px solid var(--sis-line);
}

.editor-section > header {
  display: flex;
  gap: 13px;
  align-items: flex-start;
  margin-bottom: 20px;
}

.editor-section > header div {
  display: grid;
  gap: 4px;
}

.editor-section > header small {
  color: var(--sis-muted);
}

.admin-file-field {
  display: grid;
}

.admin-editor-form > .invitation-note {
  margin: 22px 28px 0;
}

.editor-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  padding: 24px 28px 28px;
}

.card-action-link {
  color: var(--sis-blue-700);
  font-weight: 750;
}

.admin-protected-label {
  color: var(--sis-muted);
  font-size: .78rem;
  font-weight: 700;
}

.state-badge.pendiente_activacion {
  color: #866500;
  background: #fff3c4;
}

@media (max-width: 960px) {
  .registration-shell {
    grid-template-columns: minmax(0, 760px);
  }

  .registration-intro {
    position: static;
    padding-top: 0;
  }
}

@media (max-width: 640px) {
  .registration-topbar {
    align-items: flex-start;
    gap: 14px;
  }

  .registration-topbar .secondary-button {
    min-height: 42px;
    padding: 0 12px;
    font-size: .75rem;
  }

  .registration-shell {
    padding: 24px 14px 50px;
  }

  .registration-card {
    border-radius: 18px;
  }

  .registration-heading,
  .registration-form fieldset {
    padding-right: 20px;
    padding-left: 20px;
  }

  .form-grid,
  .lookup-grid {
    grid-template-columns: 1fr;
  }

  .registration-submit {
    width: calc(100% - 40px);
    margin-right: 20px;
    margin-left: 20px;
  }

  .privacy-copy {
    padding-right: 20px;
    padding-left: 20px;
  }

  .editor-section {
    padding: 20px;
  }

  .editor-actions {
    display: grid;
    padding: 20px;
  }

  .users-header-actions {
    display: grid;
    width: 100%;
  }
}
