/* ============================================================
   IKU 2026 — Divisi CSE LPEI · Modern UI
   ============================================================ */
:root {
  --bg: #f2f5f2;
  --surface: #ffffff;
  --ink: #0c1a12;
  --ink-2: #33443a;
  --ink-3: #64756b;
  --ink-4: #93a39a;
  --line: #e3e9e4;
  --line-2: #d2dcd4;

  --em-950: #04120b;
  --em-900: #07271a;
  --em-800: #0b3a26;
  --em-700: #0f5132;
  --em-500: #10b981;
  --em-400: #2dd4a0;
  --teal: #0ea5a5;
  --gold: #d4a843;
  --gold-light: #fdf6e3;

  --amber: #b45309; --amber-light: #fef3e2;
  --red: #b91c1c;   --red-light: #fdecec;
  --blue: #1d4ed8;  --blue-light: #ecf1fd;

  --grad: linear-gradient(135deg, #10b981 0%, #0ea5a5 100%);
  --grad-dark: linear-gradient(160deg, #07271a 0%, #04120b 100%);

  --r-sm: 10px; --r-md: 14px; --r-lg: 20px;
  --shadow-sm: 0 1px 2px rgba(7, 39, 26, .06), 0 2px 8px rgba(7, 39, 26, .05);
  --shadow-md: 0 4px 12px rgba(7, 39, 26, .08), 0 12px 32px rgba(7, 39, 26, .08);
  --shadow-glow: 0 8px 28px rgba(16, 185, 129, .35);

  --sans: 'Plus Jakarta Sans', system-ui, sans-serif;
  --disp: 'Space Grotesk', var(--sans);
  --mono: 'Space Grotesk', ui-monospace, 'Courier New', monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body { font-family: var(--sans); background: var(--bg); color: var(--ink); font-size: 14px; line-height: 1.6; -webkit-font-smoothing: antialiased; }
button { font-family: var(--sans); cursor: pointer; }
input, select, textarea { font-family: var(--sans); font-size: 13.5px; color: var(--ink); }
a { color: var(--em-700); text-decoration: none; }
a:hover { text-decoration: underline; }
.hidden { display: none !important; }

::selection { background: rgba(16, 185, 129, .25); }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: #c4d0c7; border-radius: 6px; border: 2px solid var(--bg); }
::-webkit-scrollbar-track { background: transparent; }

@keyframes fadeUp { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes popIn { from { opacity: 0; transform: scale(.96) translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes drift1 { 0%,100% { transform: translate(0,0) scale(1); } 50% { transform: translate(60px,-40px) scale(1.15); } }
@keyframes drift2 { 0%,100% { transform: translate(0,0) scale(1); } 50% { transform: translate(-70px,50px) scale(1.1); } }
@keyframes drift3 { 0%,100% { transform: translate(0,0) scale(1); } 50% { transform: translate(40px,60px) scale(.9); } }
@keyframes shimmer { 0% { background-position: -400px 0; } 100% { background-position: 400px 0; } }
@keyframes barGrow { from { width: 0; } }
@keyframes ringDraw { from { stroke-dashoffset: 226; } }

/* ============================================================
   LOGIN — aurora glassmorphism
   ============================================================ */
.login-wrap {
  position: fixed; inset: 0; overflow: hidden;
  display: flex; align-items: center; justify-content: center;
  background: var(--grad-dark); padding: 24px; z-index: 10;
}
.aurora span {
  position: absolute; border-radius: 50%; filter: blur(90px); opacity: .55;
}
.aurora span:nth-child(1) { width: 520px; height: 520px; background: #0d9468; top: -140px; left: -120px; animation: drift1 14s ease-in-out infinite; }
.aurora span:nth-child(2) { width: 440px; height: 440px; background: #0e7490; bottom: -160px; right: -100px; animation: drift2 17s ease-in-out infinite; }
.aurora span:nth-child(3) { width: 300px; height: 300px; background: #a1863a; top: 45%; left: 58%; opacity: .3; animation: drift3 20s ease-in-out infinite; }
.aurora span:nth-child(4) { width: 260px; height: 260px; background: #10b981; top: 10%; right: 22%; opacity: .25; animation: drift1 23s ease-in-out infinite reverse; }
.login-grid-overlay {
  position: absolute; inset: 0;
  background-image: linear-gradient(rgba(255,255,255,.045) 1px, transparent 1px),
                    linear-gradient(90deg, rgba(255,255,255,.045) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: radial-gradient(ellipse 70% 60% at 50% 45%, #000 30%, transparent 75%);
}
.login-card {
  position: relative; width: 100%; max-width: 420px;
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.16);
  backdrop-filter: blur(24px); -webkit-backdrop-filter: blur(24px);
  border-radius: 26px; padding: 44px 42px 34px;
  box-shadow: 0 30px 80px rgba(0,0,0,.45), inset 0 1px 0 rgba(255,255,255,.15);
  color: #fff; animation: popIn .5s cubic-bezier(.2,.9,.3,1.2);
}
.login-logo { display: flex; align-items: center; gap: 10px; margin-bottom: 26px; }
.logo-mark {
  width: 40px; height: 40px; border-radius: 13px; background: var(--grad);
  display: flex; align-items: center; justify-content: center;
  font-size: 19px; color: #fff; box-shadow: var(--shadow-glow); flex-shrink: 0;
}
.logo-text { font-family: var(--disp); font-weight: 700; font-size: 19px; letter-spacing: .02em; color: #fff; }
.logo-text span { color: var(--em-400); font-weight: 500; margin-left: 3px; }
.login-card h1 { font-family: var(--disp); font-size: 30px; font-weight: 700; line-height: 1.18; margin-bottom: 8px; }
.login-sub { font-size: 12.5px; color: rgba(255,255,255,.55); margin-bottom: 28px; line-height: 1.5; }
.login-card .field label { color: rgba(255,255,255,.65); }
.input-ico { position: relative; }
.login-card .input-ico input {
  width: 100%; padding: 13px 16px;
  background: rgba(255,255,255,.09); border: 1px solid rgba(255,255,255,.16);
  border-radius: 13px; color: #fff; transition: all .2s;
  color-scheme: dark;
}
.login-card .input-ico input::placeholder { color: rgba(255,255,255,.35); }
.login-card .input-ico input:focus { outline: none; border-color: var(--em-400); background: rgba(255,255,255,.13); box-shadow: 0 0 0 4px rgba(16,185,129,.18); }
/* Chrome autofill: override the white background that makes white text invisible */
#login-username:-webkit-autofill,
#login-username:-webkit-autofill:hover,
#login-username:-webkit-autofill:focus,
#login-password:-webkit-autofill,
#login-password:-webkit-autofill:hover,
#login-password:-webkit-autofill:focus {
  -webkit-box-shadow: 0 0 0 1000px #0b3021 inset !important;
  box-shadow: 0 0 0 1000px #0b3021 inset !important;
  -webkit-text-fill-color: #ffffff !important;
  caret-color: #fff;
}
.login-error {
  background: rgba(244, 63, 94, .16); border: 1px solid rgba(244, 63, 94, .4);
  color: #fda4af; font-size: 12.5px; padding: 10px 14px; border-radius: 12px;
  margin-bottom: 16px; display: none;
}
.login-foot { margin-top: 26px; text-align: center; font-size: 11px; color: rgba(255,255,255,.35); }

/* ============================================================
   BUTTONS & FIELDS
   ============================================================ */
.btn {
  padding: 10px 18px; border: none; border-radius: 11px;
  font-size: 13.5px; font-weight: 700; transition: all .18s; letter-spacing: .01em;
}
.btn:active { transform: scale(.97); }
.btn-primary { background: var(--grad); color: #fff; box-shadow: 0 2px 10px rgba(16,185,129,.3); }
.btn-primary:hover { filter: brightness(1.07); box-shadow: var(--shadow-glow); transform: translateY(-1px); }
.btn-glow { padding: 14px 18px; font-size: 14.5px; border-radius: 13px; }
.btn-ghost { background: var(--surface); color: var(--ink-2); border: 1px solid var(--line-2); }
.btn-ghost:hover { border-color: var(--em-500); color: var(--em-700); background: #f7fbf9; }
.btn-danger { background: var(--red-light); color: var(--red); border: 1px solid #f5c8c8; }
.btn-danger:hover { background: #fbdcdc; }
.btn-sm { padding: 6px 13px; font-size: 12px; border-radius: 9px; }
.btn-block { width: 100%; }

.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 15px; }
.field label { font-size: 11px; font-weight: 700; color: var(--ink-3); text-transform: uppercase; letter-spacing: .07em; }
.field input, .field select, .field textarea {
  padding: 10px 13px; border: 1.5px solid var(--line-2); border-radius: var(--r-sm);
  background: var(--surface); transition: all .18s;
}
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none; border-color: var(--em-500); box-shadow: 0 0 0 4px rgba(16,185,129,.13);
}

/* ============================================================
   APP SHELL — sidebar + main
   ============================================================ */
.app-shell { display: flex; min-height: 100vh; }

.sidebar {
  width: 256px; flex-shrink: 0; position: sticky; top: 0; height: 100vh;
  background: var(--grad-dark); color: #fff;
  display: flex; flex-direction: column; padding: 26px 18px 18px;
  z-index: 60;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 0 8px 24px; }
.sidebar-label {
  font-family: var(--disp); font-size: 10px; letter-spacing: .18em; text-transform: uppercase;
  color: rgba(255,255,255,.35); padding: 0 12px 10px;
}
.side-nav { display: flex; flex-direction: column; gap: 4px; flex: 1; overflow-y: auto; }
.side-nav::-webkit-scrollbar { width: 4px; }
.nav-btn {
  display: flex; align-items: center; gap: 12px; width: 100%;
  padding: 11px 13px; border: none; background: none; border-radius: 12px;
  color: rgba(255,255,255,.62); font-size: 13.5px; font-weight: 600; text-align: left;
  transition: all .18s;
}
.nav-btn .ico { font-size: 16px; width: 20px; text-align: center; filter: grayscale(.3); }
.nav-btn:hover { background: rgba(255,255,255,.07); color: #fff; }
.nav-btn.active {
  background: var(--grad); color: #fff; box-shadow: 0 4px 16px rgba(16,185,129,.35);
}
.nav-btn.active .ico { filter: none; }
.nav-sep { height: 1px; background: rgba(255,255,255,.08); margin: 10px 12px; }

.sidebar-foot { border-top: 1px solid rgba(255,255,255,.09); padding-top: 14px; margin-top: 12px; }
.user-chip { display: flex; align-items: center; gap: 11px; padding: 4px 8px 12px; }
.avatar {
  width: 38px; height: 38px; border-radius: 13px; background: var(--grad);
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 15px; color: #fff; flex-shrink: 0;
  box-shadow: 0 2px 10px rgba(16,185,129,.3);
}
.user-meta { min-width: 0; }
.user-meta .name { font-weight: 700; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-meta .role { color: rgba(255,255,255,.45); font-size: 10.5px; text-transform: uppercase; letter-spacing: .08em; }
.side-actions { display: flex; gap: 8px; padding: 0 8px; }
.side-action {
  flex: 1; padding: 8px; border: 1px solid rgba(255,255,255,.13); background: rgba(255,255,255,.05);
  border-radius: 10px; color: rgba(255,255,255,.7); font-size: 14px; transition: all .18s;
}
.side-action:hover { background: rgba(255,255,255,.12); color: #fff; }

.sidebar-backdrop { display: none; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; gap: 16px;
  padding: 14px 34px;
  background: rgba(242, 245, 242, .8);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.menu-toggle { display: none; background: none; border: 1px solid var(--line-2); border-radius: 9px; padding: 6px 11px; font-size: 15px; color: var(--ink-2); }
.topbar-title { flex: 1; min-width: 0; }
.topbar-title .crumb { font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-4); font-weight: 700; }
.topbar-title h2 { font-family: var(--disp); font-size: 19px; font-weight: 700; line-height: 1.25; }
.sem-switch {
  display: flex; background: #e6ece7; border-radius: 12px; padding: 4px; gap: 2px;
  border: 1px solid var(--line);
}
.sem-switch button {
  padding: 7px 16px; border: none; background: none; color: var(--ink-3);
  font-size: 12.5px; font-weight: 700; border-radius: 9px; transition: all .2s;
}
.sem-switch button.active { background: var(--surface); color: var(--em-700); box-shadow: var(--shadow-sm); }

.page { display: none; padding: 30px 34px 90px; max-width: 1180px; width: 100%; margin: 0 auto; }
.page.active { display: block; animation: fadeUp .35s ease; }

.section-eyebrow { font-family: var(--disp); font-size: 10.5px; letter-spacing: .16em; text-transform: uppercase; color: var(--em-500); font-weight: 700; margin-bottom: 6px; }
.section-title { font-family: var(--disp); font-size: 26px; font-weight: 700; margin-bottom: 5px; letter-spacing: -.01em; }
.section-desc { font-size: 13.5px; color: var(--ink-3); margin-bottom: 28px; max-width: 660px; }

/* ============================================================
   DASHBOARD
   ============================================================ */
.dash-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(255px, 1fr)); gap: 18px; margin-bottom: 34px; }
.dash-card {
  position: relative; overflow: hidden;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg);
  padding: 22px 24px; cursor: pointer; transition: all .22s;
  box-shadow: var(--shadow-sm);
}
.dash-card::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 4px;
  background: var(--grad); opacity: 0; transition: opacity .22s;
}
.dash-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); border-color: #c8ddd0; }
.dash-card:hover::before { opacity: 1; }
.dash-head { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 14px; }
.dash-head h3 { font-family: var(--disp); font-size: 15.5px; font-weight: 700; flex: 1; line-height: 1.3; }
.dash-head .meta { font-size: 11.5px; color: var(--ink-4); font-weight: 600; }
.ring-wrap { position: relative; width: 84px; height: 84px; flex-shrink: 0; }
.ring-wrap svg { transform: rotate(-90deg); }
.ring-bg { fill: none; stroke: #eef2ee; stroke-width: 8; }
.ring-fg { fill: none; stroke: url(#ringGrad); stroke-width: 8; stroke-linecap: round; transition: stroke-dashoffset .8s cubic-bezier(.4,0,.2,1); animation: ringDraw 1s ease; }
.ring-num {
  position: absolute; inset: 0; display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  font-family: var(--disp); font-weight: 700; font-size: 18px; color: var(--em-700);
}
.ring-num small { font-size: 9px; color: var(--ink-4); font-weight: 600; letter-spacing: .05em; }
.dash-body { display: flex; gap: 16px; align-items: center; }
.dash-facts { flex: 1; display: flex; flex-direction: column; gap: 7px; font-size: 12px; color: var(--ink-3); }
.dash-facts b { color: var(--ink); font-family: var(--disp); }
.status-dots { display: flex; gap: 5px; margin-top: 14px; flex-wrap: wrap; }
.status-dot { font-size: 10.5px; padding: 3px 10px; border-radius: 20px; font-weight: 700; display: inline-flex; align-items: center; gap: 5px; }
.status-dot::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

.recent-box { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-sm); overflow: hidden; }
.recent-box h3 {
  font-family: var(--disp); font-size: 11px; letter-spacing: .14em; text-transform: uppercase;
  color: var(--ink-4); padding: 16px 22px 12px; border-bottom: 1px solid var(--line);
}
.recent-item { padding: 11px 22px; border-bottom: 1px solid #f0f4f0; font-size: 12.5px; display: flex; gap: 12px; align-items: baseline; }
.recent-item:last-child { border-bottom: none; }
.recent-item:hover { background: #fafcfa; }
.recent-item .who { font-weight: 700; white-space: nowrap; color: var(--em-800); }
.recent-item .what { flex: 1; color: var(--ink-3); }
.recent-item .when { color: var(--ink-4); font-size: 11px; white-space: nowrap; font-family: var(--disp); }

/* ============================================================
   IKU CARDS
   ============================================================ */
.iku-grid { display: flex; flex-direction: column; gap: 14px; }
.group-label {
  font-family: var(--disp); font-size: 11px; letter-spacing: .15em; text-transform: uppercase;
  color: var(--ink-4); font-weight: 700; margin: 22px 0 4px; display: flex; align-items: center; gap: 12px;
}
.group-label::after { content: ''; flex: 1; height: 1px; background: var(--line-2); }
.iku-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md);
  overflow: hidden; box-shadow: var(--shadow-sm); transition: all .2s;
  border-left: 4px solid var(--line-2);
}
.iku-card:hover { box-shadow: var(--shadow-md); }
.iku-card.st-c-ontrack { border-left-color: var(--em-500); }
.iku-card.st-c-tercapai { border-left-color: #059669; }
.iku-card.st-c-atrisk { border-left-color: #f59e0b; }
.iku-card.st-c-offtrack { border-left-color: #ef4444; }
.iku-card.mandatory { background: #fffdf4; border-color: #ecdfb0; border-left-color: var(--gold); }
.iku-card.inactive-sem { background: #fafafa; border-left-color: #d1d5db; opacity: .78; }
.iku-card.inactive-sem .iku-header { cursor: pointer; }
.iku-card.inactive-sem .iku-name { color: var(--ink-3); }
.iku-header { padding: 16px 20px 12px; display: flex; align-items: flex-start; gap: 14px; cursor: pointer; user-select: none; }
.iku-num {
  font-family: var(--disp); font-size: 11px; font-weight: 700; color: var(--ink-4);
  background: #f0f4f0; border-radius: 8px; padding: 3px 8px; margin-top: 2px;
  flex-shrink: 0; min-width: 36px; text-align: center;
}
.iku-card.mandatory .iku-num { background: var(--gold-light); color: #8a6d1f; }
.iku-main { flex: 1; min-width: 0; }
.iku-name { font-size: 14px; font-weight: 700; line-height: 1.45; margin-bottom: 7px; }
.iku-tags { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.tag {
  font-family: var(--disp); font-size: 10px; font-weight: 600; padding: 2.5px 9px;
  border-radius: 20px; letter-spacing: .04em;
}
.tag-bobot { background: #f0f4f0; color: var(--ink-3); border: 1px solid var(--line); }
.tag-max { background: #e5f7f0; color: #047857; }
.tag-min { background: var(--blue-light); color: var(--blue); }
.tag-mandatory { background: var(--gold-light); color: #92660a; border: 1px solid #ecdfb0; }
.tag-extra { background: var(--blue-light); color: var(--blue); }
.tag-align { background: #eef2ff; color: #4338ca; }
.tag-auto { background: #ecfeff; color: #0e7490; }
.tag-type { background: #f5f0ff; color: #6d28d9; }
.tag-linked { background: #fef3c7; color: #92400e; border: 1px solid #fde68a; }
.tag-parent { background: #ecfdf5; color: #065f46; border: 1px solid #a7f3d0; }
.tag-inactive { background: #f1f1f1; color: #6b7280; border: 1px solid #dcdcdc; }
.iku-right { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; flex-shrink: 0; }
.target-badge {
  font-family: var(--disp); font-size: 12px; font-weight: 700; color: var(--em-700);
  background: #e5f7f0; padding: 4px 12px; border-radius: 20px; white-space: nowrap;
  max-width: 260px; overflow: hidden; text-overflow: ellipsis;
}
.real-badge {
  font-size: 11px; font-weight: 600; color: var(--ink-2);
  background: var(--surface-2); padding: 3px 10px; border-radius: 20px;
  white-space: nowrap; max-width: 200px; overflow: hidden; text-overflow: ellipsis;
}
.iku-chevron { color: var(--ink-4); font-size: 12px; transition: transform .25s; }
.iku-card.open .iku-chevron { transform: rotate(180deg); }

.iku-status-row { display: flex; align-items: center; gap: 12px; padding: 0 20px 14px 70px; flex-wrap: wrap; }
.status-pill { font-size: 11px; font-weight: 700; padding: 4px 13px; border-radius: 20px; display: inline-flex; align-items: center; gap: 6px; }
.status-pill::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.st-belum { background: #f0f4f0; color: var(--ink-3); }
.st-ontrack { background: #e5f7f0; color: #047857; }
.st-atrisk { background: var(--amber-light); color: var(--amber); }
.st-offtrack { background: var(--red-light); color: var(--red); }
.st-tercapai { background: #d1fae5; color: #065f46; }
.st-inactive { background: #f1f1f1; color: #6b7280; }
.mini-bar { flex: 1; max-width: 220px; height: 7px; background: #eef2ee; border-radius: 6px; overflow: hidden; }
.mini-fill { height: 100%; background: var(--grad); border-radius: 6px; animation: barGrow .8s cubic-bezier(.4,0,.2,1); }
.mini-pct { font-family: var(--disp); font-size: 12px; font-weight: 700; color: var(--ink-2); }
.capaian-chip { font-family: var(--disp); font-size: 11px; font-weight: 700; color: var(--blue); background: var(--blue-light); padding: 3px 11px; border-radius: 20px; }
.evidence-chip { font-size: 11px; color: var(--ink-4); font-weight: 600; }

/* children table — IKU CSE yang punya dept terhubung */
.children-table { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; }
.child-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 6px 10px; background: var(--surface-2); border-radius: 8px; }
.child-dept-tag { font-size: 10px; font-weight: 800; letter-spacing: .05em; color: var(--ink-3); background: var(--line); padding: 2px 7px; border-radius: 4px; flex-shrink: 0; }
.child-name { font-size: 12.5px; color: var(--ink-2); flex: 1; min-width: 140px; }
.child-managed-note { font-size: 12px; color: var(--ink-3); font-style: italic; }

/* toggle align & aktif-semester (admin) */
.toggle-group { display: flex; align-items: center; gap: 14px; margin-left: auto; flex-wrap: wrap; }
.align-toggle { display: inline-flex; align-items: center; gap: 7px; font-size: 11px; color: var(--ink-4); font-weight: 600; cursor: pointer; white-space: nowrap; }
.switch { position: relative; width: 34px; height: 19px; flex-shrink: 0; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch .track {
  position: absolute; inset: 0; background: #d5ddd6; border-radius: 20px; transition: all .2s;
}
.switch .track::after {
  content: ''; position: absolute; top: 2.5px; left: 3px; width: 14px; height: 14px;
  background: #fff; border-radius: 50%; transition: all .2s; box-shadow: 0 1px 3px rgba(0,0,0,.25);
}
.switch input:checked + .track { background: var(--em-500); }
.switch input:checked + .track::after { left: 17px; }

.iku-body { display: none; border-top: 1px solid var(--line); background: #fbfdfb; }
.iku-card.open .iku-body { display: block; animation: fadeIn .25s; }
.iku-body-inner { padding: 20px 22px 22px 70px; }
.def-block {
  background: var(--surface); border: 1px solid var(--line); border-left: 3px solid var(--em-500);
  padding: 13px 17px; border-radius: var(--r-sm);
  margin-bottom: 18px; font-size: 13px; color: var(--ink-2); white-space: pre-line;
}
.score-section-title {
  font-family: var(--disp); font-size: 10.5px; letter-spacing: .13em; text-transform: uppercase;
  color: var(--ink-4); font-weight: 700; margin: 18px 0 9px;
}
.score-table { width: 100%; border-collapse: collapse; font-size: 13px; background: var(--surface); border-radius: var(--r-sm); overflow: hidden; border: 1px solid var(--line); }
.score-table th { text-align: left; padding: 9px 13px; font-weight: 700; font-size: 11px; background: #f4f7f4; color: var(--ink-3); border-bottom: 1px solid var(--line); }
.score-table td { padding: 10px 13px; vertical-align: top; border-bottom: 1px solid #f0f4f0; color: var(--ink-2); }
.score-table tr:last-child td { border-bottom: none; }
.score-pill { display: inline-block; font-family: var(--disp); font-weight: 700; font-size: 11.5px; padding: 3px 11px; border-radius: 20px; white-space: nowrap; }
.s120 { background: #d1fae5; color: #065f46; } .s110 { background: #e5f7f0; color: #047857; }
.s100 { background: var(--blue-light); color: var(--blue); } .s90 { background: var(--blue-light); color: var(--blue); }
.s80 { background: var(--amber-light); color: var(--amber); } .s70 { background: var(--amber-light); color: var(--amber); }
.s60 { background: #fff1eb; color: #c2410c; } .s50 { background: var(--red-light); color: var(--red); }

.iku-actions { display: flex; gap: 8px; margin: 18px 0 4px; flex-wrap: wrap; }
.meas-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 14px; }
.meas-item { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 11px 15px; }
.meas-label { font-family: var(--disp); font-size: 9.5px; letter-spacing: .11em; text-transform: uppercase; color: var(--ink-4); font-weight: 700; margin-bottom: 3px; }
.meas-val { font-size: 13px; font-weight: 600; color: var(--ink-2); }

.evidence-list { margin-top: 6px; }
.evidence-item {
  display: flex; align-items: center; gap: 12px; padding: 10px 14px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-sm);
  margin-bottom: 7px; font-size: 12.5px; transition: border-color .18s;
}
.evidence-item:hover { border-color: var(--em-500); }
.evidence-item .fname { font-weight: 700; }
.evidence-item .fmeta { color: var(--ink-4); font-size: 11px; flex: 1; }
.history-item { padding: 9px 0; border-bottom: 1px dashed var(--line); font-size: 12.5px; color: var(--ink-3); }
.history-item strong { color: var(--ink-2); }

/* ============================================================
   DATA TABLES / SUMMARY
   ============================================================ */
.data-table {
  width: 100%; border-collapse: collapse; font-size: 13px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md);
  overflow: hidden; box-shadow: var(--shadow-sm);
}
.data-table th { text-align: left; padding: 11px 16px; font-size: 10.5px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; background: #f4f7f4; color: var(--ink-3); border-bottom: 1px solid var(--line); white-space: nowrap; }
.data-table td { padding: 12px 16px; border-bottom: 1px solid #f0f4f0; vertical-align: top; }
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: #fafcfa; }

.summary-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; margin-bottom: 26px; }
.sum-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md);
  padding: 16px 20px; box-shadow: var(--shadow-sm); position: relative; overflow: hidden;
}
.sum-card.hero { background: var(--grad-dark); color: #fff; border: none; }
.sum-card.hero .lbl { color: rgba(255,255,255,.5); }
.sum-card.hero .val { color: var(--em-400); }
.sum-card.hero .sub { color: rgba(255,255,255,.6); }
.sum-card .lbl { font-family: var(--disp); font-size: 9.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-4); font-weight: 700; }
.sum-card .val { font-family: var(--disp); font-size: 26px; font-weight: 700; color: var(--em-700); line-height: 1.3; }
.sum-card .sub { font-size: 11px; color: var(--ink-3); font-weight: 600; }

.toolbar { display: flex; align-items: center; gap: 10px; margin-bottom: 18px; flex-wrap: wrap; }
.toolbar .spacer { flex: 1; }

/* ============================================================
   MODAL
   ============================================================ */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(7, 25, 17, .55);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  z-index: 200; display: none; align-items: flex-start; justify-content: center;
  padding: 34px 16px; overflow-y: auto;
}
.modal-overlay.open { display: flex; animation: fadeIn .2s; }
.modal {
  background: var(--surface); border-radius: 22px; width: 100%; max-width: 620px;
  box-shadow: 0 30px 90px rgba(0,0,0,.35); margin: auto;
  animation: popIn .3s cubic-bezier(.2,.9,.3,1.15);
}
.modal.wide { max-width: 840px; }
.modal-head { padding: 24px 28px 0; display: flex; align-items: flex-start; gap: 12px; }
.modal-head h2 { font-family: var(--disp); font-size: 19px; font-weight: 700; flex: 1; line-height: 1.35; }
.modal-close { background: #f0f4f0; border: none; width: 32px; height: 32px; border-radius: 10px; font-size: 16px; color: var(--ink-3); flex-shrink: 0; transition: all .18s; }
.modal-close:hover { background: var(--red-light); color: var(--red); }
.modal-body { padding: 18px 28px 28px; }
.form-row { display: flex; gap: 12px; flex-wrap: wrap; }
.form-row .field { flex: 1; min-width: 150px; }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 20px; }

.check-row {
  display: flex; align-items: center; gap: 11px; padding: 11px 14px;
  border: 1.5px solid var(--line); border-radius: var(--r-sm); margin-bottom: 7px;
  background: var(--surface); cursor: pointer; font-size: 13px; transition: all .16s;
}
.check-row:hover { border-color: var(--em-500); background: #f7fdfa; }
.check-row.selected { background: #e5f7f0; border-color: var(--em-500); }
.check-row input { accent-color: #059669; width: 16px; height: 16px; flex-shrink: 0; }
.check-row .pts { font-family: var(--disp); font-size: 11px; font-weight: 700; color: #047857; background: #d1fae5; padding: 2px 10px; border-radius: 20px; margin-left: auto; white-space: nowrap; }
.rc-score-box {
  background: #f4f7f4; border: 1px solid var(--line); border-radius: var(--r-sm);
  padding: 9px 14px; display: flex; justify-content: space-between; margin: 8px 0 16px; font-size: 12.5px;
}
.rc-score-box .v { font-family: var(--disp); font-weight: 700; color: var(--em-700); }
.rc-result {
  background: var(--grad-dark); color: #fff; border-radius: var(--r-md);
  padding: 18px 24px; margin-top: 16px;
  display: flex; align-items: center; justify-content: space-between;
}
.rc-result .score { font-family: var(--disp); font-size: 34px; font-weight: 700; color: var(--em-400); }

.perm-table { width: 100%; border-collapse: collapse; font-size: 12.5px; margin-top: 8px; }
.perm-table th, .perm-table td { padding: 8px 10px; border-bottom: 1px solid #f0f4f0; text-align: center; }
.perm-table td:first-child, .perm-table th:first-child { text-align: left; font-weight: 600; }
.perm-table th { font-size: 10.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-3); }
.perm-table input { accent-color: #059669; width: 16px; height: 16px; }

.criteria-editor .crit-row { display: flex; gap: 8px; margin-bottom: 8px; align-items: flex-start; }
.criteria-editor .crit-row input[type=number] { width: 72px; }
.criteria-editor .crit-row input[type=text] { flex: 1; }
.criteria-editor .crit-row textarea { flex: 2.2; min-height: 40px; }
.criteria-editor input, .criteria-editor textarea { padding: 8px 10px; border: 1.5px solid var(--line-2); border-radius: 9px; background: var(--surface); }
.criteria-editor input:focus, .criteria-editor textarea:focus { outline: none; border-color: var(--em-500); }

/* revert badge & rows */
.chg-action { font-family: var(--disp); font-size: 10px; font-weight: 700; padding: 2px 9px; border-radius: 20px; text-transform: uppercase; letter-spacing: .05em; }
.chg-create { background: #d1fae5; color: #065f46; }
.chg-update { background: var(--blue-light); color: var(--blue); }
.chg-delete { background: var(--red-light); color: var(--red); }
.chg-reverted { opacity: .5; }

.toast {
  position: fixed; bottom: 26px; left: 50%; transform: translateX(-50%) translateY(90px);
  background: rgba(9, 26, 18, .92); backdrop-filter: blur(10px);
  color: #fff; padding: 12px 24px; border-radius: 30px; font-size: 13px; font-weight: 600;
  z-index: 300; transition: transform .3s cubic-bezier(.2,.9,.3,1.2);
  box-shadow: 0 10px 34px rgba(0,0,0,.3); border: 1px solid rgba(255,255,255,.12);
}
.toast.show { transform: translateX(-50%) translateY(0); }
.toast.error { background: rgba(153, 27, 27, .95); }

.empty-state { text-align: center; padding: 44px 20px; color: var(--ink-4); font-size: 13px; }

/* admin tabs */
.admin-tabs { display: flex; gap: 6px; margin-bottom: 22px; background: #e6ece7; border: 1px solid var(--line); border-radius: 12px; padding: 4px; width: fit-content; }
.admin-tab { padding: 8px 18px; border: none; background: none; border-radius: 9px; font-size: 13px; font-weight: 700; color: var(--ink-3); transition: all .18s; }
.admin-tab.active { background: var(--surface); color: var(--em-700); box-shadow: var(--shadow-sm); }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 900px) {
  .sidebar {
    position: fixed; left: 0; top: 0; bottom: 0; transform: translateX(-100%);
    transition: transform .28s cubic-bezier(.4,0,.2,1); box-shadow: 0 0 60px rgba(0,0,0,.4);
  }
  .sidebar.open { transform: none; }
  .sidebar-backdrop { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 55; }
  .sidebar.open ~ .sidebar-backdrop { display: block; animation: fadeIn .2s; }
  .menu-toggle { display: block; }
  .topbar { padding: 12px 16px; gap: 10px; }
  .topbar-title h2 { font-size: 16px; }
  .sem-switch button { padding: 7px 11px; font-size: 11.5px; }
  .page { padding: 22px 16px 70px; }
  .section-title { font-size: 21px; }

  /* kartu IKU: badge (bobot/target/realisasi) turun ke baris sendiri, full-width,
     supaya nama IKU tidak diperas jadi kolom sempit */
  .iku-header { flex-wrap: wrap; padding: 14px 16px 10px; }
  .iku-right {
    flex-basis: 100%; flex-direction: row; flex-wrap: wrap;
    align-items: center; margin-top: 8px;
  }
  .iku-chevron { margin-left: auto; }
  .iku-body-inner { padding: 16px; }
  .iku-status-row { padding: 0 16px 12px 16px; }
  .meas-grid { grid-template-columns: 1fr; }
  .login-card { padding: 34px 26px 28px; }

  /* tabel lebar (kegiatan/konten/admin) discroll horizontal, bukan mendorong
     seluruh halaman melebar */
  .data-table, .score-table, .perm-table {
    display: block; overflow-x: auto; -webkit-overflow-scrolling: touch;
  }
  .admin-tabs { max-width: 100%; overflow-x: auto; }

  /* editor kriteria: baris (skor+label+kriteria+hapus) ditumpuk vertikal,
     bukan diperas jadi kolom sempit */
  .criteria-editor .crit-row { flex-wrap: wrap; }
  .criteria-editor .crit-row input[type=text] { flex: 1 1 100%; order: 1; }
  .criteria-editor .crit-row textarea { flex: 1 1 100%; order: 2; }
  .criteria-editor .crit-row input[type=number] { order: 0; }
  .criteria-editor .crit-row .btn-danger { order: 3; margin-left: auto; }
}

@media (max-width: 480px) {
  .modal-overlay { padding: 14px 8px; }
  .modal { border-radius: 16px; }
  .modal-head { padding: 18px 18px 0; }
  .modal-head h2 { font-size: 16.5px; }
  .modal-body { padding: 14px 18px 22px; }
  .login-card { padding: 28px 20px 24px; }
  .login-card h1 { font-size: 25px; }
  .sum-card .val { font-size: 21px; }
  .rc-result .score { font-size: 27px; }
}
