:root {
	/* Paleta 1: Moderna Vibrante
            --primary-color: #6200EA;
            --secondary-color: #03DAC6;
            --accent-color: #FF4081;
            --light-color: #F5F5F5;
            --dark-color: #121212;
            --chart-color1: #6200EA;
            --chart-color2: #03DAC6;
            --chart-color3: #FF4081;
            --chart-color4: #FFAB00;
            --chart-color5: #18FFFF;
            --chart-color6: #64DD17; */

	/* Otras paletas disponibles:
            /* Paleta 2: Profesional Oscuro */
	/*
            --primary-color: #263238;
            --secondary-color: #455A64;
            --accent-color: #FF6E40;
            --light-color: #ECEFF1;
            --dark-color: #102027;
            --chart-color1: #607D8B;
            --chart-color2: #FF6E40;
            --chart-color3: #00BCD4;
            --chart-color4: #FFAB00;
            --chart-color5: #82B1FF;
            --chart-color6: #69F0AE;
            */

	/* Paleta 3: Gastronómica */
	/*
            --primary-color: #7B1FA2;
            --secondary-color: #C2185B;
            --accent-color: #FFC107;
            --light-color: #F3E5F5;
            --dark-color: #4A148C;
            --chart-color1: #7B1FA2;
            --chart-color2: #C2185B;
            --chart-color3: #FFC107;
            --chart-color4: #43A047;
            --chart-color5: #1E88E5;
            --chart-color6: #FB8C00;
            */

	/* Paleta 4: Sofisticada */
	/*
	--danger-color: #f53838;
	--primary-color: #01579b;
	--secondary-color: #0277bd;
	--accent-color: #ffaa00;
	--light-color: #efefef;
	--dark-color: #002f6c;
	--chart-color1: #01579b;
	--chart-color2: #0277bd;
	--chart-color3: #ffd600;
	--chart-color4: #ff8f00;
	--chart-color5: #00bfa5;
	--chart-color6: #f50057;
 */
	/* Paleta 5: Fresca y Natural */
	--primary-color: #4caf50;
	--secondary-color: #8bc34a;
	--accent-color: #ff9800;
	--text-color: #333333;
	--background-color: #f5f5f5;
	--chart-color1: #003e6d;
	--chart-color2: #0277bd;
	--chart-color3: #ffd600;
	--chart-color4: #ff8f00;
	--chart-color5: #00bfa5;
	--chart-color6: #f50057;


	--bs-body-font-size:0.85rem
}

body {
	font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
	background-color: var(--light-color);
	overflow-x: hidden;
	font-size: var(--bs-body-font-size);
}

.form-control, .btn{
	font-size: var(--bs-body-font-size);
}


table td {
	background-color: var(--fondo-color);
	font-size: var(--bs-body-font-size)
}

/* Sidebar */
.sidebar {
	position: fixed;
	top: 0;
	left: 0;
	height: 100vh;
	background-color: var(--primary-color);
	color: white;
	transition: width 0.3s ease;
	z-index: 1000;
	width: 60px;
	overflow: hidden;
	box-shadow: 3px 0 10px rgba(0, 0, 0, 0.2);
}

.sidebar:hover,
.sidebar.expanded {
	width: 250px;
}

.sidebar-header {
	padding: 20px 0;
	text-align: center;
	border-bottom: 1px solid rgba(255, 255, 255, 0.1);
	background-color: rgba(0, 0, 0, 0.1);
}

.sidebar-logo {
	width: 40px;
	height: 40px;
	margin: 0 auto;
	background-color: var(--accent-color);
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 20px;
	font-weight: bold;
}

.sidebar-user {
	text-align: center;
	font-size: 12px;
	padding: 10px 0;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.sidebar-menu {
	list-style: none;
	padding: 0;
	margin: 0;
}

.menu-item {
	position: relative;
}

.menu-link {
	display: flex;
	align-items: center;
	padding: 15px;
	color: white;
	text-decoration: none;
	transition: background-color 0.3s;
	white-space: nowrap;
}

.menu-link:hover {
	background-color: rgba(255, 255, 255, 0.1);
}

.menu-icon {
	width: 30px;
	text-align: center;
	font-size: 18px;
}

.menu-text {
	margin-left: 10px;
	opacity: 0;
	transition: opacity 0.3s ease;
}

.sidebar:hover .menu-text,
.sidebar.expanded .menu-text {
	opacity: 1;
}

.submenu {
	list-style: none;
	padding-left: 0;
	max-height: 0;
	overflow: hidden;
	transition: max-height 0.3s ease;
	background-color: rgba(0, 0, 0, 0.2);
}

.menu-item.active .submenu {
	max-height: 1000px;
}

.submenu-link {
	display: block;
	padding: 10px 10px 10px 55px;
	color: white;
	text-decoration: none;
	transition: background-color 0.3s;
	white-space: nowrap;
	font-size: 14px;
}

.submenu-link:hover {
	background-color: rgba(255, 255, 255, 0.1);
}

.has-submenu::after {
	content: "\f054";
	font-family: "Font Awesome 6 Free";
	font-weight: 900;
	position: absolute;
	right: 15px;
	top: 50%;
	transform: translateY(-50%);
	transition: transform 0.3s;
}

.menu-item.active .has-submenu::after {
	transform: translateY(-50%) rotate(90deg);
}

/* Main content */
.main-content {
	margin-left: 60px;
	padding: 20px;
	transition: margin-left 0.3s ease;
}

.page-title {
	text-align: center;
	margin-bottom: 30px;
	color: var(--dark-color);
	border-bottom: 2px solid var(--accent-color);
	padding-bottom: 10px;
}

.dashboard-card {
	background-color: white;
	border-radius: 10px;
	box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
	padding: 20px;
	margin-bottom: 20px;
	transition: transform 0.3s, box-shadow 0.3s;
	height: 100%;
}

.dashboard-card:hover {
	transform: translateY(-5px);
	box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

.card-title {
	color: var(--primary-color);
	font-size: 18px;
	margin-bottom: 15px;
	display: flex;
	align-items: center;
	font-weight: 600;
}

.card-title i {
	margin-right: 10px;
	color: var(--accent-color);
}

.card-value {
	font-size: 24px;
	font-weight: bold;
	color: var(--dark-color);
	margin-bottom: 10px;
}

.card-trend {
	font-size: 14px;
	color: #00c853;
	display: flex;
	align-items: center;
}

.card-trend i {
	margin-right: 5px;
}

.card-trend.negative {
	color: #ff5252;
}

.card-subtitle {
	font-size: 13px;
	color: #757575;
	margin-top: 5px;
}

/* Footer */
footer {
	background-color: var(--primary-color);
	color: white;
	text-align: center;
	padding: 10px 0;
	margin-top: 40px;
	position: fixed;
	bottom: 0;
	left: 0;
	right: 0;
	z-index: 1000;
	margin-left: 60px;
	transition: margin-left 0.3s ease;
}

footer a {
	color: var(--secondary-color);
	text-decoration: none;
}

footer a:hover {
	text-decoration: underline;
	color: var(--accent-color);
}

/* Responsive */
@media (max-width: 991px) {
	.sidebar {
		width: 0;
		transition: width 0.3s ease;
		/* Transición suave */
		z-index: 1000;
	}

	.sidebar.expanded {
		width: 250px;
	}

	.main-content,
	footer {
		margin-left: 0;
		transition: margin-left 0.3s ease;
		/* Transición suave */
	}

	.menu-toggle {
		display: block;
		position: fixed;
		top: 15px;
		left: 15px;
		z-index: 1001;
		background-color: var(--primary-color);
		color: white;
		border: none;
		border-radius: 5px;
		padding: 10px;
		cursor: pointer;
	}
}

@media (min-width: 992px) {
	.menu-toggle {
		display: none;
	}
}

/* Charts */
.chart-container {
	position: relative;
	margin: 0 auto;
	height: 300px;
}

.chart-container-sm {
	position: relative;
	margin: 0 auto;
	height: 200px;
}

/* Tablas */
.table-container {
	overflow-x: auto;
}

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

#div_id_lbusca, #div_id_comercio, #div_id_adicionar {
	margin: 5px 0 !important;
}

.custom-table th {
	background-color: var(--primary-color);
	color: white;
	padding: 12px;
	text-align: left;
	font-weight: 500;
}

.custom-table td {
	padding: 5px;
	border-bottom: 1px solid #ddd;
}

.custom-table tr:hover {
	background-color: rgba(0, 0, 0, 0.05);
}

/* Indicators */
.indicator {
	display: flex;
	align-items: center;
	margin-bottom: 10px;
}

.indicator-color {
	width: 15px;
	height: 15px;
	border-radius: 50%;
	margin-right: 10px;
}

.indicator-text {
	font-size: 14px;
}

.data-green {
	color: green;
}

.data-red {
	color: #ff5252;
}

/* KPI Cards */
.kpi-card {
	background-color: white;
	border-radius: 10px;
	box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
	padding: 15px;
	margin-bottom: 0px;
	transition: transform 0.3s, box-shadow 0.3s;
	border-left: 4px solid var(--accent-color);
}

.kpi-card:hover {
	transform: translateY(-5px);
	box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

.kpi-card .card-title {
	font-size: 14px;
	margin-bottom: 10px;
}

.kpi-card .card-value {
	font-size: 20px;
	margin-bottom: 5px;
}

/* Progress bar */
.progress-container {
	margin-top: 10px;
}

.progress-label {
	display: flex;
	justify-content: space-between;
	margin-bottom: 5px;
	font-size: 14px;
}

.progress {
	height: 8px;
	border-radius: 4px;
	background-color: #f0f0f0;
}

.progress-bar {
	background-color: var(--accent-color);
	border-radius: 4px;
}

/* Badge */
.custom-badge {
	display: inline-block;
	padding: 3px 8px;
	border-radius: 12px;
	font-size: 12px;
	font-weight: 500;
}

.badge-warning {
	background-color: #fff3cd;
	color: #856404;
}

.badge-success {
	background-color: #d4edda;
	color: #155724;
}

.badge-danger {
	background-color: #f8d7da;
	color: #721c24;
}

/* Quick Actions */
.quick-action {
	background-color: white;
	border-radius: 10px;
	padding: 15px;
	margin-bottom: 10px;
	display: flex;
	align-items: center;
	box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
	transition: transform 0.3s;
	cursor: pointer;
}

.quick-action:hover {
	transform: translateY(-3px);
	box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.quick-action i {
	width: 40px;
	height: 40px;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 18px;
	border-radius: 50%;
	margin-right: 15px;
	background-color: var(--primary-color);
	color: white;
}

.quick-action-text {
	font-weight: 500;
	font-size: 14px;
}

/* Semáforo de estado */
.status-dot {
	width: 10px;
	height: 10px;
	border-radius: 50%;
	display: inline-block;
	margin-right: 5px;
}

.status-dot.green {
	background-color: #00c853;
}

.status-dot.yellow {
	background-color: #ffd600;
}

.status-dot.red {
	background-color: #ff5252;
}

/* Date range picker */
.date-range {
	display: flex;
	align-items: center;
	margin-bottom: 20px;
}

.date-range select {
	padding: 8px 15px;
	border-radius: 5px;
	border: 1px solid #ddd;
	margin-left: 10px;
	cursor: pointer;
}

@media (min-width: 992px) {
	.menu-item:hover .submenu {
		max-height: 1000px;
		/* Ajusta este valor según la altura de tu submenú */
	}

	/* Rotar la flecha del submenú al hacer hover */
	.menu-item:hover .has-submenu::after {
		transform: translateY(-50%) rotate(90deg);
	}
}

.htmx-indicator {
	display: none;
	position: fixed;
	top: 0;
	left: 0;
	font-size: 2em;
	width: 100%;
	height: 100%;
	background-color: rgba(0, 0, 0, 0.0);
	z-index: 9999;
	justify-content: center;
	align-items: center;
}

.htmx-indicator.htmx-request {
	display: flex;
}

.logout{
	color: var(--light-color);
	text-decoration: none;
}

.edt-btn{
	font-size: 1.5em;
	color: var(--accent-color);
}

.del-btn{
	font-size: 1.5em;
	color: var(--danger-color);
}

@media (max-width: 768px) {
	.custom-table thead {
		display: none;
	}

	.custom-table, 
	.custom-table tbody, 
	.custom-table tr, 
	.custom-table td {
		display: block;
		width: 100%;
	}

	.custom-table tr {
		margin-bottom: 15px;
		background-color: white;
		border-radius: 10px;
		box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
		overflow: hidden;
		border-left: 5px solid var(--accent-color); /* To match kpi-card style roughly */
	}

	.custom-table td {
		display: flex;
		justify-content: space-between;
		align-items: center;
		text-align: right;
		padding: 12px 15px;
		border-bottom: 1px solid #f0f0f0;
		min-height: 40px; /* Ensure touch targets */
	}

	.custom-table td:last-child {
		border-bottom: none;
	}

	.custom-table td::before {
		content: attr(data-label);
		font-weight: 600;
		color: var(--primary-color);
		text-align: left;
		margin-right: auto; /* Push content to right */
		padding-right: 10px;
		font-size: 0.9em;
		text-transform: uppercase;
		letter-spacing: 0.5px;
	}
	
	/* Adjust specific elements if needed inside the cells */
	.custom-table td .badge {
		font-size: 0.85em; /* Slightly larger on mobile for readability */
	}
}