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

:root {
	--midnight: #0B1120;
	--midnight-80: rgba(11,17,32,0.80);
	--midnight-12: rgba(11,17,32,0.12);
	--midnight-06: rgba(11,17,32,0.06);
	--copper-dark: #8a4e20;
	--copper-20: rgba(176,106,58,0.20);
	--copper-10: rgba(176,106,58,0.10);
	--ivory: #FAF8F4;
	--pearl: #F0EBE3;
	--copper: #B06A3A;
	--midnight-60: rgba(11,17,32,0.60);
	--light: #E8E2D9;
	--green: #16a34a;
	--green-bg: #dcfce7;
	--amber: #d97706;
	--amber-bg: #fef3c7;
	--red: #dc2626;
	--red-bg: #fee2e2;
	--blue: #2563eb;

	--topbar-h: 56px;
	--topbar-accent: #FFFFFF;
	--topbar-accent-bg: rgba(255,255,255,0.12);
	--topbar-text: rgba(255,255,255,0.86);
	--topbar-muted: rgba(255,255,255,0.72);
	--topbar-subtle: rgba(255,255,255,0.62);
	--topbar-danger: #FCA5A5;
	--radius: 10px;
	--shadow: 0 2px 12px var(--midnight-06);
	--shadow-md: 0 4px 24px var(--midnight-12);

	/* WordPress preset aliases — required by property-submit/view.css */
	--wp--preset--color--midnight: #0B1120;
	--wp--preset--color--copper:   #B06A3A;
	--wp--preset--color--ivory:    #FAF8F4;
	--wp--preset--color--pearl:    #F0EBE3;
	--wp--preset--color--light:    #E8E2D9;
	--wp--preset--font-family--vazirmatn: Vazirmatn, system-ui, sans-serif;
}

html, body {
	font-family: Vazirmatn, system-ui, sans-serif;
	font-size: 14px;
	line-height: 1.6;
	color: var(--midnight);
	background: var(--ivory);
	direction: rtl;
	min-height: 100vh;
	overflow-x: hidden;
}

body {
	display: flex;
	flex-direction: column;
}

/* ── Top bar ──────────────────────────────────────────────────────────────── */

.rap-topbar {
	height: var(--topbar-h);
	background: var(--midnight);
	color: var(--topbar-text);
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 0 20px;
	position: sticky;
	top: 0;
	z-index: 100;
	border-bottom: 1px solid rgba(255,255,255,0.07);
	flex-shrink: 0;
}

.rap-topbar__brand {
	display: flex;
	align-items: center;
	gap: 8px;
	color: var(--topbar-accent);
	font-size: 14px;
	font-weight: 700;
	text-decoration: none;
	white-space: nowrap;
	flex-shrink: 0;
}

.rap-topbar__logo {
	width: 28px;
	height: 28px;
	border-radius: 6px;
	object-fit: contain;
	display: block;
	flex-shrink: 0;
}

.rap-topbar__nav {
	display: flex;
	align-items: center;
	gap: 2px;
	flex: 1;
	padding-right: 16px;
}

.rap-nav-item {
	display: flex;
	align-items: center;
	gap: 7px;
	padding: 7px 13px;
	border-radius: 7px;
	color: var(--topbar-muted);
	text-decoration: none;
	font-size: 13px;
	font-weight: 500;
	transition: background 0.15s, color 0.15s;
	white-space: nowrap;
}

.rap-nav-item:hover {
	background: rgba(255,255,255,0.07);
	color: #fff;
}

.rap-nav-item.is-active {
	background: var(--topbar-accent-bg);
	color: var(--topbar-accent);
}

.rap-topbar__end {
	display: flex;
	align-items: center;
	gap: 14px;
	flex-shrink: 0;
}

.rap-quick-link {
	display: flex;
	align-items: center;
	gap: 6px;
	color: var(--topbar-subtle);
	text-decoration: none;
	font-size: 12.5px;
	white-space: nowrap;
	transition: color 0.15s;
}

.rap-quick-link:hover { color: rgba(255,255,255,0.80); }

.rap-topbar__user {
	display: flex;
	align-items: center;
	gap: 8px;
	padding-right: 14px;
	border-right: 1px solid rgba(255,255,255,0.10);
}

.rap-topbar__avatar {
	width: 30px;
	height: 30px;
	border-radius: 50%;
	flex-shrink: 0;
}

.rap-topbar__display-name {
	font-size: 12.5px;
	font-weight: 600;
	color: var(--topbar-text);
	white-space: nowrap;
}

.rap-topbar__logout {
	font-size: 12px;
	color: var(--topbar-subtle);
	text-decoration: none;
	transition: color 0.15s;
}

.rap-topbar__logout:hover { color: var(--topbar-danger); }

/* ── Main ─────────────────────────────────────────────────────────────────── */

.rap-main {
	flex: 1;
	display: flex;
	flex-direction: column;
	min-height: 0;
}

.rap-footer {
	padding: 16px 28px 20px;
	text-align: center;
	font-size: 12px;
	font-weight: 600;
	color: rgba(11,17,32,0.58);
}

/* ── Buttons ──────────────────────────────────────────────────────────────── */

.rap-btn {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 9px 18px;
	border-radius: 8px;
	font-family: inherit;
	font-size: 13.5px;
	font-weight: 600;
	cursor: pointer;
	border: none;
	text-decoration: none;
	transition: opacity 0.15s, transform 0.1s;
}

.rap-btn:hover { opacity: 0.88; transform: translateY(-1px); }
.rap-btn:active { transform: translateY(0); }

.rap-btn--primary   { background: var(--copper); color: #fff; }
.rap-btn--secondary { background: var(--pearl); color: var(--midnight); border: 1px solid var(--light); }

/* ── Form view ────────────────────────────────────────────────────────────── */

.rap-form-wrap {
	padding: 24px 28px 48px;
	max-width: 1100px;
	margin-inline: auto;
}

@media (min-width: 640px) {
	.rap-form-wrap { min-width: 600px; }
}

.rap-form-wrap .re-submit-wrap {
	max-width: none !important;
	min-width: 0;
	width: 100%;
	border-radius: 12px;
}

@media (max-width: 639px) {
	.rap-form-wrap {
		width: 100%;
	}
}

@media (max-width: 680px) {
	.rap-form-wrap {
		padding: 0 0 40px;
	}
	.rap-form-wrap .re-submit-wrap {
		border-radius: 0;
	}
}

/* ── Stats ────────────────────────────────────────────────────────────────── */

.rap-stats {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	gap: 16px;
	padding: 24px 28px 0;
}

.rap-stat-card {
	background: #fff;
	border: 1px solid var(--light);
	border-radius: var(--radius);
	padding: 20px 22px;
	box-shadow: var(--shadow);
	border-top: 3px solid var(--light);
	transition: box-shadow 0.2s;
}

.rap-stat-card:hover { box-shadow: var(--shadow-md); }
.rap-stat-card--green { border-top-color: var(--green); }
.rap-stat-card--amber { border-top-color: var(--amber); }
.rap-stat-card--red   { border-top-color: var(--red); }

.rap-stat-value {
	font-size: 28px;
	font-weight: 800;
	color: var(--midnight);
	line-height: 1;
	margin-bottom: 6px;
}

.rap-stat-label {
	font-size: 12.5px;
	color: var(--midnight);
	font-weight: 500;
}

/* ── Toolbar ──────────────────────────────────────────────────────────────── */

.rap-toolbar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	padding: 20px 28px 0;
}

.rap-toolbar__filters {
	display: flex;
	align-items: center;
	gap: 10px;
	flex-wrap: wrap;
}

.rap-search-wrap {
	position: relative;
}

.rap-search-wrap svg {
	position: absolute;
	right: 12px;
	top: 50%;
	transform: translateY(-50%);
	color: var(--midnight-60);
	pointer-events: none;
}

.rap-input {
	font-family: inherit;
	font-size: 13.5px;
	padding: 9px 36px 9px 14px;
	border: 1px solid var(--light);
	border-radius: 8px;
	background: #fff;
	color: var(--midnight);
	outline: none;
	width: 240px;
	transition: border-color 0.15s, box-shadow 0.15s;
}

.rap-input:focus {
	border-color: var(--copper);
	box-shadow: 0 0 0 3px var(--copper-10);
}

.rap-select {
	font-family: inherit;
	font-size: 13.5px;
	padding: 9px 36px 9px 14px;
	border: 1px solid var(--light);
	border-radius: 8px;
	background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%234A5568' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E") no-repeat right 12px center;
	color: var(--midnight);
	outline: none;
	cursor: pointer;
	appearance: none;
	-webkit-appearance: none;
	transition: border-color 0.15s;
}

.rap-select:focus { border-color: var(--copper); }

.rap-toolbar__count {
	font-size: 12.5px;
	color: var(--midnight);
	white-space: nowrap;
}

/* ── Table ────────────────────────────────────────────────────────────────── */

.rap-table-wrap {
	margin: 16px 28px 0;
	background: #fff;
	border: 1px solid var(--light);
	border-radius: var(--radius);
	box-shadow: var(--shadow);
	overflow: hidden;
}

.rap-table {
	width: 100%;
	border-collapse: collapse;
	font-size: 13.5px;
}

.rap-table thead {
	background: var(--pearl);
	border-bottom: 1px solid var(--light);
}

.rap-table th {
	padding: 12px 14px;
	text-align: right;
	font-weight: 600;
	font-size: 12.5px;
	color: var(--midnight);
	white-space: nowrap;
}

.rap-table td {
	padding: 12px 14px;
	vertical-align: middle;
	border-bottom: 1px solid var(--light);
}

.rap-table tbody tr:last-child td { border-bottom: none; }

.rap-table tbody tr:hover { background: var(--ivory); }

.rap-table tbody tr.rap-row-clickable { cursor: pointer; }

.rap-table tbody tr.is-trash { opacity: 0.65; }

/* Thumbnail cell */
.rap-thumb {
	width: 52px;
	height: 52px;
	border-radius: 6px;
	object-fit: cover;
	display: block;
	background: var(--pearl);
	flex-shrink: 0;
}

.rap-thumb-placeholder {
	width: 52px;
	height: 52px;
	border-radius: 6px;
	background: var(--pearl);
	display: flex;
	align-items: center;
	justify-content: center;
	color: var(--light);
}

/* Title cell */
.rap-title-cell { max-width: 220px; }

.rap-title-row {
	display: flex;
	align-items: center;
	gap: 6px;
	min-width: 0;
}

.rap-title-link {
	font-weight: 600;
	color: var(--midnight);
	text-decoration: none;
	flex: 1;
	min-width: 0;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	transition: color 0.15s;
}

.rap-title-link:hover { color: var(--copper); }

.rap-prop-code {
	font-size: 11.5px;
	color: var(--midnight-60);
	margin-top: 2px;
}

/* Inline featured-star button */
.rap-star-btn {
	flex-shrink: 0;
	background: none;
	border: none;
	cursor: pointer;
	padding: 3px 4px;
	border-radius: 4px;
	color: var(--midnight-60);
	display: flex;
	align-items: center;
	transition: color 0.15s, background 0.12s;
}

.rap-star-btn:hover { color: var(--copper); background: var(--copper-10); }
.rap-star-btn.is-featured { color: var(--copper); }
.rap-star-btn.is-featured:hover { color: var(--copper-dark); background: var(--copper-10); }

.rap-star-btn .star-filled { display: none; }
.rap-star-btn .star-empty  { display: block; }
.rap-star-btn.is-featured .star-filled { display: block; }
.rap-star-btn.is-featured .star-empty  { display: none; }


/* Badges */
.rap-badge {
	display: inline-block;
	padding: 3px 9px;
	border-radius: 20px;
	font-size: 11.5px;
	font-weight: 600;
	white-space: nowrap;
}

.rap-badge--publish { background: var(--green-bg); color: var(--green); }
.rap-badge--draft   { background: var(--amber-bg); color: var(--amber); }
.rap-badge--trash   { background: var(--red-bg);   color: var(--red); }
.rap-badge--sale    { background: var(--copper-20); color: var(--copper); }
.rap-badge--rent    { background: #ede9fe; color: #7c3aed; }
.rap-badge--presale { background: #e0f2fe; color: #0369a1; }

/* Dots (kebab) button */
.rap-dots-btn {
	background: none;
	border: 1px solid transparent;
	border-radius: 6px;
	cursor: pointer;
	font-size: 20px;
	line-height: 1;
	padding: 4px 10px;
	color: var(--midnight);
	transition: background 0.12s, border-color 0.12s, color 0.12s;
	display: flex;
	align-items: center;
}

.rap-dots-btn:hover {
	background: var(--pearl);
	border-color: var(--light);
	color: var(--midnight);
}

/* Dropdown menu */
.rap-dropdown {
	background: #fff;
	border: 1px solid var(--light);
	border-radius: 10px;
	box-shadow: 0 8px 32px rgba(11,17,32,0.14), 0 2px 8px rgba(11,17,32,0.06);
	padding: 6px;
	min-width: 180px;
	display: flex;
	flex-direction: column;
	gap: 2px;
}

.rap-dropdown[hidden] { display: none; }

.rap-dd-item {
	display: flex;
	align-items: center;
	gap: 9px;
	padding: 9px 12px;
	border-radius: 7px;
	font-family: inherit;
	font-size: 13px;
	font-weight: 500;
	color: var(--midnight);
	background: none;
	border: none;
	cursor: pointer;
	text-decoration: none;
	text-align: right;
	transition: background 0.12s, color 0.12s;
}

.rap-dd-item:hover                { background: var(--pearl); }
.rap-dd-item--warn:hover          { background: #fef3c7; color: var(--amber); }
.rap-dd-item--danger              { color: var(--red); }
.rap-dd-item--danger:hover        { background: var(--red-bg); }
.rap-dd-item--restore             { color: var(--green); }
.rap-dd-item--restore:hover       { background: var(--green-bg); }

.rap-dd-sep {
	height: 1px;
	background: var(--light);
	margin: 4px 0;
}

/* ── Pagination ───────────────────────────────────────────────────────────── */

.rap-pagination {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	padding: 20px 28px 32px;
}

.rap-page-btn {
	background: #fff;
	border: 1px solid var(--light);
	color: var(--midnight);
	font-family: inherit;
	font-size: 13px;
	padding: 7px 14px;
	border-radius: 7px;
	cursor: pointer;
	transition: background 0.15s, border-color 0.15s;
}

.rap-page-btn:hover { background: var(--pearl); border-color: var(--copper); }
.rap-page-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.rap-page-btn.is-current { background: var(--copper); border-color: var(--copper); color: #fff; font-weight: 700; }

.rap-page-info {
	font-size: 12.5px;
	color: var(--midnight);
	padding: 0 4px;
}

/* ── Loading & Error ──────────────────────────────────────────────────────── */

.rap-loading-row td {
	text-align: center;
	padding: 48px !important;
	color: var(--midnight);
	font-size: 14px;
}

.rap-spinner {
	width: 28px;
	height: 28px;
	border: 3px solid var(--light);
	border-top-color: var(--copper);
	border-radius: 50%;
	animation: rap-spin 0.7s linear infinite;
	display: inline-block;
	vertical-align: middle;
	margin-left: 10px;
}

@keyframes rap-spin { to { transform: rotate(360deg); } }

.rap-error {
	margin: 16px 28px 0;
	background: var(--red-bg);
	border: 1px solid var(--red);
	color: var(--red);
	padding: 12px 16px;
	border-radius: var(--radius);
	font-size: 13.5px;
}

.rap-empty-row td {
	text-align: center;
	padding: 48px !important;
	color: var(--midnight-60);
}

/* ── Responsive ───────────────────────────────────────────────────────────── */

/* Always allow horizontal scroll as safety fallback */
.rap-table-wrap { overflow-x: auto; }

@media (max-width: 1100px) {
	.rap-stats { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 960px) {
	.rap-table th:nth-child(5),
	.rap-table td:nth-child(5),
	.rap-table th:nth-child(7),
	.rap-table td:nth-child(7) { display: none; }
}

@media (max-width: 680px) {
	.rap-topbar { padding: 0 14px; gap: 6px; overflow: hidden; }
	.rap-topbar__brand span { display: none; }
	.rap-topbar__nav { padding-right: 4px; }
	.rap-nav-item span { display: none; }
	.rap-nav-item { padding: 7px 10px; }
	.rap-quick-link { display: none; }
	.rap-topbar__display-name { display: none; }
	.rap-stats { grid-template-columns: repeat(2, 1fr); padding: 16px; }
	.rap-toolbar {
		flex-direction: column;
		align-items: stretch;
		padding: 12px 16px 0;
		gap: 10px;
	}
	.rap-toolbar__filters {
		display: grid;
		grid-template-columns: 1fr 1fr;
		grid-template-rows: auto auto;
		gap: 8px;
	}
	.rap-search-wrap { grid-column: 1 / -1; }
	.rap-input { width: 100%; }
	.rap-select { width: 100%; }
	.rap-toolbar__count { text-align: center; }
	.rap-table-wrap { margin: 12px 16px 0; overflow-x: auto; }
	.rap-footer { padding: 14px 16px 18px; }
}

/* ── Mobile card layout (merged into 680px block above) ───────────────────── */

@media (max-width: 680px) {
	.rap-stat-card { padding: 14px 16px; }
	.rap-stat-value { font-size: 22px; }

	/* Convert table to card list */
	.rap-table-wrap { overflow-x: visible; }

	.rap-table,
	.rap-table tbody { display: block; width: 100%; }

	.rap-table thead { display: none; }

	.rap-table tr {
		display: flex;
		align-items: center;
		gap: 10px;
		padding: 10px 12px;
		border-bottom: 1px solid var(--light);
		position: relative;
	}

	.rap-table tr:last-child { border-bottom: none; }
	.rap-table tr.rap-loading-row,
	.rap-table tr.rap-empty-row { display: table-row; }
	.rap-table tr.rap-loading-row td,
	.rap-table tr.rap-empty-row td { display: table-cell; }

	.rap-table td {
		display: block;
		border-bottom: none;
		padding: 0;
	}

	/* Thumbnail — fixed width, no grow */
	.rap-table td:nth-child(1) {
		flex-shrink: 0;
	}

	/* Title — grows to fill */
	.rap-table td:nth-child(2) {
		flex: 1;
		min-width: 0;
	}

	.rap-title-cell { max-width: none; }
	.rap-title-link { font-size: 13px; }
	.rap-prop-code { font-size: 11px; }

	/* Status badge — shrink only */
	.rap-table td:nth-child(3) {
		flex-shrink: 0;
	}

	/* Hide: type, معامله, قیمت, زیربنا, زمین, تاریخ */
	.rap-table td:nth-child(4),
	.rap-table td:nth-child(5),
	.rap-table td:nth-child(6),
	.rap-table td:nth-child(7),
	.rap-table td:nth-child(8) { display: none; }

	/* Actions button — always visible */
	.rap-table td:nth-child(9) {
		flex-shrink: 0;
	}

	.rap-thumb { width: 44px; height: 44px; }
	.rap-thumb-placeholder { width: 44px; height: 44px; }

	/* Pagination compact */
	.rap-pagination { padding: 16px; gap: 5px; }
	.rap-page-btn { padding: 6px 10px; font-size: 12px; }
}

/* ── Toast notification ──────────────────────────────────────────────── */

.rap-toast {
	position: fixed;
	bottom: 28px;
	left: 50%;
	transform: translateX(-50%) translateY(12px);
	background: var(--midnight);
	color: #fff;
	font-size: 13.5px;
	font-weight: 500;
	padding: 10px 20px;
	border-radius: 8px;
	box-shadow: 0 4px 20px var(--midnight-12);
	opacity: 0;
	pointer-events: none;
	transition: opacity 0.22s, transform 0.22s;
	white-space: nowrap;
	z-index: 10000;
}

.rap-toast.is-visible {
	opacity: 1;
	transform: translateX(-50%) translateY(0);
}

/* ── FAB (mobile add button) ─────────────────────────────────────────── */

.rap-fab-add {
	display: none;
	position: fixed;
	bottom: 24px;
	right: 20px;
	width: 56px;
	height: 56px;
	border-radius: 50%;
	background: var(--copper);
	color: #fff;
	align-items: center;
	justify-content: center;
	box-shadow: 0 4px 20px rgba(176,106,58,0.45), 0 2px 8px rgba(11,17,32,0.18);
	text-decoration: none;
	z-index: 200;
	transition: transform 0.15s, box-shadow 0.15s;
}

.rap-fab-add:hover {
	transform: scale(1.07);
	box-shadow: 0 6px 28px rgba(176,106,58,0.55), 0 2px 8px rgba(11,17,32,0.20);
}

.rap-fab-add:active { transform: scale(0.96); }

@media (max-width: 680px) {
	.rap-fab-add { display: flex; }
}

/* ── Login page ──────────────────────────────────────────────────────── */
.re-admin-login-page {
	background: var(--midnight);
	align-items: center;
	justify-content: center;
}

.re-admin-login {
	width: 100%;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 48px 16px;
}

.re-admin-login__card {
	background: rgba(255,255,255,0.05);
	border: 1px solid rgba(176,106,58,0.25);
	border-radius: 12px;
	padding: 40px 48px;
	width: 100%;
	max-width: 380px;
	text-align: center;
}

.re-admin-login__icon { font-size: 2rem; margin-bottom: 12px; }

.re-admin-login__title {
	color: var(--wp--preset--color--ivory);
	font-size: 1.25rem;
	font-weight: 600;
	margin: 0 0 24px;
}

.re-admin-login__card .login-username,
.re-admin-login__card .login-password { margin-bottom: 16px; text-align: right; }

.re-admin-login__card label {
	display: block;
	color: var(--wp--preset--color--pearl);
	font-size: 0.875rem;
	margin-bottom: 6px;
}

.re-admin-login__card input[type="text"],
.re-admin-login__card input[type="password"] {
	width: 100%;
	padding: 10px 14px;
	background: rgba(255,255,255,0.08);
	border: 1px solid rgba(255,255,255,0.15);
	border-radius: 8px;
	color: var(--wp--preset--color--ivory);
	font-family: Vazirmatn, sans-serif;
	font-size: 1rem;
	direction: rtl;
	transition: border-color 0.2s;
}

.re-admin-login__card input[type="text"]:focus,
.re-admin-login__card input[type="password"]:focus {
	outline: none;
	border-color: var(--wp--preset--color--copper);
}

.re-admin-login__card input[type="submit"] {
	width: 100%;
	margin-top: 8px;
	padding: 12px;
	background-color: var(--wp--preset--color--copper);
	color: var(--wp--preset--color--midnight);
	border: none;
	border-radius: 8px;
	font-family: Vazirmatn, sans-serif;
	font-size: 1rem;
	font-weight: 700;
	cursor: pointer;
	transition: opacity 0.2s;
}

.re-admin-login__card input[type="submit"]:hover { opacity: 0.9; }

/* ── Settings ─────────────────────────────────────────────────────────────── */
.rap-settings-wrap { max-width: 520px; margin: 32px auto; padding: 0 16px; }
.rap-settings-card { background: #fff; border-radius: 12px; padding: 28px 28px 24px; box-shadow: 0 1px 4px rgba(11,17,32,.08); }
.rap-settings-title { font-size: 1.1rem; font-weight: 700; margin-bottom: 20px; color: var(--midnight); }
.rap-settings-group { display: flex; flex-direction: column; gap: 6px; }
.rap-settings-label { font-size: .875rem; font-weight: 600; color: var(--midnight); }
.rap-settings-hint { font-size: .8rem; color: var(--midnight-60); margin-bottom: 4px; }
.rap-settings-msg { font-size: .85rem; margin-top: 8px; }
.rap-btn-primary { background: var(--copper); color: #fff; border: none; border-radius: 8px; padding: 10px 20px; font-family: Vazirmatn, sans-serif; font-size: .9rem; font-weight: 600; cursor: pointer; transition: opacity .2s; width: fit-content; }
.rap-btn-primary:hover { opacity: .9; }
.rap-btn-primary:disabled { opacity: .6; cursor: not-allowed; }

.rap-settings-divider { border: none; border-top: 1px solid var(--light); margin: 20px 0; }
.rap-city-list { list-style: none; margin-bottom: 10px; display: flex; flex-direction: column; gap: 4px; }
.rap-city-list__empty { font-size: .8rem; color: var(--midnight-60); padding: 4px 0; }
.rap-city-list__item { display: flex; align-items: center; gap: 8px; font-size: .875rem; padding: 6px 10px; background: var(--midnight-06); border-radius: 6px; }
.rap-add-city-row { display: flex; gap: 8px; align-items: center; }

/* ── Analytics tab ────────────────────────────────────────────────────────── */

.rap-analytics-wrap {
	padding: 24px 20px 48px;
	max-width: 960px;
	margin: 0 auto;
}

.rap-analytics-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	flex-wrap: wrap;
	gap: 12px;
	margin-bottom: 24px;
}

.rap-analytics-title {
	font-size: 18px;
	font-weight: 700;
	color: var(--midnight);
}

/* Period switcher */
.rap-period-switcher {
	display: flex;
	gap: 3px;
	background: var(--pearl);
	border-radius: 8px;
	padding: 3px;
}
.rap-period-btn {
	padding: 6px 14px;
	border: none;
	background: transparent;
	border-radius: 6px;
	font-family: Vazirmatn, system-ui, sans-serif;
	font-size: 13px;
	cursor: pointer;
	color: var(--midnight-60);
	transition: background 0.15s, color 0.15s;
}
.rap-period-btn.is-active {
	background: #fff;
	color: var(--midnight);
	font-weight: 600;
	box-shadow: 0 1px 4px var(--midnight-12);
}

/* Back button */
.rap-btn-back {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 7px 14px;
	border: 1px solid var(--light);
	background: #fff;
	border-radius: 7px;
	font-family: Vazirmatn, system-ui, sans-serif;
	font-size: 13px;
	cursor: pointer;
	color: var(--midnight);
	transition: background 0.15s;
	flex-shrink: 0;
}
.rap-btn-back:hover { background: var(--pearl); }

/* Property detail header */
.rap-analytics-prop-header {
	display: flex;
	align-items: center;
	gap: 14px;
	margin-bottom: 24px;
}
.rap-analytics-prop-title {
	font-size: 16px;
	font-weight: 700;
	color: var(--midnight);
}

/* Ranking table — make rows pointer */
.rap-analytics-row { cursor: pointer; }
.rap-analytics-error { text-align: center; color: var(--red); padding: 24px !important; }

/* Series / bar charts */
.rap-analytics-series { display: flex; flex-direction: column; gap: 24px; }
.rap-analytics-empty  { color: var(--midnight-60); font-size: 14px; }
.rap-analytics-loading { display: flex; justify-content: center; padding: 40px; }

.rap-ametric {
	background: #fff;
	border: 1px solid var(--light);
	border-radius: 10px;
	padding: 16px 20px;
}
.rap-ametric__info {
	display: flex;
	justify-content: space-between;
	align-items: baseline;
	margin-bottom: 14px;
}
.rap-ametric__name  { font-size: 14px; font-weight: 600; color: var(--midnight); }
.rap-ametric__total { font-size: 13px; color: var(--midnight-60); }

/* Bar chart */
.rap-abars {
	display: flex;
	align-items: flex-end;
	gap: 3px;
	height: 80px;
	overflow-x: auto;
}
.rap-abar-wrap {
	flex: 1 0 14px;
	max-width: 48px;
	height: 100%;
	display: flex;
	align-items: flex-end;
	cursor: default;
}
.rap-abar {
	width: 100%;
	border-radius: 3px 3px 0 0;
	min-height: 2px;
	transition: opacity 0.15s;
}
.rap-abar-wrap:hover .rap-abar { opacity: 0.72; }
.rap-input--inline { flex: 1; min-width: 0; }

/* ── Overview chart ── */
.rap-overview-chart-wrap {
	background: #fff;
	border: 1px solid var(--light);
	border-radius: var(--radius);
	box-shadow: var(--shadow);
	padding: 20px 20px 16px;
	margin-bottom: 20px;
}
.rap-overview-chart-wrap[hidden] { display: none; }
.rap-overview-legend {
	display: flex;
	gap: 16px;
	flex-wrap: wrap;
	margin-bottom: 14px;
	justify-content: flex-end;
}
.rap-overview-legend__item {
	display: flex;
	align-items: center;
	gap: 6px;
	font-size: 12px;
	color: var(--midnight-60);
	font-weight: 500;
}
.rap-overview-legend__item::before {
	content: '';
	display: inline-block;
	width: 10px;
	height: 10px;
	border-radius: 2px;
	background: var(--dot);
	flex-shrink: 0;
}
.rap-overview-chart-loading {
	display: flex;
	align-items: center;
	justify-content: center;
	height: 220px;
}
#rap-overview-chart {
	width: 100% !important;
	height: 220px !important;
	display: block;
}
@media (max-width: 680px) {
	.rap-overview-chart-wrap { padding: 14px 12px 10px; margin-bottom: 14px; }
	#rap-overview-chart { height: 180px !important; }
	.rap-overview-chart-loading { height: 180px; }
}
