/* =========================================================
   DESIGN TOKENS
   ========================================================= */
:root {
	--brand-900: #072637;
	--brand-800: #0c3959;
	--brand-700: #114d78;
	--brand-600: #1769a1;
	--accent:    #f2b134;

	--bg:        #eef2f7;
	--surface:   #ffffff;
	--surface-2: #f6f8fb;
	--line:      #dde5ee;

	--text:      #16222e;
	--text-soft: #5b6b7c;
	--text-mute: #8a99a8;

	--ok:        #16a34a;
	--ok-bg:     #e7f6ed;
	--wait:      #b07d10;
	--wait-bg:   #fdf3dd;

	--radius-sm: 8px;
	--radius:    14px;
	--radius-lg: 20px;

	--shadow-sm: 0 1px 2px rgba(10, 35, 60, .06), 0 1px 3px rgba(10, 35, 60, .05);
	--shadow:    0 4px 12px rgba(10, 35, 60, .07), 0 2px 4px rgba(10, 35, 60, .04);
	--shadow-lg: 0 18px 44px rgba(10, 35, 60, .16);

	--sidebar-w: 268px;
	--header-h:  62px;

	--font: "Inter", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
	--mono: "SFMono-Regular", "JetBrains Mono", Consolas, "Liberation Mono", monospace;

	/* diisi per halaman pasaran lewat atribut style */
	--pool: var(--accent);
}

@media (prefers-color-scheme: dark) {
	:root {
		--bg:        #0b1620;
		--surface:   #111f2b;
		--surface-2: #16293a;
		--line:      #22384b;
		--text:      #e8eef4;
		--text-soft: #a7bacb;
		--text-mute: #7a8fa2;
		--ok-bg:     #102b1e;
		--wait-bg:   #30250d;
		--shadow-sm: 0 1px 2px rgba(0,0,0,.4);
		--shadow:    0 4px 14px rgba(0,0,0,.45);
		--shadow-lg: 0 18px 44px rgba(0,0,0,.55);
	}
}

/* =========================================================
   BASE
   ========================================================= */
*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
	margin: 0;
	background: var(--bg);
	color: var(--text);
	font-family: var(--font);
	font-size: 15px;
	line-height: 1.65;
	-webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }
a   { color: var(--brand-600); text-decoration: none; }
a:hover { text-decoration: underline; }

:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

/* Agar target lompatan tidak tertutup topbar yang sticky. */
[id] { scroll-margin-top: calc(var(--header-h) + 14px); }

.skip-link {
	position: absolute; left: 12px; top: -60px; z-index: 200;
	background: var(--accent); color: #231a00; font-weight: 700;
	padding: 10px 16px; border-radius: 0 0 var(--radius-sm) var(--radius-sm);
	transition: top .18s ease;
}
.skip-link:focus { top: 0; text-decoration: none; }

.sr-only {
	position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
	overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* =========================================================
   LAYOUT
   ========================================================= */
.layout { display: grid; grid-template-columns: 1fr; min-height: 100vh; }
@media (min-width: 1024px) {
	.layout { grid-template-columns: var(--sidebar-w) minmax(0, 1fr); }
}

/* =========================================================
   SIDEBAR
   ========================================================= */
.sidebar {
	position: fixed;
	inset: 0 auto 0 0;
	width: min(86vw, var(--sidebar-w));
	z-index: 90;
	background: linear-gradient(175deg, var(--brand-800) 0%, var(--brand-900) 100%);
	color: #fff;
	display: flex;
	flex-direction: column;
	padding: 18px 14px calc(18px + env(safe-area-inset-bottom));
	overflow-y: auto;
	overscroll-behavior: contain;
	transform: translateX(-102%);
	transition: transform .26s cubic-bezier(.4, 0, .2, 1);
	box-shadow: var(--shadow-lg);
}
.sidebar.is-open { transform: translateX(0); }

@media (min-width: 1024px) {
	.sidebar {
		position: sticky; top: 0; height: 100vh;
		width: auto; transform: none; box-shadow: none;
		border-right: 1px solid rgba(255, 255, 255, .07);
	}
}

.brand {
	display: flex; align-items: center; gap: 11px;
	padding: 6px 8px 18px;
	border-bottom: 1px solid rgba(255, 255, 255, .1);
	margin-bottom: 16px;
}
.brand img {
	width: 40px; height: 40px; flex: none;
	border-radius: 10px; background: #fff; padding: 4px; object-fit: contain;
}
.brand-name { font-size: 15px; font-weight: 700; line-height: 1.25; letter-spacing: .2px; }
.brand-tag {
	display: block; font-size: 11px; font-weight: 500;
	color: rgba(255, 255, 255, .6); letter-spacing: .6px; text-transform: uppercase;
}

.nav-label {
	font-size: 10.5px; font-weight: 700; letter-spacing: 1.2px; text-transform: uppercase;
	color: rgba(255, 255, 255, .45);
	padding: 0 10px; margin: 18px 0 8px;
}
.nav-label:first-of-type { margin-top: 0; }

.nav-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }

.nav-link {
	display: flex; align-items: center; gap: 10px;
	padding: 10px 12px;
	border-radius: 10px;
	color: rgba(255, 255, 255, .82);
	font-size: 13.5px; font-weight: 500;
	transition: background .15s ease, color .15s ease;
}
.nav-link:hover { background: rgba(255, 255, 255, .09); color: #fff; text-decoration: none; }
.nav-link.is-active {
	background: rgba(255, 255, 255, .13);
	color: #fff; font-weight: 600;
	box-shadow: inset 3px 0 0 var(--accent);
}
.dot { width: 9px; height: 9px; border-radius: 50%; flex: none; box-shadow: 0 0 0 3px rgba(255, 255, 255, .1); }
.nav-icon { width: 16px; text-align: center; opacity: .75; font-size: 13px; }

.sidebar-foot {
	margin-top: auto; padding: 16px 12px 0;
	border-top: 1px solid rgba(255, 255, 255, .1);
	font-size: 11.5px; color: rgba(255, 255, 255, .5);
}

.scrim {
	position: fixed; inset: 0; z-index: 80;
	background: rgba(5, 20, 33, .55);
	backdrop-filter: blur(2px);
	opacity: 0; visibility: hidden;
	transition: opacity .25s ease, visibility .25s ease;
}
.scrim.is-open { opacity: 1; visibility: visible; }
@media (min-width: 1024px) { .scrim { display: none; } }

/* =========================================================
   TOP BAR
   ========================================================= */
.topbar {
	position: sticky; top: 0; z-index: 70;
	height: var(--header-h);
	display: flex; align-items: center; gap: 12px;
	padding: 0 14px;
	background: color-mix(in srgb, var(--surface) 88%, transparent);
	backdrop-filter: saturate(180%) blur(12px);
	border-bottom: 1px solid var(--line);
}

.burger {
	display: inline-flex; align-items: center; justify-content: center;
	width: 40px; height: 40px; flex: none;
	border: 1px solid var(--line); border-radius: 10px;
	background: var(--surface); color: var(--text);
	cursor: pointer;
}
.burger:hover { background: var(--surface-2); }
.burger span { position: relative; display: block; width: 17px; height: 2px; background: currentColor; border-radius: 2px; }
.burger span::before, .burger span::after {
	content: ""; position: absolute; left: 0; width: 17px; height: 2px;
	background: currentColor; border-radius: 2px;
}
.burger span::before { top: -5.5px; }
.burger span::after  { top:  5.5px; }
@media (min-width: 1024px) { .burger { display: none; } }

.topbar-title {
	margin: 0;
	font-size: 14.5px; font-weight: 700; letter-spacing: .2px;
	white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
@media (min-width: 640px) { .topbar-title { font-size: 16px; } }

.topbar-clock {
	margin-left: auto; flex: none;
	display: inline-flex; align-items: baseline; gap: 6px;
	padding: 7px 12px;
	background: var(--brand-800); color: #fff;
	border-radius: 999px;
	font-variant-numeric: tabular-nums;
	box-shadow: var(--shadow-sm);
}
.topbar-clock .time { font-family: var(--mono); font-size: 13px; font-weight: 600; letter-spacing: .4px; }
.topbar-clock .tz   { font-size: 10px; font-weight: 700; letter-spacing: .8px; opacity: .72; }

/* =========================================================
   HERO
   ========================================================= */
.main { min-width: 0; }

.hero {
	position: relative; overflow: hidden;
	background: linear-gradient(135deg, var(--brand-800) 0%, var(--brand-700) 55%, var(--brand-600) 100%);
	color: #fff;
	padding: 30px 18px 34px;
}
.hero::after {
	content: ""; position: absolute; right: -90px; top: -110px;
	width: 320px; height: 320px; border-radius: 50%;
	background: radial-gradient(circle, color-mix(in srgb, var(--pool) 45%, transparent), transparent 65%);
	pointer-events: none;
}
.hero-inner { position: relative; max-width: 1100px; margin: 0 auto; }
.hero h1 {
	margin: 0 0 8px;
	font-size: clamp(21px, 4.4vw, 32px);
	line-height: 1.2; letter-spacing: -.4px; font-weight: 800;
}
.hero p { margin: 0; max-width: 62ch; font-size: 14px; color: rgba(255, 255, 255, .8); }

.hero-eyebrow {
	display: inline-flex; align-items: center; gap: 8px;
	margin-bottom: 10px;
	font-size: 11px; font-weight: 700; letter-spacing: 1.2px; text-transform: uppercase;
	color: rgba(255, 255, 255, .7);
}
.hero-eyebrow .dot { width: 10px; height: 10px; box-shadow: 0 0 0 4px rgba(255, 255, 255, .12); }

.hero-badges { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.badge {
	display: inline-flex; align-items: center; gap: 6px;
	padding: 5px 11px; border-radius: 999px;
	background: rgba(255, 255, 255, .13);
	border: 1px solid rgba(255, 255, 255, .18);
	font-size: 11.5px; font-weight: 600; letter-spacing: .3px;
	color: #fff;
}
a.badge:hover { background: rgba(255, 255, 255, .22); text-decoration: none; }
.badge .dot-live {
	width: 7px; height: 7px; border-radius: 50%; background: #5ce08a;
	box-shadow: 0 0 0 0 rgba(92, 224, 138, .7);
	animation: pulse 2s infinite;
}
@keyframes pulse {
	70%  { box-shadow: 0 0 0 7px rgba(92, 224, 138, 0); }
	100% { box-shadow: 0 0 0 0 rgba(92, 224, 138, 0); }
}
@media (prefers-reduced-motion: reduce) {
	* { animation: none !important; transition-duration: .01ms !important; }
}

.crumbs { margin-bottom: 12px; font-size: 12.5px; color: rgba(255, 255, 255, .62); }
.crumbs a { color: rgba(255, 255, 255, .82); }
.crumbs span { margin: 0 7px; opacity: .5; }

/* =========================================================
   CONTENT SHELL
   ========================================================= */
.wrap { max-width: 1100px; margin: 0 auto; padding: 20px 14px calc(36px + env(safe-area-inset-bottom)); }
@media (min-width: 640px) { .wrap, .hero { padding-left: 24px; padding-right: 24px; } }

.card {
	background: var(--surface);
	border: 1px solid var(--line);
	border-radius: var(--radius-lg);
	box-shadow: var(--shadow-sm);
	overflow: hidden;
}
.card + .card, .card + .ad, .ad + .card, .ad + .ad { margin-top: 18px; }

.card-head {
	display: flex; align-items: center; justify-content: space-between; gap: 12px;
	flex-wrap: wrap;
	padding: 16px 18px;
	border-bottom: 1px solid var(--line);
	background: var(--surface-2);
}
.card-title {
	margin: 0; font-size: 15px; font-weight: 700; letter-spacing: .2px;
	display: flex; align-items: center; gap: 9px;
}
.card-title .bar { width: 4px; height: 17px; border-radius: 3px; background: var(--pool); }
.card-sub { font-size: 12.5px; color: var(--text-soft); }
.card-body { padding: 18px; }

/* =========================================================
   FORM CONTROLS
   ========================================================= */
.filters { display: grid; gap: 12px; grid-template-columns: 1fr; padding: 16px 18px; border-bottom: 1px solid var(--line); }
@media (min-width: 640px) { .filters { grid-template-columns: 1fr 1fr; } }

.field { display: grid; gap: 6px; min-width: 0; }
.field label {
	font-size: 11px; font-weight: 700; letter-spacing: .8px; text-transform: uppercase;
	color: var(--text-mute);
}
.control {
	width: 100%;
	min-height: 44px;
	padding: 10px 13px;
	font: inherit; font-size: 14px;
	color: var(--text);
	background: var(--surface);
	border: 1px solid var(--line);
	border-radius: var(--radius-sm);
	transition: border-color .15s ease, box-shadow .15s ease;
	appearance: none;
}
.control:hover { border-color: var(--brand-600); }
.control:focus {
	outline: none;
	border-color: var(--brand-600);
	box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand-600) 18%, transparent);
}
select.control {
	background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'><path fill='%235b6b7c' d='M1.4 0 6 4.6 10.6 0 12 1.4 6 7.4 0 1.4z'/></svg>");
	background-repeat: no-repeat;
	background-position: right 13px center;
	padding-right: 36px;
}
.control-sm { width: auto; min-height: 38px; padding: 7px 11px; font-size: 13.5px; }
select.control-sm { padding-right: 32px; background-position: right 11px center; }

.btn {
	display: inline-flex; align-items: center; justify-content: center; gap: 7px;
	min-height: 38px; padding: 8px 14px;
	border: 1px solid var(--line); border-radius: var(--radius-sm);
	background: var(--surface); color: var(--text);
	font: inherit; font-size: 13.5px; font-weight: 600;
	cursor: pointer;
	transition: background .15s ease, border-color .15s ease;
}
.btn:hover:not(:disabled) { background: var(--surface-2); border-color: var(--brand-600); text-decoration: none; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-primary { background: var(--brand-800); border-color: var(--brand-800); color: #fff; }
.btn-primary:hover:not(:disabled) { background: var(--brand-700); border-color: var(--brand-700); }

/* =========================================================
   RESULTS TABLE  (tabel di desktop, kartu di mobile)
   ========================================================= */
.results { width: 100%; border-collapse: collapse; font-size: 14px; }
.results thead th {
	padding: 12px 14px;
	text-align: left;
	font-size: 11px; font-weight: 700; letter-spacing: .9px; text-transform: uppercase;
	color: var(--text-soft);
	background: var(--surface-2);
	border-bottom: 1px solid var(--line);
	white-space: nowrap;
}
.results tbody td { padding: 13px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.results tbody tr:last-child td { border-bottom: 0; }
.results tbody tr:hover { background: var(--surface-2); }

.pool { display: flex; align-items: center; gap: 9px; font-weight: 600; white-space: nowrap; }
.pool .dot { box-shadow: 0 0 0 3px color-mix(in srgb, var(--text) 7%, transparent); }
.pool a { color: inherit; }

.muted { color: var(--text-soft); white-space: nowrap; }

.numbers { display: inline-flex; gap: 5px; }
.numbers span {
	display: grid; place-items: center;
	min-width: 29px; height: 33px; padding: 0 4px;
	font-family: var(--mono); font-size: 15px; font-weight: 700;
	color: #fff;
	background: linear-gradient(180deg, var(--brand-700), var(--brand-800));
	border-radius: 7px;
	box-shadow: var(--shadow-sm);
}
.numbers-lg span { min-width: 46px; height: 58px; font-size: 26px; border-radius: 10px; }
@media (min-width: 640px) { .numbers-lg span { min-width: 54px; height: 66px; font-size: 30px; } }

.chip {
	display: inline-flex; align-items: center; gap: 6px;
	padding: 4px 10px; border-radius: 999px;
	font-size: 11.5px; font-weight: 700; letter-spacing: .3px;
	white-space: nowrap;
}
.chip-wait { background: var(--wait-bg); color: var(--wait); }
.chip-ok   { background: var(--ok-bg);   color: var(--ok); }

.empty-state { padding: 42px 18px; text-align: center; color: var(--text-soft); }
.empty-state strong { display: block; color: var(--text); margin-bottom: 4px; }

@media (max-width: 767px) {
	.results, .results tbody, .results tr, .results td { display: block; width: 100%; }
	.results thead { display: none; }
	.results tbody tr {
		border: 1px solid var(--line);
		border-radius: var(--radius);
		margin: 0 0 10px;
		padding: 4px 0;
		background: var(--surface);
		box-shadow: var(--shadow-sm);
	}
	.results tbody tr:last-child { margin-bottom: 0; }
	.results tbody td {
		display: flex; align-items: center; justify-content: space-between; gap: 14px;
		padding: 9px 14px; border-bottom: 0;
	}
	.results tbody td::before {
		content: attr(data-label);
		font-size: 10.5px; font-weight: 700; letter-spacing: .8px; text-transform: uppercase;
		color: var(--text-mute);
		flex: none;
	}
	.results tbody td.row-head {
		border-bottom: 1px solid var(--line);
		padding-top: 12px; padding-bottom: 12px;
		margin-bottom: 4px;
		justify-content: flex-start;
	}
	.results tbody td.row-head::before { display: none; }
	.results tbody tr:hover { background: var(--surface); }
}

/* =========================================================
   HASIL TERBARU (halaman pasaran)
   ========================================================= */
.latest { display: grid; gap: 18px; align-items: center; grid-template-columns: 1fr; }
@media (min-width: 680px) { .latest { grid-template-columns: auto 1fr; gap: 28px; } }

.latest-meta { display: grid; gap: 12px 20px; grid-template-columns: repeat(auto-fit, minmax(96px, 1fr)); }
.meta-item .k {
	font-size: 10.5px; font-weight: 700; letter-spacing: .9px; text-transform: uppercase;
	color: var(--text-mute);
}
.meta-item .v { font-size: 15px; font-weight: 600; }

/* =========================================================
   TABEL MINGGUAN
   ========================================================= */
.week-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.week-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.week-table th, .week-table td {
	border: 1px solid var(--line);
	padding: 9px 10px;
	text-align: center;
	white-space: nowrap;
}
.week-table thead th {
	background: var(--surface-2);
	font-size: 10.5px; font-weight: 700; letter-spacing: .8px; text-transform: uppercase;
	color: var(--text-soft);
	position: sticky; top: 0; z-index: 2;
}
.week-table tbody th {
	position: sticky; left: 0; z-index: 1;
	background: var(--surface);
	text-align: left; font-weight: 600; font-size: 12px;
	color: var(--text-soft);
}
.week-table td { font-family: var(--mono); font-weight: 700; letter-spacing: .5px; }
.week-table td.is-empty { color: var(--text-mute); font-weight: 400; }
.week-table td.is-today { background: color-mix(in srgb, var(--accent) 18%, transparent); }

/* =========================================================
   PAGINASI
   ========================================================= */
.pager {
	display: flex; align-items: center; justify-content: space-between; gap: 12px;
	flex-wrap: wrap;
	padding: 14px 18px;
	border-top: 1px solid var(--line);
	background: var(--surface-2);
}
.pager-info { font-size: 12.5px; color: var(--text-soft); }
.pager-btns { display: flex; gap: 8px; }

/* =========================================================
   ADS
   ========================================================= */
.ad { text-align: center; }
.ad a { display: block; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-sm); }
.ad img { width: 100%; height: auto; }
.ad-note {
	display: block; margin-top: 6px;
	font-size: 10px; letter-spacing: 1px; text-transform: uppercase; color: var(--text-mute);
}

/* =========================================================
   ARTIKEL
   ========================================================= */
.article { font-size: 15px; color: var(--text-soft); }
.article p { margin: 0 0 14px; }
.article p:last-child { margin-bottom: 0; }
.article h2 { margin: 26px 0 10px; font-size: 17px; font-weight: 700; color: var(--text); letter-spacing: -.1px; }
.article h2:first-child { margin-top: 0; }
.article b { color: var(--text); }
.article .lead {
	font-size: 15.5px; color: var(--text);
	padding: 14px 16px; margin-bottom: 20px;
	background: var(--surface-2);
	border-left: 4px solid var(--pool);
	border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

/* =========================================================
   FOOTER
   ========================================================= */
.footer {
	background: var(--brand-900);
	color: rgba(255, 255, 255, .72);
	padding: 34px 14px calc(18px + env(safe-area-inset-bottom));
}
.footer-inner { max-width: 1100px; margin: 0 auto; display: grid; gap: 28px; grid-template-columns: 1fr; }
@media (min-width: 768px) { .footer-inner { grid-template-columns: 1.1fr 1fr; } }

.footer h3 {
	margin: 0 0 14px;
	font-size: 12px; font-weight: 700; letter-spacing: 1.2px; text-transform: uppercase;
	color: #fff;
}
.footer p { margin: 0 0 10px; font-size: 13.5px; }
.sitemap {
	list-style: none; margin: 0; padding: 0;
	display: grid; gap: 4px 18px;
	grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
}
.sitemap a { display: flex; align-items: center; gap: 9px; padding: 5px 0; color: rgba(255, 255, 255, .75); font-size: 13.5px; }
.sitemap a:hover { color: #fff; text-decoration: none; }

.footer-bottom {
	max-width: 1100px; margin: 26px auto 0; padding-top: 16px;
	border-top: 1px solid rgba(255, 255, 255, .1);
	display: flex; flex-wrap: wrap; gap: 8px; justify-content: space-between;
	font-size: 12px; color: rgba(255, 255, 255, .5);
}

.to-top {
	position: fixed; right: 16px; z-index: 60;
	bottom: calc(16px + env(safe-area-inset-bottom));
	width: 44px; height: 44px;
	display: grid; place-items: center;
	border: 0; border-radius: 50%;
	background: var(--brand-800); color: #fff;
	box-shadow: var(--shadow-lg); cursor: pointer;
	opacity: 0; visibility: hidden; transform: translateY(10px);
	transition: opacity .2s ease, transform .2s ease, visibility .2s ease;
}
.to-top.is-visible { opacity: 1; visibility: visible; transform: translateY(0); }
