.demo-body {
  background:
    radial-gradient(circle at 100% 0%, rgba(23, 195, 232, .10), transparent 30%),
    radial-gradient(circle at 0% 0%, rgba(11, 107, 255, .08), transparent 26%),
    #edf3f9;
}

.demo-body header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: #0b1a2b;
  border-bottom: 1px solid #1e3a54;
}

.demo-back {
  color: #a9c1d6;
  text-decoration: none;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  padding: 6px 8px;
  border-radius: 8px;
}

.demo-back:hover {
  color: #fff;
  background: #16324b;
}

.demo-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: 999px;
  background: #17c3e8;
  color: #062235;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .10em;
}

.demo-body .demo-reset {
  border-color: #3f607d;
  color: #d8e8f6;
}

.demo-body .demo-reset:hover {
  background: #16324b;
}

.demo-body #logoutBtn,
.demo-body #verSwitch,
.demo-body #sideHandle,
.demo-body #cfgSetup,
.demo-panel .login {
  display: none !important;
}

.demo-panel #viewDepartamentos .card.list,
.demo-panel #viewCuadrillas .card.list,
.demo-panel #viewRoles .card.list,
.demo-panel #viewUsuarios .card.list {
  max-height: 56vh;
  overflow: auto;
}

.demo-panel #viewReports table,
.demo-panel #viewCompletados table {
  table-layout: fixed;
  width: 100%;
  min-width: 900px;
}

.demo-panel #viewReports th:nth-child(1),
.demo-panel #viewCompletados th:nth-child(1) { width: 64px; }
.demo-panel #viewReports th:nth-child(2),
.demo-panel #viewCompletados th:nth-child(2) { width: 145px; }
.demo-panel #viewReports th:nth-child(3),
.demo-panel #viewCompletados th:nth-child(3) { width: 215px; }
.demo-panel #viewReports th:nth-child(4),
.demo-panel #viewCompletados th:nth-child(4) { width: 110px; }
.demo-panel #viewReports th:nth-child(5),
.demo-panel #viewCompletados th:nth-child(5) { width: 140px; }
.demo-panel #viewReports th:nth-child(6),
.demo-panel #viewCompletados th:nth-child(6) { width: 140px; }
.demo-panel #viewReports th:nth-child(7),
.demo-panel #viewCompletados th:nth-child(7) { width: 140px; }

.demo-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) clamp(280px, 20vw, 360px);
  gap: 16px;
  width: 100%;
  max-width: 1900px;
  margin: 0 auto;
  padding: 16px;
  align-items: start;
}

.demo-panel {
  min-width: 0;
}

.demo-panel .wrap {
  max-width: none;
  margin: 0;
  padding: 0;
}

.demo-panel #panel {
  min-width: 0;
}

.demo-panel nav {
  position: static;
  inset: auto;
  transform: none;
  width: auto;
  max-width: none;
  height: auto;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  padding: 9px 12px;
  margin-bottom: 14px;
  border-radius: 12px;
  background: #15253a;
  box-shadow: 0 10px 30px -22px rgba(2, 6, 23, .6);
  overflow: visible;
  z-index: auto;
}

.demo-panel nav .tab {
  width: auto;
  padding: 8px 11px;
  border-radius: 8px;
  text-align: center;
  font-size: 12.5px;
  line-height: 1.15;
}

.demo-panel nav #tenantPickerWrap {
  display: flex;
  flex-direction: row !important;
  align-items: center !important;
  gap: 8px !important;
  margin: 0 0 0 auto !important;
  padding: 0 !important;
  background: transparent !important;
}

.demo-panel nav #tenantPicker {
  width: auto !important;
  min-width: 145px !important;
  padding: 6px 8px !important;
  font-size: 12.5px !important;
}

.demo-panel .stats {
  margin-top: 0;
}

.demo-panel .scroll-table {
  max-height: 64vh;
}

.demo-panel #adminMap {
  height: min(58vh, 560px);
  min-height: 360px;
}

.demo-panel .map-engine {
  display: none !important;
}

.demo-phone-col {
  position: sticky;
  top: 82px;
  min-width: 0;
}

.demo-phone-scope {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 10px;
  padding: 10px 11px 12px;
  border: 1px solid #cbd9e6;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 8px 22px -18px rgba(2, 10, 20, .5);
}

.demo-phone-scope .demo-field {
  margin: 0;
}

.demo-phone-scope .demo-field select {
  font-size: 12px;
}

.demo-phone-citybar strong {
  font-size: 11px;
  color: #0b5db8;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.demo-phone {
  position: relative;
  padding: 9px;
  border-radius: 38px;
  background: linear-gradient(160deg, #101c2c, #020a13);
  border: 1px solid #213b53;
  box-shadow: 0 34px 70px -34px rgba(2, 10, 20, .8), inset 0 0 0 1px rgba(255, 255, 255, .05);
}

.demo-phone-notch {
  position: absolute;
  z-index: 3;
  top: 13px;
  left: 50%;
  width: 86px;
  height: 19px;
  transform: translateX(-50%);
  border-radius: 999px;
  background: #020a13;
  border: 1px solid #1a2a3a;
}

.demo-phone-screen {
  display: flex;
  flex-direction: column;
  height: clamp(540px, 74vh, 760px);
  overflow: hidden;
  border-radius: 30px;
  background: #f6f9fc;
  color: #0f172a;
}

.demo-phone-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 18px 4px;
  font-size: 10px;
  font-weight: 700;
  color: #334155;
  background: #f6f9fc;
}

.demo-phone-signal {
  letter-spacing: 1px;
  font-size: 8px;
  color: #1d4ed8;
}

.demo-phone-citybar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 5px 12px;
  background: #f6f9fc;
  border-bottom: 1px solid #dbe6f1;
}

.demo-phone-citybar label {
  margin: 0;
  color: #64748b;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.demo-phone-citybar select {
  width: auto;
  max-width: 155px;
  padding: 4px 6px;
  border: 1px solid #cbd9e6;
  border-radius: 6px;
  background: #fff;
  color: #0f172a;
  font-size: 10px;
}

.demo-report-frame {
  display: block;
  flex: 1;
  width: 100%;
  min-height: 0;
  border: 0;
  background: #f4f9fd;
}

.demo-phone-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 12px 10px;
  border-bottom: 1px solid #dbe6f1;
  background: #f6f9fc;
}

.demo-phone-head b {
  display: block;
  font-size: 12px;
  line-height: 1.2;
}

.demo-phone-head small {
  display: block;
  font-size: 9.5px;
  color: #64748b;
}

.demo-phone-avatar {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: linear-gradient(145deg, #0b6bff, #17c3e8);
  color: #fff;
  font-size: 12px;
  font-weight: 800;
}

.demo-live {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-left: auto;
  padding: 3px 6px;
  border-radius: 999px;
  background: #e3f8ef;
  color: #0b7a55;
  font-size: 8px;
  font-weight: 800;
  letter-spacing: .06em;
  white-space: nowrap;
}

.demo-live i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #0b9f6e;
  animation: demoPulse 1.8s ease-in-out infinite;
}

@keyframes demoPulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: .35; transform: scale(.75); }
}

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

.demo-form-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 10px 11px 14px;
  scrollbar-width: thin;
}

.demo-field {
  margin-bottom: 9px;
}

.demo-field label {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin: 0 0 4px;
  font-size: 10px;
  font-weight: 700;
  color: #475569;
  text-transform: uppercase;
  letter-spacing: .04em;
}

.demo-field label span {
  font-weight: 500;
  color: #94a3b8;
  text-transform: none;
  letter-spacing: 0;
}

.demo-field input,
.demo-field select,
.demo-field textarea {
  width: 100%;
  padding: 7px 8px;
  border: 1px solid #cbd9e6;
  border-radius: 8px;
  background: #fff;
  color: #0f172a;
  font-size: 11.5px;
  line-height: 1.3;
}

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

.demo-field input[type="file"] {
  padding: 5px;
  font-size: 10px;
  background: #f8fbfe;
}

.demo-photo-preview {
  margin-top: 6px;
  overflow: hidden;
  border-radius: 8px;
  border: 1px solid #d6e3ef;
}

.demo-photo-preview img {
  display: block;
  width: 100%;
  max-height: 86px;
  object-fit: cover;
}

.demo-location-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 4px;
}

.demo-location-head label {
  margin: 0;
}

.demo-location-head button {
  padding: 4px 6px;
  border: 1px solid #b9d2e8;
  border-radius: 7px;
  background: #eef7ff;
  color: #0b5db8;
  font-size: 9px;
  font-weight: 700;
}

.demo-map {
  height: 112px;
  border-radius: 9px;
  overflow: hidden;
  border: 1px solid #cbd9e6;
  background: #dfeaf5;
}

.demo-location small {
  display: block;
  margin-top: 4px;
  font-size: 9px;
  line-height: 1.35;
  color: #64748b;
}

.demo-submit {
  width: 100%;
  margin-top: 3px;
  padding: 10px;
  border-radius: 9px;
  background: linear-gradient(135deg, #0b6bff, #0a54d0);
  color: #fff;
  font-size: 12px;
  font-weight: 800;
}

.demo-submit:disabled {
  opacity: .55;
}

.demo-error {
  min-height: 13px;
  margin-top: 6px;
  color: #b91c1c;
  font-size: 10px;
  line-height: 1.35;
}

.demo-success {
  display: flex;
  flex: 1;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 22px 18px;
  text-align: center;
}

.demo-success.hidden {
  display: none;
}

.demo-success-icon {
  width: 52px;
  height: 52px;
  padding: 13px;
  border-radius: 50%;
  background: #e3f8ef;
  color: #0b9f6e;
}

.demo-success h3 {
  margin: 10px 0 2px;
  font-size: 17px;
}

.demo-success p {
  margin: 2px 0;
  color: #64748b;
  font-size: 11px;
}

.demo-success strong {
  margin: 5px 0 8px;
  font-size: 26px;
  letter-spacing: -.03em;
  color: #0b6bff;
}

.demo-success .demo-dup {
  margin: 5px 0 8px;
  padding: 6px 8px;
  border-radius: 8px;
  background: #fff4dc;
  color: #9a5b00;
  font-size: 10px;
  line-height: 1.4;
}

.demo-success .demo-muted {
  max-width: 210px;
  font-size: 10px;
  line-height: 1.45;
}

.demo-success button {
  margin-top: 14px;
  padding: 9px 12px;
  border: 1px solid #b9d2e8;
  border-radius: 8px;
  background: #eef7ff;
  color: #0b5db8;
  font-size: 11px;
  font-weight: 700;
}

.demo-phone-caption {
  margin: 10px 6px 0;
  text-align: center;
  font-size: 10.5px;
  line-height: 1.45;
  color: #64748b;
}

.demo-toast {
  position: fixed;
  left: 18px;
  bottom: 18px;
  z-index: 3000;
  max-width: 320px;
  padding: 11px 14px;
  border-radius: 10px;
  background: #0b1a2b;
  color: #dff3ff;
  box-shadow: 0 18px 42px -20px rgba(2, 10, 20, .8);
  font-size: 12px;
  line-height: 1.4;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity .22s ease, transform .22s ease;
  pointer-events: none;
}

.demo-toast.show {
  opacity: 1;
  transform: translateY(0);
}

.demo-toast b {
  color: #7fe3ff;
}

tr.demo-new {
  animation: demoFlash 2.4s ease;
}

@keyframes demoFlash {
  0% { background: #dff3ff; }
  100% { background: transparent; }
}

@media (max-width: 1050px) {
  .demo-layout {
    grid-template-columns: minmax(0, 1fr) 300px;
  }
}

@media (max-width: 900px) {
  .demo-layout {
    grid-template-columns: minmax(0, 1fr);
    padding: 12px;
  }

  .demo-phone-col {
    position: static;
    order: -1;
    width: 100%;
    max-width: 360px;
    margin: 0 auto;
  }

  .demo-phone-screen {
    height: clamp(480px, 68vh, 660px);
  }

  .demo-field input,
  .demo-field select,
  .demo-field textarea {
    font-size: 16px;
  }

  .demo-phone-caption {
    margin-bottom: 4px;
  }

  .demo-panel nav {
    position: static;
    transform: none;
  }

  .demo-body #headerNav {
    display: none !important;
  }

  .demo-back {
    display: inline-flex;
    font-size: 0;
  }

  .demo-back::before {
    content: "← Sitio";
    font-size: 12px;
  }
}

@media (max-width: 560px) {
  .demo-body header {
    padding: 11px 12px;
    gap: 8px;
  }

  .demo-body header h1 {
    font-size: 13px;
  }

  .demo-body header .tenant {
    display: none;
  }

  .demo-body .demo-reset {
    padding: 7px 9px;
    font-size: 11px;
  }

  .demo-panel nav #tenantPickerWrap {
    width: 100%;
    margin-left: 0 !important;
    margin-top: 6px !important;
  }
}
