/* ==========================================================================
   Car Rental Booking Manager – Stylesheet
   Frontend booking form + Admin dashboard styles
   ========================================================================== */

/* --------------------------------------------------------------------------
   CSS Custom Properties
   -------------------------------------------------------------------------- */
:root {
	--crbm-primary:       #1a73e8;
	--crbm-primary-dark:  #1558b0;
	--crbm-success:       #1e8e3e;
	--crbm-success-light: #e6f4ea;
	--crbm-error:         #c5221f;
	--crbm-error-light:   #fce8e6;
	--crbm-warning:       #e37400;
	--crbm-border:        #dadce0;
	--crbm-bg:            #f8f9fa;
	--crbm-white:         #ffffff;
	--crbm-text:          #202124;
	--crbm-text-muted:    #5f6368;
	--crbm-radius:        8px;
	--crbm-shadow:        0 2px 12px rgba(0,0,0,.10);
	--crbm-transition:    0.2s ease;
}

/* ==========================================================================
   FRONTEND – Booking Form
   ========================================================================== */

.crbm-wrapper {
	max-width: 820px;
	margin: 40px auto;
	padding: 0 16px;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
	color: var(--crbm-text);
	box-sizing: border-box;
}

.crbm-form-title {
	font-size: 1.75rem;
	font-weight: 700;
	margin-bottom: 24px;
	color: var(--crbm-text);
	text-align: center;
}

/* ── Response Message ─────────────────────────────────────────────────── */
.crbm-msg {
	padding: 14px 18px;
	border-radius: var(--crbm-radius);
	margin-bottom: 20px;
	font-size: 0.95rem;
	line-height: 1.5;
	display: none;
}

.crbm-msg--success {
	background: var(--crbm-success-light);
	border-left: 4px solid var(--crbm-success);
	color: var(--crbm-success);
}

.crbm-msg--error {
	background: var(--crbm-error-light);
	border-left: 4px solid var(--crbm-error);
	color: var(--crbm-error);
}

/* ── Form Card ────────────────────────────────────────────────────────── */
.crbm-form {
	background: var(--crbm-white);
	border: 1px solid var(--crbm-border);
	border-radius: var(--crbm-radius);
	padding: 36px;
	box-shadow: var(--crbm-shadow);
}

/* ── Form Row ─────────────────────────────────────────────────────────── */
.crbm-form-row {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 20px;
	margin-bottom: 20px;
}

@media ( max-width: 640px ) {
	.crbm-form-row {
		grid-template-columns: 1fr;
	}

	.crbm-form {
		padding: 24px 16px;
	}
}

/* ── Form Group ───────────────────────────────────────────────────────── */
.crbm-form-group {
	display: flex;
	flex-direction: column;
	gap: 6px;
}

.crbm-form-group label {
	font-size: 0.875rem;
	font-weight: 600;
	color: var(--crbm-text-muted);
	letter-spacing: .01em;
}

.crbm-required {
	color: var(--crbm-error);
	margin-left: 2px;
}

/* ── Inputs / Select ──────────────────────────────────────────────────── */
.crbm-form-group input,
.crbm-form-group select {
	width: 100%;
	padding: 10px 14px;
	border: 1.5px solid var(--crbm-border);
	border-radius: 6px;
	font-size: 0.95rem;
	color: var(--crbm-text);
	background: var(--crbm-bg);
	transition: border-color var(--crbm-transition), box-shadow var(--crbm-transition);
	box-sizing: border-box;
	outline: none;
	appearance: none;
	-webkit-appearance: none;
}

.crbm-form-group select {
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%235f6368' stroke-width='1.8' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: right 14px center;
	padding-right: 38px;
	cursor: pointer;
}

.crbm-form-group input:focus,
.crbm-form-group select:focus {
	border-color: var(--crbm-primary);
	box-shadow: 0 0 0 3px rgba(26,115,232,.15);
	background: var(--crbm-white);
}

.crbm-form-group input::placeholder {
	color: #9aa0a6;
}

/* ── Submit Button ────────────────────────────────────────────────────── */
.crbm-form-submit {
	margin-top: 10px;
	text-align: center;
}

.crbm-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	padding: 13px 40px;
	background: var(--crbm-primary);
	color: var(--crbm-white);
	border: none;
	border-radius: 6px;
	font-size: 1rem;
	font-weight: 600;
	cursor: pointer;
	transition: background var(--crbm-transition), transform var(--crbm-transition);
	min-width: 180px;
}

.crbm-btn:hover:not(:disabled) {
	background: var(--crbm-primary-dark);
}

.crbm-btn:active:not(:disabled) {
	transform: translateY(1px);
}

.crbm-btn:disabled {
	opacity: 0.65;
	cursor: not-allowed;
}

/* ==========================================================================
   ADMIN – Dashboard Styles
   ========================================================================== */

.crbm-admin-wrap {
	max-width: 1200px;
}

/* ── Status Badges ────────────────────────────────────────────────────── */
.crbm-status-badge {
	display: inline-block;
	padding: 3px 10px;
	border-radius: 20px;
	font-size: 0.78rem;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: .05em;
}

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

.crbm-status-confirmed {
	background: var(--crbm-success-light);
	color: var(--crbm-success);
}

.crbm-status-cancelled {
	background: var(--crbm-error-light);
	color: var(--crbm-error);
}

/* ── Car Type Badges ──────────────────────────────────────────────────── */
.crbm-car-badge {
	display: inline-block;
	padding: 3px 10px;
	border-radius: 4px;
	font-size: 0.8rem;
	font-weight: 600;
}

.crbm-car-sedan   { background: #e8f0fe; color: #1a73e8; }
.crbm-car-suv     { background: #e6f4ea; color: #1e8e3e; }
.crbm-car-microbus{ background: #fef7e0; color: #e37400; }
.crbm-car-luxury  { background: #f3e8fd; color: #8430ce; }

/* ── Admin List Table Tweaks ─────────────────────────────────────────── */
.crbm-filter-wrap {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	margin-bottom: 0;
}

.crbm-filter-wrap select {
	min-width: 150px;
}

.crbm-status-select {
	font-size: 0.8rem;
	padding: 4px 6px;
	border-radius: 4px;
	border: 1px solid var(--crbm-border);
	cursor: pointer;
}

.column-status {
	min-width: 160px;
}

.column-locations,
.column-dates {
	min-width: 180px;
}

/* ── Detail Page ──────────────────────────────────────────────────────── */
.crbm-detail-wrap h1 {
	display: flex;
	align-items: center;
	gap: 12px;
	flex-wrap: wrap;
}

.crbm-back-link {
	font-size: 0.85rem;
	font-weight: 400;
	text-decoration: none;
	color: var(--crbm-primary);
	border: 1px solid var(--crbm-border);
	padding: 4px 12px;
	border-radius: 4px;
	transition: background var(--crbm-transition);
}

.crbm-back-link:hover {
	background: var(--crbm-bg);
}

.crbm-booking-id {
	font-size: 0.95rem;
	font-weight: 400;
	color: var(--crbm-text-muted);
	margin-left: auto;
}

.crbm-detail-grid {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 24px;
	margin-top: 24px;
}

.crbm-detail-card {
	background: var(--crbm-white);
	border: 1px solid var(--crbm-border);
	border-radius: var(--crbm-radius);
	padding: 24px;
	box-shadow: var(--crbm-shadow);
}

.crbm-detail-card h2 {
	margin: 0 0 16px;
	font-size: 1rem;
	font-weight: 700;
	color: var(--crbm-text-muted);
	text-transform: uppercase;
	letter-spacing: .06em;
	border-bottom: 2px solid var(--crbm-bg);
	padding-bottom: 10px;
}

.crbm-full-width {
	grid-column: 1 / -1;
}

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

.crbm-meta-table th,
.crbm-meta-table td {
	padding: 10px 0;
	border-bottom: 1px solid var(--crbm-bg);
	font-size: 0.92rem;
	vertical-align: top;
}

.crbm-meta-table tr:last-child th,
.crbm-meta-table tr:last-child td {
	border-bottom: none;
}

.crbm-meta-table th {
	width: 42%;
	color: var(--crbm-text-muted);
	font-weight: 600;
	padding-right: 12px;
}

.crbm-meta-table td {
	color: var(--crbm-text);
}

@media ( max-width: 900px ) {
	.crbm-detail-grid {
		grid-template-columns: 1fr;
	}

	.crbm-full-width {
		grid-column: 1;
	}
}
