/* Sistema de diseño compartido (público, panel de negocio y superadmin).
   Un solo acento índigo + neutros fríos (slate). Reemplaza el aspecto por
   defecto de Bootstrap (azul, bordes rectos, insignias sólidas) por
   componentes coherentes; todo se activa con la clase .ui-shell en <body>. */

.ui-shell {
	--ui-accent: #4f46e5;
	--ui-accent-hover: #4338ca;
	--ui-accent-soft: #eef2ff;
	--ui-ink: #0f172a;
	--ui-ink-soft: #475569;
	--ui-ink-mute: #64748b;
	--ui-line: #e2e8f0;
	--ui-surface: #ffffff;
	--ui-bg: #f8fafc;
	--ui-ok: #16a34a;
	--ui-radius: 14px;
	--ui-shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 4px 16px rgba(15, 23, 42, 0.05);

	--bs-body-font-family: "Inter Variable", "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
	--bs-body-color: var(--ui-ink);
	--bs-body-bg: var(--ui-bg);
	--bs-tertiary-bg: var(--ui-bg);
	--bs-link-color: var(--ui-accent);
	--bs-link-hover-color: var(--ui-accent-hover);
	--bs-border-color: var(--ui-line);
	--bs-primary: #4f46e5;
	--bs-primary-rgb: 79, 70, 229;
	background: var(--ui-bg) !important;
	color: var(--ui-ink);
	font-feature-settings: "cv11", "ss01";
	-webkit-font-smoothing: antialiased;
}

.ui-shell h1,
.ui-shell h2,
.ui-shell h3,
.ui-shell h4,
.ui-shell h5 {
	letter-spacing: -0.02em;
	font-weight: 650;
}
.ui-shell h2 { font-size: 1.5rem; }
.ui-shell h5.text-muted,
.ui-shell h6.text-muted { font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.07em; font-weight: 650; margin: 1.25rem 0 0.6rem; }
.ui-shell .text-muted { color: var(--ui-ink-mute) !important; }
.ui-shell code {
	color: #3730a3;
	background: var(--ui-accent-soft);
	padding: 0.12rem 0.4rem;
	border-radius: 6px;
	font-size: 0.85em;
}

/* ---- Botones ---- */
.ui-shell .btn {
	border-radius: 10px;
	font-weight: 550;
	transition: background-color 0.15s, border-color 0.15s, box-shadow 0.15s, transform 0.05s;
}
.ui-shell .btn:not(.btn-sm):not(.btn-lg) { padding: 0.55rem 1.05rem; }
.ui-shell .btn-sm { padding: 0.38rem 0.75rem; font-size: 0.83rem; border-radius: 8px; }
.ui-shell .btn-lg { padding: 0.8rem 1.4rem; font-size: 1rem; border-radius: 12px; }
.ui-shell .btn:active { transform: translateY(1px); }
.ui-shell .btn:focus-visible { box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.18); }

.ui-shell .btn-primary {
	--bs-btn-bg: var(--ui-accent);
	--bs-btn-border-color: var(--ui-accent);
	--bs-btn-hover-bg: var(--ui-accent-hover);
	--bs-btn-hover-border-color: var(--ui-accent-hover);
	--bs-btn-active-bg: var(--ui-accent-hover);
	--bs-btn-active-border-color: var(--ui-accent-hover);
	--bs-btn-disabled-bg: var(--ui-accent);
	--bs-btn-disabled-border-color: var(--ui-accent);
	--bs-btn-focus-shadow-rgb: 79, 70, 229;
	box-shadow: 0 1px 2px rgba(79, 70, 229, 0.25), 0 4px 12px rgba(79, 70, 229, 0.16);
}
.ui-shell .btn-secondary {
	--bs-btn-bg: #334155;
	--bs-btn-border-color: #334155;
	--bs-btn-hover-bg: #1e293b;
	--bs-btn-hover-border-color: #1e293b;
}
.ui-shell .btn-success {
	--bs-btn-bg: #16a34a;
	--bs-btn-border-color: #16a34a;
	--bs-btn-hover-bg: #15803d;
	--bs-btn-hover-border-color: #15803d;
	--bs-btn-active-bg: #15803d;
	--bs-btn-active-border-color: #15803d;
}
.ui-shell .btn-danger {
	--bs-btn-bg: #dc2626;
	--bs-btn-border-color: #dc2626;
	--bs-btn-hover-bg: #b91c1c;
	--bs-btn-hover-border-color: #b91c1c;
	--bs-btn-active-bg: #b91c1c;
	--bs-btn-active-border-color: #b91c1c;
}

/* Variantes "outline": neutras con fondo blanco y solo el borde/texto tintado */
.ui-shell .btn-outline-secondary {
	--bs-btn-color: var(--ui-ink-soft);
	--bs-btn-border-color: var(--ui-line);
	--bs-btn-hover-bg: #f1f5f9;
	--bs-btn-hover-color: var(--ui-ink);
	--bs-btn-hover-border-color: #cbd5e1;
	--bs-btn-active-bg: #f1f5f9;
	--bs-btn-active-color: var(--ui-ink);
	--bs-btn-active-border-color: #cbd5e1;
	background: var(--ui-surface);
}
.ui-shell .btn-outline-primary {
	--bs-btn-color: var(--ui-accent);
	--bs-btn-border-color: #c7d2fe;
	--bs-btn-hover-bg: var(--ui-accent-soft);
	--bs-btn-hover-color: var(--ui-accent-hover);
	--bs-btn-hover-border-color: #a5b4fc;
	--bs-btn-active-bg: var(--ui-accent-soft);
	--bs-btn-active-color: var(--ui-accent-hover);
	--bs-btn-active-border-color: #a5b4fc;
	background: var(--ui-surface);
}
.ui-shell .btn-outline-success {
	--bs-btn-color: #15803d;
	--bs-btn-border-color: #bbf7d0;
	--bs-btn-hover-bg: #f0fdf4;
	--bs-btn-hover-color: #166534;
	--bs-btn-hover-border-color: #86efac;
	--bs-btn-active-bg: #f0fdf4;
	--bs-btn-active-color: #166534;
	--bs-btn-active-border-color: #86efac;
	background: var(--ui-surface);
}
.ui-shell .btn-outline-warning {
	--bs-btn-color: #b45309;
	--bs-btn-border-color: #fde68a;
	--bs-btn-hover-bg: #fffbeb;
	--bs-btn-hover-color: #92400e;
	--bs-btn-hover-border-color: #fcd34d;
	--bs-btn-active-bg: #fffbeb;
	--bs-btn-active-color: #92400e;
	--bs-btn-active-border-color: #fcd34d;
	background: var(--ui-surface);
}
.ui-shell .btn-outline-danger {
	--bs-btn-color: #dc2626;
	--bs-btn-border-color: #fecaca;
	--bs-btn-hover-bg: #fef2f2;
	--bs-btn-hover-color: #b91c1c;
	--bs-btn-hover-border-color: #fca5a5;
	--bs-btn-active-bg: #fef2f2;
	--bs-btn-active-color: #b91c1c;
	--bs-btn-active-border-color: #fca5a5;
	background: var(--ui-surface);
}
.ui-shell .btn-close:focus { box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.18); }

/* ---- Formularios ---- */
.ui-shell .form-label { font-weight: 550; font-size: 0.88rem; margin-bottom: 0.35rem; color: var(--ui-ink); }
.ui-shell .form-control,
.ui-shell .form-select {
	border-radius: 10px;
	border-color: #cbd5e1;
	background-color: #fff;
	padding: 0.6rem 0.85rem;
	color: var(--ui-ink);
	transition: border-color 0.15s, box-shadow 0.15s;
}
.ui-shell .form-select { padding-right: 2.25rem; }
.ui-shell .form-control-sm,
.ui-shell .form-select-sm { padding: 0.4rem 0.7rem; font-size: 0.85rem; border-radius: 8px; }
.ui-shell .form-select-sm { padding-right: 2rem; }
.ui-shell .form-control:hover,
.ui-shell .form-select:hover { border-color: #94a3b8; }
.ui-shell .form-control:focus,
.ui-shell .form-select:focus {
	border-color: var(--ui-accent);
	box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.14);
}
.ui-shell .form-control::placeholder { color: #94a3b8; }
.ui-shell .form-text { color: var(--ui-ink-mute); }
.ui-shell .form-check-input { border-color: #94a3b8; }
.ui-shell .form-check-input:checked { background-color: var(--ui-accent); border-color: var(--ui-accent); }
.ui-shell .form-check-input:focus { border-color: var(--ui-accent); box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.14); }
.ui-shell .input-group > .form-control,
.ui-shell .input-group > .btn { border-radius: 10px; }
.ui-shell .input-group > :not(:first-child) { border-top-left-radius: 0; border-bottom-left-radius: 0; }
.ui-shell .input-group > :not(:last-child) { border-top-right-radius: 0; border-bottom-right-radius: 0; }

/* Select con ícono a la izquierda (filtros) */
.select-icon { position: relative; display: inline-block; }
.select-icon > i {
	position: absolute;
	left: 0.8rem;
	top: 50%;
	transform: translateY(-50%);
	color: var(--ui-ink-mute);
	pointer-events: none;
	font-size: 0.9rem;
}
.select-icon > .form-select { padding-left: 2.2rem; font-weight: 550; }

/* ---- Tarjetas ---- */
.ui-shell .card {
	border: 1px solid var(--ui-line);
	border-radius: var(--ui-radius);
	box-shadow: var(--ui-shadow);
	background: var(--ui-surface);
}
.ui-shell .card-header {
	background: transparent;
	border-bottom: 1px solid var(--ui-line);
	font-weight: 650;
	padding: 0.9rem 1.15rem;
}
.ui-shell .card-header:first-child { border-radius: var(--ui-radius) var(--ui-radius) 0 0; }
.ui-shell .card-body { padding: 1.15rem; }
.ui-shell .list-group { --bs-list-group-border-color: var(--ui-line); --bs-list-group-border-radius: var(--ui-radius); }

/* ---- Tablas ---- */
.ui-shell .table-responsive {
	/* Safari iOS trata el contenedor con scroll como capa propia: sin z-index el
	   menú "..." queda debajo de la tarjeta que viene después. */
	position: relative;
	z-index: 2;
	background: var(--ui-surface);
	border: 1px solid var(--ui-line);
	border-radius: var(--ui-radius);
	box-shadow: var(--ui-shadow);
}
.ui-shell .table {
	--bs-table-bg: transparent;
	--bs-table-hover-bg: #f8fafc;
	margin-bottom: 0;
	font-size: 0.92rem;
}
.ui-shell .table > thead > tr > th {
	background: #f8fafc;
	color: var(--ui-ink-mute);
	font-size: 0.72rem;
	font-weight: 650;
	text-transform: uppercase;
	letter-spacing: 0.06em;
	padding: 0.75rem 1rem;
	border-bottom: 1px solid var(--ui-line);
}
.ui-shell .table > tbody > tr > td { padding: 0.85rem 1rem; border-color: #eef2f6; vertical-align: middle; }
.ui-shell .table > tbody > tr:last-child > td { border-bottom: 0; }
.ui-shell .table-hover > tbody > tr:hover > * { background: #f8fafc; }

/* ---- Insignias: pastillas suaves con punto de estado ---- */
.pill {
	display: inline-flex;
	align-items: center;
	gap: 0.35rem;
	font-size: 0.78rem;
	font-weight: 600;
	padding: 0.2rem 0.65rem;
	border-radius: 999px;
	background: #f1f5f9;
	color: #475569;
	white-space: nowrap;
}
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill-programada { background: #e0e7ff; color: #4338ca; }
.pill-completada,
.pill-activo { background: #dcfce7; color: #15803d; }
.pill-no_asistio { background: #ffedd5; color: #c2410c; }
.pill-por-vencer { background: #fef3c7; color: #b45309; }
.pill-vencido { background: #fee2e2; color: #b91c1c; }
.pill-cancelada,
.pill-inactivo { background: #f1f5f9; color: #64748b; }

/* ---- Alertas ---- */
.ui-shell .alert { border-radius: 12px; border: 1px solid transparent; font-size: 0.93rem; }
.ui-shell .alert-success { background: #f0fdf4; border-color: #bbf7d0; color: #166534; }
.ui-shell .alert-danger { background: #fef2f2; border-color: #fecaca; color: #991b1b; }
.ui-shell .alert-warning { background: #fffbeb; border-color: #fde68a; color: #92400e; }
.ui-shell .alert-info { background: #eff6ff; border-color: #bfdbfe; color: #1e40af; }

/* ---- Menús desplegables ---- */
.ui-shell .dropdown-menu {
	border: 1px solid var(--ui-line);
	border-radius: 12px;
	box-shadow: 0 10px 30px rgba(15, 23, 42, 0.12);
	padding: 0.35rem;
	font-size: 0.9rem;
}
.ui-shell .dropdown-item { border-radius: 8px; padding: 0.5rem 0.75rem; font-weight: 500; }
.ui-shell .dropdown-item:hover,
.ui-shell .dropdown-item:focus { background: #f1f5f9; }
.ui-shell .dropdown-item.text-danger:hover { background: #fef2f2; }
.ui-shell .dropdown-item.text-success { color: #15803d !important; }
.ui-shell .dropdown-item.text-warning { color: #b45309 !important; }

/* ---- Modales ---- */
.ui-shell .modal-content {
	border: 0;
	border-radius: 18px;
	box-shadow: 0 24px 60px rgba(15, 23, 42, 0.25);
	overflow: hidden;
}
.ui-shell .modal-header { border-bottom: 0; padding: 1.25rem 1.5rem 0.25rem; }
.ui-shell .modal-title { font-size: 1.1rem; font-weight: 650; letter-spacing: -0.01em; }
.ui-shell .modal-body { padding: 1rem 1.5rem; }
.ui-shell .modal-footer {
	border-top: 1px solid var(--ui-line);
	background: #f8fafc;
	padding: 0.9rem 1.5rem;
	gap: 0.5rem;
}
.ui-shell .modal-backdrop.show { opacity: 0.45; background: #0f172a; }

/* Confirmación (modal genérico) */
.confirm-icono {
	width: 56px;
	height: 56px;
	border-radius: 50%;
	background: #fef3c7;
	color: #d97706;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	font-size: 1.6rem;
	margin-bottom: 0.9rem;
}
.confirm-icono.peligro { background: #fee2e2; color: #dc2626; }

/* Detalle de cita */
.cita-detalle-cabecera { display: flex; align-items: center; gap: 0.85rem; margin-bottom: 1.1rem; }
.cita-avatar {
	width: 46px;
	height: 46px;
	border-radius: 14px;
	background: var(--ui-accent-soft);
	color: var(--ui-accent);
	display: inline-flex;
	align-items: center;
	justify-content: center;
	font-weight: 700;
	font-size: 1.1rem;
	flex-shrink: 0;
}
.cita-detalle-lista { list-style: none; margin: 0; padding: 0; }
.cita-detalle-lista li {
	display: flex;
	align-items: center;
	gap: 0.75rem;
	padding: 0.65rem 0;
	border-top: 1px solid #eef2f6;
	font-size: 0.93rem;
}
.cita-detalle-lista li > i { color: var(--ui-ink-mute); width: 1.1rem; text-align: center; }
.cita-detalle-lista .etiqueta { color: var(--ui-ink-mute); min-width: 92px; }
.cita-detalle-lista .valor { font-weight: 600; word-break: break-word; }

/* ---- Barra lateral ---- */
.ui-shell .sidebar.bg-dark { background: #0f172a !important; }
.ui-shell .sidebar .border-secondary { border-color: rgba(255, 255, 255, 0.08) !important; }
.ui-shell .sidebar .nav-link {
	color: #cbd5e1 !important;
	font-weight: 500;
	font-size: 0.92rem;
	padding: 0.55rem 0.75rem;
	border-radius: 10px;
	opacity: 1;
	display: flex;
	align-items: center;
}
.ui-shell .sidebar .nav-link i { color: #94a3b8; }
.ui-shell .sidebar .nav-link:hover { background: rgba(255, 255, 255, 0.06); color: #fff !important; }
.ui-shell .sidebar .nav-link.active {
	background: rgba(99, 102, 241, 0.2);
	color: #fff !important;
}
.ui-shell .sidebar .nav-link.active i { color: #a5b4fc; }
.ui-shell .sidebar .text-white-50 { color: #94a3b8 !important; }

/* ---- Horario laboral ---- */
.dias-selector { display: flex; gap: 0.3rem; }
.ui-shell .dias-selector > .btn:not(.btn-sm):not(.btn-lg) { flex: 1 1 0; min-width: 0; padding: 0.45rem 0; text-align: center; }
.dias-selector .btn-check:checked + .btn {
	background: var(--ui-accent);
	border-color: var(--ui-accent);
	color: #fff;
}
.franja-chip {
	display: inline-flex;
	align-items: center;
	gap: 0.4rem;
	background: var(--ui-accent-soft);
	color: #3730a3;
	border-radius: 999px;
	padding: 0.25rem 0.35rem 0.25rem 0.8rem;
	font-size: 0.85rem;
	font-weight: 600;
	font-variant-numeric: tabular-nums;
}
.franja-chip button {
	border: 0;
	background: transparent;
	color: #6366f1;
	width: 22px;
	height: 22px;
	border-radius: 50%;
	font-size: 0.7rem;
	line-height: 1;
}
.franja-chip button:hover { background: #c7d2fe; color: #3730a3; }

/* ---- Enlaces legales (pie de página de todas las vistas) ---- */
.pie-legal { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.35rem 1.1rem; font-size: 0.8rem; }
.pie-legal a { color: var(--ui-ink-mute); text-decoration: none; font-weight: 500; }
.pie-legal a:hover { color: var(--ui-ink); text-decoration: underline; }
.pie-legal-panel { flex-shrink: 0; padding-top: 1rem; border-top: 1px solid var(--ui-line); }
