/* frontend/pages/clientes/clientes.css */
/* =========================================================
   Rasta Pets – Clientes (Diseño Minimalista & High Density)
   ========================================================= */

/* Regla defensiva */
.clients-page [hidden],
.clients-page section[hidden],
.clients-page aside[hidden] {
  display: none !important;
}

/* Alias limitados a Clientes; las variantes locales se definen más abajo. */
.clients-page {
  --bg-body: var(--page-bg-body);
  --bg-card: var(--page-bg-card);
  --bg-soft: var(--page-bg-soft);
  --bg-input: var(--page-bg-input);
  --text-main: var(--page-text-main);
  --text-secondary: var(--page-text-secondary);
  --text-placeholder: var(--page-text-placeholder);
  --color-blue: var(--page-color-blue);
  --color-blue-soft: var(--page-color-blue-soft);
  --color-green: var(--page-color-green);
  --color-green-soft: var(--page-color-green-soft);
  --color-orange: var(--page-color-orange);
  --color-orange-soft: var(--page-color-orange-soft);
  --color-purple: var(--page-color-purple);
  --color-purple-soft: var(--page-color-purple-soft);
  --color-red: var(--page-color-red);
  --color-red-soft: var(--page-color-red-soft);
  --border-soft: var(--page-border-soft);
  --border-light: var(--page-border-light);
  --shadow-soft: var(--page-shadow-soft);
  --shadow-hover: var(--page-shadow-hover);
  --shadow-focus: var(--page-shadow-focus);
  --shadow-primary: var(--page-shadow-primary);
  --radius-xl: var(--page-radius-xl);
  --radius-l: var(--page-radius-l);
  --radius-m: var(--page-radius-m);
  --radius-s: var(--page-radius-s);
  --radius-round: var(--page-radius-round);


/* =========================================================
   Layout General
   ========================================================= */

  width: 100%;
  max-width: 100%;
  
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin: 0;
  padding: 20px 24px;
  box-sizing: border-box;
  background: var(--bg-body);
  color: var(--text-main);
  font-family: var(--font-family);
}

/* =========================================================
   Topbar / Header
   ========================================================= */

.clients-page .topbar {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: center;
  justify-content: space-between;
  position: relative;
  z-index: 10;
}

@layer pages {
.clients-page .title-wrap {
  display: flex;
  flex-direction: column;
  gap: 4px;
}



.clients-page .title-row {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}
}

.clients-page .title {
  
  margin: 0;
  color: #0f172a;
  font-size: 28px;
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.03em;
}

.clients-page .kpi-inline {
  font-size: 12.5px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  color: #64748b;
  padding: 4px 12px;
  border-radius: 8px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.02);
}

@layer pages {
.clients-page .tooltip-info {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #94a3b8;
  cursor: help;
  transition: color 0.15s;
}



.clients-page .tooltip-info:hover {
  color: #0f172a;
}



.clients-page .top-actions {
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 10px;
}
}

/* Selector de Orden y Conmutador de Vista */
:where(.clients-page) .view-sort-group {
  display: inline-flex;
  align-items: center;
  background: #ffffff;
  padding: 3px 6px;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.02);
  height: 40px;
  box-sizing: border-box;
  flex-shrink: 0;
}

:where(.clients-page) .view-sort-group .sort {
  min-width: 125px;
  display: flex;
  align-items: center;
}

:where(.clients-page) .view-sort-group .custom-select {
  width: 100%;
  min-width: 120px;
}

:where(.clients-page) .view-sort-group .cs-selected {
  min-height: 34px !important;
  height: 34px !important;
  padding: 0 8px 0 10px !important;
  border: none !important;
  background: transparent !important;
  box-shadow: none !important;
  font-weight: 600 !important;
  font-size: 13.5px !important;
  color: #0f172a !important;
  border-radius: 6px !important;
  cursor: pointer;
}

:where(.clients-page) .view-sort-group .cs-selected:hover {
  background: #f8fafc !important;
}

:where(.clients-page) .view-sort-group .custom-select.open .cs-selected {
  background: #f8fafc !important;
  border-color: transparent !important;
  box-shadow: none !important;
}

:where(.clients-page) .view-sort-group .cs-options {
  min-width: 150px !important;
  top: calc(100% + 4px) !important;
  padding: 4px !important;
  border-radius: 8px !important;
  box-shadow: 0 10px 25px -5px rgba(15, 23, 42, 0.12) !important;
  border: 1px solid #e2e8f0 !important;
}

:where(.clients-page) .view-sort-group .cs-option {
  padding: 8px 12px !important;
  font-size: 13px !important;
  font-weight: 500 !important;
  border-radius: 6px !important;
  white-space: nowrap !important;
}

:where(.clients-page) .view-sort-group select#sortBy {
  border: none !important;
  background: transparent !important;
  padding: 0 24px 0 10px !important;
  box-shadow: none !important;
  font-weight: 600;
  font-size: 13.5px;
  color: #0f172a;
  height: 34px;
  outline: none !important;
  cursor: pointer;
  min-width: 120px;
}

:where(.clients-page) .view-sort-group .divider {
  width: 1px;
  height: 22px;
  background: #e2e8f0;
  margin: 0 6px;
}

:where(.clients-page) .view-sort-group .view-toggle {
  display: flex;
  align-items: center;
  gap: 3px;
}

:where(.clients-page) .view-sort-group .view-toggle .toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  padding: 0 !important;
  background: transparent !important;
  color: #64748b !important;
  border: 1px solid transparent !important;
  border-radius: 6px !important;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1) !important;
  outline: none !important;
  cursor: pointer;
}

:where(.clients-page) .view-sort-group .view-toggle .toggle i,
:where(.clients-page) .view-sort-group .view-toggle .toggle svg {
  width: 17px !important;
  height: 17px !important;
}

:where(.clients-page) .view-sort-group .view-toggle .toggle:hover {
  background: #f8fafc !important;
  color: #0f172a !important;
}



/* Boton Nuevo Cliente */
:where(.clients-page) .btn-new-client-premium {
  height: 40px !important;
  min-height: 40px !important;
  padding: 0 18px !important;
  border-radius: 8px !important;
  font-weight: 600 !important;
  font-size: 13.5px !important;
  letter-spacing: -0.01em !important;
  border: 1px solid #0f172a !important;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08) !important;
  background: #0f172a !important;
  color: #ffffff !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 7px !important;
  cursor: pointer !important;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1) !important;
  white-space: nowrap !important;
  flex: 0 0 auto !important;
  width: auto !important;
  max-width: max-content !important;
  box-sizing: border-box !important;
}

:where(.clients-page) .btn-new-client-premium i,
:where(.clients-page) .btn-new-client-premium svg {
  width: 18px !important;
  height: 18px !important;
  stroke-width: 2.2 !important;
}

:where(.clients-page) .btn-new-client-premium:hover {
  background: #1e293b !important;
  border-color: #1e293b !important;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.18) !important;
  transform: translateY(-1px);
}

/* =========================================================
   Workbench (Grid 2 Columnas)
   ========================================================= */

@layer pages {
.clients-page .workbench {
  width: 100%;
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 20px;
  align-items: stretch;
}
}

/* ---------- Rail Izquierdo (Filtros) ---------- */
.clients-page .rail-left {
  display: flex;
  flex-direction: column;
  background: #ffffff !important;
  border: 1px solid #e2e8f0 !important;
  border-radius: 12px !important;
  padding: 18px !important;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02) !important;
  position: sticky;
  top: 16px;
  align-self: stretch;
  margin-bottom: 0;
}

:where(.clients-page) .rail-section {
  padding-bottom: 14px;
  margin-bottom: 14px;
  border-bottom: 1px solid #f1f5f9;
}

:where(.clients-page) .rail-section:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

:where(.clients-page) .rail-title {
  font-size: 11px;
  text-transform: uppercase;
  font-weight: 700;
  color: #64748b;
  letter-spacing: 0.05em;
  margin-bottom: 8px;
}

:where(.clients-page) .nav-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

:where(.clients-page) .nav-item {
  width: 100%;
  text-align: left;
  background: transparent;
  border: 1px solid transparent;
  padding: 8px 12px;
  font-size: 13px;
  font-weight: 500;
  color: #334155;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s ease;
  display: flex;
  align-items: center;
  gap: 8px;
  box-sizing: border-box;
}

:where(.clients-page) .nav-item:hover {
  background: #f8fafc;
  color: #0f172a;
}

:where(.clients-page) .nav-item.is-active {
  font-weight: 600 !important;
  background: #0f172a !important;
  color: #ffffff !important;
  border-color: #0f172a !important;
}

:where(.clients-page) #btnToggleDisabled {
  color: #64748b;
  border: 1px solid #e2e8f0;
  background: #ffffff;
  border-radius: 8px;
}

:where(.clients-page) #btnToggleDisabled:hover {
  background: #f8fafc;
  color: #0f172a;
  border-color: #cbd5e1;
}

:where(.clients-page) #btnToggleDisabled i {
  color: #64748b;
  opacity: 0.85;
  transition: color 0.15s;
}

:where(.clients-page) #btnToggleDisabled:hover i {
  color: #0f172a;
}

:where(.clients-page) #btnToggleDisabled.is-inactivos {
  background: #fff1f2 !important;
  color: #e11d48 !important;
  border-color: #fecdd3 !important;
  font-weight: 700 !important;
}

:where(.clients-page) #btnToggleDisabled.is-inactivos i,
:where(.clients-page) #btnToggleDisabled.is-inactivos svg {
  color: #e11d48 !important;
  opacity: 1 !important;
}

/* Radio chips: Última visita */
:where(.clients-page) .radio-chip-group {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 6px;
}

:where(.clients-page) .radio-chip {
  cursor: pointer;
  user-select: none;
}

:where(.clients-page) .radio-chip input {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

:where(.clients-page) .radio-chip span {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6px 8px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 500;
  color: #64748b;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  transition: all 0.15s ease;
  text-align: center;
  box-sizing: border-box;
}

:where(.clients-page) .radio-chip:hover span {
  background: #f1f5f9;
  color: #0f172a;
  border-color: #cbd5e1;
}

:where(.clients-page) .radio-chip input:checked + span {
  font-weight: 600 !important;
}

/* Más filtros (Rango de fechas) */
@layer pages {
:where(.clients-page) .filters-grid {
  margin-top: 4px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}



:where(.clients-page) .filter-date-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}
}

:where(.clients-page) .filter-date-grid .sub-label {
  display: block;
  margin-bottom: 4px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
}

:where(.clients-page) .filter-date-grid .input {
  width: 100%;
  box-sizing: border-box;
  min-height: 36px;
  padding: 6px 10px;
  font-size: 12.5px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #ffffff;
  color: #0f172a;
}

@layer pages {
:where(.clients-page) .filter-buttons-row {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  width: 100%;
  margin-top: 4px;
  box-sizing: border-box;
}
}

:where(.clients-page) .filter-buttons-row .btn {
  width: 100%;
  min-width: 0;
  min-height: 36px;
  padding: 6px 8px;
  font-size: 12.5px;
  font-weight: 600;
  box-sizing: border-box;
  justify-content: center;
  white-space: nowrap;
}

:where(.clients-page) .filter-buttons-row .btn-primary {
  background: #0f172a !important;
  color: #ffffff !important;
  border: 1px solid #0f172a !important;
  border-radius: 8px !important;
}

:where(.clients-page) .filter-buttons-row .btn-primary:hover {
  background: #1e293b !important;
  border-color: #1e293b !important;
}

:where(.clients-page) .filter-buttons-row .btn-plain {
  border: 1px solid #e2e8f0 !important;
  background: #ffffff !important;
  color: #64748b !important;
  border-radius: 8px !important;
}

:where(.clients-page) .filter-buttons-row .btn-plain:hover {
  background: #f8fafc !important;
  color: #0f172a !important;
}

/* ---------- Columna Central (Lista y Toolbar) ---------- */
@layer pages {
.clients-page .list-col {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
}
}

.clients-page .list-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 16px;
  background: #ffffff !important;
  border: 1px solid #e2e8f0 !important;
  border-radius: 10px !important;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02) !important;
}

:where(.clients-page) .search-wrap-box {
  flex: 1;
  max-width: 360px;
  position: relative;
  display: flex;
  align-items: center;
}

:where(.clients-page) .search-wrap-box .search-box-icon {
  position: absolute;
  left: 14px;
  width: 17px;
  height: 17px;
  color: #94a3b8;
  pointer-events: none;
  z-index: 2;
}

:where(.clients-page) .search-input {
  width: 100%;
  height: 42px;
  min-height: 42px;
  padding: 0 14px 0 40px !important;
  background: #ffffff !important;
  border: 1px solid #cbd5e1 !important;
  border-radius: 8px !important;
  font-size: 13.5px;
  font-weight: 500;
  color: #0f172a !important;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.02) !important;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

:where(.clients-page) .search-input::placeholder {
  color: #94a3b8 !important;
  font-weight: 400 !important;
}

:where(.clients-page) .search-input:focus {
  outline: none !important;
  background-color: #ffffff !important;
}

@layer pages {
:where(.clients-page) .toolbar-actions-right {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-left: auto;
}
}

.clients-page .muted {
  color: #64748b !important;
  font-size: 12.5px !important;
  font-weight: 600 !important;
}

@layer pages {
:where(.clients-page) .bulk-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
}

/* =========================================================
   Contenedor Scroll
   ========================================================= */

:where(.clients-page) .clients-scroll {
  max-height: none;
  overflow: visible;
  border-radius: 12px;
}

:where(.clients-page) .clients-scroll::-webkit-scrollbar {
  width: 6px;
}

:where(.clients-page) .clients-scroll::-webkit-scrollbar-track {
  background: transparent;
}

:where(.clients-page) .clients-scroll::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.3);
  border-radius: 10px;
}

:where(.clients-page) .clients-scroll::-webkit-scrollbar-thumb:hover {
  background: rgba(148, 163, 184, 0.5);
}

/* =========================================================
   Paginación Minimalista
   ========================================================= */

.clients-page .pagination-controls {
  display: flex;
  grid-column: 2;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  padding: 0 4px;
}

.clients-page .pagination-controls #clientesPageInfo {
  font-size: 12.5px;
  font-weight: 600;
  color: #64748b;
  padding: 0 8px;
}

.clients-page .pagination-controls .btn-page {
  flex: 0 0 32px !important;
  width: 32px !important;
  min-width: 32px !important;
  max-width: 32px !important;
  height: 32px;
  min-height: 32px;
  border-radius: 8px !important;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  color: #475569;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.clients-page .pagination-controls .btn-page:hover:not(:disabled),
.clients-page .pagination-controls .btn-page:focus-visible:not(:disabled) {
  background: #2563eb !important;
  color: #ffffff !important;
  border-color: #2563eb !important;
  box-shadow: 0 2px 6px rgba(37, 99, 235, 0.22) !important;
  transform: translateY(-1px);
}

.clients-page .pagination-controls .btn-page:disabled {
  opacity: 0.35;
  cursor: not-allowed;
  pointer-events: none;
}

/* =========================================================
   Vista: Tarjetas (Alta Densidad)
   ========================================================= */

.clients-page .client-cards {
  display: flex;
  flex-direction: column;
  background: #ffffff !important;
  border: 1px solid #e2e8f0 !important;
  border-radius: 12px !important;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02) !important;
  overflow: hidden;
}

@layer pages {
.clients-page .client-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 8px 18px;
  background: #ffffff;
  border-bottom: 1px solid #f1f5f9;
  transition: all 0.15s ease;
  border-left: 3px solid transparent;
  cursor: pointer;
}



.clients-page .client-card:last-child {
  border-bottom: none;
}



.clients-page .client-card:hover {
  background: #f8fafc;
}
}

.clients-page .avatar {
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f1f5f9 !important;
  color: #334155 !important;
  border: 1px solid #e2e8f0 !important;
  border-radius: 8px !important;
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.clients-page .avatar.lg {
  width: 44px;
  height: 44px;
  font-size: 16px;
  border-radius: 10px !important;
}

@layer pages {
.clients-page .cc-main-info {
  flex: 1 1 200px;
  display: flex;
  align-items: baseline;
  gap: 10px;
  min-width: 0;
}
}

.clients-page .cc-name {
  margin: 0;
  font-size: 14px;
  font-weight: 700;
  color: #0f172a !important;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.clients-page .cc-phone {
  font-size: 12.5px;
  font-weight: 500;
  color: #64748b !important;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
  transition: color 0.15s;
}

.clients-page .cc-phone:hover {
  color: #0f172a !important;
}

@layer pages {
.clients-page .cc-pets {
  width: 220px;
  flex-shrink: 0;
  display: flex;
  gap: 5px;
  overflow: hidden;
  align-items: center;
  flex-wrap: nowrap;
}
}

:where(.clients-page) .pet-chip {
  padding: 3px 8px !important;
  background: #f8fafc !important;
  color: #334155 !important;
  border: 1px solid #e2e8f0 !important;
  border-radius: 6px !important;
  font-size: 11.5px !important;
  font-weight: 600 !important;
  white-space: nowrap;
  max-width: 95px;
  overflow: hidden;
  text-overflow: ellipsis;
}

:where(.clients-page) .pet-chip-more {
  background: #0f172a !important;
  color: #ffffff !important;
  border-color: #0f172a !important;
  font-weight: 700 !important;
  font-size: 11px !important;
  padding: 3px 6px !important;
  flex-shrink: 0;
}

:where(.clients-page) .no-pets-label {
  font-size: 12.5px;
  color: #94a3b8;
  font-style: normal;
}

@layer pages {
.clients-page .cc-stats {
  width: 140px;
  flex-shrink: 0;
  display: flex;
  justify-content: flex-end;
  gap: 14px;
  font-size: 12.5px;
  color: #64748b;
  white-space: nowrap;
}
}

.clients-page .cc-stats span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

@layer pages {
.clients-page .cc-actions {
  width: 76px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
}
}

.clients-page .cc-action-btn {
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #ffffff !important;
  color: #64748b !important;
  border: 1px solid #e2e8f0 !important;
  border-radius: 8px !important;
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.02) !important;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1) !important;
  padding: 0;
}

.clients-page .cc-action-btn:hover {
  color: #ffffff !important;
  transform: translateY(-1px);
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.15) !important;
}

.clients-page .cc-action-btn svg,
.clients-page .cc-action-btn i {
  width: 14px;
  height: 14px;
}

/* =========================================================
   Vista: Tabla
   ========================================================= */

.clients-page .table-wrap {
  overflow-x: auto;
  border-radius: 10px !important;
  border: 1px solid #e2e8f0 !important;
  background: #ffffff !important;
  width: 100%;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02) !important;
}

.clients-page table.table {
  width: 100%;
  table-layout: fixed;
  border-collapse: collapse;
  font-size: 13px;
}

.clients-page table.table thead tr {
  background: #f8fafc;
}

.clients-page table.table th {
  padding: 12px 16px;
  text-align: left;
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #475569 !important;
  border-bottom: 1px solid #e2e8f0 !important;
  white-space: nowrap;
  position: sticky;
  top: 0;
  z-index: 10;
  background: #f8fafc;
}

.clients-page table.table th:first-child,
.clients-page table.table td:first-child {
  padding-left: 18px;
  width: 40px;
}

.clients-page table.table th:nth-child(2),
.clients-page table.table td:nth-child(2) {
  width: 24%;
}

.clients-page table.table th:nth-child(3),
.clients-page table.table td:nth-child(3) {
  width: 14%;
}

.clients-page table.table th:nth-child(4),
.clients-page table.table td:nth-child(4) {
  width: 22%;
}

.clients-page table.table th:nth-child(5),
.clients-page table.table td:nth-child(5) {
  width: 13%;
}

.clients-page table.table th:nth-child(6),
.clients-page table.table td:nth-child(6) {
  width: 12%;
}

.clients-page table.table th:last-child,
.clients-page table.table td:last-child {
  padding-right: 18px;
  width: 80px;
  text-align: right;
}

.clients-page table.table tbody tr {
  transition: background 0.12s ease;
  cursor: pointer;
}

.clients-page table.table td {
  padding: 12px 16px;
  vertical-align: middle;
  font-size: 13px;
  font-weight: 500;
  color: #334155;
  border-bottom: 1px solid #f1f5f9;
}

.clients-page table.table tr:last-child td {
  border-bottom: none;
}

.clients-page table.table tbody tr:hover td {
  background: #f8fafc;
}

.clients-page table.table td:nth-child(2) {
  font-weight: 600;
  color: #0f172a;
}

/* Checkbox personalizado */
.clients-page table.table input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  min-width: 18px;
  min-height: 18px;
  border: 1.5px solid #cbd5e1;
  border-radius: 5px;
  background-color: #ffffff;
  cursor: pointer;
  position: relative;
  transition: all 0.15s ease;
  margin: 0;
  display: inline-block;
  vertical-align: middle;
  outline: none;
}

.clients-page table.table input[type="checkbox"]:hover {
  border-color: #0f172a;
}

.clients-page table.table input[type="checkbox"]:checked {
  background-color: #0f172a !important;
  border-color: #0f172a !important;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'%3E%3C/polyline%3E%3C/svg%3E") !important;
  background-size: 11px 11px !important;
  background-position: center center !important;
  background-repeat: no-repeat !important;
}

.clients-page table.table input[type="checkbox"]:indeterminate {
  background-color: #0f172a !important;
  border-color: #0f172a !important;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cline x1='5' y1='12' x2='19' y2='12'%3E%3C/line%3E%3C/svg%3E") !important;
  background-size: 11px 11px !important;
  background-position: center center !important;
  background-repeat: no-repeat !important;
}

@layer pages {
.clients-page .tbl-actions-wrap {
  display: flex;
  align-items: center;
  gap: 4px;
  justify-content: flex-end;
}
}

:where(.clients-page) .badge-ok {
  padding: 3px 8px;
  background: #ecfdf5;
  color: #059669;
  border: 1px solid #a7f3d0;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
}

/* =========================================================
   Formularios y diálogos de la página
   ========================================================= */

.clients-page .card {
  position: relative;
  padding: 20px 24px;
  box-sizing: border-box;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-l);
  box-shadow: var(--shadow-soft);
}

.clients-page .block-title {
  margin-bottom: 16px;
  color: var(--text-main);
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.clients-page .label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 8px;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 700;
}

.clients-page .input {
  min-height: 42px;
  padding: 8px 12px;
  box-sizing: border-box;
  background: var(--bg-input);
  color: var(--text-main);
  border: 1px solid var(--border-soft);
  border-radius: 10px;
  font-size: 13.5px;
  font-weight: 500;
  transition: all 0.2s ease;
}

.clients-page .input:focus {
  outline: none;
  background: #ffffff;
  border-color: var(--color-primary);
  box-shadow: var(--shadow-focus);
}

@layer pages {
:where(.clients-page) .grid-2-cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  align-items: start;
}
}

:where(.clients-page) .map-container {
  width: 100% !important;
  height: 310px !important;
  min-height: 280px !important;
  border-radius: 14px !important;
  border: 1px solid var(--border-soft, #e2e8f0) !important;
  overflow: hidden !important;
  position: relative !important;
  z-index: 1 !important;
  box-shadow: 0 2px 10px rgba(16, 42, 86, 0.05) !important;
}

@layer pages {
:where(.clients-page) .form-footer {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 8px;
}



:where(.clients-page) .form-actions-right {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}
}

/* Modal Confirmación Desactivar */
:where(.clients-page) .modal-confirm-card {
  max-width: 380px;
  padding: 24px;
  text-align: center;
  border: none;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.16);
  border-radius: 16px;
  background: #fff;
}

:where(.clients-page) .modal-confirm-icon {
  font-size: 36px;
  margin-bottom: 10px;
}

:where(.clients-page) .modal-confirm-title {
  margin-bottom: 8px;
  font-size: 18px;
}

:where(.clients-page) .modal-confirm-text {
  color: var(--text-secondary);
  font-size: 13.5px;
  line-height: 1.5;
  margin-bottom: 20px;
}

@layer pages {
:where(.clients-page) .modal-confirm-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
}
}

:where(.clients-page) .btn-confirm-danger {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  justify-content: center;
  min-height: 36px;
  padding: 0 16px;
  background: var(--color-red);
  color: white;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
}

:where(.clients-page) .btn-confirm-cancel {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  justify-content: center;
  min-height: 36px;
  padding: 0 16px;
  border-radius: 8px;
  cursor: pointer;
  border: 1px solid var(--border-soft);
}

/* Modal Ver Ubicación */
:where(.clients-page) .modal-ver-ubicacion {
  max-width: 650px;
  width: 90%;
}

@layer pages {
:where(.clients-page) .modal-title-flex {
  margin: 0;
  font-size: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}
}

:where(.clients-page) .btn-circle-close {
  padding: 4px 10px;
  min-height: auto;
  border-radius: 50%;
  border: none;
  background: var(--bg-input);
  cursor: pointer;
}

:where(.clients-page) .ubicacion-address-text {
  color: var(--text-secondary);
  font-size: 13.5px;
  margin-bottom: 12px;
  line-height: 1.4;
  font-weight: 500;
  background: var(--bg-input);
  padding: 10px 14px;
  border-radius: 8px;
  border: 1px solid var(--border-soft);
}

:where(.clients-page) .map-wrapper-320 {
  height: 320px;
  width: 100%;
  border-radius: 10px;
  border: 1px solid var(--border-soft);
  overflow: hidden;
  margin-bottom: 16px;
  position: relative;
}

:where(.clients-page) .map-inner {
  height: 100%;
  width: 100%;
  z-index: 1;
}

:where(.clients-page) .btn-link-flex {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
}

/* =========================================================
   Clases Utilitarias Específicas
   ========================================================= */

:where(.clients-page) .btn-drawer-edit { padding: 4px; height: auto; }
:where(.clients-page) .btn-add-location { font-size: 12px; padding: 4px 10px; height: 28px; }

/* =========================================================
   Kebab Dropdown Menu
   ========================================================= */





:where(body:has(.clients-page)) .kebab-menu button {
  font-family: var(--font-family, inherit);
}















/* =========================================================
   Badges de Calificación / Semáforo (Cliente y Mascota)
   ========================================================= */
:where(.clients-page) .badge-calif {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px 6px;
  border-radius: 5px;
  font-size: 10px;
  font-weight: 700;
  line-height: 1.2;
  white-space: nowrap;
}

:where(.clients-page) .badge-calif-client--verde,
:where(.clients-page) .badge-calif-pet--verde {
  background: #dcfce7;
  color: #15803d;
  border: 1px solid #bbf7d0;
}

:where(.clients-page) .badge-calif-client--amarillo,
:where(.clients-page) .badge-calif-pet--amarillo {
  background: #fef9c3;
  color: #a16207;
  border: 1px solid #fef08a;
}

:where(.clients-page) .badge-calif-client--rojo,
:where(.clients-page) .badge-calif-pet--rojo {
  background: #fee2e2;
  color: #b91c1c;
  border: 1px solid #fecaca;
}


/* =========================================================
   Responsive
   ========================================================= */

@media (max-width: 1024px) {
  @layer pages {
.clients-page .workbench {
    grid-template-columns: 220px 1fr;
    gap: 16px;
  }
}
}

@media (max-width: 768px) {
  .clients-page {
    padding: 16px;
  }

  @layer pages {
.clients-page .workbench {
    grid-template-columns: 1fr;
  }
}

  .clients-page .rail-left {
    position: static;
  }

  .clients-page .pagination-controls {
    grid-column: 1;
  }

  @layer pages {
.clients-page .top-actions {
    justify-content: flex-end;
    flex-wrap: nowrap;
    gap: 8px;
  }


  
.clients-page .client-card {
    flex-wrap: wrap;
    gap: 10px;
  }
}

  .clients-page .cc-pets,
  .clients-page .cc-stats {
    width: auto;
  }

  @layer pages {
:where(.clients-page) .grid-2-cols {
    grid-template-columns: 1fr;
  }
}
}

@media (max-width: 480px) {
  .clients-page .topbar {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  @layer pages {
.clients-page .top-actions {
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: center;
    gap: 8px;
    width: 100%;
    justify-content: flex-end;
  }
}

  :where(.clients-page) .view-sort-group {
    flex: 0 1 auto;
  }

  :where(.clients-page) .btn-new-client-premium {
    flex: 0 0 auto;
  }
}

/* Identidad visual basada en Fidelidad */
:where(.clients-page) {
  --bg-body: #f8fafc;
  --text-main: #0f172a;
  --text-secondary: #64748b;
  --color-primary: #2563eb;
  --color-primary-hover: #1d4ed8;
  --color-primary-soft: #eff6ff;
  --border-soft: #e2e8f0;
  --border-light: #e2e8f0;
  --shadow-focus: 0 0 0 3px rgba(37, 99, 235, 0.12);
  --shadow-primary: 0 2px 6px rgba(37, 99, 235, 0.18);
}

.clients-page .nav-item.is-active {
  background: #eff6ff !important;
  color: #1d4ed8 !important;
  border-color: #bfdbfe !important;
}

:where(.clients-page) .radio-chip input:checked + span {
  background: #eff6ff !important;
  color: #1d4ed8 !important;
  border-color: #bfdbfe !important;
}

:where(.clients-page) .view-sort-group .view-toggle .toggle.is-active {
  background: #2563eb !important;
  color: #ffffff !important;
  border-color: #2563eb !important;
  box-shadow: 0 2px 6px rgba(37, 99, 235, 0.2) !important;
}

:where(.clients-page) .search-input:focus {
  border-color: #2563eb !important;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12) !important;
}

@layer pages {
.clients-page .client-card:hover {
  border-left-color: #2563eb;
}
}

.clients-page .cc-action-btn:hover {
  background: #2563eb !important;
  border-color: #2563eb !important;
}



:where(.clients-page) input[type="checkbox"] {
  accent-color: #2563eb;
}

/* Espacio para el botón del menú en pantallas pequeñas. */
@media (max-width: 768px) {
  @layer pages {
.clients-page .title-wrap {
    margin-left: 48px;
  }
}
}

/* Accesibilidad y estados comunes de botones */
:where(.clients-page) button:focus-visible,
:where(.clients-page) [role="tab"]:focus-visible,
:where(body:has(.clients-page)) .kebab-menu button:focus-visible {
  outline: 3px solid rgba(37, 99, 235, 0.42);
  outline-offset: 2px;
}

:where(.clients-page) button:disabled {
  cursor: not-allowed;
}

:where(.clients-page) .radio-chip input:focus-visible + span {
  outline: 3px solid rgba(37, 99, 235, 0.42);
  outline-offset: 2px;
}

/* Mantener Clientes dentro del viewport y reservar el scroll para la lista. */
html:has(.clients-page),
body:has(.clients-page) {
  height: 100%;
  overflow: hidden;
}

.app-root:has(.clients-page) {
  height: 100vh;
  min-height: 0;
  overflow: hidden;
}

.clients-page {
  height: 100vh;
  min-height: 0;
  overflow: hidden;
}

@layer pages {
.clients-page .workbench {
  flex: 1 1 auto;
  min-height: 0;
}



.clients-page .list-col {
  height: 100%;
  min-height: 0;
  overflow: hidden;
}
}

:where(.clients-page) .clients-scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
}

.clients-page .pagination-controls {
  flex: 0 0 auto;
  margin-top: -10px;
}

/* Datos opcionales de la mascota. */
.pet-item .pet-extra-details { margin-top: 6px; font-size: 12px; color: #475569; }
.pet-item .pet-extra-details summary { cursor: pointer; }
.pet-item .pet-extra-details dl { margin: 8px 0 0; }
.pet-item .pet-extra-details dl > div { display: grid; grid-template-columns: minmax(90px, 140px) minmax(0, 1fr); gap: 8px; padding: 3px 0; }
.pet-item .pet-extra-details dt { font-weight: 600; }
.pet-item .pet-extra-details dd { margin: 0; overflow-wrap: anywhere; white-space: normal; }
