/* =========================================================================
   PMS Sinar Chrome Garage — gaya "Seller Centre" (kandungan cerah, bar gelap)
   Font: Plus Jakarta Sans (tajuk, angka), Inter (teks), JetBrains Mono (ID / kod)
   ========================================================================= */
:root {
  --ink: #0e0f12;          /* bar sisi / kepala gelap */
  --ink-2: #17181d;
  --ink-3: #23252c;
  --ink-line: #2c2e36;
  --bg: #f4f5f7;           /* latar kandungan */
  --panel: #ffffff;        /* kad */
  --panel2: #f6f7f9;       /* latar lembut dalam kad */
  --line: #e6e7eb;
  --line-2: #d9dbe0;
  --text: #16171b;
  --text-2: #3a3c44;
  --muted: #6b6e78;
  --red: #d81f26;
  --red-dark: #b3161c;
  --red-soft: #fdeced;
  --yellow: #ffc72c;
  --yellow-ink: #8a6100;
  --green: #16a34a;
  --green-ink: #15803d;
  --blue-ink: #1d4ed8;
  --orange-ink: #c2410c;
  --r: 14px;
  --r-sm: 10px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 1px 3px rgba(16, 24, 40, .06);
  --shadow-lg: 0 12px 32px rgba(16, 24, 40, .14);
  --side-w: 252px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  --f-head: "Plus Jakarta Sans", "Inter", system-ui, sans-serif;
  --f-body: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --f-mono: "JetBrains Mono", ui-monospace, Consolas, monospace;
  color-scheme: light;
}

/* ---------- Asas ---------- */
* { box-sizing: border-box; }
html {
  -webkit-text-size-adjust: 100%; text-size-adjust: 100%;
  touch-action: pan-x pan-y;           /* tiada pinch-zoom / double-tap zoom di telefon */
}
html, body { margin: 0; }
body {
  background: var(--bg); color: var(--text);
  font: 400 15px/1.5 var(--f-body);
  font-feature-settings: "cv11", "ss01";
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
  min-height: 100vh; min-height: 100dvh;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior-y: none;
}
a { color: var(--red); text-decoration-thickness: 1px; text-underline-offset: 2px; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3 { font-family: var(--f-head); margin: 0 0 .5em; line-height: 1.2; letter-spacing: -.015em; color: var(--text); }
h1 { font-size: 1.55rem; font-weight: 800; }
h2 { font-size: 1.08rem; font-weight: 700; }
h3 { font-size: .95rem; font-weight: 700; }
[hidden] { display: none !important; }
.loading { color: var(--muted); padding: 60px 0; text-align: center; font-weight: 500; }
.loading::before { content: ""; display: block; width: 26px; height: 26px; margin: 0 auto 12px; border: 3px solid var(--line); border-top-color: var(--red); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.muted { color: var(--muted); }
.small { font-size: .84rem; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.spread { justify-content: space-between; }
.grow { flex: 1; min-width: 0; }
.mt { margin-top: 16px; }
.mb { margin-bottom: 16px; }
b, strong { font-weight: 600; }

/* ---------- Rangka: shell + bar sisi ---------- */
.shell { min-height: 100vh; }
.wrap { max-width: 1120px; margin: 0 auto; padding: 18px 16px 28px; }
body.noauth .wrap { max-width: none; padding: 0; }

.side {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; gap: 12px;
  padding: 10px 14px; padding-top: calc(10px + var(--safe-t));
  background: var(--ink); color: #fff;
  box-shadow: 0 1px 0 rgba(255, 255, 255, .04), 0 4px 18px rgba(0, 0, 0, .18);
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: #fff; min-width: 0; }
.brand img { height: 26px; width: auto; max-width: 100%; flex: none; object-fit: contain; display: block; }
.brand-tag {
  font: 800 .78rem/1 var(--f-head); letter-spacing: .14em; color: var(--yellow);
  padding-left: 10px; border-left: 1px solid var(--ink-line);
}
.brand-tag small { display: none; }
.side-label { display: none; }
.nav { display: none; }
.me {
  margin-left: auto; display: flex; align-items: center; gap: 10px; border: 0; background: none; color: #fff;
  cursor: pointer; padding: 0; border-radius: 999px;
}
.me .av { width: 36px; height: 36px; font-size: .8rem; background: var(--red); color: #fff; box-shadow: 0 0 0 2px rgba(255, 255, 255, .12); }
.me-txt, .me-more { display: none; }

/* Bar atas halaman (desktop) */
.pagebar { display: none; }

/* Menu bawah (telefon) */
.bottomnav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; display: flex;
  background: rgba(255, 255, 255, .97); backdrop-filter: saturate(180%) blur(14px); -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-top: 1px solid var(--line); padding-bottom: var(--safe-b);
  box-shadow: 0 -4px 18px rgba(16, 24, 40, .06);
}
.bottomnav a {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 8px 2px 8px;
  color: var(--muted); text-decoration: none; font: 600 .66rem/1.1 var(--f-body); position: relative; min-width: 0;
}
.bottomnav a span { white-space: nowrap; }
.bottomnav a svg { width: 22px; height: 22px; }
.bottomnav a.on { color: var(--red); }
.bottomnav a.on::before { content: ""; position: absolute; top: 0; left: 30%; right: 30%; height: 3px; border-radius: 0 0 3px 3px; background: var(--red); }
body:not(.noauth) { padding-bottom: calc(66px + var(--safe-b)); }
.dot {
  position: absolute; top: 3px; left: calc(50% + 5px); min-width: 17px; height: 17px; padding: 0 4px; border-radius: 9px;
  background: var(--red); color: #fff; font: 700 .64rem/17px var(--f-body); text-align: center; box-shadow: 0 0 0 2px #fff;
}

@media (min-width: 900px) {
  body:not(.noauth) { padding-bottom: 0; padding-left: var(--side-w); }
  .side {
    position: fixed; top: 0; left: 0; bottom: 0; width: var(--side-w);
    flex-direction: column; align-items: stretch; gap: 0; padding: 22px 14px 14px;
    box-shadow: none; border-right: 1px solid #000;
    background: linear-gradient(180deg, #121318 0%, var(--ink) 40%);
  }
  .brand { flex-direction: column; align-items: flex-start; gap: 12px; padding: 0 8px 20px; border-bottom: 1px solid var(--ink-line); }
  .brand img { height: 34px; }
  .brand-tag { border-left: 0; padding-left: 0; font-size: .82rem; }
  .brand-tag small { display: block; margin-top: 5px; font: 500 .72rem/1.2 var(--f-body); letter-spacing: .02em; color: #8e909a; }
  .side-label { display: block; margin: 20px 10px 8px; font: 700 .66rem/1 var(--f-body); letter-spacing: .14em; text-transform: uppercase; color: #6e717c; }
  .nav { display: flex; flex-direction: column; gap: 2px; flex: 1; overflow-y: auto; }
  .nav a {
    display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px;
    color: #b9bbc3; text-decoration: none; font: 600 .9rem/1.2 var(--f-body); position: relative; transition: background .15s, color .15s;
  }
  .nav a svg { width: 19px; height: 19px; flex: none; opacity: .9; }
  .nav a:hover { background: var(--ink-3); color: #fff; }
  .nav a.on { background: rgba(216, 31, 38, .14); color: #fff; }
  .nav a.on::before { content: ""; position: absolute; left: -14px; top: 8px; bottom: 8px; width: 4px; border-radius: 0 4px 4px 0; background: var(--red); }
  .nav a.on svg { color: var(--red); opacity: 1; }
  .nav .dot { position: static; margin-left: auto; box-shadow: none; }
  .me {
    margin: 12px 0 0; width: 100%; padding: 10px; border-radius: 12px; background: var(--ink-2); border: 1px solid var(--ink-line);
    text-align: left; transition: background .15s;
  }
  .me:hover { background: var(--ink-3); }
  .me-txt { display: block; flex: 1; min-width: 0; }
  .me-txt b { display: block; font: 600 .86rem/1.25 var(--f-body); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .me-txt small { display: block; font-size: .72rem; color: #8e909a; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .me-more { display: block; width: 16px; height: 16px; color: #6e717c; flex: none; }
  .bottomnav { display: none; }
  .pagebar {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    position: sticky; top: 0; z-index: 20; height: 56px; padding: 0 28px;
    background: rgba(255, 255, 255, .9); backdrop-filter: saturate(180%) blur(12px); -webkit-backdrop-filter: saturate(180%) blur(12px);
    border-bottom: 1px solid var(--line);
  }
  .crumb { display: flex; align-items: center; gap: 6px; font-size: .86rem; color: var(--muted); }
  .crumb svg { width: 14px; height: 14px; }
  .crumb b { color: var(--text); font-weight: 600; }
  .today { font-size: .84rem; color: var(--muted); font-weight: 500; }
  .wrap { padding: 26px 28px 40px; }
}

/* ---------- Tajuk halaman ---------- */
.wrap > h1:first-child, .wrap > .row:first-child h1 { margin-bottom: 4px; }
.wrap > .row.spread.mb:first-child { margin-bottom: 20px; align-items: flex-end; }
.wrap > .row.spread.mb:first-child .muted.small { margin-top: 4px; max-width: 640px; }

/* ---------- Kad ---------- */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 18px; box-shadow: var(--shadow); }
.card + .card { margin-top: 14px; }
.card > h2:first-child { margin-bottom: 14px; }
.grid { display: grid; gap: 14px; }
.g2 { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.g3 { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
@media (max-width: 899px) { .grid { gap: 10px; } .card { padding: 15px; } .card.stat b { font-size: 1.5rem; } h1 { font-size: 1.35rem; } }

.hero {
  position: relative; overflow: hidden; border-radius: var(--r); padding: 22px 22px 20px; color: #fff;
  background: radial-gradient(120% 140% at 100% 0%, rgba(216, 31, 38, .55) 0%, rgba(216, 31, 38, 0) 55%), linear-gradient(135deg, #1a1b21 0%, var(--ink) 100%);
  box-shadow: var(--shadow-lg);
}
.hero::after {
  content: ""; position: absolute; right: -30px; bottom: -60px; width: 220px; height: 220px; border-radius: 50%;
  border: 28px solid rgba(255, 199, 44, .08);
}
.hero h1 { color: #fff; font-size: 1.6rem; }
.hero .muted { color: #b9bbc3; }

.stat { position: relative; overflow: hidden; }
.card.stat::before { content: ""; position: absolute; left: 0; top: 16px; bottom: 16px; width: 3px; border-radius: 0 3px 3px 0; background: var(--red); }
.stat b { display: block; font: 800 1.75rem/1.1 var(--f-head); letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.stat span { color: var(--muted); font-size: .82rem; font-weight: 500; }
.stat a { color: var(--red); font-weight: 600; text-decoration: none; }

.tile {
  display: flex; gap: 14px; align-items: center; text-decoration: none; color: var(--text);
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 16px 18px;
  box-shadow: var(--shadow); transition: border-color .15s, transform .15s, box-shadow .15s;
}
.tile:hover { border-color: var(--line-2); transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.tile .ic { width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center; background: var(--red-soft); color: var(--red) !important; flex: none; }
.tile .ic svg { width: 23px; height: 23px; }
.tile b { display: block; font: 700 .98rem/1.3 var(--f-head); }
.tile span { color: var(--muted); font-size: .84rem; }

/* ---------- Bar kemajuan & markah ---------- */
.bar { height: 8px; background: #eceef1; border-radius: 6px; overflow: hidden; }
.bar > i { display: block; height: 100%; background: var(--red); border-radius: 6px; transition: width .5s cubic-bezier(.2, .8, .2, 1); }
.bar.y > i { background: #f5b301; }
.bar.g > i { background: var(--green); }
.score-row { display: grid; grid-template-columns: minmax(110px, 1.2fr) 2fr 48px; gap: 12px; align-items: center; padding: 7px 0; font-size: .9rem; }
.score-row b { text-align: right; font-family: var(--f-head); font-weight: 700; font-variant-numeric: tabular-nums; }

/* ---------- Butang & borang ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid transparent; cursor: pointer;
  background: var(--red); color: #fff; font: 600 .92rem/1.2 var(--f-body); padding: 11px 18px; border-radius: var(--r-sm);
  text-decoration: none; min-height: 44px; transition: background .15s, box-shadow .15s, transform .05s;
  box-shadow: 0 1px 2px rgba(216, 31, 38, .25), inset 0 1px 0 rgba(255, 255, 255, .12);
}
.btn:hover { background: var(--red-dark); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .55; cursor: default; }
.btn.ghost { background: #fff; border-color: var(--line-2); color: var(--text); box-shadow: var(--shadow); }
.btn.ghost:hover { background: var(--panel2); border-color: #c9ccd3; }
.btn.sm { min-height: 36px; padding: 7px 13px; font-size: .84rem; border-radius: 9px; }
.btn.block { width: 100%; }
label.f { display: block; margin-bottom: 14px; }
label.f > span { display: block; font-weight: 600; font-size: .84rem; color: var(--text-2); margin-bottom: 6px; }
input[type=text], input[type=password], input[type=number], input[type=date], select, textarea, input[type=search] {
  width: 100%; background: #fff; border: 1px solid var(--line-2); border-radius: var(--r-sm); padding: 11px 13px; min-height: 44px; outline: none;
  font-size: 16px;   /* 16px: telefon tidak auto-zoom bila menaip */
  transition: border-color .15s, box-shadow .15s;
}
input::placeholder, textarea::placeholder { color: #a1a4ad; }
select { appearance: none; -webkit-appearance: none; padding-right: 38px; cursor: pointer;
  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='%236b6e78' stroke-width='2.5' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 13px center; }
textarea { min-height: 100px; resize: vertical; line-height: 1.5; }
input:focus, select:focus, textarea:focus { border-color: var(--red); box-shadow: 0 0 0 4px rgba(216, 31, 38, .12); }
input[type=search] { padding-left: 40px; background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%239a9da6' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-3.5-3.5'/%3E%3C/svg%3E") no-repeat 14px center; }
.check { display: flex; gap: 10px; align-items: flex-start; cursor: pointer; margin-bottom: 12px; }
.check input { width: 20px; height: 20px; accent-color: var(--red); margin-top: 1px; flex: none; }
.err { background: #fef2f2; border: 1px solid #fecaca; color: #b91c1c; padding: 11px 13px; border-radius: var(--r-sm); margin-bottom: 14px; font-size: .88rem; font-weight: 500; }
.note { background: #fffaeb; border: 1px solid #fde68a; color: #7a5300; padding: 11px 14px; border-radius: var(--r-sm); font-size: .87rem; }
.note a { color: #9a3412; font-weight: 600; }
.pw-wrap { position: relative; }
.pw-wrap input { padding-right: 52px; }
.eye {
  position: absolute; right: 4px; top: 50%; transform: translateY(-50%); width: 42px; height: 36px;
  border: 0; background: none; color: var(--muted); cursor: pointer; border-radius: 8px; display: grid; place-items: center;
}
.eye:hover { color: var(--text); background: var(--panel2); }
.eye svg { width: 20px; height: 20px; }
.eye-toggle {
  display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line-2); background: #fff; color: var(--text);
  border-radius: 9px; padding: 6px 12px; cursor: pointer; font-size: .84rem; font-weight: 600; min-height: 36px; box-shadow: var(--shadow);
}
.eye-toggle:hover { background: var(--panel2); }
.eye-toggle svg { width: 18px; height: 18px; color: var(--red); }
.seg { display: flex; background: #eceef1; border-radius: 11px; padding: 4px; gap: 4px; overflow-x: auto; scrollbar-width: none; }
.seg::-webkit-scrollbar { display: none; }
.seg button { flex: 1; border: 0; background: none; padding: 8px 14px; border-radius: 8px; cursor: pointer; color: var(--muted); font-weight: 600; white-space: nowrap; font-size: .86rem; transition: background .15s, color .15s; }
.seg button:hover { color: var(--text); }
.seg button.on { background: #fff; color: var(--text); box-shadow: 0 1px 3px rgba(16, 24, 40, .12); }

/* ---------- Log masuk (skrin terbelah: jenama gelap + borang putih) ---------- */
.login { min-height: 100vh; min-height: 100dvh; display: grid; grid-template-rows: auto 1fr; background: var(--bg); }
.login-brand {
  position: relative; overflow: hidden; color: #fff; padding: calc(28px + var(--safe-t)) 24px 64px;
  background: radial-gradient(90% 120% at 100% 0%, rgba(216, 31, 38, .55), rgba(216, 31, 38, 0) 60%), linear-gradient(160deg, #1b1c22, var(--ink));
}
.login-brand img { height: 40px; width: auto; max-width: 100%; align-self: flex-start; flex: none; object-fit: contain; display: block; }
.login-brand h2 { color: #fff; font-size: 1.35rem; font-weight: 800; margin: 22px 0 6px; }
.login-brand p { margin: 0; color: #b9bbc3; font-size: .92rem; max-width: 380px; }
.login-brand ul { display: none; }
.login-brand .chip { align-self: flex-start; display: inline-block; margin-top: 16px; font: 700 .7rem/1 var(--f-body); letter-spacing: .14em; color: var(--yellow); border: 1px solid rgba(255, 199, 44, .35); padding: 6px 10px; border-radius: 99px; }
.login-main { padding: 0 16px 32px; }
.login-card {
  width: 100%; max-width: 420px; margin: -40px auto 0; position: relative; z-index: 1;
  background: #fff; border: 1px solid var(--line); border-radius: 18px; padding: 26px 22px; box-shadow: var(--shadow-lg);
}
.login-card h1 { font-size: 1.35rem; margin-bottom: 4px; }
.login-card .sub { color: var(--muted); margin: 0 0 20px; font-size: .9rem; }
.login-foot { text-align: center; color: var(--muted); font-size: .8rem; margin-top: 18px; }
@media (min-width: 900px) {
  .login { grid-template-rows: none; grid-template-columns: minmax(380px, 46%) 1fr; }
  .login-brand { display: flex; flex-direction: column; justify-content: center; padding: 56px 56px; }
  .login-brand img { height: 52px; }
  .login-brand h2 { font-size: 2.1rem; line-height: 1.15; margin-top: 34px; max-width: 460px; }
  .login-brand p { font-size: 1rem; }
  .login-brand ul { display: grid; gap: 12px; list-style: none; padding: 0; margin: 32px 0 0; color: #d6d7dc; font-size: .94rem; }
  .login-brand li { display: flex; gap: 10px; align-items: center; }
  .login-brand li::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--red); box-shadow: 0 0 0 4px rgba(216, 31, 38, .2); flex: none; }
  .login-brand::after { content: ""; position: absolute; right: -90px; bottom: -90px; width: 320px; height: 320px; border-radius: 50%; border: 40px solid rgba(255, 199, 44, .06); }
  .login-main { display: grid; place-items: center; padding: 40px; }
  .login-card { margin: 0; padding: 34px 32px; box-shadow: var(--shadow); }
}

/* ---------- Senarai staff (Nilai Staff) ---------- */
.dept-h { margin: 22px 0 10px; font: 700 .7rem/1 var(--f-body); letter-spacing: .14em; color: var(--muted); display: flex; align-items: center; gap: 10px; text-transform: uppercase; }
.dept-h::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.person {
  display: flex; align-items: center; gap: 14px; padding: 12px 14px; background: #fff; border: 1px solid var(--line);
  border-radius: 12px; cursor: pointer; width: 100%; text-align: left; margin-bottom: 8px; box-shadow: var(--shadow);
  transition: border-color .15s, box-shadow .15s, transform .1s;
}
.person:hover { border-color: var(--line-2); box-shadow: var(--shadow-lg); }
.person:active { transform: scale(.995); }
.person .nilai-btn { flex: none; min-width: 74px; pointer-events: none; }
.person:hover .nilai-btn { background: var(--red-dark); }
.person .grow b { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 600; }
.person .grow > span { color: var(--muted); font-size: .8rem; }
.av {
  width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; flex: none;
  font: 700 .82rem/1 var(--f-head); background: var(--red-soft); color: var(--red); letter-spacing: .02em;
}
.ok-dot { color: var(--green-ink); font-weight: 600; }
.pill { display: inline-flex; align-items: center; gap: 4px; font-size: .72rem; font-weight: 600; padding: 4px 9px; border-radius: 99px; white-space: nowrap; line-height: 1.2; }
.pill.done, .pill.selesai { background: #dcfce7; color: var(--green-ink); }
.pill.todo, .pill.ditolak { background: #eef0f3; color: #555863; }
.pill.baru { background: #dbeafe; color: var(--blue-ink); }
.pill.tindakan { background: #ffedd5; color: var(--orange-ink); }
.pill.segera { background: #fee2e2; color: #b91c1c; }
.pill.penting { background: #fef3c7; color: var(--yellow-ink); }

/* ---------- Borang penilaian ---------- */
.crit { padding: 16px 0; border-bottom: 1px solid var(--line); }
.crit:first-child { padding-top: 4px; }
.crit:last-of-type { border-bottom: 0; }
.crit h3 { margin: 0; font-size: 1rem; }
.crit p { margin: 3px 0 12px; color: var(--muted); font-size: .84rem; }
.rate { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.rate button {
  border: 1px solid var(--line-2); background: #fff; border-radius: 11px; padding: 9px 2px 8px; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: 3px; color: var(--muted); transition: all .12s;
}
.rate button b { font: 800 1.2rem/1 var(--f-head); color: var(--text); }
.rate button small { font-size: .62rem; line-height: 1.15; text-align: center; font-weight: 500; }
.rate button:hover { border-color: #b9bcc4; }
.rate button.on { border-color: var(--c); background: color-mix(in srgb, var(--c) 12%, #fff); color: var(--text); box-shadow: 0 0 0 3px color-mix(in srgb, var(--c) 18%, transparent); }
.rate button.on b { color: var(--c); }
.r1 { --c: #dc2626; } .r2 { --c: #ea580c; } .r3 { --c: #d4a106; } .r4 { --c: #65a30d; } .r5 { --c: #16a34a; }
.sticky-act { position: sticky; bottom: calc(66px + var(--safe-b)); padding: 14px 0 2px; background: linear-gradient(rgba(255, 255, 255, 0), #fff 35%); }
@media (min-width: 900px) { .sticky-act { bottom: 0; } }

/* ---------- Jadual ---------- */
.tbl-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
table { width: 100%; border-collapse: collapse; font-size: .87rem; }
th, td { padding: 11px 14px; text-align: left; border-bottom: 1px solid var(--line); white-space: nowrap; }
th { color: var(--muted); font: 600 .7rem/1.2 var(--f-body); letter-spacing: .08em; text-transform: uppercase; background: var(--panel2); position: sticky; top: 0; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: #fafbfc; }
tbody tr.click { cursor: pointer; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
td b { font-weight: 600; }
.sc { font-weight: 700; font-family: var(--f-head); }
.sc.lo { color: #dc2626; } .sc.mid { color: #b45309; } .sc.hi { color: var(--green-ink); }
.mono, .id { font-family: var(--f-mono); font-size: .82em; letter-spacing: .02em; }

/* ---------- Komen ---------- */
.quote { background: var(--panel2); border: 1px solid var(--line); border-left: 3px solid var(--red); border-radius: 10px; padding: 10px 13px; margin-bottom: 8px; font-size: .9rem; white-space: pre-wrap; }
.quote.cad { border-left-color: #f5b301; }
.quote small { display: block; color: var(--muted); font-size: .66rem; font-weight: 700; letter-spacing: .12em; margin-bottom: 4px; }

/* ---------- Kotak sulit (aduan) ---------- */
.safe { display: grid; gap: 6px; background: #f0fdf4; border: 1px solid #bbf7d0; border-radius: 12px; padding: 14px 16px; margin-bottom: 14px; font-size: .88rem; color: #14532d; }
.safe > b { font: 700 .98rem/1.3 var(--f-head); color: var(--green-ink); }

/* ---------- Aduan ---------- */
.aduan { background: #fff; border: 1px solid var(--line); border-radius: var(--r); padding: 16px 18px; margin-bottom: 12px; box-shadow: var(--shadow); }
.aduan h3 { font-size: 1.02rem; }
.aduan .meta { color: var(--muted); font-size: .8rem; }
.aduan p { margin: 10px 0; white-space: pre-wrap; color: var(--text-2); font-size: .92rem; }
.reply { background: #f0fdf4; border: 1px solid #bbf7d0; border-radius: 10px; padding: 10px 13px; font-size: .88rem; white-space: pre-wrap; margin-top: 10px; color: #14532d; }
.photo-prev { max-width: 100%; max-height: 240px; border-radius: 10px; border: 1px solid var(--line); display: block; margin-top: 8px; }
.thumb { width: 76px; height: 76px; object-fit: cover; border-radius: 10px; border: 1px solid var(--line); cursor: zoom-in; }

/* ---------- Utama: penilaian diterima / saya nilai ---------- */
.given { border-top: 1px solid var(--line); padding-top: 14px; font-size: .9rem; }
.given-row { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.given-row:last-child { border-bottom: 0; }
#givenList { margin-top: 8px; }
#recvList { margin-top: 14px; display: grid; gap: 10px; }
#recvList[hidden] { display: none; }
.recv { background: var(--panel2); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; }
.recv .quote { background: #fff; }

/* ---------- Aktiviti ---------- */
.akt { background: #fff; border: 1px solid var(--line); border-radius: 12px; margin-bottom: 8px; box-shadow: var(--shadow); overflow: hidden; }
.akt summary { display: flex; align-items: center; gap: 12px; padding: 12px 14px; cursor: pointer; list-style: none; flex-wrap: wrap; }
.akt summary::-webkit-details-marker { display: none; }
.akt summary:hover { background: #fafbfc; }
.akt[open] summary { border-bottom: 1px solid var(--line); background: var(--panel2); }
.akt-body { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 18px; padding: 16px; }
.akt-body h3 { font-size: .86rem; margin-bottom: 8px; color: var(--text-2); }
.akt-row { display: flex; justify-content: space-between; gap: 10px; padding: 7px 0; border-bottom: 1px solid var(--line); font-size: .88rem; }
.akt-row:last-child { border-bottom: 0; }

/* ---------- Dialog & toast ---------- */
dialog {
  border: 0; background: #fff; color: var(--text); border-radius: 18px; padding: 0;
  width: min(560px, calc(100vw - 24px)); max-height: calc(100vh - 40px); box-shadow: 0 24px 64px rgba(16, 24, 40, .28);
}
dialog[open] { animation: pop .18s ease-out; }
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(.98); } }
dialog::backdrop { background: rgba(14, 15, 18, .55); backdrop-filter: blur(2px); }
#dlgBody { padding: 24px; }
#dlgBody h2 { font-size: 1.2rem; }
.toast {
  position: fixed; left: 50%; bottom: calc(86px + var(--safe-b)); transform: translate(-50%, 16px); opacity: 0; pointer-events: none;
  background: var(--ink); color: #fff; padding: 12px 18px; border-radius: 12px; font-weight: 500; font-size: .88rem; z-index: 50;
  transition: all .25s; max-width: calc(100vw - 32px); box-shadow: var(--shadow-lg);
}
@media (min-width: 900px) { .toast { bottom: 28px; left: calc(50% + var(--side-w) / 2); } }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.bad { background: var(--red); }
.pw-box { font: 700 1.4rem/1 var(--f-mono); letter-spacing: .1em; background: var(--panel2); border: 1px dashed #d4a106; color: var(--text); border-radius: 12px; padding: 16px; text-align: center; margin: 12px 0; user-select: all; }
.empty { text-align: center; color: var(--muted); padding: 36px 12px; }
::selection { background: rgba(216, 31, 38, .18); }
