.wsr-porteria-app {
	background: white;
	border: 2px solid #0073aa;
	border-radius: 12px;
	padding: 25px;
	max-width: 600px;
	margin: 20px auto;
	font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
	box-shadow: 0 4px 20px rgba(0,0,0,0.08);
}

.wsr-porteria-app .wsr-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	padding-bottom: 15px;
	border-bottom: 2px solid #f0f0f0;
	margin-bottom: 20px;
}

.wsr-porteria-app .wsr-header h2 {
	margin: 0;
	color: #0073aa;
	font-size: 24px;
}

.wsr-header-right {
	display: flex;
	align-items: center;
	gap: 15px;
}

.wsr-clock {
	font-size: 18px;
	color: #666;
	font-weight: 300;
}

/* Notificaciones */
.wsr-notif-btn {
	position: relative;
	background: none;
	border: 2px solid #e0e0e0;
	border-radius: 50%;
	width: 44px;
	height: 44px;
	font-size: 20px;
	cursor: pointer;
	transition: all 0.2s;
	display: flex;
	align-items: center;
	justify-content: center;
}

.wsr-notif-btn:hover {
	border-color: #0073aa;
	background: #f0f7fd;
}

.wsr-notif-btn.wsr-notif-active {
	border-color: #dc3545;
	background: #fff5f5;
	animation: wsrPulse 2s infinite;
}

.wsr-notif-btn.wsr-ringing {
	border-color: #dc3545;
	background: #fff5f5;
	animation: wsrRinging 0.5s infinite;
}

@keyframes wsrPulse {
	0%, 100% { transform: scale(1); }
	50% { transform: scale(1.05); }
}

@keyframes wsrRinging {
	0%, 100% { transform: rotate(0deg); }
	15% { transform: rotate(15deg); }
	30% { transform: rotate(-15deg); }
	45% { transform: rotate(10deg); }
	60% { transform: rotate(-10deg); }
	75% { transform: rotate(5deg); }
}

.wsr-notif-badge {
	position: absolute;
	top: -4px;
	right: -4px;
	background: #dc3545;
	color: white;
	border-radius: 50%;
	width: 20px;
	height: 20px;
	font-size: 11px;
	font-weight: bold;
	display: flex;
	align-items: center;
	justify-content: center;
	line-height: 1;
}

.wsr-notif-panel {
	background: white;
	border: 2px solid #0073aa;
	border-radius: 10px;
	margin-bottom: 15px;
	box-shadow: 0 4px 16px rgba(0,0,0,0.12);
	overflow: hidden;
}

.wsr-notif-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	padding: 12px 16px;
	background: #f0f7fd;
	border-bottom: 1px solid #e0e0e0;
}

.wsr-notif-close {
	background: none;
	border: none;
	font-size: 18px;
	cursor: pointer;
	color: #666;
	padding: 4px 8px;
	border-radius: 4px;
}

.wsr-notif-close:hover {
	background: #e0e0e0;
}

.wsr-notif-list {
	max-height: 300px;
	overflow-y: auto;
}

.wsr-notif-item {
	display: flex;
	justify-content: space-between;
	align-items: center;
	padding: 12px 16px;
	border-bottom: 1px solid #f0f0f0;
	cursor: pointer;
	transition: background 0.2s;
}

.wsr-notif-item:hover {
	background: #f0f7fd;
}

.wsr-notif-item:last-child {
	border-bottom: none;
}

.wsr-notif-item-left {
	display: flex;
	align-items: center;
	gap: 10px;
	flex: 1;
}

.wsr-notif-icon {
	font-size: 24px;
}

.wsr-notif-item-left div strong {
	display: block;
	color: #333;
	font-size: 14px;
}

.wsr-notif-preview {
	margin: 2px 0 0 0;
	color: #666;
	font-size: 12px;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	max-width: 200px;
}

.wsr-notif-item-right {
	text-align: right;
	display: flex;
	flex-direction: column;
	align-items: flex-end;
	gap: 4px;
}

.wsr-notif-count {
	background: #dc3545;
	color: white;
	border-radius: 10px;
	padding: 2px 8px;
	font-size: 11px;
	font-weight: bold;
}

.wsr-notif-item-right small {
	color: #999;
	font-size: 11px;
}

.wsr-notif-empty {
	text-align: center;
	color: #999;
	padding: 20px;
	margin: 0;
}

.wsr-tabs {
	display: flex;
	gap: 10px;
	margin-bottom: 20px;
}

.wsr-tab {
	flex: 1;
	padding: 12px;
	background: #f0f0f0;
	color: #333;
	border: none;
	border-radius: 8px;
	cursor: pointer;
	font-size: 14px;
	font-weight: 600;
	transition: all 0.2s;
}

.wsr-tab:hover { background: #e0e0e0; }
.wsr-tab.active { background: #0073aa; color: white; }

.wsr-panel { display: none !important; }
.wsr-panel.active { display: block !important; }

.wsr-porteria-app label {
	display: block;
	margin: 12px 0 6px 0;
	color: #333;
	font-weight: 600;
	font-size: 14px;
}

.wsr-porteria-app input[type="text"],
.wsr-porteria-app input[type="number"] {
	width: 100%;
	padding: 12px;
	border: 2px solid #e0e0e0;
	border-radius: 8px;
	font-size: 15px;
	box-sizing: border-box;
	transition: border-color 0.2s;
}

.wsr-porteria-app input:focus {
	outline: none;
	border-color: #0073aa;
}

.wsr-btn {
	width: 100%;
	padding: 14px;
	border: none;
	border-radius: 8px;
	cursor: pointer;
	font-size: 16px;
	font-weight: bold;
	margin-top: 15px;
	transition: transform 0.1s, box-shadow 0.2s;
}

.wsr-btn:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(0,0,0,0.15); }
.wsr-btn:active { transform: translateY(0); }

.wsr-btn-primary { background: #0073aa; color: white; }
.wsr-btn-success { background: #28a745; color: white; }
.wsr-btn-warning { background: #f5991f; color: white; }
.wsr-btn-danger { background: #dc3545; color: white; }

.wsr-result {
	margin-top: 20px;
	padding: 20px;
	border-radius: 8px;
	text-align: center;
	font-weight: bold;
	font-size: 16px;
	animation: wsrFadeIn 0.3s ease-out;
}

@keyframes wsrFadeIn {
	from { opacity: 0; transform: translateY(-10px); }
	to { opacity: 1; transform: translateY(0); }
}

.wsr-result.success {
	background: #d4edda;
	color: #155724;
	border-left: 4px solid #28a745;
}

.wsr-result.error {
	background: #f8d7da;
	color: #721c24;
	border-left: 4px solid #dc3545;
}

.wsr-chat-selector {
	display: flex;
	gap: 10px;
	margin-bottom: 15px;
}

.wsr-chat-selector input { flex: 1; padding: 10px; border: 2px solid #e0e0e0; border-radius: 8px; }
.wsr-chat-selector button { width: auto; padding: 10px 20px; margin: 0; }

/* Buscador de residentes */
.wsr-resident-search {
	flex: 1;
	position: relative;
}

.wsr-resident-search input {
	width: 100%;
	padding: 12px;
	border: 2px solid #e0e0e0;
	border-radius: 8px;
	font-size: 14px;
	box-sizing: border-box;
}

.wsr-resident-search input:focus {
	border-color: #0073aa;
	outline: none;
}

.wsr-resident-list {
	position: absolute;
	top: 100%;
	left: 0;
	right: 0;
	background: white;
	border: 2px solid #0073aa;
	border-top: none;
	border-radius: 0 0 8px 8px;
	max-height: 250px;
	overflow-y: auto;
	z-index: 100;
	box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.wsr-resident-option {
	padding: 10px 14px;
	cursor: pointer;
	border-bottom: 1px solid #f0f0f0;
	transition: background 0.15s;
}

.wsr-resident-option:last-child {
	border-bottom: none;
}

.wsr-resident-option:hover {
	background: #f0f7fd;
}

.wsr-resident-option-main {
	font-size: 14px;
	color: #333;
}

.wsr-resident-option-detail {
	display: flex;
	justify-content: space-between;
	font-size: 12px;
	color: #666;
	margin-top: 3px;
}

.wsr-resident-empty {
	padding: 15px;
	text-align: center;
	color: #999;
	font-size: 13px;
}

/* Header del chat con info del residente */
.wsr-chat-header {
	padding: 10px 15px;
	background: #f0f7fd;
	border-bottom: 1px solid #e0e0e0;
	font-size: 13px;
	color: #333;
}

.wsr-chat-box {
	border: 1px solid #e0e0e0;
	border-radius: 8px;
	overflow: hidden;
	height: 400px;
	display: flex;
	flex-direction: column;
}

.wsr-chat-messages {
	flex: 1;
	overflow-y: auto;
	padding: 15px;
	background: #f9f9f9;
}

.wsr-chat-input {
	display: flex;
	gap: 10px;
	padding: 10px;
	border-top: 1px solid #e0e0e0;
	background: white;
}

.wsr-chat-input input {
	flex: 1;
	padding: 10px;
	border: 1px solid #ddd;
	border-radius: 6px;
}

.wsr-chat-input button { width: auto; padding: 10px 20px; margin: 0; }

.wsr-chat-footer {
	padding: 8px 10px;
	border-top: 1px solid #f0f0f0;
	text-align: center;
}

/* Respuestas rápidas del portero */
.wsr-quick-responses {
	margin-top: 12px;
	padding: 15px;
	background: #f8f9fa;
	border-radius: 10px;
	border: 2px solid #0073aa;
}

.wsr-quick-responses p {
	margin: 0 0 10px 0;
	font-size: 13px;
	color: #333;
}

.wsr-quick-btns {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}

.wsr-qr-btn {
	padding: 8px 12px;
	border: none;
	border-radius: 6px;
	font-size: 12px;
	font-weight: 600;
	cursor: pointer;
	transition: all 0.2s;
}

.wsr-qr-btn:hover {
	transform: translateY(-1px);
	box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.wsr-qr-authorize {
	background: #28a745;
	color: white;
}

.wsr-qr-deny {
	background: #f8d7da;
	color: #721c24;
	border: 1px solid #f5c6cb;
}

.wsr-qr-custom {
	background: #fff3cd;
	color: #856404;
	border: 1px solid #ffc107;
}

.wsr-btn-end {
	background: none;
	border: 1px solid #dc3545;
	color: #dc3545;
	padding: 8px 16px;
	border-radius: 6px;
	cursor: pointer;
	font-size: 12px;
	font-weight: 600;
	transition: all 0.2s;
}

.wsr-btn-end:hover {
	background: #dc3545;
	color: white;
}

.wsr-chat-msg {
	margin-bottom: 10px;
}

.wsr-chat-msg.mine { text-align: right; }
.wsr-chat-msg.other { text-align: left; }

.wsr-chat-bubble {
	display: inline-block;
	padding: 10px 14px;
	border-radius: 14px;
	max-width: 75%;
	word-wrap: break-word;
	font-size: 14px;
}

.wsr-chat-msg.mine .wsr-chat-bubble {
	background: #0073aa;
	color: white;
	border-bottom-right-radius: 4px;
}

.wsr-chat-msg.other .wsr-chat-bubble {
	background: white;
	color: #333;
	border: 1px solid #e0e0e0;
	border-bottom-left-radius: 4px;
}

.wsr-chat-time {
	display: block;
	font-size: 10px;
	opacity: 0.7;
	margin-top: 4px;
	font-weight: normal;
}

.wsr-footer {
	margin-top: 20px;
	padding-top: 15px;
	border-top: 1px solid #f0f0f0;
	text-align: center;
	color: #666;
}

.wsr-error {
	background: #ffe6e6;
	color: #c00;
	padding: 20px;
	border: 1px solid #c00;
	border-radius: 8px;
	text-align: center;
}


/* Foto de paquete */
.wsr-pkg-video,
.wsr-pkg-preview {
	width: 100%;
	max-width: 250px;
	border-radius: 8px;
	border: 2px solid #e0e0e0;
	margin: 8px 0;
	display: block;
}

.wsr-pkg-foto-btns {
	display: flex;
	gap: 8px;
	margin-top: 8px;
}

.wsr-btn-foto-pkg {
	padding: 8px 14px;
	border: 1px solid #e0e0e0;
	background: #f8f9fa;
	border-radius: 6px;
	font-size: 13px;
	cursor: pointer;
	transition: all 0.2s;
}

.wsr-btn-foto-pkg:hover {
	background: #e0e0e0;
	border-color: #0073aa;
}
