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

body {
	font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
	background: #f8fafc;
	min-height: 100vh;
	padding: 16px;
	font-size: 14px;
	color: #1e293b;
}

.container {
	max-width: 1600px;
	margin: 0 auto;
	background: white;
	border-radius: 12px;
	box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
	overflow: hidden;
}

.header {
	background: linear-gradient(135deg, #1e293b 0%, #334155 100%);
	color: white;
	padding: 16px 24px;
}

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

.header h1 {
	font-size: 22px;
	font-weight: 600;
	letter-spacing: -0.025em;
}

.header p {
	color: #cbd5e1;
	font-size: 13px;
	font-weight: 400;
}

/* Nueva cabecera moderna */

.modern-header {
	background: linear-gradient(135deg, #2563eb 0%, #3b82f6 100%);
	color: white;
	padding: 24px;
	box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.header-content {
	max-width: 1600px;
	margin: 0 auto;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 24px;
}

.header-left {
	display: flex;
	align-items: center;
	gap: 16px;
}

.header-icon {
	background: rgba(255, 255, 255, 0.2);
	padding: 12px;
	border-radius: 12px;
	font-size: 24px;
	backdrop-filter: blur(10px);
}

.header-title h1 {
	font-size: 28px;
	font-weight: 500;
	letter-spacing: -0.02em;
	margin-bottom: 6px;
}

.header-title p {
	font-size: 15px;
	opacity: 0.9;
}

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

.header-btn {
	background: rgba(255, 255, 255, 0.15);
	border: 1px solid rgba(255, 255, 255, 0.2);
	color: white;
	padding: 8px 16px;
	border-radius: 8px;
	cursor: pointer;
	font-size: 14px;
	font-weight: 500;
	transition: all 0.2s;
	display: flex;
	align-items: center;
	gap: 8px;
	backdrop-filter: blur(10px);
}

.header-btn:hover {
	background: rgba(255, 255, 255, 0.25);
	transform: translateY(-1px);
}

/* Sección de estadísticas */
.stats-section {
	background: #f8fafc;
	padding: 24px;
	border-bottom: 1px solid #e2e8f0;
}

.controls {
	padding: 16px 24px;
	background: #f8fafc;
	border-bottom: 1px solid #e2e8f0;
	display: flex;
	gap: 12px;
	align-items: center;
	flex-wrap: wrap;
}

.stats-container {
	max-width: 1600px;
	margin: 0 auto;
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
	gap: 16px;
}

/* Tarjetas de estadísticas modernas */

.stat-card {
	background: white;
	border-radius: 16px;
	padding: 24px;
	display: flex;
	align-items: center;
	gap: 16px;
	box-shadow: 0 4px 10px rgba(0, 0, 0, 0.5);
	border: 1px solid #e5e7eb;
	transition: all 0.2s ease;
	cursor: pointer;
}

.stat-card:hover {
	transform: translateY(-4px);
	box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
}

.stat-card.critical {
	border-left: 4px solid #ef4444;
}

.stat-card.alert {
	border-left: 4px solid #f59e0b;
}

.stat-icon {
	font-size: 26px;
	width: 52px;
	height: 52px;
	display: flex;
	align-items: center;
	justify-content: center;
	background: #f1f5f9;
	border-radius: 50%;
}

.stat-content {
	flex: 1;
}

.stat-label {
	font-size: 11px;
	color: #64748b;
	font-weight: 400;
	text-transform: uppercase;
	letter-spacing: 0.5px;
	margin-bottom: 6px;
}

.stat-number {
	font-size: 22px;
	font-weight: 300;
	color: #1e293b;
}

.stats-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
	gap: 12px;
}

.stats-card {
	background: rgba(255, 255, 255, 0.1);
	border-radius: 8px;
	padding: 12px;
	backdrop-filter: blur(10px);
}

.stats-card-title {
	font-size: 11px;
	color: #cbd5e1;
	text-transform: uppercase;
	font-weight: 500;
	letter-spacing: 0.05em;
	margin-bottom: 6px;
}

.stats-card-content {
	display: flex;
	justify-content: space-between;
	align-items: center;
}

.stat-breakdown {
	display: flex;
	flex-direction: column;
	align-items: flex-end;
	font-size: 10px;
	color: #cbd5e1;
	gap: 1px;
}

.search-input,
.filter-select {
	padding: 8px 12px;
	border: 1px solid #d1d5db;
	border-radius: 6px;
	font-size: 14px;
	min-width: 140px;
	background: white;
	transition: border-color 0.2s;
}

.search-input:focus,
.filter-select:focus {
	outline: none;
	border-color: #3b82f6;
	box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.control-btn {
	padding: 8px 16px;
	color: white;
	border: none;
	border-radius: 6px;
	cursor: pointer;
	font-size: 14px;
	transition: all 0.2s;
	font-weight: 500;
	display: flex;
	align-items: center;
	gap: 6px;
}

.export-btn {
	background: #059669;
}

.clear-btn {
	background: #6b7280;
}

.alert-btn {
	background: #0ea5e9;
}

.history-btn {
	background: #7c3aed;
	position: relative;
}

.history-indicator {
	position: absolute;
	top: -4px;
	right: -4px;
	width: 8px;
	height: 8px;
	background: #ef4444;
	border-radius: 50%;
	border: 2px solid white;
}

.export-btn:hover {
	background: #047857;
}

.clear-btn:hover {
	background: #4b5563;
}

.alert-btn:hover {
	background: #0284c7;
}

.history-btn:hover {
	background: #6d28d9;
}

.room-card {
	aspect-ratio: 1;
	border: 2px solid #e5e7eb;
	border-radius: 8px;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	transition: all 0.2s ease;
	position: relative;
	font-weight: 500;
	font-size: 14px;
	padding: 8px;
}

.room-card:hover {
	transform: translateY(-2px);
	box-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
}

.room-card.libre {
	background: #f0fdf4;
	border-color: #22c55e;
	color: #16a34a;
}

.room-card.ocupada {
	background: #fef3c7;
	border-color: #f59e0b;
	color: #92400e;
}

.room-card.bloqueada {
	background: #f1f5f9;
	border-color: #64748b;
	color: #475569;
}

.room-card.leve {
	background: #eff6ff;
	border-color: #3b82f6;
	color: #2563eb;
}

.room-card.moderada {
	background: #fffbeb;
	border-color: #f59e0b;
	color: #d97706;
}

.room-card.grave {
	background: #fff7ed;
	border-color: #f97316;
	color: #ea580c;
}

.room-card.critica {
	background: #fef2f2;
	border-color: #ef4444;
	color: #dc2626;
}

.room-number {
	font-size: 18px;
	font-weight: 600;
	margin-bottom: 4px;
}

.room-status {
	font-size: 10px;
	margin-bottom: 4px;
}

.context-menu-item {
	color: #1e293b !important;
}

.room-tags {
	display: flex;
	gap: 2px;
	flex-wrap: wrap;
	justify-content: center;
	margin-top: 4px;
}

.room-tag {
	background: rgba(0, 0, 0, 0.1);
	color: currentColor;
	padding: 2px 4px;
	border-radius: 4px;
	font-size: 8px;
	font-weight: 500;
}

.guest-info {
	font-size: 9px;
	color: #6b7280;
	text-align: center;
	margin-top: 4px;
	line-height: 1.2;
}

.incident-badges {
	position: absolute;
	top: -6px;
	right: -6px;
	display: flex;
	flex-direction: column;
	gap: 2px;
}

.incident-badge {
	background: #ef4444;
	color: white;
	border-radius: 50%;
	width: 24px;
	height: 24px;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 9px;
	font-weight: 600;
	border: 2px solid white;
}

.incident-badge.leve {
	background: #3b82f6;
}

.incident-badge.moderada {
	background: #f59e0b;
	color: #000;
}

.incident-badge.grave {
	background: #f97316;
}

.incident-badge.critica {
	background: #ef4444;
}

.incident-type-icon {
	position: absolute;
	top: 4px;
	left: 4px;
	font-size: 12px;
	background: rgba(255, 255, 255, 0.9);
	border-radius: 4px;
	width: 16px;
	height: 16px;
	display: flex;
	align-items: center;
	justify-content: center;
	border: 1px solid rgba(0, 0, 0, 0.1);
}

.modal {
	display: none;
	position: fixed;
	z-index: 1000;
	left: 0;
	top: 0;
	width: 100%;
	height: 100%;
	background-color: rgba(0, 0, 0, 0.5);
	animation: fadeIn 0.3s;
}

.modal-content {
	background-color: white;
	margin: 2% auto;
	padding: 0;
	border-radius: 12px;
	width: 90%;
	max-width: 800px;
	max-height: 90vh;
	overflow: hidden;
	animation: slideIn 0.3s;
}

.modal-header {
	background: linear-gradient(135deg, #1e293b, #334155);
	color: white;
	padding: 20px 24px;
	display: flex;
	justify-content: space-between;
	align-items: center;
}

.modal-header h2 {
	margin: 0;
	font-size: 20px;
	font-weight: 600;
}

.close {
	color: white;
	font-size: 24px;
	font-weight: bold;
	cursor: pointer;
	border: none;
	background: none;
}

.close:hover {
	opacity: 0.7;
}

.modal-body {
	padding: 24px;
	max-height: 60vh;
	overflow-y: auto;
}

.modal-tabs {
	display: flex;
	border-bottom: 1px solid #e5e7eb;
	margin-bottom: 24px;
}

.modal-tab {
	padding: 12px 20px;
	background: none;
	border: none;
	border-bottom: 2px solid transparent;
	cursor: pointer;
	font-size: 14px;
	font-weight: 500;
	transition: all 0.2s;
	color: #6b7280;
}

.modal-tab.active {
	color: #1e293b;
	border-bottom-color: #3b82f6;
}

.tab-content {
	display: none;
}

.tab-content.active {
	display: block;
}

.form-grid {
	display: grid;
	gap: 16px;
}

.form-grid-2 {
	grid-template-columns: 1fr 1fr;
}

.form-grid-3 {
	grid-template-columns: 1fr 1fr 1fr;
}

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

.form-group label {
	display: block;
	margin-bottom: 6px;
	font-weight: 500;
	color: #374151;
	font-size: 13px;
}

.form-group select,
.form-group textarea,
.form-group input {
	width: 100%;
	padding: 8px 12px;
	border: 1px solid #d1d5db;
	border-radius: 6px;
	font-size: 14px;
	font-family: inherit;
	transition: border-color 0.2s;
}

.form-group select:focus,
.form-group textarea:focus,
.form-group input:focus {
	outline: none;
	border-color: #3b82f6;
	box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.form-group textarea {
	min-height: 80px;
	resize: vertical;
}

.btn {
	padding: 8px 16px;
	border: none;
	border-radius: 6px;
	cursor: pointer;
	font-size: 14px;
	font-weight: 500;
	transition: all 0.2s;
	margin-right: 8px;
	margin-bottom: 8px;
	display: inline-flex;
	align-items: center;
	gap: 6px;
}

.btn-primary {
	background: #3b82f6;
	color: white;
}

.btn-primary:hover {
	background: #2563eb;
}

.btn-secondary {
	background: #6b7280;
	color: white;
}

.btn-secondary:hover {
	background: #4b5563;
}

.btn-danger {
	background: #ef4444;
	color: white;
}

.btn-danger:hover {
	background: #dc2626;
}

.btn-success {
	background: #22c55e;
	color: white;
}

.btn-success:hover {
	background: #16a34a;
}

.btn-warning {
	background: #f59e0b;
	color: #000;
}

.btn-warning:hover {
	background: #d97706;
}

.management-alert {
	background: linear-gradient(135deg, #fbbf24, #f59e0b);
	color: #92400e;
	padding: 12px 16px;
	border-radius: 8px;
	margin-bottom: 16px;
	border-left: 4px solid #d97706;
	display: flex;
	align-items: center;
	gap: 10px;
	font-weight: 500;
}

.management-alert-content {
	flex: 1;
}

.management-alert button {
	background: white;
	color: #92400e;
	border: 1px solid #d97706;
	padding: 6px 12px;
	border-radius: 4px;
	font-size: 12px;
	font-weight: 600;
	cursor: pointer;
	transition: all 0.2s;
}

.management-alert button:hover {
	background: #fbbf24;
}

.incidents-list {
	margin-top: 16px;
}

.incident-item {
	background: #f8fafc;
	padding: 12px;
	border-left: 3px solid #3b82f6;
	margin-bottom: 8px;
	border-radius: 0 6px 6px 0;
	position: relative;
	font-size: 13px;
}

.incident-item.moderada {
	border-left-color: #f59e0b;
}

.incident-item.grave {
	border-left-color: #f97316;
}

.incident-item.critica {
	border-left-color: #ef4444;
}

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

.incident-type-tags {
	display: flex;
	gap: 6px;
	flex-wrap: wrap;
}

.incident-severity {
	font-weight: 600;
	padding: 3px 8px;
	border-radius: 4px;
	font-size: 10px;
	text-transform: uppercase;
}

.incident-severity.leve {
	background: #eff6ff;
	color: #2563eb;
}

.incident-severity.moderada {
	background: #fffbeb;
	color: #d97706;
}

.incident-severity.grave {
	background: #fff7ed;
	color: #ea580c;
}

.incident-severity.critica {
	background: #fef2f2;
	color: #dc2626;
}

.incident-type {
	background: #f1f5f9;
	color: #475569;
	padding: 3px 8px;
	border-radius: 4px;
	font-size: 10px;
	text-transform: uppercase;
}

.incident-tag {
	background: #dbeafe;
	color: #1d4ed8;
	padding: 3px 8px;
	border-radius: 12px;
	font-size: 10px;
	cursor: pointer;
	transition: background 0.2s;
}

.incident-tag:hover {
	background: #bfdbfe;
}

.tag-input-container {
	position: relative;
}

.popular-tags {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	margin-top: 8px;
}

.popular-tag {
	background: #f3f4f6;
	color: #374151;
	padding: 4px 8px;
	border-radius: 12px;
	font-size: 11px;
	cursor: pointer;
	transition: all 0.2s;
	border: 1px solid #d1d5db;
}

.popular-tag:hover {
	background: #e5e7eb;
}

.popular-tag.frequent {
	background: #dbeafe;
	color: #1d4ed8;
	border-color: #3b82f6;
}

.legend {
	display: flex;
	justify-content: center;
	gap: 20px;
	padding: 20px;
	background: #f8fafc;
	border-top: 1px solid #e5e7eb;
	flex-wrap: wrap;
}

.legend-item {
	display: flex;
	align-items: center;
	gap: 8px;
	font-size: 12px;
	font-weight: 500;
}

.legend-color {
	width: 16px;
	height: 16px;
	border-radius: 4px;
	border: 2px solid;
}

.alerts-container {
	position: fixed;
	top: 20px;
	right: 20px;
	z-index: 3000;
	max-width: 400px;
	pointer-events: none;
}

.alert-popup {
	background: white;
	border: 1px solid #e5e7eb;
	border-left: 4px solid #ef4444;
	border-radius: 8px;
	padding: 16px;
	box-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
	margin-bottom: 8px;
	animation: slideInRight 0.3s;
	pointer-events: auto;
	font-size: 14px;
}

.alert-popup.info {
	border-left-color: #0ea5e9;
}

.alert-popup.warning {
	border-left-color: #f59e0b;
}

.alert-popup.success {
	border-left-color: #22c55e;
}

.alert-popup-header {
	font-weight: 600;
	margin-bottom: 8px;
	display: flex;
	justify-content: space-between;
	align-items: center;
}

.alert-popup-close {
	background: none;
	border: none;
	font-size: 18px;
	cursor: pointer;
	color: #6b7280;
}

.active-alert {
	position: absolute;
	bottom: 4px;
	right: 4px;
	width: 8px;
	height: 8px;
	background: #ef4444;
	border-radius: 50%;
	animation: pulse 2s infinite;
}

@keyframes pulse {

	0%,
	100% {
		opacity: 1;
	}

	50% {
		opacity: 0.5;
	}
}

@keyframes fadeIn {
	from {
		opacity: 0;
	}

	to {
		opacity: 1;
	}
}

@keyframes slideIn {
	from {
		transform: translateY(-30px);
		opacity: 0;
	}

	to {
		transform: translateY(0);
		opacity: 1;
	}
}

@keyframes slideInRight {
	from {
		transform: translateX(100%);
		opacity: 0;
	}

	to {
		transform: translateX(0);
		opacity: 1;
	}
}

@media (max-width: 768px) {
	.header-top {
		flex-direction: column;
		align-items: flex-start;
		gap: 8px;
	}

	.stats-grid {
		grid-template-columns: 1fr;
	}


	.controls {
		flex-direction: column;
		align-items: stretch;
	}

	.form-grid-2,
	.form-grid-3 {
		grid-template-columns: 1fr;
	}

	.modal-content {
		width: 95%;
		margin: 5% auto;
	}
}

.main-container {
	display: flex;
	/* Forza el diseño flex */
	flex-direction: row;
	width: 100%;
	/* Asegura que ocupe todo el ancho */
	min-height: 100vh;
	/* Altura completa */
	box-sizing: border-box;
	/* Evita desbordes */
}

.content-area {
	flex: 7;
	/* 60% del espacio */
	padding: 0px;
	display: grid;

}

.rooms-grid {
	width: 100%;
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
	gap: 12px;
	max-height: 900px;
	overflow-y: auto;
	padding: 16px;
	box-sizing: border-box;
}

.agenda-panel {
	flex: 3;
	/* 40% del espacio */
	background-color: #f9fafb;
	padding: 0px;
	position: sticky;
	top: 0;
	height: 100vh;
	overflow-y: auto;
	box-sizing: border-box;
	border-left: 1px solid #e5e7eb;
}

/* Responsive */
@media (max-width: 768px) {
	.main-container {
		flex-direction: column;
	}

	.agenda-panel {
		position: static;
		height: auto;
	}
}

.agenda-header {
	background: linear-gradient(135deg, #60a5fa, #3b82f6);
	/* azul claro → azul intenso */
	color: white;
	padding: 16px;
	display: flex;
	justify-content: space-between;
	align-items: center;

}

.agenda-header h3 {
	margin: 0;
	font-size: 14px;
	font-weight: 600;
}

.agenda-nav button {
	background: rgba(255, 255, 255, 0.2);
	border: none;
	color: white;
	padding: 4px 8px;
	border-radius: 4px;
	cursor: pointer;
	margin-left: 4px;
}

.agenda-nav button:hover {
	background: rgba(255, 255, 255, 0.3);
}

.agenda-content {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
	gap: 16px;
	padding: 16px;
	flex: 1;
	overflow-y: auto;
}

.agenda-day {
	background: #f9fafb;
	border: 1px solid #e5e7eb;
	border-radius: 8px;
	padding: 12px;
}

.agenda-day h4 {
	margin-bottom: 8px;
	font-weight: 600;
	font-size: 14px;
}

/* Estilos para login y autenticación */
#loginForm {
	display: block !important;
	background: white;
	padding: 40px;
	border-radius: 12px;
	box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1);
	max-width: 400px;
	margin: 50px auto;
	text-align: center;
}

#loginForm input {
	width: 100%;
	padding: 12px;
	margin: 8px 0;
	border: 1px solid #d1d5db;
	border-radius: 6px;
	font-size: 16px;
	box-sizing: border-box;
}

#loginForm button {
	width: 100%;
	padding: 12px;
	background: #3b82f6;
	color: white;
	border: none;
	border-radius: 6px;
	font-size: 16px;
	font-weight: 500;
	cursor: pointer;
	margin-top: 16px;
}

#loginForm button:hover {
	background: #2563eb;
}

#contenido {
	display: none !important;
}

/* Ocultar elementos específicos cuando no esté autenticado */
body:not(.authenticated) .modern-header,
body:not(.authenticated) .stats-section,
body:not(.authenticated) .controls,
body:not(.authenticated) .main-container,
body:not(.authenticated) .agenda-panel,
body:not(.authenticated) .alerts-container {
	display: none !important;
}

/* Asegurar que el loginForm se vea solo cuando no está autenticado */
body.authenticated #loginForm {
	display: none !important;
}

body:not(.authenticated) #contenido {
	display: none !important;
}

.room-card[data-alert="true"] {
    border: 4px solid #ef4444 !important;
    background: #fef2f2 !important;
    animation: intense-blink 0.8s infinite;
    box-sizing: border-box !important;
    position: relative !important;
}

@keyframes intense-blink {
    0% { 
        background: #fef2f2;
        border-color: #ef4444;
        box-shadow: 0 0 0 rgba(239, 68, 68, 0);
    }
    50% { 
        background: #fee2e2;
        border-color: #dc2626;
        box-shadow: 0 0 8px rgba(239, 68, 68, 0.6);
    }
    100% { 
        background: #fef2f2;
        border-color: #ef4444;
        box-shadow: 0 0 0 rgba(239, 68, 68, 0);
    }
} 
