/* Portal Latihan: follows the razakmajid.com theme (white and mist surfaces, red accent, Playfair Display + Inter). */
:root {
  --accent: #dc2626;
  --accent-2: #c81e1e;
  --accent-dark: #a51b1b;
  --accent-soft: #fef2f2;
  --accent-line: #fecaca;
  --ink: #161616;
  --heading: #121212;
  --muted: #5c5c5c;
  --bg: #fafafa;
  --mist: #f6f6f6;
  --line: #e5e5e5;
  --line-2: #d4d4d4;
  --white: #ffffff;
  --ok: #007956;
  --ok-bg: #ecfdf5;
  --bad: #bf000f;
  --bad-bg: #fef2f2;
  --warn: #8a5a00;
  --warn-bg: #fff4d6;
  --radius: 2px;
  --head: 'Playfair Display', Georgia, 'Times New Roman', serif;
  --body: 'Inter', -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
  --label: var(--body);
  /* names kept for older inline styles */
  --blue: var(--accent);
  --blue-2: var(--accent-2);
  --blue-dark: var(--accent-dark);
  --lime: var(--accent);
  --navy: var(--heading);
  --card: var(--mist);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.6 var(--body); }
a { color: var(--accent-2); }
img { max-width: 100%; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Header (white, like razakmajid.com) */
.top { position: sticky; top: 0; z-index: 30; background: rgba(255, 255, 255, .95); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.top .wrap { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 64px; }
.brand { color: var(--heading); text-decoration: none; display: flex; align-items: center; gap: 10px; }
.brand-mark { display: none; }
.brand-text { font: 600 18px/1 var(--head); letter-spacing: .14em; text-transform: uppercase; white-space: nowrap; }
.brand-text small { display: block; font: 500 9.5px/1.2 var(--body); letter-spacing: .2em; text-transform: uppercase; color: var(--muted); margin-top: 6px; }
.top-link { color: var(--muted); font: 500 14px var(--body); text-decoration: none; position: relative; padding: 8px 2px; }
.top-link:hover { color: var(--heading); }
.top-link::after { content: ''; position: absolute; left: 2px; right: 2px; bottom: 0; height: 2px; background: var(--accent); transform: scaleX(0); transition: transform .15s ease; }
.top-link:hover::after { transform: scaleX(1); }

.wrap { width: 100%; max-width: 760px; margin: 0 auto; padding-left: 16px; padding-right: 16px; }
.wrap.wide { max-width: 1120px; }

/* Hero */
.hero { padding: 36px 0 8px; }
.crumbs { font: 500 13px var(--body); color: var(--muted); margin-bottom: 20px; }
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: var(--accent-2); }
.eyebrow { font: 600 12px var(--body); letter-spacing: .18em; text-transform: uppercase; color: var(--accent-dark); margin: 0; }
.bar { width: 44px; height: 2px; background: var(--accent); margin: 14px 0 16px; }
h1, h2, h3 { font-family: var(--head); color: var(--heading); margin: 0; line-height: 1.1; font-weight: 500; }
h1 { font-size: clamp(36px, 7.5vw, 54px); letter-spacing: -.015em; line-height: 1.08; }
h1 .hl, h2 .hl { color: var(--accent-2); font-style: italic; }
h2 { font-size: 28px; letter-spacing: -.01em; }
h3 { font-size: 21px; font-weight: 600; }
.lead { font-size: 17px; color: var(--ink); margin: 14px 0 0; max-width: 60ch; }
.meta { display: flex; flex-wrap: wrap; gap: 8px 18px; margin-top: 16px; color: var(--muted); font-size: 14.5px; }
.meta span { display: inline-flex; align-items: center; gap: 6px; }
.meta svg { color: var(--accent); }

main { padding-bottom: 56px; }
section.block, .block { margin-top: 24px; }

/* Cards and tiles */
.card { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; box-shadow: 0 1px 2px rgba(0, 0, 0, .04); }
.card + .card { margin-top: 16px; }
.list { display: grid; gap: 14px; margin-top: 24px; }
.training { display: flex; align-items: center; gap: 18px; text-decoration: none; color: inherit; background: var(--white); border: 1px solid var(--line); border-left: 3px solid var(--accent); border-radius: var(--radius); padding: 22px; transition: box-shadow .15s ease, border-color .15s ease; }
.training:hover { box-shadow: 0 24px 48px -28px rgba(0, 0, 0, .35); }
.training .num { flex: none; width: 46px; height: 46px; border-radius: 50%; border: 1px solid var(--accent-line); background: var(--accent-soft); color: var(--accent-dark); display: grid; place-items: center; font: italic 600 22px var(--head); }
.training h2 { font-size: 26px; }
.training p { margin: 4px 0 0; color: var(--muted); font-size: 14.5px; }
.training .go { margin-left: auto; flex: none; color: var(--accent); font: 500 24px var(--body); }

.tiles { display: grid; grid-template-columns: 1fr; gap: 14px; margin-top: 26px; }
@media (min-width: 640px) { .tiles { grid-template-columns: 1fr 1fr; } }
.tile { position: relative; display: flex; flex-direction: column; gap: 6px; min-height: 150px; padding: 24px; border-radius: var(--radius); text-decoration: none; color: var(--ink); background: var(--white); border: 1px solid var(--line); border-top: 2px solid var(--line); transition: box-shadow .15s ease, border-color .15s ease; }
.tile:hover { border-top-color: var(--accent); box-shadow: 0 24px 48px -28px rgba(0, 0, 0, .35); }
.tile .ico { width: 50px; height: 50px; border-radius: 50%; background: var(--accent-soft); border: 1px solid var(--accent-line); display: grid; place-items: center; margin-bottom: 8px; }
.tile .ico svg { width: 24px; height: 24px; stroke: var(--accent-2); fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.tile .step { position: absolute; top: 20px; right: 22px; font: italic 600 18px var(--head); color: var(--accent); }
.tile h2 { font-size: 25px; }
.tile p { margin: 0; color: var(--muted); font-size: 14.5px; }
.tile.dark { background: var(--accent-soft); border-color: var(--accent-line); border-top: 2px solid var(--accent); }
.tile.dark .ico { background: var(--accent); border-color: var(--accent); }
.tile.dark .ico svg { stroke: #fff; }

/* Forms */
form { margin: 0; }
.field { margin-top: 20px; }
.field:first-child { margin-top: 0; }
label.lbl, .lbl { display: block; font: 600 14.5px var(--body); color: var(--heading); margin-bottom: 7px; }
.hint { font-size: 13px; color: var(--muted); margin: 6px 0 0; }
input[type=text], input[type=email], input[type=tel], input[type=password], textarea {
  width: 100%; font: 16px var(--body); color: var(--ink); background: #fff;
  border: 1px solid var(--line-2); border-radius: var(--radius); padding: 13px 14px; outline: none;
  transition: border-color .15s ease, box-shadow .15s ease;
}
textarea { min-height: 96px; resize: vertical; }
input:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(220, 38, 38, .14); }
.invalid input, .invalid textarea { border-color: var(--bad); }
.err { color: var(--bad); font-size: 13.5px; margin: 6px 0 0; display: none; }
.invalid .err { display: block; }
.check { display: flex; gap: 12px; align-items: flex-start; font-size: 14.5px; color: var(--ink); }
.check input { width: 20px; height: 20px; margin: 2px 0 0; flex: none; accent-color: var(--accent); }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; font: 600 15.5px var(--body); letter-spacing: .01em; border-radius: var(--radius); padding: 14px 22px; border: 1px solid transparent; cursor: pointer; text-decoration: none; transition: background .15s ease, border-color .15s ease, color .15s ease; }
.btn.primary { background: var(--accent); color: #fff; }
.btn.primary:hover { background: var(--accent-2); }
.btn.lime { background: var(--white); color: var(--accent-2); border-color: var(--accent); }
.btn.lime:hover { background: var(--accent-soft); }
.btn.ghost { background: var(--white); color: var(--heading); border-color: var(--line-2); }
.btn.ghost:hover { border-color: var(--heading); }
.btn.block { width: 100%; }
.btn[disabled] { opacity: .6; cursor: progress; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 22px; }

.notice { border-radius: var(--radius); padding: 14px 16px; font-size: 14.5px; margin-top: 16px; display: none; border: 1px solid transparent; }
.notice.show { display: block; }
.notice.ok { background: var(--ok-bg); color: var(--ok); border-color: #a4f4cf; }
.notice.bad { background: var(--bad-bg); color: var(--bad); border-color: var(--accent-line); }
.notice.info { background: var(--mist); color: var(--ink); border-color: var(--line); }

.who { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; background: var(--white); border: 1px solid var(--line); border-left: 3px solid var(--accent); border-radius: var(--radius); padding: 14px 16px; }
.who b { font: 600 20px var(--head); color: var(--heading); }
.who small { color: var(--muted); display: block; font-size: 12.5px; }
.who button { background: transparent; border: 1px solid var(--line-2); color: var(--heading); border-radius: var(--radius); padding: 8px 12px; font: 500 13.5px var(--body); cursor: pointer; }
.who button:hover { border-color: var(--heading); }

.done { text-align: center; padding: 30px 22px; }
.done .tick { width: 68px; height: 68px; margin: 0 auto 16px; border-radius: 50%; background: var(--ok-bg); border: 1px solid #a4f4cf; display: grid; place-items: center; }
.done .tick svg { width: 34px; height: 34px; stroke: var(--ok); stroke-width: 2.6; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.done h2 { margin-bottom: 6px; }
.done p { color: var(--ink); }
.done .actions { justify-content: center; }

/* Likert */
.scale-key { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; font-size: 11.5px; color: var(--muted); text-align: center; margin: 14px 0 2px; line-height: 1.3; }
.scale-key span b { display: block; font: 600 20px var(--head); color: var(--accent-2); }
.sec-title { display: flex; align-items: baseline; flex-wrap: wrap; gap: 10px; margin: 32px 0 4px; }
.sec-title .tag { font: 600 11.5px var(--body); letter-spacing: .14em; text-transform: uppercase; color: var(--accent-dark); background: var(--accent-soft); border: 1px solid var(--accent-line); border-radius: 999px; padding: 3px 10px; }
.sec-lead { color: var(--muted); margin: 6px 0 0; font-style: italic; }
.q { border: 1px solid var(--line); background: #fff; border-radius: var(--radius); padding: 14px; margin: 10px 0 0; }
.q legend { float: left; width: 100%; padding: 0; font-weight: 600; color: var(--heading); font-size: 15px; line-height: 1.45; display: flex; gap: 8px; }
.q .opts { clear: both; }
.q legend .n { color: var(--accent); font: italic 600 17px var(--head); flex: none; min-width: 20px; }
.q.missing { border-color: var(--bad); box-shadow: 0 0 0 3px rgba(191, 0, 15, .1); }
.opts { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; margin-top: 12px; }
.opts label { cursor: pointer; display: flex; }
.opts label > span { flex: 1; }
.opts input { position: absolute; opacity: 0; pointer-events: none; }
.opts span { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; min-height: 56px; border: 1px solid var(--line-2); border-radius: var(--radius); background: #fff; text-align: center; padding: 6px 2px; font: 600 19px/1 var(--head); color: var(--heading); transition: background .12s ease, border-color .12s ease; }
.opts span small { font: 500 10px/1.15 var(--body); color: var(--muted); }
.opts label:hover span { border-color: var(--accent); }
.opts input:focus-visible + span { box-shadow: 0 0 0 3px rgba(220, 38, 38, .2); }
.opts input:checked + span { background: var(--accent); border-color: var(--accent); color: #fff; }
.opts input:checked + span small { color: #fff; }
.opts span small.en { font-size: 9px; opacity: .8; }
.q legend .ms, label.lbl .ms { display: block; font-weight: 400; font-style: italic; color: var(--muted); font-size: 14px; margin-top: 2px; }
.sec-lead .ms { font-style: italic; }
.scale-key i { font-style: italic; }
.barrow .t .ms { display: block; color: var(--muted); font-style: italic; font-size: 12.5px; margin-top: 1px; }

/* Steps list (training menu) */
.steps { margin: 14px 0 0; padding: 0; list-style: none; counter-reset: st; display: grid; gap: 14px; }
.steps li { counter-increment: st; position: relative; padding-left: 44px; min-height: 30px; font-size: 15px; }
.steps li::before { content: counter(st); position: absolute; left: 0; top: -2px; width: 30px; height: 30px; border-radius: 50%; background: var(--accent-soft); border: 1px solid var(--accent-line); color: var(--accent-dark); display: grid; place-items: center; font: italic 600 16px var(--head); }

/* Admin */
.adm-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px; padding-top: 28px; padding-bottom: 6px; }
.adm-head h1 { font-size: clamp(32px, 6vw, 46px); }
.adm-head .sub { color: var(--muted); font-size: 13.5px; margin: 8px 0 0; }
.tabs { position: sticky; top: 64px; z-index: 5; background: rgba(250, 250, 250, .96); backdrop-filter: blur(6px); border-bottom: 1px solid var(--line); margin-top: 16px; }
.tabs .wrap { display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; }
.tabs .wrap::-webkit-scrollbar { display: none; }
.tab { flex: none; border: 0; background: transparent; padding: 14px 14px 12px; font: 500 14px var(--body); color: var(--muted); border-bottom: 2px solid transparent; cursor: pointer; display: inline-flex; align-items: center; gap: 8px; }
.tab:hover { color: var(--heading); }
.tab[aria-selected="true"] { color: var(--heading); font-weight: 600; border-bottom-color: var(--accent); }
.tab .count { background: var(--mist); border: 1px solid var(--line); color: var(--heading); border-radius: 999px; padding: 0 8px; font-size: 12px; }
.tab[aria-selected="true"] .count { background: var(--accent-soft); border-color: var(--accent-line); color: var(--accent-dark); }
.view[hidden] { display: none; }
.kpis { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin-top: 20px; }
@media (min-width: 860px) { .kpis { grid-template-columns: repeat(4, 1fr); } .kpis.five { grid-template-columns: repeat(5, 1fr); } }
.kpi { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; }
.kpi .v { font: 500 40px/1 var(--head); color: var(--heading); }
.kpi .l { font: 600 11.5px var(--body); letter-spacing: .14em; text-transform: uppercase; color: var(--muted); margin-top: 8px; }
.kpi .s { font-size: 13px; color: var(--muted); margin-top: 3px; }
.kpi.accent { background: var(--accent-soft); border-color: var(--accent-line); border-top: 2px solid var(--accent); }
.kpi.accent .v { color: var(--accent-2); }
.kpi.accent .l { color: var(--accent-dark); }
.kpi.accent .s { color: var(--ink); }
.meter { height: 6px; background: #efefef; border-radius: 99px; margin-top: 12px; overflow: hidden; }
.meter i { display: block; height: 100%; background: var(--accent); border-radius: 99px; }
.toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.toolbar .btn { padding: 10px 14px; font-size: 14px; }
.panel { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; margin-top: 18px; }
.panel h2 { font-size: 25px; margin-bottom: 4px; }
.panel .sub { color: var(--muted); font-size: 14px; margin: 0 0 14px; }
.secs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.secs div { background: var(--mist); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; }
.secs b { display: block; font: 500 28px/1 var(--head); color: var(--accent-2); }
.secs span { font-size: 12.5px; color: var(--muted); }
.bars { display: grid; gap: 14px; margin-top: 8px; }
.barrow { display: grid; grid-template-columns: 1fr; gap: 4px; }
@media (min-width: 760px) { .barrow { grid-template-columns: minmax(0, 46%) 1fr; gap: 16px; align-items: center; } }
.barrow .t { font-size: 14px; color: var(--ink); }
.barrow .t i { font: italic 600 15px var(--head); color: var(--accent); margin-right: 6px; }
.track { position: relative; height: 24px; background: var(--mist); border-radius: var(--radius); }
.fill { position: absolute; inset: 0 auto 0 0; background: var(--accent); border-radius: var(--radius) 4px 4px var(--radius); }
.track .val { position: absolute; top: 50%; transform: translateY(-50%); font: 600 12.5px var(--body); color: var(--heading); white-space: nowrap; }
.track .val.in { color: #fff; }
.dist { font-size: 12px; color: var(--muted); }
table.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th { text-align: left; font: 600 11.5px var(--body); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); border-bottom: 1px solid var(--line-2); padding: 9px 6px; }
.tbl td { border-bottom: 1px solid var(--line); padding: 10px 6px; vertical-align: top; }
.tbl .y { color: var(--ok); font-weight: 600; }
.tbl .n { color: var(--muted); }
.scroll { overflow-x: auto; }
.quotes { display: grid; gap: 10px; margin-top: 8px; }
.quotes blockquote { margin: 0; background: var(--mist); border-left: 2px solid var(--accent); border-radius: var(--radius); padding: 10px 14px; font-size: 14.5px; }
.quotes cite { display: block; font-style: normal; font-size: 12.5px; color: var(--muted); margin-top: 4px; }
.qrs { display: grid; grid-template-columns: 1fr; gap: 14px; }
@media (min-width: 640px) { .qrs { grid-template-columns: 1fr 1fr; } }
.qr { text-align: center; background: var(--mist); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
.qr img { width: 220px; height: 220px; background: #fff; padding: 10px; border: 1px solid var(--line); }
.qr b { display: block; font: 600 22px var(--head); color: var(--heading); margin-top: 10px; }
.qr code { display: block; font-size: 13px; color: var(--muted); word-break: break-all; margin: 4px 0 12px; }

.foot { color: var(--muted); font-size: 13px; text-align: center; padding: 26px 16px 34px; border-top: 1px solid var(--line); background: #fff; }
.foot a { color: var(--muted); }
.foot a:hover { color: var(--accent-2); }

.pill { display: inline-flex; align-items: center; gap: 6px; border-radius: 999px; padding: 2px 10px; font: 600 12.5px var(--body); white-space: nowrap; border: 1px solid transparent; }
.pill::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill.ok { background: var(--ok-bg); color: var(--ok); border-color: #a4f4cf; }
.pill.bad { background: var(--bad-bg); color: var(--bad); border-color: var(--accent-line); }
.pill.wait { background: var(--warn-bg); color: var(--warn); border-color: #f5dc9a; }
.pill.off { background: var(--mist); color: var(--muted); border-color: var(--line); }
.statusline { display: grid; gap: 10px; }
@media (min-width: 760px) { .statusline { grid-template-columns: 1fr 1fr 1fr; } }
.statusline > div { background: var(--mist); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
.statusline b { display: block; font: 600 18px var(--head); color: var(--heading); margin-bottom: 8px; }
.statusline p { margin: 8px 0 0; font-size: 13.5px; color: var(--muted); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 12px; }
.chip { border: 1px solid var(--line-2); background: #fff; color: var(--heading); border-radius: 999px; padding: 6px 12px; font: 500 13.5px var(--body); cursor: pointer; }
.chip:hover { border-color: var(--heading); }
.chip[aria-pressed="true"] { background: var(--accent-soft); border-color: var(--accent); color: var(--accent-dark); font-weight: 600; }
.search { max-width: 320px; padding: 10px 12px !important; font-size: 15px !important; }
.tbl td small { display: block; color: var(--muted); font-size: 12.5px; }
.tbl td .err-text { color: var(--bad); font-size: 12.5px; display: block; margin-top: 3px; max-width: 280px; }
.tbl .num { font: italic 600 15px var(--head); color: var(--accent); width: 36px; }
.tbl .acts { white-space: nowrap; }
.tbl .acts button { border: 1px solid var(--line-2); background: #fff; color: var(--accent-2); border-radius: var(--radius); padding: 5px 9px; font: 600 12.5px var(--body); cursor: pointer; margin: 0 4px 4px 0; }
.tbl .acts button:hover { border-color: var(--accent); }
.empty { text-align: center; color: var(--muted); padding: 26px 10px; }
.overall { display: flex; flex-wrap: wrap; gap: 18px; align-items: center; }
.overall .big { font: 500 64px/1 var(--head); color: var(--accent-2); }
.overall .big small { font-size: 24px; color: var(--muted); }
.legend { display: flex; flex-wrap: wrap; gap: 12px; font-size: 12.5px; color: var(--muted); margin: 6px 0 4px; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 5px; vertical-align: -1px; }
.stack { display: flex; height: 8px; border-radius: 2px; overflow: hidden; margin-top: 5px; gap: 2px; }
.stack span { display: block; height: 100%; }
.s1 { background: #f6d3d3; } .s2 { background: #eeaaaa; } .s3 { background: #e27a7a; } .s4 { background: #d63e3e; } .s5 { background: #a51b1b; }
.login { max-width: 420px; margin: 48px auto 0; }
.toast { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); background: #fff; color: var(--ink); border: 1px solid var(--line); border-left: 3px solid var(--accent); border-radius: var(--radius); padding: 12px 16px; font-size: 14.5px; box-shadow: 0 24px 48px -20px rgba(0, 0, 0, .35); z-index: 40; max-width: calc(100% - 32px); display: none; }
.toast.show { display: block; }
.grid2 { display: grid; gap: 16px; }
@media (min-width: 860px) { .grid2 { grid-template-columns: 1fr 1fr; } }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; font-size: 14.5px; margin: 10px 0 0; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; color: var(--heading); font-weight: 500; word-break: break-word; }

@media print {
  .top, .toolbar, .noprint, .foot, .tabs { display: none !important; }
  body { background: #fff; }
  .panel, .kpi { break-inside: avoid; box-shadow: none; }
}
