/* =========================================================
   KORDVEX · Gestión Operativa de Seguridad
   ========================================================= */

:root {
  /* KORDVEX design tokens */
  --kv-primary: #0F1C2E;
  --kv-secondary: #2A3E56;
  --kv-accent: #4F7FA6;
  --kv-surface: #E8ECF1;
  --kv-background: #F7F8FA;
  --kv-text-primary: #0F1C2E;
  --kv-text-secondary: #667487;
  --kv-border: #DCE2E9;
  --kv-success: #29966F;
  --kv-warning: #E5A23D;
  --kv-danger: #D9535F;
  --kv-neutral: #8491A1;
  --kv-radius-sm: 6px;
  --kv-radius-md: 10px;
  --kv-radius-lg: 14px;
  --kv-shadow-card: 0 2px 8px rgba(15, 28, 46, 0.04);

  /* Compatibility aliases used by the existing components */
  --ink: var(--kv-text-primary);
  --ink-soft: var(--kv-secondary);
  --muted: var(--kv-text-secondary);
  --muted-strong: #4E5D70;
  --forest: var(--kv-primary);
  --forest-2: var(--kv-secondary);
  --forest-3: var(--kv-accent);
  --paper: var(--kv-background);
  --surface: #FFFFFF;
  --surface-2: #F7F8FA;
  --surface-3: var(--kv-surface);
  --line: var(--kv-border);
  --line-soft: #EDF0F4;
  --gold: var(--kv-accent);
  --gold-strong: var(--kv-secondary);
  --gold-soft: var(--kv-surface);
  --gold-line: var(--kv-border);
  --morning: var(--kv-accent);
  --morning-soft: #EAF0F6;
  --afternoon: #7186A0;
  --afternoon-soft: #EEF2F6;
  --whatsapp: var(--kv-success);
  --whatsapp-dark: #207A5B;
  --danger: var(--kv-danger);
  --danger-soft: #FBECEE;
  --shadow-panel: var(--kv-shadow-card);
  --shadow-float: 0 18px 45px -24px rgba(15, 28, 46, 0.35);
  --radius-panel: var(--kv-radius-lg);
  --radius-card: var(--kv-radius-md);
  --font-sans: "Inter", "SF Pro Display", -apple-system, BlinkMacSystemFont,
    "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  color: var(--ink);
  background:
    radial-gradient(1000px 540px at 93% -8%, rgba(103, 127, 139, 0.08), transparent 62%),
    radial-gradient(880px 620px at -8% 32%, rgba(29, 43, 51, 0.045), transparent 68%),
    var(--paper);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body.modal-open {
  overflow: hidden;
}

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

button {
  color: inherit;
}

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

button:not(:disabled),
label,
[role="gridcell"] {
  cursor: pointer;
}

a {
  color: inherit;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

svg {
  display: block;
}

[hidden] {
  display: none !important;
}

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

.svg-sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.icon {
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
}

.skip-link {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 5000;
  padding: 10px 14px;
  color: #fff;
  background: var(--forest);
  border-radius: 8px;
  transform: translateY(-160%);
  transition: transform 0.16s ease;
}

.skip-link:focus {
  transform: translateY(0);
}

:focus-visible {
  outline: 2px solid var(--forest-3);
  outline-offset: 2px;
}


/* =========================
   Arranque y acceso
   ========================= */

.boot-screen {
  position: fixed;
  inset: 0;
  z-index: 5000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 13px;
  color: #fff;
  background:
    radial-gradient(700px 420px at 50% 34%, rgba(255, 255, 255, 0.07), transparent 70%),
    var(--forest);
}

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

.boot-brand .brand-mark {
  width: 44px;
  height: 44px;
}

.boot-brand strong {
  font-size: 21px;
  font-weight: 750;
  letter-spacing: 0.035em;
}

.boot-loader {
  width: 24px;
  height: 24px;
  margin-top: 8px;
  border: 2px solid rgba(255, 255, 255, 0.13);
  border-top-color: #d8d5cc;
  border-radius: 50%;
  animation: boot-spin 0.8s linear infinite;
}

.boot-screen p {
  margin: 2px 0 0;
  color: rgba(255, 255, 255, 0.46);
  font-size: 9.5px;
  font-weight: 650;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.auth-screen {
  min-height: 100dvh;
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(440px, 0.92fr);
  background: var(--paper);
}

.auth-brand-panel {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 100dvh;
  padding: 36px clamp(30px, 4.5vw, 68px) 26px;
  overflow: hidden;
  color: #fff;
  background:
    radial-gradient(720px 460px at 18% 8%, rgba(129, 155, 166, 0.17), transparent 68%),
    linear-gradient(rgba(255, 255, 255, 0.023) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.023) 1px, transparent 1px),
    linear-gradient(148deg, #18242b 0%, #1d2d36 58%, #22343e 100%);
  background-size: auto, 58px 58px, 58px 58px, auto;
  border-right: 1px solid rgba(255, 255, 255, 0.06);
}

.auth-brand-panel::before {
  content: "";
  position: absolute;
  top: -180px;
  right: -210px;
  width: 520px;
  height: 520px;
  border: 1px solid rgba(255, 255, 255, 0.055);
  border-radius: 50%;
  box-shadow:
    0 0 0 70px rgba(255, 255, 255, 0.018),
    0 0 0 150px rgba(255, 255, 255, 0.012);
  pointer-events: none;
}

.auth-brand-head,
.auth-brand-body,
.auth-brand-foot {
  position: relative;
  z-index: 1;
}

.auth-brand-head {
  display: flex;
  align-items: center;
  gap: 11px;
}

.auth-brand-mark {
  width: 43px;
  height: 43px;
}

.auth-brand-name {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}

.auth-brand-name strong {
  font-size: 20px;
  font-weight: 750;
  letter-spacing: 0.035em;
}

.auth-brand-name span {
  margin-top: 4px;
  color: rgba(255, 255, 255, 0.46);
  font-size: 9px;
  font-weight: 650;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.auth-brand-body {
  width: min(640px, 100%);
  margin: auto 0;
  padding: 42px 0;
}

.auth-kicker {
  margin: 0 0 18px;
  color: #91a6af;
  font-size: 9.5px;
  font-weight: 750;
  letter-spacing: 0.17em;
  text-transform: uppercase;
}

.auth-brand-body h1 {
  margin: 0 0 20px;
  color: #f3f2ed;
  font-size: clamp(2.4rem, 3.7vw, 3.45rem);
  font-weight: 750;
  letter-spacing: -0.06em;
  line-height: 1.01;
}

.auth-brand-body h1 em {
  color: #aabdc4;
  font-style: normal;
}

.auth-lead {
  max-width: 465px;
  margin: 0;
  color: rgba(255, 255, 255, 0.56);
  font-size: 13px;
  line-height: 1.65;
}

.auth-features {
  display: grid;
  gap: 15px;
  max-width: 430px;
  margin: 35px 0 0;
  padding: 0;
  list-style: none;
}

.auth-features li {
  display: flex;
  align-items: flex-start;
  gap: 11px;
}

.auth-feature-icon {
  width: 33px;
  height: 33px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  color: #a9bcc4;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 9px;
}

.auth-feature-icon .icon {
  width: 15px;
  height: 15px;
}

.auth-features li > span:last-child {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding-top: 1px;
}

.auth-features strong {
  color: rgba(255, 255, 255, 0.82);
  font-size: 11.5px;
  font-weight: 650;
}

.auth-features small {
  color: rgba(255, 255, 255, 0.38);
  font-size: 10px;
  line-height: 1.45;
}

.auth-brand-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-top: 17px;
  color: rgba(255, 255, 255, 0.36);
  border-top: 1px solid rgba(255, 255, 255, 0.09);
  font-size: 9px;
  letter-spacing: 0.02em;
}

.auth-brand-foot span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.auth-brand-foot .icon {
  width: 11px;
  height: 11px;
}

.auth-form-panel {
  display: grid;
  place-items: center;
  min-height: 100dvh;
  padding: 36px 30px;
  background:
    radial-gradient(700px 520px at 90% 5%, rgba(103, 127, 139, 0.07), transparent 65%),
    var(--paper);
}

.auth-card {
  width: min(394px, 100%);
  padding: 31px 31px 25px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow:
    0 1px 2px rgba(24, 36, 43, 0.03),
    0 24px 60px -36px rgba(24, 36, 43, 0.32);
}

.auth-mobile-brand {
  display: none;
}

.auth-card h2 {
  margin: 0 0 6px;
  color: var(--ink);
  font-size: 28px;
  font-weight: 750;
  letter-spacing: -0.05em;
  line-height: 1.1;
}

.auth-subtitle {
  margin: 0 0 22px;
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.55;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.login-error {
  display: flex;
  align-items: flex-start;
  gap: 7px;
  padding: 9px 10px;
  color: #8d372f;
  background: var(--danger-soft);
  border: 1px solid #e9c7c2;
  border-radius: 8px;
  font-size: 10.5px;
  line-height: 1.45;
}

.login-error .icon {
  width: 13px;
  height: 13px;
  margin-top: 1px;
}

.password-input {
  position: relative;
  display: block;
}

.password-input input {
  padding-right: 45px;
}

.password-toggle {
  position: absolute;
  top: 50%;
  right: 4px;
  width: 33px;
  height: 33px;
  display: grid;
  place-items: center;
  padding: 0;
  color: #7d898d;
  background: transparent;
  border: 0;
  border-radius: 7px;
  transform: translateY(-50%);
  cursor: pointer;
}

.password-toggle .icon {
  width: 16px;
  height: 16px;
}

.password-toggle:hover {
  color: var(--ink);
  background: var(--surface-2);
}

.check-field {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 10.5px;
  line-height: 1.4;
  cursor: pointer;
  user-select: none;
}

.check-field input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.check-box {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  color: transparent;
  background: #fff;
  border: 1px solid #c8d0cd;
  border-radius: 4px;
  transition:
    background-color 0.14s ease,
    border-color 0.14s ease,
    color 0.14s ease;
}

.check-box .icon {
  width: 10px;
  height: 10px;
}

.check-field input:checked + .check-box {
  color: #fff;
  background: var(--forest);
  border-color: var(--forest);
}

.check-field input:focus-visible + .check-box {
  outline: 2px solid var(--forest-3);
  outline-offset: 2px;
}

.auth-submit {
  width: 100%;
  min-height: 44px;
  margin-top: 2px;
  border-radius: 10px;
  font-size: 12px;
}

.auth-submit .icon {
  width: 16px;
  height: 16px;
}

.auth-submit:disabled {
  color: rgba(255, 255, 255, 0.6);
}

.auth-note {
  display: flex;
  align-items: flex-start;
  gap: 7px;
  margin-top: 22px;
  padding-top: 15px;
  color: #8d9999;
  border-top: 1px solid var(--line-soft);
}

.auth-note .icon {
  width: 12px;
  height: 12px;
  margin-top: 2px;
}

.auth-note p {
  margin: 0;
  font-size: 9px;
  line-height: 1.5;
}

.auth-note strong {
  color: #6e7d80;
  font-weight: 650;
}

/* =========================
   Barra superior
   ========================= */

.topbar {
  position: sticky;
  top: 0;
  z-index: 60;
  color: #fff;
  background:
    radial-gradient(900px 260px at 16% -80%, rgba(255, 255, 255, 0.07), transparent 68%),
    linear-gradient(112deg, #18242b 0%, #1b2931 55%, #202f38 100%);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 6px 24px -18px rgba(0, 0, 0, 0.7);
}

.topbar::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: -1px;
  left: 0;
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent 8%,
    rgba(203, 214, 219, 0.24) 46%,
    transparent 92%
  );
  pointer-events: none;
}

.topbar-inner {
  width: min(1440px, 100%);
  min-height: 76px;
  margin: 0 auto;
  padding: 0 30px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  text-decoration: none;
  border-radius: 12px;
}

.brand-mark {
  width: 41px;
  height: 41px;
  display: grid;
  place-items: center;
  color: var(--forest);
  background: #dedbd2;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 13px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.32);
}

.brand-mark svg {
  width: 25px;
  height: 25px;
}

.brand-copy {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}

.brand-copy strong {
  font-size: 20px;
  font-weight: 750;
  letter-spacing: 0.035em;
}

.brand-copy span {
  margin-top: 4px;
  color: rgba(255, 255, 255, 0.47);
  font-size: 9.5px;
  font-weight: 650;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.account {
  position: relative;
  flex: 0 0 auto;
}

.account-trigger {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 4px 8px 4px 4px;
  color: #fff;
  background: rgba(255, 255, 255, 0.055);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 999px;
  cursor: pointer;
  transition:
    background-color 0.15s ease,
    border-color 0.15s ease;
}

.account-trigger:hover,
.account-trigger[aria-expanded="true"] {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.24);
}

.account-avatar {
  width: 29px;
  height: 29px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  color: var(--forest);
  background: #d9d5ca;
  border-radius: 50%;
  font-size: 8.5px;
  font-weight: 760;
  letter-spacing: 0.01em;
}

.account-copy {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  min-width: 0;
  line-height: 1.2;
}

.account-copy strong {
  max-width: 112px;
  overflow: hidden;
  color: rgba(255, 255, 255, 0.9);
  font-size: 10px;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-copy span {
  margin-top: 2px;
  color: rgba(255, 255, 255, 0.4);
  font-size: 8px;
  letter-spacing: 0.035em;
}

.account-chevron {
  width: 12px;
  height: 12px;
  color: rgba(255, 255, 255, 0.38);
  transition: transform 0.15s ease;
}

.account-trigger[aria-expanded="true"] .account-chevron {
  transform: rotate(180deg);
}

.account-menu {
  position: absolute;
  top: calc(100% + 9px);
  right: 0;
  z-index: 120;
  width: 232px;
  padding: 6px;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 18px 48px -20px rgba(18, 30, 37, 0.38);
  animation: account-menu-in 0.14s ease both;
}

.account-menu-head {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 9px 10px 10px;
  border-bottom: 1px solid var(--line-soft);
  margin-bottom: 4px;
}

.account-menu-head strong {
  font-size: 11.5px;
  font-weight: 700;
}

.account-menu-head span {
  color: var(--muted);
  font-size: 9.5px;
}

.account-menu-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 10px;
  color: var(--ink-soft);
  background: transparent;
  border: 0;
  border-radius: 7px;
  font-size: 11px;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
}

.account-menu-item .icon {
  width: 14px;
  height: 14px;
  color: #7a888c;
}

.account-menu-item:hover {
  background: var(--surface-2);
}

.account-menu-item.is-danger {
  color: var(--danger);
}

.account-menu-item.is-danger .icon {
  color: var(--danger);
}

.account-menu-item.is-danger:hover {
  background: var(--danger-soft);
}

/* =========================
   Botones
   ========================= */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  padding: 10px 17px;
  color: var(--ink);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 680;
  line-height: 1.15;
  letter-spacing: 0.005em;
  white-space: nowrap;
  cursor: pointer;
  transition:
    background-color 0.16s ease,
    border-color 0.16s ease,
    color 0.16s ease,
    transform 0.16s ease,
    box-shadow 0.16s ease;
}

.btn .icon {
  width: 18px;
  height: 18px;
}

.btn:active {
  transform: translateY(1px);
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
}

.btn-outline-light {
  color: #fff;
  background: rgba(255, 255, 255, 0.055);
  border-color: rgba(255, 255, 255, 0.25);
}

.btn-outline-light:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.4);
}

.btn-outline-light .icon {
  color: rgba(255, 255, 255, 0.72);
}

.btn-gold {
  color: var(--forest);
  background: #e5e2da;
  border-color: rgba(255, 255, 255, 0.16);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.4);
}

.btn-gold:hover {
  background: #f0eee8;
}

.btn-primary {
  color: #fff;
  background: var(--forest);
  border-color: var(--forest);
  box-shadow: 0 5px 15px -10px rgba(29, 43, 51, 0.9);
}

.btn-primary:hover {
  background: var(--forest-2);
  border-color: var(--forest-2);
}

.btn-soft {
  color: var(--forest);
  background: var(--surface-2);
  border-color: var(--line);
}

.btn-soft:hover {
  background: var(--surface-3);
  border-color: #d3cbbb;
}

.btn-ghost {
  color: var(--ink-soft);
  background: transparent;
  border-color: transparent;
}

.btn-ghost:hover {
  color: var(--ink);
  background: var(--surface-2);
}

.btn-danger {
  color: #fff;
  background: var(--danger);
  border-color: var(--danger);
}

.btn-danger:hover {
  background: #9d382f;
}

.btn-whatsapp {
  color: #fff;
  background: var(--whatsapp);
  border-color: var(--whatsapp);
  box-shadow: 0 6px 18px -12px rgba(23, 141, 79, 0.9);
}

.btn-whatsapp:hover {
  background: var(--whatsapp-dark);
  border-color: var(--whatsapp-dark);
}

.btn-today {
  min-height: 30px;
  margin-left: 7px;
  padding: 6px 12px;
  color: var(--ink-soft);
  background: rgba(255, 255, 255, 0.7);
  border-color: var(--line);
  font-size: 11.5px;
}

.btn-today:hover {
  color: var(--forest);
  background: #fff;
  border-color: #c5cece;
}

.btn-dashed {
  width: 100%;
  min-height: 42px;
  color: var(--forest-2);
  background: transparent;
  border: 1px dashed #c8d0cf;
  border-radius: 12px;
  font-size: 12px;
}

.btn-dashed:hover {
  background: rgba(74, 101, 115, 0.05);
  border-color: var(--forest-3);
}

.icon-button {
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  padding: 0;
  color: var(--ink-soft);
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  cursor: pointer;
  transition:
    background-color 0.16s ease,
    border-color 0.16s ease,
    color 0.16s ease,
    transform 0.16s ease;
}

.icon-button .icon {
  width: 17px;
  height: 17px;
}

.icon-button:hover {
  color: var(--forest);
  background: #fff;
  border-color: #c9d1d1;
}

.icon-button:active {
  transform: scale(0.96);
}

.text-button {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 0;
  color: var(--forest-2);
  background: none;
  border: 0;
  font-size: 12px;
  font-weight: 700;
  text-decoration: underline;
  text-decoration-color: rgba(29, 43, 51, 0.3);
  text-underline-offset: 3px;
  cursor: pointer;
}

.text-button .icon {
  width: 14px;
  height: 14px;
  transition: transform 0.16s ease;
}

.text-button:hover .icon {
  transform: translateX(2px);
}

/* =========================
   Estructura de página
   ========================= */

.page {
  width: min(1440px, 100%);
  margin: 0 auto;
  padding: 34px 30px 22px;
  animation: page-in 0.42s ease both;
}

.overview {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 32px;
  margin-bottom: 26px;
}

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

.eyebrow {
  margin: 0 0 8px;
  color: #60747e;
  font-size: 10px;
  font-weight: 750;
  letter-spacing: 0.16em;
  line-height: 1.2;
  text-transform: uppercase;
}

.overview h1 {
  margin: 0 0 8px;
  font-size: clamp(2rem, 3vw, 2.8rem);
  font-weight: 760;
  letter-spacing: -0.055em;
  line-height: 1.02;
}

.page-subtitle {
  max-width: 570px;
  margin: 0;
  color: var(--muted);
  font-size: 13.5px;
  line-height: 1.55;
}

.stats {
  flex: 0 0 auto;
  display: grid;
  grid-template-columns: repeat(3, minmax(132px, 1fr));
  gap: 9px;
}

.stat-card {
  min-width: 132px;
  padding: 13px 15px 12px;
  background: rgba(252, 252, 249, 0.72);
  border: 1px solid rgba(204, 212, 208, 0.88);
  border-radius: 15px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

.stat-label {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 650;
  letter-spacing: 0.035em;
}

.stat-label .icon {
  width: 14px;
  height: 14px;
  color: #77888f;
}

.stat-value-row {
  display: flex;
  align-items: baseline;
  gap: 7px;
  min-width: 0;
}

.stat-value-row strong {
  font-size: 26px;
  font-weight: 750;
  letter-spacing: -0.045em;
  line-height: 1.08;
}

.stat-value-row span {
  color: var(--muted);
  font-size: 10px;
  white-space: nowrap;
}

.stat-card-accent {
  color: #fff;
  background:
    radial-gradient(130px 90px at 100% 0, rgba(124, 151, 163, 0.14), transparent 70%),
    var(--forest);
  border-color: #2d404a;
}

.stat-card-accent .stat-label {
  color: rgba(255, 255, 255, 0.58);
}

.stat-card-accent .stat-label .icon {
  color: rgba(255, 255, 255, 0.62);
}

.stat-card-accent .stat-value-row strong {
  color: #f3f3ef;
}

.stat-card-accent .stat-value-row span {
  color: rgba(255, 255, 255, 0.53);
}

/* =========================
   Aviso de datos de ejemplo
   ========================= */

.demo-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
  padding: 10px 14px;
  background: rgba(250, 250, 247, 0.82);
  border: 1px solid var(--line);
  border-left: 3px solid #93a6ae;
  border-radius: 13px;
}

.demo-banner-copy {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.demo-banner-copy p {
  margin: 0;
  color: #5f6d68;
  font-size: 12px;
  line-height: 1.4;
}

.demo-badge {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  color: #5d7077;
  background: #fff;
  border: 1px solid #d4dbd8;
  border-radius: 999px;
  font-size: 9px;
  font-weight: 750;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.demo-badge .icon {
  width: 11px;
  height: 11px;
}

/* =========================
   Panel y calendario
   ========================= */

.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 372px;
  gap: 18px;
  align-items: start;
}

.panel {
  color: var(--ink);
  background: var(--surface);
  border: 1px solid rgba(216, 208, 193, 0.82);
  border-radius: var(--radius-panel);
  box-shadow: var(--shadow-panel);
}

.calendar-panel {
  min-width: 0;
  padding: 20px 20px 14px;
}

.calendar-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 17px;
}

.month-switcher {
  display: flex;
  align-items: center;
  gap: 3px;
  min-width: 0;
}

.month-switcher h2 {
  min-width: 154px;
  margin: 0 8px;
  color: var(--ink);
  font-size: 20px;
  font-weight: 740;
  letter-spacing: -0.04em;
  line-height: 1.2;
  text-align: center;
  white-space: nowrap;
}

.legend {
  display: flex;
  align-items: center;
  gap: 13px;
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.015em;
}

.legend span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.legend-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
}

.legend-dot.morning {
  background: var(--morning);
  box-shadow: 0 0 0 3px rgba(127, 106, 70, 0.11);
}

.legend-dot.afternoon {
  background: var(--afternoon);
  box-shadow: 0 0 0 3px rgba(73, 104, 121, 0.1);
}

.weekdays {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 6px;
  padding: 0 1px;
  margin-bottom: 5px;
}

.weekdays span {
  padding-left: 8px;
  color: #8a938b;
  font-size: 9px;
  font-weight: 750;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  grid-auto-rows: minmax(104px, 1fr);
  gap: 5px;
}

.day-cell {
  position: relative;
  min-width: 0;
  min-height: 104px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 8px 8px 7px;
  overflow: hidden;
  background: #fafbf8;
  border: 1px solid transparent;
  border-radius: 11px;
  transition:
    background-color 0.14s ease,
    border-color 0.14s ease,
    box-shadow 0.14s ease;
}

.day-cell.is-weekend {
  background: #f5f6f3;
}

.day-cell.is-outside {
  color: #98a099;
  background: transparent;
  opacity: 0.48;
}

.day-cell.is-today {
  background: #f8faf9;
  border-color: #c6d1d3;
}

.day-cell.is-selected {
  z-index: 1;
  background: #fff;
  border-color: transparent;
  box-shadow: 0 0 0 1.5px var(--forest), 0 8px 18px -14px rgba(29, 43, 51, 0.4);
}

.day-cell:hover {
  background: #fff;
  border-color: #cbd4d2;
}

.day-cell.is-selected:hover {
  border-color: transparent;
}

.day-cell:focus-visible {
  outline: 2px solid var(--forest-3);
  outline-offset: 1px;
}

.day-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 22px;
}

.day-number {
  width: 23px;
  height: 23px;
  display: grid;
  place-items: center;
  color: var(--ink-soft);
  border-radius: 50%;
  font-size: 11.5px;
  font-weight: 680;
  line-height: 1;
}

.day-cell.is-today .day-number {
  color: #fff;
  background: var(--forest);
  font-weight: 700;
}

.day-cell.is-selected:not(.is-today) .day-number {
  color: var(--forest);
  background: #e8edef;
}

.day-mini-list {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
  overflow: hidden;
}

.mini-service {
  display: flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
  padding: 3px 4px 3px 5px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.86);
  border: 1px solid rgba(222, 227, 222, 0.88);
  border-left: 2px solid var(--morning);
  border-radius: 5px;
  line-height: 1.2;
}

.mini-service[data-shifts="afternoon"] {
  border-left-color: var(--afternoon);
}

.mini-service[data-shifts="both"] {
  border-left-color: var(--morning);
  background: linear-gradient(
    100deg,
    rgba(240, 236, 227, 0.82),
    rgba(232, 237, 239, 0.82)
  );
}

.mini-name {
  min-width: 0;
  overflow: hidden;
  color: var(--ink-soft);
  font-size: 9.4px;
  font-weight: 620;
  letter-spacing: -0.005em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mini-shifts {
  flex: 0 0 auto;
  display: flex;
  gap: 2px;
  margin-left: auto;
}

.shift-dot {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--morning);
}

.shift-dot.afternoon {
  background: var(--afternoon);
}

.more-services {
  padding-left: 2px;
  color: var(--muted);
  font-size: 8.5px;
  font-weight: 600;
}

.mobile-day-summary {
  display: none;
}

.calendar-caption {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 12px;
  padding: 11px 2px 1px;
  color: #8b938c;
  border-top: 1px solid var(--line-soft);
  font-size: 10.5px;
}

.caption-key {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
}

.today-key {
  width: 9px;
  height: 9px;
  display: inline-block;
  border: 1px solid #94a6ad;
  border-radius: 50%;
}

/* =========================
   Panel del día
   ========================= */

.day-panel {
  position: sticky;
  top: 96px;
  scroll-margin-top: 82px;
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 118px);
  padding: 20px 19px 15px;
}

.day-panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line-soft);
}

.day-panel-head h2 {
  margin: 0 0 3px;
  font-size: 21px;
  font-weight: 740;
  letter-spacing: -0.04em;
  line-height: 1.16;
}

.day-summary {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
}

.add-day-button {
  color: #fff;
  background: var(--forest);
  border-color: var(--forest);
}

.add-day-button:hover {
  color: #fff;
  background: var(--forest-2);
  border-color: var(--forest-2);
}

.day-services {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 120px;
  padding: 14px 3px 10px 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: #d6cfc1 transparent;
}

.day-services::-webkit-scrollbar {
  width: 5px;
}

.day-services::-webkit-scrollbar-thumb {
  background: #d6cfc1;
  border-radius: 99px;
}

.service-card {
  position: relative;
  flex: 0 0 auto;
  padding: 12px 12px 12px 15px;
  overflow: hidden;
  background: #fff;
  border: 1px solid var(--line-soft);
  border-radius: 14px;
  box-shadow: 0 1px 1px rgba(23, 37, 30, 0.025);
  transition:
    border-color 0.16s ease,
    box-shadow 0.16s ease;
}

.service-card::before {
  content: "";
  position: absolute;
  top: 13px;
  bottom: 13px;
  left: 0;
  width: 3px;
  background: var(--morning);
  border-radius: 0 3px 3px 0;
}

.service-card[data-shifts="afternoon"]::before {
  background: var(--afternoon);
}

.service-card[data-shifts="both"]::before {
  background: linear-gradient(180deg, var(--morning), var(--afternoon));
}

.service-card:hover {
  border-color: #ddd5c6;
  box-shadow: 0 8px 22px -18px rgba(23, 37, 30, 0.5);
}

.service-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.service-card h3 {
  min-width: 0;
  margin: 0;
  color: var(--ink);
  font-size: 13.5px;
  font-weight: 720;
  letter-spacing: -0.018em;
  line-height: 1.32;
  overflow-wrap: anywhere;
}

.service-actions {
  flex: 0 0 auto;
  display: flex;
  gap: 1px;
  margin: -3px -3px 0 0;
}

.service-action {
  width: 27px;
  height: 27px;
  display: grid;
  place-items: center;
  padding: 0;
  color: #8a938c;
  background: transparent;
  border: 0;
  border-radius: 7px;
  cursor: pointer;
  transition:
    color 0.14s ease,
    background-color 0.14s ease;
}

.service-action .icon {
  width: 14px;
  height: 14px;
}

.service-action:hover {
  color: var(--forest);
  background: var(--surface-2);
}

.service-action.is-danger:hover {
  color: var(--danger);
  background: var(--danger-soft);
}

.service-meta {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-top: 5px;
  color: var(--muted);
  font-size: 10.5px;
  line-height: 1.35;
}

.service-meta .icon {
  width: 12px;
  height: 12px;
  color: #9a9f95;
}

.service-meta span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.shift-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 9px;
}

.shift-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 7px;
  padding: 5px 7px;
  background: var(--surface-2);
  border-radius: 7px;
}

.shift-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 6px;
  color: #6b5a3a;
  background: var(--morning-soft);
  border-radius: 999px;
  font-size: 9px;
  font-weight: 750;
  letter-spacing: 0.015em;
}

.shift-badge::before {
  content: "";
  width: 4px;
  height: 4px;
  background: var(--morning);
  border-radius: 50%;
}

.shift-badge.afternoon {
  color: #405e6f;
  background: var(--afternoon-soft);
}

.shift-badge.afternoon::before {
  background: var(--afternoon);
}

.shift-time {
  color: var(--ink-soft);
  font-size: 10.5px;
  font-weight: 620;
  font-variant-numeric: tabular-nums;
}

.shift-length {
  color: #8a938c;
  font-size: 9.5px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.agents-row {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-top: 9px;
}

.avatar-stack {
  flex: 0 0 auto;
  display: flex;
  padding-left: 4px;
}

.avatar {
  width: 21px;
  height: 21px;
  display: grid;
  place-items: center;
  margin-left: -4px;
  color: var(--forest);
  background: #e6eaeb;
  border: 1.5px solid #fff;
  border-radius: 50%;
  font-size: 7px;
  font-weight: 760;
  letter-spacing: 0.01em;
}

.avatar:nth-child(2) {
  color: #665f50;
  background: #ece9e2;
}

.avatar:nth-child(3) {
  color: #405e6f;
  background: #e4e9ec;
}

.avatar:nth-child(4) {
  color: #5e5c58;
  background: #e8e6e3;
}

.avatar-more {
  color: var(--muted-strong);
  background: var(--surface-3);
  font-size: 7px;
}

.agent-names {
  min-width: 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 9.8px;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.service-warning {
  display: flex;
  align-items: center;
  gap: 5px;
  margin: 7px 0 0;
  padding: 5px 7px;
  color: #7c5d2c;
  background: #f8f1e1;
  border: 1px solid #eadcc0;
  border-radius: 6px;
  font-size: 9px;
  line-height: 1.35;
}

.service-warning .icon {
  width: 12px;
  height: 12px;
  flex: 0 0 auto;
}

/* Desplegable de ubicación dentro de la tarjeta de servicio */
.service-map-details {
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px dashed var(--line-soft);
}

.service-map-details > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: #607068;
  font-size: 9px;
  font-weight: 650;
  list-style: none;
  cursor: pointer;
}

.service-map-details > summary::-webkit-details-marker {
  display: none;
}

.service-map-details > summary:hover {
  color: var(--forest);
}

.service-map-summary-title {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
}

.service-map-summary-title .icon {
  width: 12px;
  height: 12px;
  color: #88978f;
}

.service-map-summary-status {
  flex: 0 0 auto;
  padding: 2px 6px;
  color: var(--muted-strong);
  background: var(--surface-2);
  border: 1px solid var(--line-soft);
  border-radius: 999px;
  font-size: 7.5px;
  font-weight: 600;
}

.service-map-summary-status::after {
  content: " +";
}

.service-map-details[open] .service-map-summary-status::after {
  content: " −";
}

.service-map-body {
  padding-top: 9px;
}

.service-map-select {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 7px;
}

.service-map-select > span {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 8px;
  font-weight: 650;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.service-map-select select {
  flex: 1 1 auto;
  min-width: 0;
  padding: 5px 7px;
  color: var(--ink-soft);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 7px;
  font: inherit;
  font-size: 9px;
}

.service-map-frame {
  position: relative;
  min-height: 165px;
  aspect-ratio: 1.75 / 1;
  overflow: hidden;
  background:
    linear-gradient(135deg, rgba(125, 143, 133, 0.12) 25%, transparent 25%) 0 0 / 18px 18px,
    linear-gradient(315deg, rgba(125, 143, 133, 0.12) 25%, transparent 25%) 0 0 / 18px 18px,
    #eef1eb;
  border: 1px solid var(--line);
  border-radius: 10px;
}

.leaflet-map {
  position: absolute;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  background: #eef1eb;
}

.leaflet-map .leaflet-tile-pane {
  filter: saturate(0.7) contrast(0.97) brightness(1.015);
}

.leaflet-map.is-unavailable {
  display: flex;
  align-items: center;
  justify-content: center;
}

.map-fallback {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  padding: 16px;
  color: var(--muted);
  font-size: 9px;
  text-align: center;
}

.map-fallback a {
  color: var(--forest-2);
  font-weight: 650;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.service-map-frame .leaflet-control-zoom {
  margin: 9px 9px 0 0;
  overflow: hidden;
  border: 1px solid #dfe5df;
  border-radius: 7px;
  box-shadow: 0 4px 12px -8px rgba(20, 32, 27, 0.6);
}

.service-map-frame .leaflet-control-zoom a {
  width: 25px;
  height: 25px;
  color: #4c6157;
  background: #fff;
  border-color: #e8ece7;
  font-size: 15px;
  line-height: 25px;
}

.service-map-frame .leaflet-control-zoom a:hover {
  color: var(--forest);
  background: #f4f6f2;
}

.service-map-frame .leaflet-control-attribution {
  padding: 1px 4px;
  color: #6d7971;
  background: rgba(255, 255, 255, 0.86);
  border-radius: 4px 0 0 0;
  font-size: 7px;
}

.service-map-frame .leaflet-control-attribution a {
  color: #4c6658;
}

.service-map-frame .leaflet-control-scale-line {
  color: #5c6b62;
  background: rgba(255, 255, 255, 0.78);
  border-color: #74867b;
  font-size: 7px;
  line-height: 1.2;
}

.leaflet-div-icon.vigia-map-marker {
  background: transparent;
  border: 0;
}

.vigia-map-marker-pin {
  position: relative;
  z-index: 2;
  width: 42px;
  height: 42px;
  display: block;
  margin: 0 auto;
  overflow: hidden;
  background: var(--forest);
  border: 2px solid #fff;
  border-radius: 12px;
  box-shadow:
    0 6px 14px rgba(20, 32, 27, 0.3),
    0 0 0 1px rgba(20, 32, 27, 0.12);
}

.vigia-map-marker-pin img {
  width: 100%;
  height: 100%;
  display: block;
}

.vigia-map-marker-tip {
  position: absolute;
  left: 50%;
  bottom: 0;
  width: 0;
  height: 0;
  border-right: 7px solid transparent;
  border-left: 7px solid transparent;
  border-top: 12px solid var(--forest);
  transform: translateX(-50%);
  filter: drop-shadow(0 2px 2px rgba(20, 32, 27, 0.22));
}

.vigia-map-tooltip {
  padding: 3px 6px;
  color: #f5f6f2;
  background: var(--forest);
  border: 0;
  border-radius: 5px;
  box-shadow: 0 4px 10px -6px rgba(20, 32, 27, 0.7);
  font-size: 8px;
  font-weight: 600;
}

.vigia-map-tooltip.leaflet-tooltip-top::before {
  border-top-color: var(--forest);
}

.service-map-caption {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 3px 8px;
  margin-top: 7px;
  color: var(--muted);
  font-size: 8.5px;
  line-height: 1.4;
}

.service-map-agent {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.service-map-agent strong {
  overflow: hidden;
  color: var(--ink-soft);
  font-size: 9px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.service-map-agent span {
  overflow: hidden;
  color: var(--muted);
  font-size: 7.5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.service-map-badge {
  align-self: start;
  padding: 2px 6px;
  color: var(--muted-strong);
  background: var(--surface-2);
  border: 1px solid var(--line-soft);
  border-radius: 999px;
  font-size: 7px;
  font-weight: 650;
  white-space: nowrap;
}

.service-map-badge.is-inside {
  color: #426353;
  background: #e9f0eb;
  border-color: #d2e0d6;
}

.service-map-badge.is-outside {
  color: #7e463b;
  background: var(--danger-soft);
  border-color: #e8ccc6;
}

.service-map-badge.is-approximate {
  color: #7c5d2c;
  background: #f8f1e1;
  border-color: #eadcc0;
}

.service-map-meta {
  grid-column: 1 / -1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.service-map-link {
  grid-column: 1 / -1;
  justify-self: start;
  color: var(--forest-2);
  font-size: 8px;
  font-weight: 650;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.service-map-link:hover {
  color: var(--forest);
}

.service-map-note {
  margin: 4px 0 0;
  color: #9aa49d;
  font-size: 7.5px;
  line-height: 1.35;
}

.service-map-note a {
  color: #7d8981;
  text-decoration: underline;
  text-underline-offset: 1px;
}

.service-map-empty {
  margin: 0;
  padding: 10px;
  color: var(--muted);
  background: var(--surface-2);
  border: 1px dashed var(--line);
  border-radius: 8px;
  font-size: 8.5px;
  line-height: 1.45;
  text-align: center;
}

.service-notes {
  margin: 8px 0 0;
  padding-top: 7px;
  color: #7e877f;
  border-top: 1px dashed var(--line-soft);
  font-size: 9.7px;
  line-height: 1.45;
}

.service-notes strong {
  color: #5e6b61;
  font-weight: 700;
}

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 180px;
  padding: 24px 18px;
  text-align: center;
  background: var(--surface-2);
  border: 1px dashed #cfd7d3;
  border-radius: 15px;
}

.empty-icon {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  margin-bottom: 11px;
  color: #536e7a;
  background: #e9edee;
  border-radius: 13px;
}

.empty-icon .icon {
  width: 21px;
  height: 21px;
}

.empty-state h3 {
  margin: 0 0 4px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: -0.015em;
}

.empty-state p {
  max-width: 210px;
  margin: 0;
  color: var(--muted);
  font-size: 10.5px;
  line-height: 1.5;
}

.day-panel > .btn-dashed {
  flex: 0 0 auto;
  margin-top: 1px;
}

.day-tip {
  flex: 0 0 auto;
  display: flex;
  align-items: flex-start;
  gap: 7px;
  margin-top: 12px;
  padding-top: 11px;
  color: #8b938c;
  border-top: 1px solid var(--line-soft);
}

.day-tip .icon {
  width: 13px;
  height: 13px;
  margin-top: 1px;
  color: var(--whatsapp);
}

.day-tip p {
  margin: 0;
  font-size: 9.5px;
  line-height: 1.45;
}

.page-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 3px 0;
  color: #8b938c;
  font-size: 10px;
}

.page-footer p {
  display: flex;
  align-items: center;
  gap: 5px;
  margin: 0;
}

.page-footer .icon {
  width: 12px;
  height: 12px;
}

.footer-brand {
  font-weight: 600;
  letter-spacing: 0.03em;
}

/* =========================
   Vistas de trabajo
   ========================= */

.view-tabs {
  display: flex;
  align-items: center;
  gap: 3px;
  width: max-content;
  max-width: 100%;
  margin: 0 0 23px;
  padding: 3px;
  overflow-x: auto;
  background: rgba(252, 252, 249, 0.7);
  border: 1px solid var(--line);
  border-radius: 999px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.65);
  scrollbar-width: none;
}

.view-tabs::-webkit-scrollbar {
  display: none;
}

.view-tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 33px;
  padding: 7px 13px;
  color: var(--muted-strong);
  background: transparent;
  border: 0;
  border-radius: 999px;
  font-size: 10.5px;
  font-weight: 650;
  white-space: nowrap;
  cursor: pointer;
  transition:
    color 0.15s ease,
    background-color 0.15s ease;
}

.view-tab .icon {
  width: 14px;
  height: 14px;
  opacity: 0.7;
}

.view-tab:hover {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.8);
}

.view-tab.is-active {
  color: #fff;
  background: var(--forest);
  box-shadow: 0 4px 12px -8px rgba(24, 36, 43, 0.7);
}

.view-tab.is-active .icon {
  opacity: 0.9;
}

.view-tab-badge {
  min-width: 16px;
  padding: 1px 5px;
  color: #18322d;
  background: #d9d5ca;
  border-radius: 999px;
  font-size: 8px;
  font-weight: 760;
  line-height: 1.5;
  text-align: center;
}

.view-tab.is-active .view-tab-badge {
  color: var(--forest);
  background: #d9d5ca;
}

.app-view {
  min-width: 0;
  animation: view-in 0.2s ease both;
}

.view-hero {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 26px;
  margin-bottom: 21px;
}

.view-hero h1 {
  margin: 0 0 7px;
  font-size: clamp(1.9rem, 2.8vw, 2.55rem);
  font-weight: 760;
  letter-spacing: -0.055em;
  line-height: 1.03;
}

.view-hero p:not(.eyebrow) {
  max-width: 580px;
  margin: 0;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.55;
}

.view-hero-side {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 8px;
}

.view-date-chip {
  display: inline-flex;
  align-items: center;
  min-height: 31px;
  padding: 6px 10px;
  color: var(--muted-strong);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 10px;
  font-weight: 650;
  white-space: nowrap;
}

.operation-banner {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  margin-bottom: 13px;
  padding: 11px 13px;
  color: #5d573f;
  background: #f7f1e2;
  border: 1px solid #e7dcc2;
  border-left: 3px solid #a98c5d;
  border-radius: 10px;
  font-size: 11px;
  line-height: 1.5;
}

.operation-banner .icon {
  width: 16px;
  height: 16px;
  margin-top: 1px;
  flex: 0 0 auto;
}

.operation-banner p {
  margin: 0;
}

.operation-banner strong {
  font-weight: 720;
}

.operation-banner.is-warning {
  color: #755926;
  background: #f8f1e1;
  border-color: #eadcc0;
  border-left-color: #b4853f;
}

.operation-banner.is-danger {
  color: #7d3830;
  background: #f7ecea;
  border-color: #e9cfca;
  border-left-color: var(--danger);
}

.operation-banner.is-info {
  color: #405b67;
  background: #edf2f3;
  border-color: #d9e2e4;
  border-left-color: #668492;
}

/* =========================
   Asignación de agentes por turno
   ========================= */

.agent-chips {
  display: flex;
  flex-direction: column;
  flex-wrap: nowrap;
  gap: 5px;
}

.agent-assignment-row {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) auto 22px;
  align-items: center;
  gap: 8px;
  min-width: 0;
  padding: 7px 8px;
  background: var(--surface-2);
  border: 1px solid var(--line-soft);
  border-radius: 9px;
}

.agent-assignment-avatar {
  width: 27px;
  height: 27px;
  display: grid;
  place-items: center;
  color: #38515d;
  background: #e2e8e8;
  border-radius: 50%;
  font-size: 7.5px;
  font-weight: 760;
}

.agent-assignment-copy {
  display: flex;
  flex-direction: column;
  min-width: 0;
  line-height: 1.3;
}

.agent-assignment-copy strong {
  overflow: hidden;
  color: var(--ink-soft);
  font-size: 10.5px;
  font-weight: 680;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.agent-assignment-copy span {
  margin-top: 1px;
  overflow: hidden;
  color: #8b978f;
  font-size: 8.5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.agent-assignment-copy span.is-new {
  color: #9a7443;
}

.agent-shift-picks {
  display: flex;
  align-items: center;
  gap: 3px;
}

.shift-pick {
  display: inline-flex;
  cursor: pointer;
}

.shift-pick input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.shift-pick span {
  padding: 4px 7px;
  color: #87938c;
  background: #fff;
  border: 1px solid #dce2de;
  border-radius: 999px;
  font-size: 8px;
  font-weight: 680;
  line-height: 1.2;
  transition:
    background-color 0.14s ease,
    border-color 0.14s ease,
    color 0.14s ease;
}

.shift-pick:hover span {
  border-color: #bfc9c5;
}

.shift-pick[data-shift="morning"] input:checked + span {
  color: #6e5a37;
  background: var(--morning-soft);
  border-color: #d9ccb4;
}

.shift-pick[data-shift="afternoon"] input:checked + span {
  color: #3f5d6d;
  background: var(--afternoon-soft);
  border-color: #c9d7dd;
}

.shift-pick input:focus-visible + span {
  outline: 2px solid var(--forest-3);
  outline-offset: 1px;
}

.agent-assignment-row .agent-chip-remove {
  justify-self: end;
}

.agent-assignment-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 3px 7px;
  color: var(--muted-strong);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 8px;
  font-weight: 650;
  white-space: nowrap;
}

/* =========================
   Matriz de cobertura
   ========================= */

.coverage-matrix-wrap {
  overflow: hidden;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  transition:
    border-color 0.16s ease,
    box-shadow 0.16s ease;
}

.coverage-matrix-wrap.has-error {
  border-color: #d59e97;
  box-shadow: 0 0 0 3px rgba(178, 65, 55, 0.06);
}

.coverage-scroll {
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scrollbar-width: thin;
  scrollbar-color: #d0d6d1 transparent;
}

.coverage-table {
  width: 100%;
  min-width: max-content;
  border-collapse: separate;
  border-spacing: 0;
}

.coverage-table th,
.coverage-table td {
  padding: 0;
  border-right: 1px solid var(--line-soft);
  border-bottom: 1px solid var(--line-soft);
}

.coverage-table thead th {
  min-width: 52px;
  padding: 7px 5px;
  color: var(--muted);
  background: var(--surface-2);
  font-size: 8px;
  font-weight: 720;
  letter-spacing: 0.03em;
  line-height: 1.3;
  text-align: center;
  white-space: nowrap;
}

.coverage-table thead th span {
  display: block;
  color: var(--ink-soft);
  font-size: 8.5px;
  letter-spacing: 0.01em;
}

.coverage-table thead th small {
  display: block;
  margin-top: 2px;
  color: #99a29b;
  font-size: 7px;
  font-weight: 600;
}

.coverage-table .coverage-agent-head {
  position: sticky;
  left: 0;
  z-index: 2;
  min-width: 206px;
  padding: 8px 10px;
  color: var(--ink-soft);
  font-size: 8px;
  letter-spacing: 0.08em;
  text-align: left;
  text-transform: uppercase;
}

.coverage-table tbody tr:last-child td {
  border-bottom: 0;
}

.coverage-table td:last-child,
.coverage-table thead th:last-child {
  border-right: 0;
}

.coverage-agent-cell {
  position: sticky;
  left: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 206px;
  min-width: 206px;
  padding: 7px 8px !important;
  background: #fff;
}

.coverage-agent-info {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
}

.coverage-agent-info .agent-assignment-avatar {
  width: 25px;
  height: 25px;
  font-size: 7px;
}

.coverage-agent-info > div {
  display: flex;
  flex-direction: column;
  min-width: 0;
  line-height: 1.25;
}

.coverage-agent-info strong {
  overflow: hidden;
  color: var(--ink-soft);
  font-size: 9.5px;
  font-weight: 680;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.coverage-agent-info span {
  margin-top: 1px;
  color: var(--muted);
  font-size: 7.5px;
}

.coverage-all {
  flex: 0 0 auto;
  padding: 3px 6px;
  color: var(--muted-strong);
  background: var(--surface-2);
  border: 1px solid var(--line-soft);
  border-radius: 999px;
  font-size: 7.5px;
  font-weight: 650;
  cursor: pointer;
}

.coverage-all:hover {
  color: var(--forest);
  background: #edf1ee;
}

.coverage-all.is-all {
  color: #5c6a63;
  background: #f1f0e9;
  border-color: #dfd8c9;
}

.coverage-cell {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 7px 4px;
}

.coverage-pick {
  position: relative;
  display: inline-flex;
  cursor: pointer;
}

.coverage-pick input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.coverage-pick span {
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  color: #a1aaa4;
  background: #fff;
  border: 1px solid #e1e6e1;
  border-radius: 6px;
  font-size: 8px;
  font-weight: 760;
  line-height: 1;
  transition:
    color 0.12s ease,
    background-color 0.12s ease,
    border-color 0.12s ease;
}

.coverage-pick:hover span {
  border-color: #bdc9c3;
}

.coverage-pick.morning input:checked + span {
  color: #fff;
  background: var(--morning);
  border-color: var(--morning);
  box-shadow: 0 1px 2px rgba(24, 36, 43, 0.12);
}

.coverage-pick.afternoon input:checked + span {
  color: #fff;
  background: var(--afternoon);
  border-color: var(--afternoon);
  box-shadow: 0 1px 2px rgba(24, 36, 43, 0.12);
}

.coverage-pick input:focus-visible + span {
  outline: 2px solid var(--forest-3);
  outline-offset: 1px;
}

.coverage-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 110px;
  padding: 20px 16px;
  color: var(--muted);
  text-align: center;
}

.coverage-empty .icon {
  width: 19px;
  height: 19px;
  color: #98a39d;
}

.coverage-empty p {
  max-width: 420px;
  margin: 0;
  font-size: 9.5px;
  line-height: 1.5;
}

.coverage-hint {
  margin-top: 7px;
}

.geo-panel,
.policy-panel {
  margin-top: 13px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 11px;
}

.geo-panel summary,
.policy-panel summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  color: var(--ink-soft);
  font-size: 10px;
  font-weight: 650;
  list-style: none;
  cursor: pointer;
}

.geo-panel summary::-webkit-details-marker,
.policy-panel summary::-webkit-details-marker {
  display: none;
}

.geo-panel summary::after {
  content: "+";
  display: none;
}

.geo-summary-title {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.geo-summary-title .icon {
  width: 13px;
  height: 13px;
  color: var(--muted);
}

.geo-summary-status {
  flex: 0 0 auto;
  padding: 2px 6px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid var(--line-soft);
  border-radius: 999px;
  font-size: 7.5px;
  font-weight: 600;
}

.geo-summary-status.is-ready {
  color: #476257;
  background: #e9f0eb;
  border-color: #d3e1d7;
}

.geo-panel-body {
  padding: 11px 12px 12px;
  border-top: 1px solid var(--line-soft);
}

.policy-panel {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 11px;
}

.policy-panel > summary {
  color: var(--ink-soft);
  font-size: 10px;
  font-weight: 650;
  list-style: none;
  cursor: pointer;
}

.policy-check {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  padding: 7px 8px;
  color: var(--muted-strong);
  background: #fff;
  border: 1px solid var(--line-soft);
  border-radius: 7px;
  font-size: 9px;
  line-height: 1.35;
}

.policy-check input {
  margin-top: 1px;
}

#service-overtime-policy {
  width: 100%;
  padding: 8px 9px;
  color: var(--ink-soft);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 7px;
  font: inherit;
  font-size: 10px;
}



.place-search {
  margin-bottom: 10px;
}

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

.place-search-row input {
  width: 100%;
  min-height: 36px;
  padding: 8px 9px;
  color: var(--ink-soft);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  font: inherit;
  font-size: 10px;
}

.place-search-row input:focus {
  outline: 2px solid rgba(13, 47, 37, 0.16);
  border-color: var(--forest);
}

.place-search-row .btn {
  min-height: 36px;
  padding: 7px 10px;
  font-size: 9px;
  white-space: nowrap;
}

.place-results {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-height: 210px;
  margin-top: 6px;
  padding: 5px;
  overflow-y: auto;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 9px;
  box-shadow: 0 12px 24px -18px rgba(20, 32, 27, 0.45);
}

.place-result {
  display: flex;
  align-items: flex-start;
  gap: 7px;
  width: 100%;
  padding: 7px 8px;
  color: var(--ink-soft);
  background: transparent;
  border: 0;
  border-radius: 6px;
  font: inherit;
  font-size: 9px;
  line-height: 1.35;
  text-align: left;
  cursor: pointer;
}

.place-result:hover,
.place-result:focus-visible {
  background: #edf2ed;
  outline: none;
}

.place-result svg {
  flex: 0 0 auto;
  width: 13px;
  height: 13px;
  margin-top: 1px;
  color: var(--forest-2);
}

.place-result strong {
  display: block;
  color: var(--ink-soft);
  font-size: 9.5px;
  font-weight: 680;
}

.place-result small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 8px;
  line-height: 1.35;
}

.place-results-empty,
.place-results-loading {
  padding: 9px;
  color: var(--muted);
  font-size: 8.5px;
  line-height: 1.4;
}

.service-place-map-wrap {
  position: relative;
  height: 190px;
  margin-top: 8px;
  overflow: hidden;
  background: #eef1eb;
  border: 1px solid var(--line);
  border-radius: 10px;
}

.service-place-map {
  width: 100%;
  height: 100%;
}

.service-place-map .leaflet-control-attribution {
  max-width: calc(100% - 8px);
  padding: 1px 4px;
  overflow: hidden;
  font-size: 7px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.service-place-map-hint {
  position: absolute;
  left: 8px;
  bottom: 8px;
  z-index: 4;
  padding: 3px 6px;
  color: var(--muted-strong);
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid var(--line-soft);
  border-radius: 5px;
  font-size: 7.5px;
  pointer-events: none;
}

.place-selected {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-top: 8px;
  padding: 7px 8px;
  background: #edf2ed;
  border: 1px solid #d7e2da;
  border-radius: 8px;
}

.place-selected-icon {
  flex: 0 0 auto;
  display: grid;
  width: 24px;
  height: 24px;
  place-items: center;
  color: var(--forest);
  background: #fff;
  border-radius: 50%;
}

.place-selected-icon .icon {
  width: 13px;
  height: 13px;
}

.place-selected-copy {
  flex: 1 1 auto;
  min-width: 0;
}

.place-selected-copy strong {
  display: block;
  overflow: hidden;
  color: var(--ink-soft);
  font-size: 9px;
  font-weight: 680;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.place-selected-copy small {
  display: block;
  margin-top: 2px;
  overflow: hidden;
  color: var(--muted);
  font-size: 8px;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.place-selected .text-button {
  flex: 0 0 auto;
  font-size: 8px;
}

.place-selected[hidden],
.service-place-map-wrap[hidden],
.place-results[hidden] {
  display: none;
}

.geo-coordinates {
  margin: 8px 0 0;
  padding: 0;
  background: rgba(255, 255, 255, 0.5);
  border: 1px solid var(--line-soft);
  border-radius: 8px;
}

.geo-coordinates > summary {
  padding: 7px 8px;
  color: var(--muted-strong);
  font-size: 8.5px;
  font-weight: 650;
  list-style: none;
  cursor: pointer;
}

.geo-coordinates > summary::-webkit-details-marker {
  display: none;
}

.geo-coordinates[open] > summary {
  border-bottom: 1px solid var(--line-soft);
}

.geo-coordinates .geo-grid {
  padding: 8px;
}

.geo-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(110px, 0.7fr);
  gap: 9px;
}

.geo-grid .field {
  gap: 4px;
}

.geo-grid .field input {
  min-height: 34px;
  padding: 7px 9px;
  font-size: 11px;
}

.geo-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-top: 9px;
}

.geo-actions .btn {
  min-height: 31px;
  padding: 6px 10px;
  border-radius: 7px;
  font-size: 9px;
}

.geo-actions .text-button {
  font-size: 9px;
}

#geo-capture-status {
  margin-top: 8px;
}

#geo-capture-status.is-error {
  color: var(--danger);
}

#geo-capture-status.is-success {
  color: #4f705d;
}

.form-series-note {
  margin-top: 10px;
  padding: 8px 10px;
  color: #5b6a62;
  background: var(--surface-2);
  border: 1px solid var(--line-soft);
  border-radius: 8px;
}

.coverage-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 5px 12px;
  margin-bottom: 7px;
  color: var(--muted);
  font-size: 8.5px;
}

.coverage-legend:empty {
  display: none;
}

.coverage-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.coverage-legend-item i {
  width: 17px;
  height: 17px;
  display: grid;
  place-items: center;
  color: #fff;
  background: var(--morning);
  border-radius: 4px;
  font-size: 7px;
  font-style: normal;
  font-weight: 760;
}

.coverage-legend-item.afternoon i {
  background: var(--afternoon);
}

/* =========================
   Mi servicio
   ========================= */

.my-service-content {
  display: flex;
  flex-direction: column;
  gap: 11px;
  margin-bottom: 17px;
}

.service-live-card {
  position: relative;
  padding: 18px 19px 16px;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow-panel);
}

.service-live-card::before {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  height: 3px;
  background: var(--line);
}

.service-live-card.is-active::before {
  background: linear-gradient(90deg, var(--morning), #b99d6e);
}

.service-live-card.is-paused::before {
  background: linear-gradient(90deg, var(--gold-strong), #b7a77f);
}

.service-live-card.is-auto::before,
.service-live-card.is-alert::before {
  background: linear-gradient(90deg, var(--danger), #c2796d);
}

.service-live-card.is-completed::before {
  background: var(--forest-2);
}

.live-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.live-card-title {
  min-width: 0;
}

.live-card-title .eyebrow {
  margin-bottom: 5px;
}

.live-card-title h2 {
  margin: 0 0 4px;
  font-size: 19px;
  font-weight: 750;
  letter-spacing: -0.04em;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.live-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 12px;
  margin: 0;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.4;
}

.live-card-meta span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.live-card-meta .icon {
  width: 12px;
  height: 12px;
  color: #8d9994;
}

.status-badge {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 8px;
  color: var(--muted-strong);
  background: var(--surface-2);
  border: 1px solid var(--line-soft);
  border-radius: 999px;
  font-size: 8.5px;
  font-weight: 710;
  white-space: nowrap;
}

.status-badge::before {
  content: "";
  width: 5px;
  height: 5px;
  background: #96a29b;
  border-radius: 50%;
}

.status-badge.status-active {
  color: #66552f;
  background: var(--morning-soft);
  border-color: #ddcfb7;
}

.status-badge.status-active::before {
  background: var(--morning);
  box-shadow: 0 0 0 3px rgba(127, 106, 70, 0.11);
}

.status-badge.status-paused {
  color: #73694e;
  background: #f1eee6;
  border-color: #ded7c7;
}

.status-badge.status-paused::before {
  background: #a59268;
}

.status-badge.status-auto {
  color: #80433a;
  background: var(--danger-soft);
  border-color: #e7c8c3;
}

.status-badge.status-auto::before {
  background: var(--danger);
  box-shadow: 0 0 0 3px rgba(150, 63, 55, 0.1);
}

.status-badge.status-completed {
  color: #466158;
  background: #ebf0ec;
  border-color: #d7e0da;
}

.status-badge.status-completed::before {
  background: #5f8170;
}

.status-badge.status-pending {
  color: #7c857e;
  background: #f3f4f1;
}

.live-card-main {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(240px, 0.8fr);
  gap: 24px;
  margin-top: 15px;
  padding-top: 15px;
  border-top: 1px dashed var(--line-soft);
}

.live-clock-block {
  min-width: 0;
}

.live-clock-label {
  display: block;
  margin-bottom: 2px;
  color: var(--muted);
  font-size: 8.5px;
  font-weight: 680;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.live-clock {
  display: block;
  color: var(--ink);
  font-size: clamp(1.7rem, 2.5vw, 2.25rem);
  font-weight: 720;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.045em;
  line-height: 1.1;
}

.live-clock-sub {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 9.5px;
  line-height: 1.45;
}

.live-progress {
  width: 100%;
  height: 4px;
  margin-top: 11px;
  overflow: hidden;
  background: #e9ebe7;
  border-radius: 99px;
}

.live-progress > span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--morning), #b39763);
  border-radius: inherit;
  transition: width 0.35s ease;
}

.service-live-card.is-auto .live-progress > span {
  background: linear-gradient(90deg, var(--danger), #c78578);
}

.live-progress.is-overtime > span {
  background: var(--danger);
}

.live-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
}

.live-metric {
  min-width: 0;
  padding: 8px 9px;
  background: var(--surface-2);
  border: 1px solid var(--line-soft);
  border-radius: 9px;
}

.live-metric span {
  display: block;
  margin-bottom: 3px;
  color: var(--muted);
  font-size: 8px;
  line-height: 1.3;
}

.live-metric strong {
  display: block;
  color: var(--ink-soft);
  font-size: 11px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.live-metric.is-extra strong {
  color: var(--danger);
}

.live-alert {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-top: 13px;
  padding: 10px 11px;
  color: #6f5325;
  background: #f8f0df;
  border: 1px solid #e8d9bc;
  border-left: 3px solid #ad8248;
  border-radius: 9px;
}

.live-alert.is-danger {
  color: #7b3a32;
  background: var(--danger-soft);
  border-color: #e8cbc6;
  border-left-color: var(--danger);
}

.live-alert .icon {
  width: 16px;
  height: 16px;
  margin-top: 1px;
  flex: 0 0 auto;
}

.live-alert-copy {
  display: flex;
  align-items: flex-start;
  gap: 7px;
  min-width: 0;
}

.live-alert p {
  margin: 0;
  font-size: 10px;
  line-height: 1.5;
}

.live-alert strong {
  font-weight: 720;
}

.live-alert .btn {
  flex: 0 0 auto;
  min-height: 30px;
  padding: 6px 10px;
  font-size: 9.5px;
}

.active-pause-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-top: 12px;
  padding: 10px 11px;
  color: #625d4e;
  background: #f3f1ea;
  border: 1px solid #e1dbcc;
  border-left: 3px solid #a39475;
  border-radius: 9px;
}

.active-pause-copy {
  min-width: 0;
}

.active-pause-copy strong {
  display: block;
  font-size: 10.5px;
  font-weight: 700;
}

.active-pause-copy span {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.4;
}

.active-pause-copy em {
  font-style: normal;
  font-weight: 650;
}

.geo-status-line {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px 9px;
  margin-top: 9px;
  padding: 7px 9px;
  color: var(--muted);
  background: var(--surface-2);
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  font-size: 9px;
  line-height: 1.4;
}

.geo-status-line .icon {
  width: 12px;
  height: 12px;
  flex: 0 0 auto;
  color: #75868b;
}

.geo-status-line strong {
  color: var(--ink-soft);
  font-weight: 680;
}

.geo-status-line.is-inside {
  color: #4d6859;
  background: #eef3ee;
  border-color: #dae5dc;
}

.geo-status-line.is-outside {
  color: #7b4b3f;
  background: #f7eeeb;
  border-color: #ead7d1;
}

.geo-status-line.is-error {
  color: #7b4b3f;
  background: #f7eeeb;
  border-color: #ead7d1;
}

.geo-status-line.is-approximate {
  color: #7c5d2c;
  background: #f8f1e1;
  border-color: #eadcc0;
}

.geo-status-line.is-manual {
  background: #f6f7f3;
  border-style: dashed;
}

.geo-status-line .map-link {
  margin-left: auto;
  color: var(--forest-2);
  font-size: 8.5px;
  font-weight: 650;
  text-decoration: underline;
  text-underline-offset: 2px;
  white-space: nowrap;
}

.live-geo-line {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 5px 10px;
  padding-top: 7px;
  color: var(--muted);
  border-top: 1px dashed var(--line-soft);
  font-size: 8.5px;
  line-height: 1.4;
}

.live-geo-line .icon {
  width: 12px;
  height: 12px;
}

.geo-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 6px;
  color: var(--muted-strong);
  background: var(--surface-2);
  border: 1px solid var(--line-soft);
  border-radius: 999px;
  font-size: 7.5px;
  font-weight: 650;
  white-space: nowrap;
}

.geo-badge::before {
  content: "";
  width: 5px;
  height: 5px;
  background: #99a39c;
  border-radius: 50%;
}

.geo-badge.is-inside {
  color: #426353;
  background: #e9f0eb;
  border-color: #d2e0d6;
}

.geo-badge.is-inside::before {
  background: #5f8b72;
}

.geo-badge.is-outside {
  color: #7e463b;
  background: var(--danger-soft);
  border-color: #e8ccc6;
}

.geo-badge.is-outside::before {
  background: var(--danger);
}

.geo-badge.is-approximate {
  color: #7c5d2c;
  background: #f8f1e1;
  border-color: #eadcc0;
}

.geo-badge.is-approximate::before {
  background: #b98a3d;
}

.live-geo-line .map-link {
  color: var(--forest-2);
  font-weight: 650;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.live-geo-line .geo-coordinates {
  font-variant-numeric: tabular-nums;
}

.live-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-top: 14px;
}

.live-actions .btn {
  min-height: 34px;
  padding: 7px 12px;
  border-radius: 8px;
  font-size: 10px;
}

.live-actions .btn-finish {
  margin-left: auto;
}

.btn-outline {
  color: var(--ink-soft);
  background: #fff;
  border-color: var(--line);
}

.btn-outline:hover {
  color: var(--ink);
  background: var(--surface-2);
  border-color: #c7d0cb;
}

.live-pauses {
  margin-top: 12px;
  border-top: 1px dashed var(--line-soft);
}

.live-pauses summary {
  padding-top: 9px;
  color: var(--muted);
  font-size: 9.5px;
  font-weight: 600;
  cursor: pointer;
  list-style: none;
}

.live-pauses summary::-webkit-details-marker {
  display: none;
}

.live-pauses summary::before {
  content: "+";
  display: inline-block;
  width: 14px;
  font-weight: 700;
}

.live-pauses[open] summary::before {
  content: "−";
}

.pause-log {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin: 7px 0 0;
  padding: 0;
  list-style: none;
}

.pause-log li {
  display: grid;
  grid-template-columns: 78px minmax(0, 1fr) auto;
  gap: 8px;
  padding: 6px 8px;
  color: var(--muted);
  background: var(--surface-2);
  border-radius: 6px;
  font-size: 9px;
  line-height: 1.35;
}

.pause-log strong {
  color: var(--ink-soft);
  font-weight: 650;
}

.pause-log span:nth-child(2) {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pause-log time {
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.live-audit {
  margin-top: 8px;
  padding-top: 7px;
  border-top: 1px dashed var(--line-soft);
}

.live-audit > summary {
  color: var(--muted-strong);
  font-size: 8.5px;
  font-weight: 650;
  list-style: none;
  cursor: pointer;
}

.live-audit > summary::-webkit-details-marker {
  display: none;
}

.live-audit > summary::after {
  content: " +";
}

.live-audit[open] > summary::after {
  content: " −";
}

.audit-log {
  display: flex;
  flex-direction: column;
  gap: 3px;
  margin: 6px 0 0;
  padding: 0;
  list-style: none;
}

.audit-log li {
  display: grid;
  grid-template-columns: 80px minmax(0, 1fr);
  gap: 2px 7px;
  padding: 5px 7px;
  color: var(--muted);
  background: var(--surface-2);
  border-radius: 6px;
  font-size: 8px;
  line-height: 1.35;
}

.audit-log time {
  grid-row: 1 / 3;
  color: var(--muted-strong);
  font-variant-numeric: tabular-nums;
}

.audit-log strong {
  color: var(--ink-soft);
  font-weight: 650;
}

.audit-log em {
  grid-column: 2;
  color: var(--muted);
  font-style: italic;
}

.assignment-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 17px 19px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow-panel);
}

.assignment-card.is-muted {
  background: rgba(252, 252, 249, 0.72);
  box-shadow: none;
}

.assignment-main {
  min-width: 0;
}

.assignment-kicker {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
  margin-bottom: 4px;
  color: var(--gold-strong);
  font-size: 8.5px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.assignment-card h2 {
  margin: 0 0 4px;
  font-size: 16px;
  font-weight: 730;
  letter-spacing: -0.03em;
  line-height: 1.25;
}

.assignment-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 5px 12px;
  margin: 0;
  color: var(--muted);
  font-size: 9.5px;
  line-height: 1.45;
}

.assignment-meta span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.assignment-meta .icon {
  width: 11px;
  height: 11px;
}

.assignment-side {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 12px;
}

.assignment-duration {
  text-align: right;
}

.assignment-duration strong {
  display: block;
  font-size: 13px;
  font-weight: 720;
  font-variant-numeric: tabular-nums;
}

.assignment-duration span {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 8.5px;
}

.assignment-side .btn {
  min-height: 34px;
  padding: 7px 12px;
  border-radius: 8px;
  font-size: 10px;
}

.records-panel {
  padding: 18px 19px;
}

.panel-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
}

.panel-heading h2 {
  margin: 0 0 3px;
  font-size: 15px;
  font-weight: 730;
  letter-spacing: -0.025em;
}

.panel-heading p {
  margin: 0;
  color: var(--muted);
  font-size: 9.5px;
  line-height: 1.45;
}

.history-table-wrap {
  overflow-x: auto;
  scrollbar-width: thin;
  scrollbar-color: #d5d9d4 transparent;
}

.history-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 10px;
  white-space: nowrap;
}

.history-table th {
  padding: 7px 8px;
  color: #8b968f;
  border-bottom: 1px solid var(--line-soft);
  font-size: 7.5px;
  font-weight: 720;
  letter-spacing: 0.08em;
  text-align: left;
  text-transform: uppercase;
}

.history-table td {
  padding: 9px 8px;
  color: var(--ink-soft);
  border-bottom: 1px solid var(--line-soft);
  vertical-align: middle;
}

.history-table tr:last-child td {
  border-bottom: 0;
}

.history-table tbody tr:hover td {
  background: var(--surface-2);
}

.history-service {
  min-width: 150px;
  max-width: 230px;
  white-space: normal;
}

.history-service strong {
  display: block;
  color: var(--ink);
  font-size: 10.5px;
  font-weight: 680;
  line-height: 1.35;
}

.history-service span {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 8.5px;
}

.history-extra {
  color: var(--danger) !important;
  font-weight: 650;
}

.history-empty {
  padding: 22px 12px;
  color: var(--muted);
  font-size: 10.5px;
  text-align: center;
}

/* =========================
   Control en vivo
   ========================= */

.live-controls {
  flex: 0 0 auto;
  display: flex;
  align-items: flex-end;
  gap: 8px;
}

.live-date-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.live-date-field span {
  color: var(--muted);
  font-size: 8px;
  font-weight: 680;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.live-date-field input {
  min-height: 36px;
  padding: 7px 9px;
  color: var(--ink-soft);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 11px;
  outline: none;
}

.live-date-field input:focus {
  border-color: var(--forest-3);
  box-shadow: 0 0 0 3px rgba(74, 101, 115, 0.1);
}

.live-controls .btn {
  min-height: 36px;
  padding: 7px 11px;
  border-radius: 8px;
  font-size: 10px;
}

.live-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 14px;
}

.live-stat {
  padding: 11px 13px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
}

.live-stat span {
  display: flex;
  align-items: center;
  gap: 5px;
  color: var(--muted);
  font-size: 8.5px;
  font-weight: 650;
}

.live-stat span .icon {
  width: 12px;
  height: 12px;
}

.live-stat strong {
  display: block;
  margin-top: 3px;
  color: var(--ink);
  font-size: 20px;
  font-weight: 740;
  letter-spacing: -0.035em;
  font-variant-numeric: tabular-nums;
  line-height: 1.15;
}

.live-stat.is-accent {
  background: var(--forest);
  border-color: var(--forest);
}

.live-stat.is-accent span {
  color: rgba(255, 255, 255, 0.55);
}

.live-stat.is-accent strong {
  color: #f3f3ef;
}

.live-list {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.live-row-details {
  border-radius: 12px;
}

.live-row-details > summary.live-row {
  list-style: none;
  cursor: pointer;
}

.live-row-details > summary.live-row::-webkit-details-marker {
  display: none;
}

.live-row-details > summary.live-row:focus-visible {
  outline: 2px solid var(--forest-3);
  outline-offset: 2px;
}

.live-row-details[open] > summary.live-row {
  border-bottom-right-radius: 0;
  border-bottom-left-radius: 0;
  border-bottom-color: transparent;
}

.live-expand-label {
  color: #7d8c84;
  font-size: 7.5px;
  font-weight: 600;
  white-space: nowrap;
}

.live-row-details[open] .live-expand-label {
  color: var(--forest);
}

.live-expand-icon {
  width: 22px;
  height: 28px;
  display: grid;
  place-items: center;
  color: #7d8c84;
  transition: transform 0.16s ease;
}

.live-expand-icon .icon {
  width: 13px;
  height: 13px;
}

.live-row-details[open] .live-expand-icon {
  transform: rotate(90deg);
}

.live-outside-date {
  display: inline-flex !important;
  width: fit-content;
  margin-top: 4px !important;
  padding: 2px 5px;
  color: #7c5d2c !important;
  background: #f8f1e1;
  border: 1px solid #eadcc0;
  border-radius: 999px;
  font-size: 7px !important;
  font-weight: 600;
}

.live-row-detail {
  padding: 14px;
  background: #f8f9f6;
  border: 1px solid var(--line);
  border-top: 0;
  border-radius: 0 0 12px 12px;
}

.live-detail-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 11px;
  border-bottom: 1px solid var(--line-soft);
}

.live-detail-head .eyebrow {
  margin-bottom: 3px;
}

.live-detail-head h3 {
  margin: 0;
  color: var(--ink);
  font-size: 15px;
  font-weight: 730;
  letter-spacing: -0.025em;
  line-height: 1.25;
}

.live-detail-subtitle {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.45;
}

.live-detail-location {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px;
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 8.5px;
}

.live-detail-location .icon {
  width: 11px;
  height: 11px;
}

.live-detail-head > .status-badge {
  flex: 0 0 auto;
}

.live-detail-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 420px);
  gap: 16px;
  margin-top: 12px;
}

.live-detail-info {
  min-width: 0;
}

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

.live-detail-stat {
  min-width: 0;
  padding: 8px 9px;
  background: #fff;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
}

.live-detail-stat span {
  display: block;
  color: var(--muted);
  font-size: 7.5px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.live-detail-stat strong {
  display: block;
  overflow: hidden;
  margin-top: 3px;
  color: var(--ink-soft);
  font-size: 11px;
  font-weight: 680;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.live-detail-stat.is-live {
  color: #fff;
  background: var(--forest);
  border-color: var(--forest);
}

.live-detail-stat.is-live span {
  color: rgba(255, 255, 255, 0.55);
}

.live-detail-stat.is-live strong {
  color: #fff;
  font-size: 18px;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
  white-space: nowrap;
}

.live-detail-stat .live-detail-extra {
  color: var(--danger);
}

.live-detail-progress-note {
  margin: 8px 1px 0;
  color: var(--muted);
  font-size: 8.5px;
  line-height: 1.45;
}

.live-detail-map {
  min-width: 0;
}

.live-detail-map-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
  color: var(--muted-strong);
  font-size: 8.5px;
  font-weight: 650;
}

.live-detail-map-head > span:first-child {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.live-detail-map-head .icon {
  width: 11px;
  height: 11px;
}

.live-detail-map-frame {
  min-height: 220px;
  aspect-ratio: auto;
  height: 220px;
}

.live-detail-map-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 4px 8px;
  margin-top: 6px;
  color: var(--muted);
  font-size: 7.5px;
  line-height: 1.4;
}

.live-detail-map-foot a {
  color: var(--forest-2);
  font-weight: 650;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.live-detail-map-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 6px;
  min-height: 190px;
  padding: 18px;
  color: var(--muted);
  background:
    linear-gradient(135deg, rgba(125, 143, 133, 0.1) 25%, transparent 25%) 0 0 / 18px 18px,
    linear-gradient(315deg, rgba(125, 143, 133, 0.1) 25%, transparent 25%) 0 0 / 18px 18px,
    #eef1eb;
  border: 1px dashed var(--line);
  border-radius: 10px;
  font-size: 8.5px;
  line-height: 1.45;
  text-align: center;
}

.live-detail-map-empty .icon {
  width: 18px;
  height: 18px;
  color: #7f9087;
}

.live-detail-empty-copy {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 8px;
  line-height: 1.4;
}

@media (max-width: 900px) {
  .live-detail-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 12px;
  }

  .live-detail-map-frame {
    height: 200px;
  }
}

@media (max-width: 700px) {
  .live-expand-label {
    display: none;
  }

  .live-row-detail {
    padding: 11px;
  }

  .live-detail-head {
    flex-direction: column;
    gap: 7px;
  }

  .live-detail-head h3 {
    font-size: 14px;
  }

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

  .live-detail-stat.is-live strong {
    font-size: 16px;
  }

  .live-detail-map-frame,
  .live-detail-map-empty {
    height: 175px;
    min-height: 175px;
  }
}

.live-row {
  position: relative;
  display: grid;
  grid-template-columns: minmax(170px, 1.05fr) minmax(150px, 0.95fr) repeat(5, minmax(58px, 0.46fr)) auto;
  grid-template-areas: "person service entry exit elapsed extra pauses end";
  align-items: center;
  gap: 10px;
  padding: 11px 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
}

.live-row::before {
  content: "";
  position: absolute;
  top: 11px;
  bottom: 11px;
  left: 0;
  width: 2px;
  background: #c7cfca;
  border-radius: 0 2px 2px 0;
}

.live-row.status-active::before {
  background: var(--morning);
}

.live-row.status-paused::before {
  background: #a39475;
}

.live-row.status-auto::before {
  background: var(--danger);
}

.live-row.status-completed::before {
  background: #6f8b7c;
}

.live-person {
  grid-area: person;
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.live-person-avatar {
  width: 28px;
  height: 28px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  color: #3d5865;
  background: #e4eaeb;
  border-radius: 50%;
  font-size: 7.5px;
  font-weight: 760;
}

.live-person-copy {
  min-width: 0;
}

.live-person-copy strong {
  display: block;
  overflow: hidden;
  color: var(--ink);
  font-size: 10.5px;
  font-weight: 680;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.live-person-copy span {
  display: block;
  margin-top: 1px;
  overflow: hidden;
  color: var(--muted);
  font-size: 8px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.live-service {
  grid-area: service;
  min-width: 0;
}

.live-service strong {
  display: block;
  overflow: hidden;
  color: var(--ink-soft);
  font-size: 10px;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.live-service span {
  display: block;
  margin-top: 1px;
  color: var(--muted);
  font-size: 8px;
  line-height: 1.35;
}

.live-cell {
  grid-area: auto;
  min-width: 0;
}

.live-row .live-cell.live-cell-entry {
  grid-area: entry;
}

.live-row .live-cell.live-cell-exit {
  grid-area: exit;
}

.live-row .live-cell.live-cell-elapsed {
  grid-area: elapsed;
}

.live-row .live-cell.live-cell-extra {
  grid-area: extra;
}

.live-row .live-cell.live-cell-pauses {
  grid-area: pauses;
}

.live-cell-label {
  display: none;
  color: var(--muted);
  font-size: 7.5px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.live-cell strong {
  display: block;
  overflow: hidden;
  color: var(--ink-soft);
  font-size: 9.5px;
  font-weight: 660;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.live-cell span {
  display: block;
  margin-top: 1px;
  color: var(--muted);
  font-size: 8px;
  white-space: nowrap;
}

.live-cell.is-extra strong {
  color: var(--danger);
}

.live-row > .live-pauses {
  grid-column: 1 / -1;
  width: 100%;
  margin-top: 0;
}

.live-row-end {
  grid-area: end;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 5px;
}

.live-row-end .status-badge {
  max-width: 116px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.live-edit {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  padding: 0;
  color: #84908b;
  background: transparent;
  border: 0;
  border-radius: 6px;
  cursor: pointer;
}

.live-edit:hover {
  color: var(--forest);
  background: var(--surface-2);
}

.live-edit .icon {
  width: 13px;
  height: 13px;
}

.live-empty {
  padding: 34px 20px;
  text-align: center;
  background: var(--surface);
  border: 1px dashed var(--line);
  border-radius: 14px;
}

.live-empty .icon {
  width: 24px;
  height: 24px;
  margin: 0 auto 9px;
  color: #849891;
}

.live-empty h3 {
  margin: 0 0 4px;
  font-size: 13px;
  font-weight: 700;
}

.live-empty p {
  margin: 0;
  color: var(--muted);
  font-size: 10px;
}

/* =========================
   Diálogos operativos
   ========================= */

.modal-pause,
.modal-credentials {
  width: min(550px, calc(100vw - 30px));
}

.modal-location {
  width: min(650px, calc(100vw - 30px));
}

.modal-admin-time {
  width: min(560px, calc(100vw - 30px));
}

.modal-report {
  width: min(760px, calc(100vw - 30px));
}

.live-detail-head-actions {
  display: flex;
  align-items: center;
  gap: 7px;
  flex: 0 0 auto;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.live-admin-button {
  min-height: 27px;
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 8.5px;
}

.report-week-toolbar {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  padding: 10px;
  background: var(--surface-2);
  border: 1px solid var(--line-soft);
  border-radius: 11px;
}

.report-week-arrow {
  flex: 0 0 auto;
  width: 31px;
  height: 35px;
  color: var(--muted-strong);
  border: 1px solid var(--line);
}

.report-week-input {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.report-week-input span {
  color: var(--muted);
  font-size: 8px;
  font-weight: 650;
}

.report-week-input input {
  min-height: 35px;
  padding: 7px 8px;
  color: var(--ink-soft);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 7px;
  font: inherit;
  font-size: 10px;
}

.report-week-period {
  flex: 1 1 auto;
  min-width: 0;
  padding: 0 4px 3px;
}

.report-week-period strong {
  display: block;
  overflow: hidden;
  color: var(--ink-soft);
  font-size: 11px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.report-week-period span {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 8px;
}

.report-preview {
  margin-top: 12px;
  min-height: 120px;
}

.report-loading {
  padding: 28px 10px;
  color: var(--muted);
  font-size: 10px;
  text-align: center;
}

.report-kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
}

.report-kpi {
  padding: 9px;
  background: #f8f9f6;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
}

.report-kpi span {
  display: block;
  color: var(--muted);
  font-size: 7.5px;
  font-weight: 650;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.report-kpi strong {
  display: block;
  margin-top: 4px;
  color: var(--ink-soft);
  font-size: 18px;
  font-weight: 750;
  letter-spacing: -0.04em;
}

.report-kpi small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 7.5px;
}

.report-block {
  margin-top: 10px;
  padding: 10px;
  background: #fff;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
}

.report-block h4 {
  margin: 0 0 6px;
  color: var(--ink-soft);
  font-size: 9.5px;
  font-weight: 700;
}

.report-lines {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px 14px;
}

.report-line {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  padding: 3px 0;
  border-bottom: 1px dashed var(--line-soft);
  font-size: 8.5px;
}

.report-line span {
  color: var(--muted);
}

.report-line strong {
  color: var(--ink-soft);
  font-weight: 650;
  text-align: right;
}

.report-warning {
  margin: 10px 0 0;
  padding: 7px 8px;
  color: #7e463b;
  background: var(--danger-soft);
  border: 1px solid #e8ccc6;
  border-radius: 7px;
  font-size: 8.5px;
  line-height: 1.45;
}

.report-hint {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 8px;
  line-height: 1.45;
}

.report-footer {
  justify-content: space-between;
}

.report-export-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.report-export-actions .btn {
  font-size: 9px;
}

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

  .report-lines {
    grid-template-columns: 1fr;
  }

  .report-week-toolbar {
    flex-wrap: wrap;
  }

  .report-week-period {
    flex-basis: 100%;
    order: 5;
    padding-top: 4px;
  }

  .report-footer {
    flex-direction: column-reverse;
    align-items: stretch;
  }

  .report-export-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }
}

.admin-time-target {
  margin: 0 0 12px;
  padding: 9px 10px;
  color: var(--muted);
  background: var(--surface-2);
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  font-size: 9.5px;
  line-height: 1.45;
}

.admin-time-target strong {
  color: var(--ink-soft);
  font-weight: 680;
}

.admin-time-correction {
  margin-bottom: 10px;
}

#admin-time-action {
  width: 100%;
  padding: 8px 9px;
  color: var(--ink-soft);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  font: inherit;
  font-size: 11px;
}

.location-intro {
  margin: 0 0 10px;
  color: var(--muted-strong);
  font-size: 10px;
  line-height: 1.5;
}

.location-adjust-map {
  position: relative;
  height: 300px;
  overflow: hidden;
  background:
    linear-gradient(135deg, rgba(125, 143, 133, 0.12) 25%, transparent 25%) 0 0 / 18px 18px,
    linear-gradient(315deg, rgba(125, 143, 133, 0.12) 25%, transparent 25%) 0 0 / 18px 18px,
    #eef1eb;
  border: 1px solid var(--line);
  border-radius: 11px;
}

.location-adjust-readout {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 5px 12px;
  margin-top: 7px;
  color: var(--muted-strong);
  font-size: 8.5px;
  font-variant-numeric: tabular-nums;
}

.location-adjust-readout span:last-child {
  color: var(--muted);
}

#location-adjust-status {
  margin-top: 6px;
}

#location-adjust-status.is-success {
  color: #4f705d;
}

#location-adjust-status.is-error {
  color: var(--danger);
}

.location-adjust-footer {
  flex-wrap: wrap;
}

.location-adjust-footer .btn:first-child {
  margin-right: auto;
}

.geo-line-actions {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-left: auto;
}

.geo-adjust-button {
  padding: 2px 6px;
  color: var(--muted-strong);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 999px;
  font: inherit;
  font-size: 7.5px;
  font-weight: 650;
  cursor: pointer;
  white-space: nowrap;
}

.geo-adjust-button:hover {
  color: var(--forest);
  background: #f3f6f2;
}

@media (max-width: 700px) {
  .location-adjust-map {
    height: 250px;
  }

  .location-adjust-footer {
    gap: 6px;
  }

  .location-adjust-footer .btn {
    flex: 1 1 auto;
  }

  .location-adjust-footer .btn:first-child {
    margin-right: 0;
    flex-basis: 100%;
  }
}

.pause-target,
.credentials-intro,
.first-password-intro {
  margin: 0 0 15px;
  padding: 10px 11px;
  color: var(--muted);
  background: var(--surface-2);
  border: 1px solid var(--line-soft);
  border-radius: 9px;
  font-size: 10.5px;
  line-height: 1.5;
}

.first-password-intro {
  color: #5f6b64;
  background: #f1f4f1;
  border-color: #dfe5e0;
}

.pause-target strong {
  color: var(--ink-soft);
  font-weight: 680;
}

.pause-quick-reasons {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 7px;
}

.pause-quick-reasons button {
  padding: 4px 8px;
  color: var(--muted-strong);
  background: var(--surface-2);
  border: 1px solid var(--line-soft);
  border-radius: 999px;
  font-size: 8.5px;
  cursor: pointer;
}

.pause-quick-reasons button:hover {
  color: var(--forest);
  background: #edf1ee;
}

.credentials-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.credential-row {
  display: grid;
  grid-template-columns: minmax(120px, 1fr) minmax(110px, 0.8fr) minmax(140px, 1fr);
  gap: 10px;
  align-items: center;
  padding: 9px 10px;
  background: var(--surface-2);
  border: 1px solid var(--line-soft);
  border-radius: 8px;
}

.credential-row span {
  display: block;
  margin-bottom: 1px;
  color: var(--muted);
  font-size: 7.5px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.credential-row strong {
  display: block;
  overflow: hidden;
  color: var(--ink-soft);
  font-size: 10.5px;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.credential-row code {
  padding: 2px 5px;
  color: #455c66;
  background: #e7ece9;
  border-radius: 4px;
  font-family: var(--font-sans);
  font-size: 9.5px;
}

.confirm-icon.is-primary {
  color: var(--forest-2);
  background: #e9efeb;
  border-color: #d6e0d9;
}

/* =========================
   Modales
   ========================= */

.modal {
  width: min(720px, calc(100vw - 30px));
  max-width: none;
  max-height: calc(100dvh - 24px);
  margin: auto;
  padding: 0;
  color: var(--ink);
  background: transparent;
  border: 0;
  overflow: visible;
}

.modal::backdrop {
  background: rgba(14, 21, 25, 0.58);
  backdrop-filter: blur(4px);
}

.modal[open] {
  animation: modal-in 0.22s cubic-bezier(0.2, 0.75, 0.3, 1) both;
}

.modal-service {
  width: min(940px, calc(100vw - 30px));
}

.modal-share {
  width: min(680px, calc(100vw - 30px));
}

.modal-confirm {
  width: min(430px, calc(100vw - 30px));
}

.modal-shell {
  position: relative;
  display: flex;
  flex-direction: column;
  max-height: calc(100dvh - 24px);
  overflow: hidden;
  background: var(--surface);
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 24px;
  box-shadow: var(--shadow-float);
}

.modal-head {
  flex: 0 0 auto;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 23px 17px;
  border-bottom: 1px solid var(--line-soft);
}

.modal-head h2 {
  margin: 0;
  font-size: 21px;
  font-weight: 750;
  letter-spacing: -0.04em;
  line-height: 1.2;
}

.modal-head .eyebrow {
  margin-bottom: 5px;
}

.modal-head > .icon-button {
  margin-top: -3px;
}

.modal-title-group {
  display: flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
}

.modal-icon {
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border-radius: 12px;
}

.modal-icon.whatsapp {
  color: var(--whatsapp-dark);
  background: #e8efeb;
}

.modal-icon .icon {
  width: 23px;
  height: 23px;
}

.modal form {
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.modal-body {
  flex: 1 1 auto;
  min-height: 0;
  padding: 21px 23px 24px;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: #d6cfc1 transparent;
}

.modal-body::-webkit-scrollbar {
  width: 6px;
}

.modal-body::-webkit-scrollbar-thumb {
  background: #d6cfc1;
  border-radius: 99px;
}

.modal-footer {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  padding: 14px 23px;
  background: rgba(248, 248, 245, 0.94);
  border-top: 1px solid var(--line-soft);
}

.modal-footer-center {
  justify-content: center;
}

/* Formulario */

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 15px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.field-full {
  grid-column: 1 / -1;
}

.field-label {
  display: flex;
  align-items: center;
  gap: 5px;
  color: var(--ink-soft);
  font-size: 11.5px;
  font-weight: 680;
  line-height: 1.3;
}

.field-label em {
  color: #9b5d49;
  font-style: normal;
}

.optional {
  margin-left: 1px;
  padding: 1px 5px;
  color: #8c948d;
  background: var(--surface-2);
  border: 1px solid var(--line-soft);
  border-radius: 4px;
  font-size: 8.5px;
  font-weight: 650;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.field input,
.field textarea,
.field select,
.agent-entry input {
  width: 100%;
  min-height: 41px;
  padding: 9px 11px;
  color: var(--ink);
  background: #fff;
  border: 1px solid #dcd5c8;
  border-radius: 10px;
  font-size: 12.5px;
  line-height: 1.4;
  outline: none;
  transition:
    border-color 0.15s ease,
    box-shadow 0.15s ease,
    background-color 0.15s ease;
}

.field textarea {
  min-height: 78px;
  resize: vertical;
}

.field input::placeholder,
.field textarea::placeholder,
.agent-entry input::placeholder {
  color: #a1a69d;
}

.field input:hover,
.field textarea:hover,
.agent-entry input:hover {
  border-color: #cbc3b5;
}

.field input:focus,
.field textarea:focus,
.field select:focus,
.agent-entry input:focus {
  border-color: var(--forest-3);
  box-shadow: 0 0 0 3px rgba(74, 101, 115, 0.11);
}

.field input[type="date"],
.field input[type="time"] {
  color-scheme: light;
}

.field input.is-invalid,
.field textarea.is-invalid,
.agent-entry input.is-invalid {
  border-color: #c36157;
  box-shadow: 0 0 0 3px rgba(178, 65, 55, 0.08);
}

.agent-picker.has-error,
.shift-card.has-error {
  border-color: #d59e97;
  box-shadow: 0 0 0 3px rgba(178, 65, 55, 0.06);
}

.field-error {
  color: var(--danger);
  font-size: 10px;
  line-height: 1.4;
}

.field-hint {
  margin: 0;
  color: #8b938c;
  font-size: 9.5px;
  line-height: 1.45;
}

.form-section + .field {
  margin-top: 17px;
}

.form-errors {
  margin-bottom: 16px;
  padding: 10px 12px;
  color: #8d342c;
  background: var(--danger-soft);
  border: 1px solid #ecc8c3;
  border-radius: 10px;
  font-size: 11.5px;
}

.form-errors p {
  margin: 0 0 4px;
  font-weight: 700;
}

.form-errors ul {
  margin: 0;
  padding-left: 16px;
}

.form-errors li + li {
  margin-top: 2px;
}

.form-section {
  margin-top: 22px;
  padding-top: 20px;
  border-top: 1px solid var(--line-soft);
}

.section-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 11px;
}

.section-heading h3 {
  margin: 0 0 2px;
  font-size: 13px;
  font-weight: 730;
  letter-spacing: -0.015em;
}

.req-mark {
  color: #9b5d49;
  font-weight: 700;
}

.section-heading p {
  margin: 0;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.45;
}

.total-pill {
  flex: 0 0 auto;
  padding: 4px 8px;
  color: #536268;
  background: #eef0ed;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 9.5px;
  font-weight: 680;
  white-space: nowrap;
}

.total-pill-neutral {
  color: var(--muted-strong);
  background: var(--surface-2);
  border-color: var(--line-soft);
}

.shift-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.shift-card {
  min-width: 0;
  padding: 12px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 13px;
  transition:
    background-color 0.16s ease,
    border-color 0.16s ease;
}

.shift-card.is-disabled {
  background: #fafbf8;
  border-color: var(--line-soft);
}

.shift-card.is-disabled .shift-card-copy,
.shift-card.is-disabled .shift-icon,
.shift-card.is-disabled .shift-times,
.shift-card.is-disabled .shift-duration {
  opacity: 0.42;
}

.shift-card-head {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.shift-icon {
  width: 29px;
  height: 29px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  color: var(--morning);
  background: var(--morning-soft);
  border-radius: 8px;
}

.shift-afternoon .shift-icon {
  color: var(--afternoon);
  background: var(--afternoon-soft);
}

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

.shift-card-copy {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  min-width: 0;
  line-height: 1.3;
}

.shift-card-copy strong {
  font-size: 11.5px;
  font-weight: 700;
}

.shift-card-copy span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 8.5px;
}

.switch {
  position: relative;
  flex: 0 0 auto;
  display: inline-flex;
  padding: 2px 0;
}

.switch input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.switch-track {
  position: relative;
  width: 34px;
  height: 19px;
  background: #dad5c9;
  border-radius: 999px;
  transition: background-color 0.16s ease;
}

.switch-track::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 13px;
  height: 13px;
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(23, 37, 30, 0.25);
  transition: transform 0.16s ease;
}

.switch input:checked + .switch-track {
  background: var(--forest-2);
}

.switch input:checked + .switch-track::after {
  transform: translateX(15px);
}

.switch input:focus-visible + .switch-track {
  outline: 2px solid var(--forest-3);
  outline-offset: 2px;
}

.shift-times {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: end;
  gap: 5px;
  margin-top: 11px;
}

.time-field {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.time-field span {
  color: #8b938c;
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.time-field input {
  width: 100%;
  min-height: 32px;
  padding: 5px 6px;
  color: var(--ink-soft);
  background: #fff;
  border: 1px solid #ded7ca;
  border-radius: 7px;
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  outline: none;
}

.time-field input:focus {
  border-color: var(--forest-3);
  box-shadow: 0 0 0 2px rgba(74, 101, 115, 0.1);
}

.time-arrow {
  padding-bottom: 8px;
  color: #a5aaa2;
  font-size: 11px;
}

.shift-overnight-hint {
  margin-top: 8px;
}

.shift-duration {
  display: block;
  margin-top: 7px;
  color: #8b938c;
  font-size: 8.5px;
  font-weight: 600;
}

.agent-picker {
  padding: 10px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 13px;
}

.agent-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.agent-chips:not(:empty) {
  margin-bottom: 8px;
}

.agent-empty {
  display: block;
  padding: 4px 2px 7px;
  color: #969d96;
  font-size: 10px;
  font-style: italic;
}

.agent-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  max-width: 100%;
  padding: 3px 4px 3px 3px;
  color: var(--ink-soft);
  background: #f0f2f1;
  border: 1px solid #dee3e1;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 600;
}

.agent-chip-avatar {
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  color: #fff;
  background: var(--forest-2);
  border-radius: 50%;
  font-size: 7px;
  font-weight: 750;
}

.agent-chip > span:not(.agent-chip-avatar) {
  max-width: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.agent-chip-remove {
  width: 17px;
  height: 17px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  padding: 0;
  color: #7e8a80;
  background: transparent;
  border: 0;
  border-radius: 50%;
  cursor: pointer;
}

.agent-chip-remove:hover {
  color: var(--danger);
  background: #fff;
}

.agent-chip-remove .icon {
  width: 11px;
  height: 11px;
}

.agent-entry {
  display: flex;
  gap: 6px;
}

.agent-entry input {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 36px;
  padding: 7px 9px;
  font-size: 11.5px;
  border-radius: 8px;
}

.agent-entry .btn {
  flex: 0 0 auto;
  min-height: 36px;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 10.5px;
}

.agent-suggestions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
  margin-top: 7px;
}

.agent-suggestions:empty {
  display: none;
}

.suggestion-label {
  color: #949a93;
  font-size: 8.5px;
}

.agent-suggestion {
  padding: 3px 7px;
  color: var(--muted-strong);
  background: var(--surface-2);
  border: 1px solid var(--line-soft);
  border-radius: 999px;
  font-size: 9px;
  cursor: pointer;
  transition:
    color 0.14s ease,
    background-color 0.14s ease;
}

.agent-suggestion:hover {
  color: var(--forest);
  background: #edf0ef;
}

#agent-picker .field-hint {
  margin-top: 7px;
}

/* Compartir */

.share-scope {
  margin: 0 0 17px;
  padding: 0;
  border: 0;
}

.share-scope legend {
  margin-bottom: 7px;
  color: var(--ink-soft);
  font-size: 11.5px;
  font-weight: 680;
}

.segmented {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  padding: 4px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 12px;
}

.segmented label {
  position: relative;
  min-width: 0;
}

.segmented input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.segmented span {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 10px;
  color: var(--muted);
  border: 1px solid transparent;
  border-radius: 8px;
  font-size: 11.5px;
  font-weight: 620;
  line-height: 1.3;
  transition:
    background-color 0.15s ease,
    color 0.15s ease,
    box-shadow 0.15s ease;
}

.segmented em {
  flex: 0 0 auto;
  min-width: 19px;
  padding: 1px 5px;
  color: #8a938c;
  background: rgba(255, 255, 255, 0.7);
  border-radius: 999px;
  font-size: 9px;
  font-style: normal;
  font-weight: 700;
  text-align: center;
}

.segmented input:checked + span {
  color: var(--ink);
  background: #fff;
  border-color: var(--line-soft);
  box-shadow: 0 2px 7px -4px rgba(23, 37, 30, 0.25);
}

.segmented input:checked + span em {
  color: var(--forest);
  background: #edf0ee;
}

.segmented input:focus-visible + span {
  outline: 2px solid var(--forest-3);
  outline-offset: 1px;
}

#share-phone {
  text-transform: none;
}

.preview-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin: 18px 0 7px;
  color: var(--ink-soft);
  font-size: 11.5px;
  font-weight: 680;
}

.preview-hint {
  color: #8a938c;
  font-size: 9px;
  font-weight: 500;
}

.whatsapp-preview {
  max-height: 262px;
  padding: 12px 13px;
  overflow-y: auto;
  background:
    radial-gradient(circle at 20% 20%, rgba(255, 255, 255, 0.4) 0 1px, transparent 1.5px),
    radial-gradient(circle at 70% 60%, rgba(255, 255, 255, 0.32) 0 1px, transparent 1.5px),
    #e6e9e5;
  background-size: 26px 26px, 33px 33px, auto;
  border: 1px solid #d3d9d4;
  border-radius: 14px;
  scrollbar-width: thin;
  scrollbar-color: #c6beb0 transparent;
}

.wa-bubble {
  position: relative;
  max-width: 100%;
  padding: 11px 13px;
  background: #fff;
  border-radius: 10px 10px 10px 3px;
  box-shadow: 0 1px 2px rgba(23, 37, 30, 0.12);
}

.wa-bubble pre {
  margin: 0;
  color: #29343a;
  font-family: var(--font-sans);
  font-size: 11px;
  line-height: 1.55;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.share-link-panel {
  margin: 0 0 17px;
  padding: 12px;
  background: #f6f7f4;
  border: 1px solid var(--line);
  border-radius: 12px;
}

.share-link-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 9px;
}

.share-link-heading h3 {
  margin: 0 0 3px;
  color: var(--ink-soft);
  font-size: 11px;
  font-weight: 700;
}

.share-link-heading p {
  margin: 0;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.45;
}

.share-link-badge {
  flex: 0 0 auto;
  padding: 3px 7px;
  color: var(--muted-strong);
  background: #fff;
  border: 1px solid var(--line-soft);
  border-radius: 999px;
  font-size: 7.5px;
  font-weight: 650;
  white-space: nowrap;
}

.share-link-badge.is-ready {
  color: #476257;
  background: #e9f0eb;
  border-color: #d3e1d7;
}

.share-link-badge.is-error {
  color: #7e463b;
  background: var(--danger-soft);
  border-color: #e8ccc6;
}

.share-link-panel .field {
  margin-bottom: 8px;
}

.share-link-create-row {
  display: flex;
  align-items: center;
  gap: 9px;
  flex-wrap: wrap;
}

.share-link-create-row .field-hint {
  flex: 1 1 220px;
  margin: 0;
}

.share-link-result {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--line-soft);
}

.share-link-url-row {
  display: flex;
  gap: 5px;
  align-items: center;
}

.share-link-url-row input {
  flex: 1 1 auto;
  min-width: 0;
  padding: 7px 8px;
  color: var(--ink-soft);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 7px;
  font: inherit;
  font-size: 9px;
}

.share-link-url-row .btn {
  min-height: 30px;
  padding: 5px 8px;
  font-size: 8.5px;
}

.share-link-metrics {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 8px;
}

.share-link-metric {
  padding: 3px 6px;
  color: var(--muted-strong);
  background: #fff;
  border: 1px solid var(--line-soft);
  border-radius: 999px;
  font-size: 7.5px;
}

.share-link-metric strong {
  color: var(--ink-soft);
  font-weight: 700;
}

.share-link-agent-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-height: 170px;
  margin-top: 8px;
  overflow-y: auto;
}

.share-link-agent {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 5px 7px;
  background: #fff;
  border: 1px solid var(--line-soft);
  border-radius: 6px;
  font-size: 8.5px;
}

.share-link-agent span {
  min-width: 0;
  overflow: hidden;
  color: var(--ink-soft);
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.share-link-agent small {
  color: var(--muted);
  font-size: 7.5px;
}

.share-link-agent .is-confirmed {
  color: #476257;
}

.share-link-agent .is-pending {
  color: var(--muted);
}

.share-link-status {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 8.5px;
  line-height: 1.4;
}

.share-link-status.is-error {
  color: var(--danger);
}

.share-warning {
  margin: 10px 0 0;
  padding: 9px 10px;
  color: #8d342c;
  background: var(--danger-soft);
  border: 1px solid #ecc8c3;
  border-radius: 8px;
  font-size: 10.5px;
  line-height: 1.45;
}

.share-warning[hidden] {
  display: none;
}

#btn-copy-message {
  margin-right: auto;
}

/* Confirmación */

.confirm-body {
  padding: 27px 26px 17px;
  text-align: center;
}

.confirm-icon {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  margin: 0 auto 13px;
  color: var(--danger);
  background: var(--danger-soft);
  border: 1px solid #efd2ce;
  border-radius: 14px;
}

.confirm-icon .icon {
  width: 21px;
  height: 21px;
}

.confirm-body h2 {
  margin: 0 0 6px;
  font-size: 19px;
  font-weight: 740;
  letter-spacing: -0.035em;
}

.confirm-body p {
  max-width: 320px;
  margin: 0 auto;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.modal-confirm .modal-footer {
  justify-content: center;
  padding-bottom: 19px;
  background: transparent;
  border-top: 0;
}

/* =========================
   Administración de usuarios
   ========================= */

.modal-users {
  width: min(700px, calc(100vw - 30px));
}

.modal-password {
  width: min(520px, calc(100vw - 30px));
}

.modal-icon.neutral {
  color: #4b6673;
  background: #e9edee;
}

.users-summary {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 16px;
  margin-bottom: 12px;
  padding: 9px 11px;
  color: var(--muted);
  background: var(--surface-2);
  border: 1px solid var(--line-soft);
  border-radius: 9px;
  font-size: 10px;
}

.users-summary strong {
  color: var(--ink-soft);
  font-weight: 700;
}

.users-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.user-row {
  display: grid;
  grid-template-columns: 33px minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  background: #fff;
  border: 1px solid var(--line-soft);
  border-radius: 10px;
}

.user-avatar {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  color: #3c5866;
  background: #e7ecec;
  border-radius: 50%;
  font-size: 8px;
  font-weight: 760;
}

.user-identity {
  display: flex;
  flex-direction: column;
  min-width: 0;
  line-height: 1.3;
}

.user-identity strong {
  overflow: hidden;
  color: var(--ink);
  font-size: 11.5px;
  font-weight: 680;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-identity span {
  overflow: hidden;
  margin-top: 1px;
  color: var(--muted);
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-badges {
  display: flex;
  align-items: center;
  gap: 5px;
}

.role-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 7px;
  color: #4a626c;
  background: #e9eeee;
  border-radius: 999px;
  font-size: 8.5px;
  font-weight: 700;
  white-space: nowrap;
}

.role-badge.admin {
  color: #f1f2ef;
  background: #273942;
}

.you-badge {
  padding: 2px 5px;
  color: #6b7b7e;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 8px;
  font-weight: 650;
}

.pending-badge {
  padding: 2px 6px;
  color: #755c2d;
  background: #f3ecdf;
  border: 1px solid #e2d5bd;
  border-radius: 999px;
  font-size: 7.5px;
  font-weight: 650;
  white-space: nowrap;
}

.temp-password {
  display: block;
  margin-top: 2px;
  color: #877047 !important;
  font-size: 8px !important;
  font-variant-numeric: tabular-nums;
}

.user-identity span.temp-password {
  overflow: visible;
  white-space: normal;
}

.user-row-actions {
  display: flex;
  align-items: center;
  gap: 1px;
}

.user-action {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  padding: 0;
  color: #7f8d90;
  background: transparent;
  border: 0;
  border-radius: 6px;
  cursor: pointer;
}

.user-action .icon {
  width: 14px;
  height: 14px;
}

.user-action:hover {
  color: var(--forest);
  background: var(--surface-2);
}

.user-action.is-danger:hover {
  color: var(--danger);
  background: var(--danger-soft);
}

.user-action:disabled {
  opacity: 0.25;
  cursor: not-allowed;
}

.user-action:disabled:hover {
  color: #7f8d90;
  background: transparent;
}

.create-user-section {
  margin-top: 21px;
  padding-top: 19px;
  border-top: 1px solid var(--line-soft);
}

.user-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.user-form-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-top: 12px;
}

.user-form-footer p {
  margin: 0;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.45;
}

.user-form-footer .btn {
  flex: 0 0 auto;
  min-height: 36px;
  padding: 8px 13px;
  border-radius: 8px;
  font-size: 10.5px;
}

.password-target {
  margin: 0 0 15px;
  padding: 10px 12px;
  color: var(--muted);
  background: var(--surface-2);
  border: 1px solid var(--line-soft);
  border-radius: 9px;
  font-size: 10.5px;
  line-height: 1.45;
}

.password-target strong {
  color: var(--ink-soft);
  font-weight: 680;
}

.password-target span {
  color: var(--muted);
}

.password-hint {
  margin-top: 10px;
}

/* =========================
   Toast
   ========================= */

.toast {
  position: fixed;
  bottom: 22px;
  left: 50%;
  z-index: 3000;
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: calc(100vw - 32px);
  padding: 9px 14px 9px 9px;
  color: #fff;
  background: #24333b;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 999px;
  box-shadow: 0 14px 34px -14px rgba(12, 20, 25, 0.6);
  font-size: 11.5px;
  font-weight: 600;
  transform: translateX(-50%);
  animation: toast-in 0.22s ease both;
}

.toast.is-error {
  background: #7e2f28;
}

.toast.is-in-dialog {
  position: absolute;
  right: auto;
  bottom: 74px;
  z-index: 20;
  width: max-content;
}

.toast-icon {
  width: 22px;
  height: 22px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  color: #24333b;
  background: #d9d5ca;
  border-radius: 50%;
}

.toast.is-error .toast-icon {
  color: #7e2f28;
  background: #f0c3be;
}

.toast-icon .icon {
  width: 13px;
  height: 13px;
}

/* =========================
   Animaciones
   ========================= */

@keyframes page-in {
  from {
    opacity: 0;
    transform: translateY(7px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes modal-in {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translate(-50%, 8px);
  }
  to {
    opacity: 1;
    transform: translate(-50%, 0);
  }
}

@keyframes account-menu-in {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes boot-spin {
  to {
    transform: rotate(360deg);
  }
}

/* =========================
   Responsive
   ========================= */

@media (max-width: 1200px) {
  .workspace {
    grid-template-columns: minmax(0, 1fr) 344px;
  }

  .calendar-grid {
    grid-auto-rows: minmax(96px, 1fr);
  }

  .day-cell {
    min-height: 96px;
  }

  .overview {
    gap: 24px;
  }
}

@media (max-width: 1020px) {
  .workspace {
    grid-template-columns: minmax(0, 1fr);
  }

  .day-panel {
    position: static;
    max-height: none;
  }

  .day-services {
    overflow: visible;
    max-height: none;
  }

  .day-services .empty-state {
    min-height: 130px;
  }

  .calendar-grid {
    grid-auto-rows: minmax(100px, 1fr);
  }

  .day-cell {
    min-height: 100px;
  }

  .day-panel {
    padding: 20px;
  }

  .day-tip {
    margin-top: 13px;
  }
}

@media (max-width: 880px) {
  .topbar-inner {
    padding: 0 20px;
  }

  .page {
    padding: 26px 20px 18px;
  }

  .overview {
    align-items: stretch;
    flex-direction: column;
    gap: 18px;
  }

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

  .stat-card {
    min-width: 0;
  }

  .overview h1 {
    font-size: clamp(2rem, 6vw, 2.6rem);
  }
}

@media (max-width: 700px) {
  .topbar-inner {
    min-height: 66px;
    padding: 0 14px;
    gap: 10px;
  }

  .brand-mark {
    width: 36px;
    height: 36px;
    border-radius: 11px;
  }

  .brand-mark svg {
    width: 22px;
    height: 22px;
  }

  .brand-copy strong {
    font-size: 17px;
  }

  .brand-copy span {
    display: none;
  }

  .topbar-actions {
    gap: 6px;
  }

  .topbar-actions .btn {
    min-height: 36px;
    padding: 8px 11px;
    font-size: 11px;
  }

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

  #btn-share .btn-label,
  #btn-weekly-report .btn-label {
    display: none;
  }

  #btn-weekly-report {
    width: 36px;
    padding: 0;
    justify-content: center;
  }

  #btn-share {
    width: 36px;
    padding: 0;
    border-radius: 50%;
  }

  #btn-new {
    gap: 5px;
  }

  .page {
    padding: 22px 13px 16px;
  }

  .overview {
    margin-bottom: 18px;
  }

  .page-subtitle {
    font-size: 12.5px;
  }

  .stats {
    gap: 6px;
  }

  .stat-card {
    padding: 10px 11px;
    border-radius: 12px;
  }

  .stat-label {
    gap: 4px;
    margin-bottom: 3px;
    font-size: 8.5px;
    letter-spacing: 0;
  }

  .stat-label .icon {
    width: 12px;
    height: 12px;
  }

  .stat-value-row {
    display: block;
  }

  .stat-value-row strong {
    display: block;
    font-size: 22px;
  }

  .stat-value-row span {
    display: none;
  }

  .demo-banner {
    align-items: flex-start;
    flex-direction: column;
    gap: 7px;
    padding: 10px 12px;
  }

  .demo-banner-copy {
    align-items: flex-start;
    gap: 7px;
  }

  .demo-banner-copy p {
    font-size: 11px;
  }

  .demo-badge {
    margin-top: 1px;
  }

  .calendar-panel {
    padding: 14px 11px 10px;
    border-radius: 17px;
  }

  .calendar-toolbar {
    flex-wrap: wrap;
    gap: 9px;
    margin-bottom: 12px;
    padding: 0 1px;
  }

  .month-switcher {
    flex: 1 1 auto;
  }

  .month-switcher h2 {
    min-width: 0;
    flex: 1 1 auto;
    margin: 0 4px;
    font-size: 17px;
    text-align: left;
  }

  .calendar-toolbar .icon-button {
    width: 31px;
    height: 31px;
  }

  .btn-today {
    min-height: 29px;
    margin-left: 4px;
    padding: 5px 9px;
    font-size: 10.5px;
  }

  .legend {
    gap: 9px;
    padding-left: 2px;
    font-size: 9.5px;
  }

  .weekdays {
    gap: 4px;
    margin-bottom: 4px;
  }

  .weekdays span {
    padding-left: 5px;
    font-size: 8px;
  }

  .calendar-grid {
    grid-auto-rows: minmax(75px, 1fr);
    gap: 4px;
  }

  .day-cell {
    min-height: 75px;
    padding: 5px 5px 4px;
    border-radius: 8px;
  }

  .day-number {
    width: 21px;
    height: 21px;
    font-size: 10px;
  }

  .day-mini-list {
    display: none;
  }

  .mobile-day-summary {
    display: flex;
    flex-wrap: wrap;
    align-content: flex-start;
    gap: 3px;
    min-height: 9px;
    padding: 1px 2px;
  }

  .mobile-service-dot {
    width: 6px;
    height: 6px;
    background: var(--morning);
    border-radius: 50%;
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.7);
  }

  .mobile-service-dot.afternoon {
    background: var(--afternoon);
  }

  .mobile-service-dot.both {
    background: linear-gradient(90deg, var(--morning) 50%, var(--afternoon) 50%);
  }

  .calendar-caption {
    justify-content: flex-end;
    margin-top: 9px;
    padding-top: 9px;
    font-size: 9.5px;
  }

  .calendar-caption > span:first-child {
    display: none;
  }

  .day-panel {
    padding: 16px 14px 13px;
    border-radius: 17px;
  }

  .day-panel-head h2 {
    font-size: 19px;
  }

  .day-services {
    padding: 12px 0 8px;
  }

  .service-card {
    padding: 12px 12px 12px 14px;
  }

  .service-card h3 {
    font-size: 13.5px;
  }

  .day-tip {
    display: none;
  }

  .page-footer {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
    padding-top: 14px;
  }

  .footer-brand {
    display: none !important;
  }

  .modal {
    width: calc(100vw - 16px);
    max-height: calc(100dvh - 16px);
  }

  .modal-shell {
    max-height: calc(100dvh - 16px);
    border-radius: 18px;
  }

  .modal-head {
    padding: 16px 17px 14px;
  }

  .modal-head h2 {
    font-size: 18px;
  }

  .modal-body {
    padding: 17px;
  }

  .modal-footer {
    padding: 12px 15px;
    gap: 6px;
  }

  .modal-footer .btn {
    min-height: 38px;
    padding: 9px 13px;
  }

  .form-grid {
    grid-template-columns: 1fr;
    gap: 13px;
  }

  .field-full {
    grid-column: auto;
  }

  .form-section {
    margin-top: 19px;
    padding-top: 17px;
  }

  .section-heading {
    gap: 8px;
  }

  .section-heading p {
    font-size: 9.5px;
  }

  .total-pill {
    padding: 3px 7px;
    font-size: 8.5px;
  }

  .shift-grid {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .shift-card {
    padding: 11px;
  }

  .shift-card-copy span {
    font-size: 8px;
  }

  .agent-entry .btn {
    padding: 7px 10px;
  }

  .preview-heading {
    margin-top: 15px;
  }

  .whatsapp-preview {
    max-height: 210px;
  }

  .modal-title-group {
    gap: 8px;
  }

  .modal-icon {
    width: 37px;
    height: 37px;
    border-radius: 10px;
  }

  .modal-icon .icon {
    width: 20px;
    height: 20px;
  }

  .modal-share .modal-footer {
    flex-wrap: wrap;
  }

  #btn-copy-message {
    margin-right: 0;
  }

  .modal-share .modal-footer .btn {
    flex: 1 1 140px;
  }

  .confirm-body {
    padding: 24px 20px 14px;
  }
}

@media (max-width: 420px) {
  .topbar-actions .btn {
    font-size: 10.5px;
    padding: 8px 10px;
  }

  #btn-new {
    padding-left: 9px;
  }

  .page {
    padding-right: 10px;
    padding-left: 10px;
  }

  .calendar-panel {
    padding-right: 8px;
    padding-left: 8px;
  }

  .day-cell {
    min-height: 68px;
  }

  .calendar-grid {
    grid-auto-rows: minmax(68px, 1fr);
  }

  .weekdays span {
    font-size: 7.5px;
  }

  .legend {
    display: none;
  }

  .month-switcher h2 {
    font-size: 16px;
  }

  .segmented span {
    padding: 8px;
    font-size: 10.5px;
  }
}


/* =========================
   Responsive de acceso y usuarios
   ========================= */

@media (max-width: 1060px) {
  .auth-screen {
    grid-template-columns: minmax(0, 1fr) minmax(410px, 0.9fr);
  }

  .auth-brand-panel {
    padding-right: 38px;
    padding-left: 38px;
  }

  .auth-brand-body h1 {
    font-size: clamp(2.35rem, 4vw, 3.1rem);
  }

  .auth-form-panel {
    padding-right: 22px;
    padding-left: 22px;
  }
}

@media (max-width: 900px) {
  .auth-screen {
    display: block;
    min-height: 100dvh;
  }

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

  .auth-form-panel {
    min-height: 100dvh;
    padding: 20px 16px;
  }

  .auth-card {
    padding: 27px 27px 23px;
  }

  .auth-mobile-brand {
    display: flex;
    align-items: center;
    gap: 9px;
    margin-bottom: 28px;
  }

  .auth-mobile-brand .brand-mark {
    width: 37px;
    height: 37px;
    border-radius: 11px;
  }

  .auth-mobile-brand .brand-mark svg {
    width: 22px;
    height: 22px;
  }

  .auth-mobile-brand > span:last-child {
    display: flex;
    flex-direction: column;
    line-height: 1.15;
  }

  .auth-mobile-brand strong {
    font-size: 17px;
    font-weight: 750;
    letter-spacing: 0.03em;
  }

  .auth-mobile-brand small {
    margin-top: 3px;
    color: var(--muted);
    font-size: 8px;
    font-weight: 650;
    letter-spacing: 0.11em;
    text-transform: uppercase;
  }
}

@media (max-width: 760px) {
  .account-copy,
  .account-chevron {
    display: none;
  }

  .account-trigger {
    width: 36px;
    height: 36px;
    min-height: 36px;
    justify-content: center;
    padding: 0;
    border-radius: 50%;
  }

  .account-avatar {
    width: 30px;
    height: 30px;
  }

  .account-menu {
    width: 224px;
  }
}

@media (max-width: 620px) {
  .user-row {
    grid-template-columns: 32px minmax(0, 1fr) auto;
    row-gap: 5px;
    padding: 9px;
  }

  .user-avatar {
    grid-row: 1 / 3;
  }

  .user-badges {
    grid-column: 2;
    grid-row: 2;
    justify-content: flex-start;
  }

  .user-row-actions {
    grid-column: 3;
    grid-row: 1 / 3;
  }

  .user-form-grid {
    grid-template-columns: 1fr;
    gap: 11px;
  }

  .user-form-footer {
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
  }

  .user-form-footer .btn {
    width: 100%;
  }

  .modal-users .modal-footer {
    justify-content: stretch;
  }

  .modal-users .modal-footer .btn {
    width: 100%;
  }
}

@media (max-width: 420px) {
  .auth-form-panel {
    padding: 10px;
  }

  .auth-card {
    padding: 24px 18px 20px;
    border-radius: 16px;
  }

  .auth-mobile-brand {
    margin-bottom: 23px;
  }

  .auth-card h2 {
    font-size: 26px;
  }

  .topbar-actions {
    gap: 5px;
  }

  .account-trigger {
    width: 35px;
    height: 35px;
    min-height: 35px;
  }

  .account-avatar {
    width: 29px;
    height: 29px;
  }
}

@media (max-width: 360px) {
  .btn-new-label {
    display: none;
  }

  #btn-new {
    width: 36px;
    padding: 0;
    border-radius: 50%;
  }
}


@media (max-width: 1020px) {
  .live-row {
    grid-template-columns: minmax(170px, 1.1fr) minmax(150px, 1fr) repeat(2, minmax(62px, 0.5fr)) auto;
  }

  .live-row .live-cell:nth-of-type(4),
  .live-row .live-cell:nth-of-type(5) {
    display: none;
  }
}

@media (max-width: 880px) {
  .view-tabs {
    width: 100%;
  }

  .view-tab {
    flex: 1 1 auto;
    justify-content: center;
  }

  .view-hero {
    align-items: flex-start;
    flex-direction: column;
    gap: 14px;
  }

  .view-hero-side,
  .live-controls {
    width: 100%;
  }

  .view-hero-side {
    justify-content: space-between;
  }

  .live-controls {
    justify-content: flex-start;
    align-items: flex-end;
  }

  .live-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .live-row {
    grid-template-columns: minmax(0, 1fr) repeat(2, minmax(64px, 0.55fr)) auto;
  }

  .live-row .live-service {
    display: none;
  }

  .live-row .live-cell:nth-of-type(2),
  .live-row .live-cell:nth-of-type(3) {
    display: block;
  }

  .live-card-main {
    grid-template-columns: minmax(0, 1fr);
    gap: 14px;
  }
}

@media (max-width: 700px) {
  .view-tabs {
    margin-bottom: 18px;
    padding: 3px;
  }

  .view-tab {
    padding: 7px 9px;
    font-size: 9.5px;
  }

  .view-tab .icon {
    width: 13px;
    height: 13px;
  }

  .view-hero h1 {
    font-size: 27px;
  }

  .service-live-card {
    padding: 15px 13px 13px;
    border-radius: 15px;
  }

  .live-card-top {
    gap: 10px;
  }

  .live-card-title h2 {
    font-size: 17px;
  }

  .live-card-main {
    margin-top: 12px;
    padding-top: 12px;
  }

  .live-clock {
    font-size: 30px;
  }

  .live-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .live-metric {
    padding: 7px;
  }

  .live-metric strong {
    font-size: 10px;
  }

  .live-alert,
  .active-pause-banner {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
  }

  .live-alert .btn {
    width: 100%;
  }

  .live-actions .btn {
    flex: 1 1 auto;
  }

  .live-actions .btn-finish {
    flex-basis: 100%;
    margin-left: 0;
  }

  .assignment-card {
    align-items: flex-start;
    flex-direction: column;
    gap: 11px;
    padding: 14px;
  }

  .assignment-side {
    width: 100%;
    justify-content: space-between;
  }

  .assignment-side .btn {
    flex: 1 1 auto;
  }

  .assignment-duration {
    text-align: left;
  }

  .records-panel {
    padding: 14px 12px;
  }

  .live-summary {
    gap: 6px;
  }

  .live-stat {
    padding: 9px 10px;
  }

  .live-stat strong {
    font-size: 18px;
  }

  .live-row {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: start;
    row-gap: 8px;
    padding: 10px;
  }

  .live-row .live-person {
    grid-column: 1;
  }

  .live-row .live-service {
    display: block;
    grid-column: 1 / -1;
    grid-row: 2;
  }

  .live-row .live-cell {
    display: block !important;
    grid-row: 3;
  }

  .live-row .live-cell:nth-of-type(1) {
    grid-column: 1;
  }

  .live-row .live-cell:nth-of-type(2) {
    grid-column: 2;
  }

  .live-row .live-cell:nth-of-type(3) {
    grid-column: 3;
  }

  .live-row .live-cell:nth-of-type(4) {
    grid-column: 4;
  }

  .live-row .live-cell:nth-of-type(5) {
    grid-column: 5;
  }

  .live-row-end {
    grid-column: 2;
    grid-row: 1;
    align-self: start;
  }

  .live-cell-label {
    display: block;
  }

  .live-row .status-badge {
    font-size: 7.5px;
  }

  .agent-assignment-row {
    grid-template-columns: 27px minmax(0, 1fr) 22px;
  }

  .agent-shift-picks {
    grid-column: 2;
    grid-row: 2;
    padding-top: 2px;
  }

  .agent-assignment-row .agent-chip-remove {
    grid-column: 3;
    grid-row: 1 / 3;
  }

  .credential-row {
    grid-template-columns: 1fr 1fr;
  }

  .credential-row > div:first-child {
    grid-column: 1 / -1;
  }

  .pause-log li {
    grid-template-columns: 66px minmax(0, 1fr);
  }

  .pause-log time {
    grid-column: 2;
  }
}

@media (max-width: 500px) {
  .live-row {
    grid-template-columns: 1fr auto;
  }

  .live-row .live-cell:nth-of-type(3),
  .live-row .live-cell:nth-of-type(4),
  .live-row .live-cell:nth-of-type(5) {
    grid-row: 4;
  }

  .live-row .live-cell:nth-of-type(1) {
    grid-column: 1;
  }

  .live-row .live-cell:nth-of-type(2) {
    grid-column: 2;
  }

  .live-row .live-cell:nth-of-type(3) {
    grid-column: 1;
  }

  .live-row .live-cell:nth-of-type(4) {
    grid-column: 2;
  }

  .live-row .live-cell:nth-of-type(5) {
    grid-column: 1;
    grid-row: 5;
  }

  .live-summary {
    grid-template-columns: 1fr 1fr;
  }
}


/* Ajustes de grilla del tablero en vivo */
.live-row .live-cell.live-cell-extra,
.live-row .live-cell.live-cell-pauses {
  display: block;
}

@media (max-width: 1050px) {
  .live-row {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
      "person end"
      "service service"
      "entry exit"
      "elapsed extra"
      "pauses pauses";
    align-items: start;
    gap: 9px 12px;
    padding: 12px;
  }

  .live-row .live-service {
    display: block;
  }

  .live-row .live-cell {
    display: block !important;
    padding: 6px 8px;
    background: var(--surface-2);
    border: 1px solid var(--line-soft);
    border-radius: 7px;
  }

  .live-cell-label {
    display: block;
  }

  .live-row .live-cell.live-cell-entry {
    grid-area: entry;
  }

  .live-row .live-cell.live-cell-exit {
    grid-area: exit;
  }

  .live-row .live-cell.live-cell-elapsed {
    grid-area: elapsed;
  }

  .live-row .live-cell.live-cell-extra {
    grid-area: extra;
  }

  .live-row .live-cell.live-cell-pauses {
    grid-area: pauses;
  }

  .live-row-end {
    grid-area: end;
    align-self: start;
  }
}

@media (max-width: 700px) {
  .live-row {
    gap: 7px 8px;
    padding: 10px;
  }

  .live-row .live-cell {
    padding: 5px 7px;
  }

  .live-row .status-badge {
    font-size: 7.5px;
  }

  .live-row-end {
    flex-direction: column;
    align-items: flex-end;
  }
}


@media (max-width: 700px) {
  .agent-assignment-row {
    grid-template-columns: 27px minmax(0, 1fr) auto 22px;
  }

  .agent-assignment-row .agent-chip-remove {
    grid-column: 4;
    grid-row: 1;
  }

  .agent-assignment-count {
    padding: 2px 5px;
    font-size: 7px;
  }

  .coverage-table .coverage-agent-head,
  .coverage-agent-cell {
    width: 160px;
    min-width: 160px;
  }

  .coverage-agent-head {
    padding-left: 8px !important;
  }

  .coverage-table thead th {
    min-width: 47px;
    font-size: 7.5px;
  }

  .coverage-table thead th span {
    font-size: 8px;
  }

  .coverage-pick span {
    width: 20px;
    height: 20px;
  }
}


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

  .geo-grid .field:last-child {
    grid-column: 1 / -1;
  }
}

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

  .geo-grid .field:last-child {
    grid-column: auto;
  }

  .geo-status-line {
    align-items: flex-start;
  }

  .geo-status-line .map-link {
    margin-left: 18px;
  }
}


@media (max-width: 700px) {
  .service-map-frame {
    aspect-ratio: 1.75 / 1;
  }

  .service-map-caption {
    font-size: 8px;
  }
}

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

/* =========================================================
   KORDVEX · Corporate identity layer
   ========================================================= */

body {
  color: var(--kv-text-primary);
  background: var(--kv-background);
  font-size: 14px;
  font-weight: 400;
  letter-spacing: -0.005em;
}

body.is-auth,
body.modal-open {
  background: var(--kv-background);
}

h1, h2, h3, h4, h5, h6 {
  color: var(--kv-text-primary);
}

::selection {
  color: #fff;
  background: var(--kv-accent);
}

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

.kv-wordmark {
  display: inline-block;
  color: var(--kv-primary);
  font-family: var(--font-sans);
  font-size: 18px;
  font-weight: 600;
  letter-spacing: 0.075em;
  line-height: 1;
  text-transform: uppercase;
}

.kv-wordmark-light {
  color: #fff;
}

.kv-descriptor {
  color: var(--kv-text-secondary);
  font-size: 9px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.boot-screen {
  color: #fff;
  background: var(--kv-primary);
}

.boot-brand {
  flex-direction: column;
  gap: 8px;
}

.boot-brand .kv-wordmark {
  font-size: 28px;
}

.boot-brand .kv-descriptor {
  color: rgba(255, 255, 255, 0.6);
}

.boot-loader {
  border-color: rgba(255, 255, 255, 0.18);
  border-top-color: var(--kv-accent);
}

.auth-brand-panel {
  color: #fff;
  background: var(--kv-primary);
  border-right: 1px solid rgba(255, 255, 255, 0.08);
}

.auth-brand-panel::before {
  display: none;
}

.auth-brand-head {
  align-items: flex-start;
}

.auth-brand-name strong.kv-wordmark {
  color: #fff;
  font-size: 22px;
  letter-spacing: 0.08em;
}

.auth-brand-name span {
  color: rgba(255, 255, 255, 0.56);
  letter-spacing: 0.11em;
}

.auth-kicker {
  color: var(--kv-accent);
  letter-spacing: 0.13em;
}

.auth-brand-body h1 {
  color: #fff;
  font-size: clamp(2.2rem, 3.3vw, 3.1rem);
  font-weight: 600;
  letter-spacing: -0.035em;
  line-height: 1.06;
}

.auth-brand-body h1 em {
  color: #AEBED0;
}

.auth-lead {
  color: rgba(255, 255, 255, 0.66);
  font-size: 14px;
  line-height: 1.65;
}

.auth-feature-icon {
  color: var(--kv-accent);
  background: rgba(79, 127, 166, 0.15);
  border-color: rgba(79, 127, 166, 0.22);
}

.auth-features strong {
  color: rgba(255, 255, 255, 0.9);
  font-size: 12px;
  font-weight: 600;
}

.auth-features small {
  color: rgba(255, 255, 255, 0.55);
  font-size: 11px;
}

.auth-brand-foot {
  color: rgba(255, 255, 255, 0.46);
  border-top-color: rgba(255, 255, 255, 0.1);
}

.auth-form-panel {
  background: var(--kv-background);
}

.auth-card {
  background: #fff;
  border: 1px solid var(--kv-border);
  border-radius: var(--kv-radius-lg);
  box-shadow: var(--kv-shadow-card);
}

.auth-card h2 {
  font-size: 26px;
  font-weight: 600;
  letter-spacing: -0.03em;
}

.auth-subtitle {
  color: var(--kv-text-secondary);
  font-size: 13px;
}

.auth-mobile-brand .kv-wordmark {
  color: var(--kv-primary);
  font-size: 17px;
}

.auth-mobile-brand small {
  color: var(--kv-text-secondary);
}

.auth-note {
  color: var(--kv-text-secondary);
  background: var(--kv-background);
  border-color: var(--kv-border);
}

.auth-note strong {
  color: var(--kv-secondary);
}

/* Header */
.topbar {
  color: #fff;
  background: var(--kv-primary);
  border-bottom: 1px solid rgba(255, 255, 255, 0.09);
  box-shadow: 0 1px 0 rgba(15, 28, 46, 0.08);
}

.topbar::after {
  display: none;
}

.topbar-inner {
  min-height: 68px;
  padding-inline: 28px;
}

.brand {
  border-radius: var(--kv-radius-sm);
}

.brand-copy strong {
  font-size: 18px;
  font-weight: 600;
  letter-spacing: 0.08em;
}

.brand-copy span {
  color: rgba(255, 255, 255, 0.58);
  font-size: 8px;
  font-weight: 500;
  letter-spacing: 0.11em;
}

.topbar-actions {
  gap: 8px;
}

.account-trigger {
  min-height: 38px;
  border-radius: var(--kv-radius-sm);
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.16);
}

.account-trigger:hover {
  background: rgba(255, 255, 255, 0.1);
}

.btn {
  min-height: 36px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: -0.005em;
  transition: background-color 0.15s ease, border-color 0.15s ease,
    color 0.15s ease, box-shadow 0.15s ease;
}

.btn .icon {
  width: 17px;
  height: 17px;
}

.btn-primary {
  color: #fff;
  background: var(--kv-primary);
  border-color: var(--kv-primary);
  box-shadow: none;
}

.btn-primary:hover {
  background: var(--kv-secondary);
  border-color: var(--kv-secondary);
}

.btn-soft {
  color: var(--kv-secondary);
  background: #fff;
  border-color: var(--kv-border);
}

.btn-soft:hover {
  color: var(--kv-primary);
  background: var(--kv-background);
  border-color: #C9D3DE;
}

.btn-ghost {
  color: var(--kv-text-secondary);
}

.btn-ghost:hover {
  color: var(--kv-primary);
  background: var(--kv-surface);
}

.btn-outline-light {
  color: #fff;
  background: transparent;
  border-color: rgba(255, 255, 255, 0.24);
}

.btn-outline-light:hover {
  background: var(--kv-secondary);
  border-color: var(--kv-secondary);
}

.btn-gold {
  color: #fff;
  background: var(--kv-accent);
  border-color: var(--kv-accent);
  box-shadow: none;
}

.btn-gold:hover {
  background: #456F91;
  border-color: #456F91;
}

.btn-danger {
  color: #fff;
  background: var(--kv-danger);
  border-color: var(--kv-danger);
}

.btn-danger:hover {
  background: #C34551;
  border-color: #C34551;
}

/* Navigation */
.view-tabs {
  gap: 4px;
  padding: 4px;
  background: transparent;
  border: 1px solid var(--kv-border);
  border-radius: var(--kv-radius-md);
  box-shadow: none;
}

.view-tab {
  min-height: 36px;
  padding: 7px 12px;
  color: var(--kv-text-secondary);
  border-radius: 6px;
  font-size: 12px;
  font-weight: 500;
}

.view-tab:hover {
  color: var(--kv-primary);
  background: #fff;
}

.view-tab.is-active {
  position: relative;
  color: #fff;
  background: var(--kv-secondary);
  box-shadow: none;
}

.view-tab.is-active::before {
  content: "";
  width: 3px;
  height: 14px;
  margin-right: 1px;
  background: var(--kv-accent);
  border-radius: 2px;
}

.view-tab-badge {
  color: #fff;
  background: var(--kv-accent);
  border-radius: 4px;
}

/* Main content */
.page {
  padding: 30px 28px 24px;
}

.eyebrow {
  color: var(--kv-text-secondary);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.13em;
}

.overview {
  gap: 28px;
  margin-bottom: 24px;
}

.overview h1 {
  font-size: clamp(26px, 2.6vw, 30px);
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.12;
}

.page-subtitle {
  color: var(--kv-text-secondary);
  font-size: 13px;
  line-height: 1.55;
}

.panel,
.stat-card,
.day-panel,
.live-card,
.history-card,
.my-service-card,
.service-card,
.agent-session-card,
.report-preview,
.whatsapp-preview {
  background: #fff;
  border: 1px solid var(--kv-border);
  border-radius: var(--kv-radius-md);
  box-shadow: var(--kv-shadow-card);
}

.panel {
  border-radius: var(--kv-radius-lg);
}

.stat-card {
  min-width: 132px;
  padding: 14px 15px;
  border-radius: var(--kv-radius-md);
}

.stat-label {
  color: var(--kv-text-secondary);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.02em;
}

.stat-label .icon {
  color: var(--kv-accent);
}

.stat-value-row strong {
  color: var(--kv-primary);
  font-size: 30px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.04em;
}

.stat-value-row span {
  color: var(--kv-text-secondary);
  font-size: 10px;
}

.stat-card-accent {
  color: #fff;
  background: var(--kv-primary);
  border-color: var(--kv-primary);
}

.stat-card-accent .stat-value-row strong {
  color: #fff;
}

.stat-card-accent .stat-label,
.stat-card-accent .stat-value-row span {
  color: rgba(255, 255, 255, 0.62);
}

.stat-card-accent .stat-label .icon {
  color: #9DB6CE;
}

.demo-banner {
  color: var(--kv-secondary);
  background: #fff;
  border: 1px solid var(--kv-border);
  border-radius: var(--kv-radius-md);
}

.demo-badge {
  color: var(--kv-secondary);
  background: var(--kv-surface);
}

.demo-badge .icon {
  color: var(--kv-accent);
}

/* Calendar and tables */
.weekdays {
  color: var(--kv-text-secondary);
  font-size: 9px;
  font-weight: 500;
  letter-spacing: 0.08em;
}

.day-cell {
  background: #fff;
  border-color: var(--kv-border);
  border-radius: var(--kv-radius-sm);
}

.day-cell:hover {
  background: #FBFCFF;
  border-color: #C9D4E0;
}

.day-cell.is-today {
  border-color: var(--kv-accent);
  box-shadow: inset 0 0 0 1px var(--kv-accent);
}

.day-cell.is-selected {
  background: #F3F7FB;
  border-color: var(--kv-accent);
}

.legend-dot.morning {
  background: var(--kv-accent);
}

.legend-dot.afternoon {
  background: #7186A0;
}

.calendar-service,
.day-service {
  border-left-color: var(--kv-accent);
}

.history-table-wrap,
.coverage-scroll,
.table-wrap {
  scrollbar-color: #C9D3DE transparent;
}

.history-table th,
.coverage-table thead th {
  color: var(--kv-text-secondary);
  background: var(--kv-background);
  border-color: var(--kv-border);
  font-size: 8px;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.history-table td,
.coverage-table td {
  border-color: #EDF0F4;
}

.history-table tbody tr:hover td,
.coverage-table tbody tr:hover td {
  background: #F8FAFD;
}

/* Forms */
input,
textarea,
select {
  color: var(--kv-primary);
  background: #fff;
  border-color: var(--kv-border);
  border-radius: 8px;
}

input::placeholder,
textarea::placeholder {
  color: #96A1AF;
}

input:focus,
textarea:focus,
select:focus {
  border-color: var(--kv-accent);
  outline: 2px solid rgba(79, 127, 166, 0.2);
  outline-offset: 0;
}

.field-label {
  color: var(--kv-secondary);
  font-size: 10px;
  font-weight: 500;
}

.field-hint,
.form-hint {
  color: var(--kv-text-secondary);
}

/* Dialogs */
.modal-shell {
  background: #fff;
  border: 1px solid var(--kv-border);
  border-radius: var(--kv-radius-lg);
  box-shadow: var(--shadow-float);
}

.modal-head {
  border-bottom-color: var(--kv-border);
}

.modal-title-group h2 {
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.025em;
}

.modal-icon {
  color: var(--kv-accent);
  background: var(--kv-surface);
}

.modal-footer {
  background: #fff;
  border-top-color: var(--kv-border);
}

/* Operational statuses */
.status-badge {
  gap: 5px;
  padding: 4px 8px;
  color: var(--kv-text-secondary);
  background: var(--kv-background);
  border-color: var(--kv-border);
  border-radius: 5px;
  font-size: 9px;
  font-weight: 500;
}

.status-badge::before {
  width: 6px;
  height: 6px;
  background: var(--kv-neutral);
}

.status-badge.status-active {
  color: #1F6F54;
  background: #EAF6F1;
  border-color: #CFE9DF;
}

.status-badge.status-active::before {
  background: var(--kv-success);
  box-shadow: none;
}

.status-badge.status-paused {
  color: #8A6426;
  background: #FBF3E5;
  border-color: #F0DFC2;
}

.status-badge.status-paused::before {
  background: var(--kv-warning);
}

.status-badge.status-auto {
  color: #2A3E56;
  background: #EAF0F6;
  border-color: #D5E1EC;
}

.status-badge.status-auto::before {
  background: var(--kv-accent);
  box-shadow: none;
}

.status-badge.status-completed {
  color: #3B607F;
  background: #EDF3F8;
  border-color: #D6E3EE;
}

.status-badge.status-completed::before {
  background: var(--kv-accent);
}

.status-badge.status-pending {
  color: var(--kv-text-secondary);
  background: var(--kv-background);
}

.status-badge.status-pending::before {
  background: var(--kv-neutral);
}

/* Maps and public surfaces */
.leaflet-map .leaflet-tile-pane,
.service-place-map .leaflet-tile-pane {
  filter: saturate(0.4) contrast(0.92) brightness(1.04);
}

.leaflet-control-zoom a {
  color: var(--kv-primary);
  background: #fff;
  border-color: var(--kv-border);
}

.vigia-map-marker-pin {
  background: var(--kv-accent);
  border-color: #fff;
}

.vigia-map-marker-tip {
  border-top-color: var(--kv-accent);
}

.public-topbar {
  border-bottom: 1px solid var(--kv-border);
}

.public-brand .kv-wordmark {
  color: var(--kv-primary);
}

.public-brand small {
  color: var(--kv-text-secondary);
}

.public-card {
  background: #fff;
  border-color: var(--kv-border);
  border-radius: var(--kv-radius-lg);
  box-shadow: var(--kv-shadow-card);
}

.public-hero h1 {
  font-weight: 600;
  letter-spacing: -0.04em;
}

.public-eyebrow {
  color: var(--kv-text-secondary);
  letter-spacing: 0.12em;
}

.public-stat {
  background: #fff;
  border-color: var(--kv-border);
}

.public-btn-primary {
  background: var(--kv-primary);
  border-color: var(--kv-primary);
}

.public-btn-primary:hover {
  background: var(--kv-secondary);
}

.public-status-pill.is-confirmed {
  color: #1F6F54;
  background: #EAF6F1;
  border-color: #CFE9DF;
}

@media (max-width: 1020px) {
  .topbar-inner {
    padding-inline: 18px;
  }

  .brand-copy span {
    display: none;
  }

  .page {
    padding-inline: 18px;
  }
}

@media (max-width: 650px) {
  .kv-wordmark {
    font-size: 16px;
  }

  .topbar-inner {
    min-height: 62px;
  }

  .overview h1 {
    font-size: 26px;
  }

  .page {
    padding-inline: 14px;
  }

  .view-tabs {
    width: 100%;
  }

  .view-tab {
    flex: 1;
    justify-content: center;
    padding-inline: 8px;
  }
}

/* KORDVEX · calendar surface refinements */
.day-cell,
.day-cell.is-weekend {
  background: #FFFFFF;
  border-color: var(--kv-border);
}

.day-cell.is-outside {
  background: transparent;
  opacity: 0.38;
}

.day-cell.is-today {
  background: #F8FAFD;
}

.day-cell.is-selected {
  background: #F3F7FB;
}

.day-cell:hover {
  background: #FBFCFE;
  border-color: #C9D4E0;
}

.day-cell.is-selected:hover {
  background: #F3F7FB;
}

.calendar-panel,
.day-panel {
  background: #FFFFFF;
}

.mini-service,
.service-card,
.day-service {
  background: #F8FAFD;
  border-color: var(--kv-border);
}

.mini-service:hover,
.service-card:hover {
  background: #F2F6FB;
}

.day-number {
  color: var(--kv-secondary);
}

.day-cell.is-selected:not(.is-today) .day-number {
  color: var(--kv-primary);
  background: var(--kv-surface);
}

.btn-report {
  border-radius: 8px;
}

/* KORDVEX · semantic state alignment */
.geo-summary-status.is-ready,
.share-link-badge.is-ready {
  color: #1F6F54;
  background: #EAF6F1;
  border-color: #CFE9DF;
}

.place-selected {
  background: #F1F5FA;
  border-color: #D6E3EE;
}

.share-link-agent .is-confirmed {
  color: #1F6F54;
}

.btn {
  font-size: 13px;
}

.field-label {
  font-size: 11px;
}

@media (max-width: 1020px) {
  .btn {
    font-size: 12px;
  }
}

.report-kpi {
  background: #FFFFFF;
  border-color: var(--kv-border);
}

.report-block {
  background: #FFFFFF;
  border-color: var(--kv-border);
}

.report-week-toolbar {
  background: var(--kv-background);
  border-color: var(--kv-border);
}

/* KORDVEX · desktop navigation rail (same routes, same controls) */
@media (min-width: 1200px) {
  .page {
    width: auto;
    max-width: none;
    margin: 0 0 0 224px;
    padding: 30px 30px 24px;
  }

  .view-tabs {
    position: fixed;
    top: 68px;
    bottom: 0;
    left: 0;
    z-index: 55;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 5px;
    width: 224px;
    max-width: none;
    margin: 0;
    padding: 22px 14px 18px;
    overflow-y: auto;
    background: var(--kv-primary);
    border: 0;
    border-right: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 0;
    box-shadow: none;
    scrollbar-width: none;
  }

  .view-tabs::before {
    content: "Operación";
    display: block;
    padding: 0 10px 10px;
    color: rgba(255, 255, 255, 0.42);
    font-size: 9px;
    font-weight: 500;
    letter-spacing: 0.13em;
    text-transform: uppercase;
  }

  .view-tabs::after {
    content: "KORDVEX · Gestión Operativa";
    margin-top: auto;
    padding: 18px 10px 0;
    color: rgba(255, 255, 255, 0.3);
    border-top: 1px solid rgba(255, 255, 255, 0.09);
    font-size: 8px;
    font-weight: 500;
    letter-spacing: 0.08em;
    line-height: 1.45;
    text-transform: uppercase;
  }

  .view-tab {
    justify-content: flex-start;
    min-height: 42px;
    padding: 10px 12px;
    color: rgba(255, 255, 255, 0.68);
    border-radius: 8px;
    font-size: 13px;
  }

  .view-tab:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.07);
  }

  .view-tab.is-active {
    color: #fff;
    background: var(--kv-secondary);
  }

  .view-tab.is-active::before {
    position: absolute;
    top: 50%;
    left: 0;
    width: 3px;
    height: 18px;
    margin: 0;
    transform: translateY(-50%);
    background: var(--kv-accent);
    border-radius: 0 2px 2px 0;
  }

  .view-tab .icon {
    width: 18px;
    height: 18px;
    opacity: 0.86;
  }

  .view-tab-badge {
    margin-left: auto;
  }

  .topbar-inner {
    padding-inline: 28px;
  }

  .calendar-panel {
    padding: 20px 20px 14px;
  }
}

@media (min-width: 1200px) {
  .page {
    animation: none;
    transform: none;
  }
}

.btn-accent {
  color: #FFFFFF;
  background: var(--kv-accent);
  border-color: var(--kv-accent);
}

.btn-accent:hover {
  background: #456F91;
  border-color: #456F91;
}

.btn-danger {
  box-shadow: none;
}

/* Official KORDVEX logo integration */
.kv-app-icon {
  display: block;
  flex: 0 0 auto;
  border-radius: 12px;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.14);
}

.kv-app-icon-lg {
  width: 64px;
  height: 64px;
}

.brand-app-icon {
  width: 38px;
  height: 38px;
  display: block;
  flex: 0 0 auto;
  border-radius: 10px;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.16);
}

.auth-brand-icon {
  width: 48px;
  height: 48px;
  border-radius: 11px;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.18);
}

.auth-mobile-logo {
  display: block;
  width: 196px;
  height: auto;
}

@media (max-width: 760px) {
  .auth-mobile-logo {
    width: 172px;
  }
}

.auth-card-monogram {
  display: block;
  width: 36px;
  height: 36px;
  margin-bottom: 18px;
  object-fit: contain;
}

@media (max-width: 880px) {
  .auth-card-monogram {
    display: none;
  }
}

@media (max-width: 650px) {
  .topbar-inner {
    gap: 8px;
    padding-inline: 12px;
  }

  .brand {
    gap: 7px;
  }

  .brand-app-icon {
    width: 34px;
    height: 34px;
    border-radius: 9px;
  }

  .brand-copy strong {
    font-size: 16px;
  }

  .topbar-actions {
    gap: 4px;
  }

  #btn-new {
    width: 36px;
    min-width: 36px;
    padding: 0;
    justify-content: center;
  }

  .btn-new-label {
    display: none;
  }

  .account-trigger {
    width: 34px;
    min-width: 34px;
    padding: 2px;
    justify-content: center;
  }
}

/* Reverse horizontal lockup for dark surfaces */
.boot-horizontal-logo {
  display: block;
  width: min(280px, 80vw);
  height: auto;
}

.auth-horizontal-logo {
  display: block;
  width: min(246px, 72%);
  height: auto;
}

.brand-horizontal-logo {
  display: none;
  width: 238px;
  height: auto;
}

@media (min-width: 1200px) {
  .brand-horizontal-logo {
    display: block;
  }

  .brand .brand-app-icon,
  .brand .brand-copy {
    display: none;
  }
}

/* Command Center */
.command-center {
  margin-bottom: 18px;
}

.command-center-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
}

.command-center-head h2 {
  margin: 0 0 3px;
  font-size: 20px;
  letter-spacing: -0.03em;
}

.command-center-head p:not(.eyebrow) {
  margin: 0;
  color: var(--kv-text-secondary);
  font-size: 13px;
}

.command-kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

.command-kpi {
  background: #fff;
  border: 1px solid var(--kv-border);
  border-radius: var(--kv-radius-lg);
  padding: 13px 14px;
  min-height: 78px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.command-kpi span {
  color: var(--kv-text-secondary);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.command-kpi strong {
  font-size: 25px;
  font-weight: 650;
  letter-spacing: -0.04em;
}

.command-kpi small {
  color: var(--kv-text-secondary);
  font-size: 10px;
}

.command-kpi.is-warning strong { color: #9a6714; }
.command-kpi.is-danger strong { color: var(--kv-danger); }
.command-kpi.is-accent { background: var(--kv-primary); border-color: var(--kv-primary); }
.command-kpi.is-accent span, .command-kpi.is-accent small { color: #c5d1df; }
.command-kpi.is-accent strong { color: #fff; }

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

.command-health-card {
  text-align: left;
  background: #fff;
  border: 1px solid var(--kv-border);
  border-radius: var(--kv-radius);
  padding: 12px 13px;
  cursor: pointer;
  font: inherit;
  color: inherit;
  transition: border-color 120ms ease, background 120ms ease;
}

.command-health-card:hover, .command-health-card:focus-visible {
  border-color: var(--kv-accent);
  background: #fbfcfd;
}

.command-health-card.is-normal { border-left: 3px solid var(--kv-success); }
.command-health-card.is-attention { border-left: 3px solid var(--kv-warning); }
.command-health-card.is-critical { border-left: 3px solid var(--kv-danger); }
.command-health-card.is-unknown { border-left: 3px solid #9aa8b7; }

.command-health-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.command-health-top strong {
  font-size: 13px;
}

.command-health-status {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.command-health-card.is-normal .command-health-status { color: var(--kv-success); }
.command-health-card.is-attention .command-health-status { color: #9a6714; }
.command-health-card.is-critical .command-health-status { color: var(--kv-danger); }
.command-health-card.is-unknown .command-health-status { color: #637383; }

.command-health-meta {
  display: block;
  margin-top: 3px;
  color: var(--kv-text-secondary);
  font-size: 11px;
}

.command-health-reason {
  display: block;
  margin-top: 6px;
  color: var(--kv-text-secondary);
  font-size: 11px;
  line-height: 1.35;
}

.command-modules-note {
  margin: 8px 0 0;
  color: var(--kv-text-secondary);
  font-size: 11px;
}

@media (max-width: 900px) {
  .command-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .command-health { grid-template-columns: 1fr; }
}

@media (max-width: 520px) {
  .command-center-head { align-items: flex-start; flex-direction: column; }
  .command-kpi { min-height: 68px; padding: 11px 12px; }
  .command-kpi strong { font-size: 21px; }
}

.command-events {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--kv-border);
}

.command-events ul {
  list-style: none;
  margin: 6px 0 0;
  padding: 0;
  display: grid;
  gap: 5px;
}

.command-events li {
  display: grid;
  grid-template-columns: 138px 1fr;
  gap: 10px;
  font-size: 11px;
  color: var(--kv-text-secondary);
}

.command-events li strong {
  color: var(--kv-text-primary);
  font-weight: 600;
}

@media (max-width: 600px) {
  .command-events li { grid-template-columns: 1fr; gap: 1px; }
}

/* Patrol */
.patrol-content { display: grid; gap: 16px; }
.patrol-grid { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr); gap: 16px; align-items: start; }
.patrol-panel { background: #fff; border: 1px solid var(--kv-border); border-radius: var(--kv-radius-lg); padding: 16px; }
.patrol-panel h2 { margin: 0 0 3px; font-size: 17px; }
.patrol-panel > p { margin: 0 0 12px; color: var(--kv-text-secondary); font-size: 12px; }
.patrol-list { display: grid; gap: 8px; }
.patrol-card { border: 1px solid var(--kv-border); border-radius: var(--kv-radius); padding: 12px; background: #fff; }
.patrol-card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.patrol-card-head strong { font-size: 13px; }
.patrol-card-meta { color: var(--kv-text-secondary); font-size: 11px; display: block; margin-top: 2px; }
.patrol-checkpoint-list { list-style: none; margin: 9px 0 0; padding: 0; display: grid; gap: 5px; }
.patrol-checkpoint-list li { display: flex; justify-content: space-between; gap: 8px; font-size: 11px; border-top: 1px solid var(--kv-border); padding-top: 5px; }
.patrol-checkpoint-list code { font-size: 10px; color: var(--kv-text-secondary); word-break: break-all; }
.patrol-actions { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 9px; }
.patrol-actions .btn { min-height: 30px; padding: 5px 9px; font-size: 11px; }
.patrol-run-card { display: flex; justify-content: space-between; gap: 10px; align-items: center; }
.patrol-status { font-size: 10px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; }
.patrol-status.is-scheduled { color: var(--kv-text-secondary); }
.patrol-status.is-in_progress { color: var(--kv-accent); }
.patrol-status.is-completed { color: var(--kv-success); }
.patrol-status.is-missed { color: var(--kv-danger); }
.patrol-run-checkpoints { display: grid; gap: 8px; margin-top: 12px; }
.patrol-run-checkpoint { border: 1px solid var(--kv-border); border-radius: var(--kv-radius); padding: 10px; }
.patrol-run-checkpoint.is-done { border-left: 3px solid var(--kv-success); }
.patrol-run-checkpoint.is-issue { border-left: 3px solid var(--kv-danger); }
.patrol-run-checkpoint-head { display: flex; justify-content: space-between; gap: 8px; align-items: flex-start; }
.patrol-run-checkpoint-head strong { font-size: 12px; }
.patrol-methods-row { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 5px; }
.patrol-methods-row span { border: 1px solid var(--kv-border); border-radius: 4px; padding: 2px 5px; font-size: 9px; color: var(--kv-text-secondary); text-transform: uppercase; }
.patrol-verify-row { display: flex; flex-wrap: wrap; gap: 5px; align-items: center; margin-top: 8px; }
.patrol-verify-row input[type="text"] { width: 130px; min-height: 30px; padding: 4px 7px; font-size: 11px; }
.patrol-verify-row .btn { min-height: 30px; padding: 4px 8px; font-size: 10px; }
.patrol-evidence { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.patrol-evidence img { width: 54px; height: 54px; object-fit: cover; border-radius: 5px; border: 1px solid var(--kv-border); }
.patrol-methods { border: 1px solid var(--kv-border); border-radius: var(--kv-radius); padding: 9px 11px; margin: 10px 0; display: flex; flex-wrap: wrap; gap: 10px 16px; }
.patrol-methods legend { font-size: 11px; font-weight: 600; padding: 0 4px; }
.patrol-methods label { display: flex; align-items: center; gap: 5px; font-size: 12px; }
.patrol-empty { padding: 20px; text-align: center; color: var(--kv-text-secondary); font-size: 12px; }
@media (max-width: 900px) { .patrol-grid { grid-template-columns: 1fr; } }

.patrol-qr-button { border: 0; background: transparent; color: var(--kv-accent); font: inherit; font-size: 10px; cursor: pointer; padding: 0 4px; }
.patrol-qr-slot { padding: 8px 0 2px; }
.patrol-qr-slot svg { width: 112px; height: 112px; display: block; }

.patrol-scan-video { width: 100%; max-height: 340px; background: #0f1c2e; border-radius: 10px; object-fit: cover; }

/* Incidents */
.incident-toolbar { display: flex; align-items: end; gap: 10px; margin-bottom: 12px; }
.field-inline { min-width: 180px; }
.incident-list { display: grid; gap: 8px; }
.incident-card { background: #fff; border: 1px solid var(--kv-border); border-radius: var(--kv-radius); padding: 12px; border-left: 3px solid #9aa8b7; cursor: pointer; text-align: left; font: inherit; color: inherit; }
.incident-card.is-critical { border-left-color: var(--kv-danger); }
.incident-card.is-high { border-left-color: #c47c2b; }
.incident-card.is-medium { border-left-color: var(--kv-warning); }
.incident-card.is-low { border-left-color: var(--kv-accent); }
.incident-card-head { display: flex; justify-content: space-between; gap: 10px; }
.incident-card strong { font-size: 13px; }
.incident-meta { color: var(--kv-text-secondary); font-size: 11px; display: block; margin-top: 2px; }
.incident-badges { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 7px; }
.incident-badge { border: 1px solid var(--kv-border); border-radius: 4px; padding: 2px 6px; font-size: 9px; letter-spacing: 0.04em; text-transform: uppercase; color: var(--kv-text-secondary); }
.incident-badge.is-open { color: var(--kv-danger); border-color: #efc6cb; }
.incident-badge.is-closed { color: var(--kv-success); border-color: #c8e6d8; }
.incident-detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.incident-field { background: var(--kv-surface); border-radius: 5px; padding: 7px 9px; }
.incident-field span { display: block; color: var(--kv-text-secondary); font-size: 9px; text-transform: uppercase; letter-spacing: 0.04em; }
.incident-field strong { font-size: 12px; }
.incident-timeline { list-style: none; margin: 6px 0 0; padding: 0; display: grid; gap: 6px; }
.incident-timeline li { border-left: 2px solid var(--kv-border); padding-left: 8px; font-size: 11px; }
.incident-timeline li strong { display: block; color: var(--kv-text-primary); }
.incident-timeline li span { color: var(--kv-text-secondary); }
.incident-evidence { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 6px; }
.incident-evidence a, .incident-evidence img { width: 68px; height: 68px; object-fit: cover; border-radius: 5px; border: 1px solid var(--kv-border); display: block; }
.incident-evidence a.is-pdf { display: grid; place-items: center; font-size: 9px; text-decoration: none; color: var(--kv-accent); }
.incident-actions { display: flex; flex-wrap: wrap; gap: 6px; align-items: end; margin-top: 10px; }
.incident-actions .field { min-width: 150px; margin: 0; }
.incident-actions .btn { min-height: 32px; }
@media (max-width: 700px) { .incident-detail-grid { grid-template-columns: 1fr; } .incident-toolbar { align-items: stretch; flex-direction: column; } }

@media (max-width: 700px) {
  .view-tabs { overflow-x: auto; flex-wrap: nowrap; scrollbar-width: thin; }
  .view-tab { flex: 0 0 auto; }
}

/* Workforce */
.workforce-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.workforce-range { display: grid; grid-template-columns: 1fr 1fr auto auto; gap: 6px; align-items: end; }
.workforce-range .field { min-width: 0; }
.workforce-profile-card { border: 1px solid var(--kv-border); border-radius: var(--kv-radius); padding: 10px; background: #fff; cursor: pointer; text-align: left; font: inherit; color: inherit; width: 100%; }
.workforce-profile-card:hover { border-color: var(--kv-accent); }
.workforce-profile-name { display: flex; justify-content: space-between; gap: 8px; font-size: 12px; font-weight: 600; }
.workforce-profile-meta { display: block; margin-top: 3px; color: var(--kv-text-secondary); font-size: 10px; }
.workforce-profile-badges { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.workforce-availability { display: grid; gap: 5px; margin: 5px 0 10px; }
.workforce-day { display: grid; grid-template-columns: 120px 80px 80px; gap: 6px; align-items: center; font-size: 11px; }
.workforce-day input[type="time"] { min-height: 30px; padding: 3px 5px; font-size: 11px; }
.workforce-inline-form { display: flex; flex-wrap: wrap; gap: 5px; margin: 6px 0 12px; }
.workforce-inline-form input, .workforce-inline-form select { min-height: 30px; padding: 4px 7px; font-size: 11px; border: 1px solid var(--kv-border); border-radius: 5px; }
.workforce-inline-form input[type="text"] { width: 140px; }
.workforce-item { display: flex; justify-content: space-between; gap: 8px; border-bottom: 1px solid var(--kv-border); padding: 5px 0; font-size: 11px; }
.workforce-proposal-row { display: flex; justify-content: space-between; gap: 8px; border-bottom: 1px solid var(--kv-border); padding: 6px 0; font-size: 11px; }
.workforce-proposal-row strong { display: block; font-size: 12px; }
.workforce-conflict { color: var(--kv-danger); font-size: 11px; }
@media (max-width: 900px) { .workforce-grid { grid-template-columns: 1fr; } .workforce-range { grid-template-columns: 1fr 1fr; } }

/* Handover */
.handover-card { background:#fff; border:1px solid var(--kv-border); border-radius:var(--kv-radius); padding:11px; text-align:left; font:inherit; color:inherit; cursor:pointer; width:100%; }
.handover-card:hover { border-color:var(--kv-accent); }
.handover-card-head { display:flex; justify-content:space-between; gap:8px; }
.handover-status { font-size:10px; font-weight:700; letter-spacing:.04em; text-transform:uppercase; }
.handover-status.is-ACCEPTED { color:var(--kv-success); }
.handover-status.is-EXCEPTIONAL { color:#9a6714; }
.handover-status.is-REJECTED { color:var(--kv-danger); }
.handover-status.is-PENDING { color:var(--kv-text-secondary); }
.handover-presence { display:grid; grid-template-columns:1fr 1fr; gap:7px; margin-top:8px; }
.handover-presence-item { border:1px solid var(--kv-border); border-radius:5px; padding:7px; font-size:11px; }
.handover-presence-item strong { display:block; font-size:12px; }
.handover-presence-item span { color:var(--kv-text-secondary); }
.handover-list { margin:0; padding-left:16px; font-size:11px; color:var(--kv-text-secondary); }
.handover-actions { display:flex; flex-wrap:wrap; gap:6px; margin-top:8px; }
.handover-actions .btn { min-height:30px; padding:4px 8px; font-size:10px; }
@media(max-width:600px){.handover-presence{grid-template-columns:1fr;}}

/* Notifications and automation */
.topbar-bell { position: relative; width: 38px; padding: 0; justify-content: center; }
.notification-badge { position: absolute; top: -5px; right: -5px; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 9px; background: var(--kv-danger); color: #fff; font-size: 9px; line-height: 17px; text-align: center; }
.notification-item { border: 1px solid var(--kv-border); border-left: 3px solid var(--kv-accent); border-radius: 5px; padding: 8px 10px; margin-bottom: 6px; font-size: 11px; }
.notification-item.is-unread { background: #fbfcfd; }
.notification-item.is-high { border-left-color: var(--kv-warning); }
.notification-item.is-critical { border-left-color: var(--kv-danger); }
.notification-item strong { display: block; font-size: 12px; }
.notification-item span { color: var(--kv-text-secondary); }
.notification-item time { display: block; margin-top: 3px; color: var(--kv-text-secondary); font-size: 9px; }
.automation-rule { border: 1px solid var(--kv-border); border-radius: var(--kv-radius); padding: 10px; display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; }
.automation-rule strong { font-size: 12px; }
.automation-rule span { display: block; color: var(--kv-text-secondary); font-size: 10px; margin-top: 2px; }
.automation-rule .btn { min-height: 28px; padding: 3px 7px; font-size: 10px; }

/* Client portal */
.client-access-list { display: grid; gap: 5px; max-height: 320px; overflow: auto; }
.client-access-list label { display: flex; gap: 7px; align-items: center; border: 1px solid var(--kv-border); border-radius: 5px; padding: 7px 9px; font-size: 11px; }
.client-access-list span { color: var(--kv-text-secondary); margin-left: auto; }
.client-service-card { border: 1px solid var(--kv-border); border-radius: var(--kv-radius); padding: 10px; }
.client-service-card strong { font-size: 12px; }
.client-service-card span { color: var(--kv-text-secondary); font-size: 10px; display: block; margin-top: 2px; }
.client-coverage { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 6px; }
.client-coverage span { border: 1px solid var(--kv-border); border-radius: 4px; padding: 2px 5px; font-size: 9px; }
.client-coverage .is-covered { color: var(--kv-success); border-color: #c8e6d8; }
.client-coverage .is-pending { color: #9a6714; border-color: #efd9b8; }
@media(max-width:900px){.client-access-list{max-height:260px;}}

/* Intelligence */
.intelligence-toolbar { display: flex; flex-wrap: wrap; align-items: end; gap: 8px; margin-bottom: 12px; }
.intelligence-toolbar .segmented { margin: 0; }
.intelligence-toolbar .field { min-width: 140px; }
.analytics-trend-row { display: grid; grid-template-columns: 110px 1fr 40px; gap: 8px; align-items: center; font-size: 10px; margin: 6px 0; }
.analytics-bar { height: 7px; border-radius: 3px; background: var(--kv-border); overflow: hidden; }
.analytics-bar span { display: block; height: 100%; background: var(--kv-accent); }
.analytics-service-row { display: grid; grid-template-columns: 1.4fr .55fr .55fr .55fr .5fr; gap: 6px; border-bottom: 1px solid var(--kv-border); padding: 6px 0; font-size: 10px; align-items: center; }
.analytics-service-row strong { font-size: 11px; }
.analytics-service-row span { color: var(--kv-text-secondary); }
.analytics-service-head { font-weight: 600; color: var(--kv-text-secondary); text-transform: uppercase; font-size: 9px; letter-spacing: .04em; }
@media(max-width:700px){.analytics-service-row { grid-template-columns: 1.5fr .6fr .6fr; } .analytics-service-row > :nth-child(n+4){display:none;} .analytics-trend-row{grid-template-columns:90px 1fr 34px;}}

/* Tablet: evita que la barra de vistas ensanche la página. */
@media (max-width: 900px) {
  .view-tabs {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    overflow-x: auto;
  }
}

/* Tablet topbar: conserva iconos, oculta etiquetas largas. */
@media (max-width: 900px) {
  .topbar-actions { gap: 5px; }
  .topbar-actions .btn-label { display: none; }
  .topbar-actions .btn { width: 36px; min-width: 36px; padding: 0; justify-content: center; }
  .account-trigger { padding-right: 5px; }
}

/* Alineación óptica del lockup horizontal dentro del topbar de 68 px. */
.brand {
  align-self: center;
  align-items: center;
}

.brand-horizontal-logo {
  display: block;
  align-self: center;
  transform: translateY(-0.5px);
}

/* Desktop: el lockup acompaña el inicio del rail de navegación lateral.
   El logo no se centra en el viewport; se ancla al mismo margen que el
   encabezado "Operación" del menú izquierdo. */
@media (min-width: 1200px) {
  .brand {
    position: absolute;
    left: 24px;
    top: 50%;
    z-index: 2;
    transform: translateY(-50%);
  }

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

/* Tablet horizontal: mismas acciones como iconos para evitar overflow. */
@media (min-width: 901px) and (max-width: 1199px) {
  .topbar-actions {
    gap: 5px;
  }

  .topbar-actions .btn-label,
  .topbar-actions .btn-new-label {
    display: none;
  }

  .topbar-actions .btn {
    width: 36px;
    min-width: 36px;
    padding: 0;
    justify-content: center;
  }
}

/* Desktop: acciones del topbar alineadas al borde derecho del contenido
   y opciones del rail alineadas al margen del logo. */
@media (min-width: 1200px) {
  .topbar-actions {
    position: absolute;
    top: 50%;
    right: 30px;
    left: auto;
    transform: translateY(-50%);
  }

  .view-tabs .view-tab {
    margin-left: 0;
  }
}

/* Feedback inmediato de acciones de incidentes */
.btn[aria-busy="true"] {
  opacity: 0.65;
  cursor: progress;
}

.btn[aria-busy="true"]::after {
  content: "";
  width: 9px;
  height: 9px;
  border: 1.5px solid currentColor;
  border-top-color: transparent;
  border-radius: 50%;
  animation: btn-busy-spin 0.7s linear infinite;
}
@keyframes btn-busy-spin { to { transform: rotate(360deg); } }

/* Services / confirmations */
.services-day { border: 1px solid var(--kv-border); border-radius: var(--kv-radius); padding: 10px; background: #fff; }
.services-day-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-bottom: 6px; }
.services-day-head strong { font-size: 13px; }
.services-day-head span { color: var(--kv-text-secondary); font-size: 10px; }
.services-service { border-top: 1px solid var(--kv-border); padding: 8px 0; }
.services-service:first-of-type { border-top: 0; padding-top: 2px; }
.services-service-head { display: flex; justify-content: space-between; gap: 8px; }
.services-service-head strong { font-size: 12px; }
.services-service-head span { color: var(--kv-text-secondary); font-size: 10px; }
.services-shift { margin-top: 6px; }
.services-shift-label { display: block; color: var(--kv-text-secondary); font-size: 9px; text-transform: uppercase; letter-spacing: .05em; margin-bottom: 3px; }
.services-agent-row { display: flex; justify-content: space-between; gap: 8px; align-items: center; padding: 4px 0; font-size: 11px; }
.services-agent-row small { color: var(--kv-text-secondary); font-size: 9px; }
.services-confirm { border: 1px solid var(--kv-border); border-radius: 4px; padding: 2px 6px; font-size: 9px; text-transform: uppercase; letter-spacing: .03em; white-space: nowrap; }
.services-confirm.is-confirmed { color: var(--kv-success); border-color: #c8e6d8; }
.services-confirm.is-pending { color: #9a6714; border-color: #efd9b8; }
.services-confirm.is-none { color: var(--kv-danger); border-color: #efc6cb; }
.services-confirm.is-muted { color: var(--kv-text-secondary); }
.services-empty { border: 1px dashed var(--kv-border); border-radius: var(--kv-radius); padding: 16px; color: var(--kv-text-secondary); font-size: 12px; text-align: center; }

/* CRM */
.crm-grid { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr); gap: 14px; margin-top: 14px; }
.crm-list { display: grid; gap: 7px; }
.crm-item { border: 1px solid var(--kv-border); border-radius: var(--kv-radius); padding: 9px; background: #fff; cursor: pointer; text-align: left; font: inherit; color: inherit; }
.crm-item:hover { border-color: var(--kv-accent); }
.crm-item strong { display: block; font-size: 12px; }
.crm-item span { display: block; color: var(--kv-text-secondary); font-size: 10px; margin-top: 2px; }
.crm-pipeline { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.crm-stage { border: 1px solid var(--kv-border); border-radius: 5px; padding: 6px; min-height: 64px; background: #fbfcfd; }
.crm-stage h4 { margin: 0 0 5px; font-size: 8px; letter-spacing: .05em; text-transform: uppercase; color: var(--kv-text-secondary); }
.crm-stage .crm-item { padding: 6px; margin-bottom: 4px; }
.crm-stage .crm-item strong { font-size: 10px; }
.crm-stage .crm-item span { font-size: 9px; }
.crm-detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.crm-detail-field { border: 1px solid var(--kv-border); border-radius: 5px; padding: 6px; font-size: 10px; }
.crm-detail-field span { display: block; color: var(--kv-text-secondary); font-size: 8px; text-transform: uppercase; }
.crm-section { margin-top: 10px; border-top: 1px solid var(--kv-border); padding-top: 8px; }
.crm-section h4 { margin: 0 0 5px; font-size: 11px; }
.crm-contact-row { display: flex; justify-content: space-between; gap: 6px; border-bottom: 1px solid var(--kv-border); padding: 5px 0; font-size: 10px; }
.crm-contact-row small { color: var(--kv-text-secondary); }
.crm-form-inline { display: grid; grid-template-columns: 1fr 1fr; gap: 5px; margin-top: 6px; }
.crm-form-inline input, .crm-form-inline select { min-width: 0; }
.crm-doc-list { display: flex; flex-wrap: wrap; gap: 5px; }
.crm-doc-list a { font-size: 9px; border: 1px solid var(--kv-border); border-radius: 4px; padding: 3px 5px; text-decoration: none; color: var(--kv-accent); }
.crm-stage-history { margin: 5px 0 0; padding-left: 16px; font-size: 9px; color: var(--kv-text-secondary); }
.crm-actions { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 8px; }
.crm-actions .btn { min-height: 27px; font-size: 9px; }
@media (max-width: 900px) { .crm-grid { grid-template-columns: 1fr; } .crm-pipeline { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 600px) { .crm-detail-grid { grid-template-columns: 1fr; } .crm-pipeline { grid-template-columns: 1fr; } }

/* Quoting */
.quote-calc { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:6px; border:1px solid var(--kv-border); border-radius:6px; padding:8px; margin:10px 0; background:#fbfcfd; }
.quote-calc div { font-size:10px; color:var(--kv-text-secondary); }
.quote-calc strong { display:block; color:var(--kv-text-primary); font-size:13px; }
.quote-card { border:1px solid var(--kv-border); border-left:3px solid var(--kv-accent); border-radius:var(--kv-radius); padding:9px; background:#fff; cursor:pointer; text-align:left; font:inherit; color:inherit; }
.quote-card.is-approved { border-left-color:var(--kv-success); }
.quote-card.is-draft { border-left-color:#9aa8b7; }
.quote-card.is-rejected { border-left-color:var(--kv-danger); }
.quote-card strong { display:block; font-size:12px; }
.quote-card span { display:block; color:var(--kv-text-secondary); font-size:10px; margin-top:2px; }
.quote-actions { display:flex; flex-wrap:wrap; gap:5px; margin-top:8px; }
.quote-actions .btn { min-height:27px; font-size:9px; }
.quote-breakdown { width:100%; border-collapse:collapse; font-size:10px; }
.quote-breakdown td { padding:4px 2px; border-bottom:1px solid var(--kv-border); }
.quote-breakdown td:last-child { text-align:right; white-space:nowrap; }
.quote-status { border:1px solid var(--kv-border); border-radius:4px; padding:2px 6px; font-size:9px; text-transform:uppercase; }
.quote-status.is-approved { color:var(--kv-success); border-color:#c8e6d8; }
.quote-status.is-rejected { color:var(--kv-danger); border-color:#efc6cb; }
.quote-status.is-accepted { color:var(--kv-success); border-color:#c8e6d8; }
.delivery-demo { border:1px dashed var(--kv-border); border-radius:6px; padding:8px; background:#fbfcfd; margin-top:8px; }
.delivery-demo pre { white-space:pre-wrap; font-size:10px; margin:5px 0; max-height:150px; overflow:auto; }
.delivery-channel { display:flex; justify-content:space-between; gap:8px; align-items:center; padding:5px 0; border-bottom:1px solid var(--kv-border); font-size:10px; }
@media(max-width:700px){ .quote-calc{grid-template-columns:repeat(2,minmax(0,1fr));} }

/* Contracts */
.contract-card { border:1px solid var(--kv-border); border-left:3px solid var(--kv-accent); border-radius:var(--kv-radius); padding:9px; background:#fff; cursor:pointer; text-align:left; font:inherit; color:inherit; }
.contract-card.is-active { border-left-color:var(--kv-success); }
.contract-card.is-terminated { border-left-color:var(--kv-danger); }
.contract-card strong { display:block; font-size:12px; }
.contract-card span { display:block; color:var(--kv-text-secondary); font-size:10px; margin-top:2px; }
.contract-req { border-bottom:1px solid var(--kv-border); padding:5px 0; font-size:10px; }
.contract-req:last-child { border-bottom:0; }
.contract-req strong { display:block; font-size:11px; }
.contract-req span { color:var(--kv-text-secondary); }
.contract-form-inline { display:grid; grid-template-columns:1.3fr 1fr .6fr .8fr .7fr .7fr; gap:5px; margin-top:6px; align-items:end; }
.contract-form-inline .btn { min-height:30px; }
@media(max-width:800px){ .contract-form-inline{grid-template-columns:1fr 1fr;} }

/* HR */
.hr-employee-card { border:1px solid var(--kv-border); border-radius:var(--kv-radius); padding:9px; background:#fff; cursor:pointer; text-align:left; font:inherit; color:inherit; }
.hr-employee-card strong { display:block; font-size:12px; }
.hr-employee-card span { display:block; color:var(--kv-text-secondary); font-size:10px; margin-top:2px; }
.hr-status { border:1px solid var(--kv-border); border-radius:4px; padding:2px 6px; font-size:9px; text-transform:uppercase; }
.hr-task { display:flex; justify-content:space-between; gap:8px; align-items:center; border-bottom:1px solid var(--kv-border); padding:5px 0; font-size:10px; }
.hr-task:last-child { border-bottom:0; }
.hr-doc-row { display:flex; justify-content:space-between; gap:8px; border-bottom:1px solid var(--kv-border); padding:5px 0; font-size:10px; }
.hr-doc-row a { color:var(--kv-accent); text-decoration:none; }
.hr-form-inline { display:grid; grid-template-columns:1fr 1fr auto; gap:5px; margin-top:6px; align-items:end; }
@media(max-width:700px){.hr-form-inline{grid-template-columns:1fr;}}

/* Payroll */
.payroll-period { border:1px solid var(--kv-border); border-radius:var(--kv-radius); padding:9px; background:#fff; cursor:pointer; text-align:left; font:inherit; color:inherit; }
.payroll-period strong { display:block; font-size:12px; }
.payroll-period span { display:block; color:var(--kv-text-secondary); font-size:10px; margin-top:2px; }
.payroll-status { border:1px solid var(--kv-border); border-radius:4px; padding:2px 6px; font-size:9px; text-transform:uppercase; }
.payroll-table { width:100%; border-collapse:collapse; font-size:9px; }
.payroll-table th,.payroll-table td { padding:4px 3px; border-bottom:1px solid var(--kv-border); text-align:right; }
.payroll-table th:first-child,.payroll-table td:first-child { text-align:left; }
.payroll-adjust { display:grid; grid-template-columns:.8fr .8fr 1.5fr .7fr auto; gap:4px; margin-top:6px; align-items:end; }
@media(max-width:800px){.payroll-adjust{grid-template-columns:1fr 1fr;}}

/* Category navigation */
.category-tabs { display:flex; gap:6px; margin:0 0 8px; padding:4px; border:1px solid var(--kv-border); border-radius:var(--kv-radius); background:#fff; width:fit-content; }
.category-tab { display:flex; align-items:center; gap:6px; border:0; background:transparent; color:var(--kv-text-secondary); font:inherit; font-size:11px; padding:7px 12px; border-radius:5px; cursor:pointer; }
.category-tab.is-active { background:var(--kv-navy); color:#fff; }
.category-tab .icon { width:15px; height:15px; }
.view-tabs { margin-top:0; }

/* Three-category navigation: categories own the rail; tools live inside the page. */
@media (min-width: 1200px) {
  .category-tabs {
    position: fixed;
    top: 68px;
    bottom: 0;
    left: 0;
    z-index: 55;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
    width: 224px;
    max-width: none;
    margin: 0;
    padding: 22px 14px 18px;
    overflow-y: auto;
    background: var(--kv-primary);
    border: 0;
    border-right: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 0;
  }
  .category-tabs::before {
    content: "Categorías";
    display: block;
    padding: 0 10px 10px;
    color: rgba(255, 255, 255, 0.42);
    font-size: 9px;
    font-weight: 500;
    letter-spacing: 0.13em;
    text-transform: uppercase;
  }
  .category-tab {
    width: 100%;
    padding: 10px 12px;
    color: rgba(255, 255, 255, 0.72);
    background: transparent;
    border-radius: 6px;
    font-size: 12px;
  }
  .category-tab:hover { color: #fff; background: rgba(255,255,255,0.07); }
  .category-tab.is-active { color: #fff; background: rgba(255,255,255,0.13); }
  .page { margin-left: 224px; width: auto; max-width: none; }
  .view-tabs {
    position: static;
    display: flex;
    flex-direction: row;
    width: max-content;
    max-width: 100%;
    margin: 0 0 22px;
    padding: 4px;
    overflow-x: auto;
    background: #fff;
    border: 1px solid var(--kv-border);
    border-radius: var(--kv-radius-md);
    box-shadow: none;
  }
  .view-tabs::before {
    content: "Herramientas";
    flex: 0 0 auto;
    align-self: center;
    padding: 0 10px 0 6px;
    color: var(--kv-text-secondary);
    font-size: 9px;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
  }
  .view-tabs::after { content: none; }
  .view-tab { width: auto; justify-content: flex-start; }
}

/* Final navigation: original operational routes remain in the left rail;
   the three categories are grouping shortcuts in the content header. */
@media (min-width: 1200px) {
  .category-tabs {
    position: static;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 4px;
    width: fit-content;
    max-width: 100%;
    margin: 0 0 8px;
    padding: 4px;
    overflow-x: auto;
    background: #fff;
    border: 1px solid var(--kv-border);
    border-radius: var(--kv-radius);
    border-right: 1px solid var(--kv-border);
  }
  .category-tabs::before { content: "Grupos"; display: block; padding: 0 8px; color: var(--kv-text-secondary); font-size: 9px; letter-spacing: .12em; text-transform: uppercase; }
  .category-tab { width: auto; color: var(--kv-text-secondary); background: transparent; padding: 7px 11px; }
  .category-tab:hover { color: var(--kv-primary); background: var(--kv-background); }
  .category-tab.is-active { color: #fff; background: var(--kv-navy); }
  .page { margin-left: 224px; width: auto; max-width: none; }
  .view-tabs {
    position: fixed;
    top: 68px; bottom: 0; left: 0;
    z-index: 55;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 5px;
    width: 224px; max-width: none;
    margin: 0;
    padding: 22px 14px 18px;
    overflow-y: auto;
    background: var(--kv-primary);
    border: 0;
    border-right: 1px solid rgba(255,255,255,.08);
    border-radius: 0;
    box-shadow: none;
  }
  .view-tabs::before { content: "Operación"; display: block; padding: 0 10px 10px; color: rgba(255,255,255,.42); font-size: 9px; letter-spacing: .13em; text-transform: uppercase; }
  .view-tabs::after { content: "KORDVEX · Gestión Operativa"; margin-top: auto; padding: 18px 10px 0; color: rgba(255,255,255,.3); border-top: 1px solid rgba(255,255,255,.09); font-size: 8px; letter-spacing: .08em; text-transform: uppercase; }
  .view-tab { width: 100%; justify-content: flex-start; color: rgba(255,255,255,.72); }
  .view-tab:hover { color: #fff; background: rgba(255,255,255,.07); }
  .view-tab.is-active { color: #fff; background: rgba(255,255,255,.13); }
}

/* Grouped rail: categories at the top, operational routes below. */
@media (min-width: 1200px) {
  .category-tabs {
    position: fixed;
    top: 68px; left: 0;
    z-index: 56;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
    width: 224px;
    margin: 0;
    padding: 18px 14px 12px;
    background: var(--kv-primary);
    border: 0;
    border-right: 1px solid rgba(255,255,255,.08);
    border-radius: 0;
  }
  .category-tabs::before { content: "Grupos"; display: block; padding: 0 10px 9px; color: rgba(255,255,255,.42); font-size: 9px; letter-spacing: .13em; text-transform: uppercase; }
  .category-tab { width: 100%; justify-content: flex-start; color: rgba(255,255,255,.72); background: transparent; padding: 9px 11px; }
  .category-tab:hover { color: #fff; background: rgba(255,255,255,.07); }
  .category-tab.is-active { color: #fff; background: rgba(255,255,255,.15); }
  .view-tabs {
    position: fixed;
    top: 225px; bottom: 0; left: 0;
    z-index: 55;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
    width: 224px; max-width: none;
    margin: 0;
    padding: 10px 14px 18px;
    overflow-y: auto;
    background: var(--kv-primary);
    border: 0;
    border-right: 1px solid rgba(255,255,255,.08);
    border-radius: 0;
    box-shadow: none;
  }
  .view-tabs::before { content: "Operación"; display: block; padding: 4px 10px 8px; color: rgba(255,255,255,.42); font-size: 9px; letter-spacing: .13em; text-transform: uppercase; }
  .view-tabs::after { content: "KORDVEX · Gestión Operativa"; margin-top: auto; padding: 16px 10px 0; color: rgba(255,255,255,.3); border-top: 1px solid rgba(255,255,255,.09); font-size: 8px; letter-spacing: .08em; text-transform: uppercase; }
  .view-tab { width: 100%; justify-content: flex-start; color: rgba(255,255,255,.72); }
  .view-tab:hover { color: #fff; background: rgba(255,255,255,.07); }
  .view-tab.is-active { color: #fff; background: rgba(255,255,255,.13); }
  .page { margin-left: 224px; width: auto; max-width: none; }
  .group-tools { display: flex; align-items: center; gap: 5px; flex-wrap: wrap; margin: 0 0 10px; padding: 5px; background: #fff; border: 1px solid var(--kv-border); border-radius: var(--kv-radius); }
  .group-tools[hidden] { display: none; }
  .group-tool { border: 1px solid var(--kv-border); background: var(--kv-background); color: var(--kv-text-secondary); border-radius: 5px; padding: 7px 11px; font: inherit; font-size: 11px; cursor: pointer; }
  .group-tool.is-active { background: var(--kv-navy); color: #fff; border-color: var(--kv-navy); }
}
@media (max-width: 1199px) {
  .category-tabs { position: static; display: flex; flex-direction: row; gap: 4px; width: fit-content; max-width: 100%; overflow-x: auto; background: #fff; border: 1px solid var(--kv-border); border-radius: var(--kv-radius); padding: 4px; margin-bottom: 8px; }
  .category-tab { color: var(--kv-text-secondary); background: transparent; }
  .category-tab.is-active { color: #fff; background: var(--kv-navy); }
  .group-tools { display: flex; gap: 5px; flex-wrap: wrap; margin-bottom: 10px; }
  .group-tools[hidden] { display: none; }
  .group-tool { border: 1px solid var(--kv-border); background: #fff; border-radius: 5px; padding: 7px 11px; font: inherit; font-size: 11px; }
}

@media (min-width: 1200px) {
  .view-tabs { top: 185px; }
}

@media (min-width: 1200px) {
  .view-tabs { top: 225px; }
}

@media (min-width: 1200px) {
  .category-tabs {
    bottom: auto;
    height: auto;
    padding-bottom: 8px;
  }
  .view-tabs {
    top: 178px;
  }
}

/* Evita que el acento activo consuma ancho y recorte icono/texto del rail. */
@media (min-width: 1200px) {
  .view-tabs {
    overflow-x: hidden;
  }
  .view-tab {
    box-sizing: border-box;
    min-width: 0;
    width: 100%;
    padding-left: 12px;
    padding-right: 12px;
  }
  .view-tab .icon {
    flex: 0 0 auto;
  }
  .view-tab > span:not(.view-tab-badge) {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .view-tab.is-active::before {
    content: none;
    display: none;
  }
  .view-tab.is-active {
    box-shadow: inset 3px 0 0 var(--kv-accent);
  }
}

@media (min-width: 1200px) {
  .view-tab {
    padding-left: 18px;
    gap: 8px;
  }
  .view-tab .icon {
    width: 16px;
    height: 16px;
    margin-left: 1px;
  }
  .view-tab > span:not(.view-tab-badge) {
    overflow: visible;
    text-overflow: clip;
  }
  .view-tabs {
    padding-left: 12px;
    padding-right: 12px;
  }
}

/* El acento del ítem activo no debe pintar ni recortar el icono. */
@media (min-width: 1200px) {
  .view-tab.is-active::before {
    display: none !important;
    content: none !important;
  }
  .view-tab.is-active {
    box-shadow: none !important;
  }
  #tab-calendar .icon {
    overflow: visible;
    flex-shrink: 0;
  }
}

/* El rail operativo va primero; los grupos van al pie del rail. */
@media (min-width: 1200px) {
  .view-tabs {
    top: 68px;
    bottom: 190px;
    padding-top: 18px;
  }
  .view-tabs::before {
    content: "Operación";
  }
  .view-tabs::after {
    content: none;
  }
  .category-tabs {
    top: auto;
    bottom: 0;
    left: 0;
    height: auto;
    padding: 12px 14px 18px;
    border-top: 1px solid rgba(255,255,255,.08);
    border-right: 1px solid rgba(255,255,255,.08);
  }
}

@media (min-width: 1200px) {
  .view-tab { overflow: visible; }
  .view-tab .icon { overflow: visible; }
  #tab-calendar .icon { width: 18px; height: 18px; margin-left: 0; }
}

/* Sin divisor entre el rail operativo y los grupos. */
@media (min-width: 1200px) {
  .category-tabs {
    border-top: 0 !important;
  }
}

/* Submenú de grupo dentro del propio contenedor de grupos. */
@media (min-width: 1200px) {
  .category-tabs {
    max-height: 340px;
    overflow-y: auto;
    overflow-x: hidden;
  }
  .view-tabs {
    top: 68px;
    bottom: 350px;
  }
  .category-tabs .group-tools {
    position: static;
    display: flex;
    flex-direction: column;
    gap: 2px;
    width: 100%;
    margin: 6px 0 0;
    padding: 6px 0 0;
    background: transparent;
    border: 0;
    border-radius: 0;
  }
  .category-tabs .group-tools[hidden] { display: none; }
  .category-tabs .group-tool {
    width: 100%;
    text-align: left;
    padding: 7px 10px 7px 30px;
    color: rgba(255,255,255,.66);
    background: transparent;
    border: 0;
    border-radius: 5px;
    font: inherit;
    font-size: 11px;
  }
  .category-tabs .group-tool:hover { color: #fff; background: rgba(255,255,255,.07); }
  .category-tabs .group-tool.is-active { color: #fff; background: rgba(255,255,255,.13); }
}

@media (min-width: 1200px) {
  /* El rail operativo termina exactamente donde empieza el contenedor de grupos. */
  .view-tabs { bottom: 340px; }
}

@media (min-width: 1200px) {
  .category-tabs {
    height: 340px;
    max-height: 340px;
  }
}

/* =========================
   GOVERNNOR CONTROL PLANE
   ========================= */
.governor-view { max-width: 1120px; }
.governor-status { display:flex; align-items:center; gap:8px; margin:0 0 14px; padding:9px 12px; border:1px solid var(--kv-border); border-radius:9px; background:#fff; color:var(--kv-text-secondary); font-size:10.5px; }
.governor-status.is-error { color: var(--kv-danger); border-color:#e5c5c1; background:#fbf2f0; }
.governor-pulse { width:7px; height:7px; border-radius:50%; background:#2e8b57; box-shadow:0 0 0 3px rgba(46,139,87,.14); }
.governor-status.is-error .governor-pulse { background:var(--kv-danger); box-shadow:0 0 0 3px rgba(182,59,75,.12); }
.governor-build { margin-left:auto; color:var(--kv-text-tertiary); font-family:ui-monospace,SFMono-Regular,Menlo,monospace; font-size:9.5px; }
.governor-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:14px; margin:14px 0; }
.governor-grid .patrol-panel { margin:0; min-width:0; }
.governor-facts { display:grid; gap:0; margin:8px 0 0; border-top:1px solid var(--kv-border-soft); }
.governor-facts > div { display:flex; justify-content:space-between; gap:12px; padding:8px 0; border-bottom:1px solid var(--kv-border-soft); }
.governor-facts dt { color:var(--kv-text-secondary); font-size:10.5px; }
.governor-facts dd { margin:0; color:var(--ink); font-size:10.5px; font-weight:650; text-align:right; overflow-wrap:anywhere; }
.governor-actions { margin:0 0 14px; }
.governor-actions .live-controls { margin-top:8px; flex-wrap:wrap; }
.governor-audit-row { display:flex; justify-content:space-between; gap:12px; padding:7px 0; border-bottom:1px solid var(--kv-border-soft); font-size:10.5px; }
.governor-audit-row time { color:var(--kv-text-tertiary); font-variant-numeric:tabular-nums; }
@media (max-width: 900px) {
  .governor-grid { grid-template-columns:1fr; }
  .governor-status { flex-wrap:wrap; }
  .governor-build { width:100%; margin-left:15px; }
}
.governor-list { display:grid; gap:7px; margin-top:8px; }
.governor-list-row { display:flex; justify-content:space-between; gap:12px; align-items:center; padding:8px 0; border-bottom:1px solid var(--kv-border-soft); font-size:10.5px; }
.governor-list-row > div:first-child { min-width:0; }
.governor-list-row strong { display:block; color:var(--ink); font-size:11px; }
.governor-list-row span { display:block; color:var(--kv-text-secondary); margin-top:2px; overflow-wrap:anywhere; }
.governor-row-actions { display:flex; gap:4px; flex:0 0 auto; flex-wrap:wrap; justify-content:flex-end; }
.governor-row-actions .btn { min-height:28px; padding:4px 7px; font-size:9.5px; }
.governor-tag { color:#2e8b57 !important; font-weight:700; }
@media (max-width: 700px) {
  .governor-list-row { align-items:flex-start; flex-direction:column; gap:5px; }
  .governor-row-actions { justify-content:flex-start; }
}
.auth-recovery-link { display:block; margin:12px auto 0; padding:4px 8px; border:0; background:transparent; color:var(--kv-text-secondary); font:inherit; font-size:10.5px; text-decoration:underline; cursor:pointer; }
.governor-tools-nav { display:flex; gap:4px; overflow-x:auto; padding:4px 0 10px; margin:0 0 4px; scrollbar-width:none; }
.governor-tools-nav::-webkit-scrollbar { display:none; }
.governor-tools-nav button { flex:0 0 auto; min-height:34px; padding:7px 12px; border:1px solid var(--kv-border); border-radius:999px; background:#fff; color:var(--kv-text-secondary); font:inherit; font-size:10.5px; font-weight:650; cursor:pointer; }
.governor-tools-nav button.is-active { background:var(--kv-primary); color:#fff; border-color:var(--kv-primary); }
.governor-tools-nav button:hover { border-color:var(--kv-accent); }
.first-run { display:flex; align-items:center; justify-content:space-between; gap:18px; margin:14px 0; padding:16px 18px; border:1px solid #cddfd1; border-radius:14px; background:linear-gradient(105deg,#f0f7f1,#fff); }
.first-run h2 { margin:3px 0 4px; font-size:18px; letter-spacing:-.03em; }
.first-run p { margin:0; max-width:620px; color:var(--kv-text-secondary); font-size:11px; line-height:1.5; }
.first-run-actions { display:flex; align-items:center; gap:7px; flex-wrap:wrap; justify-content:flex-end; }
.first-run-actions .icon-button { font-size:18px; }
@media (max-width: 760px) { .first-run { align-items:flex-start; flex-direction:column; } .first-run-actions { width:100%; justify-content:flex-start; } }
.remuneration-summary { display:flex; gap:18px; flex-wrap:wrap; margin:14px 0; }
.remuneration-summary > div { flex:1; min-width:120px; padding:10px 12px; border:1px solid var(--kv-border); border-radius:9px; background:#f8faf7; }
.remuneration-summary span { display:block; color:var(--kv-text-secondary); font-size:9px; text-transform:uppercase; letter-spacing:.08em; }
.remuneration-summary strong { display:block; margin-top:4px; font-size:18px; }
.remuneration-table { width:100%; border-collapse:collapse; min-width:620px; font-size:10px; }
.remuneration-table th, .remuneration-table td { padding:8px 9px; border-bottom:1px solid var(--kv-border-soft); text-align:left; }
.remuneration-table th { color:var(--kv-text-secondary); font-size:8px; text-transform:uppercase; letter-spacing:.08em; }
.remuneration-table td:nth-child(n+2), .remuneration-table th:nth-child(n+2) { text-align:right; white-space:nowrap; }
.pwa-install-card { display:flex; align-items:center; gap:10px; margin-top:14px; padding:11px; border:1px solid #cddfd1; border-radius:12px; background:#f0f7f1; }
.pwa-install-icon { display:grid; place-items:center; width:34px; height:34px; border-radius:9px; background:var(--kv-primary); color:#fff; font-weight:800; flex:0 0 auto; }
.pwa-install-copy { min-width:0; flex:1; display:grid; gap:2px; }
.pwa-install-copy strong { color:var(--ink); font-size:10px; }
.pwa-install-copy span { color:var(--kv-text-secondary); font-size:8.5px; line-height:1.35; }
.pwa-install-button { flex:0 0 auto; min-height:32px; padding:6px 9px; font-size:9px; }
.pwa-ios-dialog { width:min(430px,calc(100vw - 28px)); }
.pwa-ios-steps { font-size:11px; line-height:1.6; color:var(--kv-text-secondary); }
.pwa-ios-steps p { margin:0 0 12px; }
.pwa-ios-steps ol { margin:0 0 14px; padding-left:20px; }
.pwa-ios-steps li { margin-bottom:8px; }
.pwa-ios-share { display:inline-grid; place-items:center; width:22px; height:22px; border:1px solid var(--kv-border); border-radius:5px; color:var(--kv-primary); font-size:12px; }
@media (max-width: 380px) { .pwa-install-card { flex-wrap:wrap; } .pwa-install-copy { flex-basis:calc(100% - 44px); } .pwa-install-button { width:100%; } }
.history-toolbar { display:flex; align-items:end; justify-content:space-between; gap:16px; margin:14px 0; }
.history-search { max-width:340px; width:100%; }
.history-groups { display:grid; gap:12px; }
.history-person { border:1px solid var(--kv-border); border-radius:12px; background:#fff; overflow:hidden; }
.history-person > summary { display:flex; align-items:center; justify-content:space-between; gap:12px; padding:14px 16px; cursor:pointer; list-style:none; background:#f8faf7; }
.history-person > summary::-webkit-details-marker { display:none; }
.history-person-title { display:flex; flex-direction:column; gap:2px; min-width:0; }
.history-person-title strong { color:var(--ink); font-size:12px; }
.history-person-title span { color:var(--kv-text-secondary); font-size:9px; }
.history-person-totals { display:flex; gap:14px; text-align:right; flex:0 0 auto; }
.history-person-totals span { display:block; color:var(--kv-text-secondary); font-size:8px; text-transform:uppercase; letter-spacing:.06em; }
.history-person-totals strong { display:block; font-size:12px; color:var(--ink); }
.history-entries { overflow-x:auto; }
.history-table { width:100%; border-collapse:collapse; min-width:720px; font-size:10px; }
.history-table th, .history-table td { padding:9px 11px; border-top:1px solid var(--kv-border-soft); text-align:left; }
.history-table th { color:var(--kv-text-secondary); font-size:8px; text-transform:uppercase; letter-spacing:.07em; background:#fbfcfa; }
.history-table td.numeric { text-align:right; white-space:nowrap; }
.history-table td.actions { white-space:nowrap; text-align:right; }
.history-table .btn { min-height:28px; padding:4px 7px; font-size:8px; }
.history-empty { padding:28px; text-align:center; color:var(--kv-text-secondary); border:1px dashed var(--kv-border); border-radius:12px; background:#fff; }
@media (max-width:720px) { .history-toolbar { display:block; } .history-search { max-width:none; margin-bottom:8px; } .history-person > summary { align-items:flex-start; } .history-person-totals { gap:8px; } }
.sentinel-attach-row { display:flex; align-items:center; gap:8px; flex-wrap:wrap; }
.sentinel-image-name { color:var(--kv-text-secondary); font-size:9px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; max-width:220px; }
.sentinel-image-actions { display:flex; gap:8px; flex-wrap:wrap; margin:8px 0 4px; }
.sentinel-review-dialog { width:min(980px,calc(100vw - 24px)); }
.sentinel-review-dialog .table-wrap { max-height:46vh; overflow:auto; border:1px solid var(--kv-border); border-radius:8px; margin:10px 0; }
.sentinel-review-dialog .history-service-fields { margin-top:12px; }
.sentinel-review-actions { flex-wrap:wrap; }
.sentinel-review-field { width:100%; min-width:88px; padding:5px 6px; border:1px solid var(--kv-border); border-radius:5px; font-size:9px; color:var(--ink); background:#fff; }
.sentinel-review-field[type="date"], .sentinel-review-field[type="time"] { min-width:112px; }
.onboarding-panel { margin: 0 0 16px; padding: 18px; border: 1px solid var(--kv-border); border-radius: 12px; background: #fff; box-shadow: var(--kv-shadow-card); }
.onboarding-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }.onboarding-head h2 { margin: 2px 0 4px; font-size: 20px; }.onboarding-head p:not(.eyebrow) { margin: 0; color: var(--kv-text-secondary); font-size: 11px; }
.onboarding-progress { height: 5px; border-radius: 10px; background: var(--kv-surface); margin: 14px 0; overflow: hidden; }.onboarding-progress span { display: block; height: 100%; width: 0; background: var(--kv-accent); transition: width .3s; }
.onboarding-steps { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 6px; }.onboarding-step { display: flex; align-items: center; gap: 8px; border: 1px solid var(--kv-border); border-radius: 8px; padding: 8px 9px; text-align: left; background: #fbfcfd; color: var(--ink); font-size: 10px; cursor: pointer; }.onboarding-step:hover { border-color: var(--kv-accent); }.onboarding-step.is-done { background: #f0f8f4; border-color: #c9e6d9; color: #266b53; cursor: default; }.onboarding-step i { width: 18px; height: 18px; border-radius: 50%; display: grid; place-items: center; background: var(--kv-surface); color: var(--kv-text-secondary); font-size: 9px; font-style: normal; flex: 0 0 auto; }.onboarding-step.is-done i { background: var(--kv-success); color: #fff; }.onboarding-step span { display: grid; gap: 1px; }.onboarding-step strong { font-size: 10px; }.onboarding-step small { font-size: 8px; color: var(--kv-text-secondary); }
@media(max-width:700px){.onboarding-steps{grid-template-columns:1fr}.onboarding-panel{padding:14px}}

.table-pagination{display:flex;align-items:center;justify-content:space-between;gap:12px;margin:14px 0 4px;padding:10px 0;border-top:1px solid var(--kv-border)}.table-pagination[hidden]{display:none}.table-pagination span{font-size:10px;color:var(--kv-text-secondary);font-weight:600}.table-pagination .btn{width:auto;min-height:32px;padding:5px 10px;font-size:10px}

.mfa-banner{display:flex;justify-content:space-between;gap:18px;align-items:center;margin:0 0 16px;padding:16px 18px;border:1px solid #d8e2eb;border-radius:12px;background:#f3f7fa}.mfa-banner[hidden]{display:none}.mfa-banner h2{margin:2px 0 3px;font-size:17px}.mfa-banner p:not(.eyebrow){margin:0;color:var(--kv-text-secondary);font-size:10px;max-width:700px}.mfa-banner-actions{display:flex;align-items:center;gap:6px;flex:0 0 auto}.mfa-banner-actions .btn{width:auto;white-space:nowrap}@media(max-width:700px){.mfa-banner{align-items:flex-start;flex-direction:column}.mfa-banner-actions{width:100%;justify-content:space-between}}
