:root {
  color-scheme: light;
  --ink: #17202a;
  --muted: #657386;
  --line: #d9e1ea;
  --panel: #ffffff;
  --accent: #0f766e;
  --accent-2: #1d4ed8;
  --danger: #b42318;
  --ok: #18794e;
  --bg: #eef3f7;
  --radius-control: 10px;
  --radius-panel: 16px;
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  font-family: Segoe UI, Arial, sans-serif;
  color: var(--ink);
  background: linear-gradient(
    180deg,
    #071a33 0,
    #0b2444 25vh,
    #2f5f8f 42vh,
    #d8e6f3 68vh,
    #ffffff 100vh
  ) fixed;
}

.brand-header {
  height: 96px;
  overflow: hidden;
  background: #ffffff url("../images/mobilapps-header.png") center 48% / 50% auto no-repeat;
  border-bottom: 4px solid #10b9b1;
}

.brand-header.rondin-header {
  height: 140px;
  background-image: url("../images/mobil-rondin.png");
  background-size: auto 128px;
  border-bottom-color: #18c75a;
}

.brand-header img {
  display: none;
}

.topbar {
  height: 56px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 0 24px;
  background: #ffffff;
  border-bottom: 1px solid var(--line);
}

.topbar > .brand {
  justify-self: start;
}

.topbar nav {
  justify-self: end;
}

.current-user-label {
  min-width: 0;
  display: grid;
  justify-items: center;
  line-height: 1.15;
  text-align: center;
}

.current-user-label span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
}

.current-user-label strong {
  max-width: min(48vw, 520px);
  overflow: hidden;
  color: var(--ink);
  font-size: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.topbar.with-brand-header {
  border-top: 0;
}

.brand,
.topbar a {
  color: var(--ink);
  text-decoration: none;
  font-weight: 600;
}

.topbar nav {
  display: flex;
  gap: 18px;
}

main {
  padding: 24px;
}

.commercial-home {
  width: min(1180px, 100%);
  margin: 0 auto;
  display: grid;
  gap: 28px;
}

.commercial-hero {
  min-height: 430px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, .9fr)) minmax(280px, 1.3fr);
  align-items: center;
  gap: 34px;
  padding: 34px;
  background: #ffffff;
  border: 1px solid var(--line);
}

.hero-copy {
  display: grid;
  gap: 16px;
}

.domain-badge {
  width: fit-content;
  padding: 7px 10px;
  color: #0f766e;
  background: #e6f5f1;
  border: 1px solid #b9e3d9;
  font-weight: 800;
  letter-spacing: 0;
}

.hero-copy h1 {
  max-width: 720px;
  margin: 0;
  font-size: 42px;
  line-height: 1.08;
}

.hero-copy p {
  max-width: 650px;
  margin: 0;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.55;
}

.hero-actions,
.product-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.hero-visual {
  min-height: 310px;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: #eef6f6;
  border: 1px solid #c9dde5;
}

.hero-visual img {
  width: min(360px, 100%);
  height: auto;
  display: block;
}

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

.product-card {
  display: grid;
  grid-template-rows: 210px 1fr;
  overflow: hidden;
  background: var(--panel);
  border: 1px solid var(--line);
}

.product-card img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.product-body {
  display: grid;
  gap: 10px;
  align-content: start;
  padding: 20px;
}

.product-body span {
  color: #0f766e;
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
}

.product-body h2 {
  margin: 0;
  color: var(--ink);
  font-size: 20px;
  line-height: 1.25;
}

.product-body p {
  margin: 0;
  color: var(--muted);
  line-height: 1.48;
}

.construction-shell {
  min-height: calc(100vh - 104px);
  display: grid;
  place-items: center;
}

.construction-panel {
  width: min(620px, 100%);
  display: grid;
  gap: 14px;
  padding: 34px;
  background: #ffffff;
  border: 1px solid var(--line);
}

.construction-panel h1 {
  margin-bottom: 0;
}

.construction-panel p {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 18px;
}

.home-shell {
  width: min(1040px, 100%);
  margin: 24px auto 0;
  display: grid;
  gap: 22px;
}

.home-visual {
  display: grid;
  place-items: center;
  padding: 18px;
  background: #ffffff;
  border: 1px solid var(--line);
}

.home-visual img {
  width: min(520px, 100%);
  height: auto;
  display: block;
}

.entry-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 18px;
  width: 100%;
}

.single-entry {
  max-width: 520px;
  margin: 0 auto;
}

.entry-panel {
  min-height: 180px;
  padding: 26px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 8px;
  color: #fff;
  text-decoration: none;
}

.entry-panel.admin {
  background: #1f4f78;
}

.entry-panel.portal {
  background: #157a62;
}

.entry-panel span {
  font-size: 15px;
  opacity: .9;
}

.entry-panel strong {
  font-size: 24px;
  line-height: 1.2;
}

.login-shell,
.portal-shell {
  min-height: calc(100vh - 104px);
  display: grid;
  place-items: center;
}

.portal-stack {
  width: min(560px, 100%);
  display: grid;
  gap: 18px;
}

.portal-stack.wide {
  width: min(720px, 100%);
}

.portal-visual img {
  width: min(360px, 100%);
}

.module-logo {
  display: block;
  width: min(260px, 100%);
  height: auto;
  margin: 0 auto 16px;
}

.module-logo.compact {
  width: 110px;
  margin: 0;
}

.module-logo.compact.corner,
.module-logo.menu-corner {
  width: 72px;
  max-width: 72px;
  margin: 0;
  justify-self: start;
}

.module-logo.menu-corner {
  display: block;
  margin-bottom: 10px;
}

.login-box,
.portal-card {
  width: min(440px, 100%);
  background: var(--panel);
  border: 1px solid var(--line);
  padding: 28px;
}

.portal-card {
  margin: 0 auto;
}

.portal-card-logo {
  width: min(260px, 100%);
  display: block;
  margin: 0 auto 20px;
}

.register-card {
  width: 100%;
}

.event-row {
  display: grid;
  grid-template-columns: 52px 1fr;
  gap: 10px;
  align-items: start;
  margin-bottom: 14px;
}

.event-badge {
  min-height: 46px;
  display: grid;
  place-items: center;
  color: #ffffff;
  background: #157a62;
  font-weight: 800;
}

.event-combo {
  position: relative;
  min-width: 0;
}

.event-combo-button {
  width: 100%;
  min-height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 10px;
  color: var(--ink);
  background: #ffffff;
  border: 1px solid var(--line);
  text-align: left;
}

.event-combo-current {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
}

.event-combo-arrow {
  flex: 0 0 auto;
  color: var(--accent-2);
  font-weight: 900;
}

.event-combo-list {
  position: absolute;
  z-index: 20;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  display: grid;
  gap: 4px;
  max-height: 260px;
  overflow: auto;
  padding: 6px;
  background: #ffffff;
  border: 1px solid var(--line);
  box-shadow: 0 14px 32px rgba(15, 23, 42, 0.18);
}

.event-option {
  min-height: 58px;
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  color: var(--ink);
  background: #ffffff;
  border: 1px solid var(--line);
  font-weight: 700;
  text-align: left;
}

.event-option.selected {
  color: #ffffff;
  background: var(--accent);
  border-color: var(--accent);
}

.event-combo-current img,
.event-option img,
.event-combo-current .event-option-fallback,
.event-option-fallback {
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  object-fit: cover;
  border: 1px solid currentColor;
  background: #ffffff;
}

.event-option-fallback {
  display: grid;
  place-items: center;
  color: var(--accent-2);
}

.event-option-text {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.event-option-text strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.event-option-text small {
  color: inherit;
  font-weight: 700;
  opacity: 0.8;
}

.catalog-image-cell {
  display: grid;
  gap: 8px;
  min-width: 160px;
}

.catalog-image-cell img {
  width: 68px;
  height: 68px;
  object-fit: contain;
  background: #ffffff;
  border: 1px solid var(--line);
}

.catalog-image-cell input[type="file"] {
  max-width: 220px;
}

.person-photo-editor {
  display: grid;
  gap: 5px;
  min-width: 118px;
}

.person-photo-main {
  display: flex;
  align-items: flex-start;
  gap: 5px;
}

.person-photo-actions,
.person-camera-actions {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.person-photo-preview,
.person-camera-video {
  width: 72px;
  height: 72px;
  border: 1px solid #b7c8df;
  border-radius: 4px;
  background: #eef4fb;
  object-fit: cover;
}

.person-photo-icon-button {
  width: 32px;
  min-width: 32px;
  height: 32px;
  min-height: 32px;
  display: grid;
  place-items: center;
  margin: 0;
  padding: 6px;
  color: #ffffff;
  background: var(--accent-2);
  border: 0;
  border-radius: 4px;
  cursor: pointer;
}

.person-photo-icon-button.secondary {
  color: var(--accent-2);
  background: #f8fafc;
  border: 1px solid var(--line);
}

.person-photo-icon-button svg {
  width: 18px;
  height: 18px;
  display: block;
  fill: currentColor;
}

.person-photo-icon-button input[type="file"] {
  width: 1px;
  min-width: 1px;
  height: 1px;
  position: absolute;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
}

.person-camera-panel {
  display: flex;
  align-items: flex-start;
  gap: 5px;
}

.person-camera-panel .person-camera-video {
  width: 120px;
  height: 90px;
}

.person-photo-editor small {
  max-width: 145px;
  color: #42556e;
  font-size: 10px;
  line-height: 1.2;
}

.capture-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
  margin: 18px 0;
}

.capture-panel {
  display: grid;
  gap: 10px;
  padding: 14px;
  background: #f8fafc;
  border: 1px solid var(--line);
}

.capture-panel strong {
  font-size: 15px;
}

.capture-panel span {
  color: var(--muted);
  overflow-wrap: anywhere;
}

.capture-panel span.photo-status-ok {
  color: var(--ok);
  font-weight: 700;
}

.capture-panel span.photo-status-error {
  color: var(--danger);
  font-weight: 700;
}

.nfc-panel code {
  display: block;
  padding: 8px;
  color: var(--ink);
  background: #ffffff;
  border: 1px solid var(--line);
  overflow-wrap: anywhere;
}

.nfc-link-detected {
  margin-bottom: 14px;
  padding: 10px 12px;
  color: #0f5132;
  background: #e8f6ee;
  border: 1px solid #9fd3b5;
}

.round-points-panel {
  display: grid;
  gap: 8px;
  margin: 14px 0;
  padding: 12px;
  background: #f8fafc;
  border: 1px solid var(--line);
}

.round-point {
  display: grid;
  grid-template-columns: 38px 1fr;
  gap: 10px;
  align-items: start;
  padding: 8px;
  background: #ffffff;
  border: 1px solid var(--line);
}

.round-point.done {
  background: #e8f6ee;
  border-color: #9fd3b5;
}

.round-point-mark {
  min-height: 28px;
  display: grid;
  place-items: center;
  color: #ffffff;
  background: #cbd5e1;
  font-size: 12px;
  font-weight: 800;
}

.round-point.done .round-point-mark {
  background: var(--ok);
}

.round-point small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  overflow-wrap: anywhere;
}

.map-viewer {
  position: relative;
  overflow: auto;
  margin-bottom: 16px;
  background: #ffffff;
  border: 1px solid var(--line);
}

.map-viewer img {
  width: 100%;
  display: block;
}

.map-tag-marker {
  width: 28px;
  height: 28px;
  position: absolute;
  display: grid;
  place-items: center;
  color: #ffffff;
  background: #dc2626;
  border: 3px solid #ffffff;
  border-radius: 999px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .35);
  font-size: 10px;
  font-weight: 900;
  transform: translate(-50%, -50%);
}

.map-tag-marker.visited {
  background: var(--ok);
}

.round-map-positioner {
  grid-column: 1 / -1;
  display: grid;
  gap: 10px;
}

.round-map-positioner-canvas {
  position: relative;
  min-height: 220px;
  overflow: hidden;
  background: #f8fafc;
  border: 1px solid var(--line);
}

.round-map-positioner-canvas img {
  width: 100%;
  display: block;
  user-select: none;
}

.round-map-positioner-marker {
  width: 32px;
  height: 32px;
  position: absolute;
  left: 50%;
  top: 50%;
  cursor: grab;
  background: #dc2626;
  border: 4px solid #ffffff;
  border-radius: 999px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, .35);
  transform: translate(-50%, -50%);
  touch-action: none;
}

.round-map-positioner-marker:active {
  cursor: grabbing;
}

.round-map-positioner-marker::after {
  content: "";
  width: 8px;
  height: 8px;
  position: absolute;
  inset: 8px;
  background: #ffffff;
  border-radius: 999px;
}

.camera-mode {
  margin-bottom: 0;
}

.map-preview {
  min-height: 170px;
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  background: #d9e1ea;
}

.map-preview iframe {
  width: 100%;
  height: 100%;
  min-height: 170px;
  display: block;
  border: 0;
  opacity: 0;
  pointer-events: none;
}

.map-preview iframe.ready {
  opacity: 1;
}

.map-pin {
  width: 18px;
  height: 18px;
  position: absolute;
  z-index: 2;
  border: 3px solid #ffffff;
  border-radius: 999px 999px 999px 0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .32);
  pointer-events: none;
  transform: translate(-50%, -100%) rotate(-45deg);
}

.map-pin::after {
  content: "";
  width: 6px;
  height: 6px;
  position: absolute;
  top: 3px;
  left: 3px;
  border-radius: 50%;
  background: #ffffff;
}

.map-pin.current {
  background: #1d4ed8;
}

.map-pin.zone {
  background: #facc15;
  border-color: #78350f;
}

.map-legend {
  display: grid;
  gap: 10px;
  color: var(--muted);
  font-size: 12px;
}

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

.map-legend code {
  color: var(--text);
  font-family: "Segoe UI", Arial, sans-serif;
  font-weight: 700;
}

.allowed-zone-data {
  display: none;
}

.legend-dot {
  width: 10px;
  height: 10px;
  display: inline-block;
  border-radius: 50%;
}

.legend-dot.current {
  background: #1d4ed8;
}

.legend-dot.zone {
  background: #facc15;
  border: 1px solid #78350f;
}

.map-placeholder {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: var(--muted);
  font-weight: 600;
  background: linear-gradient(135deg, #e9eff5, #cfdbe7);
}

#cameraPreview,
#documentCameraPreview,
.photo-preview {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  background: #d9e1ea;
}

.signature-panel {
  grid-column: 1 / -1;
}

.signature-canvas {
  width: 100%;
  height: 170px;
  display: block;
  background: #ffffff;
  border: 1px solid var(--line);
  touch-action: none;
}

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

.hidden {
  display: none;
}

h1 {
  margin: 0 0 18px;
  font-size: 26px;
}

h2 {
  margin: 0 0 12px;
  font-size: 18px;
}

label {
  display: grid;
  gap: 6px;
  margin-bottom: 14px;
  font-weight: 600;
}

input,
select,
textarea {
  width: 100%;
  min-height: 36px;
  padding: 7px 9px;
  border: 1px solid #b9c5d2;
  background: #fff;
  color: var(--ink);
  font: inherit;
  border-radius: var(--radius-control);
}

textarea {
  resize: vertical;
}

button {
  min-height: 36px;
  border: 0;
  padding: 8px 14px;
  color: #fff;
  background: var(--accent-2);
  font-weight: 600;
  cursor: pointer;
  border-radius: var(--radius-control);
}

button.secondary {
  color: var(--accent-2);
  background: #f8fafc;
  border: 1px solid var(--line);
}

.button {
  min-height: 36px;
  display: inline-grid;
  place-items: center;
  padding: 8px 14px;
  color: #fff;
  background: var(--accent-2);
  font-weight: 600;
  text-decoration: none;
  border-radius: var(--radius-control);
}

.button.secondary {
  color: var(--accent-2);
  background: #f8fafc;
  border: 1px solid var(--line);
}

.alert-message,
.status-message,
.portal-result {
  margin: 12px 0;
  padding: 10px 12px;
  border: 1px solid var(--line);
  background: #f8fafc;
}

.status-message.status-success {
  color: #ffffff;
  background: var(--ok);
  border-color: var(--ok);
}

.status-message.status-error {
  color: #ffffff;
  background: var(--danger);
  border-color: var(--danger);
}

.alert-message,
.portal-result.fail {
  color: var(--danger);
}

.portal-result.ok {
  color: var(--ok);
}

.portal-result-success {
  margin: 0 0 20px;
  padding: 16px 18px;
  color: #0f5132;
  background: #e8f6ee;
  border-color: #9fd3b5;
  font-size: 22px;
  font-weight: 800;
  text-align: center;
}

.portal-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 14px;
}

.client-register-shell {
  min-height: calc(100vh - 104px);
  display: grid;
  align-items: center;
}

.client-register-layout {
  width: min(980px, 100%);
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, .85fr) minmax(320px, 1fr);
  gap: 24px;
  align-items: start;
}

.client-register-copy,
.client-register-form {
  background: var(--panel);
  border: 1px solid var(--line);
  padding: 28px;
}

.client-register-copy {
  display: grid;
  gap: 14px;
}

.client-register-copy h1 {
  margin: 0;
  font-size: 34px;
}

.client-register-copy p {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.client-register-form {
  display: grid;
  gap: 2px;
}

.field-validation {
  color: var(--danger);
  font-size: 13px;
  font-weight: 500;
}

.form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.admin-menu,
.work-surface {
  max-width: 1280px;
  margin: 0 auto;
}

.admin-menu > h1 {
  color: #ffffff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, .28);
}

.menu-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
}

.menu-grid a {
  padding: 22px;
  background: var(--panel);
  color: var(--ink);
  border: 1px solid var(--line);
  text-decoration: none;
  font-weight: 700;
  border-radius: var(--radius-panel);
  box-shadow: 0 4px 14px rgba(15, 35, 60, .08);
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}

.menu-grid a:hover,
.menu-grid a:focus-visible {
  border-color: #9db5cf;
  box-shadow: 0 8px 22px rgba(15, 35, 60, .14);
  transform: translateY(-2px);
}

.menu-icon-link {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.menu-license-badge {
  flex-basis: 100%;
  margin-left: 36px;
  padding: 6px 8px;
  color: var(--muted);
  background: #f8fafc;
  border: 1px solid var(--line);
  font-size: .82rem;
  font-weight: 700;
  line-height: 1.25;
  border-radius: var(--radius-control);
}

.title-with-icon {
  display: flex;
  align-items: center;
  gap: 10px;
}

.tool-icon,
.menu-icon {
  width: 26px;
  height: 26px;
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  color: var(--accent-2);
}

.tool-icon svg,
.menu-icon svg {
  width: 100%;
  height: 100%;
  display: block;
  fill: currentColor;
}

.tool-panel {
  display: grid;
  gap: 14px;
  padding: 18px;
  margin-bottom: 16px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-panel);
}

.tool-upload-form {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
  align-items: end;
}

.tool-upload-form label {
  margin: 0;
}

.layout-columns {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.layout-columns code {
  padding: 5px 8px;
  color: var(--accent-2);
  background: #f4f7fa;
  border: 1px solid var(--line);
  font-family: "Segoe UI", Arial, sans-serif;
  font-weight: 700;
}

.surface-title {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 16px;
}

.surface-title > div {
  flex: 1 1 auto;
}

.surface-title > form {
  margin-left: auto;
}

.surface-title a {
  color: #ffffff;
  text-decoration: none;
  font-weight: 600;
}

.surface-title h1 {
  color: #ffffff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, .28);
}

.edit-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  align-items: end;
  padding: 16px;
  margin-bottom: 18px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-panel);
}

.create-panel {
  margin-bottom: 14px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-panel);
  overflow: hidden;
}

.create-panel summary {
  padding: 12px 16px;
  color: var(--accent-2);
  cursor: pointer;
  font-weight: 700;
}

.edit-grid.compact {
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  max-height: 260px;
  overflow: auto;
  margin-bottom: 0;
  border: 0;
  border-top: 1px solid var(--line);
}

.edit-grid.compact label {
  margin-bottom: 0;
  min-width: 0;
  font-size: 11px;
  line-height: 1.2;
}

.edit-grid.compact input,
.edit-grid.compact select {
  min-height: 32px;
  min-width: 0;
  padding: 5px 7px;
  font-size: 11px;
}

.edit-grid.compact .date-field {
  grid-column: span 2;
  min-width: 280px;
}

.calendar-input {
  min-width: 0;
  color-scheme: light;
  cursor: pointer;
}

.calendar-input::-webkit-calendar-picker-indicator {
  min-width: 18px;
  min-height: 18px;
  cursor: pointer;
  opacity: .9;
}

.search-bar {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto auto;
  gap: 12px;
  align-items: end;
  padding: 16px;
  margin-bottom: 18px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-panel);
}

.search-bar label {
  margin: 0;
}

.search-bar a {
  min-height: 36px;
  display: inline-grid;
  place-items: center;
  padding: 8px 14px;
  color: var(--accent-2);
  background: #f8fafc;
  border: 1px solid var(--line);
  text-decoration: none;
  font-weight: 600;
}

.edit-grid h2 {
  grid-column: 1 / -1;
}

.data-table-wrap {
  overflow: auto;
  background: var(--panel);
  border: 1px solid var(--line);
}

.zone-help {
  padding: 10px 12px;
  margin-bottom: 12px;
  color: var(--muted);
  background: #f8fafc;
  border: 1px solid var(--line);
}

.zone-help code {
  color: var(--accent-2);
  font-weight: 700;
}

.zone-selector {
  grid-column: 1 / -1;
  display: grid;
  gap: 8px;
  padding: 12px;
  background: #f8fafc;
  border: 1px solid var(--line);
}

.zone-selector strong {
  font-size: 14px;
}

.zone-selector label {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 0;
  font-weight: 500;
}

.zone-selector input[type="checkbox"] {
  width: auto;
  min-height: auto;
}

.zone-selector.in-table {
  min-width: 260px;
  max-height: 180px;
  overflow: auto;
}

.pager {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  margin-bottom: 12px;
  background: var(--panel);
  border: 1px solid var(--line);
}

.page-size-form {
  display: flex;
  align-items: end;
  gap: 8px;
}

.page-size-form label {
  margin: 0;
  min-width: 110px;
}

.page-size-form input {
  min-height: 34px;
  width: 96px;
}

.page-size-form button {
  min-height: 34px;
}

.column-filter-form {
  margin: 0;
}

.filter-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-bottom: 10px;
}

.filter-actions a {
  min-height: 36px;
  display: inline-grid;
  place-items: center;
  padding: 8px 14px;
  color: var(--accent-2);
  background: #f8fafc;
  border: 1px solid var(--line);
  text-decoration: none;
  font-weight: 600;
}

.pager div {
  display: flex;
  gap: 8px;
}

.pager a {
  min-height: 34px;
  display: inline-grid;
  place-items: center;
  padding: 7px 12px;
  color: #ffffff;
  background: var(--accent-2);
  text-decoration: none;
  font-weight: 600;
}

.pager a.disabled {
  pointer-events: none;
  opacity: .45;
}

.data-table {
  min-width: 900px;
  width: 100%;
  border-collapse: collapse;
}

.data-table th,
.data-table td {
  padding: 6px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
  font-size: 12px;
}

.data-table th {
  background: #f4f7fa;
  position: sticky;
  top: 0;
}

.round-evidence-photo {
  display: block;
  width: 88px;
  height: 88px;
  object-fit: cover;
  border: 1px solid var(--line);
  background: #f8fafc;
}

.data-table tr.round-compliance-complete td {
  background: #dcfce7;
}

.data-table tr.round-compliance-progress td {
  background: #fef3c7;
}

.sort-link {
  color: var(--text);
  text-decoration: none;
  font-weight: 700;
}

.filter-row th {
  top: 37px;
  background: #ffffff;
}

.filter-row input {
  width: 100%;
  min-width: 130px;
  min-height: 32px;
  padding: 6px 8px;
  font-size: 13px;
}

.date-range-filter {
  display: grid;
  grid-template-columns: repeat(2, minmax(190px, 1fr));
  gap: 8px;
  min-width: 400px;
}

.date-range-filter label {
  gap: 3px;
  margin: 0;
  color: var(--muted);
  font-size: 11px;
}

.date-range-filter input {
  min-width: 190px;
}

.data-table input {
  min-width: 118px;
  min-height: 30px;
  padding: 5px 6px;
  font-size: 11px;
}

.data-table select {
  min-width: 118px;
  min-height: 30px;
  padding: 5px 6px;
  font-size: 11px;
}

.data-table .calendar-input {
  min-width: 168px;
}

.zone-map-preview {
  width: 240px;
  height: 150px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: #e5edf5;
}

.record-map-preview {
  width: 190px;
  height: 120px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: #e5edf5;
}

.record-map-preview iframe {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}

.zone-map-preview iframe {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}

.map-link {
  display: inline-block;
  margin-top: 6px;
  color: var(--accent-2);
  font-size: 12px;
  font-weight: 700;
}

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

.employee-map-filter {
  display: grid;
  grid-template-columns: minmax(180px, 1.2fr) minmax(180px, 1fr) minmax(180px, 1fr) auto;
  gap: 12px;
  align-items: end;
  margin-bottom: 16px;
  padding: 16px;
  background: var(--panel);
  border: 1px solid var(--line);
}

.employee-map-filter label {
  margin: 0;
}

.employee-map-filter input {
  width: 100%;
}

.employee-map-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-bottom: 12px;
  color: var(--muted);
}

.employee-map-summary strong {
  color: var(--ink);
}

.portal-evidence-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.portal-evidence-links a {
  min-height: 30px;
  display: inline-grid;
  place-items: center;
  padding: 5px 9px;
  color: var(--accent-2);
  background: #f8fafc;
  border: 1px solid var(--line);
  text-decoration: none;
  font-size: 12px;
  font-weight: 700;
}

.employee-map {
  position: relative;
  height: 520px;
  min-height: 520px;
  margin-bottom: 16px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: #e5edf5;
}

.employee-map.leaflet-container,
.employee-map .leaflet-container {
  height: 520px;
  min-height: 520px;
}

.employee-map iframe {
  width: 100%;
  height: 520px;
  border: 0;
  display: block;
}

.employee-marker-label {
  color: #ffffff;
  background: transparent;
  border: 0;
  box-shadow: none;
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
  pointer-events: none;
}

.employee-point-list {
  margin-top: 16px;
}

.record-photo {
  width: 92px;
  height: 70px;
  object-fit: cover;
  border: 1px solid var(--line);
  background: #f8fafc;
}

.record-event-type {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  white-space: nowrap;
}

.record-event-type img {
  width: 38px;
  height: 38px;
  object-fit: contain;
  border-radius: 8px;
}

@media (max-width: 760px) {
  .employee-map-filter {
    grid-template-columns: 1fr;
  }

  .employee-map,
  .employee-map.leaflet-container,
  .employee-map iframe,
  .employee-map .leaflet-container {
    min-height: 380px;
    height: 380px;
  }
}

.actions {
  display: flex;
  gap: 8px;
  min-width: 220px;
}

.actions button:last-child {
  background: var(--danger);
}

@media (max-width: 680px) {
  main {
    padding: 16px;
  }

  .brand-header {
    height: 74px;
    background-size: 82% auto;
  }

  .topbar {
    height: auto;
    min-height: 56px;
    grid-template-columns: 1fr auto;
    gap: 10px;
    padding: 14px 16px;
  }

  .topbar nav {
    width: auto;
  }

  .current-user-label {
    grid-column: 1 / -1;
    grid-row: 2;
    width: 100%;
  }

  .current-user-label strong {
    max-width: 90vw;
  }

  .commercial-hero {
    grid-template-columns: 1fr;
    padding: 22px;
  }

  .hero-copy h1 {
    font-size: 32px;
  }

  .hero-copy p {
    font-size: 16px;
  }

  .hero-visual {
    min-height: 230px;
  }

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

  .client-register-layout {
    grid-template-columns: 1fr;
  }

  .product-card {
    grid-template-rows: 220px 1fr;
  }

  .hero-actions .button,
  .product-actions .button,
  .form-actions .button,
  .form-actions button {
    width: 100%;
  }

  .search-bar {
    grid-template-columns: 1fr;
  }

  .pager,
  .page-size-form,
  .filter-actions {
    align-items: stretch;
    flex-direction: column;
  }
}

@media (min-width: 681px) and (max-width: 980px) {
  .commercial-hero,
  .product-grid,
  .client-register-layout {
    grid-template-columns: 1fr;
  }

  .product-card {
    grid-template-columns: 300px 1fr;
    grid-template-rows: auto;
  }
}

.catalog-liquid-page {
  position: relative;
  min-height: calc(100vh - 224px);
  margin: -24px;
  padding: 24px;
  overflow: hidden;
  isolation: isolate;
}

.liquid-ether-background {
  position: absolute;
  z-index: 0;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  pointer-events: none;
  filter: saturate(1.15) contrast(1.04);
}

.catalog-menu-content { position: relative; z-index: 1; }

.catalog-menu-content .menu-grid a {
  background: rgba(255, 255, 255, .9);
  border-color: rgba(255, 255, 255, .72);
  box-shadow: 0 8px 24px rgba(4, 12, 31, .2);
  backdrop-filter: blur(12px);
}

.catalog-menu-content .menu-grid a:hover,
.catalog-menu-content .menu-grid a:focus-visible {
  background: rgba(255, 255, 255, .97);
  border-color: #ffffff;
  box-shadow: 0 12px 30px rgba(4, 12, 31, .28);
}

.admin-menu-sidebar {
  width: min(340px, 100%);
  max-width: none;
  margin: 0 auto 0 0;
}

.admin-menu-sidebar > h1 {
  padding: 0 8px;
}

.admin-menu-sidebar .menu-grid {
  grid-template-columns: minmax(0, 1fr);
  gap: 9px;
}

.admin-menu-sidebar .menu-grid a {
  min-height: 54px;
  padding: 13px 16px;
  border-left-width: 4px;
}

.catalog-menu-content .menu-grid a.attendance-menu-link {
  border: 1px solid rgba(255, 255, 255, .38);
  border-left: 5px solid #825aa0;
  background: #a97bc9;
  color: #ffffff;
  box-shadow: 0 8px 24px rgba(91, 48, 121, .24);
}

.catalog-menu-content .menu-grid a.attendance-menu-link:hover,
.catalog-menu-content .menu-grid a.attendance-menu-link:focus-visible {
  border-color: rgba(255, 255, 255, .72);
  border-left-color: #70468f;
  background: #9668b8;
  color: #ffffff;
  box-shadow: 0 12px 30px rgba(91, 48, 121, .34);
}

@media (max-width: 640px) {
  .admin-menu-sidebar {
    width: 100%;
  }
}

.schedule-comparison-filter {
  grid-template-columns: minmax(260px, 1fr) minmax(150px, 210px) minmax(150px, 210px) auto;
  align-items: end;
}

.comparison-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 22px;
  margin: 18px 0 10px;
  color: var(--muted);
  font-size: .84rem;
}

.comparison-legend span { display: inline-flex; align-items: center; gap: 7px; }
.comparison-legend i { width: 24px; height: 10px; border-radius: 999px; }
.comparison-legend .interval-a { background: #a97bc9; }
.comparison-legend .interval-b { background: #23b8ad; }
.comparison-legend .actual-mark { width: 14px; height: 14px; background: #0f5d89; border: 2px solid #fff; box-shadow: 0 1px 4px #64748b; }

.comparison-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  margin: 18px 0;
  padding: 14px 16px;
  background: #f5eefb;
  border-left: 5px solid #a97bc9;
}

.timeline-chart {
  padding: 22px;
  overflow-x: auto;
  background: rgba(255, 255, 255, .96);
  border: 1px solid var(--line);
  border-radius: var(--radius-panel);
}

.timeline-range {
  display: flex;
  justify-content: space-between;
  margin: 0 0 12px 110px;
  color: var(--muted);
  font-size: .8rem;
}

.timeline-lane {
  min-width: 760px;
  display: grid;
  grid-template-columns: 90px minmax(650px, 1fr);
  gap: 18px;
  align-items: center;
  min-height: 118px;
}

.timeline-track {
  position: relative;
  height: 4px;
  background: #cbd5e1;
  border-radius: 999px;
}

.timeline-point {
  position: absolute;
  top: 50%;
  width: 110px;
  display: grid;
  justify-items: center;
  gap: 2px;
  transform: translate(-50%, -11px);
  text-align: center;
}

.timeline-point i {
  width: 18px;
  height: 18px;
  border: 3px solid #ffffff;
  border-radius: 50%;
  box-shadow: 0 1px 5px rgba(15, 23, 42, .28);
}

.timeline-point.theoretical i { background: #a97bc9; }
.timeline-point.actual i { background: #12a89d; }
.timeline-point b { font-size: .78rem; }
.timeline-point small {
  max-width: 110px;
  overflow: hidden;
  color: var(--muted);
  font-size: .7rem;
  line-height: 1.1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.multi-day-timeline { padding: 14px 20px; }
.daily-timeline-row {
  min-width: 920px;
  display: grid;
  grid-template-columns: 135px minmax(740px, 1fr);
  gap: 18px;
  align-items: center;
  min-height: 155px;
  border-bottom: 1px solid #e5e7eb;
}
.daily-timeline-row:last-child { border-bottom: 0; }
.daily-timeline-label { display: grid; gap: 4px; text-transform: capitalize; }
.daily-timeline-label small { color: var(--muted); font-size: .72rem; }
.daily-timeline-status { padding: 12px 16px; color: var(--muted); background: #f8fafc; border-radius: 8px; }
.daily-timeline-content { min-width: 740px; padding: 18px 0 34px; }
.daily-range { display: flex; justify-content: space-between; margin-bottom: 34px; color: var(--muted); font-size: .72rem; }
.daily-track { height: 12px; background: #e2e8f0; overflow: visible; }
.theoretical-segment { position: absolute; top: 0; height: 12px; box-shadow: inset 0 0 0 1px rgba(255,255,255,.3); }
.theoretical-segment.interval-0 { background: #a97bc9; }
.theoretical-segment.interval-1 { background: #23b8ad; }
.theoretical-boundary { position: absolute; top: -23px; transform: translateX(-50%); color: #334155; font-size: .68rem; z-index: 2; }
.timeline-point.actual.compact { top: 50%; width: 92px; transform: translate(-50%, -7px); z-index: 3; }
.timeline-point.actual.compact i { width: 16px; height: 16px; background: #0f5d89; }
.timeline-point.actual.compact b { margin-top: 2px; padding: 0 2px; background: rgba(255,255,255,.9); }
.timeline-point.actual.compact small { max-width: 92px; padding: 0 2px; background: rgba(255,255,255,.9); }
.natural-day-marker {
  position: absolute;
  top: -31px;
  bottom: -48px;
  width: 0;
  border-left: 2px dashed #64748b;
  z-index: 1;
}
.natural-day-marker b,
.natural-day-marker small {
  position: absolute;
  left: 6px;
  padding: 0 3px;
  color: #475569;
  background: rgba(255,255,255,.94);
  font-size: .66rem;
  line-height: 1.2;
  white-space: nowrap;
}
.natural-day-marker b { top: -18px; }
.natural-day-marker small { top: -5px; }
.natural-day-marker.day-start { left: 0 !important; }
.natural-day-marker.day-end b,
.natural-day-marker.day-end small { left: auto; right: 6px; text-align: right; }

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

.portal-liquid-page .portal-card {
  background: rgba(255, 255, 255, .92);
  border-color: rgba(255, 255, 255, .78);
  box-shadow: 0 16px 42px rgba(2, 48, 47, .28);
  backdrop-filter: blur(14px);
}

.portal-liquid-page .portal-shell {
  position: relative;
  z-index: 1;
  min-height: calc(100vh - 200px);
}

.admin-login-liquid-page .login-shell {
  position: relative;
  z-index: 1;
  min-height: calc(100vh - 200px);
}

.admin-login-liquid-page .login-box {
  background: rgba(255, 255, 255, .92);
  border-color: rgba(255, 255, 255, .78);
  box-shadow: 0 16px 42px rgba(2, 48, 47, .28);
  backdrop-filter: blur(14px);
}

body[data-background-effect="gradient"] .liquid-ether-background {
  display: none;
}

.appearance-tool-panel {
  display: grid;
  gap: 18px;
}

.appearance-tool-panel h2,
.appearance-tool-panel p {
  margin: 0;
}

.appearance-options {
  display: grid;
  grid-template-columns: repeat(3, minmax(180px, 1fr));
  gap: 14px;
}

.appearance-option {
  position: relative;
  display: grid;
  gap: 8px;
  align-content: start;
  padding: 12px;
  background: #ffffff;
  border: 2px solid var(--line);
  border-radius: var(--radius-panel);
  cursor: pointer;
  transition: border-color .18s ease, transform .18s ease, box-shadow .18s ease;
}

.appearance-option:has(input:checked) {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, .14);
}

.appearance-option:hover { transform: translateY(-2px); }
.appearance-option input { position: absolute; top: 18px; right: 18px; z-index: 1; }
.appearance-option strong { color: var(--ink); }
.appearance-option small { color: var(--muted); }

.appearance-preview {
  height: 92px;
  display: block;
  overflow: hidden;
  border-radius: 10px;
}

.preview-gradient {
  background: linear-gradient(180deg, #071a33 0%, #2f5f8f 48%, #d8e6f3 100%);
}

.preview-liquid {
  background:
    radial-gradient(circle at 28% 35%, #62e1d6 0 12%, transparent 36%),
    radial-gradient(circle at 70% 65%, #10b9b1 0 14%, transparent 40%),
    radial-gradient(circle at 55% 20%, #087f7a 0 12%, transparent 38%),
    #063b3b;
}

.preview-dots {
  background-color: #063b3b;
  background-image: radial-gradient(circle, #62e1d6 1px, transparent 1.4px);
  background-size: 12px 12px;
}

.appearance-save { grid-column: 1 / -1; }

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

/* Menú inicial: administración a la izquierda, asistencia a la derecha. */
.admin-menu-sidebar.admin-menu-split { width: 100%; }
.admin-menu-columns {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 24px;
}
.admin-menu-columns > .menu-grid { width: min(340px, 100%); min-width: 0; }
.admin-menu-columns > .attendance-menu-grid:empty { display: none; }
@media (max-width: 720px) {
  .admin-menu-columns { flex-direction: column; }
  .admin-menu-columns > .menu-grid { width: 100%; }
}

/* Encabezado de prenomina: contraste independiente del fondo del sitio. */
.payroll-heading {
  color: #ffffff;
  background: #102f50;
  padding: 20px 24px;
  border-radius: 16px;
  margin-bottom: 16px;
}
.payroll-heading h1,
.payroll-heading p,
.payroll-heading > a,
.payroll-heading > a:visited {
  color: #ffffff !important;
}
.payroll-heading > p,
.payroll-heading > p strong { color: #ffffff !important; }
.payroll-surface-title { align-items: center; }
.payroll-surface-title h1 { margin-bottom: 0; color: #ffffff !important; }
.payroll-surface-title > .button.secondary,
.payroll-surface-title > .button.secondary:visited,
.payroll-surface-title > .button.secondary:hover {
  color: #102f50 !important;
  background: #f8fafc;
}
.payroll-heading > a:hover { color: #b9f5f0; }
.payroll-heading .search-bar,
.payroll-heading .status-message { color: #102f50; }
.payroll-navigation { gap: 10px; margin-bottom: 16px; }
.payroll-navigation a,
.payroll-navigation a:visited {
  display: inline-block;
  color: #ffffff;
  background: #102f50;
  padding: 10px 14px;
  border-radius: 8px;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.payroll-navigation a:hover { background: #194b72; }
.payroll-heading a:focus-visible,
.payroll-navigation a:focus-visible { outline: 3px solid #16b8ad; outline-offset: 3px; }

.payroll-heading > .button.secondary,
.payroll-heading > .button.secondary:visited,
.payroll-heading > .button.secondary:hover {
  color: #102f50;
  background: #f8fafc;
  margin-bottom: 12px;
}
.work-surface > h2[id] { scroll-margin-top: 24px; }
