#map { height: 600px; border-radius: 8px; }

/* Tablas */
.table {
	margin-bottom: 0;
	font-size: 12px;
}
.table thead th {
	background: linear-gradient(135deg, #003366 0%, #004080 100%);
	color: white;
	font-weight: 600;
	border: none;
	padding: 9px 8px;
	text-align: left;
	letter-spacing: 0.3px;
	text-transform: uppercase;
	font-size: 11px;
}
.table tbody td {
	padding: 8px 8px;
	border-bottom: 1px solid #f0f1f3;
	vertical-align: middle;
	color: #374151;
}
.table tbody tr {
	transition: all 0.2s ease;
}
.table tbody tr:hover {
	background-color: #f0f9ff;
	box-shadow: inset 3px 0 0 #0ea5e9;
}
.table tbody tr:nth-child(even) {
	background-color: #fafbfc;
}
.table tbody tr:nth-child(even):hover {
	background-color: #f0f9ff;
}
.table-responsive {
	flex-grow: 1;
	overflow-y: auto;
	overflow-x: hidden;
	border-radius: 0 0 8px 8px;
}
.table-responsive::-webkit-scrollbar {
	width: 8px;
}
.table-responsive::-webkit-scrollbar-track {
	background: #f1f1f1;
	border-radius: 6px;
}
.table-responsive::-webkit-scrollbar-thumb {
	background: #9ca3af;
	border-radius: 6px;
}
.table-responsive::-webkit-scrollbar-thumb:hover {
	background: #6b7280;
}

/* Alineación números */
.text-end {
	text-align: right !important;
}

/* Modal nudo */
.nudo-modal { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; padding: 20px; background: rgba(0, 0, 0, 0.55); z-index: 1060; justify-content: center; align-items: center; }
.nudo-modal.active { display: flex; }
.nudo-modal-content { background: #fff; color: #1e293b; border-radius: 12px; width: min(980px, 95vw); border: 2px solid #003366; box-shadow: 0 24px 50px rgba(15, 23, 42, 0.35); overflow: hidden; }
.nudo-modal-header { display: flex; justify-content: space-between; align-items: center; padding: 12px 20px; background: #003366; color: white; }
.nudo-modal-header h6 { color: #fff !important; }
.nudo-modal-body { padding: 16px 20px 20px; overflow: hidden; }
.nudo-modal-grid { display: grid; grid-template-columns: 1.05fr 1fr; gap: 16px; margin-bottom: 12px; }
.nudo-modal-map { width: 100%; height: 210px; object-fit: cover; border-radius: 8px; border: 1px solid #d1d5db; }
.nudo-meta-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 12px; margin-top: 10px; font-size: 12px; }
.nudo-meta-item { background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 6px; padding: 7px 8px; }
.nudo-meta-label { display: block; color: #64748b; font-size: 11px; margin-bottom: 2px; }
.nudo-meta-value { color: #0f172a; font-weight: 600; }
.nudo-kpi-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.nudo-kpi { border: 1px solid #e2e8f0; border-radius: 8px; padding: 8px; background: #f8fafc; }
.nudo-kpi-label { color: #64748b; font-size: 11px; margin-bottom: 2px; }
.nudo-kpi-value { font-size: 17px; font-weight: 700; line-height: 1.15; }
.nudo-kpi-gen { color: #16a34a; }
.nudo-kpi-alm { color: #2563eb; }
.nudo-detail-table { width: 100%; border-collapse: collapse; font-size: 12px; margin-bottom: 8px; }
.nudo-detail-table th, .nudo-detail-table td { border: 1px solid #dbe2ea; padding: 7px 8px; text-align: center; }
.nudo-detail-table th { background: #eff6ff; color: #1e3a8a; font-weight: 700; }
.nudo-detail-table td:first-child { text-align: left; font-weight: 600; color: #334155; background: #f8fafc; }
.nudo-chart-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.nudo-chart-card { border: 1px solid #e2e8f0; border-radius: 8px; background: #f8fafc; padding: 8px; }
.nudo-chart-title { font-size: 12px; font-weight: 700; margin-bottom: 6px; }
.nudo-chart-canvas { height: 190px; }
@media (max-width: 992px) {
	.nudo-modal { padding: 10px; }
	.nudo-modal-content { width: 100%; }
	.nudo-modal-grid { grid-template-columns: 1fr; gap: 12px; }
	.nudo-modal-map { height: 180px; }
	.nudo-meta-grid { grid-template-columns: 1fr 1fr; }
	.nudo-chart-grid { grid-template-columns: 1fr; }
}
.nudo-table { width: 100%; font-size: 13px; border-collapse: collapse; margin-bottom: 10px; }
.nudo-table th, .nudo-table td { padding: 6px 8px; text-align: center; border: 1px solid #003366; }
.nudo-table th { background: #003366; color: white; font-weight: 600; }

/* Google Maps InfoWindow adjustments */
.gm-style-iw-c { padding: 0 !important; }
.gm-style-iw-d { overflow: auto !important; max-height: 76vh !important; }
.gm-style-iw-tc { display: none; }

/* Tabla modal con cabecera/columna fija */
#tablaNudosModalWrapper { overflow-x: auto; overflow-y: auto; max-height: calc(75vh - 120px); }
#tablaNudosModalTable { border-collapse: separate; border-spacing: 0; margin-bottom: 0 !important; }
#tablaNudosModalTable thead th { position: sticky !important; top: 0; z-index: 9 !important; background: linear-gradient(135deg, #003366 0%, #004080 100%) !important; color: white !important; box-shadow: 0 2px 4px rgba(0,0,0,0.1); font-weight: 600; }
#tablaNudosModalTable thead th:first-child, #tablaNudosModalTable tbody td:first-child { position: sticky !important; left: 0; z-index: 10 !important; box-shadow: 2px 0 5px rgba(0,0,0,0.15); }
#tablaNudosModalTable thead th:first-child { z-index: 12 !important; background: linear-gradient(135deg, #003366 0%, #004080 100%) !important; color: white !important; }
#tablaNudosModalTable tbody td:first-child { background-color: #ffffff !important; font-weight: 500; }
#tablaNudosModalTable tbody tr:hover td:first-child { background-color: #f0f9ff !important; }
#tablaNudosModalTable tbody tr:nth-of-type(even) td:first-child { background-color: #fafbfc !important; }
#tablaNudosModalTable tbody tr:nth-of-type(even):hover td:first-child { background-color: #f0f9ff !important; }
#tablaNudosModalWrapper::-webkit-scrollbar { width: 10px; height: 10px; }
#tablaNudosModalWrapper::-webkit-scrollbar-track { background: #f1f1f1; border-radius: 6px; }
#tablaNudosModalWrapper::-webkit-scrollbar-thumb { background: #003366; border-radius: 6px; }
#tablaNudosModalWrapper::-webkit-scrollbar-thumb:hover { background: #00509e; }

#tablaAlertas tbody tr { cursor: pointer; }

/* Tabs en cabecera de tabla */
.tabla-tabs { display: flex; gap: 0; border-bottom: 2px solid #003366; margin: 0; padding: 0; list-style: none; background: #f8f9fa; }
.tabla-tabs li { margin: 0; }
.tabla-tabs li a { display: block; padding: 10px 18px; cursor: pointer; font-size: 13px; font-weight: 600; color: #6b7280; text-decoration: none; border-bottom: 3px solid transparent; transition: all 0.2s; }
.tabla-tabs li a:hover { color: #003366; background: #e8f0fe; }
.tabla-tabs li a.active { color: #003366; border-bottom-color: #003366; background: white; }

/* Dual-color GEN/ALM cells */
.cell-dual { display: flex; flex-direction: column; gap: 1px; line-height: 1.4; }
.val-gen { color: #16a34a; font-weight: 600; font-size: 11px; }
.val-alm { color: #2563eb; font-weight: 600; font-size: 11px; }

.increment-pos { color: #16a34a; }
.increment-neg { color: #dc3545; }
.btn-eye { background: none; border: none; color: #003366; cursor: pointer; padding: 2px 6px; font-size: 14px; opacity: 0.7; transition: opacity 0.2s; }
.btn-eye:hover { opacity: 1; }

/* Legend inline */
.legend-inline { display: flex; gap: 16px; align-items: center; font-size: 11px; padding: 6px 12px; border-top: 1px solid #f0f1f3; background: #fafbfc; }
.legend-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 4px; vertical-align: middle; }
.legend-toggle { display: inline-flex; align-items: center; cursor: pointer; user-select: none; border-radius: 999px; padding: 2px 6px; transition: opacity 0.15s ease, background-color 0.15s ease; color: #0d6efd; text-decoration: underline; text-underline-offset: 2px; }
.legend-toggle:hover { background: rgba(0, 51, 102, 0.06); }
.legend-toggle.is-off { opacity: 0.45; text-decoration: line-through; }
.series-scope-group { display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.series-scope-btn {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	border: 1px solid #cbd5e1;
	background: #fff;
	color: #334155;
	border-radius: 999px;
	font-size: 12px;
	padding: 3px 10px;
	line-height: 1.2;
	cursor: pointer;
	transition: all 0.15s ease;
}
.series-scope-btn:hover { border-color: #94a3b8; background: #f8fafc; }
.series-scope-btn.is-active {
	background: #e8f1ff;
	color: #1d4ed8;
	border-color: #bfd7ff;
	box-shadow: inset 0 0 0 1px rgba(29, 78, 216, 0.15);
}

#tablaPrincipal thead {
	display: none;
}
#tablaPrincipal tbody.tabla-nudos-cards {
	display: flex;
	flex-direction: column;
	gap: 10px;
	padding: 12px 16px 14px;
}
#tablaPrincipal tbody.tabla-nudos-cards tr {
	display: block;
	width: 100%;
	background-color: transparent !important;
	box-shadow: none !important;
}
#tablaPrincipal tbody.tabla-nudos-cards tr:hover {
	background-color: transparent !important;
	box-shadow: none !important;
}
#tablaPrincipal tbody.tabla-nudos-cards td {
	display: block;
	border: none !important;
	padding: 0 !important;
}

/* Subtítulo bajo pestañas */
.tab-subtitle { font-size: 12px; color: #6b7280; padding: 6px 14px; background: #f8f9fa; border-bottom: 1px solid #e5e7eb; }

/* Filtros */
.filtros-bar { display: flex; align-items: center; gap: 8px; padding: 8px 12px; background: #f8f9fa; border-bottom: 1px solid #e5e7eb; flex-wrap: wrap; }
.filtro-tag { display: inline-flex; align-items: center; background: #e9ecef; border: 1px solid #ced4da; border-radius: 4px; padding: 3px 8px; font-size: 11px; gap: 5px; height: 28px; }
.filtro-tag { cursor: default; }
.filtro-tag:hover { background: #dde3e9; }
.filtro-tag .filtro-campo { color: #6c757d; font-weight: 500; }
.filtro-tag .filtro-valor { color: #212529; }
.filtro-tag .filtro-cerrar { cursor: pointer; color: #6c757d; font-size: 13px; line-height: 1; }
.filtro-tag .filtro-cerrar:hover { color: #dc3545; }
#filter-range-rango-container .form-range {
	pointer-events: none;
	background: transparent;
	-webkit-appearance: none;
	appearance: none;
}
#filter-range-rango-container .form-range::-webkit-slider-runnable-track {
	height: 6px;
	background: transparent;
	border: 0;
}
#filter-range-rango-container .form-range::-webkit-slider-thumb {
	-webkit-appearance: none;
	appearance: none;
	pointer-events: auto;
	cursor: pointer;
	width: 16px;
	height: 16px;
	border-radius: 50%;
	border: 2px solid #ffffff;
	background: #2563eb;
	box-shadow: 0 0 0 1px rgba(37, 99, 235, 0.6);
	margin-top: -5px;
}
#filter-range-rango-container .form-range::-moz-range-track {
	height: 6px;
	background: transparent;
	border: 0;
}
#filter-range-rango-container .form-range::-moz-range-thumb {
	pointer-events: auto;
	cursor: pointer;
	width: 16px;
	height: 16px;
	border-radius: 50%;
	border: 2px solid #ffffff;
	background: #2563eb;
	box-shadow: 0 0 0 1px rgba(37, 99, 235, 0.6);
}

/* Favoritos */
.btn-fav { background: none; border: none; cursor: pointer; padding: 2px 4px; font-size: 14px; color: #d1d5db; transition: color 0.2s; }
.btn-fav:hover { color: #f59e0b; }
.btn-fav.active { color: #f59e0b; }

#addFilterBtn {
	height: 28px;
	display: flex;
	align-items: center;
	font-size: 11px;
}
#addFilterBtn .filtros-chevron {
	font-size: 10px;
	transition: transform 0.25s ease;
}
#addFilterBtn.is-active {
	background: #e9ecef;
	border-color: #adb5bd;
}
#addFilterBtn.is-active .filtros-chevron {
	transform: rotate(180deg);
}
#filter-select-ccaa, #filter-select-prelacion, #filter-select-motivo { font-size: 12px; }
.filtros-accordion {
	border-bottom: 1px solid transparent;
	background: #f5f7fb;
	flex-shrink: 0;
}
.filtros-accordion.show,
.filtros-accordion.collapsing {
	border-bottom-color: #e5e7eb;
}
.filtros-accordion-inner {
	padding: 12px;
	max-height: 45vh;
	overflow-y: auto;
}
.filtros-accordion-footer {
	display: flex;
	justify-content: flex-end;
	gap: 8px;
	margin-top: 12px;
	padding-top: 10px;
	border-top: 1px solid #e2e8f0;
}
.filtros-layout {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 12px;
	align-items: start;
}
.filtro-section {
	background: #ffffff;
	border: 1px solid #e2e8f0;
	border-radius: 12px;
	padding: 12px;
}
.filtro-section.is-wide { grid-column: 1 / -1; }
.filtro-section .section-title {
	font-size: 11px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	color: #475569;
	margin-bottom: 8px;
}
.filtros-accordion .form-label {
	font-size: 11px;
	font-weight: 700;
	text-transform: uppercase;
	color: #64748b;
	margin-bottom: 5px;
}
.filtros-accordion .form-select {
	border-color: #cbd5e1;
	border-radius: 10px;
	min-height: 36px;
	background-color: #fff;
}
.filtros-accordion .form-select:focus,
.filtros-accordion .form-check-input:focus {
	border-color: #94a3b8;
	box-shadow: 0 0 0 0.16rem rgba(30, 64, 175, 0.12);
}
.filtros-rango-wrap { display:flex; flex-direction:column; gap:10px; }
.filtros-rango-track {
	position: relative;
	height: 28px;
}
.filtros-rango-track .track-bg {
	position: absolute;
	left: 0;
	right: 0;
	top: 50%;
	height: 6px;
	transform: translateY(-50%);
	background: #d1d5db;
	border-radius: 999px;
}
.filtros-rango-track .track-center {
	position: absolute;
	left: 50%;
	top: 5px;
	bottom: 5px;
	width: 1px;
	background: #94a3b8;
}
.filtros-rango-values {
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 10px;
}
.filtros-rango-values .range-val {
	font-size: 12px;
	font-weight: 700;
	color: #1f2937;
	min-width: 78px;
}
.filtros-rango-values .range-val.right { text-align: right; }
.filtros-rango-values .range-zero { font-size: 11px; color: #64748b; }
.filtro-check-group {
	display: flex;
	flex-direction: column;
	gap: 10px;
}
.filtro-check-item {
	display: flex;
	align-items: flex-start;
	gap: 8px;
	padding: 8px 10px;
	border: 1px solid #e2e8f0;
	border-radius: 10px;
	background: #fcfdff;
}
.filtro-check-item .form-check-input { margin-top: 3px; }
.filtro-check-item .form-check-label {
	font-size: 13px;
	color: #334155;
	line-height: 1.25;
}
.filtro-section--options .filtro-check-item { padding: 7px 9px; }
.filtro-section--options .filtro-check-group { gap: 8px; }
@media (max-width: 991.98px) {
	.filtros-layout { grid-template-columns: 1fr; }
}

.map-nudo-panel {
	position: absolute;
	top: 12px;
	right: 12px;
	bottom: 12px;
	width: 340px;
	max-width: calc(100% - 24px);
	background: #fff;
	border-radius: 8px;
	box-shadow: 0 8px 24px rgba(0, 0, 0, 0.28);
	z-index: 30;
	display: none;
	flex-direction: column;
	overflow: hidden;
}
.map-nudo-panel-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 8px;
	padding: 12px 16px;
	border-bottom: 1px solid #e5e7eb;
	background: #fff;
}
.map-nudo-panel-body {
	overflow-y: auto;
	overflow-x: hidden;
	height: 100%;
	background: #fff;
}

.nudo-modal-header-actions {
	display: flex;
	align-items: center;
	gap: 8px;
}

#modalEditNudoCoords { z-index: 1090 !important; }
#modalEditNudoCoords ~ .modal-backdrop { z-index: 1085 !important; }
#editNudoCoordsMap {
	height: 280px;
	width: 100%;
	border-radius: 8px;
	border: 1px solid #dbe2ea;
}
.edit-coords-hint {
	font-size: 12px;
	color: #64748b;
	margin-top: 8px;
}





.station-card {
	position: relative;
	border: 1px solid #0d3553;
	border-radius: 12px;
	background: #f3f3f3;
	padding: 14px 36px 14px 16px;
	width: 100%;
	font-size: 0.78rem;
	cursor: pointer;
	transition: background-color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}
.station-card-chart-col {
	border-left: 1px dashed #c7c7c7;
	padding-left: 8px;
	min-height: 96px;
}
.station-card-chart-title {
	font-size: 0.62rem;
	font-weight: 700;
	color: #166534;
	text-align: center;
	margin-bottom: 2px;
	line-height: 1.15;
}
.station-card-chart-wrap {
	height: 92px;
	position: relative;
}
.station-card-chart {
	display: block;
	width: 100% !important;
	height: 100% !important;
}
.station-card-chart-empty {
	display: flex;
	align-items: center;
	justify-content: center;
	height: 92px;
	font-size: 0.65rem;
	color: #94a3b8;
	text-align: center;
	padding: 0 4px;
}
.station-card-fav {
	position: absolute;
	top: 8px;
	right: 10px;
	z-index: 2;
	font-size: 16px;
	line-height: 1;
}
.station-card-fav .bi-star-fill {
	color: #f59e0b;
}
.station-card:hover {
	background: #e8eef4;
	border-color: #1a5a8a;
	box-shadow: 0 2px 8px rgba(13, 53, 83, 0.1);
}
.station-card:active {
	background: #dde5ed;
}

	.station-card h5 {
		font-size: 0.88rem;
		margin-bottom: 0.35rem !important;
	}

	.station-card h6 {
		font-size: 0.72rem;
		margin-bottom: 0.35rem !important;
	}

	.station-card .separator {
		border-right: 1px dashed #c7c7c7;
		height: 100%;
	}

	.station-card .badge-ree {
		background: #9be07e;
		color: #111;
		font-weight: 700;
		font-size: 0.68rem;
		border-radius: 6px;
		padding: 3px 8px;
		display: inline-block;
	}

	.station-card-reserva {
		color: #111;
		font-size: 0.72rem;
		font-weight: 600;
		line-height: 1.2;
	}

	.station-card .metric-box {
		background: #e9e9e9;
		border-radius: 10px;
		padding: 3px 8px;
		display: inline-block;
		font-weight: 700;
		font-size: 0.85rem;
		line-height: 1.1;
	}

	.station-card .metric-positive {
		color: #4caf50;
	}

	.station-card .metric-warning {
		color: #f07b3f;
	}

	.station-card .metric-unit {
		color: #222;
		font-size: 0.72rem;
		font-weight: 500;
	}

	.station-card .small-label {
		font-size: 0.68rem;
		line-height: 1.2;
	}

	.station-card .small-value {
		color: #5aa34a;
		font-weight: 600;
	}

	.station-card .location {
		color: #8d8d8d;
		font-size: 0.68rem;
	}

	.station-card .state-link {
		color: #111;
		font-size: 0.78rem;
		text-decoration: none;
	}

	.station-card .state-link:hover {
		text-decoration: underline;
	}