/**
 * Estilos globales y Sistema de Diseño para OptiDesk Cloud
 * Centralización de tema, paleta de colores, componentes de formulario, botones,
 * layouts estilizados (Sidebar, Topbar, Cards) y adaptaciones de Bootstrap 5 / Grid.js.
 */

/* ==========================================================================
	 1. VARIABLES GLOBALES Y PALETA DE COLORES (MODERN MEDICAL & SAAS)
	 ========================================================================== */
:root {
	/* Colores de Marca y Estados */
	--bs-primary: #0d9488;
	--bs-primary-rgb: 13, 148, 136;
	--bs-primary-hover: #0f766e;
	--bs-primary-active: #115e59;
	--bs-primary-subtle: #f0fdfa;
	--bs-primary-border-subtle: #ccfbf1;
	--bs-primary-text: #0f766e;

	--bs-success: #10b981;
	--bs-success-rgb: 16, 185, 129;
	--bs-success-hover: #059669;
	--bs-success-active: #047857;
	--bs-success-subtle: #ecfdf5;
	--bs-success-border-subtle: #a7f3d0;
	--bs-success-text: #065f46;

	--bs-info: #0ea5e9;
	--bs-info-rgb: 14, 165, 233;
	--bs-info-hover: #0284c7;
	--bs-info-active: #0369a1;
	--bs-info-subtle: #f0f9ff;
	--bs-info-border-subtle: #bae6fd;
	--bs-info-text: #0369a1;

	--bs-warning: #f59e0b;
	--bs-warning-rgb: 245, 158, 11;
	--bs-warning-hover: #d97706;
	--bs-warning-active: #b45309;
	--bs-warning-subtle: #fffbeb;
	--bs-warning-border-subtle: #fde68a;
	--bs-warning-text: #92400e;

	--bs-danger: #f43f5e;
	--bs-danger-rgb: 244, 63, 94;
	--bs-danger-hover: #e11d48;
	--bs-danger-active: #be123c;
	--bs-danger-subtle: #fff1f2;
	--bs-danger-border-subtle: #fecdd3;
	--bs-danger-text: #9f1239;

	--bs-secondary: #64748b;
	--bs-secondary-rgb: 100, 116, 139;
	--bs-secondary-hover: #475569;
	--bs-secondary-active: #334155;
	--bs-secondary-subtle: #f8fafc;
	--bs-secondary-border-subtle: #e2e8f0;
	--bs-secondary-text: #334155;

	--bs-dark: #0f172a;
	--bs-dark-rgb: 15, 23, 42;
	--bs-dark-hover: #1e293b;

	--bs-purple: #8b5cf6;
	--bs-purple-rgb: 139, 92, 246;
	--bs-purple-subtle: #f5f3ff;
	--bs-purple-text: #6d28d9;

	--bs-pink: #ec4899;
	--bs-pink-rgb: 236, 72, 153;
	--bs-pink-subtle: #fdf2f8;
	--bs-pink-text: #be185d;

	--bs-indigo: #6366f1;
	--bs-indigo-rgb: 99, 102, 241;
	--bs-indigo-subtle: #eef2ff;
	--bs-indigo-text: #4338ca;

	/* Tipografía y Superficies */
	--app-bg: #f8fafc;
	--card-bg: #ffffff;
	--text-main: #1e293b;
	--text-muted: #64748b;
	--border-color: #e2e8f0;
	--border-color-focus: var(--bs-primary);
	--radius-sm: 0.375rem;
	--radius-md: 0.5rem;
	--radius-lg: 0.75rem;
	--radius-xl: 1rem;

	/* Sombras de Elevación */
	--shadow-xs: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
	--shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.08), 0 1px 2px -1px rgba(0, 0, 0, 0.05);
	--shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.07), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
	--shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -4px rgba(0, 0, 0, 0.04);
	--shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.05);

	/* Dimensiones del Layout */
	--sidebar-width: 260px;
	--topbar-height: 68px;
	--sidebar-bg: #090e17;
	--sidebar-hover: rgba(255, 255, 255, 0.06);
	--sidebar-active: var(--bs-primary);
}

/* ==========================================================================
	 PALETAS DE COLORES SELECCIONABLES (MULTI-TENANT / POR EMPRESA)
	 ========================================================================== */
[data-theme-palette="teal"],
:root[data-theme-palette="teal"] {
	--bs-primary: #0d9488;
	--bs-primary-rgb: 13, 148, 136;
	--bs-primary-hover: #0f766e;
	--bs-primary-active: #115e59;
	--bs-primary-subtle: #f0fdfa;
	--bs-primary-border-subtle: #ccfbf1;
	--bs-primary-text: #0f766e;
	--border-color-focus: #0d9488;
	--sidebar-active: #0d9488;
}

[data-theme-palette="ocean"],
:root[data-theme-palette="ocean"] {
	--bs-primary: #0284c7;
	--bs-primary-rgb: 2, 132, 199;
	--bs-primary-hover: #0369a1;
	--bs-primary-active: #075985;
	--bs-primary-subtle: #f0f9ff;
	--bs-primary-border-subtle: #bae6fd;
	--bs-primary-text: #0369a1;
	--border-color-focus: #0284c7;
	--sidebar-active: #0284c7;
}

[data-theme-palette="indigo"],
:root[data-theme-palette="indigo"] {
	--bs-primary: #4f46e5;
	--bs-primary-rgb: 79, 70, 229;
	--bs-primary-hover: #4338ca;
	--bs-primary-active: #3730a3;
	--bs-primary-subtle: #eef2ff;
	--bs-primary-border-subtle: #c7d2fe;
	--bs-primary-text: #4338ca;
	--border-color-focus: #4f46e5;
	--sidebar-active: #4f46e5;
}

[data-theme-palette="emerald"],
:root[data-theme-palette="emerald"] {
	--bs-primary: #059669;
	--bs-primary-rgb: 5, 150, 105;
	--bs-primary-hover: #047857;
	--bs-primary-active: #065f46;
	--bs-primary-subtle: #ecfdf5;
	--bs-primary-border-subtle: #a7f3d0;
	--bs-primary-text: #047857;
	--border-color-focus: #059669;
	--sidebar-active: #059669;
}

[data-theme-palette="purple"],
:root[data-theme-palette="purple"] {
	--bs-primary: #7c3aed;
	--bs-primary-rgb: 124, 58, 237;
	--bs-primary-hover: #6d28d9;
	--bs-primary-active: #5b21b6;
	--bs-primary-subtle: #f5f3ff;
	--bs-primary-border-subtle: #ddd6fe;
	--bs-primary-text: #6d28d9;
	--border-color-focus: #7c3aed;
	--sidebar-active: #7c3aed;
}

[data-theme-palette="rose"],
:root[data-theme-palette="rose"] {
	--bs-primary: #e11d48;
	--bs-primary-rgb: 225, 29, 72;
	--bs-primary-hover: #be123c;
	--bs-primary-active: #9f1239;
	--bs-primary-subtle: #fff1f2;
	--bs-primary-border-subtle: #fecdd3;
	--bs-primary-text: #be123c;
	--border-color-focus: #e11d48;
	--sidebar-active: #e11d48;
}

[data-theme-palette="amber"],
:root[data-theme-palette="amber"] {
	--bs-primary: #d97706;
	--bs-primary-rgb: 217, 119, 6;
	--bs-primary-hover: #b45309;
	--bs-primary-active: #92400e;
	--bs-primary-subtle: #fffbeb;
	--bs-primary-border-subtle: #fde68a;
	--bs-primary-text: #b45309;
	--border-color-focus: #d97706;
	--sidebar-active: #d97706;
}

[data-theme-palette="slate"],
:root[data-theme-palette="slate"] {
	--bs-primary: #334155;
	--bs-primary-rgb: 51, 65, 85;
	--bs-primary-hover: #1e293b;
	--bs-primary-active: #0f172a;
	--bs-primary-subtle: #f8fafc;
	--bs-primary-border-subtle: #cbd5e1;
	--bs-primary-text: #1e293b;
	--border-color-focus: #334155;
	--sidebar-active: #334155;
}

/* ==========================================================================
	 2. ESTILOS BASE Y TIPOGRAFÍA
	 ========================================================================== */
body {
	font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
	background-color: var(--app-bg);
	color: var(--text-main);
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
	letter-spacing: -0.01em;
	min-height: 100vh;
	overflow-x: hidden;
	overflow-y: auto;
	-webkit-overflow-scrolling: touch;
}

h1, h2, h3, h4, h5, h6 {
	color: #0f172a;
	font-weight: 700;
	letter-spacing: -0.02em;
}

/* ==========================================================================
	 3. LAYOUT DEL SISTEMA (SIDEBAR, TOPBAR, WRAPPER, FOOTER)
	 ========================================================================== */

/* Sidebar */
#sidebar {
	width: var(--sidebar-width);
	height: 100vh;
	height: 100dvh;
	position: fixed;
	top: 0;
	left: 0;
	z-index: 1000;
	background: linear-gradient(180deg, #090e17 0%, #0f172a 100%);
	color: #94a3b8;
	transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
	border-right: 1px solid rgba(255, 255, 255, 0.06);
	overflow-y: auto;
	-webkit-overflow-scrolling: touch;
}

#sidebar::-webkit-scrollbar {
	width: 5px;
}

#sidebar::-webkit-scrollbar-thumb {
	background: rgba(255, 255, 255, 0.1);
	border-radius: 4px;
}

#sidebar .brand {
	height: var(--topbar-height);
	display: flex;
	align-items: center;
	padding: 0 1.5rem;
	color: #ffffff;
	font-weight: 700;
	font-size: 1.2rem;
	border-bottom: 1px solid rgba(255, 255, 255, 0.07);
	text-decoration: none;
	letter-spacing: -0.01em;
}

#sidebar .brand-logo-icon {
	width: 36px;
	height: 36px;
	border-radius: var(--radius-md);
	background: linear-gradient(135deg, var(--bs-primary) 0%, #0284c7 100%);
	display: inline-flex;
	align-items: center;
	justify-content: center;
	color: #ffffff;
	font-size: 1.15rem;
	margin-right: 0.75rem;
	box-shadow: 0 2px 8px rgba(var(--bs-primary-rgb), 0.4);
	flex-shrink: 0;
}

#sidebar .brand-logo-custom-wrapper {
	width: 38px;
	height: 38px;
	border-radius: var(--radius-md);
	background: rgba(255, 255, 255, 0.08);
	border: 1px solid rgba(255, 255, 255, 0.12);
	display: inline-flex;
	align-items: center;
	justify-content: center;
	margin-right: 0.75rem;
	padding: 2px;
	flex-shrink: 0;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

#sidebar .brand-logo-custom-wrapper img {
	max-width: 100%;
	max-height: 100%;
	object-fit: contain;
	border-radius: var(--radius-sm);
}

#sidebar .brand .brand-text {
	font-size: 1.1rem;
	font-weight: 700;
	color: #ffffff;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	line-height: 1.2;
}

#sidebar .nav-header {
	font-size: 0.68rem;
	text-transform: uppercase;
	letter-spacing: 0.08em;
	padding: 1.15rem 1.25rem 0.35rem;
	color: #64748b;
	font-weight: 700;
}

#sidebar .nav-header:first-of-type {
	padding-top: 0.35rem;
}

#sidebar .nav-link {
	color: #94a3b8;
	padding: 0.625rem 1.15rem;
	display: flex;
	align-items: center;
	font-size: 0.88rem;
	font-weight: 500;
	border-radius: var(--radius-md);
	margin: 0.15rem 0.75rem;
	transition: all 0.2s ease;
	text-decoration: none;
	cursor: pointer;
}

#sidebar .nav-link i:not(.submenu-arrow) {
	font-size: 1.1rem;
	margin-right: 0.75rem;
	color: #64748b;
	transition: color 0.2s ease;
}

#sidebar .nav-link:hover {
	color: #ffffff;
	background-color: var(--sidebar-hover);
}

#sidebar .nav-link:hover i:not(.submenu-arrow) {
	color: #38bdf8;
}

#sidebar .nav-link.active {
	color: #ffffff;
	background: linear-gradient(135deg, var(--bs-primary) 0%, var(--bs-primary-hover) 100%);
	font-weight: 600;
	box-shadow: 0 4px 14px rgba(var(--bs-primary-rgb), 0.35);
}

#sidebar .nav-link.active i:not(.submenu-arrow) {
	color: #ffffff;
}

#sidebar .nav-link.parent-active:not(.active) {
	color: #e2e8f0;
	background-color: rgba(255, 255, 255, 0.05);
}

#sidebar .nav-link.parent-active:not(.active) > i:not(.submenu-arrow) {
	color: #2dd4bf;
}

/* Flechas y animación de submenús */
#sidebar .submenu-arrow {
	font-size: 0.72rem;
	transition: transform 0.25s ease-in-out;
	color: #64748b;
	margin-left: auto;
}

#sidebar .nav-link:not(.collapsed) .submenu-arrow {
	transform: rotate(180deg);
	color: #38bdf8;
}

#sidebar .nav-link.collapsed .submenu-arrow {
	transform: rotate(0deg);
}

/* Listas de submenús */
#sidebar .submenu-list {
	padding: 0.2rem 0 0.35rem 0;
	margin: 0.1rem 0.75rem 0.25rem 1.65rem;
	border-left: 2px solid rgba(255, 255, 255, 0.08);
	list-style: none;
}

#sidebar .submenu-link {
	padding: 0.45rem 0.85rem;
	margin: 0.15rem 0 0.15rem 0.4rem;
	font-size: 0.835rem;
	color: #94a3b8;
	border-radius: var(--radius-sm);
	display: flex;
	align-items: center;
	transition: all 0.2s ease;
	text-decoration: none;
	cursor: pointer;
}

#sidebar .submenu-link i {
	font-size: 0.85rem;
	margin-right: 0.6rem;
	color: #64748b;
	transition: color 0.2s ease;
}

#sidebar .submenu-link:hover {
	color: #ffffff;
	background-color: var(--sidebar-hover);
}

#sidebar .submenu-link:hover i {
	color: #38bdf8;
}

#sidebar .submenu-link.active {
	color: var(--bs-primary);
	background: rgba(var(--bs-primary-rgb), 0.15);
	font-weight: 600;
}

#sidebar .submenu-link.active i {
	color: var(--bs-primary);
}

/* Badge de Próximamente / Pendiente */
#sidebar .nav-badge-pending {
	font-size: 0.62rem;
	font-weight: 600;
	padding: 0.15rem 0.45rem;
	border-radius: 10px;
	background: rgba(245, 158, 11, 0.18);
	color: #fbbf24;
	border: 1px solid rgba(245, 158, 11, 0.3);
	letter-spacing: 0.04em;
	text-transform: uppercase;
	line-height: 1;
	margin-left: auto;
}

/* Wrapper Principal */
#wrapper {
	margin-left: var(--sidebar-width);
	min-height: 100vh;
	display: flex;
	flex-direction: column;
	transition: margin-left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
	background-color: var(--app-bg);
}

/* Topbar */
#topbar {
	height: var(--topbar-height);
	background: rgba(255, 255, 255, 0.9);
	backdrop-filter: blur(12px);
	-webkit-backdrop-filter: blur(12px);
	border-bottom: 1px solid rgba(226, 232, 240, 0.9);
	padding: 0 2rem;
	display: flex;
	align-items: center;
	justify-content: space-between;
	position: sticky;
	top: 0;
	z-index: 999;
	box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.03);
}

.avatar-badge {
	width: 40px;
	height: 40px;
	border-radius: 50%;
	background: linear-gradient(135deg, var(--bs-primary), #0284c7);
	color: #ffffff;
	font-weight: 600;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	box-shadow: 0 2px 8px rgba(var(--bs-primary-rgb), 0.3);
	border: 2px solid #ffffff;
	font-size: 0.95rem;
}

/* Contenido Principal */
#main-content {
	flex: 1;
	padding: 2rem;
}

/* Footer */
footer {
	background: #ffffff;
	border-top: 1px solid #e2e8f0;
	padding: 1.1rem 2rem;
	font-size: 0.85rem;
	color: #64748b;
}

/* Backdrop Oscuro para Navegación Móvil */
.sidebar-backdrop {
	position: fixed;
	top: 0;
	left: 0;
	width: 100vw;
	height: 100vh;
	background: rgba(15, 23, 42, 0.65);
	backdrop-filter: blur(4px);
	-webkit-backdrop-filter: blur(4px);
	z-index: 998;
	opacity: 0;
	visibility: hidden;
	display: none;
	pointer-events: none;
	transition: opacity 0.25s cubic-bezier(0.4, 0, 0.2, 1), visibility 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar-backdrop.show {
	display: block;
	opacity: 1;
	visibility: visible;
	pointer-events: auto;
}

body.sidebar-open {
	overflow: hidden !important;
}

/* Responsive Mobile Layout */
@media (max-width: 991.98px) {
	#sidebar {
		transform: translateX(-100%);
		box-shadow: 0 0 35px rgba(0, 0, 0, 0.45);
		z-index: 1000;
	}

	#sidebar.show {
		transform: translateX(0);
	}

	#wrapper {
		margin-left: 0 !important;
		width: 100% !important;
		max-width: 100vw !important;
	}

	#topbar {
		padding: 0 1rem;
		height: 62px;
	}

	#main-content {
		padding: 1.25rem 1rem;
	}
}

@media (max-width: 575.98px) {
	#topbar {
		padding: 0 0.75rem;
		height: 58px;
	}

	#main-content {
		padding: 1rem 0.65rem;
	}

	footer {
		padding: 0.85rem 1rem;
		font-size: 0.78rem;
		text-align: center;
	}
}

/* ==========================================================================
	 4. BOTONES MODERNOS (SÓLIDOS, SOFT, OUTLINE, BTN-XS, ICON-ONLY)
	 ========================================================================== */

/* Estilo Base de Botones */
.btn {
	font-weight: 500;
	border-radius: var(--radius-md);
	padding: 0.5rem 1rem;
	font-size: 0.875rem;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 0.4rem;
	transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
	border: 1px solid transparent;
}

.btn:active {
	transform: translateY(1px);
}

/* Botones Sólidos con Sombra y Micro-elevación */
.btn-primary {
	background-color: var(--bs-primary);
	border-color: var(--bs-primary);
	color: #ffffff;
	box-shadow: 0 2px 4px rgba(var(--bs-primary-rgb), 0.25);
}

.btn-primary:hover, .btn-primary:focus {
	background-color: var(--bs-primary-hover);
	border-color: var(--bs-primary-hover);
	color: #ffffff;
	box-shadow: 0 4px 10px rgba(var(--bs-primary-rgb), 0.35);
	transform: translateY(-1px);
}

.btn-success {
	background-color: var(--bs-success);
	border-color: var(--bs-success);
	color: #ffffff;
	box-shadow: 0 2px 4px rgba(16, 185, 129, 0.25);
}

.btn-success:hover, .btn-success:focus {
	background-color: var(--bs-success-hover);
	border-color: var(--bs-success-hover);
	color: #ffffff;
	box-shadow: 0 4px 10px rgba(16, 185, 129, 0.35);
	transform: translateY(-1px);
}

.btn-danger {
	background-color: var(--bs-danger);
	border-color: var(--bs-danger);
	color: #ffffff;
	box-shadow: 0 2px 4px rgba(244, 63, 94, 0.25);
}

.btn-danger:hover, .btn-danger:focus {
	background-color: var(--bs-danger-hover);
	border-color: var(--bs-danger-hover);
	color: #ffffff;
	box-shadow: 0 4px 10px rgba(244, 63, 94, 0.35);
	transform: translateY(-1px);
}

.btn-warning {
	background-color: var(--bs-warning);
	border-color: var(--bs-warning);
	color: #ffffff;
	box-shadow: 0 2px 4px rgba(245, 158, 11, 0.25);
}

.btn-warning:hover, .btn-warning:focus {
	background-color: var(--bs-warning-hover);
	border-color: var(--bs-warning-hover);
	color: #ffffff;
	box-shadow: 0 4px 10px rgba(245, 158, 11, 0.35);
	transform: translateY(-1px);
}

.btn-info {
	background-color: var(--bs-info);
	border-color: var(--bs-info);
	color: #ffffff;
	box-shadow: 0 2px 4px rgba(14, 165, 233, 0.25);
}

.btn-info:hover, .btn-info:focus {
	background-color: var(--bs-info-hover);
	border-color: var(--bs-info-hover);
	color: #ffffff;
	box-shadow: 0 4px 10px rgba(14, 165, 233, 0.35);
	transform: translateY(-1px);
}

.btn-secondary {
	background-color: var(--bs-secondary);
	border-color: var(--bs-secondary);
	color: #ffffff;
	box-shadow: 0 2px 4px rgba(100, 116, 139, 0.2);
}

.btn-secondary:hover, .btn-secondary:focus {
	background-color: var(--bs-secondary-hover);
	border-color: var(--bs-secondary-hover);
	color: #ffffff;
	box-shadow: 0 4px 10px rgba(100, 116, 139, 0.3);
	transform: translateY(-1px);
}

.btn-dark {
	background-color: var(--bs-dark);
	border-color: var(--bs-dark);
	color: #ffffff;
	box-shadow: 0 2px 4px rgba(15, 23, 42, 0.25);
}

.btn-dark:hover, .btn-dark:focus {
	background-color: var(--bs-dark-hover);
	border-color: var(--bs-dark-hover);
	color: #ffffff;
	box-shadow: 0 4px 10px rgba(15, 23, 42, 0.35);
	transform: translateY(-1px);
}

.btn-purple {
	background-color: var(--bs-purple);
	border-color: var(--bs-purple);
	color: #ffffff;
	box-shadow: 0 2px 4px rgba(139, 92, 246, 0.25);
}

.btn-purple:hover, .btn-purple:focus {
	background-color: #7c3aed;
	border-color: #7c3aed;
	color: #ffffff;
	box-shadow: 0 4px 10px rgba(139, 92, 246, 0.35);
	transform: translateY(-1px);
}

.btn-pink {
	background-color: var(--bs-pink);
	border-color: var(--bs-pink);
	color: #ffffff;
	box-shadow: 0 2px 4px rgba(236, 72, 153, 0.25);
}

.btn-pink:hover, .btn-pink:focus {
	background-color: #db2777;
	border-color: #db2777;
	color: #ffffff;
	box-shadow: 0 4px 10px rgba(236, 72, 153, 0.35);
	transform: translateY(-1px);
}

/* Botones Outline Refinados */
.btn-outline-primary {
	color: var(--bs-primary);
	border-color: var(--bs-primary);
	background-color: transparent;
}
.btn-outline-primary:hover, .btn-outline-primary:focus {
	background-color: var(--bs-primary);
	border-color: var(--bs-primary);
	color: #ffffff;
	transform: translateY(-1px);
	box-shadow: 0 4px 10px rgba(var(--bs-primary-rgb), 0.25);
}

.btn-outline-secondary {
	color: var(--bs-secondary);
	border-color: #cbd5e1;
	background-color: #ffffff;
}
.btn-outline-secondary:hover, .btn-outline-secondary:focus {
	background-color: #f1f5f9;
	border-color: #94a3b8;
	color: #1e293b;
	transform: translateY(-1px);
}

.btn-outline-danger {
	color: var(--bs-danger);
	border-color: var(--bs-danger);
	background-color: transparent;
}
.btn-outline-danger:hover, .btn-outline-danger:focus {
	background-color: var(--bs-danger);
	border-color: var(--bs-danger);
	color: #ffffff;
	transform: translateY(-1px);
	box-shadow: 0 4px 10px rgba(244, 63, 94, 0.25);
}

/* Botones Soft / Pastel (Diseño SaaS Moderno) */
.btn-soft-primary {
	background-color: rgba(var(--bs-primary-rgb), 0.12);
	border-color: transparent;
	color: var(--bs-primary);
	font-weight: 600;
}
.btn-soft-primary:hover, .btn-soft-primary:focus {
	background-color: rgba(var(--bs-primary-rgb), 0.2);
	color: var(--bs-primary-hover);
	transform: translateY(-1px);
}

.btn-soft-success {
	background-color: rgba(16, 185, 129, 0.12);
	border-color: transparent;
	color: var(--bs-success);
	font-weight: 600;
}
.btn-soft-success:hover, .btn-soft-success:focus {
	background-color: rgba(16, 185, 129, 0.2);
	color: var(--bs-success-hover);
	transform: translateY(-1px);
}

.btn-soft-danger {
	background-color: rgba(244, 63, 94, 0.12);
	border-color: transparent;
	color: var(--bs-danger);
	font-weight: 600;
}
.btn-soft-danger:hover, .btn-soft-danger:focus {
	background-color: rgba(244, 63, 94, 0.2);
	color: var(--bs-danger-hover);
	transform: translateY(-1px);
}

.btn-soft-warning {
	background-color: rgba(245, 158, 11, 0.12);
	border-color: transparent;
	color: #b45309;
	font-weight: 600;
}
.btn-soft-warning:hover, .btn-soft-warning:focus {
	background-color: rgba(245, 158, 11, 0.2);
	color: #92400e;
	transform: translateY(-1px);
}

.btn-soft-info {
	background-color: rgba(14, 165, 233, 0.12);
	border-color: transparent;
	color: var(--bs-info);
	font-weight: 600;
}
.btn-soft-info:hover, .btn-soft-info:focus {
	background-color: rgba(14, 165, 233, 0.2);
	color: var(--bs-info-hover);
	transform: translateY(-1px);
}

.btn-soft-purple {
	background-color: rgba(139, 92, 246, 0.12);
	border-color: transparent;
	color: var(--bs-purple);
	font-weight: 600;
}
.btn-soft-purple:hover, .btn-soft-purple:focus {
	background-color: rgba(139, 92, 246, 0.2);
	color: #7c3aed;
	transform: translateY(-1px);
}

/* Botón Extra Pequeño (btn-xs) y Botones de Icono */
.btn-xs,
.btn-group-xs > .btn {
	padding: 0.25rem 0.55rem;
	font-size: 0.75rem;
	line-height: 1.25;
	border-radius: var(--radius-sm);
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 0.25rem;
	margin: 0.1rem;
	font-weight: 600;
}

.btn-xs i,
.btn-xs svg {
	font-size: 0.85rem;
	line-height: 1;
}

.btn-icon,
.btn-icon-xs {
	width: 28px;
	height: 28px;
	min-width: 28px;
	padding: 0 !important;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	border-radius: var(--radius-sm);
	font-size: 0.8rem;
}

.btn-icon-md {
	width: 36px;
	height: 36px;
	min-width: 36px;
	padding: 0 !important;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	border-radius: var(--radius-md);
	font-size: 1rem;
}

.btn-icon-lg {
	width: 44px;
	height: 44px;
	min-width: 44px;
	padding: 0 !important;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	border-radius: var(--radius-lg);
	font-size: 1.25rem;
}

/* ==========================================================================
	 5. INPUTS, FORMULARIOS Y CONTROLES VISUALES
	 ========================================================================== */

.form-label {
	font-size: 0.85rem;
	font-weight: 600;
	color: #334155;
	margin-bottom: 0.35rem;
	letter-spacing: -0.01em;
}

.form-control,
.form-select {
	padding: 0.6rem 0.95rem;
	font-size: 0.9rem;
	font-weight: 400;
	line-height: 1.5;
	color: #1e293b;
	background-color: #ffffff;
	background-clip: padding-box;
	border: 1.5px solid #e2e8f0;
	border-radius: var(--radius-md);
	box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.02);
	transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

.form-control::placeholder {
	color: #94a3b8;
	font-weight: 400;
}

.form-control:hover,
.form-select:hover {
	border-color: #cbd5e1;
}

.form-control:focus,
.form-select:focus {
	color: #0f172a;
	background-color: #ffffff;
	border-color: var(--bs-primary);
	outline: 0;
	box-shadow: 0 0 0 3.5px rgba(var(--bs-primary-rgb), 0.15);
}

.form-control:disabled,
.form-control[readonly] {
	background-color: #f8fafc;
	border-color: #e2e8f0;
	color: #64748b;
	opacity: 0.85;
}

/* Datepicker e Inputs de Fecha/Hora */
input[type="date"]::-webkit-calendar-picker-indicator,
input[type="time"]::-webkit-calendar-picker-indicator,
input[type="datetime-local"]::-webkit-calendar-picker-indicator {
	cursor: pointer;
	opacity: 0.65;
	transition: opacity 0.2s ease, transform 0.2s ease;
	border-radius: var(--radius-sm);
	padding: 2px;
}

input[type="date"]::-webkit-calendar-picker-indicator:hover,
input[type="time"]::-webkit-calendar-picker-indicator:hover,
input[type="datetime-local"]::-webkit-calendar-picker-indicator:hover {
	opacity: 1;
	transform: scale(1.1);
}

/* Input Groups */
.input-group {
	border-radius: var(--radius-md);
}

.input-group-text {
	display: flex;
	align-items: center;
	padding: 0.6rem 0.85rem;
	font-size: 0.9rem;
	font-weight: 500;
	line-height: 1.5;
	color: #64748b;
	text-align: center;
	white-space: nowrap;
	background-color: #f8fafc;
	border: 1.5px solid #e2e8f0;
	border-radius: var(--radius-md);
	transition: border-color 0.2s ease, background-color 0.2s ease, color 0.2s ease;
}

.input-group > :not(:first-child):not(.dropdown-menu):not(.valid-tooltip):not(.valid-feedback):not(.invalid-tooltip):not(.invalid-feedback) {
	margin-left: -1.5px;
}

.input-group:focus-within .input-group-text {
	border-color: var(--bs-primary);
	color: var(--bs-primary);
	background-color: #f0fdfa;
}

/* Floating Labels */
.form-floating > .form-control,
.form-floating > .form-select {
	height: calc(3.5rem + 2px);
	line-height: 1.25;
	padding: 1rem 0.95rem;
}

.form-floating > label {
	color: #64748b;
	font-weight: 500;
	font-size: 0.875rem;
	padding: 1rem 0.95rem;
}

.form-floating > .form-control:focus ~ label,
.form-floating > .form-control:not(:placeholder-shown) ~ label,
.form-floating > .form-select ~ label {
	color: var(--bs-primary);
	opacity: 0.9;
	transform: scale(0.85) translateY(-0.6rem) translateX(0.15rem);
	font-weight: 600;
}

/* Form Checks & Radios */
.form-check-input {
	width: 1.15em;
	height: 1.15em;
	margin-top: 0.15em;
	vertical-align: top;
	background-color: #fff;
	background-repeat: no-repeat;
	background-position: center;
	background-size: contain;
	border: 1.5px solid #cbd5e1;
	appearance: none;
	print-color-adjust: exact;
	transition: background-color 0.15s ease-in-out, border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
	cursor: pointer;
}

.form-check-input:checked {
	background-color: var(--bs-primary);
	border-color: var(--bs-primary);
	box-shadow: 0 2px 4px rgba(var(--bs-primary-rgb), 0.25);
}

.form-check-input:focus {
	border-color: var(--bs-primary);
	outline: 0;
	box-shadow: 0 0 0 3px rgba(var(--bs-primary-rgb), 0.15);
}

.form-check-label {
	color: #334155;
	font-size: 0.9rem;
	cursor: pointer;
	user-select: none;
}

/* Validación */
.form-control.is-invalid,
.was-validated .form-control:invalid {
	border-color: var(--bs-danger);
	box-shadow: none;
}

.form-control.is-invalid:focus,
.was-validated .form-control:invalid:focus {
	border-color: var(--bs-danger);
	box-shadow: 0 0 0 3.5px rgba(244, 63, 94, 0.15);
}

.invalid-feedback {
	font-size: 0.8rem;
	font-weight: 500;
	color: var(--bs-danger);
	margin-top: 0.3rem;
}

/* ==========================================================================
	 6. CARDS, CONTENEDORES Y SUPERFICIES (LAYOUT MODERNO)
	 ========================================================================== */

.card {
	background-color: var(--card-bg);
	border: 1px solid var(--border-color);
	border-radius: var(--radius-lg);
	box-shadow: var(--shadow-sm);
	transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
	position: relative;
	overflow: hidden;
}

.card-header {
	background-color: #ffffff;
	border-bottom: 1px solid #f1f5f9;
	padding: 1.1rem 1.4rem;
	font-weight: 600;
	color: #0f172a;
	display: flex;
	align-items: center;
	justify-content: space-between;
}

.card-body {
	padding: 1.4rem;
}

.card-footer {
	background-color: #f8fafc;
	border-top: 1px solid #f1f5f9;
	padding: 0.9rem 1.4rem;
}

/* Hover Interactivo para Cards */
.card-hover-effect,
.card-interactive {
	cursor: pointer;
}

.card-hover-effect:hover,
.card-interactive:hover {
	transform: translateY(-3px);
	box-shadow: var(--shadow-lg);
	border-color: #cbd5e1;
}

/* Stat Cards / Tarjetas de Métricas */
.stat-widget {
	border-radius: var(--radius-lg);
	border: 1px solid #e2e8f0;
	background: #ffffff;
	box-shadow: var(--shadow-sm);
	padding: 1.35rem;
	transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
	position: relative;
	overflow: hidden;
}

.stat-widget:hover {
	transform: translateY(-3px);
	box-shadow: var(--shadow-md);
	border-color: #cbd5e1;
}

.stat-icon-wrapper {
	width: 52px;
	height: 52px;
	border-radius: var(--radius-md);
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 1.4rem;
	flex-shrink: 0;
}

/* ==========================================================================
	 7. BADGES Y ETIQUETAS VISUALES
	 ========================================================================== */

.badge {
	font-weight: 600;
	font-size: 0.75rem;
	padding: 0.4em 0.7em;
	border-radius: var(--radius-sm);
	letter-spacing: 0.02em;
	display: inline-flex;
	align-items: center;
	gap: 0.25rem;
}

.badge.rounded-pill {
	padding-left: 0.85em;
	padding-right: 0.85em;
	border-radius: 9999px;
}

/* Soft Badges */
.badge-soft-primary {
	background-color: rgba(var(--bs-primary-rgb), 0.12);
	color: var(--bs-primary-text);
}

.badge-soft-success {
	background-color: rgba(16, 185, 129, 0.12);
	color: #065f46;
}

.badge-soft-danger {
	background-color: rgba(244, 63, 94, 0.12);
	color: #9f1239;
}

.badge-soft-warning {
	background-color: rgba(245, 158, 11, 0.14);
	color: #92400e;
}

.badge-soft-info {
	background-color: rgba(14, 165, 233, 0.12);
	color: #0369a1;
}

.badge-soft-secondary {
	background-color: #f1f5f9;
	color: #475569;
}

.badge-soft-purple {
	background-color: rgba(139, 92, 246, 0.12);
	color: #6d28d9;
}

.badge-soft-pink {
	background-color: rgba(236, 72, 153, 0.12);
	color: #be185d;
}

/* ==========================================================================
	 8. ALERTAS Y NOTIFICACIONES
	 ========================================================================== */

.alert {
	border-radius: var(--radius-md);
	border: 1px solid transparent;
	padding: 0.9rem 1.2rem;
	font-size: 0.9rem;
	box-shadow: var(--shadow-sm);
	position: relative;
}

.alert-primary {
	background-color: #f0fdfa;
	border-color: #ccfbf1;
	color: #0f766e;
	border-left: 4px solid var(--bs-primary);
}

.alert-success {
	background-color: #ecfdf5;
	border-color: #a7f3d0;
	color: #065f46;
	border-left: 4px solid var(--bs-success);
}

.alert-danger {
	background-color: #fff1f2;
	border-color: #fecdd3;
	color: #9f1239;
	border-left: 4px solid var(--bs-danger);
}

.alert-warning {
	background-color: #fffbeb;
	border-color: #fde68a;
	color: #92400e;
	border-left: 4px solid var(--bs-warning);
}

.alert-info {
	background-color: #f0f9ff;
	border-color: #bae6fd;
	color: #0369a1;
	border-left: 4px solid var(--bs-info);
}

/* ==========================================================================
	 9. MODAL GENÉRICO (#genericModal) Y DIÁLOGOS
	 ========================================================================== */

.modal-content {
	border-radius: var(--radius-xl);
	border: 1px solid #e2e8f0;
	box-shadow: var(--shadow-xl);
	overflow: hidden;
}

.modal-header {
	background-color: #f8fafc;
	border-bottom: 1px solid #e2e8f0;
	padding: 1.1rem 1.5rem;
}

.modal-title {
	font-size: 1.1rem;
	font-weight: 700;
	color: #0f172a;
}

.modal-body {
	padding: 1.5rem;
	color: #334155;
}

.modal-footer {
	background-color: #f8fafc;
	border-top: 1px solid #e2e8f0;
	padding: 0.9rem 1.5rem;
	gap: 0.5rem;
}

/* ==========================================================================
	 10. ESTILOS AVANZADOS PARA GRID.JS
	 ========================================================================== */

.gridjs-container {
	font-family: inherit;
	color: #334155;
	padding: 0;
}

.gridjs-head {
	padding-bottom: 1rem;
}

.gridjs-search {
	float: left;
}

.gridjs-search-input {
	border: 1.5px solid #e2e8f0;
	border-radius: var(--radius-md);
	padding: 0.55rem 0.95rem;
	font-size: 0.875rem;
	outline: none;
	transition: all 0.2s ease;
	min-width: 280px;
	background-color: #ffffff;
	color: #1e293b;
	box-shadow: var(--shadow-xs);
}

.gridjs-search-input:focus {
	border-color: var(--bs-primary);
	box-shadow: 0 0 0 3.5px rgba(var(--bs-primary-rgb), 0.15);
	background-color: #ffffff;
}

.gridjs-wrapper {
	border: 1px solid #e2e8f0;
	border-radius: var(--radius-md);
	box-shadow: var(--shadow-xs);
	overflow-x: auto;
}

.gridjs-table {
	width: 100%;
	border-collapse: separate;
	border-spacing: 0;
}

.gridjs-th {
	background-color: #f8fafc;
	color: #475569;
	font-weight: 600;
	font-size: 0.8rem;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	padding: 0.85rem 1.1rem;
	border-bottom: 2px solid #e2e8f0;
	border-top: none;
	border-left: none;
	border-right: none;
}

.gridjs-th-content {
	display: inline-flex;
	align-items: center;
	gap: 0.4rem;
}

.gridjs-th-sort:hover {
	background-color: #f1f5f9;
	color: var(--bs-primary);
}

.gridjs-td {
	background-color: #ffffff;
	padding: 0.85rem 1.1rem;
	border-top: 1px solid #f1f5f9;
	border-bottom: none;
	border-left: none;
	border-right: none;
	font-size: 0.875rem;
	vertical-align: middle;
	color: #334155;
	transition: background-color 0.15s ease;
}

.gridjs-tr:hover .gridjs-td {
	background-color: #f8fafc;
}

.gridjs-footer {
	border-top: 1px solid #e2e8f0;
	padding: 1rem 0.25rem 0.25rem;
	background-color: transparent;
	box-shadow: none;
}

.gridjs-pagination {
	color: #64748b;
	font-size: 0.875rem;
}

.gridjs-pagination .gridjs-summary {
	color: #64748b;
	font-weight: 500;
}

.gridjs-pagination .gridjs-pages button {
	border: 1px solid #e2e8f0;
	border-radius: var(--radius-sm);
	padding: 0.4rem 0.75rem;
	margin: 0 0.2rem;
	font-size: 0.825rem;
	font-weight: 500;
	background-color: #ffffff;
	color: #475569;
	transition: all 0.15s ease;
	cursor: pointer;
	box-shadow: var(--shadow-xs);
}

.gridjs-pagination .gridjs-pages button:hover:not([disabled]) {
	background-color: #f1f5f9;
	color: var(--bs-primary);
	border-color: #cbd5e1;
}

.gridjs-pagination .gridjs-pages button.gridjs-currentPage {
	background-color: var(--bs-primary);
	border-color: var(--bs-primary);
	color: #ffffff;
	font-weight: 600;
	box-shadow: 0 2px 4px rgba(var(--bs-primary-rgb), 0.3);
}

.gridjs-pagination .gridjs-pages button[disabled] {
	opacity: 0.45;
	cursor: not-allowed;
}

.gridjs-loading-bar {
	background-color: var(--bs-primary);
}

/* ==========================================================================
	 11. CLASES UTILITARIAS Y DE INTERFAZ
	 ========================================================================== */

.cursor-pointer {
	cursor: pointer !important;
}

.text-truncate-2 {
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.text-right {
	text-align: right !important;
}

.pull-right {
	float: right !important;
}

.glassmorphism {
	background: rgba(255, 255, 255, 0.85);
	backdrop-filter: blur(12px);
	-webkit-backdrop-filter: blur(12px);
}

/* ==========================================================================
	 12. SISTEMA RESPONSIVO INTEGRAL Y ADAPTACIÓN MÓVIL / TELÉFONOS
	 ========================================================================== */

/* 12.1 Prevención Global de Desbordamiento Horizontal en Móviles */
html,
body {
	max-width: 100vw;
	overflow-x: hidden;
}

#wrapper {
	max-width: 100%;
	overflow-x: clip;
}

/* 12.2 Navegación de Pestañas con Desplazamiento Horizontal Suave en Móviles */
.nav-tabs,
.nav-tabs-bordered,
.nav-tabs-empresa,
.nav-tabs-custom,
.card-header-tabs,
#stockTabs,
#empresaTabs,
#turnoTabs,
#parametrosTabs,
#productFormTabs {
	display: flex !important;
	flex-wrap: nowrap !important;
	overflow-x: auto !important;
	-webkit-overflow-scrolling: touch;
	scrollbar-width: none; /* Firefox */
	-ms-overflow-style: none; /* IE/Edge */
	border-bottom: 2px solid #e2e8f0;
	padding-bottom: 2px;
}

.nav-tabs::-webkit-scrollbar,
.nav-tabs-bordered::-webkit-scrollbar,
.nav-tabs-empresa::-webkit-scrollbar,
.nav-tabs-custom::-webkit-scrollbar,
.card-header-tabs::-webkit-scrollbar,
#stockTabs::-webkit-scrollbar,
#empresaTabs::-webkit-scrollbar,
#turnoTabs::-webkit-scrollbar,
#parametrosTabs::-webkit-scrollbar,
#productFormTabs::-webkit-scrollbar {
	display: none; /* Chrome, Safari, Edge */
}

.nav-tabs .nav-link,
.nav-tabs-bordered .nav-link,
.nav-tabs-empresa .nav-link,
.nav-tabs-custom .nav-link,
.card-header-tabs .nav-link {
	white-space: nowrap !important;
	flex-shrink: 0 !important;
}

/* 12.3 Optimización de Tablas Grid.js en Pantallas Pequeñas */
@media (max-width: 767.98px) {
	.gridjs-head {
		padding-bottom: 0.75rem;
		display: flex;
		flex-direction: column;
	}

	.gridjs-search {
		float: none !important;
		width: 100% !important;
		margin-bottom: 0.5rem;
	}

	.gridjs-search-input {
		width: 100% !important;
		min-width: 0 !important;
		box-sizing: border-box;
		height: 42px;
		font-size: 15px;
	}

	.gridjs-wrapper {
		-webkit-overflow-scrolling: touch;
		border-radius: var(--radius-md);
	}

	.gridjs-th {
		padding: 0.65rem 0.75rem;
		font-size: 0.75rem;
		white-space: nowrap;
	}

	.gridjs-td {
		padding: 0.65rem 0.75rem;
		font-size: 0.825rem;
	}

	.gridjs-footer {
		padding: 0.75rem 0 0.25rem;
	}

	.gridjs-pagination {
		display: flex;
		flex-direction: column;
		align-items: center;
		gap: 0.5rem;
		text-align: center;
	}

	.gridjs-pagination .gridjs-summary {
		float: none !important;
		margin-bottom: 0.25rem;
		font-size: 0.8rem;
	}

	.gridjs-pagination .gridjs-pages {
		float: none !important;
		display: flex;
		flex-wrap: wrap;
		justify-content: center;
		gap: 0.25rem;
	}

	.gridjs-pagination .gridjs-pages button {
		margin: 0 !important;
		padding: 0.35rem 0.6rem !important;
		min-width: 34px;
		height: 34px;
		display: inline-flex;
		align-items: center;
		justify-content: center;
		font-size: 0.825rem;
	}
}

/* 12.4 Controles de Formulario e Inputs Amigables con Móviles / iOS */
@media (max-width: 767.98px) {
	/* 16px en móvil previene el zoom automático molesto de iOS Safari */
	.form-control,
	.form-select,
	.input-group-text {
		font-size: 16px !important;
	}

	.form-control-sm,
	.form-select-sm {
		font-size: 15px !important;
	}

	.form-floating > .form-control,
	.form-floating > .form-select {
		font-size: 16px !important;
	}

	.form-check-input {
		width: 1.25em;
		height: 1.25em;
	}
}

/* 12.5 Modales y Cuadros de Diálogo (#genericModal) en Teléfonos */
@media (max-width: 575.98px) {
	.modal-dialog {
		margin: 0.5rem;
		max-width: calc(100% - 1rem);
	}

	.modal-content {
		border-radius: var(--radius-lg);
	}

	.modal-header {
		padding: 0.85rem 1rem !important;
		padding-right: 48px !important;
	}

	.modal-title {
		font-size: 1rem !important;
		line-height: 1.3;
	}

	.modal-body {
		padding: 1rem !important;
		max-height: calc(100vh - 160px);
		overflow-y: auto;
		-webkit-overflow-scrolling: touch;
	}

	.modal-footer {
		padding: 0.75rem 1rem !important;
		flex-wrap: wrap !important;
		gap: 0.5rem !important;
	}

	.modal-footer .btn {
		flex: 1 1 auto;
		min-width: 110px;
	}
}

/* 12.6 SweetAlert2 Adaptado a Móviles */
@media (max-width: 575.98px) {
	div:where(.swal2-container) .swal2-popup {
		width: 92% !important;
		max-width: 390px !important;
		padding: 1.25rem 1rem !important;
		border-radius: var(--radius-lg) !important;
	}

	div:where(.swal2-container) .swal2-title {
		font-size: 1.15rem !important;
		padding: 0.5rem 0 !important;
	}

	div:where(.swal2-container) .swal2-html-container {
		font-size: 0.875rem !important;
		margin: 0.5rem 0 !important;
	}

	div:where(.swal2-container) .swal2-actions {
		flex-direction: column-reverse;
		width: 100%;
		gap: 0.5rem;
		margin-top: 1rem !important;
	}

	div:where(.swal2-container) .swal2-actions button {
		width: 100% !important;
		margin: 0 !important;
		height: 42px;
	}
}

/* 12.7 Punto de Venta (POS) en Teléfonos y Tablets */
@media (max-width: 991.98px) {
	.pos-container {
		min-height: auto;
	}

	.pos-cart-table {
		min-width: 520px;
	}

	#pos_resultados_busqueda {
		width: 100% !important;
		max-width: 100% !important;
		left: 0 !important;
		right: 0 !important;
		box-sizing: border-box;
	}

	#pos_resultados_pacientes {
		width: 100% !important;
		max-width: 100% !important;
		left: 0 !important;
		right: 0 !important;
		box-sizing: border-box;
	}

	.quick-cash-btn {
		min-height: 42px;
		font-size: 0.88rem;
		display: inline-flex;
		align-items: center;
		justify-content: center;
	}

	#btn_cobrar_pos {
		padding: 0.9rem !important;
	}

	#btn_cobrar_pos span {
		font-size: 1.05rem !important;
	}
}

/* 12.8 Stat Widgets y Tarjetas de Métricas en Móviles */
@media (max-width: 575.98px) {
	.stat-widget {
		padding: 1rem;
	}

	.stat-widget h3 {
		font-size: 1.35rem;
	}

	.stat-icon-wrapper {
		width: 42px;
		height: 42px;
		font-size: 1.15rem;
	}

	.caja-hero-card .card-body {
		padding: 1rem !important;
	}

	.caja-status-banner-open,
	.caja-status-banner-closed {
		padding: 1rem;
	}

	.cash-metric-box {
		padding: 0.75rem 0.5rem;
	}

	.cash-metric-val {
		font-size: 1.15rem;
	}
}

/* 12.9 Tablas con Desplazamiento Táctil Fluido */
.table-responsive {
	-webkit-overflow-scrolling: touch;
	border-radius: var(--radius-md);
}

.table-responsive::-webkit-scrollbar {
	height: 6px;
}

.table-responsive::-webkit-scrollbar-thumb {
	background: rgba(100, 116, 139, 0.2);
	border-radius: 4px;
}

.table-responsive::-webkit-scrollbar-thumb:hover {
	background: rgba(100, 116, 139, 0.35);
}

/* 12.10 Botones Táctiles Accesibles */
@media (hover: none) and (pointer: coarse), (max-width: 767.98px) {
	.btn-xs {
		padding: 0.35rem 0.65rem;
		font-size: 0.78rem;
		min-height: 32px;
	}

	.btn-icon-xs {
		width: 32px;
		height: 32px;
		min-width: 32px;
	}

	.btn-icon,
	.btn-icon-md {
		width: 38px;
		height: 38px;
		min-width: 38px;
	}
}

/* ==========================================================================
	 13. COMPONENTES DE TABLAS Y ESTADOS VACÍOS (EMPTY STATES & PLACEHOLDERS)
	 ========================================================================== */
.cell-empty-dash {
	color: #94a3b8;
	font-weight: 600;
	user-select: none;
	opacity: 0.65;
	display: inline-block;
	letter-spacing: -0.05em;
	transition: opacity 0.15s ease-in-out;
}

.cell-empty-dash:hover {
	opacity: 1;
	color: #64748b;
}

.cell-empty-text {
	color: #94a3b8;
	font-size: 0.8125rem;
	font-style: italic;
	opacity: 0.8;
}

.gridjs-td .cell-empty-dash {
	font-size: 0.95rem;
}

.gridjs-td .text-muted.fst-italic {
	font-size: 0.8125rem;
	opacity: 0.75;
}

/* ==========================================================================
	 14. TOOLTIPS BOOTSTRAP 5 (SISTEMA GLOBAL OPTIDESK CLOUD)
	 ========================================================================== */
.tooltip {
	position: absolute;
	z-index: 100060;
	display: block;
	margin: 0;
	font-family: inherit;
	font-style: normal;
	font-weight: 400;
	line-height: 1.4;
	text-align: left;
	text-decoration: none;
	text-shadow: none;
	text-transform: none;
	letter-spacing: normal;
	word-break: normal;
	white-space: normal;
	word-spacing: normal;
	line-break: auto;
	font-size: 0.75rem;
	word-wrap: break-word;
	opacity: 0;
	pointer-events: none;
	transition: opacity 0.15s ease-in-out;
}

.tooltip.show {
	opacity: 1;
}

.tooltip .tooltip-inner {
	max-width: 280px;
	padding: 0.35rem 0.65rem;
	color: #ffffff;
	text-align: center;
	background-color: var(--bs-dark, #0f172a);
	border-radius: var(--radius-md, 0.5rem);
	font-size: 0.75rem;
	font-weight: 500;
	letter-spacing: 0.01em;
	box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.2), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
}

.tooltip .tooltip-arrow {
	position: absolute;
	display: block;
	width: 0.8rem;
	height: 0.4rem;
}

.tooltip .tooltip-arrow::before {
	position: absolute;
	content: "";
	border-color: transparent;
	border-style: solid;
}

.bs-tooltip-top .tooltip-arrow,
.bs-tooltip-auto[data-popper-placement^=top] .tooltip-arrow {
	bottom: -0.4rem;
}
.bs-tooltip-top .tooltip-arrow::before,
.bs-tooltip-auto[data-popper-placement^=top] .tooltip-arrow::before {
	top: 0;
	border-width: 0.4rem 0.4rem 0;
	border-top-color: var(--bs-dark, #0f172a);
}

.bs-tooltip-end .tooltip-arrow,
.bs-tooltip-auto[data-popper-placement^=right] .tooltip-arrow {
	left: -0.4rem;
	width: 0.4rem;
	height: 0.8rem;
}
.bs-tooltip-end .tooltip-arrow::before,
.bs-tooltip-auto[data-popper-placement^=right] .tooltip-arrow::before {
	right: 0;
	border-width: 0.4rem 0.4rem 0.4rem 0;
	border-right-color: var(--bs-dark, #0f172a);
}

.bs-tooltip-bottom .tooltip-arrow,
.bs-tooltip-auto[data-popper-placement^=bottom] .tooltip-arrow {
	top: -0.4rem;
}
.bs-tooltip-bottom .tooltip-arrow::before,
.bs-tooltip-auto[data-popper-placement^=bottom] .tooltip-arrow::before {
	bottom: 0;
	border-width: 0 0.4rem 0.4rem;
	border-bottom-color: var(--bs-dark, #0f172a);
}

.bs-tooltip-start .tooltip-arrow,
.bs-tooltip-auto[data-popper-placement^=left] .tooltip-arrow {
	right: -0.4rem;
	width: 0.4rem;
	height: 0.8rem;
}
.bs-tooltip-start .tooltip-arrow::before,
.bs-tooltip-auto[data-popper-placement^=left] .tooltip-arrow::before {
	left: 0;
	border-width: 0.4rem 0 0.4rem 0.4rem;
	border-left-color: var(--bs-dark, #0f172a);
}

/* Permitir que botones deshabilitados muestren tooltips informativos */
.btn:disabled,
.btn.disabled,
button:disabled {
	pointer-events: auto !important;
	cursor: not-allowed;
}

/* ==========================================================================
	 15. PROGRESSIVE WEB APP (PWA) Y EXPERIENCIA MÓVIL NATIVA
	 ========================================================================== */

/* Variables de Área Segura (Notches y Barras de Navegación de Smartphones) */
:root {
	--pwa-safe-top: env(safe-area-inset-top, 0px);
	--pwa-safe-bottom: env(safe-area-inset-bottom, 0px);
	--pwa-safe-left: env(safe-area-inset-left, 0px);
	--pwa-safe-right: env(safe-area-inset-right, 0px);
	--mobile-bottom-nav-height: 60px;
}

/* Ajuste Global para Dispositivos Táctiles */
html, body {
	-webkit-tap-highlight-color: transparent;
}

/* Modo Standalone (PWA Instalada en Pantalla de Inicio) */
html.is-pwa-standalone body {
	padding-top: var(--pwa-safe-top);
}

html.is-pwa-standalone #topbar {
	padding-top: max(0.5rem, var(--pwa-safe-top));
}

/* Barra de Navegación Inferior Móvil (Mobile Bottom Navigation Bar) */
.mobile-bottom-nav {
	position: fixed;
	bottom: 0;
	left: 0;
	right: 0;
	height: calc(var(--mobile-bottom-nav-height) + var(--pwa-safe-bottom));
	padding-bottom: var(--pwa-safe-bottom);
	background: rgba(255, 255, 255, 0.95);
	backdrop-filter: blur(16px);
	-webkit-backdrop-filter: blur(16px);
	border-top: 1px solid rgba(226, 232, 240, 0.85);
	box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.06);
	display: flex;
	align-items: center;
	justify-content: space-around;
	z-index: 1040;
	transition: transform 0.3s ease-in-out;
}

.mobile-nav-item {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	flex: 1;
	height: 100%;
	color: #64748b;
	text-decoration: none;
	font-size: 0.68rem;
	font-weight: 500;
	padding: 0.35rem 0.25rem;
	gap: 0.2rem;
	transition: color 0.15s ease, transform 0.15s ease;
	position: relative;
	border: none;
	background: transparent;
	cursor: pointer;
}

.mobile-nav-item i {
	font-size: 1.25rem;
	line-height: 1;
	transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.mobile-nav-item:active {
	transform: scale(0.92);
}

.mobile-nav-item.active {
	color: var(--bs-primary);
	font-weight: 700;
}

.mobile-nav-item.active i {
	transform: translateY(-2px);
	color: var(--bs-primary);
}

.mobile-nav-item.active::after {
	content: '';
	position: absolute;
	top: 4px;
	width: 18px;
	height: 3px;
	background: var(--bs-primary);
	border-radius: 4px;
}

/* Espacio en el contenedor para que la barra inferior no tape contenido */
@media (max-width: 991.98px) {
	#wrapper {
		padding-bottom: calc(var(--mobile-bottom-nav-height) + var(--pwa-safe-bottom) + 1rem);
	}

	#sidebar {
		padding-bottom: calc(var(--mobile-bottom-nav-height) + var(--pwa-safe-bottom) + 1.5rem);
	}
	
	footer {
		margin-bottom: calc(var(--mobile-bottom-nav-height) + var(--pwa-safe-bottom));
	}
}

@media (min-width: 992px) {
	.mobile-bottom-nav {
		display: none !important;
	}
}

/* Banner Flotante de Instalación PWA para Móviles */
.pwa-mobile-banner {
	position: fixed;
	bottom: calc(var(--mobile-bottom-nav-height) + var(--pwa-safe-bottom) + 12px);
	left: 14px;
	right: 14px;
	max-width: 480px;
	margin: 0 auto;
	background: rgba(255, 255, 255, 0.98);
	backdrop-filter: blur(12px);
	-webkit-backdrop-filter: blur(12px);
	border: 1px solid rgba(var(--bs-primary-rgb), 0.25);
	border-radius: 1rem;
	padding: 0.85rem 1rem;
	z-index: 1050;
	box-shadow: 0 12px 28px -4px rgba(0, 0, 0, 0.15), 0 0 0 1px rgba(var(--bs-primary-rgb), 0.1);
	animation: slideUpPwa 0.35s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.pwa-mobile-banner.fade-out {
	animation: slideDownPwa 0.25s ease-in forwards;
}

@keyframes slideUpPwa {
	from {
		opacity: 0;
		transform: translateY(25px);
	}
	to {
		opacity: 1;
		transform: translateY(0);
	}
}

@keyframes slideDownPwa {
	from {
		opacity: 1;
		transform: translateY(0);
	}
	to {
		opacity: 0;
		transform: translateY(25px);
	}
}

.pwa-banner-icon {
	width: 42px;
	height: 42px;
	object-fit: cover;
	box-shadow: 0 4px 10px rgba(var(--bs-primary-rgb), 0.25);
}

/* Botones de Instalación en Cabecera y Sidebar */
.pwa-install-btn {
	border-radius: var(--radius-md);
	font-weight: 600;
	animation: pulsePwaBtn 3s infinite;
}

@keyframes pulsePwaBtn {
	0%, 100% {
		box-shadow: 0 0 0 0 rgba(var(--bs-primary-rgb), 0.4);
	}
	50% {
		box-shadow: 0 0 0 6px rgba(var(--bs-primary-rgb), 0);
	}
}

/* Indicador de Desconexión Offline */
body.is-offline {
	position: relative;
}

body.is-offline::before {
	content: '⚠️ Modo sin conexión a Internet (Offline)';
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	background: #ea580c;
	color: #ffffff;
	font-size: 0.75rem;
	font-weight: 600;
	text-align: center;
	padding: 0.3rem 0.5rem;
	z-index: 100070;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

/* ==========================================================================
	 13. COMPONENTES DEL SELECTOR DE PALETA DE COLORES (PARÁMETROS SAAS)
	 ========================================================================== */
.palette-card {
	border: 2px solid var(--border-color);
	border-radius: var(--radius-lg, 12px);
	padding: 1.1rem;
	background: #ffffff;
	cursor: pointer;
	transition: all 0.22s cubic-bezier(0.4, 0, 0.2, 1);
	position: relative;
	overflow: hidden;
	height: 100%;
	display: flex;
	flex-direction: column;
	justify-content: space-between;
}

.palette-card:hover {
	transform: translateY(-2px);
	box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
	border-color: rgba(var(--palette-rgb, var(--bs-primary-rgb)), 0.6);
}

.palette-card.selected {
	border-color: var(--palette-primary, var(--bs-primary));
	background: linear-gradient(180deg, var(--palette-subtle, var(--bs-primary-subtle)) 0%, #ffffff 100%);
	box-shadow: 0 0 0 3px rgba(var(--palette-rgb, var(--bs-primary-rgb)), 0.2), 0 8px 24px rgba(0, 0, 0, 0.08);
}

.palette-swatches {
	display: flex;
	align-items: center;
	gap: 6px;
	margin-bottom: 0.85rem;
}

.palette-swatch-circle {
	width: 26px;
	height: 26px;
	border-radius: 50%;
	border: 2px solid #ffffff;
	box-shadow: 0 1px 4px rgba(0, 0, 0, 0.18);
	flex-shrink: 0;
	transition: transform 0.15s ease;
}

.palette-card:hover .palette-swatch-circle {
	transform: scale(1.08);
}

.palette-check-indicator {
	position: absolute;
	top: 10px;
	right: 10px;
	width: 24px;
	height: 24px;
	border-radius: 50%;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	opacity: 0;
	transform: scale(0.5);
	transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
	color: #ffffff;
	background-color: var(--palette-primary, var(--bs-primary));
	box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
	font-size: 0.85rem;
}

.palette-card.selected .palette-check-indicator {
	opacity: 1;
	transform: scale(1);
}

.palette-preview-box {
	background: #ffffff;
	border: 1px solid var(--border-color);
	border-radius: var(--radius-lg, 12px);
	padding: 1.25rem;
	box-shadow: var(--shadow-sm);
}

