/* SiPeM dalam gaya KePin — semua peraturan berskop .sipem */
@import url('https://fonts.googleapis.com/css2?family=Anton&display=swap');

.sipem { --sp-line: var(--line); }
.sipem h2 { font-size: 20px; font-weight: 700; color: var(--navy); margin: 0; }
.sipem h2.display { font-size: 26px; font-weight: 800; line-height: 1.2; color: var(--txt); }
.sipem h3 { font-size: 15.5px; font-weight: 700; color: var(--navy); margin: 0; }
.sipem .muted { color: var(--mut); }
.sipem .small { font-size: 12.5px; }
.sipem .mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.sipem .row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.sipem .between { justify-content: space-between; }
.sipem .stack { display: grid; gap: 14px; }
.sipem .cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 18px; }

/* Navigasi modul */
.sipem .sp-nav { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 16px; }
.sipem .sp-nav button { background: #fff; border: 1px solid var(--line); color: var(--mut); font: 600 13px var(--font); padding: 8px 14px; border-radius: 999px; cursor: pointer; min-height: 38px; }
.sipem .sp-nav button:hover { color: var(--navy); border-color: var(--navy-300); }
.sipem .sp-nav button[aria-current="page"] { background: var(--navy); border-color: var(--navy); color: #fff; }

/* Kepala setiap paparan */
.sipem .hero { display: grid; gap: 8px; padding: 2px 0 16px; grid-template-columns: minmax(0, 1fr); background: none; border: 0; box-shadow: none; overflow: visible; }
.sipem .hero p { color: var(--mut); max-width: 70ch; }
.sipem .eyebrow { font-size: 11px; letter-spacing: .9px; text-transform: uppercase; color: var(--red); font-weight: 700; }
.sipem .back { background: #fff; border: 1px solid var(--line); color: var(--navy); font: 600 12.5px var(--font); cursor: pointer; padding: 6px 12px; border-radius: 999px; width: max-content; }
.sipem .banner { background: var(--gold-50); border: 1px solid var(--gold-200); color: var(--gold-800); padding: 10px 14px; border-radius: 12px; font-size: 13px; }

.sipem .panel { background: #fff; border: 1px solid var(--line); border-radius: var(--r); padding: 20px; min-width: 0; box-shadow: var(--shadow); }

/* Kad program (berpita seperti KePin) */
.sipem .grid-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.sipem .card { background: #fff; border: 1.5px solid var(--line); border-top: 5px solid var(--navy); border-radius: 16px; padding: 16px; display: grid; gap: 10px; cursor: pointer; text-align: left; color: inherit; font: inherit; margin: 0; transition: box-shadow .15s, border-color .15s; box-shadow: var(--shadow); }
.sipem .card:nth-child(3n+2) { border-top-color: var(--red); }
.sipem .card:nth-child(3n+3) { border-top-color: var(--gold); }
.sipem .card:hover { box-shadow: var(--shadow-lg); border-color: var(--navy-200); }
.sipem .card .no { font: 700 11.5px var(--mono); color: var(--red); letter-spacing: .5px; }
.sipem .card h3 { font-size: 16px; line-height: 1.35; color: var(--txt); }
.sipem .meta { display: flex; flex-wrap: wrap; gap: 6px; }
.sipem .chip { font: 600 11px var(--font); padding: 3px 9px; border-radius: 999px; border: 1px solid var(--line); color: var(--mut); background: #f7f8fc; white-space: nowrap; }
.sipem .chip.org { color: #fff; background: var(--navy); border-color: var(--navy); }
.sipem .chip.ok { color: var(--ok); border-color: #bfe3cc; background: var(--ok-50); }
.sipem .chip.warn { color: var(--warn); border-color: var(--gold-200); background: var(--gold-50); }
.sipem .chip.bad { color: var(--bad); border-color: #f3b4ae; background: var(--bad-50); }
.sipem .days { display: flex; align-items: baseline; gap: 6px; }
.sipem .days b { font: 700 24px var(--font); color: var(--red); }

/* Tab dalam program / admin */
.sipem .tabs { display: flex; gap: 6px; flex-wrap: wrap; border-bottom: 1px solid var(--line); padding-bottom: 12px; overflow: visible; }
.sipem .tabs button { background: #fff; border: 1px solid var(--line); color: var(--mut); font: 600 13px var(--font); padding: 7px 13px; border-radius: 10px; cursor: pointer; min-height: 36px; }
.sipem .tabs button[aria-selected="true"] { background: var(--navy); color: #fff; border-color: var(--navy); }

/* Borang */
.sipem .form { display: grid; gap: 16px; }
.sipem .fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 12px; }
.sipem label.f { display: grid; gap: 5px; font-size: 11.5px; font-weight: 700; color: var(--label); text-transform: uppercase; letter-spacing: .6px; min-width: 0; margin: 0; }
.sipem label.f input, .sipem label.f select, .sipem label.f textarea { text-transform: none; letter-spacing: 0; font-weight: 400; }
.sipem input[data-upper] { text-transform: uppercase; }
.sipem fieldset { border: 1px solid var(--line); border-radius: 12px; padding: 14px; margin: 0; display: grid; gap: 10px; min-width: 0; background: #fbfcff; }
.sipem legend { padding: 0 6px; font-weight: 700; color: var(--navy); }
.sipem .rate { display: flex; justify-content: space-between; gap: 10px; align-items: center; flex-wrap: wrap; padding: 4px 0; border-bottom: 1px dashed var(--line); }
.sipem .rate:last-of-type { border-bottom: 0; }
.sipem .stars { display: flex; gap: 2px; }
.sipem .stars input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.sipem .stars label { font-size: 26px; line-height: 1; color: #cfd3e6; cursor: pointer; padding: 2px 3px; margin: 0; text-transform: none; }
.sipem .stars label.on { color: var(--gold); }
.sipem .stars input:focus-visible + label { outline: 3px solid var(--gold); outline-offset: 1px; border-radius: 4px; }

/* Butang: lalai = lite, primary = biru KePin */
.sipem .btn { background: var(--navy-50); color: var(--navy); border: 1px solid transparent; }
.sipem .btn:hover { background: var(--navy-100); }
.sipem .btn.primary { background: var(--navy); color: #fff; }
.sipem .btn.primary:hover { background: var(--navy-2); }
.sipem .btn.ghost { background: #fff; border-color: var(--line); }
.sipem .btn.danger { background: var(--bad-50); color: var(--bad); }
.sipem .btn[disabled] { opacity: .45; cursor: not-allowed; }

/* Jadual */
.sipem .table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.sipem table { border-collapse: collapse; width: 100%; font-size: 13px; }
.sipem th, .sipem td { padding: 8px 10px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: top; }
.sipem th { font-size: 11px; letter-spacing: .6px; text-transform: uppercase; color: var(--navy); font-weight: 700; background: #f0f1f8; }
.sipem td.num, .sipem th.num { text-align: right; font-variant-numeric: tabular-nums; }

/* Statistik & carta */
.sipem .stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.sipem .stat { display: flex; flex-direction: column-reverse; align-items: flex-start; padding: 14px 16px; }
.sipem .stats > .stat:nth-child(2) { border-top-color: var(--red); }
.sipem .stats > .stat:nth-child(3) { border-top-color: var(--gold); }
.sipem .stats > .stat:nth-child(4) { border-top-color: var(--navy-2); }
.sipem .stat b { font-size: 26px; color: var(--navy); font-weight: 700; display: block; }
.sipem .stat span { font-size: 11px; color: var(--label); font-weight: 700; text-transform: uppercase; letter-spacing: .8px; }
.sipem .bars { display: grid; gap: 7px; }
.sipem .bar { display: grid; grid-template-columns: minmax(90px, 38%) 1fr auto; gap: 10px; align-items: center; font-size: 13px; }
.sipem .bar .lb { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sipem .bar .tr { height: 10px; background: var(--navy-50); border-radius: 6px; overflow: hidden; display: block; }
.sipem .bar .fl { display: block; height: 100%; background: linear-gradient(90deg, var(--navy), var(--navy-2)); border-radius: 6px; }
.sipem .bar .v { font-weight: 700; font-variant-numeric: tabular-nums; min-width: 3ch; text-align: right; }
.sipem .month { display: grid; grid-template-columns: repeat(12, 1fr); gap: 6px; align-items: end; height: 170px; padding-top: 18px; }
.sipem .month div { display: grid; gap: 4px; justify-items: center; align-self: end; font-size: 11px; color: var(--mut); }
.sipem .month i { display: block; width: 100%; max-width: 34px; background: linear-gradient(180deg, var(--navy-2), var(--navy)); border-radius: 4px 4px 0 0; min-height: 2px; }
.sipem .month em { font-style: normal; font-weight: 700; font-size: 11px; color: var(--txt); }

/* Keputusan & sijil */
.sipem .result { border: 1px solid var(--navy-200); border-radius: 14px; padding: 16px; background: var(--navy-50); display: grid; gap: 10px; }
.sipem .result.bad { border-color: #f3b4ae; background: var(--bad-50); }
.sipem .serial { font: 700 15px var(--mono); color: var(--red); word-break: break-all; }
.sipem .queue { display: grid; gap: 8px; }
.sipem .queue .track { height: 8px; background: #e1e5f3; border-radius: 4px; overflow: hidden; }
.sipem .queue .track i { display: block; height: 100%; background: var(--navy); width: 0; }
.sipem .code { font: 700 26px var(--mono); letter-spacing: .12em; color: var(--red); user-select: all; }
.sipem .sigprev { height: 48px; max-width: 160px; object-fit: contain; background: #fff; border: 1px solid var(--line); border-radius: 6px; padding: 2px; }
.sipem .empty { padding: 26px; text-align: center; color: var(--mut); border: 2px dashed var(--line); border-radius: 14px; background: #fff; }

/* Lapisan pratonton */
.sipem .overlay { position: fixed; inset: 0; z-index: 70; background: rgba(15, 15, 40, .6); display: grid; place-items: center; padding: 16px; }
.sipem .modal { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 20px; max-width: 560px; width: 100%; max-height: 100%; overflow: auto; display: grid; gap: 14px; box-shadow: 0 20px 60px rgba(0, 0, 0, .25); }
.sipem .modal img { width: 100%; height: auto; border-radius: 6px; border: 1px solid var(--line); }

@media (max-width: 560px) {
  .sipem .bar { grid-template-columns: 1fr auto; }
  .sipem .bar .tr { grid-column: 1 / -1; order: 3; }
  .sipem .panel { padding: 16px; }
  .sipem .stars label { font-size: 30px; }
}
@media (prefers-reduced-motion: reduce) { .sipem .card { transition: none; } }
