/* ============================================================
 * فونت ایران‌سنس
 * ============================================================ */
@font-face {
	font-family: "IRANSansWeb";
	src: url("../fonts/IRANSansWeb.woff2") format("woff2");
	font-weight: normal;
	font-style: normal;
	font-display: swap;
}

/* ============================================================
 * پالت رنگی افزونه: مشکی، آبی، سفید، طلایی — بدون قرمز
 * ============================================================ */
:root {
	--tb-black: #14161c;
	--tb-blue: #1e4fd8;
	--tb-blue-dark: #163ba8;
	--tb-white: #ffffff;
	--tb-gold: #FFD700;
	--tb-border: #e2e5ec;
	--tb-bg: #f7f8fb;
	--tb-text: #14161c;
	--tb-muted: #7c8393;
}

.tb-taxi-wrap {
	font-family: "IRANSansWeb", Tahoma, sans-serif;
	color: var(--tb-text);
	background: var(--tb-white);
	border: 1px solid var(--tb-border);
	border-radius: 14px;
	padding: 24px;
	max-width: 900px;
	margin: 0 auto;
	direction: rtl;
	text-align: right;
	box-sizing: border-box;
}
.tb-taxi-wrap * { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
.tb-admin-wrap * { -webkit-tap-highlight-color: transparent; }
button, .tb-taxi-wrap button, .tb-admin-wrap button { -webkit-tap-highlight-color: transparent; outline: none; }

.tb-tabs { display: flex; gap: 24px; border-bottom: 1px solid var(--tb-border); margin-bottom: 20px; }
.tb-tab,
.tb-tab:hover,
.tb-tab:focus,
.tb-tab:active {
	background: none !important; background-color: transparent !important; border: none !important; padding: 10px 4px; font-size: 15px; cursor: pointer;
	color: var(--tb-muted) !important; border-bottom: 2px solid transparent !important; font-family: inherit;
}
.tb-tab.active,
.tb-tab.active:hover,
.tb-tab.active:focus { color: var(--tb-blue) !important; border-bottom: 2px solid var(--tb-gold) !important; font-weight: bold; }

.tb-row { display: flex; gap: 12px; }
.tb-row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.tb-row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; }
.tb-row-4 { display: grid; grid-template-columns: 1fr 1fr 1fr 1fr; gap: 12px; }
@media (max-width: 760px) {
	.tb-row-4, .tb-row-3, .tb-row-2 { grid-template-columns: 1fr; }
}

.tb-field label { display: block; font-size: 13px; color: var(--tb-muted); margin-bottom: 6px; }

.tb-taxi-wrap input[type="text"],
.tb-taxi-wrap input[type="email"],
.tb-textarea {
	width: 100%; padding: 12px 14px; border: 1px solid var(--tb-border); border-radius: 10px;
	background: var(--tb-bg); font-size: 14px; font-family: inherit; color: var(--tb-text);
}
.tb-textarea { min-height: 90px; resize: vertical; }
.tb-taxi-wrap input:focus, .tb-textarea:focus { outline: none; border-color: var(--tb-blue); }
.tb-taxi-wrap input:disabled { opacity: .55; cursor: not-allowed; }

/* Combobox */
.tb-combobox { position: relative; }
.tb-combobox-input { cursor: pointer; }
.tb-combobox-panel {
	position: absolute; top: calc(100% + 6px); right: 0; left: 0; z-index: 50;
	background: var(--tb-white); border: 1px solid var(--tb-border); border-radius: 10px;
	box-shadow: 0 10px 30px rgba(20,25,50,.12); padding: 8px; max-height: 280px; overflow: hidden;
	display: none; flex-direction: column;
}
.tb-combobox.open .tb-combobox-panel { display: flex; }
.tb-combobox-search {
	width: 100%; padding: 8px 10px; border: 1px solid var(--tb-border); border-radius: 8px;
	margin-bottom: 6px; font-family: inherit; font-size: 13px;
}
.tb-combobox-list { overflow-y: auto; }
.tb-combobox-option { padding: 9px 10px; border-radius: 8px; cursor: pointer; font-size: 14px; }
.tb-combobox-option:hover, .tb-combobox-option.tb-active { background: #eaf0ff; color: var(--tb-blue-dark); }
.tb-combobox-empty { padding: 10px; color: var(--tb-muted); font-size: 13px; text-align: center; }

/* Jalali date */
.tb-jalali-date-wrap { position: relative; }
.tb-jalali-calendar {
	display: none; position: absolute; top: calc(100% + 6px); right: 0; z-index: 50;
	background: var(--tb-white); border: 1px solid var(--tb-border); border-radius: 10px;
	box-shadow: 0 10px 30px rgba(20,25,50,.12); padding: 12px; width: 280px;
}
.tb-jalali-calendar.open { display: block; }
.tb-cal-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; font-weight: bold; }
.tb-cal-nav { cursor: pointer; background: var(--tb-bg); border: none; border-radius: 6px; width: 28px; height: 28px; }
.tb-cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; text-align: center; font-size: 13px; }
.tb-cal-dow { color: var(--tb-muted); font-size: 12px; padding-bottom: 4px; }
.tb-cal-day { padding: 7px 0; border-radius: 6px; cursor: pointer; }
.tb-cal-day:hover { background: #eaf0ff; }
.tb-cal-day.tb-today { border: 1px solid var(--tb-blue); }
.tb-cal-day.tb-selected { background: var(--tb-blue); color: var(--tb-white); }
.tb-cal-day.tb-empty { visibility: hidden; }

/* Buttons */
.tb-btn { padding: 13px 18px; border-radius: 10px; border: none !important; cursor: pointer; font-size: 15px; font-family: inherit; font-weight: bold; background-color: transparent; }
.tb-btn-block { flex: 1; }
.tb-btn-primary,
.tb-btn-primary:hover,
.tb-btn-primary:focus,
.tb-btn-primary:active { background: var(--tb-blue) !important; background-color: var(--tb-blue) !important; color: var(--tb-white) !important; border-color: var(--tb-blue) !important; }
.tb-btn-primary:hover,
.tb-btn-primary:focus,
.tb-btn-primary:active { background: var(--tb-blue-dark) !important; background-color: var(--tb-blue-dark) !important; }
.tb-btn-outline,
.tb-btn-outline:hover,
.tb-btn-outline:focus,
.tb-btn-outline:active { background: var(--tb-white) !important; background-color: var(--tb-white) !important; color: var(--tb-text) !important; border: 1px solid var(--tb-border) !important; }
.tb-btn-success,
.tb-btn-success:hover,
.tb-btn-success:focus,
.tb-btn-success:active { background: var(--tb-black) !important; background-color: var(--tb-black) !important; color: var(--tb-gold) !important; border-color: var(--tb-black) !important; }
.tb-btn-success:hover,
.tb-btn-success:focus,
.tb-btn-success:active { background: #2a2d38 !important; background-color: #2a2d38 !important; }
.tb-btn:disabled { opacity: .6; cursor: not-allowed; }

.tb-note { font-size: 12.5px; color: var(--tb-muted); margin-top: 10px; }

/* Toggle switch */
.tb-toggle-box { display: flex; align-items: center; gap: 10px; background: var(--tb-bg); padding: 14px; border-radius: 10px; }
.tb-switch { position: relative; display: inline-block; width: 42px; height: 24px; flex-shrink: 0; }
.tb-switch input { opacity: 0; width: 0; height: 0; }
.tb-slider { position: absolute; cursor: pointer; inset: 0; background: #ccc; border-radius: 24px; transition: .2s; }
.tb-slider::before { content: ""; position: absolute; height: 18px; width: 18px; right: 3px; bottom: 3px; background: var(--tb-white); border-radius: 50%; transition: .2s; }
.tb-switch input:checked + .tb-slider { background: var(--tb-blue); }
.tb-switch input:checked + .tb-slider::before { transform: translateX(-18px); background: var(--tb-gold); }

.tb-checkbox-row { display: flex; align-items: center; gap: 8px; font-size: 14px; cursor: pointer; }

/* Rules box */
.tb-rules-box { border: 1px solid var(--tb-border); border-radius: 12px; padding: 16px; background: var(--tb-bg); }
.tb-rules-header { font-weight: bold; margin-bottom: 12px; display: flex; align-items: center; gap: 6px; }
.tb-rules-tabs { display: flex; gap: 18px; border-bottom: 1px solid var(--tb-border); margin-bottom: 12px; }
.tb-rules-tab,
.tb-rules-tab:hover,
.tb-rules-tab:focus,
.tb-rules-tab:active { background: none !important; background-color: transparent !important; border: none !important; padding: 8px 2px; cursor: pointer; color: var(--tb-muted) !important; border-bottom: 2px solid transparent !important; font-family: inherit; font-size: 13.5px; }
.tb-rules-tab.active,
.tb-rules-tab.active:hover,
.tb-rules-tab.active:focus { color: var(--tb-blue) !important; border-bottom: 2px solid var(--tb-gold) !important; font-weight: bold; }
.tb-rules-content p { font-size: 13.5px; line-height: 2; margin: 6px 0; }
.tb-rules-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.tb-rules-table td { padding: 8px 4px; border-bottom: 1px solid var(--tb-border); }
.tb-rules-table td:last-child { color: var(--tb-black); font-weight: bold; text-align: left; }

/* Invoice */
.tb-invoice-box { border: 1px solid var(--tb-border); border-radius: 12px; padding: 18px; background: var(--tb-bg); }
.tb-invoice-box h3 { margin-top: 0; display: flex; align-items: center; justify-content: space-between; }
.tb-invoice-table { width: 100%; border-collapse: collapse; }
.tb-invoice-table td { padding: 10px 6px; border-bottom: 1px solid var(--tb-border); font-size: 14px; }
.tb-invoice-table td:last-child { text-align: left; font-weight: bold; }
.tb-invoice-total { display: flex; justify-content: space-between; align-items: center; padding: 14px 6px 4px; font-size: 17px; color: var(--tb-blue-dark); }

.tb-success-box { text-align: center; padding: 30px 10px; }
.tb-success-box .dashicons { font-size: 48px; width: 48px; height: 48px; color: var(--tb-blue); }
.tb-success-box p { font-size: 15px; margin-top: 14px; line-height: 1.9; }

.tb-error-box { margin-top: 14px; background: var(--tb-black); color: var(--tb-gold); border: 1px solid var(--tb-black); padding: 12px 14px; border-radius: 10px; font-size: 13.5px; }

.tb-field { min-width: 0; }

/* ============================================================
 * پنل مدیریت وردپرس
 * ============================================================ */
.tb-admin-wrap { direction: rtl; font-family: "IRANSansWeb", Tahoma, sans-serif; }
.tb-admin-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin: 16px 0 24px; }
.tb-admin-tab {
	padding: 9px 16px; border-radius: 8px; text-decoration: none; font-size: 13.5px;
	background: var(--tb-white); border: 1px solid var(--tb-border); color: var(--tb-text);
}
.tb-admin-tab.tb-tab-active { background: var(--tb-black); color: var(--tb-gold); border-color: var(--tb-black); }
.tb-admin-tab:hover { border-color: var(--tb-blue); color: var(--tb-blue); }
.tb-admin-tab.tb-tab-active:hover { color: var(--tb-gold); }

.tb-stat-cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-top: 10px; }
@media (max-width: 1100px) { .tb-stat-cards { grid-template-columns: repeat(2, 1fr); } }
.tb-stat-card { border-radius: 12px; padding: 22px; color: var(--tb-white); display: flex; flex-direction: column; gap: 10px; }
.tb-stat-label { font-size: 13px; opacity: .85; }
.tb-stat-value { font-size: 26px; font-weight: bold; }
.tb-stat-gold { background: var(--tb-gold); color: var(--tb-black); }
.tb-stat-blue { background: var(--tb-blue); }
.tb-stat-black { background: var(--tb-black); color: var(--tb-gold); }
.tb-stat-white { background: var(--tb-white); color: var(--tb-black); border: 1px solid var(--tb-border); }

.tb-route-form-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.tb-route-form-row input { padding: 8px 10px; border: 1px solid var(--tb-border); border-radius: 8px; }
.tb-route-form-row input[name="origin_label"],
.tb-route-form-row input[name="destination_label"] { width: 220px; }
.tb-route-form-row input[name="duration_text"] { width: 160px; }
.tb-route-form-row input[name="distance_km"],
.tb-route-form-row input[name="base_price"] { width: 140px; }

.tb-status-badge { padding: 4px 10px; border-radius: 20px; font-size: 12px; display: inline-block; }
.tb-status-new { background: var(--tb-gold); color: var(--tb-black); }
.tb-status-assigned { background: var(--tb-blue); color: var(--tb-white); }
.tb-status-completed { background: var(--tb-black); color: var(--tb-gold); }
.tb-status-cancelled { background: #eceff4; color: var(--tb-muted); }

/* ============================================================
 * لیست مسیرها با صفحه‌بندی (تعداد نمایش + شماره صفحه‌ها)
 * توجه: چون این جدول داخل پیشخوان وردپرس رندر می‌شود و بعضی پوسته‌های
 * مدیریت، استایل عمومی روی input/select/button اعمال می‌کنند (مثلا width:100%)،
 * این بخش عمداً با !important نوشته شده تا مستقل از پوسته‌ی ادمین، ثابت بماند.
 * ============================================================ */
.tb-routes-card {
	background: var(--tb-white) !important;
	border: 1px solid var(--tb-border);
	border-radius: 14px;
	overflow: hidden;
	margin-top: 14px;
}

.tb-routes-toolbar {
	display: flex !important;
	flex-flow: row wrap !important;
	align-items: center !important;
	justify-content: space-between !important;
	gap: 12px !important;
	padding: 16px 18px !important;
	background: var(--tb-bg) !important;
	border-bottom: 1px solid var(--tb-border);
}
.tb-routes-toolbar * { box-sizing: border-box !important; }

.tb-routes-search-form {
	display: flex !important;
	flex-flow: row nowrap !important;
	align-items: center !important;
	gap: 8px !important;
	flex: 1 1 320px !important;
	max-width: 420px !important;
	margin: 0 !important;
}

.tb-routes-search-box {
	position: relative !important;
	display: flex !important;
	flex: 1 1 auto !important;
	align-items: center !important;
	background: var(--tb-white) !important;
	border: 1px solid var(--tb-border) !important;
	border-radius: 8px !important;
	padding: 0 10px !important;
	min-width: 0 !important;
	height: 38px !important;
}
.tb-routes-search-box .dashicons-search { color: var(--tb-muted); font-size: 16px; flex: 0 0 auto !important; }
.tb-routes-search-box input[type="text"] {
	display: block !important;
	border: none !important; outline: none !important; box-shadow: none !important; background: transparent !important;
	padding: 0 8px !important; margin: 0 !important; flex: 1 1 auto !important; width: 100% !important;
	min-width: 0 !important; height: 36px !important; line-height: 36px !important;
	font-family: inherit !important; font-size: 13px !important;
}
.tb-routes-search-clear {
	color: var(--tb-muted); text-decoration: none; font-size: 18px; line-height: 1;
	padding: 2px 4px; border-radius: 50%; flex: 0 0 auto !important;
}
.tb-routes-search-clear:hover { color: var(--tb-black); background: var(--tb-bg); }
.tb-routes-search-form button.button {
	flex: 0 0 auto !important; width: auto !important; height: 38px !important; margin: 0 !important;
}

.tb-routes-per-page {
	display: flex !important; flex-flow: row nowrap !important; align-items: center !important;
	gap: 8px !important; flex: 0 0 auto !important; font-size: 13px; color: var(--tb-muted);
	white-space: nowrap !important; margin: 0 !important;
}
.tb-routes-per-page select {
	display: inline-block !important; width: auto !important; min-width: 70px !important; height: 38px !important;
	border: 1px solid var(--tb-border) !important; border-radius: 8px !important; padding: 0 10px !important; margin: 0 !important;
	background: var(--tb-white) !important; font-family: inherit !important; font-size: 13px !important; color: var(--tb-text) !important;
}

.tb-routes-table-wrap { overflow-x: auto; }
.tb-routes-table { width: 100%; border-collapse: collapse; }
.tb-routes-table th {
	text-align: right; font-size: 12px; color: var(--tb-muted); font-weight: 600;
	padding: 12px 16px; border-bottom: 1px solid var(--tb-border); white-space: nowrap;
}
.tb-routes-table td {
	padding: 13px 16px; border-bottom: 1px solid var(--tb-border); font-size: 13px; vertical-align: middle;
}
.tb-routes-table tbody tr:last-child td { border-bottom: none; }
.tb-routes-table tbody tr:hover { background: var(--tb-bg); }

.tb-price-tag { font-weight: 700; color: var(--tb-blue-dark); }

.tb-row-actions { display: flex !important; gap: 6px !important; flex-wrap: nowrap !important; }
.tb-row-actions .button { font-size: 12px !important; padding: 2px 10px !important; height: auto !important; line-height: 24px !important; width: auto !important; margin: 0 !important; }
.tb-btn-danger.button { border-color: var(--tb-gold); color: #8a6d00; background: #fffbea; }
.tb-btn-danger.button:hover { background: var(--tb-gold); color: var(--tb-black); }

.tb-routes-empty { text-align: center; padding: 30px 10px; color: var(--tb-muted); font-size: 13px; }

.tb-routes-footer {
	display: flex !important; flex-flow: row wrap !important; align-items: center !important;
	justify-content: space-between !important; gap: 10px !important;
	padding: 14px 18px !important; background: var(--tb-bg) !important; border-top: 1px solid var(--tb-border);
}
.tb-routes-range { font-size: 12px; color: var(--tb-muted); white-space: nowrap; }

.tb-pagination { display: flex !important; align-items: center !important; gap: 4px !important; flex-wrap: wrap !important; margin: 0 !important; padding: 0 !important; }
.tb-page-btn {
	display: inline-flex !important; align-items: center !important; justify-content: center !important;
	min-width: 32px !important; height: 32px !important; padding: 0 8px !important; border-radius: 8px !important;
	border: 1px solid var(--tb-border) !important; background: var(--tb-white) !important;
	color: var(--tb-text) !important; font-size: 12px !important; text-decoration: none !important; box-sizing: border-box !important;
	margin: 0 !important;
}
.tb-page-btn:hover { border-color: var(--tb-blue); color: var(--tb-blue); }
.tb-page-btn.tb-page-current { background: var(--tb-blue) !important; border-color: var(--tb-blue) !important; color: var(--tb-white) !important; font-weight: 700; }
.tb-page-btn.tb-page-nav { font-size: 12px !important; padding: 0 12px !important; color: var(--tb-muted) !important; }
.tb-page-btn.disabled { opacity: .4; pointer-events: none; }
.tb-page-dots { padding: 0 4px; color: var(--tb-muted); font-size: 12px; }

@media (max-width: 900px) {
	.tb-routes-toolbar { flex-direction: column !important; align-items: stretch !important; }
	.tb-routes-search-form { max-width: none !important; flex: 1 1 auto !important; }
	.tb-routes-per-page { justify-content: space-between !important; }
}

@media (max-width: 600px) {
	.tb-routes-search-form { flex-direction: column !important; align-items: stretch !important; }
	.tb-routes-search-form button.button { width: 100% !important; }

	.tb-routes-table thead { display: none; }
	.tb-routes-table, .tb-routes-table tbody, .tb-routes-table tr, .tb-routes-table td { display: block; width: 100%; }
	.tb-routes-table tr { border-bottom: 1px solid var(--tb-border); padding: 10px 0; }
	.tb-routes-table td {
		border-bottom: none; padding: 6px 16px; display: flex; justify-content: space-between; gap: 10px; text-align: left;
	}
	.tb-routes-table td::before {
		content: attr(data-label); color: var(--tb-muted); font-size: 12px; flex-shrink: 0;
	}
	.tb-routes-footer { flex-direction: column; align-items: stretch; text-align: center; }
	.tb-pagination { justify-content: center; }
}

.tb-repeater th, .tb-repeater td { padding: 8px; }
