/* ============================================================
   eCommunity UMPSA — Prototaip Tender
   Reka bentuk: app.css (token + komponen)
   <!-- SAHKAN: warna korporat sebenar dari umpsa.edu.my dan
        garis panduan identiti universiti sebelum hantar -->
   ============================================================ */

:root {
  --umpsa-ink:      #0B2545;
  --umpsa-primary:  #13315C;
  --umpsa-accent:   #C9A227;
  --umpsa-accent-soft: #F0E6C8;
  --umpsa-teal:     #1B7F79;
  --umpsa-teal-soft:#E2F1EF;
  --umpsa-clay:     #A3452F;
  --umpsa-clay-soft:#F7E8E3;
  --umpsa-sand:     #F5F2EA;
  --umpsa-paper:    #FFFFFF;
  --umpsa-line:     #DDD7C8;
  --umpsa-muted:    #556070;

  --font-display: "Plus Jakarta Sans", "Segoe UI", system-ui, sans-serif;
  --font-body: "Inter", "Segoe UI", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", "SF Mono", ui-monospace, monospace;

  --shadow-card: 0 1px 3px rgba(11,37,69,0.08);
  --shadow-pop: 0 12px 32px rgba(11,37,69,0.18);
  --radius: 12px;
  --sidebar-w: 260px;
  --sidebar-w-collapsed: 72px;
  --topbar-h: 64px;
  --focus-ring: 0 0 0 3px rgba(201,162,39,0.55);
}

/* Tema gelap — simpan nada institusi, bukan hitam pekat */
[data-theme="dark"] {
  --umpsa-ink:      #E9EEF6;
  --umpsa-primary:  #1B4B8F;
  --umpsa-accent:   #D8B54A;
  --umpsa-accent-soft: #3A3A25;
  --umpsa-teal:     #3BB3AB;
  --umpsa-teal-soft:#123936;
  --umpsa-clay:     #D97B5F;
  --umpsa-clay-soft:#42221A;
  --umpsa-sand:     #0E1626;
  --umpsa-paper:    #16233A;
  --umpsa-line:     #2C3C58;
  --umpsa-muted:    #9AA8BD;
  --shadow-card: 0 1px 3px rgba(0,0,0,0.35);
  --shadow-pop: 0 12px 32px rgba(0,0,0,0.5);
}

/* ---------- Asas ---------- */
* { box-sizing: border-box; }
html { font-size: 16px; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--umpsa-ink);
  background: var(--umpsa-sand);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
h1,h2,h3,h4 { font-family: var(--font-display); line-height: 1.25; margin: 0; }
h1 { font-size: 24px; font-weight: 700; }
h2 { font-size: 20px; font-weight: 700; }
h3 { font-size: 16px; font-weight: 600; }
a { color: var(--umpsa-primary); text-decoration: none; }
a:hover { text-decoration: underline; }
code, .mono { font-family: var(--font-mono); }

:focus-visible { outline: none; box-shadow: var(--focus-ring); border-radius: 6px; }

.skip-link {
  position: absolute; left: -9999px; top: 8px; z-index: 200;
  background: var(--umpsa-primary); color: #fff; padding: 8px 16px; border-radius: 8px;
}
.skip-link:focus { left: 8px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

/* ---------- Susun atur apl ---------- */
.app-shell { display: flex; min-height: 100vh; }

.sidebar {
  width: var(--sidebar-w); flex-shrink: 0;
  background: var(--umpsa-primary);
  color: #E7EDF6;
  display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh;
  transition: width .25s ease;
  z-index: 60;
}
.sidebar::-webkit-scrollbar { width: 0; }
.sidebar .brand {
  display: flex; align-items: center; gap: 12px;
  padding: 18px 18px 14px; border-bottom: 1px solid rgba(255,255,255,0.08);
}
.sidebar .brand img { width: 40px; height: 40px; }
.sidebar .brand .t1 { font-family: var(--font-display); font-weight: 700; font-size: 16px; letter-spacing: .02em; }
.sidebar .brand .t2 { font-size: 11px; opacity: .65; }
.sidebar nav { flex: 1; overflow-y: auto; padding: 12px 10px; }
.sidebar .nav-sec { font-size: 11px; text-transform: uppercase; letter-spacing: .12em; opacity: .5; padding: 14px 10px 6px; }
.sidebar .nav-item {
  display: flex; align-items: center; gap: 12px;
  padding: 9px 12px; border-radius: 8px; color: #CBD7E8;
  font-size: 14px; font-weight: 500; margin-bottom: 2px;
  border-left: 3px solid transparent; cursor: pointer;
}
.sidebar .nav-item:hover { background: rgba(255,255,255,0.07); color: #fff; text-decoration: none; }
.sidebar .nav-item.active {
  background: rgba(201,162,39,0.14); color: #fff;
  border-left: 3px solid var(--umpsa-accent);
}
.sidebar .nav-item .i { width: 20px; height: 20px; flex-shrink: 0; }
.sidebar .nav-item .badge-n { margin-left: auto; }
.sidebar .foot { padding: 12px 16px; font-size: 11px; opacity: .55; border-top: 1px solid rgba(255,255,255,0.08); }

.sidebar.collapsed { width: var(--sidebar-w-collapsed); }
.sidebar.collapsed .brand .txt, .sidebar.collapsed .nav-sec, .sidebar.collapsed .nav-item span { display: none; }
.sidebar.collapsed .nav-item { justify-content: center; }
.sidebar.collapsed .nav-item .badge-n { display: none; }

.backdrop { position: fixed; inset: 0; background: rgba(11,37,69,.45); z-index: 55; display: none; }

.app-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.topbar {
  height: var(--topbar-h); background: var(--umpsa-paper);
  border-bottom: 1px solid var(--umpsa-line);
  display: flex; align-items: center; gap: 14px;
  padding: 0 24px; position: sticky; top: 0; z-index: 50;
}
.crumb { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--umpsa-muted); flex-wrap: wrap; }
.crumb ol { display: flex; align-items: center; gap: 6px; list-style: none; margin: 0; padding: 0; flex-wrap: wrap; }
.crumb li+li::before { content: "/"; margin-right: 6px; color: var(--umpsa-line); }
.crumb a { color: var(--umpsa-muted); }
.crumb [aria-current] { color: var(--umpsa-ink); font-weight: 600; }
.topbar .spacer { flex: 1; }

.app-content { flex: 1; width: 100%; max-width: 1440px; margin: 0 auto; padding: 24px; }

.footer {
  border-top: 1px solid var(--umpsa-line); background: var(--umpsa-paper);
  padding: 16px 24px; font-size: 12px; color: var(--umpsa-muted);
}
.footer .flinks { display: flex; gap: 18px; flex-wrap: wrap; margin-bottom: 8px; }
.footer .fmeta { display: flex; gap: 14px; flex-wrap: wrap; align-items: center; }
.footer .fmeta .right { margin-left: auto; display: flex; gap: 10px; align-items: center; }

/* ---------- Kad, butang, lencana ---------- */
.card {
  background: var(--umpsa-paper); border: 1px solid var(--umpsa-line);
  border-radius: var(--radius); box-shadow: var(--shadow-card);
}
.card .card-h { display: flex; align-items: center; gap: 10px; padding: 16px 18px 0; }
.card .card-h .right { margin-left: auto; }
.card .card-b { padding: 16px 18px 18px; }
.card .card-h .i { width: 18px; height: 18px; color: var(--umpsa-primary); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-family: var(--font-body); font-weight: 600; font-size: 14px;
  padding: 9px 18px; border-radius: 10px; border: 1px solid transparent;
  cursor: pointer; transition: filter .15s, background .15s; text-decoration: none !important;
}
.btn .i { width: 16px; height: 16px; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-primary { background: var(--umpsa-primary); color: #fff; }
.btn-primary:hover { filter: brightness(1.15); }
.btn-accent { background: var(--umpsa-accent); color: #0B2545; }
.btn-accent:hover { filter: brightness(1.06); }
.btn-secondary { background: var(--umpsa-paper); color: var(--umpsa-ink); border-color: var(--umpsa-line); }
.btn-secondary:hover { background: var(--umpsa-sand); }
.btn-ghost { background: transparent; color: var(--umpsa-primary); }
.btn-ghost:hover { background: rgba(19,49,92,.08); }
.btn-danger { background: var(--umpsa-clay); color: #fff; }
.btn-danger:hover { filter: brightness(1.1); }
.btn-sm { padding: 5px 12px; font-size: 13px; border-radius: 8px; }
.btn-lg { padding: 13px 26px; font-size: 16px; }
.btn-block { width: 100%; }

.badge {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11px; font-weight: 600; letter-spacing: .02em;
  padding: 2px 9px; border-radius: 999px; white-space: nowrap;
}
.badge .i { width: 12px; height: 12px; }
.b-teal { background: var(--umpsa-teal-soft); color: var(--umpsa-teal); }
.b-gold { background: var(--umpsa-accent-soft); color: #7A6210; }
.b-clay { background: var(--umpsa-clay-soft); color: var(--umpsa-clay); }
.b-navy { background: rgba(19,49,92,.10); color: var(--umpsa-primary); }
.b-gray { background: rgba(85,96,112,.12); color: var(--umpsa-muted); }
[data-theme="dark"] .b-gold { color: var(--umpsa-accent); }
[data-theme="dark"] .b-navy { background: rgba(255,255,255,.09); color: #CBD7E8; }
[data-theme="dark"] .b-gray { background: rgba(255,255,255,.09); color: var(--umpsa-muted); }

.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex-shrink: 0; }
.dot-ok { background: var(--umpsa-teal); }
.dot-warn { background: var(--umpsa-accent); }
.dot-err { background: var(--umpsa-clay); }
.dot-off { background: var(--umpsa-line); }

.chip {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 13px; font-weight: 500; padding: 5px 13px; border-radius: 999px;
  border: 1px solid var(--umpsa-line); background: var(--umpsa-paper);
  color: var(--umpsa-muted); cursor: pointer;
}
.chip:hover { border-color: var(--umpsa-primary); color: var(--umpsa-primary); }
.chip.on { background: var(--umpsa-primary); border-color: var(--umpsa-primary); color: #fff; }

/* ---------- Borang ---------- */
.label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; }
.label .req { color: var(--umpsa-clay); }
.input, .select, .textarea {
  width: 100%; font-family: var(--font-body); font-size: 14px; color: var(--umpsa-ink);
  background: var(--umpsa-paper); border: 1px solid var(--umpsa-line);
  border-radius: 10px; padding: 9px 13px;
}
.textarea { min-height: 92px; resize: vertical; }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--umpsa-primary); box-shadow: var(--focus-ring); }
.field { margin-bottom: 16px; }
.hint { font-size: 12px; color: var(--umpsa-muted); margin-top: 5px; }
.err-msg { font-size: 13px; color: var(--umpsa-clay); margin-top: 6px; display: none; }
.err-msg.show { display: flex; gap: 6px; align-items: flex-start; }

.switch { position: relative; width: 40px; height: 22px; flex-shrink: 0; display: inline-block; cursor: pointer; }
.switch input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.switch .track { position: absolute; inset: 0; background: var(--umpsa-line); border-radius: 999px; transition: background .2s; }
.switch .knob { position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; background: #fff; border-radius: 50%; transition: left .2s; box-shadow: 0 1px 2px rgba(0,0,0,.25); }
.switch input:checked ~ .track { background: var(--umpsa-teal); }
.switch input:checked ~ .knob { left: 21px; }

.seg { display: inline-flex; background: var(--umpsa-sand); border: 1px solid var(--umpsa-line); border-radius: 10px; padding: 3px; gap: 2px; }
.seg button {
  font-size: 13px; font-weight: 600; font-family: var(--font-body); color: var(--umpsa-muted);
  background: transparent; border: 0; border-radius: 8px; padding: 5px 14px; cursor: pointer;
}
.seg button.on { background: var(--umpsa-paper); color: var(--umpsa-ink); box-shadow: var(--shadow-card); }

/* ---------- Jadual ---------- */
.table-scroll { overflow-x: auto; }
.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th {
  text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .06em;
  color: var(--umpsa-muted); font-weight: 600; padding: 10px 14px;
  border-bottom: 1px solid var(--umpsa-line); white-space: nowrap;
}
.tbl td { padding: 12px 14px; border-bottom: 1px solid var(--umpsa-line); vertical-align: middle; }
.tbl tbody tr:hover { background: rgba(19,49,92,.035); }
[data-theme="dark"] .tbl tbody tr:hover { background: rgba(255,255,255,.04); }
.tbl .row-click { cursor: pointer; }

/* ---------- Laci & modal & toast & dropdown ---------- */
.drawer-back, .modal-back {
  position: fixed; inset: 0; background: rgba(11,37,69,.5); z-index: 90;
  display: flex; opacity: 0; pointer-events: none; transition: opacity .2s;
}
.drawer-back.open, .modal-back.open { opacity: 1; pointer-events: auto; }
.drawer {
  margin-left: auto; width: min(440px, 94vw); height: 100%;
  background: var(--umpsa-paper); box-shadow: var(--shadow-pop);
  display: flex; flex-direction: column; transform: translateX(40px); transition: transform .25s;
}
.drawer-back.open .drawer { transform: none; }
.drawer .dr-h { display: flex; align-items: center; gap: 10px; padding: 18px 20px; border-bottom: 1px solid var(--umpsa-line); }
.drawer .dr-h .right { margin-left: auto; }
.drawer .dr-b { flex: 1; overflow-y: auto; padding: 20px; }

.modal-back { align-items: center; justify-content: center; padding: 20px; }
.modal {
  width: min(520px, 96vw); max-height: 88vh; overflow-y: auto;
  background: var(--umpsa-paper); border-radius: 14px; box-shadow: var(--shadow-pop);
  transform: translateY(12px) scale(.98); transition: transform .2s;
}
.modal-back.open .modal { transform: none; }
.modal .mo-h { display: flex; align-items: center; gap: 10px; padding: 18px 22px 0; }
.modal .mo-h .right { margin-left: auto; }
.modal .mo-b { padding: 16px 22px 22px; }

#toast-root { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); z-index: 120; display: flex; flex-direction: column; gap: 8px; width: min(430px, 92vw); }
.toast {
  display: flex; gap: 10px; align-items: flex-start; background: var(--umpsa-ink); color: #fff;
  border-radius: 10px; padding: 12px 16px; font-size: 14px; box-shadow: var(--shadow-pop);
  animation: toast-in .25s ease;
}
[data-theme="dark"] .toast { background: #E9EEF6; color: #0B2545; }
.toast .i { width: 17px; height: 17px; flex-shrink: 0; margin-top: 2px; }
.toast.ok .i { color: #6EE7D8; }
.toast.err .i { color: #F3A08D; }
[data-theme="dark"] .toast.ok .i { color: #0E5F58; }
[data-theme="dark"] .toast.err .i { color: #8C3620; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px);} to { opacity: 1; transform: none;} }

.dropdown { position: relative; }
.dd-panel {
  position: absolute; right: 0; top: calc(100% + 8px); min-width: 260px;
  background: var(--umpsa-paper); border: 1px solid var(--umpsa-line);
  border-radius: 12px; box-shadow: var(--shadow-pop); z-index: 80;
  padding: 8px; display: none;
}
.dd-panel.open { display: block; }
.dd-panel .dd-item {
  display: flex; gap: 10px; align-items: center; width: 100%; text-align: left;
  padding: 9px 12px; border-radius: 8px; font-size: 14px; color: var(--umpsa-ink);
  background: transparent; border: 0; cursor: pointer; font-family: var(--font-body);
}
.dd-panel .dd-item:hover { background: var(--umpsa-sand); text-decoration: none; }
.dd-panel .dd-hd { font-size: 11px; text-transform: uppercase; letter-spacing: .1em; color: var(--umpsa-muted); padding: 8px 12px 4px; }
.icon-btn {
  position: relative; display: inline-flex; align-items: center; justify-content: center;
  width: 38px; height: 38px; border-radius: 10px; border: 1px solid var(--umpsa-line);
  background: var(--umpsa-paper); color: var(--umpsa-ink); cursor: pointer;
}
.icon-btn:hover { background: var(--umpsa-sand); }
.icon-btn .i { width: 18px; height: 18px; }
.icon-btn .ping {
  position: absolute; top: 6px; right: 6px; width: 8px; height: 8px; border-radius: 50%;
  background: var(--umpsa-clay); border: 2px solid var(--umpsa-paper);
}

/* ---------- Avatar ---------- */
.avatar {
  border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
  font-family: var(--font-display); font-weight: 700; color: #fff; flex-shrink: 0;
  background: var(--umpsa-primary); overflow: hidden;
}
.avatar.sz-sm { width: 30px; height: 30px; font-size: 11px; }
.avatar.sz-md { width: 40px; height: 40px; font-size: 13px; }
.avatar.sz-lg { width: 56px; height: 56px; font-size: 17px; }
.avatar.sz-xl { width: 84px; height: 84px; font-size: 24px; }

/* ---------- KAD STAF — elemen tandatangan ---------- */
.staffcard { perspective: 1200px; }
.staffcard .sc-inner {
  position: relative; width: 100%; transform-style: preserve-3d;
  transition: transform .6s cubic-bezier(.2,.7,.3,1);
}
.staffcard.flipped .sc-inner { transform: rotateY(180deg); }
.staffcard .sc-face {
  backface-visibility: hidden; -webkit-backface-visibility: hidden;
  border-radius: 16px; overflow: hidden;
  background: linear-gradient(145deg, #16386B 0%, var(--umpsa-primary) 55%, #0C2447 100%);
  color: #fff; border: 1px solid rgba(201,162,39,.35);
}
.staffcard .sc-face.back { position: absolute; inset: 0; transform: rotateY(180deg); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; }
.staffcard .gold-stripe { height: 5px; background: linear-gradient(90deg, var(--umpsa-accent), #E7CE7B 45%, var(--umpsa-accent)); }
.staffcard .sc-body { display: flex; gap: 14px; padding: 16px 18px; align-items: center; }
.staffcard .avatar { background: rgba(255,255,255,.12); border: 1px solid rgba(201,162,39,.5); }
.staffcard .sc-nama { font-family: var(--font-display); font-weight: 700; font-size: 15px; line-height: 1.3; }
.staffcard .sc-meta { font-size: 11.5px; color: #C6D2E4; }
.staffcard .sc-no { font-family: var(--font-mono); font-size: 12px; color: var(--umpsa-accent); letter-spacing: .04em; }
.staffcard .sc-kampus {
  position: absolute; top: 14px; right: 16px; font-size: 10px; font-weight: 700;
  letter-spacing: .14em; text-transform: uppercase; color: #E7CE7B;
  border: 1px solid rgba(201,162,39,.5); padding: 2px 8px; border-radius: 999px;
}
.staffcard .sc-foot {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 18px 14px; font-size: 10.5px; color: #9FB0C8;
}
.staffcard .sc-flip {
  position: absolute; bottom: 12px; right: 12px; width: 30px; height: 30px; border-radius: 8px;
  background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.18); color: #E7CE7B;
  display: flex; align-items: center; justify-content: center; cursor: pointer;
}
.staffcard .sc-flip .i { width: 14px; height: 14px; }
.staffcard.mini .sc-body { padding: 12px 14px; gap: 11px; }
.staffcard.mini .sc-nama { font-size: 13px; }
.staffcard.micro { display: inline-flex; align-items: center; gap: 9px; background: linear-gradient(145deg,#16386B,#0C2447); border-radius: 10px; padding: 7px 12px 7px 8px; color: #fff; border: 1px solid rgba(201,162,39,.3); }
.staffcard.micro .sc-nama { font-size: 12.5px; }
.staffcard.micro .sc-no { font-size: 10.5px; }
.staffcard .qr-wrap { background: #fff; border-radius: 10px; padding: 8px; line-height: 0; }

/* ---------- Aliran kerja kelulusan ---------- */
.wf { display: flex; align-items: flex-start; gap: 0; overflow-x: auto; padding: 6px 2px 14px; }
.wf-step { flex: 1; min-width: 150px; position: relative; text-align: center; padding: 0 8px; }
.wf-step .wf-node {
  width: 38px; height: 38px; border-radius: 50%; margin: 0 auto 8px;
  display: flex; align-items: center; justify-content: center; position: relative; z-index: 2;
  background: var(--umpsa-paper); border: 2px solid var(--umpsa-line); color: var(--umpsa-muted);
}
.wf-step .wf-node .i { width: 17px; height: 17px; }
.wf-step:not(:last-child)::after {
  content: ""; position: absolute; top: 19px; left: calc(50% + 23px); right: calc(-50% + 23px);
  height: 2px; background: var(--umpsa-line); z-index: 1;
}
.wf-step.done .wf-node { background: var(--umpsa-teal); border-color: var(--umpsa-teal); color: #fff; }
.wf-step.done:not(:last-child)::after { background: var(--umpsa-teal); }
.wf-step.current .wf-node { background: var(--umpsa-accent); border-color: var(--umpsa-accent); color: #0B2545; box-shadow: 0 0 0 5px rgba(201,162,39,.22); }
.wf-step.rejected .wf-node { background: var(--umpsa-clay); border-color: var(--umpsa-clay); color: #fff; }
.wf-step .wf-nama { font-size: 13px; font-weight: 600; }
.wf-step .wf-peranan { font-size: 11.5px; color: var(--umpsa-muted); }
.wf-step .wf-masa { font-family: var(--font-mono); font-size: 10.5px; color: var(--umpsa-muted); margin-top: 2px; }
.wf-step .wf-catatan { font-size: 11.5px; color: var(--umpsa-muted); margin-top: 4px; font-style: italic; }
.wf-step.current .wf-nama { color: var(--umpsa-ink); }

/* ---------- Keadaan: muat / kosong / ralat ---------- */
.skeleton { border-radius: 8px; background: linear-gradient(90deg, var(--umpsa-line) 25%, var(--umpsa-sand) 50%, var(--umpsa-line) 75%); background-size: 200% 100%; animation: sk 1.2s infinite; }
@keyframes sk { from { background-position: 200% 0; } to { background-position: -200% 0; } }
.empty-state { text-align: center; padding: 44px 20px; }
.empty-state .i { width: 42px; height: 42px; color: var(--umpsa-line); }
.empty-state h3 { margin: 12px 0 4px; }
.empty-state p { color: var(--umpsa-muted); font-size: 14px; margin: 0 0 16px; }
.error-banner {
  display: flex; gap: 12px; align-items: flex-start; background: var(--umpsa-clay-soft);
  border: 1px solid rgba(163,69,47,.3); color: var(--umpsa-clay); border-radius: 12px; padding: 16px 18px;
}
.state-ctl { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.state-ctl .lbl { font-size: 11px; text-transform: uppercase; letter-spacing: .1em; color: var(--umpsa-muted); font-weight: 600; }

/* ---------- OTP ---------- */
.otp-row { display: flex; gap: 10px; justify-content: center; }
.otp-box {
  width: 46px; height: 54px; text-align: center; font-family: var(--font-mono); font-size: 22px;
  border: 1px solid var(--umpsa-line); border-radius: 10px; background: var(--umpsa-paper); color: var(--umpsa-ink);
}
.otp-box:focus { outline: none; border-color: var(--umpsa-primary); box-shadow: var(--focus-ring); }

/* ---------- Login ---------- */
.login-wrap { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; }
.login-brand {
  position: relative; overflow: hidden; color: #E9EEF6;
  background: linear-gradient(160deg, #16386B 0%, var(--umpsa-primary) 45%, #0A1F3C 100%);
  display: flex; flex-direction: column; justify-content: space-between; padding: 48px 56px;
}
.login-brand .bg-svg { position: absolute; inset: 0; width: 100%; height: 100%; opacity: .16; }
.login-brand .lb-top { position: relative; display: flex; align-items: center; gap: 14px; }
.login-brand h1 { font-size: 32px; color: #fff; }
.login-brand .lb-points { position: relative; display: flex; flex-direction: column; gap: 14px; }
.login-brand .lb-point { display: flex; gap: 12px; align-items: flex-start; font-size: 14.5px; color: #C6D2E4; }
.login-brand .lb-point .i { width: 18px; height: 18px; color: var(--umpsa-accent); flex-shrink: 0; margin-top: 3px; }
.login-panel { display: flex; flex-direction: column; background: var(--umpsa-paper); }
.login-panel .lp-inner { width: min(420px, 100%); margin: auto; padding: 40px 36px; }

/* ---------- Kemajuan ---------- */
.progress { height: 8px; border-radius: 999px; background: var(--umpsa-sand); overflow: hidden; border: 1px solid var(--umpsa-line); }
.progress > div { height: 100%; border-radius: 999px; background: var(--umpsa-teal); }
.progress.gold > div { background: var(--umpsa-accent); }
.progress.clay > div { background: var(--umpsa-clay); }

/* ---------- Tab ---------- */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--umpsa-line); overflow-x: auto; }
.tabs button {
  font-family: var(--font-body); font-size: 14px; font-weight: 600; color: var(--umpsa-muted);
  background: transparent; border: 0; border-bottom: 2px solid transparent; margin-bottom: -1px;
  padding: 10px 16px; cursor: pointer; white-space: nowrap;
}
.tabs button.on { color: var(--umpsa-primary); border-bottom-color: var(--umpsa-accent); }

/* ---------- e-Borang builder ---------- */
.eb-palette-item {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 10px;
  border: 1px dashed var(--umpsa-line); background: var(--umpsa-paper); font-size: 13.5px; font-weight: 500;
  cursor: grab; margin-bottom: 8px; user-select: none;
}
.eb-palette-item:hover { border-color: var(--umpsa-primary); background: var(--umpsa-sand); }
.eb-palette-item .i { width: 16px; height: 16px; color: var(--umpsa-primary); }
.eb-field {
  border: 1px solid var(--umpsa-line); border-radius: 12px; background: var(--umpsa-paper);
  padding: 12px 14px; margin-bottom: 10px; cursor: pointer; position: relative;
}
.eb-field:hover { border-color: var(--umpsa-primary); }
.eb-field.sel { border-color: var(--umpsa-accent); box-shadow: 0 0 0 3px rgba(201,162,39,.18); }
.eb-field.dragging { opacity: .45; }
.eb-field.drag-over { border-top: 3px solid var(--umpsa-accent); }
.eb-field .eb-tools { position: absolute; top: 8px; right: 8px; display: none; gap: 4px; }
.eb-field:hover .eb-tools, .eb-field.sel .eb-tools { display: flex; }
.eb-field .eb-tools button { width: 26px; height: 26px; border-radius: 7px; border: 1px solid var(--umpsa-line); background: var(--umpsa-paper); cursor: pointer; display: flex; align-items: center; justify-content: center; }
.eb-field .eb-tools .i { width: 13px; height: 13px; }

/* ---------- Peta SVG ---------- */
.map-svg .geofence { fill: rgba(27,127,121,.10); stroke: var(--umpsa-teal); stroke-dasharray: 6 5; stroke-width: 1.5; }
.map-svg .building { fill: rgba(19,49,92,.14); stroke: rgba(19,49,92,.3); }
.map-svg .road { stroke: var(--umpsa-line); stroke-width: 6; }
.map-svg .you { fill: var(--umpsa-accent); stroke: #fff; stroke-width: 2; }

/* ---------- Bingkai telefon ---------- */
.phone-stage { min-height: 100vh; background: var(--umpsa-sand); display: flex; align-items: center; justify-content: center; padding: 28px 16px; flex-direction: column; gap: 18px; }
.phone {
  width: 375px; height: 812px; border-radius: 44px; background: #0B2545; padding: 10px;
  box-shadow: 0 24px 60px rgba(11,37,69,.35), inset 0 0 0 2px #1E3A63; position: relative; flex-shrink: 0;
}
.phone .screen {
  width: 100%; height: 100%; border-radius: 34px; overflow: hidden; background: var(--umpsa-sand);
  display: flex; flex-direction: column; position: relative;
}
.phone .notch { position: absolute; top: 20px; left: 50%; transform: translateX(-50%); width: 120px; height: 26px; background: #0B2545; border-radius: 999px; z-index: 40; }
.m-app { flex: 1; display: flex; flex-direction: column; min-height: 0; padding-top: 44px; }
.m-scroll { flex: 1; overflow-y: auto; padding: 8px 16px 90px; }
.m-tabbar {
  position: absolute; bottom: 0; left: 0; right: 0; background: var(--umpsa-paper);
  border-top: 1px solid var(--umpsa-line); display: flex; z-index: 30; padding-bottom: 14px;
}
.m-tabbar a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 9px 0 3px; color: var(--umpsa-muted); font-size: 10px; font-weight: 600; }
.m-tabbar a .i { width: 21px; height: 21px; }
.m-tabbar a.on { color: var(--umpsa-primary); }

/* ---------- Sitemap ---------- */
.sm-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 16px; }
.sm-card { display: block; padding: 16px; transition: transform .15s, box-shadow .15s; }
.sm-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-pop); text-decoration: none; }
.sm-card .no { font-family: var(--font-mono); font-size: 11px; color: var(--umpsa-accent); font-weight: 700; }
.sm-card h3 { margin: 4px 0; color: var(--umpsa-ink); }
.sm-card p { font-size: 13px; color: var(--umpsa-muted); margin: 0; }

/* ---------- Utiliti kecil ---------- */
.text-muted { color: var(--umpsa-muted); }
.text-teal { color: var(--umpsa-teal); }
.text-clay { color: var(--umpsa-clay); }
.text-gold { color: #8C6E12; }
[data-theme="dark"] .text-gold { color: var(--umpsa-accent); }
.divider { height: 1px; background: var(--umpsa-line); border: 0; margin: 14px 0; }
.kbd { font-family: var(--font-mono); font-size: 11px; background: var(--umpsa-sand); border: 1px solid var(--umpsa-line); border-bottom-width: 2px; border-radius: 6px; padding: 1px 6px; }
.spin { animation: rot 1s linear infinite; }
@keyframes rot { to { transform: rotate(360deg); } }
.link-plain { color: inherit; }

/* ---------- Responsif ---------- */
@media (max-width: 1023px) {
  .sidebar { position: fixed; left: 0; top: 0; transform: translateX(-100%); transition: transform .25s; width: var(--sidebar-w) !important; }
  .sidebar.open-mobile { transform: none; }
  .sidebar .brand .txt, .sidebar .nav-item span { display: block !important; }
  .backdrop.show { display: block; }
  .login-wrap { grid-template-columns: 1fr; }
  .login-brand { display: none; }
}
@media (max-width: 640px) {
  .app-content { padding: 14px; }
  .topbar { padding: 0 14px; }
  h1 { font-size: 20px; }
  .otp-box { width: 40px; height: 48px; }
  .hide-sm { display: none !important; }
  .footer .fmeta .right { margin-left: 0; }
}
