body.bg-app {
  min-height: 100vh;
  background:
    radial-gradient(circle at top left, rgba(255,255,255,0.18), transparent 30%),
    linear-gradient(135deg, #0f172a, #1d4ed8 58%, #38bdf8);
  background-attachment: fixed;
  font-family: Arial, Helvetica, sans-serif;
}

.app-shell,
.menu-wrapper,
.form-wrapper {
  max-width: 980px;
  margin: 0 auto;
}

.container.pb-6 {
  padding-bottom: 6rem !important;
}

.hero-card,
.list-card,
.card-pro {
  background: rgba(255,255,255,0.96);
  border-radius: 22px;
  box-shadow: 0 14px 34px rgba(0,0,0,0.12);
}

.hero-card {
  padding: 18px;
}

.card-pro {
  padding: 22px;
}

.list-card {
  overflow: hidden;
}

.hero-top,
.page-top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.eyebrow {
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #475569;
  margin-bottom: 4px;
  font-weight: 700;
}

.app-title {
  font-size: 1.8rem;
  font-weight: 800;
  margin: 0;
  color: #111827;
}

.app-title-sm {
  font-size: 1.45rem;
  font-weight: 800;
  color: #111827;
  margin: 0;
}

.app-subtitle {
  color: #475569;
  margin: 0;
}

.results-pill {
  background: #e0f2fe;
  color: #0369a1;
  padding: 6px 12px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 13px;
}

.search-shell {
  margin-top: 10px;
  display: flex;
  align-items: center;
  border-radius: 999px;
  background: #fff;
  border: 1px solid #d6dbe3;
  overflow: hidden;
}

.search-icon {
  padding: 9px 12px;
  color: #475569;
}

.search-live-input {
  flex: 1;
  border: none;
  outline: none;
  padding: 10px 4px;
  font-size: 14px;
  background: transparent;
}

.search-clear-btn {
  border: none;
  background: none;
  cursor: pointer;
  padding: 8px 10px;
  color: #475569;
}

.toolbar-pills {
  margin-top: 10px;
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.toolbar-pill {
  padding: 7px 11px;
  border-radius: 999px;
  background: #f1f5f9;
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  color: #0f172a;
}

.toolbar-pill.active {
  background: #2563eb;
  color: #fff;
}

.toolbar-pill.active.success {
  background: #16a34a;
  color: #fff;
}

.toolbar-pill.active.dark {
  background: #475569;
  color: #fff;
}

.mobile-sortbar {
  display: none;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}



.mobile-sortbar-label {
  font-size: 12px;
  font-weight: 700;
  color: #475569;
}

.mobile-sort-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 10px;
  border-radius: 999px;
  background: #eef2ff;
  color: #1e293b;
  text-decoration: none;
  font-size: 12px;
  font-weight: 700;
}

.mobile-sort-btn.active {
  background: #dbeafe;
  color: #1d4ed8;
}

/* LISTADO USUARIOS */
.list-header {
  display: grid;
  grid-template-columns: minmax(130px, 1.4fr) minmax(90px, 1fr) 64px 44px;
  gap: 8px;
  align-items: center;
  padding: 10px 14px;
  background: #f8fafc;
  border-bottom: 1px solid #e5e7eb;
  font-size: 12px;
  font-weight: 800;
  color: #475569;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.list-sort-link {
  text-decoration: none;
  color: #475569;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.user-item {
  display: block;
}

.user-row {
  display: grid;
  grid-template-columns: minmax(130px, 1.4fr) minmax(90px, 1fr) 64px 44px;
  gap: 8px;
  align-items: center;
  padding: 10px 14px;
  border-bottom: 1px solid #edf2f7;
  min-height: 56px;
  transition: background 0.2s ease;
}

.user-row:hover {
  background: #f8fafc;
}

.clickable-row {
  cursor: pointer;
}

.user-col-name,
.user-col-phone {
  min-width: 0;
}

.user-row-name {
  font-weight: 800;
  font-size: 14px;
  line-height: 1.15;
  color: #111827;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.phone-link,
.phone-empty {
  font-size: 13px;
  line-height: 1.1;
  color: #111827;
  text-decoration: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.phone-link:hover {
  color: #2563eb;
}

.phone-empty {
  color: #94a3b8;
}

.user-col-active,
.user-col-photo {
  display: flex;
  justify-content: center;
  align-items: center;
}

.user-col-photo {
  width: 44px;
  min-width: 44px;
}

.user-col-photo .mini-photo,
.user-col-photo .mini-photo-placeholder {
  width: 28px !important;
  height: 28px !important;
  min-width: 28px !important;
  max-width: 28px !important;
  min-height: 28px !important;
  max-height: 28px !important;
  border-radius: 50%;
  object-fit: cover;
  display: block;
  box-shadow: 0 2px 8px rgba(0,0,0,0.12);
}

.user-col-photo .mini-photo-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  background: #dbe4ee;
  color: #64748b;
  font-size: 11px;
}

/* SWITCH */
.switch-btn {
  border: none;
  background: none;
  cursor: pointer;
  padding: 0;
}

.switch-track {
  width: 36px;
  height: 20px;
  border-radius: 999px;
  background: #d1d5db;
  display: flex;
  align-items: center;
  padding: 2px;
  transition: 0.2s;
}

.switch-thumb {
  width: 16px;
  height: 16px;
  background: #fff;
  border-radius: 50%;
  transition: 0.2s;
  box-shadow: 0 1px 4px rgba(0,0,0,0.15);
}

.switch-btn.on .switch-track {
  background: #22c55e;
}

.switch-btn.on .switch-thumb {
  transform: translateX(16px);
}

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

.form-label {
  color: #0f172a;
  font-weight: 700;
}

.form-control {
  border: 1px solid #cbd5e1;
  padding: 12px 14px;
}

.form-control:focus {
  border-color: #2563eb;
  box-shadow: 0 0 0 0.2rem rgba(37,99,235,0.15);
}

.pro-switch-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0 2px 4px;
}

.pro-switch-row .form-check-input {
  width: 3rem;
  height: 1.55rem;
}

.btn-pro {
  background: linear-gradient(135deg, #111827, #2563eb);
  color: #fff;
  border: none;
  border-radius: 999px;
  padding: 12px 20px;
  font-weight: 700;
  box-shadow: 0 10px 24px rgba(37,99,235,0.28);
}

.btn-pro:hover {
  color: #fff;
  transform: translateY(-1px);
}

.camera-box {
  width: 100%;
  max-width: 260px;
  height: 260px;
  border-radius: 20px;
  object-fit: cover;
  box-shadow: 0 10px 24px rgba(0,0,0,0.14);
}

.user-photo-placeholder {
  width: 100%;
  max-width: 260px;
  height: 260px;
  border-radius: 20px;
  background: #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #64748b;
  margin: 0 auto;
}

.previewable-image {
  cursor: zoom-in;
}

.preview-help-text {
  color: rgba(255,255,255,0.92);
  font-size: 0.92rem;
  font-weight: 600;
}

/* FIRMA */
.signature-card {
  width: 100%;
  max-width: 520px;
  background: #fff;
  border: 2px dashed #cbd5e1;
  border-radius: 18px;
  padding: 10px;
}

.signature-pad {
  width: 100%;
  height: 180px;
  display: block;
  background: #ffffff;
  border-radius: 12px;
  touch-action: none;
}

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

.signature-preview-wrap {
  width: 100%;
  max-width: 520px;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 18px;
  padding: 10px;
}

.signature-preview {
  width: 100%;
  max-width: 500px;
  height: 120px;
  object-fit: contain;
  background: #fff;
  display: block;
  border-radius: 10px;
}

/* MENU */
.menu-wrapper {
  max-width: 980px;
  margin: 0 auto;
}

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

.menu-card {
  display: block;
  text-decoration: none;
  background: rgba(255,255,255,0.96);
  border-radius: 22px;
  padding: 28px 22px;
  box-shadow: 0 14px 34px rgba(0,0,0,0.12);
  color: #111827;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.menu-card:hover {
  transform: translateY(-3px);
  color: #111827;
  box-shadow: 0 18px 40px rgba(0,0,0,0.16);
}

.menu-card-title {
  font-size: 1.35rem;
  font-weight: 800;
  margin-bottom: 6px;
}

.menu-card-subtitle {
  color: #64748b;
}

.menu-card-disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

.menu-card-disabled:hover {
  transform: none;
  box-shadow: 0 14px 34px rgba(0,0,0,0.12);
}

/* FAB */
.fab-new-user {
  position: fixed;
  right: 16px;
  bottom: 16px;
  background: linear-gradient(135deg,#111827,#2563eb);
  color: #fff;
  padding: 12px 16px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
  box-shadow: 0 10px 25px rgba(0,0,0,0.28);
  z-index: 2000;
}

.fab-new-user:hover {
  color: #fff;
  transform: translateY(-1px);
}

/* MODAL IMAGEN */
.image-preview-modal {
  position: fixed;
  inset: 0;
  display: none;
  z-index: 9999;
}

.image-preview-modal.show {
  display: block;
}

.image-preview-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.9);
}

.image-preview-content {
  position: relative;
  z-index: 2;
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 20px;
}

.image-preview-full {
  max-width: 95%;
  max-height: 80%;
  border-radius: 20px;
}

.image-preview-close {
  position: absolute;
  top: 14px;
  right: 14px;
  background: rgba(255,255,255,0.2);
  border: none;
  color: white;
  font-size: 20px;
  border-radius: 50%;
  width: 40px;
  height: 40px;
}

.image-preview-header {
  position: absolute;
  top: 18px;
  left: 18px;
  color: white;
  font-weight: bold;
}

.empty-state {
  padding: 28px 20px;
  text-align: center;
}

/* RESPONSIVE */
@media (max-width: 768px) {
  .menu-grid {
    grid-template-columns: 1fr;
  }

  .app-shell {
    max-width: 100%;
  }

  .hero-card,
  .list-card {
    border-radius: 18px;
  }

  .hero-card {
    padding: 16px;
  }

  .app-title {
    font-size: 1.5rem;
  }

  .results-pill {
    font-size: 12px;
    padding: 5px 10px;
  }

  .list-header {
    display: none;
  }

  .user-row {
    grid-template-columns: minmax(92px, 1.4fr) minmax(74px, 1fr) 54px 36px;
    gap: 4px;
    padding: 8px 10px;
    min-height: 48px;
  }

  .user-row-name {
    font-size: 13px;
  }

  .phone-link,
  .phone-empty {
    font-size: 12px;
  }

  .switch-track {
    width: 32px;
    height: 18px;
    padding: 2px;
  }

  .switch-thumb {
    width: 14px;
    height: 14px;
  }

  .switch-btn.on .switch-thumb {
    transform: translateX(14px);
  }

  .user-col-photo {
    width: 36px;
    min-width: 36px;
  }

  .user-col-photo .mini-photo,
  .user-col-photo .mini-photo-placeholder {
    width: 24px !important;
    height: 24px !important;
    min-width: 24px !important;
    max-width: 24px !important;
    min-height: 24px !important;
    max-height: 24px !important;
  }

  .fab-new-user {
    right: 12px;
    bottom: 12px;
    padding: 10px 14px;
    font-size: 13px;
  }

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

  .camera-box,
  .user-photo-placeholder {
    height: 220px;
  }

  .signature-pad {
    height: 160px;
  }

  .signature-preview {
    height: 100px;
  }
}

@media (max-width: 768px) {
  .mobile-sortbar {
    display: flex;
  }
}


.list-header-citas,
.list-row-citas {
  display: grid;
  grid-template-columns: 0.9fr 0.8fr 1.3fr 1.4fr 1fr 0.7fr;
  gap: 12px;
  align-items: center;
  padding: 12px 14px;
}

.list-header-citas {
  background: #f8fafc;
  border-bottom: 1px solid #e5e7eb;
  font-weight: 800;
  font-size: 12px;
  text-transform: uppercase;
  color: #475569;
}

.list-row-citas {
  border-bottom: 1px solid #edf2f7;
}

.cita-item {
  display: block;
}

@media (max-width: 768px) {
  .list-header-citas {
    display: none;
  }

  .list-row-citas {
    grid-template-columns: 1fr;
    gap: 8px;
  }
}

.cliente-list-header-mobile3 {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) 64px;
  gap: 8px;
  align-items: center;
  padding: 10px 14px;
  background: #f8fafc;
  border-bottom: 1px solid #e5e7eb;
  font-size: 12px;
  font-weight: 800;
  color: #475569;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.cliente-row-mobile3 {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) 64px;
  gap: 8px;
  align-items: center;
  padding: 10px 14px;
  min-height: 56px;
  transition: background 0.2s ease;
  border-bottom: 1px solid #edf2f7;
}

.cliente-row-mobile3:hover {
  background: #f8fafc;
}

.cliente-row-mobile3 .cliente-col-nombre,
.cliente-row-mobile3 .cliente-col-telefono,
.cliente-row-mobile3 .cliente-col-active {
  min-width: 0;
}

.cliente-row-mobile3 .cliente-main-text,
.cliente-row-mobile3 .cliente-secondary-text {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

@media (max-width: 768px) {
  .cliente-list-header-mobile3 {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.95fr) 54px;
    gap: 6px;
    padding: 8px 10px;
    font-size: 11px;
  }

  .cliente-row-mobile3 {
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.95fr) 54px;
    gap: 6px;
    padding: 10px;
    min-height: 52px;
  }

  .cliente-row-mobile3 .cliente-main-text {
    font-size: 13px;
  }

  .cliente-row-mobile3 .cliente-secondary-text {
    font-size: 12px;
  }

  .switch-btn {
    transform: scale(0.92);
    transform-origin: center;
  }
}

/* CLIENTES SOLO 3 CAMPOS VISIBLES */
.cliente-list-header-mobile3 {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) 64px;
  gap: 8px;
  align-items: center;
  padding: 10px 14px;
  background: #f8fafc;
  border-bottom: 1px solid #e5e7eb;
  font-size: 12px;
  font-weight: 800;
  color: #475569;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.cliente-card-wrap {
  border-bottom: 1px solid #edf2f7;
}

.cliente-row-mobile3 {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) 64px;
  gap: 8px;
  align-items: center;
  padding: 10px 14px;
  min-height: 56px;
  transition: background 0.2s ease;
}

.cliente-row-mobile3:hover {
  background: #f8fafc;
}

.cliente-row-mobile3 .cliente-col-nombre,
.cliente-row-mobile3 .cliente-col-telefono,
.cliente-row-mobile3 .cliente-col-active {
  min-width: 0;
}

.cliente-row-mobile3 .cliente-main-text,
.cliente-row-mobile3 .cliente-secondary-text {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cliente-delete-bar {
  display: flex;
  justify-content: flex-end;
  padding: 0 14px 12px 14px;
}

@media (max-width: 768px) {
  .cliente-list-header-mobile3 {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.95fr) 58px;
    gap: 6px;
    padding: 8px 10px;
    font-size: 11px;
  }

  .cliente-row-mobile3 {
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.95fr) 58px;
    gap: 6px;
    padding: 10px;
    min-height: 52px;
  }

  .cliente-row-mobile3 .cliente-main-text {
    font-size: 13px;
  }

  .cliente-row-mobile3 .cliente-secondary-text {
    font-size: 12px;
  }

  .cliente-delete-bar {
    padding: 0 10px 10px 10px;
  }

  .cliente-delete-bar .btn {
    font-size: 12px;
    padding: 6px 10px;
  }
}


.cliente-list-header-mobile2 {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  padding: 10px 14px;
  background: #f8fafc;
  border-bottom: 1px solid #e5e7eb;
  font-size: 12px;
  font-weight: 800;
  color: #475569;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.cliente-row-mobile2 {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  padding: 10px 14px;
  min-height: 56px;
  transition: background 0.2s ease;
  border-bottom: 1px solid #edf2f7;
}

.cliente-row-mobile2:hover {
  background: #f8fafc;
}

.cliente-row-mobile2 .cliente-col-nombre,
.cliente-row-mobile2 .cliente-col-telefono {
  min-width: 0;
}

.cliente-row-mobile2 .cliente-main-text,
.cliente-row-mobile2 .cliente-secondary-text {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

@media (max-width: 768px) {
  .cliente-list-header-mobile2 {
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
    gap: 6px;
    padding: 8px 10px;
    font-size: 11px;
  }

  .cliente-row-mobile2 {
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
    gap: 6px;
    padding: 10px;
    min-height: 52px;
  }

  .cliente-row-mobile2 .cliente-main-text {
    font-size: 13px;
  }

  .cliente-row-mobile2 .cliente-secondary-text {
    font-size: 12px;
  }
}


/* ===== DARK MODE GLOBAL ===== */

body.dark-mode {
  background: #0f172a !important;
  color: #e5e7eb;
}

body.dark-mode .hero-card,
body.dark-mode .list-card,
body.dark-mode .card-pro,
body.dark-mode .cita-card {
  background: #111827 !important;
  color: #e5e7eb !important;
  border: 1px solid rgba(255,255,255,.08);
  box-shadow: 0 8px 24px rgba(0,0,0,.25);
}

body.dark-mode .app-title,
body.dark-mode .app-title-sm,
body.dark-mode .eyebrow,
body.dark-mode .app-subtitle,
body.dark-mode p,
body.dark-mode h1,
body.dark-mode h3,
body.dark-mode strong,
body.dark-mode label,
body.dark-mode span,
body.dark-mode div {
  color: #e5e7eb !important;
}

body.dark-mode .btn-light {
  background: #1f2937 !important;
  color: #f9fafb !important;
  border-color: #374151 !important;
}

body.dark-mode input,
body.dark-mode select,
body.dark-mode textarea {
  background: #1f2937 !important;
  color: #f9fafb !important;
  border-color: #374151 !important;
}

body.dark-mode .results-pill {
  background: #1e3a8a !important;
  color: #fff !important;
}


.image-preview-modal {
  position: fixed;
  inset: 0;
  z-index: 1080;
  display: none;
}

.image-preview-modal.show {
  display: block;
}

.image-preview-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,.72);
}

.image-preview-content {
  position: relative;
  z-index: 2;
  max-width: 92vw;
  max-height: 92vh;
  margin: 3vh auto;
  background: #fff;
  border-radius: 20px;
  padding: 18px;
  box-shadow: 0 20px 60px rgba(0,0,0,.35);
}

.image-preview-close {
  position: absolute;
  top: 10px;
  right: 10px;
  border: none;
  background: rgba(17,24,39,.86);
  color: #fff;
  width: 40px;
  height: 40px;
  border-radius: 999px;
}

.image-preview-header {
  font-weight: 700;
  margin-bottom: 12px;
  padding-right: 48px;
}

.image-preview-full {
  width: 100%;
  max-height: 78vh;
  object-fit: contain;
  display: block;
  border-radius: 14px;
}



















.agenda-toggle .switch-track {
  height: 20px !important;
  min-height: 20px !important;
}

.agenda-toggle .switch-thumb {
  width: 16px !important;
  height: 16px !important;
}