:root {
	--primary: #007cba;
	--primary-hover: #005a87;
	--success: #28a745;
	--danger: #dc3545;
	--warning: #ffc107;
	--info: #17a2b8;
	--gray: #6c757d;
	--light-gray: #f8f9fa;
	--border: #dee2e6;
	--text: #212529;
	--text-light: #6c757d;
	--bg: #f0f2f5;
	--card-bg: #ffffff;
	--radius: 8px;
}

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

body {
	font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
	background: var(--bg);
	color: var(--text);
	line-height: 1.6;
	min-height: 100vh;
}

/* ===== Layout ===== */

.container {
	max-width: 800px;
	margin: 0 auto;
	padding: 16px;
}

.header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	padding: 12px 16px;
	background: var(--card-bg);
	border-bottom: 1px solid var(--border);
	margin-bottom: 16px;
}

.header h1 {
	font-size: 1.2rem;
	font-weight: 600;
}

.header a {
	color: var(--primary);
	text-decoration: none;
	font-size: 0.9rem;
}

/* ===== Cards ===== */

.card {
	background: var(--card-bg);
	border-radius: var(--radius);
	padding: 24px;
	margin-bottom: 16px;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.card h2 {
	font-size: 1.1rem;
	margin-bottom: 16px;
	color: var(--text);
}

/* ===== Login Page ===== */

.login-container {
	display: flex;
	justify-content: center;
	align-items: center;
	min-height: 100vh;
	padding: 16px;
}

.login-card {
	background: var(--card-bg);
	border-radius: var(--radius);
	padding: 32px 24px;
	width: 100%;
	max-width: 360px;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
	text-align: center;
}

.login-card h1 {
	font-size: 1.4rem;
	margin-bottom: 8px;
}

.login-card p {
	color: var(--text-light);
	font-size: 0.9rem;
	margin-bottom: 24px;
}

.login-card .footer-link {
	margin-top: 16px;
	font-size: 0.85rem;
}

.login-card .footer-link a {
	color: var(--text-light);
	text-decoration: none;
}

.login-card .footer-link a:hover {
	color: var(--primary);
}

.error-msg {
	color: var(--danger);
	font-size: 0.85rem;
	margin-bottom: 12px;
}

/* ===== Forms ===== */

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

.form-group label {
	display: block;
	font-size: 0.9rem;
	font-weight: 500;
	margin-bottom: 4px;
	color: var(--text);
}

.form-group input,
.form-group select {
	width: 100%;
	padding: 10px 12px;
	border: 1px solid var(--border);
	border-radius: 6px;
	font-size: 0.95rem;
	font-family: inherit;
	transition: border-color 0.15s;
}

.form-group input:focus,
.form-group select:focus {
	outline: none;
	border-color: var(--primary);
	box-shadow: 0 0 0 3px rgba(0, 124, 186, 0.15);
}

.form-group input::placeholder {
	color: #adb5bd;
}

/* ===== Buttons ===== */

.btn {
	display: inline-block;
	padding: 10px 20px;
	border: none;
	border-radius: 6px;
	font-size: 0.95rem;
	font-weight: 500;
	cursor: pointer;
	text-decoration: none;
	text-align: center;
	transition: background-color 0.15s;
}

.btn-primary {
	background: var(--primary);
	color: #fff;
	width: 100%;
}

.btn-primary:hover {
	background: var(--primary-hover);
}

.btn-sm {
	padding: 6px 12px;
	font-size: 0.8rem;
}

.btn-success {
	background: var(--success);
	color: #fff;
}

.btn-success:hover {
	background: #218838;
}

.btn-danger {
	background: var(--danger);
	color: #fff;
}

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

.btn-warning {
	background: var(--warning);
	color: #212529;
}

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

/* ===== Status Badges ===== */

.status-badge {
	display: inline-block;
	padding: 2px 8px;
	border-radius: 4px;
	font-size: 0.8rem;
	font-weight: 500;
}

.status-pending {
	background: #fff3cd;
	color: #856404;
}

.status-processed {
	background: #cce5ff;
	color: #004085;
}

.status-completed {
	background: #d4edda;
	color: #155724;
}

.status-cancelled {
	background: #e2e3e5;
	color: #383d41;
}

/* ===== Order List ===== */

.order-list {
	list-style: none;
}

.order-item {
	display: flex;
	justify-content: space-between;
	align-items: flex-start;
	padding: 16px;
	border: 1px solid var(--border);
	border-radius: var(--radius);
	margin-bottom: 12px;
	background: var(--card-bg);
	gap: 12px;
}

.order-info {
	flex: 1;
	min-width: 0;
}

.order-info .order-header {
	display: flex;
	align-items: center;
	gap: 8px;
	margin-bottom: 4px;
}

.order-info .order-header .room-label {
	font-weight: 600;
	font-size: 0.95rem;
}

.order-info .order-detail {
	font-size: 0.85rem;
	color: var(--text-light);
	line-height: 1.5;
}

.order-actions {
	display: flex;
	flex-direction: column;
	gap: 6px;
	align-items: flex-end;
	flex-shrink: 0;
}

.order-price {
	font-weight: 600;
	font-size: 1rem;
	color: var(--danger);
	margin-bottom: 4px;
}

/* ===== Admin Table ===== */

.admin-table {
	width: 100%;
	border-collapse: collapse;
	font-size: 0.85rem;
}

.admin-table th,
.admin-table td {
	padding: 10px 8px;
	text-align: left;
	border-bottom: 1px solid var(--border);
}

.admin-table th {
	font-weight: 600;
	background: var(--light-gray);
	position: sticky;
	top: 0;
}

.admin-table td {
	vertical-align: middle;
}

/* ===== Room Selection Grid ===== */

.room-grid {
	display: grid;
	grid-template-columns: repeat(2, 1fr);
	gap: 10px;
}

.room-card {
	border: 2px solid var(--border);
	border-radius: var(--radius);
	padding: 10px;
	text-align: center;
	cursor: pointer;
	transition: border-color 0.15s, background-color 0.15s;
}

.room-card:hover {
	border-color: var(--primary);
}

.room-card.selected {
	border-color: var(--primary);
	background: rgba(0, 124, 186, 0.08);
}

.room-card img {
	width: 100%;
	height: 120px;
	object-fit: cover;
	border-radius: 4px;
	margin-bottom: 6px;
}

.room-card .room-name {
	font-size: 0.85rem;
	font-weight: 500;
}

.room-card .room-price {
	font-size: 0.8rem;
	color: var(--danger);
	margin-top: 2px;
}

.room-card input[type="radio"] {
	display: none;
}

/* ===== Nights Selector ===== */

.nights-selector {
	display: flex;
	gap: 8px;
}

.nights-option {
	flex: 1;
	padding: 10px;
	border: 2px solid var(--border);
	border-radius: 6px;
	text-align: center;
	cursor: pointer;
	font-weight: 500;
	transition: border-color 0.15s, background-color 0.15s;
}

.nights-option:hover {
	border-color: var(--primary);
}

.nights-option.selected {
	border-color: var(--primary);
	background: rgba(0, 124, 186, 0.08);
}

.nights-option input[type="radio"] {
	display: none;
}

/* ===== Modal ===== */

.modal-overlay {
	display: none;
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background: rgba(0, 0, 0, 0.5);
	z-index: 1000;
	justify-content: center;
	align-items: center;
}

.modal-overlay.active {
	display: flex;
}

.modal-content {
	background: var(--card-bg);
	border-radius: var(--radius);
	padding: 24px;
	max-width: 360px;
	width: 90%;
	text-align: center;
	box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

.modal-content h3 {
	margin-bottom: 12px;
	font-size: 1.1rem;
}

.modal-content img.qr-code-img {
	max-width: 100%;
	border-radius: 16px;
	margin-bottom: 12px;
	border: 4px solid var(--primary);
}

.modal-content .qr-price {
	font-size: 1.3rem;
	font-weight: 700;
	color: var(--danger);
	margin-bottom: 8px;
}

.modal-content .qr-info {
	font-size: 0.85rem;
	color: var(--text-light);
	margin-bottom: 16px;
}

/* ===== Section Tabs ===== */

.section-tabs {
	display: flex;
	gap: 4px;
	margin-bottom: 16px;
	flex-wrap: wrap;
}

.section-tabs a {
	padding: 6px 14px;
	border-radius: 20px;
	font-size: 0.85rem;
	text-decoration: none;
	color: var(--text);
	background: var(--light-gray);
	border: 1px solid var(--border);
}

.section-tabs a.active {
	background: var(--primary);
	color: #fff;
	border-color: var(--primary);
}

/* ===== Price Preview ===== */

.price-preview {
	font-size: 1.2rem;
	font-weight: 600;
	color: var(--danger);
	text-align: right;
	padding: 12px 0;
	border-top: 1px solid var(--border);
	margin-top: 8px;
}

/* ===== Empty State ===== */

.empty-state {
	text-align: center;
	padding: 40px 16px;
	color: var(--text-light);
}

.empty-state p {
	font-size: 0.95rem;
}

/* ===== Access Code List ===== */

.code-list-item {
	display: flex;
	justify-content: space-between;
	align-items: center;
	padding: 10px 0;
	border-bottom: 1px solid var(--border);
}

.code-list-item:last-child {
	border-bottom: none;
}

.code-list-item .code-info {
	font-size: 0.9rem;
}

.code-list-item .code-info .code-value {
	font-weight: 600;
	font-family: monospace;
	margin-right: 8px;
}

/* ===== Responsive ===== */

@media (min-width: 768px) {
	.room-grid {
		grid-template-columns: repeat(4, 1fr);
	}
}

@media (max-width: 600px) {
	.order-item {
		flex-direction: column;
	}

	.order-actions {
		flex-direction: row;
		width: 100%;
	}

	.admin-table {
		font-size: 0.75rem;
	}

	.admin-table th,
	.admin-table td {
		padding: 6px 4px;
	}
}
