/* Traffic Quality Monitor Standalone Admin Stylesheet */
:root {
	--tqm-primary: #4CAF50;
	--tqm-primary-hover: #45a049;
	--tqm-dark: #1e293b;
	--tqm-text: #334155;
	--tqm-border: #cbd5e1;
	--tqm-bg: #f8fafc;
	--tqm-card: #ffffff;
}

* {
	box-sizing: border-box;
}

body {
	margin: 0;
	padding: 0;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
	background: var(--tqm-bg);
	color: var(--tqm-text);
	font-size: 13px;
	line-height: 1.5;
}

/* Top Admin Header Bar */
.tqm-topbar {
	background: #0f172a;
	color: #f8fafc;
	height: 48px;
	display: flex;
	align-items: center;
	justify-content: space-between;
	/* Latar hitam header dibatasi 1800px, sama dengan lebar body (.wrap) */
	max-width: 1800px;
	margin: 0 auto;
	padding: 0 24px;
	position: sticky;
	top: 0;
	z-index: 9999;
	box-shadow: 0 1px 3px rgba(0,0,0,0.12);
}

.tqm-topbar-brand {
	display: flex;
	align-items: center;
	gap: 10px;
	font-size: 14px;
	font-weight: 700;
	color: #ffffff;
	text-decoration: none;
}

.tqm-topbar-brand svg {
	fill: var(--tqm-primary);
	width: 20px;
	height: 20px;
}

.tqm-topbar-badge {
	background: rgba(76, 175, 80, 0.2);
	color: #86efac;
	border: 1px solid rgba(76, 175, 80, 0.4);
	padding: 2px 8px;
	border-radius: 9999px;
	font-size: 11px;
	font-weight: 600;
}

.tqm-topbar-right {
	display: flex;
	align-items: center;
	gap: 16px;
}

.tqm-topbar-link {
	color: #94a3b8;
	text-decoration: none;
	font-size: 12px;
	transition: color 0.2s;
	display: flex;
	align-items: center;
	gap: 5px;
}

.tqm-topbar-link:hover {
	color: #ffffff;
}

.tqm-topbar-btn {
	background: #ef4444;
	color: #ffffff;
	padding: 5px 12px;
	border-radius: 4px;
	font-size: 11px;
	font-weight: 600;
	text-decoration: none;
	transition: background 0.2s;
}

.tqm-topbar-btn:hover {
	background: #dc2626;
}

/* Main Container */
.wrap {
	max-width: 1800px;
	margin: 24px auto;
	padding: 0 24px 60px 24px;
}

h1 {
	font-size: 24px;
	font-weight: 700;
	color: #0f172a;
	margin: 0 0 16px 0;
	padding: 0;
}

h2 {
	font-size: 18px;
	font-weight: 600;
	color: #1e293b;
	margin: 20px 0 12px 0;
}

h3 {
	font-size: 15px;
	font-weight: 600;
	color: #334155;
	margin: 16px 0 8px 0;
}

/* Navigation Tabs */
.tqm-nav-row {
	display: flex;
	justify-content: space-between;
	align-items: flex-end;
	border-bottom: 2px solid var(--tqm-border);
	margin-bottom: 20px;
	padding-bottom: 0;
	flex-wrap: wrap;
	gap: 12px;
}

.nav-tab-wrapper {
	border-bottom: none !important;
	margin: 0 !important;
	padding: 0 !important;
	display: flex;
	flex-wrap: wrap;
	gap: 4px;
}

.nav-tab {
	display: inline-block;
	padding: 8px 16px;
	font-size: 13px;
	font-weight: 600;
	color: #475569;
	text-decoration: none;
	background: #e2e8f0;
	border: 1px solid var(--tqm-border);
	border-bottom: none;
	border-radius: 6px 6px 0 0;
	margin-bottom: -2px;
	transition: all 0.2s ease;
}

.nav-tab:hover {
	background: #f1f5f9;
	color: #0f172a;
}

.nav-tab-active,
.nav-tab-active:hover {
	background: #ffffff !important;
	color: #0f172a !important;
	border-color: var(--tqm-border) var(--tqm-border) #ffffff !important;
	border-bottom: 2px solid #ffffff !important;
	margin-bottom: -2px !important;
}

/* Clock */
.tqm-live-clock {
	background: #ffffff;
	border: 1px solid var(--tqm-border);
	border-radius: 6px;
	padding: 6px 14px;
	font-size: 12px;
	display: flex;
	align-items: center;
	gap: 10px;
	box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

.tqm-live-clock__sep {
	color: #cbd5e1;
}

/* Notices */
.notice {
	background: #ffffff;
	border: 1px solid var(--tqm-border);
	border-left-width: 4px;
	padding: 12px 16px;
	margin: 16px 0;
	border-radius: 4px;
	box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

.notice p {
	margin: 0;
	line-height: 1.5;
}

.notice-success {
	border-left-color: #22c55e;
}

.notice-error {
	border-left-color: #ef4444;
}

.notice-warning {
	border-left-color: #f59e0b;
}

.notice-info {
	border-left-color: #3b82f6;
}

/* Buttons */
.button,
.button-secondary,
.button-primary,
button,
input[type="submit"],
input[type="button"] {
	display: inline-block;
	text-decoration: none;
	font-size: 13px;
	line-height: 2.15;
	min-height: 30px;
	margin: 0;
	padding: 0 12px;
	cursor: pointer;
	border-width: 1px;
	border-style: solid;
	border-radius: 4px;
	white-space: nowrap;
	box-sizing: border-box;
	font-weight: 500;
	transition: all 0.15s ease-in-out;
}

.button,
.button-secondary {
	color: #1e293b;
	border-color: #94a3b8;
	background: #ffffff;
}

.button:hover,
.button-secondary:hover {
	background: #f1f5f9;
	border-color: #64748b;
	color: #0f172a;
}

.button-primary {
	background: var(--tqm-primary);
	border-color: var(--tqm-primary);
	color: #ffffff;
	font-weight: 600;
}

.button-primary:hover,
.button-primary:focus {
	background: var(--tqm-primary-hover);
	border-color: var(--tqm-primary-hover);
	color: #ffffff;
}

.button-small {
	min-height: 24px;
	line-height: 2;
	padding: 0 8px;
	font-size: 11px;
}

.button-link {
	border: none;
	background: transparent;
	color: #2563eb;
	text-decoration: underline;
	padding: 0;
	min-height: auto;
	line-height: inherit;
}

/* Form Tables */
.form-table {
	border-collapse: collapse;
	margin-top: 10px;
	width: 100%;
	clear: both;
}

.form-table th {
	vertical-align: top;
	text-align: left;
	padding: 16px 10px 16px 0;
	width: 220px;
	line-height: 1.4;
	font-weight: 600;
	color: #1e293b;
}

.form-table td {
	margin-bottom: 9px;
	padding: 12px 10px;
	line-height: 1.4;
	vertical-align: middle;
}

/* Input Fields */
input[type="text"],
input[type="password"],
input[type="email"],
input[type="number"],
input[type="search"],
input[type="url"],
select,
textarea {
	border: 1px solid var(--tqm-border);
	padding: 6px 10px;
	border-radius: 4px;
	font-size: 13px;
	line-height: 1.4;
	color: #1e293b;
	background-color: #ffffff;
	box-shadow: 0 1px 2px rgba(0,0,0,0.04);
	transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

input[type="text"]:focus,
input[type="password"]:focus,
input[type="email"]:focus,
input[type="number"]:focus,
select:focus,
textarea:focus {
	border-color: var(--tqm-primary);
	box-shadow: 0 0 0 2px rgba(76, 175, 80, 0.2);
	outline: none;
}

.regular-text {
	width: 100%;
	max-width: 480px;
}

.large-text {
	width: 100%;
}

.small-text {
	width: 80px;
}

/* Data Tables */
.widefat {
	border-spacing: 0;
	width: 100%;
	clear: both;
	margin: 12px 0;
	background: #ffffff;
	border: 1px solid var(--tqm-border);
	border-radius: 6px;
	overflow: hidden;
	box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.widefat thead th,
.widefat tfoot th {
	background: #f1f5f9;
	color: #334155;
	font-weight: 600;
	text-align: left;
	padding: 10px 12px;
	border-bottom: 1px solid var(--tqm-border);
}

.widefat tfoot th {
	border-top: 1px solid var(--tqm-border);
	border-bottom: none;
}

.widefat td {
	padding: 10px 12px;
	vertical-align: middle;
	border-bottom: 1px solid #f1f5f9;
}

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

.widefat.striped tbody tr:nth-child(odd) {
	background-color: #f8fafc;
}

.widefat tbody tr:hover {
	background-color: #f1f5f9;
}

/* Tablenav & Pagination */
.tablenav {
	clear: both;
	height: 36px;
	margin: 12px 0;
	display: flex;
	justify-content: space-between;
	align-items: center;
}

.tablenav .displaying-num {
	color: #64748b;
	font-size: 12px;
}

.tablenav-pages {
	display: flex;
	gap: 4px;
	align-items: center;
}

.tablenav-pages a,
.tablenav-pages .current-page {
	padding: 4px 10px;
	border: 1px solid var(--tqm-border);
	background: #ffffff;
	border-radius: 4px;
	text-decoration: none;
	color: #334155;
	font-size: 12px;
}

.tablenav-pages a:hover {
	background: #f1f5f9;
}

/* Modal and Overlays */
.tqm-modal-overlay {
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background: rgba(15, 23, 42, 0.6);
	backdrop-filter: blur(2px);
	z-index: 10000;
	display: flex;
	align-items: center;
	justify-content: center;
}

.tqm-modal-box {
	background: #ffffff;
	border-radius: 8px;
	box-shadow: 0 10px 25px rgba(0,0,0,0.2);
	max-width: 550px;
	width: 90%;
	padding: 24px;
}

/* ---------------------------------------------------------------------------
 * Dashicons shim — ikon bawaan WordPress (tombol hapus Grup, Smartlink, dll.)
 * Font Dashicons tidak dimuat di versi standalone, jadi ikon digambar dengan
 * SVG + mask dan mengikuti warna teks (currentColor).
 * ------------------------------------------------------------------------- */
.dashicons {
	display: inline-block;
	width: 20px;
	height: 20px;
	vertical-align: middle;
	flex: none;
	background-color: currentColor;
	-webkit-mask-repeat: no-repeat;
	mask-repeat: no-repeat;
	-webkit-mask-position: center;
	mask-position: center;
	-webkit-mask-size: contain;
	mask-size: contain;
}
.dashicons-trash {
	-webkit-mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'><path d='M12 4h3c.6 0 1 .4 1 1v1H3V5c0-.6.4-1 1-1h3c.2-1.1 1.3-2 2.5-2s2.3.9 2.5 2zM8 4h3c-.2-.6-.9-1-1.5-1S8.2 3.4 8 4zM4 7h11l-.9 10.1c0 .5-.5.9-1 .9H5.9c-.5 0-.9-.4-1-.9L4 7z'/></svg>");
	mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'><path d='M12 4h3c.6 0 1 .4 1 1v1H3V5c0-.6.4-1 1-1h3c.2-1.1 1.3-2 2.5-2s2.3.9 2.5 2zM8 4h3c-.2-.6-.9-1-1.5-1S8.2 3.4 8 4zM4 7h11l-.9 10.1c0 .5-.5.9-1 .9H5.9c-.5 0-.9-.4-1-.9L4 7z'/></svg>");
}
.dashicons-no-alt {
	-webkit-mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'><path d='M14.95 6.46L11.41 10l3.54 3.54-1.41 1.41L10 11.42l-3.53 3.53-1.42-1.42L8.58 10 5.05 6.47l1.42-1.42L10 8.58l3.54-3.53z'/></svg>");
	mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'><path d='M14.95 6.46L11.41 10l3.54 3.54-1.41 1.41L10 11.42l-3.53 3.53-1.42-1.42L8.58 10 5.05 6.47l1.42-1.42L10 8.58l3.54-3.53z'/></svg>");
}
.dashicons-warning {
	-webkit-mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'><path d='M10 2c.4 0 .8.3 1 .6l7.5 13.3c.3.5.3 1.1 0 1.6-.3.4-.7.5-1.2.5H2.7c-.5 0-.9-.1-1.2-.5-.3-.5-.3-1.1 0-1.6L9 2.6c.2-.3.6-.6 1-.6zM9 7v5h2V7H9zm0 6.2v1.8h2v-1.8H9z'/></svg>");
	mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'><path d='M10 2c.4 0 .8.3 1 .6l7.5 13.3c.3.5.3 1.1 0 1.6-.3.4-.7.5-1.2.5H2.7c-.5 0-.9-.1-1.2-.5-.3-.5-.3-1.1 0-1.6L9 2.6c.2-.3.6-.6 1-.6zM9 7v5h2V7H9zm0 6.2v1.8h2v-1.8H9z'/></svg>");
}
.dashicons-shield {
	-webkit-mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'><path d='M10 2l7 3v5c0 4-3 7.2-7 8.5C6 17.2 3 14 3 10V5l7-3z'/></svg>");
	mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'><path d='M10 2l7 3v5c0 4-3 7.2-7 8.5C6 17.2 3 14 3 10V5l7-3z'/></svg>");
}
.dashicons-calendar-alt {
	-webkit-mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'><path d='M15 4h2c.6 0 1 .4 1 1v12c0 .6-.4 1-1 1H3c-.6 0-1-.4-1-1V5c0-.6.4-1 1-1h2V2h2v2h6V2h2v2zM4 8v8h12V8H4zm2 1h2v2H6V9zm3 0h2v2H9V9zm3 0h2v2h-2V9zm-6 3h2v2H6v-2zm3 0h2v2H9v-2z'/></svg>");
	mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'><path d='M15 4h2c.6 0 1 .4 1 1v12c0 .6-.4 1-1 1H3c-.6 0-1-.4-1-1V5c0-.6.4-1 1-1h2V2h2v2h6V2h2v2zM4 8v8h12V8H4zm2 1h2v2H6V9zm3 0h2v2H9V9zm3 0h2v2h-2V9zm-6 3h2v2H6v-2zm3 0h2v2H9v-2z'/></svg>");
}
.dashicons-image-rotate {
	-webkit-mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'><path d='M10 3c-2.5 0-4.8 1.3-6 3.4L2 5v5h5L5.4 8.4C6.3 6.9 8 6 10 6c2.2 0 4.1 1.3 4.9 3.2l2.8-1C16.5 5.5 13.5 3 10 3zm6 7c-.9 1.9-2.8 3.2-5 3.2-2 0-3.7-.9-4.6-2.4L8 12.4H3v5l1.9-1.4c1.2 2.1 3.5 3.4 6 3.4 3.5 0 6.5-2.5 7.7-5.8L16 10z'/></svg>");
	mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'><path d='M10 3c-2.5 0-4.8 1.3-6 3.4L2 5v5h5L5.4 8.4C6.3 6.9 8 6 10 6c2.2 0 4.1 1.3 4.9 3.2l2.8-1C16.5 5.5 13.5 3 10 3zm6 7c-.9 1.9-2.8 3.2-5 3.2-2 0-3.7-.9-4.6-2.4L8 12.4H3v5l1.9-1.4c1.2 2.1 3.5 3.4 6 3.4 3.5 0 6.5-2.5 7.7-5.8L16 10z'/></svg>");
}
.dashicons-arrow-right-alt2 {
	-webkit-mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'><path d='M6 15l5-5-5-5 1-2 7 7-7 7z'/></svg>");
	mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'><path d='M6 15l5-5-5-5 1-2 7 7-7 7z'/></svg>");
}
.dashicons-admin-page {
	-webkit-mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'><path d='M6 15V2h10v13H6zm-1 1h8v2H3V5h2v11z'/></svg>");
	mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'><path d='M6 15V2h10v13H6zm-1 1h8v2H3V5h2v11z'/></svg>");
}

/* ---------------------------------------------------------------------------
 * Gaya inti WordPress yang dipakai plugin asli tapi tidak ada di versi
 * standalone (keterangan, spinner, tombol tutup notifikasi, kotak, dll.)
 * ------------------------------------------------------------------------- */
a { color: #2271b1; }
a:hover, a:focus { color: #135e96; }

code {
	background: rgba(0,0,0,0.07);
	padding: 2px 5px 1px;
	margin: 0 1px;
	font-size: 13px;
}

.description,
p.description {
	color: #646970;
	font-size: 13px;
	font-style: normal;
	margin: 2px 0 5px;
}

.screen-reader-text {
	position: absolute;
	margin: -1px;
	padding: 0;
	height: 1px;
	width: 1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	border: 0;
	word-wrap: normal !important;
}

/* Animasi loading (Tes API, Telegram, Cek Ulang, dll.) */
.spinner {
	background: none;
	display: inline-block;
	visibility: hidden;
	float: right;
	vertical-align: middle;
	opacity: 1;
	width: 18px;
	height: 18px;
	margin: 4px 10px 0;
	border: 2px solid #cbd5e1;
	border-top-color: #2271b1;
	border-radius: 50%;
	box-sizing: border-box;
}
.spinner.is-active {
	visibility: visible;
	animation: tqm-spin 0.8s linear infinite;
}
@keyframes tqm-spin { to { transform: rotate(360deg); } }

/* Notifikasi yang bisa ditutup (tombol X) */
.notice.is-dismissible {
	position: relative;
	padding-right: 40px;
}
.notice.inline {
	display: block;
	margin: 8px 0 12px;
}
.notice-dismiss {
	position: absolute;
	top: 0;
	right: 1px;
	border: none;
	margin: 0;
	padding: 9px;
	background: none;
	color: #787c82;
	cursor: pointer;
	line-height: 1;
}
.notice-dismiss:before {
	content: "\00d7";
	display: block;
	width: 20px;
	height: 20px;
	font-size: 22px;
	line-height: 20px;
	text-align: center;
}
.notice-dismiss:hover,
.notice-dismiss:focus { color: #d63638; }

/* Kotak (dipakai halaman Shopee) */
.postbox {
	background: #ffffff;
	border: 1px solid #c3c4c7;
	box-shadow: 0 1px 1px rgba(0,0,0,0.04);
	margin-bottom: 20px;
}

/* ---------------------------------------------------------------------------
 * Fastpanel: TQM responsive untuk mobile (revisi 2).
 * Ditambahkan di BAWAH gaya desktop; tampilan desktop tidak berubah.
 * Berlaku untuk semua halaman admin TQM (Dashboard, Kampanye, Traffic Chart,
 * Raw Log, Conversion, Shopee, Kalkulator Arbitrage, Settings) dan login.
 *
 * Catatan: banyak halaman memasang <style> sendiri SETELAH file ini. Karena
 * itu selector di bawah memakai awalan "body " (spesifisitas lebih tinggi)
 * atau !important bila yang ditimpa adalah style inline.
 * ------------------------------------------------------------------------- */

html {
	-webkit-text-size-adjust: 100%;
	text-size-adjust: 100%;
}
img,
video {
	max-width: 100%;
	height: auto;
}
pre {
	max-width: 100%;
	overflow-x: auto;
}

/* Pembungkus tabel data (dipasang otomatis oleh admin/index.php): tabel lebar
   digeser ke samping DI DALAM kotaknya, bukan menggeser seluruh halaman. */
.tqm-table-scroll {
	max-width: 100%;
	overflow-x: auto;
	-webkit-overflow-scrolling: touch;
}

/* ===== Tablet ke bawah (<= 900px) ===== */
@media (max-width: 900px) {
	.tqm-topbar {
		height: auto;
		min-height: 48px;
		flex-wrap: wrap;
		gap: 8px 12px;
		padding: 10px 16px;
	}
	.wrap {
		margin: 16px auto;
		padding: 0 16px 40px 16px;
	}
	.tqm-nav-row {
		flex-direction: column;
		align-items: stretch;
	}
	.nav-tab-wrapper {
		flex-wrap: nowrap;
		overflow-x: auto;
		-webkit-overflow-scrolling: touch;
		scrollbar-width: none;
		padding-bottom: 2px;
	}
	.nav-tab-wrapper::-webkit-scrollbar {
		display: none;
	}
	.nav-tab {
		white-space: nowrap;
		flex: none;
	}
	body .tqm-live-clock {
		align-self: flex-start;
		white-space: normal;
		flex-wrap: wrap;
		max-width: 100%;
	}
	.tablenav {
		flex-wrap: wrap;
		height: auto;
		gap: 8px;
	}
	.tablenav-pages {
		flex-wrap: wrap;
	}
	.tqm-modal-box {
		width: calc(100vw - 24px);
		padding: 16px;
	}
}

/* ===== HP (<= 782px) ===== */
@media (max-width: 782px) {
	body {
		font-size: 14px;
	}
	.tqm-topbar {
		padding: 8px 12px;
		flex-wrap: nowrap;
	}
	.tqm-topbar > div:first-child {
		min-width: 0;
	}
	.tqm-topbar-brand {
		font-size: 13px;
		min-width: 0;
	}
	.tqm-topbar-brand span {
		overflow: hidden;
		text-overflow: ellipsis;
		white-space: nowrap;
	}
	.tqm-topbar-right {
		flex-wrap: wrap;
		justify-content: flex-end;
		gap: 8px;
		flex: none;
	}
	.tqm-topbar-badge {
		display: none;
	}
	.wrap {
		margin: 12px auto;
		padding: 0 12px 32px 12px;
		min-width: 0;
		overflow-x: clip;
	}
	h1 {
		font-size: 20px;
		line-height: 1.25;
	}
	h2 {
		font-size: 16px;
	}

	/* Tab menu: satu baris, geser ke samping. */
	.nav-tab {
		padding: 9px 12px;
	}

	/* Jam live: ringkas, boleh membungkus. */
	body .tqm-live-clock {
		font-size: 12px;
		padding: 6px 10px;
		gap: 4px 8px;
		width: 100%;
		justify-content: center;
	}

	/* ---- Kontrol sentuh: tombol & input lebih besar, font 16px (cegah zoom iOS) ---- */
	body .button,
	body .button-secondary,
	body .button-primary {
		min-height: 38px;
		line-height: 1.5;
		padding: 6px 14px;
		white-space: normal;
	}
	body .button.button-small,
	body .button-small {
		min-height: 32px;
		padding: 4px 10px;
	}
	.wrap input[type="text"],
	.wrap input[type="password"],
	.wrap input[type="email"],
	.wrap input[type="number"],
	.wrap input[type="search"],
	.wrap input[type="url"],
	.wrap select,
	.wrap textarea {
		font-size: 16px;
		max-width: 100%;
	}
	.wrap input[type="text"],
	.wrap input[type="password"],
	.wrap input[type="email"],
	.wrap input[type="number"],
	.wrap input[type="search"],
	.wrap input[type="url"],
	.wrap select {
		min-height: 40px;
	}
	.regular-text,
	.large-text {
		width: 100% !important;
		max-width: none !important;
	}
	.small-text {
		width: 120px !important;
	}

	/* ---- Form pengaturan (form-table): label di atas, input selebar layar ---- */
	.form-table,
	.form-table tbody,
	.form-table tr,
	.form-table th,
	.form-table td {
		display: block;
		width: 100% !important;
		box-sizing: border-box;
	}
	.form-table th {
		padding: 10px 0 2px 0;
	}
	.form-table td {
		padding: 2px 0 12px 0;
	}
	.form-table input[type="text"],
	.form-table input[type="password"],
	.form-table input[type="email"],
	.form-table input[type="number"],
	.form-table input[type="search"],
	.form-table input[type="url"],
	.form-table select,
	.form-table textarea {
		width: 100% !important;
		max-width: none !important;
	}
	.form-table .small-text,
	.form-table input[type="number"].small-text {
		width: 120px !important;
	}
	.form-table .button,
	.form-table button.button,
	.form-table input[type="submit"],
	.form-table input[type="button"] {
		width: 100%;
	}
	.tqm-campaign-form {
		padding: 12px !important;
	}
	.tqm-campaign-form .form-table th {
		width: 100% !important;
	}

	/* ---- Tabel tata-letak bertingkat (tanpa class) di form Kampanye & Settings ---- */
	.wrap table:not(.widefat):not(.tqm-sim-t):not(.form-table),
	.wrap table:not(.widefat):not(.tqm-sim-t):not(.form-table) tbody,
	.wrap table:not(.widefat):not(.tqm-sim-t):not(.form-table) tr,
	.wrap table:not(.widefat):not(.tqm-sim-t):not(.form-table) td,
	.wrap table:not(.widefat):not(.tqm-sim-t):not(.form-table) th {
		display: block;
		width: 100% !important;
		min-width: 0 !important;
		box-sizing: border-box;
	}
	.wrap table:not(.widefat):not(.tqm-sim-t):not(.form-table) td,
	.wrap table:not(.widefat):not(.tqm-sim-t):not(.form-table) th {
		white-space: normal !important;
		padding-right: 0 !important;
	}
	.wrap table:not(.widefat):not(.tqm-sim-t):not(.form-table) select,
	.wrap table:not(.widefat):not(.tqm-sim-t):not(.form-table) input[type="text"],
	.wrap table:not(.widefat):not(.tqm-sim-t):not(.form-table) input[type="url"],
	.wrap table:not(.widefat):not(.tqm-sim-t):not(.form-table) textarea {
		max-width: 100%;
	}
	.wrap table:not(.widefat):not(.tqm-sim-t):not(.form-table) input[type="number"] {
		max-width: 100%;
	}
	/* Simulator CPM: tabel data, geser ke samping. */
	#tqm-sim-box {
		overflow-x: auto;
		-webkit-overflow-scrolling: touch;
	}
	#tqm-sim-box .tqm-sim-t {
		min-width: 560px;
	}

	/* ---- Tabel data ---- */
	.widefat {
		font-size: 12px;
	}
	.widefat th,
	.widefat td {
		padding: 8px 8px;
		overflow-wrap: break-word;
		word-break: normal;
	}
	.widefat thead th,
	.widefat tfoot th {
		white-space: nowrap;
	}

	/* ---- Filter (form GET di Dashboard / Traffic / Raw Log / Conversion) ---- */
	form[method="get"][style*="flex-wrap"] {
		gap: 10px !important;
		align-items: stretch !important;
	}
	form[method="get"][style*="flex-wrap"] > div {
		flex: 1 1 100%;
		min-width: 0;
	}
	form[method="get"][style*="flex-wrap"] select,
	form[method="get"][style*="flex-wrap"] input[type="text"],
	form[method="get"][style*="flex-wrap"] input[type="search"] {
		width: 100% !important;
		min-width: 0 !important;
		max-width: 100% !important;
	}
	form[method="get"][style*="flex-wrap"] > div > .button,
	form[method="get"][style*="flex-wrap"] > div > button {
		width: 100%;
	}
	body .tqm-daterange {
		display: block;
		width: 100%;
	}
	body .tqm-daterange-btn {
		width: 100%;
		min-height: 40px;
		font-size: 14px;
	}

	/* Pilih tanggal: lembar bawah layar penuh, bukan popover melebar. */
	body .tqm-daterange-panel {
		position: fixed;
		left: 8px;
		right: 8px;
		top: auto;
		bottom: 8px;
		max-height: calc(100vh - 16px);
		overflow-y: auto;
		flex-direction: column;
		border-radius: 12px;
		z-index: 100010;
		box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.28);
	}
	body .tqm-daterange-presets {
		flex-direction: row;
		flex-wrap: wrap;
		border-right: 0;
		border-bottom: 1px solid #eee;
		min-width: 0;
		padding: 8px;
		gap: 6px;
	}
	body .tqm-preset {
		border: 1px solid #e5e7eb;
		padding: 8px 10px;
	}
	body .tqm-daterange-calendar {
		width: auto;
		padding: 12px;
	}
	body .tqm-cal-day {
		padding: 10px 0;
	}

	/* Menu Export / Column Settings: lembar bawah layar. */
	body details.tqm-ipexport {
		max-width: 100%;
	}
	body details.tqm-ipexport > summary.button {
		width: 100%;
		text-align: center;
	}
	body details.tqm-ipexport > .tqm-ipexport-panel {
		position: fixed;
		left: 8px;
		right: 8px;
		top: auto;
		bottom: 8px;
		width: auto;
		max-height: calc(100vh - 16px);
		overflow-y: auto;
		z-index: 100010;
		box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.28);
	}
	/* Sub-menu Export dibuka di tempat (tidak melayang). */
	body details.tqm-ipexport.tqm-export-submenu > .tqm-ipexport-panel {
		position: static;
		width: auto;
		max-height: none;
		margin: 4px 0 6px 8px;
		box-shadow: none;
		border: 0;
		border-left: 2px solid #e5e7eb;
		border-radius: 0;
		padding: 4px 0 4px 8px;
	}
	body .tqm-export-menu-link,
	body .tqm-export-menu-item {
		padding: 11px 10px;
	}

	/* ---- Pagination ---- */
	.tablenav-pages,
	.pagination-links {
		flex-wrap: wrap;
	}

	/* ---- Baris flex inline yang tidak membungkus: boleh membungkus ---- */
	[style*="display:flex"],
	[style*="display: flex"] {
		flex-wrap: wrap;
	}
	[style*="min-width:300px"],
	[style*="min-width:220px"],
	[style*="min-width:190px"],
	[style*="min-width:180px"],
	[style*="min-width:160px"] {
		min-width: 0 !important;
		max-width: 100% !important;
	}

	/* ---- Form Kampanye: kontrol khusus TQM ---- */
	.tqm-dist-grid {
		min-width: 680px;
	}
	#tqm-dist-list {
		overflow-x: auto;
		-webkit-overflow-scrolling: touch;
	}
	.tqm-smartlink-urlrow,
	.tqm-smartlink-row {
		flex-wrap: wrap !important;
	}
	.tqm-smartlink-url-input {
		max-width: none !important;
	}
	.tqm-smartlink-row > input,
	.tqm-smartlink-row > select {
		min-width: 0;
		flex: 1 1 140px;
	}
	.tqm-group-header,
	.tqm-group-api-head,
	.tqm-sk-head,
	.tqm-sk-body {
		flex-wrap: wrap !important;
	}
	.tqm-group-label-input {
		max-width: 100% !important;
	}
	.tqm-group-api-key,
	.tqm-country-picker,
	.tqm-country-suggestions,
	.tqm-country-search {
		max-width: none !important;
	}
	.tqm-track-url {
		max-width: 100% !important;
	}
	.tqm-sk-pop {
		max-width: min(280px, calc(100vw - 48px));
	}
	.tqm-smartlink-advpopover {
		max-width: calc(100vw - 48px);
	}
	select.tqm-dist-status {
		max-width: none !important;
	}

	/* ---- Diagram Alasan Rute (Raw Log) ---- */
	body .tqm-rr-card {
		padding: 14px 12px;
	}
	body .tqm-rr-body {
		gap: 14px;
	}
	body .tqm-rr-donut {
		flex: 0 0 100%;
		position: static;
		display: flex;
		justify-content: center;
	}
	body .tqm-rr-list {
		flex: 1 1 100%;
		min-width: 0;
		max-height: 420px;
	}

	/* ---- Modal / notifikasi ---- */
	body .tqm-modal-box {
		max-height: calc(100vh - 24px);
		overflow-y: auto;
	}
	body .tqm-modal-box .tqm-modal-footer {
		display: flex;
		flex-wrap: wrap;
		gap: 8px;
		justify-content: flex-end;
	}
	body .tqm-modal-box .tqm-modal-footer .button {
		margin-left: 0;
	}
	.tqm-modal .tqm-modal-box,
	.tqm-marked-box,
	.tqm-confirm-box {
		max-width: 100% !important;
	}
	.tqm-confirm-actions .button {
		min-width: 0;
		flex: 1 1 120px;
	}
	#tqm-copy-toast {
		left: 12px !important;
		right: 12px !important;
		top: 56px !important;
		text-align: center;
	}
	.notice {
		padding: 10px 12px;
	}
	.notice.is-dismissible {
		padding-right: 36px;
	}

	/* ---- Teks panjang ---- */
	code {
		word-break: break-all;
	}
	textarea {
		max-width: 100%;
	}
}

/* ===== HP kecil (<= 480px) ===== */
@media (max-width: 480px) {
	.tqm-topbar {
		padding: 8px 10px;
	}
	.tqm-topbar-brand span {
		max-width: 52vw;
	}
	.tqm-topbar-link span,
	.tqm-topbar-sep {
		display: none;
	}
	.wrap {
		padding: 0 10px 24px 10px;
	}
	.nav-tab {
		padding: 8px 10px;
		font-size: 12px;
	}
	.tqm-modal-box {
		padding: 12px;
	}
	.widefat th,
	.widefat td {
		padding: 7px 6px;
	}
	body .tqm-daterange-presets .tqm-preset {
		flex: 1 1 calc(50% - 6px);
		text-align: center;
	}
}

/* Login TQM: gaya login.php sendiri datang setelah file ini, jadi pakai
   !important hanya untuk padding di layar kecil. */
@media (max-width: 768px) {
	.login-card {
		width: 100% !important;
	}
	.login-header {
		padding: 24px 16px !important;
	}
	.login-body {
		padding: 24px 16px !important;
	}
	.input-wrap input {
		font-size: 16px !important;
	}
}
@media (max-width: 480px) {
	.login-header h1 {
		font-size: 18px !important;
	}
}

/* ---------------------------------------------------------------------------
 * Fastpanel: TQM responsive untuk mobile (revisi 3).
 * - Tab menu: semua tab tampil (membungkus ke beberapa baris), tidak lagi
 *   tersembunyi di balik geseran samping.
 * - Kartu Conversion Pixel: ditumpuk satu kolom di HP.
 * - Pilihan <select>: dibuka sebagai lembar bawah layar (lihat JS di
 *   admin/index.php) sehingga daftar opsi tidak keluar dari layar HP.
 * - Penjaga luapan umum: input/select/teks panjang tidak melebihi layar.
 * ------------------------------------------------------------------------- */

/* Kartu Conversion Pixel (desktop: 3 kolom, otomatis turun baris bila sempit) */
.tqm-pixel-grid {
	display: flex;
	flex-wrap: wrap;
	gap: 16px;
	margin-top: 16px;
}
.tqm-pixel-card {
	flex: 1 1 300px;
	min-width: 0;
	background: #fff;
	border: 1px solid #dcdcde;
	border-radius: 4px;
	padding: 16px;
}
.tqm-pixel-card textarea {
	display: block;
	width: 100%;
	max-width: 100%;
	font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
	font-size: 12px;
	white-space: pre;
	overflow: auto;
}

/* ===== Lembar pilihan <select> (dibuat oleh JS di admin/index.php) ===== */
.tqm-sheet-overlay {
	position: fixed;
	inset: 0;
	z-index: 100020;
	background: rgba(15, 23, 42, 0.55);
	display: flex;
	align-items: flex-end;
	justify-content: center;
}
.tqm-sheet {
	background: #fff;
	width: 100%;
	max-width: 560px;
	max-height: 78vh;
	max-height: 78dvh;
	border-radius: 14px 14px 0 0;
	box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.3);
	display: flex;
	flex-direction: column;
	overflow: hidden;
}
.tqm-sheet-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
	padding: 12px 14px;
	border-bottom: 1px solid #e2e8f0;
	font-weight: 600;
	color: #0f172a;
	font-size: 14px;
}
.tqm-sheet-title {
	min-width: 0;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}
.tqm-sheet-close {
	flex: none;
	border: 0;
	background: #f1f5f9;
	color: #334155;
	border-radius: 999px;
	width: 30px;
	height: 30px;
	min-height: 30px;
	line-height: 1;
	padding: 0;
	font-size: 18px;
	cursor: pointer;
}
.tqm-sheet-search {
	margin: 10px 14px 0;
	width: calc(100% - 28px);
	font-size: 16px;
	min-height: 40px;
}
.tqm-sheet-list {
	list-style: none;
	margin: 0;
	padding: 6px 0 10px;
	overflow-y: auto;
	-webkit-overflow-scrolling: touch;
	overscroll-behavior: contain;
}
.tqm-sheet-group {
	padding: 10px 16px 4px;
	font-size: 11px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	color: #64748b;
}
.tqm-sheet-opt {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
	padding: 12px 16px;
	font-size: 15px;
	line-height: 1.35;
	color: #1e293b;
	cursor: pointer;
	overflow-wrap: anywhere;
}
.tqm-sheet-opt:active {
	background: #f1f5f9;
}
.tqm-sheet-opt.is-selected {
	background: #f0fdf4;
	color: #166534;
	font-weight: 600;
}
.tqm-sheet-opt.is-selected::after {
	content: "\2713";
	flex: none;
	font-weight: 700;
}
.tqm-sheet-opt.is-disabled {
	color: #94a3b8;
	pointer-events: none;
}
.tqm-sheet-empty {
	padding: 16px;
	color: #64748b;
	text-align: center;
}

/* ===== HP (<= 782px) — revisi 3 ===== */
@media (max-width: 782px) {

	/* ---- Tab menu: SEMUA tab terlihat, membungkus ke beberapa baris ---- */
	body .tqm-nav-row {
		border-bottom: 0;
		gap: 10px;
		margin-bottom: 14px;
	}
	body .tqm-nav-row .nav-tab-wrapper,
	body .nav-tab-wrapper {
		display: flex;
		flex-wrap: wrap;
		overflow: visible;
		gap: 6px;
		padding: 0 !important;
		margin: 0 !important;
		width: 100%;
	}
	body .nav-tab-wrapper .nav-tab {
		flex: 1 1 auto;
		min-width: calc(33.333% - 6px);
		text-align: center;
		white-space: normal;
		margin: 0 !important;
		padding: 9px 8px;
		font-size: 13px;
		line-height: 1.3;
		border: 1px solid var(--tqm-border);
		border-radius: 6px;
	}
	body .nav-tab-wrapper .nav-tab-active,
	body .nav-tab-wrapper .nav-tab-active:hover {
		background: var(--tqm-primary) !important;
		border-color: var(--tqm-primary) !important;
		color: #ffffff !important;
		border-bottom: 1px solid var(--tqm-primary) !important;
	}

	/* ---- Conversion Pixel: satu kolom ---- */
	.tqm-pixel-grid {
		flex-direction: column;
		flex-wrap: nowrap;
		gap: 12px;
	}
	.tqm-pixel-card {
		flex: 0 0 auto;
		width: 100%;
		padding: 12px;
	}
	.tqm-pixel-card .button {
		width: 100%;
	}
	.tqm-pixel-card textarea {
		font-size: 12px !important;
		min-height: 150px;
	}

	/* ---- Elemen inline ber-min-width lebar: satu baris penuh, bukan
	   berdesakan berdampingan ---- */
	[style*="min-width:300px"],
	[style*="min-width: 300px"],
	[style*="min-width:260px"],
	[style*="min-width: 260px"],
	[style*="min-width:240px"],
	[style*="min-width: 240px"],
	[style*="min-width:220px"],
	[style*="min-width: 220px"],
	[style*="min-width:200px"],
	[style*="min-width: 200px"],
	[style*="min-width:190px"],
	[style*="min-width: 190px"],
	[style*="min-width:180px"],
	[style*="min-width: 180px"] {
		min-width: 0 !important;
		max-width: 100% !important;
		flex: 1 1 100% !important;
	}

	/* ---- Penjaga luapan umum ---- */
	.wrap {
		max-width: 100vw;
	}
	.wrap > *,
	.wrap form,
	.wrap .postbox,
	.wrap .notice {
		max-width: 100%;
		min-width: 0;
	}
	.wrap input,
	.wrap select,
	.wrap textarea,
	.wrap button {
		max-width: 100%;
		box-sizing: border-box;
	}
	.wrap select {
		width: 100%;
		text-overflow: ellipsis;
	}
	/* Input ber-lebar tetap di dalam form: ikut selebar kotaknya. */
	.wrap input[style*="width:"],
	.wrap select[style*="width:"],
	.wrap textarea[style*="width:"] {
		max-width: 100% !important;
	}
	.wrap input.tqm-extra-slug-input,
	.wrap input#tqm_c_slug {
		flex: 1 1 120px;
		min-width: 0;
	}
	.wrap a,
	.wrap .description,
	.wrap p,
	.wrap li,
	.wrap label,
	.wrap td,
	.wrap th {
		overflow-wrap: anywhere;
	}
	.wrap .widefat th,
	.wrap .widefat td {
		overflow-wrap: break-word;
	}
	.wrap pre,
	.wrap code {
		max-width: 100%;
		white-space: pre-wrap;
		overflow-wrap: anywhere;
	}
	.wrap img,
	.wrap svg,
	.wrap canvas,
	.wrap iframe {
		max-width: 100%;
	}
	/* Grid inline bertiang tetap: jangan melebihi layar. */
	.wrap [style*="grid-template-columns"] {
		min-width: 0;
	}
	/* Popover/daftar saran ber-lebar mutlak tidak boleh keluar layar. */
	.tqm-country-suggestions,
	.tqm-sk-pop,
	.tqm-smartlink-advpopover {
		max-width: calc(100vw - 32px) !important;
	}
}

/* Tablet (<= 900px): tab menu juga membungkus, tidak disembunyikan. */
@media (max-width: 900px) {
	body .nav-tab-wrapper {
		flex-wrap: wrap;
		overflow: visible;
	}
}
