html, body, :root {
  color-scheme: light !important;
}

:root {
  --primary: #006399;
  --primary-light: #e0f2fe;
  --bg-body: #edf2f7;
  --bg-sidebar: #ffffff;
  --bg-header: #ffffff;
  --bg-card: #ffffff;
  --animation-speed: 0.3s;
  --text-main: #000000;
  --text-muted: #1a1a1a;
  --text-light: #333333;
  --border: #f1f5f9;
  --border-strong: #e2e8f0;
  --accent-blue: #006399;
  --accent-green: #10b981;
  --accent-red: #ef4444;
  --radius-lg: 12px;
  --radius-md: 8px;
  --radius-sm: 4px;
  --shadow-card: 0 10px 15px -3px rgba(0, 0, 0, 0.05), 0 4px 6px -2px rgba(0, 0, 0, 0.02);
  --shadow-hover: 0 20px 25px -5px rgba(0, 0, 0, 0.08), 0 10px 10px -5px rgba(0, 0, 0, 0.03);
  --shadow-sm: 0 1px 2px 0 rgba(0,0,0,0.05);
  --dark: #1e293b;
  --dark-light: #64748b;
}

.icon-asset {
    display: inline-block;
    width: var(--size, 18px);
    height: var(--size, 18px);
    background-color: currentColor;
    -webkit-mask-size: contain;
    mask-size: contain;
    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;
    -webkit-mask-position: center;
    mask-position: center;
    vertical-align: middle;
}

@keyframes pulse-red {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7); }
  70% { transform: scale(1); box-shadow: 0 0 0 6px rgba(239, 68, 68, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}

@keyframes slide-right {
  from { opacity: 0; transform: translateX(-30px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes slide-down {
  from { opacity: 0; transform: translateY(-20px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes slide-up {
  from { opacity: 0; transform: translateY(30px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes scale-in {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* Custom Scrollbar - Global */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 10px;
  border: 2px solid transparent;
  background-clip: content-box;
}

::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
  border: 2px solid transparent;
  background-clip: content-box;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  overflow: hidden;
  background-color: var(--bg-body);
}

body {
  font-family: 'Manrope', sans-serif;
  color: var(--text-main);
  line-height: 1.4;
  -webkit-font-smoothing: antialiased;
}

#app {
  width: 100%;
  height: 100%;
  overflow: hidden;
}

#app {
  width: 100%;
  height: 100%;
}

/* Auth Section */
.auth-container {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  background: white;
}

.auth-card {
  width: 100%;
  max-width: 440px;
  padding: 48px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-md);
}

.auth-logo {
  font-size: 2rem;
  font-weight: 800;
  color: var(--primary);
  letter-spacing: -1px;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.auth-logo span { color: var(--secondary); }

/* Dashboard Shell */
.app-shell {
  display: grid;
  grid-template-columns: 260px 1fr;
  width: 100%;
  height: 100%;
  overflow: hidden;
  zoom: 0.8;
}

.main-content {
  display: flex;
  flex-direction: column;
  height: 100%;
  width: 100%;
  min-width: 0;
  background-color: var(--bg-body);
  overflow: hidden;
}

.sidebar {
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border);
  padding: 11px 20px 24px 20px;
  display: flex;
  flex-direction: column;
  height: 100%;
  z-index: 20;
  animation: slide-right 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.logo-container {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 16px;
  margin-bottom: 11px;
}

.logo-box {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.logo-box img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.logo-text h1 {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--primary);
  line-height: 1.2;
}

.logo-text p {
  font-size: 0.875rem;
  color: var(--text-muted);
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px 20px;
  text-decoration: none;
  color: #475569;
  font-weight: 500;
  font-size: 1.05rem;
  border-radius: 8px;
  transition: all 0.2s;
  margin-bottom: 6px;
}

.nav-link.active {
  background-color: var(--primary-light);
  color: var(--primary);
  font-weight: 700;
  position: relative;
}

.nav-link.active::after {
  content: '';
  position: absolute;
  left: -20px;
  top: 15%;
  height: 70%;
  width: 4px;
  background: var(--primary);
  border-radius: 0 4px 4px 0;
}

.nav-link.active .nav-icon {
  color: var(--primary);
  opacity: 1;
}

.nav-link:hover:not(.active) {
  background-color: #f1f5f9;
  color: var(--primary);
  transform: translateX(4px);
}

.nav-icon {
  font-size: 24px;
  opacity: 0.8;
}

.user-badge-container {
  margin-top: auto;
  padding-top: 24px;
}

.sidebar-separator {
  height: 1px;
  background-color: #e2e8f0;
  width: 100%;
  margin-bottom: 0;
}

.user-badge {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: left;
  gap: 12px;
  padding: 16px;
  border-radius: 16px;
  transition: all 0.2s ease;
  background: rgba(241, 245, 249, 0.4);
  position: relative;
  width: 100%;
}

.user-info {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  width: 100%;
}

.user-name {
  font-size: 0.95rem;
  font-weight: 700;
  color: #000000;
  line-height: 1.2;
}

.user-role {
  font-size: 0.65rem;
  font-weight: 700;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin-top: 2px;
  line-height: 1;
}

.user-location {
  font-size: 0.65rem;
  font-weight: 500;
  color: var(--primary);
  margin-top: 2px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.user-badge-chevron {
  position: absolute;
  top: 16px;
  right: 16px;
  opacity: 0.3;
  color: #64748b;
  cursor: pointer;
}

.logout-btn {
  margin-top: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  background: transparent;
  border: none;
  color: #64748b;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 4px 0;
  cursor: pointer;
  transition: color 0.2s;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.logout-btn:hover {
  color: var(--accent-red);
}

.header {
  background-color: var(--bg-header);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px; /* Reducido para alinearse con el contenido */
  height: 70px;
  flex-shrink: 0;
  z-index: 10;
  animation: slide-down 0.8s cubic-bezier(0.16, 1, 0.3, 1) 0.2s backwards;
}

.scroll-area {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 32px;
  width: 100%;
}

/* Scrollbar estilizada y siempre visible */
.scroll-area::-webkit-scrollbar {
  width: 12px;
}
.scroll-area::-webkit-scrollbar-track {
  background: #f8fafc;
  border-left: 1px solid var(--border);
}
.scroll-area::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 10px;
  border: 3px solid #f8fafc;
}
.scroll-area::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

/* Page Title & Filters */
.page-header {
  display: flex; 
  justify-content: space-between; 
  align-items: center; 
  padding: 24px 32px;
  background: #ffffff;
  border: 1px solid #f1f5f9;
  border-bottom: none;
  border-radius: 20px 20px 0 0;
  margin-bottom: 0;
  width: 100%;
  animation: fade-in 1s ease 0.4s backwards;
}

/* Transparencia específica para el Dashboard de Inicio (No Gestión) */
.scroll-area > .page-header:not(.page-management .page-header) {
  background: transparent;
  border: none;
  padding: 12px 0 32px 0;
}

/* Stats Grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin-bottom: 32px;
  width: 100%;
}

.stat-card {
  background: var(--bg-card);
  padding: 20px 24px;
  border-radius: 24px;
  border: 1px solid rgba(241, 245, 249, 0.8);
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
  position: relative;
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  cursor: pointer;
  overflow: hidden;
  animation: slide-up 0.8s cubic-bezier(0.16, 1, 0.3, 1) backwards;
}

.stat-card:nth-child(1) { animation-delay: 0.5s; }
.stat-card:nth-child(2) { animation-delay: 0.6s; }
.stat-card:nth-child(3) { animation-delay: 0.7s; }
.stat-card:nth-child(4) { animation-delay: 0.8s; }

.stat-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-hover);
}


.stat-header {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}

.stat-title-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 99px;
  border: none;
}

.pill-blue { background: #eff6ff; color: #1e40af; }
.pill-green { background: #f0fdf4; color: #166534; }
.pill-red { background: #fef2f2; color: #991b1b; }
.pill-gray { background: #f1f5f9; color: #475569; }

.stat-title-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
}

.dot-green { background: #22c55e; }
.dot-blue { background: #3b82f6; }
.dot-red { background: #ef4444; }
.dot-black { background: #000000; }

.stat-label {
  color: inherit; 
  font-size: 0.85rem; 
  font-weight: 700; 
  margin-bottom: 0;
  white-space: nowrap;
}

.stat-trend-indicator {
  font-size: 0.85rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 4px;
}

.trend-positive { color: #10b981; }
.trend-negative { color: #ef4444; }
.trend-neutral { color: #94a3b8; }

.stat-card:hover .stat-icon-box {
  transform: scale(1.1) rotate(-5deg);
}

.icon-box-green {
  background: #ecfdf5;
  color: #10b981;
}

.icon-box-red {
  background: #fef2f2;
  color: #ef4444;
}

.stat-icon-group {
  display: flex;
  align-items: center;
  gap: 12px;
}

.stat-label {
  color: var(--text-light); 
  font-size: 0.9rem; 
  font-weight: 700; 
  margin-bottom: 0;
}

.stat-value {
  font-size: 2.2rem;
  font-weight: 800; 
  color: #000000;
  margin-top: 0;
  white-space: nowrap;
  letter-spacing: -1.5px;
  line-height: 1;
}

.stat-value.val-blue { color: #3b82f6; }
.stat-value.val-green { color: #22c55e; }
.stat-value.val-red { color: #ef4444; }
.stat-value.val-gray { color: #475569; }

.stat-main-content {
  width: 100%;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-top: 12px;
}

.stat-chart-container {
  flex: 1;
  height: 45px;
  margin-top: 0;
  display: flex;
  align-items: flex-end;
  min-width: 80px;
}

.sparkline-svg {
  width: 100%;
  height: 100%;
  overflow: visible;
}

.sparkline-path {
  fill: none;
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
  filter: drop-shadow(0 2px 3px rgba(0,0,0,0.05));
}

.sparkline-area {
  stroke: none;
  opacity: 0.6;
}

.stat-trend {
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0; /* Eliminado padding excedente al quitar el fondo */
  border-radius: 6px;
}

.trend-up { color: var(--accent-green); }
.trend-down { color: var(--accent-red); }
.trend-blue { color: var(--primary); }

.content-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  border: 1.5px solid #cbd5e1;
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  margin-top: 32px;
  animation: scale-in 0.8s cubic-bezier(0.16, 1, 0.3, 1) 0.9s backwards;
}

.table-card-header + .content-card {
  margin-top: 0;
}

.table-inner-container {
  border: 1.5px solid #cbd5e1;
  border-radius: 12px;
  overflow: hidden;
  background: #ffffff;
  margin: 0 24px 24px 24px;
  box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.08);
}

.page-management .table-inner-container {
  margin: 0 32px 32px 32px;
  background: #ffffff;
  display: flex;
  flex-direction: column;
}

.page-management .content-card {
  background: #f8fafc; /* Subtle gray bg for the card to make the white container POP */
  border: none; /* No border on the main parent, only on the inner board */
}

.table-body-scroll {
  overflow-y: auto;
  max-height: 60vh; /* Dynamic max height based on viewport */
  min-height: 200px;
}

.data-table thead {
  position: sticky;
  top: 0;
  z-index: 10;
  background: #f8fafc; /* Match header row bg */
}
.table-footer {
  padding: 20px 32px;
  border-top: 2px solid #f8fafc;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: white;
}

.pagination {
  display: flex;
  gap: 8px;
  align-items: center;
}

.page-btn {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  font-weight: 700;
  font-size: 0.85rem;
  cursor: pointer;
  color: var(--text-muted);
  transition: all 0.2s;
}

.page-btn.active {
  background: var(--primary);
  color: white;
}

.page-btn:hover:not(.active) {
  background: #f1f5f9;
}

.table-header {
  padding: 24px;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

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

.data-table th {
  position: sticky;
  top: 0;
  z-index: 50;
  background: #f1f5f9;
  padding: 16px;
  text-align: left !important;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-top: 1.5px solid #cbd5e1;
  border-bottom: 1px solid #e2e8f0;
}

.cell-status {
  text-align: center !important;
  padding-left: 0 !important;
  padding-right: 0 !important;
}

.cell-status .sort-icon {
  display: inline-flex;
  margin-left: 4px;
  vertical-align: middle;
}

.data-table td {
  padding: 16px 24px;
  border-bottom: 1px solid var(--border);
  font-size: 0.875rem;
  vertical-align: middle;
}

.text-medium-muted {
  font-size: 0.75rem;
  color: #64748b;
  font-weight: 500;
  margin-bottom: 2px;
}

.text-bold-dark {
  font-size: 0.95rem;
  font-weight: 800;
  color: #0f172a;
  line-height: 1.2;
}

.google-maps-link {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 0;
    background: none;
    text-decoration: none;
    margin-bottom: 4px;
    width: fit-content;
}

.google-maps-link:hover span {
    text-decoration: underline;
}

.maps-icon-box {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
}

.hospital-container {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.action-dots {
  background: none;
  border: none;
  font-size: 1.25rem;
  color: #64748b;
  cursor: pointer;
  padding: 4px;
  border-radius: 6px;
  transition: all 0.2s;
  line-height: 1;
}

.action-dots:hover {
  background: #f1f5f9;
  color: #000;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 16px 6px 10px;
    border-radius: 99px;
    font-size: 1.1rem;
    font-weight: 800;
    text-transform: capitalize;
}

.table-cell {
    text-align: left;
}

.status-dot {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background-color: currentColor;
}

.status-atendida { background: #dcfce7; color: #15803d; }
.status-cancelada { background: #fee2e2; color: #b91c1c; }
.status-programada { background: #e0f2fe; color: #0369a1; }
.status-reprogramada { background: #fef3c7; color: #92400e; }
.status-pendiente { background: #f1f5f9; color: #475569; }

.table-loading-state {
  text-align: center;
  padding: 40px !important;
}


.user-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--primary-light);
  color: var(--primary);
  display: flex;
  flex-shrink: 0;
  border: 3px solid var(--primary);
  box-shadow: 0 4px 6px -1px rgba(0,0,0,0.1);
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.75rem;
  overflow: hidden; /* Asegura que la imagen sea circular */
}

.user-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Status Tags */
.status-tag {
  display: inline-flex;
  align-items: center;
  padding: 4px 12px;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 600;
}

.status-programmed { background: #e0f2fe; color: #0369a1; }
.status-attended { background: #dcfce7; color: #15803d; }
.status-canceled { background: #fee2e2; color: #b91c1c; }

.btn-primary {
  background: var(--primary);
  color: white;
  padding: 12px 24px;
  border: none;
  border-radius: var(--radius-md);
  font-weight: 600;
  cursor: pointer;
  transition: filter 0.2s;
}

.btn-primary:hover {
  filter: brightness(1.1);
}

.btn-with-icon {
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-table-action {
  padding: 8px 16px;
  font-size: 0.85rem;
}

.v-divider {
  height: 30px;
  width: 1px;
  background-color: var(--border-strong);
  margin: 0 8px;
}

/* Responsive */
@media (max-width: 1024px) {
  .app-shell { grid-template-columns: 80px 1fr; }
  .sidebar span { display: none; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 640px) {
  .app-shell {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr;
  }
  .sidebar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 70px;
    flex-direction: row;
    padding: 0 12px;
    border-right: none;
    border-top: 1px solid var(--border);
    justify-content: space-around;
  }
  .stats-grid { grid-template-columns: 1fr; }
  .main-content { padding: 20px; padding-bottom: 90px; }
}

/* Header Components */
.search-container {
  flex: 1; 
  display: flex; 
  align-items: center; 
  max-width: none; 
  margin-right: 20px; /* Reducido para mayor extensión */
}

.search-inner {
  display: flex; 
  align-items: center; 
  background: #f8fafc; /* Clearer, lighter background */
  padding: 10px 18px; 
  border-radius: 99px; /* More rounded premium look */
  gap: 12px; /* Generous gap to avoid crowded/encimado text */
  width: 100%;
  border: 1.5px solid #e2e8f0;
  transition: all 0.3s ease;
}

.search-inner:focus-within {
  background: white;
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(0, 102, 179, 0.1);
  transform: translateY(-1px);
}

.search-input {
  background: transparent; 
  border: none; 
  width: 100%; 
  outline: none; 
  font-size: 1rem; 
  color: #0f172a; 
  font-family: 'Manrope', sans-serif;
}

.header-tools {
  display: flex; 
  align-items: center; 
  gap: 20px; /* Compactado para ahorrar espacio */
}

.header-icons {
  display: flex; 
  align-items: center; 
  gap: 24px;
}

.icon-button {
  position: relative; 
  cursor: pointer; 
  color: #64748b;
  display: flex;
  align-items: center;
}

.notification-dot {
  position: absolute; 
  top: 0; 
  right: 0; 
  width: 8px; 
  height: 8px; 
  background-color: var(--accent-red); 
  border-radius: 50%; 
  border: 2px solid white;
  animation: pulse-red 2s infinite;
}

.header-divider {
  width: 1px; 
  height: 40px; 
  background-color: #e2e8f0;
}

.date-time {
  text-align: right;
}

.date-text {
  font-weight: 800; 
  font-size: 1.1rem; 
  color: var(--primary);
}

.time-text {
  font-size: 0.85rem; 
  color: var(--text-light); 
  font-weight: 600;
}

.page-header-actions {
  display: flex; 
  align-items: center;
  gap: 24px;
}

.header-filters {
  display: flex;
  gap: 12px;
}

.main-title {
  font-size: 2.5rem; 
  font-weight: 800; 
  background: linear-gradient(135deg, #000000 0%, var(--primary) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  color: transparent;
  margin-bottom: 8px; 
  letter-spacing: -1.5px;
  display: inline-block;
}

.sort-header {
    cursor: pointer;
    -webkit-user-select: none;
    user-select: none;
    transition: background 0.2s;
    position: relative;
    white-space: nowrap;
}

.sort-header:hover {
    background: #f1f5f9 !important;
}

.sort-header.active {
    color: var(--primary) !important;
}

.sort-icon {
    position: relative;
    display: inline-block;
    vertical-align: middle;
    margin-left: 6px;
    height: 12px; 
    width: 12px; 
    line-height: 1;
}

.sort-icon svg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    transition: all 0.2s ease;
    color: #cbd5e1;
}

.sort-header.active .sort-icon {
    opacity: 1;
}

.sort-header:not(.active) .sort-icon {
    opacity: 0.3;
}

/* Precise Active States with high visibility */
.sort-header.asc .asc-arrow {
    color: var(--primary) !important;
    opacity: 1 !important;
}

.sort-header.desc .desc-arrow {
    color: var(--primary) !important;
    opacity: 1 !important;
}

.sort-header.asc .desc-arrow,
.sort-header.desc .asc-arrow {
    opacity: 0.3 !important;
    color: #cbd5e1 !important;
}

.sort-header.asc .asc-arrow,
.sort-header.desc .desc-arrow {
    opacity: 1;
    color: var(--primary);
    transform: scale(1.2);
}

/* Efecto de Marcado para Nuevos Registros (More visible) */
@keyframes row-flash-premium {
    0% { background: transparent; }
    5% { background: var(--primary-light); box-shadow: inset 6px 0 0 var(--primary); }
    40% { background: var(--primary-light); }
    100% { background: transparent; }
}

.main-subtitle {
  color: var(--text-muted); 
  font-size: 1.1rem; 
  font-weight: 500;
}

.filter-pill {
  background: white; 
  padding: 12px 20px; 
  border-radius: 99px; 
  border: 1px solid #e2e8f0; 
  display: flex; 
  align-items: center; 
  gap: 12px; 
  cursor: pointer; 
  box-shadow: var(--shadow-sm);
}

.filter-label {
  font-size: 0.7rem; 
  font-weight: 800; 
  color: var(--text-light); 
  text-transform: uppercase; 
  letter-spacing: 1px;
}

.filter-value {
  font-weight: 700; 
  font-size: 1rem; 
  color: #000000;
}

.chevron {
  color: var(--text-light); 
  margin-left: 4px;
}

/* Table Enhancements */
.table-card-header {
  padding: 24px 32px;
  border-bottom: 2px solid #f8fafc;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.table-title-group {
  display: flex;
  align-items: center;
  gap: 12px;
}

.title-radar-icon {
  color: var(--primary);
  opacity: 0.9;
  animation: radar-spin 4s linear infinite;
}

@keyframes radar-spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.table-card-title {
  font-size: 1.5rem; 
  font-weight: 800; 
  color: var(--primary); /* Restaurado el azul para títulos */
  margin-bottom: 0;
}

.table-actions-group {
  display: flex; 
  gap: 24px; 
  color: var(--text-light);
}

.action-icon {
  cursor: pointer;
  transition: color 0.2s ease;
}

.action-icon:hover {
  color: var(--primary);
}

.id-badge {
  font-weight: 400; 
  color: var(--text-light); 
  font-size: 0.85rem; 
  margin-bottom: 4px;
}

.location-container {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.location-link {
  display: flex; 
  align-items: center; 
  gap: 6px;
  font-weight: 500; 
  color: var(--primary); 
  font-size: 0.8rem;
  text-decoration: none;
  transition: all 0.2s ease;
  width: fit-content;
}

.location-link:hover {
  text-decoration: underline;
  opacity: 0.8;
}

.location-info-svg {
  color: var(--primary);
  opacity: 0.8;
}

/* Table Utility Classes */
.table-cell {
  padding: 16px 20px !important;
  border-bottom: 1px solid #f1f5f9 !important; /* Lighter, clearer border color */
}

.table-row {
  transition: all 0.2s ease;
  cursor: pointer;
  background-color: white;
}

.table-row:hover {
  background-color: #f1f5f9; /* Resaltado gris claro más notable al pasar el mouse */
}

.text-bold-dark {
  font-weight: 800; 
  color: #000000; /* Nombres de procedimientos en negro */
  font-size: 0.9rem;
}

.text-bold-muted {
  font-weight: 500; 
  color: var(--text-light); 
  font-size: 0.8rem;
}

.text-medium-muted {
  font-weight: 400; 
  color: var(--text-light); 
  font-size: 0.8rem;
}

.status-badge {
  padding: 6px 14px; 
  border-radius: 99px; 
  font-weight: 700;
  font-size: 0.75rem;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.status-badge::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
}

.status-badge-blue {
  background: #eff6ff; 
  color: #1e40af;
}

.status-badge-blue::before {
  background-color: #3b82f6;
}

.status-badge-green {
  background: #f0fdf4; 
  color: #166534;
}

.status-badge-green::before {
  background-color: #22c55e;
}

.status-badge-red {
  background: #fef2f2; 
  color: #991b1b;
}

.status-badge-red::before {
  background-color: #ef4444;
}

.action-dots {
  border: none; 
  background: transparent; 
  cursor: pointer; 
  color: var(--text-light); 
  font-size: 1.5rem; 
  font-weight: 800;
}

/* Sidebar Components */
.user-badge-container {
  margin-top: auto; 
  padding-top: 20px; 
  border-top: 1px solid var(--border);
}

.user-name {
  font-size: 0.875rem; 
  font-weight: 700;
  color: #000000;
}


.table-header-cell {
  background: #f8fafc;
  padding: 16px 16px !important;
  text-align: left !important;
  font-size: 0.68rem;
  font-weight: 800;
  color: #333333; /* Texto oscuro para encabezados */
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.col-actions {
  width: 60px;
  min-width: 60px;
  display: table-cell; /* Asegura comportamiento de celda */
  vertical-align: middle;
  text-align: center !important;
  padding: 16px 8px !important;
}

th.col-actions {
  display: table-cell; /* Revertir a table-cell para mantener estructura de tabla */
}

/* Contenedor interno para asegurar centrado perfecto de iconos */
.col-actions-inner {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  height: 100%;
}

/* Pagination Styles */
.pagination-footer {
  padding: 20px 32px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid #f1f5f9;
  background: #ffffff;
  border-bottom-left-radius: 20px;
  border-bottom-right-radius: 20px;
}

.dashboard-view .pagination-footer {
  display: none !important;
}

.pagination-info {
  font-size: 0.85rem;
  font-weight: 700;
  color: #333333;
}

.pagination-controls {
  display: flex;
  gap: 8px;
  align-items: center;
}

.pagination-btn {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
  background: white;
  cursor: pointer;
  font-weight: 700;
  font-size: 0.85rem;
  color: #000000;
  transition: all 0.2s;
}

.pagination-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.pagination-btn.active {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

.pagination-btn.disabled {
  opacity: 0.5;
  cursor: not-allowed;
  background: #f8fafc;
}
/* Modal Styles */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.4);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  display: none; /* Controlled by JS */
  justify-content: center;
  align-items: center;
  z-index: 1000;
  padding: 20px;
}

.modal-overlay.active {
  display: flex;
  animation: fade-in 0.3s ease;
}

.modal-container {
  background: white;
  width: 100%;
  max-width: 1000px;
  max-height: 90vh;
  border-radius: 24px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  display: flex;
  flex-direction: column;
  overflow: visible;
  animation: scale-in 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-header {
  padding: 16px 32px;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-title-group {
  display: flex;
  align-items: center;
  gap: 16px;
}

.modal-icon-box {
  width: 48px;
  height: 48px;
  background: var(--primary-light);
  color: var(--primary);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-title {
  font-size: 32px;
  font-weight: 800;
  color: #0f172a;
  line-height: 1.1;
  margin-bottom: 8px;
}

.modal-subtitle {
  font-size: 16px;
  color: #475569;
  max-width: 600px;
}

.badge-engine {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--primary);
  margin-bottom: 8px;
}

.badge-engine span {
  font-size: 16px;
}

.modal-close {
  background: none;
  border: none;
  font-size: 32px;
  color: #64748b;
  cursor: pointer;
  padding: 8px;
  line-height: 1;
  transition: color 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-close:hover {
  color: #0f172a;
}

.modal-content {
  padding: 0;
  overflow-y: auto;
  flex: 1 1 auto;
  min-height: 0;
}

.form-section-title {
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--primary);
  margin-top: 5px;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.form-section-title::after {
  content: '';
  flex: 1;
  height: 1px;
  background: #f1f5f9;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin-bottom: 12px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 0;
}

.form-group.span-2 {
  grid-column: span 2;
}

.form-group label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 9px;
  font-weight: 800;
  color: #0f172a;
  margin-bottom: 4px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  line-height: 1.2;
}

.form-group label i {
  font-size: 14px;
  color: #000000;
  font-style: normal;
  vertical-align: middle;
  line-height: 1;
}

.required-dot {
  color: #ef4444;
  margin-left: 2px;
  font-size: 12px;
  font-weight: 800;
}

.map-action-btn {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 36px;
  height: 36px;
  background: white;
  color: #0f172a;
  padding: 0;
  border-radius: 8px;
  display: flex !important;
  justify-content: center;
  align-items: center;
  align-items: center;
  gap: 6px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  border: 1px solid #e2e8f0;
  transition: all 0.2s;
  z-index: 10;
}

.badge-new {
    background: #0ea5e9;
    color: white;
    font-size: 8px;
    font-weight: 900;
    padding: 2px 5px;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-left: 6px;
    display: inline-flex;
    align-items: center;
    line-height: 1;
    vertical-align: middle;
}

.map-action-btn:hover {
  background: #f8fafc;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.map-action-btn i {
  font-size: 16px !important;
  color: #000000 !important;
}

.hospital-map-label {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: none;
  color: #0f172a;
  padding: 8px 12px;
  font-size: 10px;
  font-weight: 800;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 8px;
  text-shadow: 0 0 4px #ffffff, 0 0 8px #ffffff;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 5px 8px;
  background-color: #ffffff !important;
  color: #0f172a !important;
  border: 1px solid #e2e8f0;
  border-radius: 4px;
  font-size: 12px;
  transition: all 0.2s;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent !important;
  color-scheme: only light !important;
  forced-color-adjust: none !important;
}

.form-group select option {
  background-color: #ffffff !important;
  color: #000000 !important;
  color-scheme: only light !important;
}

.form-group select:focus option {
  background-color: #ffffff !important;
  color: #000000 !important;
}

.form-group select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  color-scheme: light;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' width='24' height='24' stroke='%2394a3b8' stroke-width='2' fill='none' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 16px;
  padding-right: 40px;
  background-color: #ffffff !important;
}

select:-webkit-autofill,
select:-webkit-autofill:hover,
select:-webkit-autofill:focus,
select:-webkit-autofill:active {
  -webkit-box-shadow: 0 0 0 30px white inset !important;
}

.form-group select {
  background-color: #ffffff !important;
}

.form-group select:focus,
.form-group select:active {
  background-color: #ffffff !important;
  box-shadow: none !important;
  -webkit-box-shadow: none !important;
  border-color: var(--primary);
}

.form-group select::-webkit-calendar-picker-indicator {
  filter: invert(1);
  background-color: transparent !important;
}

.form-group input:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--primary);
}

.form-group select:active {
  background-color: #ffffff !important;
  box-shadow: none !important;
}

/* Kits Selection Styles */
.components-container {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.kit-card {
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 16px;
  transition: all 0.2s;
  cursor: pointer;
}

.kit-card:hover {
  border-color: var(--primary);
  background: #fafafa;
}

.kit-card.selected {
  border-color: var(--primary);
  background: var(--primary-light);
  box-shadow: 0 4px 12px rgba(0, 99, 153, 0.1);
  transform: translateY(-2px);
}

.kit-card-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  font-weight: 700;
}

.kit-components {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-left: 26px;
}

.component-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.85rem;
  color: #64748b;
}

.component-badge {
  font-size: 0.65rem;
  padding: 2px 6px;
  border-radius: 4px;
  background: #fee2e2;
  color: #b91c1c;
  font-weight: 700;
}

.modal-footer {
  padding: 16px 32px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  gap: 16px;
  background: #f8fafc;
}

.btn-submit,
.btn-cancel {
  padding: 5px 12px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  border: none;
  text-transform: uppercase;
}

.btn-submit {
  background: var(--primary);
  color: white;
  box-shadow: 0 1px 2px rgba(0, 99, 153, 0.2);
  display: flex;
  align-items: center;
  gap: 6px;
}

.btn-cancel {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  color: #64748b;
}

.btn-cancel:hover {
  background: #f1f5f9;
}

.btn-submit:hover {
  background: rgba(0, 99, 153, 0.9);
  transform: translateY(-1px);
}

.modal-small {
  max-width: 500px !important;
}

.reason-section {
  display: none;
  margin-top: 20px;
  animation: slide-down 0.3s ease;
}

.reason-section.active {
  display: block;
}

.form-group textarea {
  width: 100%;
  padding: 12px;
  border-radius: 10px;
  border: 1px solid #e2e8f0;
  font-family: inherit;
  font-size: 0.95rem;
  resize: vertical;
}

.form-group textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(0, 99, 153, 0.1);
}

.mt-3 {
  margin-top: 12px;
}

/* Kit Selection Limit Styles */
.kit-card.limit-reached {
    opacity: 0.5;
    filter: grayscale(0.5);
    cursor: not-allowed !important;
    border-color: var(--border-color);
}

.kit-card.limit-reached input[type="checkbox"] {
    cursor: not-allowed;
}

.kits-header {
 background: var(--surface-bg-alt, #f8fafc);
 padding: 12px 16px;
 border-radius: 8px;
 border: 1px solid var(--border-color, #e2e8f0);
 margin-bottom: 20px;
}

#kitSelectionCount {
 font-weight: 600;
 color: var(--primary-color);
}


/* Capacity Badge Styles */
.capacity-badge {
    background: #f1f5f9;
    color: #475569;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    margin-left: auto;
}

.capacity-badge.out-of-stock {
    background: #fee2e2;
    color: #dc2626;
}

.disabled-card {
    opacity: 0.6;
    pointer-events: none;
    background: #f1f5f9;
}


/* Modal Tabs Styles */
.modal-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 0;
    border-bottom: 2px solid var(--primary-color);
    padding: 0 20px;
    background: #1e293b; /* Dark background like the image */
    padding-top: 10px;
}

.tab-btn {
    padding: 10px 24px;
    border: none;
    background: #cbd5e1; /* Gray background for inactive */
    color: #334155;
    font-weight: 500;
    border-radius: 8px 8px 0 0;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.tab-btn.active {
    background: #0ea5e9; /* Bright blue for active */
    color: white;
}

.tab-btn:hover:not(.active) {
    background: #94a3b8;
}

.tab-pane {
    display: none;
    padding: 0;
}

.tab-pane.active {
    display: flex;
    flex-direction: column;
    height: 100%;
}

/* File Upload Zone */
.file-upload-zone {
    border: 2px dashed var(--border-color);
    border-radius: 12px;
    padding: 40px 20px;
    text-align: center;
    background: var(--surface-bg-alt);
    cursor: pointer;
    transition: border-color 0.2s;
}

.file-upload-zone:hover {
    border-color: var(--primary-color);
}

/* material symbols fix */
.material-symbols-outlined {
  font-family: 'Material Symbols Outlined';
  font-weight: normal;
  font-style: normal;
  font-size: 24px;
  line-height: 1;
  letter-spacing: normal;
  text-transform: none;
  display: inline-block;
  white-space: nowrap;
  word-wrap: normal;
  direction: ltr;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: 'liga';
}



.step-item {
    display: flex;
    flex-direction: column;
    gap: 8px;
    transition: transform 0.3s ease;
}

.step-label {
    display: block;
    font-size: 11px;
    font-weight: 800;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

.step-item.active .step-label,
.step-item.completed .step-label {
    color: var(--primary);
}

.step-line {
    height: 4px;
    width: 100%;
    background: #e2e8f0;
    border-radius: 9999px;
    transition: background 0.3s;
}

.step-item.active .step-line,
.step-item.completed .step-line {
    background: var(--primary);
}

/* Modal Content Grid */
.booking-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 340px;
    gap: 32px;
    padding: 32px;
    background: #f1f5f9;
    align-items: stretch;
    height: 100%;
}

.booking-main {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 24px;
    display: flex;
    flex-direction: column;
}

.booking-sidebar {
    display: flex;
    flex-direction: column;
    gap: 16px;
    height: 100%;
}

/* Summary Cards */
.summary-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 24px;
    flex: 1;
}

/* Sidebar Summary Refined */
.summary-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 12px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

.summary-header {
    font-size: 16px;
    font-weight: 800;
    color: var(--primary);
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.summary-item {
    display: flex;
    gap: 10px;
    margin-bottom: 12px;
    align-items: flex-start;
}

.summary-icon-box {
    width: 20px;
    background: transparent !important;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    color: #000000 !important;
    flex-shrink: 0;
    margin-top: -3px;
}

.summary-icon-box i {
    font-size: 18px !important;
    color: #000000 !important;
}

.summary-content {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.summary-label {
    font-size: 10px;
    font-weight: 800;
    color: #000000;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 2px;
}

.summary-value {
    font-size: 14px;
    font-weight: 400;
    color: #000000;
    line-height: 1.2;
    max-width: 100%;
    overflow: hidden;
}

.summary-progress-area {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #f1f5f9;
}

.progress-details {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    color: #64748b;
}

#progress-percent {
    color: var(--primary);
}

.progress-bar-container {
    height: 8px;
    background: #e2e8f0;
    border-radius: 10px;
    overflow: hidden;
}

/* --- Smart Booking Consolidated Styles --- */

#modalNewSchedule .modal-container {
    max-width: 1000px;
    height: 93vh;
    max-height: 90vh; /* Increased from 626px to provide more space */
    display: flex;
    flex-direction: column;
    background: #f8fafc;
    border-radius: 12px;
    overflow: hidden;
}

#modalNewSchedule .modal-header-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px 8px 20px;
    background: #fff;
    min-height: 64px;
}

.modal-header-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
}

.modal-header-branding {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    margin-right: auto;
}

.modal-badge-mini {
    display: flex;
    align-items: center;
    gap: 3px;
    font-size: 9px;
    font-weight: 900;
    color: #0f172a;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    margin-bottom: 5px;
}

.modal-badge-mini svg {
    width: 12px !important;
    height: 12px !important;
    min-width: 12px !important;
    min-height: 12px !important;
    display: block;
    flex-shrink: 0;
}

.modal-title-main {
    font-size: 31px;
    font-weight: 800;
    color: var(--primary);
    margin: 0;
    line-height: 1.1;
}

#modalNewSchedule .modal-content {
    flex: 1;
    overflow-y: hidden;
    background: #f1f5f9;
    display: flex;
    flex-direction: column;
    min-height: 0;
    height: 100%;
}

#modalNewSchedule .booking-grid {
    min-height: 100%;
    display: flex;
    flex-direction: row;
    height: 100%;
}

#modalNewSchedule .booking-main {
    flex: 1;
    height: auto;
    padding-top: 10px;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

#modalNewSchedule .booking-sidebar {
    width: 280px;
    flex-shrink: 0;
    height: auto;
}

#modalNewSchedule .form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    flex: 1;
    min-height: 0;
}

#modalNewSchedule .booking-main {
    flex: 1;
    height: auto;
    padding: 10px;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

#modalNewSchedule .booking-sidebar {
    width: 280px;
    flex-shrink: 0;
    height: auto;
    display: flex;
    flex-direction: column;
}

#modalNewSchedule .summary-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 12px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
    flex: 1;
    margin: 0;
}

#modalNewSchedule #formNewSchedule {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

#modalNewSchedule .tab-pane {
    flex: 1;
    display: none;
    flex-direction: column;
    min-height: 0;
}

#modalNewSchedule .tab-pane.active {
    display: flex;
    flex-direction: column;
    min-height: 0;
    height: 100%;
}

.booking-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 280px;
    gap: 10px;
    padding: 10px;
    align-items: stretch;
    flex: 1;
    min-height: 0;
}



.booking-main {
    background: #ffffff !important;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow-y: auto;
    height: 100%;
}
.logistics-container {
    padding: 0;
    height: 100%;
    display: grid;
    grid-template-columns: 1fr 1.1fr;
    gap: 12px;
}

.booking-main::-webkit-scrollbar {
    width: 6px;
}
.booking-main::-webkit-scrollbar-thumb {
    background-color: rgba(0,0,0,0.1);
    border-radius: 3px;
}
.booking-main::-webkit-scrollbar-thumb:hover {
    background-color: rgba(0,0,0,0.2);
}

#modalNewSchedule .form-group {
    gap: 4px;
    margin-bottom: 6px;
}

#modalNewSchedule .form-group label {
    margin-bottom: 2px;
}

#formNewSchedule {
    display: flex;
    flex-direction: column;
    flex: 1;
}

.tab-pane.active {
    display: flex;
    flex-direction: column;
    flex: 1;
}

/* Stepper */
.modal-stepper {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 12px;
    padding: 0 20px 14px 20px;
    background: #ffffff;
    border-bottom: 1px solid #e2e8f0;
}

.step-item {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    padding: 0;
}

.step-line {
    height: 3px;
    width: 100%;
    background: #e2e8f0;
    transition: all 0.3s ease;
}

.step-label {
    font-size: 11px;
    font-weight: 800;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.step-item.active .step-line,
.step-item.completed .step-line {
    background: var(--primary);
}

.step-item.active .step-label,
.step-item.completed .step-label {
    color: var(--primary);
}

/* Sidebar Cards */
.summary-card {
    padding: 12px;
    margin-bottom: 12px;
    border-radius: 8px;
}

.summary-header {
    font-size: 13px;
    margin-bottom: 12px;
}

.summary-item {
    gap: 8px;
    margin-bottom: 0;
    padding: 8px 0;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
}

.summary-item:last-child {
    border-bottom: none;
}

.summary-icon-box {
    width: 24px;
    height: 24px;
    border-radius: 4px;
    background: #e0f2fe;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    flex-shrink: 0;
}

.summary-icon-box svg {
    width: 14px;
    height: 14px;
}

.summary-label {
    font-size: 9px;
}

.summary-value {
    font-size: 12px;
}

.summary-progress-section {
    margin-top: auto;
    padding-top: 8px;
    border-top: 1px solid #e2e8f0;
    padding-bottom: 8px;
}

.progress-details {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
    font-size: 9px;
    font-weight: 800;
    text-transform: uppercase;
    color: #64748b;
}

.progress-bar-container {
    height: 4px;
    background: #f1f5f9;
    border-radius: 10px;
    margin-bottom: 6px;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    background: var(--primary);
    border-radius: 10px;
    transition: width 0.3s ease;
}

#modalNewSchedule .progress-hint {
    font-size: 11px !important;
    color: #94a3b8;
    margin: 0;
    line-height: 1.4;
}

#modalNewSchedule .insurance-text {
    font-size: 11px !important;
    color: #64748b;
    margin: 6px 0 0 0;
    line-height: 1.4;
}

/* Footer Buttons */
.modal-footer {
    padding: 8px 20px;
    background: #ffffff;
    border-top: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.form-section-title {
    font-size: 11px;
    margin-bottom: 12px;
}

.form-section-title span {
    color: var(--primary);
}

/* Left Sidebar for Specialties - Appended */
.booking-left-sidebar {
    width: 230px;
    flex-shrink: 0;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 8px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
    min-height: 0;
    overflow-y: auto;
}

.booking-left-sidebar::-webkit-scrollbar {
    width: 4px;
}

.booking-left-sidebar::-webkit-scrollbar-track {
    background: transparent;
}

.booking-left-sidebar::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 10px;
}

.booking-left-sidebar::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

.booking-sidebar-title {
    font-size: 10px;
    font-weight: 800;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    margin-bottom: 8px;
    padding: 2px 6px;
}

.minimal-checkbox {
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: inset 0 1px 2px rgba(0,0,0,0.05);
}

.minimal-checkbox.active {
    box-shadow: 0 2px 4px rgba(0, 99, 153, 0.2);
}

.procedure-selection-row {
    border-bottom: 1px solid #f1f5f9;
}

.procedure-selection-row:last-child {
    border-bottom: none;
}

.procedure-selection-row:hover {
    background-color: #f8fafc !important;
}

.minimal-material-row:hover {
    background-color: #f8fafc;
}

.proc-side-select:focus {
    border-color: var(--primary) !important;
    box-shadow: 0 0 0 3px rgba(0, 99, 153, 0.1);
}

@keyframes spinning {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.spinning {
    animation: spinning 1s linear infinite;
    display: inline-block;
}

.specialties-list,
.regions-list,
.procedures-list {
    display: flex;
    flex-direction: column;
    gap: 1px;
    overflow-y: auto;
    overflow-x: hidden;
}

.specialty-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid transparent;
    position: relative;
    color: #475569;
    font-weight: 500;
}

.specialty-item:hover:not(.active) {
    background: #f1f5f9;
    color: var(--primary);
    transform: translateX(4px);
}

.specialty-item.active {
    background-color: var(--primary-light);
    color: var(--primary);
    font-weight: 700;
    position: relative;
}

.specialty-item.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 15%;
    height: 70%;
    width: 4px;
    background: var(--primary);
    border-radius: 0 4px 4px 0;
}

.specialty-icon {
    width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #64748b;
    flex-shrink: 0;
    transition: all 0.2s ease;
}

/* Reducción específica de espacio para el paso de procedimientos */
.procedures-list .specialty-item {
    padding: 8px 12px;
}

.specialty-icon i {
    font-size: 14px;
    font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 20;
}

.specialty-item.active .specialty-icon {
    color: var(--primary);
    opacity: 1;
}

.specialty-item.active .specialty-icon i {
    font-variation-settings: 'FILL' 1, 'wght' 400, 'GRAD' 0, 'opsz' 24;
}

.specialty-name {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: -0.2px;
}

.specialty-item.invalid {
    background-color: #fff1f2 !important;
    color: #e11d48 !important;
    border-color: #fca5a5 !important;
}

.specialty-item.invalid .specialty-icon {
    color: #e11d48 !important;
}

.specialty-item.invalid::before {
    background: #e11d48 !important;
}

/* Logistics: Calendar & Time Picker */
.calendar-wrapper {
    display: flex;
    flex-direction: column;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 10px;
    -webkit-user-select: none;
    user-select: none;
    height: auto;
    min-height: 220px;
    margin-bottom: 0;
    position: relative;
}

.calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.calendar-title {
    font-weight: 600;
    color: var(--dark);
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.cal-nav-btn {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--secondary);
    transition: all 0.2s;
}

.cal-nav-btn:hover {
    background: #f1f5f9;
    color: var(--primary);
}

.calendar-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    text-align: center;
    font-size: 10px;
    font-weight: 800;
    color: #000000;
    margin-bottom: 4px;
}

.calendar-days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    grid-template-rows: repeat(6, 1fr);
    gap: 2px;
    justify-items: center;
}

.calendar-day {
    width: 20px;
    aspect-ratio: 1 / 1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10.5px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s;
    font-weight: 500;
    color: #000000;
}

.calendar-day:hover:not(.disabled):not(.selected) {
    background: #f1f5f9;
}

.calendar-day.selected {
    background: var(--primary);
    color: #fff !important;
    font-weight: 600;
}

.calendar-day.disabled {
    opacity: 0.35;
    cursor: default;
    pointer-events: none;
    filter: grayscale(1);
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
}

.calendar-day.day-low {
    background: transparent !important;
    color: #22c55e !important;
    font-weight: 600;
    border: none !important;
}

.calendar-day.day-yellow {
    background: transparent !important;
    color: #eab308 !important;
    font-weight: 600;
    border: none !important;
}

.calendar-day.day-medium {
    background: transparent !important;
    color: #f97316 !important;
    font-weight: 600;
    border: none !important;
}

.calendar-day.day-full {
    background: transparent !important;
    color: #dc2626 !important;
    font-weight: 600;
    border: none !important;
}

.calendar-day.day-low:hover { background: rgba(34, 197, 94, 0.1) !important; }
.calendar-day.day-low.selected { 
    background: #22c55e !important; 
    color: #ffffff !important; 
    box-shadow: 0 4px 12px rgba(34, 197, 94, 0.2);
}

.calendar-day.day-yellow:hover { background: rgba(234, 179, 8, 0.1) !important; }
.calendar-day.day-yellow.selected { 
    background: #eab308 !important; 
    color: #ffffff !important; 
    box-shadow: 0 4px 12px rgba(234, 179, 8, 0.2);
}

.calendar-day.day-medium:hover { background: rgba(249, 115, 22, 0.1) !important; }
.calendar-day.day-medium.selected { 
    background: #f97316 !important; 
    color: #ffffff !important; 
    box-shadow: 0 4px 12px rgba(249, 115, 22, 0.2);
}

.calendar-day.day-full:hover { background: rgba(220, 38, 38, 0.1) !important; }
.calendar-day.day-full.selected { 
    background: #dc2626 !important; 
    color: #ffffff !important; 
    box-shadow: 0 4px 12px rgba(220, 38, 38, 0.2);
}

.time-duration-badge {
    background: #ecfdf5;
    border: 1px solid #10b981;
    color: #065f46;
    padding: 10px 14px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 600;
    margin-top: 10px;
}

.time-duration-badge i {
    font-size: 18px;
}

/* User Selector Dropdown */
.user-selector-dropdown {
    position: absolute;
    bottom: 100%;
    left: 0;
    width: 100%;
    background: white;
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: var(--shadow-hover);
    margin-bottom: 8px;
    display: none;
    max-height: 300px;
    overflow-y: auto;
    animation: slide-up 0.3s ease;
}

.user-selector-dropdown.active {
    display: block;
}

.dropdown-header {
    padding: 12px 16px;
    font-size: 0.7rem;
    font-weight: 800;
    color: var(--text-muted);
    background: #f8fafc;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.user-option {
    padding: 12px 16px;
    cursor: pointer;
    transition: background 0.2s;
    border-top: 1px solid #f1f5f9;
}

.user-option:hover {
    background: var(--primary-light);
}

.user-option-name {
    font-size: 0.85rem;
    font-weight: 700;
    color: #000;
}

.user-option-role {
    font-size: 0.7rem;
    color: #64748b;
}

/* Assign Button and Modal */
.assign-btn {
    margin-top: 8px;
    padding: 4px 12px;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--primary);
    background: var(--primary-light);
    border: 1px solid var(--primary);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
}

.assign-btn:hover {
    background: var(--primary);
    color: white;
}

.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    -webkit-backdrop-filter: blur(4px);
    backdrop-filter: blur(4px);
}

.modal.active {
    display: flex;
}

.modal-content.modal-small {
    width: 90%;
    max-width: 400px;
    background: white;
    border-radius: 20px;
    padding: 24px;
    box-shadow: var(--shadow-hover);
    animation: scale-in 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.modal-header h3 {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--primary);
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-size: 0.65rem;
    font-weight: 700;
    margin-bottom: 8px;
    color: #475569;
}

.conflict-popover {
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
    background: rgba(255, 255, 255, 0.9) !important;
    border: 1px solid rgba(255, 255, 255, 0.4) !important;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05) !important;
    border-radius: 10px !important;
    padding: 8px 12px !important;
    width: 200px !important;
    animation: bubbleIn 0.2s ease-out;
}

.conflict-popover::after {
    content: '';
    position: absolute;
    bottom: -6px;
    left: 50%;
    transform: translateX(-50%);
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-top: 6px solid rgba(255, 255, 255, 0.9);
    filter: drop-shadow(0 2px 2px rgba(0,0,0,0.05));
}

@keyframes bubbleIn {
    from { opacity: 0; transform: scale(0.9) translateY(10px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

.form-control {
    width: 100%;
    padding: 12px;
    border-radius: 10px;
    border: 1px solid var(--border-strong);
    outline: none;
    font-family: inherit;
    transition: border-color 0.2s;
}

.form-control:focus {
    border-color: var(--primary);
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

.btn-secondary {
    background: #f1f5f9;
    color: #475569;
    padding: 10px 20px;
    border: none;
    border-radius: 10px;
    font-weight: 700;
    cursor: pointer;
}

.btn-secondary:hover {
    background: #e2e8f0;
}

/* Material checkbox hover - keep same blue when checked */
input[type="checkbox"].mat-checkbox {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    border: 2px solid #cbd5e1;
    border-radius: 4px;
    cursor: pointer;
    accent-color: var(--primary) !important;
    -webkit-accent-color: var(--primary) !important;
    background-color: transparent;
}

input[type="checkbox"].mat-checkbox:checked {
    background-color: var(--primary) !important;
    border-color: var(--primary) !important;
}

input[type="checkbox"].mat-checkbox:hover {
    border-color: var(--primary) !important;
}

input[type="checkbox"].mat-checkbox:checked:hover {
    background-color: var(--primary) !important;
    border-color: var(--primary) !important;
}

/* --- STEP 4 AGENDA STYLES REMOVED (Conflicting with core calendar styles) --- */

/* Availability Details */
.availability-item {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.availability-item:hover {
    transform: translateX(4px);
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.availability-badge {
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Loan Search Button */
.loan-search-btn {
    background: #f1f5f9;
    color: #64748b;
    border: 1px solid #e2e8f0;
    width: 28px;
    height: 28px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
}
.loan-search-btn:hover {
    background: #e0f2fe;
    color: var(--primary);
    border-color: var(--primary);
}

#btn-refresh-step4 {
    border-radius: 4px;
    padding: 2px;
    transition: all 0.2s;
}
#btn-refresh-step4:hover {
    background: #e2e8f0;
    color: var(--primary) !important;
}
#btn-refresh-step4.spinning img {
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Hourly Grid */
#hourly-grid-container {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-top: 12px;
}
.hour-slot {
    padding: 6px;
    font-size: 10px;
    font-weight: 700;
    text-align: center;
    border-radius: 6px;
    border: 1px solid #e2e8f0;
    transition: all 0.2s;
}
.hour-slot.free {
    background: #f0fdf4;
    color: #166534;
    border-color: #bbf7d0;
}
.hour-slot.busy {
    background: #f1f5f9;
    color: #94a3b8;
    background-image: repeating-linear-gradient(45deg, transparent, transparent 5px, rgba(0,0,0,0.03) 5px, rgba(0,0,0,0.03) 10px);
    cursor: not-allowed;
}

/* Loan Modal Details */
.loan-modal {
    animation: modalScaleIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes modalScaleIn {
    from { transform: translate(-50%, -45%) scale(0.95); opacity: 0; }
    to { transform: translate(-50%, -50%) scale(1); opacity: 1; }
}

.plaza-availability-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    margin-bottom: 8px;
    transition: border-color 0.2s;
}
.plaza-availability-item:hover {
    border-color: var(--primary);
}

/* --- COMPONENT STYLES (Moved from ScheduleModal.js) --- */
#modalNewSchedule select {
    background: #f8fafc !important;
    border: 1px solid #e2e8f0 !important;
    color: #64748b !important;
    padding: 8px 12px !important;
    border-radius: 6px !important;
    font-size: 13px !important;
    appearance: auto !important;
}

.calendar-select {
    border: none !important;
    background: #f1f5f9 !important;
    color: #1e293b !important;
    cursor: pointer;
}

.loan-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 90%;
    max-width: 400px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    z-index: 10001;
    display: none;
    flex-direction: column;
    border: 1px solid #e2e8f0;
}

.loan-modal-header {
    padding: 16px;
    border-bottom: 1px solid #f1f5f9;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.loan-modal-body {
    padding: 16px;
    max-height: 300px;
    overflow-y: auto;
}

.specialty-item.invalid {
    background: #fef2f2 !important;
    color: #ef4444 !important;
}

.specialty-item.invalid::before {
    content: '';
    position: absolute;
    left: 0;
    top: 15%;
    height: 70%;
    width: 5px;
    background: #ef4444;
    border-radius: 0 4px 4px 0;
}

.btn-suggest-date-custom {
    position: absolute;
    bottom: 12px;
    right: 12px;
    background: white;
    border: 1px solid #22c55e;
    border-radius: 8px;
    width: 32px;
    height: 32px;
    cursor: pointer;
    color: #22c55e;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    transition: all 0.2s ease;
    padding: 0;
    box-shadow: 0 1px 3px rgba(34, 197, 94, 0.1);
}

.btn-suggest-date-custom:hover {
    background: #f0fdf4;
    border-color: #16a34a;
    color: #16a34a;
    transform: translateY(-1px);
    box-shadow: 0 4px 6px rgba(34, 197, 94, 0.15);
}

.btn-suggest-date-custom:active {
    transform: translateY(0);
}

/* --- CUSTOM PREMIUM SLIDER (EDGE-TO-EDGE) --- */
.duration-slider-wrapper {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 0;
}

.duration-slider-header {
    display: flex; 
    justify-content: space-between; 
    align-items: center;
}

.duration-slider-label {
    font-size: 10px;
    font-weight: 800;
    color: #475569;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.duration-val-highlight {
    font-size: 11px;
    font-weight: 500;
    color: #000;
    background: transparent;
    padding: 0;
}

/* The Container that handles the padding for the thumb */
.custom-slider-container {
    padding: 10px 8px; /* 8px side padding for 16px handle */
    margin: 0 -8px;
    position: relative;
    cursor: pointer;
    touch-action: none;
}

.custom-slider-track {
    height: 4px;
    background: #e2e8f0;
    border-radius: 10px;
    position: relative;
    width: 100%;
}

.custom-slider-fill {
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    background: var(--primary);
    border-radius: 10px;
    width: 0%; /* Dynamic */
}

.custom-slider-handle {
    position: absolute;
    top: 50%;
    left: 0%; /* Dynamic */
    width: 16px;
    height: 16px;
    background: #fff;
    border: 2px solid var(--primary);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    box-shadow: 0 2px 5px rgba(0, 99, 153, 0.2);
    z-index: 10;
    pointer-events: none;
    transition: transform 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.slider-tooltip {
    position: absolute;
    top: -22px;
    background: var(--primary);
    color: white;
    font-size: 8px;
    font-weight: 800;
    padding: 2px 5px;
    border-radius: 4px;
    white-space: nowrap;
    pointer-events: none;
    line-height: 1;
}

.slider-tooltip::after {
    content: '';
    position: absolute;
    bottom: -3px;
    left: 50%;
    transform: translateX(-50%);
    border-left: 3px solid transparent;
    border-right: 3px solid transparent;
    border-top: 3px solid var(--primary);
}

.slider-notches {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    display: flex;
    justify-content: space-between;
    pointer-events: none;
}

.slider-notch {
    width: 2px;
    height: 12px;
    background: #94a3b8;
    margin-top: -4px;
    opacity: 0.35;
}

.time-square.disabled {
    opacity: 0.4;
    cursor: not-allowed;
    background: #f1f5f9;
}

.custom-slider-container:hover .custom-slider-handle {
    transform: translate(-50%, -50%) scale(1.1);
}

.agenda-layout {
    display: flex;
    gap: 16px;
    flex: 1;
    min-height: 0;
    margin-top: 10px;
}

.agenda-col-left {
    flex: 1.2;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.agenda-col-right {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: #f8fafc;
    border-radius: 12px;
    padding: 12px;
    border: 1px solid #e2e8f0;
    min-width: 0;
}

.procedure-status-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 4px;
    border-bottom: 1px dashed #e2e8f0;
    gap: 10px;
}

.procedure-status-item:last-child {
    border-bottom: none;
}

.procedure-status-item:hover {
    background: rgba(0,0,0,0.02);
}

.time-wrapper {
    display: flex;
    flex-direction: column;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 10px;
    height: 100%;
    min-height: 140px;
    position: relative;
    overflow: hidden;
}

.time-grid-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
    flex: 1;
}

.time-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 7.5px;
}

.time-square {
    aspect-ratio: 1;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
    padding: 1px;
}

.square-hour {
    font-size: 8px;
    font-weight: 500;
    color: #000000;
}

.square-start-pointer {
    position: absolute;
    top: 3px;
    right: 3px;
    width: 11px;
    height: 11px;
    background: #0284c7;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
    z-index: 20;
    border: 1px solid #0284c7;
    pointer-events: none;
    transition: all 0.2s ease;
}

.square-start-pointer .icon-asset {
    background-color: #ffffff !important;
}

.time-square:hover .square-start-pointer {
    background: #ffffff !important;
}

.time-square:hover .square-start-pointer .icon-asset {
    background-color: #0284c7 !important;
}

.time-square.available {
    background: transparent !important;
    border: 2px dashed #22c55e !important;
}

.time-square.partial {
    background: transparent !important;
    border: 2px dashed #f59e0b !important;
}

.time-square.busy {
    background: rgba(220, 38, 38, 0.05) !important;
    border: 2px dashed #dc2626 !important;
    color: #000000 !important;
}

.time-square.occupied {
    background: repeating-linear-gradient(
        45deg,
        rgba(220, 38, 38, 0.08) 0px,
        rgba(220, 38, 38, 0.08) 3px,
        rgba(220, 38, 38, 0.2) 3px,
        rgba(220, 38, 38, 0.2) 6px
    ) !important;
    border: 2px solid #dc2626 !important;
    color: #000000 !important;
    font-weight: 900 !important;
}

.time-square.disabled {
    opacity: 0.35;
    cursor: default;
    pointer-events: none;
    filter: grayscale(1);
    background: #f1f5f9;
    border-color: #e2e8f0;
}

.time-square.available:hover,
.time-square.available.selected {
    background: #22c55e !important;
    color: #ffffff !important;
    border-color: #22c55e !important;
}

.time-square.available:hover .square-hour,
.time-square.available.selected .square-hour {
    color: #ffffff !important;
}

.time-square.partial:hover,
.time-square.partial.selected {
    background: #f59e0b !important;
    color: #ffffff !important;
    border-color: #f59e0b !important;
}

.time-square.partial:hover .square-hour,
.time-square.partial.selected .square-hour {
    color: #ffffff !important;
}

.time-square.busy:hover,
.time-square.busy.selected,
.time-square.occupied:hover,
.time-square.occupied.selected {
    background: #dc2626 !important;
    color: #ffffff !important;
    border-color: #dc2626 !important;
}

.time-square.busy:hover .square-hour,
.time-square.busy.selected .square-hour,
.time-square.occupied:hover .square-hour,
.time-square.occupied.selected .square-hour { 
    color: #fff !important; 
}

.time-square.hover-preview,
.time-square.hover-preview:hover,
.time-square.hover-preview.selected {
    background: rgba(125, 211, 252, 0.4) !important;
    border: 2px dashed #0369a1 !important;
    color: #0369a1 !important;
    opacity: 1 !important;
    filter: none !important;
    z-index: 10 !important;
}
.time-square.hover-preview .square-hour,
.time-square.hover-preview:hover .square-hour {
    color: #0369a1 !important;
}

.time-square.hover-next-day::after {
    content: '+1d';
    position: absolute;
    top: -14px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 8px;
    font-weight: 900;
    color: #475569;
    background: #ffffff;
    padding: 1px 5px;
    border-radius: 4px;
    border: 1px solid #cbd5e1;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
    z-index: 10;
    pointer-events: none;
}

.time-square.estimated-start {
    background: #0284c7 !important;
    border: 1px solid #0284c7 !important;
    color: #ffffff !important;
    z-index: 6;
    transition: all 0.2s ease;
    opacity: 1 !important;
    filter: none !important;
}

.time-square.estimated-start:hover {
    background: #0369a1 !important;
    border-color: #0369a1 !important;
}

.time-square.estimated-start:hover .square-hour {
    color: #ffffff !important;
}

.time-square.estimated-slot {
    background: #0284c7 !important;
    border: 1px solid #0284c7 !important;
    color: #ffffff !important;
    z-index: 5;
    opacity: 1 !important;
    filter: none !important;
}

.time-square.estimated-start .square-hour,
.time-square.estimated-slot .square-hour {
    color: #ffffff !important;
}

/* Ensure hover-preview from JS always wins over solid estimated colors */
.time-square.hover-preview {
    background: rgba(125, 211, 252, 0.4) !important;
    border: 2px dashed #0369a1 !important;
    color: #0369a1 !important;
    z-index: 10 !important;
}

.time-square.hover-preview .square-hour {
    color: #0369a1 !important;
}

/* Ensure info icon is hidden in preview or selection modes */
.time-square.hover-preview .square-info-icon,
.time-square.estimated .square-info-icon {
    display: none !important;
}

/* --- END STEP 4 STYLES --- */

.square-info-icon {
    transition: all 0.2s ease;
    z-index: 5;
}

.time-square:hover .square-info-icon {
    opacity: 1 !important;
}

.time-square:hover .square-info-icon span.icon-asset {
    background-color: #ffffff !important;
}

.popover-trigger {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.popover-content {
    position: absolute;
    top: -15px;
    bottom: auto;
    left: calc(100% + 14px);
    transform: translateX(-10px);
    background: white;
    padding: 12px 14px;
    border-radius: 14px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2), 0 0 0 1px rgba(0,0,0,0.05);
    border: none;
    z-index: 99999;
    width: max-content;
    min-width: 180px;
    max-width: 320px;
    opacity: 0;
    visibility: hidden;
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    pointer-events: none;
    text-align: left;
}

.popover-trigger:hover .popover-content {
    opacity: 1;
    visibility: visible;
    transform: translateX(0);
}

.popover-content::after {
    content: '';
    position: absolute;
    top: 15px;
    left: auto;
    right: 100%;
    border-width: 8px;
    border-style: solid;
    border-color: transparent white transparent transparent;
    filter: drop-shadow(-2px 0 1px rgba(0,0,0,0.05));
    pointer-events: none;
}

.popover-item {
    font-size: 11px;
    font-weight: 700;
    color: #1e293b;
    padding: 3px 0 3px 15px; /* Reducido al 50% */
    border-bottom: 1px solid #f8fafc;
    white-space: nowrap;
    position: relative;
    margin-left: 5px;
}

.popover-item::before {
    content: '';
    position: absolute;
    left: 0px;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background-color: var(--primary);
    opacity: 0.5;
}

.popover-item:last-child {
    border-bottom: none !important;
}

/* Sort Headers */
.sort-header {
    cursor: pointer;
    -webkit-user-select: none;
    user-select: none;
    transition: background-color 0.2s;
    position: relative;
    padding-right: 25px !important;
}

.sort-header:hover {
    background-color: #f8fafc;
    color: var(--primary);
}

.sort-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-left: 6px;
    opacity: 0.3;
    transition: all 0.2s;
}

.sort-header:hover .sort-icon {
    opacity: 0.7;
}

.sort-header.active {
    font-weight: 800;
}

.sort-header.active .sort-icon {
    opacity: 1;
    color: var(--primary);
}

.sort-header.asc .sort-icon {
    transform: rotate(180deg);
}

.sort-header.desc .sort-icon {
    transform: rotate(0deg);
}
/* --- PREMIUM TOAST (BUBBLE STYLE) --- */
.surgefy-toast {
  position: fixed;
  bottom: 40px;
  left: 50%;
  transform: translateX(-50%) translateY(30px);
  padding: 12px 24px;
  border-radius: 50px; /* Pill/Bubble style */
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2), 0 4px 10px rgba(0, 0, 0, 0.1);
  z-index: 99999;
  pointer-events: none;
  opacity: 0;
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275); /* Bouncy transition */
  max-width: 90%;
  text-align: center;
  border: 1px solid rgba(255, 255, 255, 0.2);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}

.surgefy-toast.active {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.surgefy-toast.toast-success { background: rgba(16, 185, 129, 0.95); }
.surgefy-toast.toast-error   { background: rgba(239, 68, 68, 0.95); }
.surgefy-toast.toast-info    { background: rgba(59, 130, 246, 0.95); }

.surgefy-toast .toast-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.2);
  width: 28px;
  height: 28px;
  border-radius: 50%;
  flex-shrink: 0;
}

@keyframes toastSlideOut {
  from { opacity: 1; transform: translateX(-50%) translateY(0); }
  to { opacity: 0; transform: translateX(-50%) translateY(-20px); }
}

.surgefy-toast.leaving {
  animation: toastSlideOut 0.4s forwards ease-in;
}

/* Table Filters & Pagination Styles */
.select-filter {
    padding: 8px 12px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-strong);
    background: #fff;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--dark);
    cursor: pointer;
    outline: none;
    transition: all 0.2s;
    min-width: 160px;
}

.select-filter:hover {
    border-color: var(--primary);
    background: #f8fafc;
}

.action-icon {
    cursor: pointer;
    color: #64748b;
    transition: all 0.2s;
    padding: 4px;
    border-radius: 6px;
}

.action-icon:hover {
    color: var(--primary);
    background: #f1f5f9;
    transform: rotate(5deg);
}

#btnRefreshProcedures:active {
    transform: rotate(180deg);
}

.pagination-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 32px;
    background: #fff;
    border-top: 1px solid var(--border);
    transition: all 0.3s ease;
}

.pagination-info {
    font-size: 0.85rem;
    color: #64748b;
    font-weight: 600;
}

.pagination-controls {
    display: flex;
    gap: 6px;
    align-items: center;
}

.pagination-btn {
    min-width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    font-weight: 700;
    font-size: 0.85rem;
    cursor: pointer;
    color: #475569;
    background: #f1f5f9;
    border: 1px solid transparent;
    transition: all 0.2s;
    padding: 0 8px;
}

.pagination-btn:hover:not(.disabled) {
    background: #e2e8f0;
    color: var(--primary);
    border-color: rgba(0, 99, 153, 0.2);
}

.pagination-btn.active {
    background: var(--primary);
    color: #fff;
    box-shadow: 0 4px 6px -1px rgba(0, 99, 153, 0.3);
}

.pagination-btn.disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* View Switching Animations */
.stats-grid {
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

[data-view] {
    transition: all 0.2s ease;
}

/* Actions cell styles */
.action-buttons-wrapper {
    display: flex;
    gap: 8px;
    align-items: center;
}

.action-btn-mini {
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    background: #fff;
    color: #64748b;
    cursor: pointer;
    transition: all 0.2s;
    flex-shrink: 0;
}

.action-btn-mini:hover {
    background: #f8fafc;
    color: var(--primary);
    border-color: var(--primary);
    transform: translateY(-1px);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

.action-btn-mini.btn-cancel-cx:hover {
    color: #ef4444;
    border-color: #ef4444;
    background: #fef2f2;
}

.action-btn-mini.btn-delete:hover {
    color: #dc2626;
    border-color: #dc2626;
    background: #fee2e2;
}

.action-btn-mini svg {
    pointer-events: none;
}

/* Kebab Menu & Dropdown */
.actions-dropdown-container {
    position: relative;
    display: flex;
    justify-content: center;
}

.kebab-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: none;
    background: transparent;
    color: #64748b;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
}

.kebab-btn:hover {
    background: #f1f5f9;
    color: var(--primary);
}

.dropdown-menu {
    position: absolute;
    right: 32px;
    top: 0;
    background: #ffffff;
    min-width: 180px;
    border-radius: 12px;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
    border: 1px solid #e2e8f0;
    padding: 8px;
    display: none;
    z-index: 1000;
}

.dropdown-menu.active {
    display: block;
    animation: scale-in 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    border-radius: 8px;
    color: #475569;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.dropdown-item:hover {
    background: #f8fafc;
    color: var(--primary);
}

.dropdown-item.text-danger {
    color: #ef4444;
}

.dropdown-item.text-danger:hover {
    background: #fef2f2;
}

.dropdown-item .icon-asset {
    opacity: 0.7;
}

/* Table Card Header Styles (Outside Container) */
.table-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 4px 4px 4px;
    width: 100%;
    margin-bottom: 10px;
    animation: scale-in 0.8s cubic-bezier(0.16, 1, 0.3, 1) 0.85s backwards;
}

.table-title-group {
    display: flex;
    align-items: center;
    gap: 16px;
}

.title-radar-icon {
    color: var(--primary);
    background: #ffffff;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 14px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    padding: 8px;
}

.table-card-title {
    font-size: 1.65rem;
    font-weight: 800;
    color: #0f172a;
    letter-spacing: -0.03em;
    line-height: 1;
}

.table-actions-group {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Actions Column Width Reduction */
#thActions, .cell-actions {
    width: 60px !important;
    min-width: 60px !important;
    text-align: center !important;
    padding: 8px !important;
}


/* Mini Context Menus */
.actions-dropdown-container {
    position: relative;
    display: inline-flex;
    align-items: center;
}

.kebab-btn-mini {
    background: white;
    padding: 3px 10px;
    border-radius: 99px;
    cursor: pointer;
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    opacity: 0.6;
}

.kebab-btn-mini svg {
    width: 14px;
    height: 14px;
}

.kebab-btn-mini:hover {
    background: #0ea5e9;
    border-color: #0ea5e9;
    color: #ffffff;
}

.actions-dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    width: 180px;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    display: none;
    padding: 6px;
    margin-top: 5px;
}

.actions-dropdown-menu.active {
    display: block;
    animation: menu-pop 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes menu-pop {
    from { opacity: 0; transform: translateY(-5px) scale(0.95); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.actions-dropdown-menu .dropdown-item {
    padding: 10px 12px;
    font-size: 13px;
    font-weight: 600;
    color: #475569;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: all 0.15s;
}

.actions-dropdown-menu .dropdown-item:hover {
    background: #f8fafc;
    color: var(--primary);
}

.actions-dropdown-menu .dropdown-item.danger:hover {
    background: #fef2f2;
    color: #ef4444;
}

.actions-dropdown-menu .icon-asset {
    opacity: 0.7;
}

