/* ============================================================
   SBD MPC — Sistem Reka Bentuk (dari ConfirmDesign / Figma
   "Modern Enterprise Dashboard"). Font: Poppins.
   ============================================================ */

:root {
  --mpc-red: #C8102E;
  --mpc-red-bright: #D0142A;
  --mpc-red-dark: #850010;
  --ink: #1F2937;
  --muted: #6B7280;
  --muted-2: #9CA3AF;
  --line: #E5E7EB;
}

* { box-sizing: border-box; }
.is-hidden { display: none !important; }

body.mpc {
  margin: 0;
  font-family: 'Poppins', sans-serif;
  color: var(--ink);
  background: #fff;
}

/* ── LOG MASUK ─────────────────────────────────────────────── */

.login-scene {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}
.login-scene__bg {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover; object-position: center;
  animation: bgPan 20s ease-in-out infinite alternate;
  z-index: 0;
}
.login-scene__dim { position: absolute; inset: 0; background: rgba(0,0,0,.08); z-index: 1; }
.login-scene__spot { position: absolute; inset: 0; background: radial-gradient(ellipse 65% 65% at 50% 50%, rgba(255,200,180,.18) 0%, transparent 70%); z-index: 2; }
.login-scene__vignette { position: absolute; inset: 0; background: radial-gradient(ellipse at 50% 100%, rgba(200,16,46,.22) 0%, transparent 65%); z-index: 2; }

@keyframes bgPan { 0% { transform: scale(1.06) translate(0,0); } 100% { transform: scale(1.1) translate(-1%,1%); } }
@keyframes loginFade { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: translateY(0); } }
@keyframes spin { from { transform: rotate(0); } to { transform: rotate(360deg); } }

.login-card {
  position: relative; z-index: 10;
  width: min(480px, calc(100vw - 32px));
  background: rgba(255,255,255,.82);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: 28px;
  border: 1px solid rgba(255,255,255,.9);
  box-shadow: 0 20px 60px rgba(0,0,0,.15), inset 0 1px 0 rgba(255,255,255,1);
  padding: 40px 36px 32px;
  animation: loginFade .7s cubic-bezier(.4,0,.2,1) both;
}
.login-card__logo { display: flex; justify-content: center; margin-bottom: 20px; }
.login-card__logo > div { background: #fff; border-radius: 16px; padding: 12px 20px; box-shadow: 0 8px 28px rgba(0,0,0,.35); }
.login-card__logo img { width: 130px; display: block; }
.login-card h1 { color: var(--ink); font-size: 22px; font-weight: 800; text-align: center; margin: 0 0 6px; letter-spacing: -.3px; }
.login-card__sub { color: var(--muted); font-size: 13px; text-align: center; margin: 0 0 28px; }

.login-form { display: flex; flex-direction: column; gap: 14px; }
.login-field { position: relative; }
.login-field__icon { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); color: var(--muted-2); display: flex; }
.login-inp {
  width: 100%; height: 52px;
  border-radius: 999px;
  border: 1.5px solid var(--line);
  background: rgba(255,255,255,.85);
  color: var(--ink);
  font-size: 14px;
  font-family: 'Poppins', sans-serif;
  padding: 0 48px 0 44px;
  backdrop-filter: blur(4px);
  outline: none;
  transition: all .2s;
}
.login-inp::placeholder { color: #4B5563; }
.login-inp:focus { border-color: var(--mpc-red); background: #fff; box-shadow: 0 0 0 3px rgba(200,16,46,.1); }
.login-field__toggle {
  position: absolute; right: 16px; top: 50%; transform: translateY(-50%);
  background: none; border: 0; cursor: pointer; color: var(--muted-2);
  display: flex; align-items: center; padding: 0;
}

.login-row { display: flex; align-items: center; justify-content: space-between; }
.login-remember { display: flex; align-items: center; gap: 8px; cursor: pointer; font-size: 12.5px; color: #374151; }
.login-remember input { display: none; }
.login-remember .box {
  width: 18px; height: 18px; border-radius: 5px; border: 1.5px solid #D1D5DB;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
  transition: background .15s;
}
.login-remember input:checked + .box { background: var(--mpc-red); border-color: var(--mpc-red); }
.login-remember .box svg { opacity: 0; }
.login-remember input:checked + .box svg { opacity: 1; }
.login-forgot { font-size: 12.5px; font-weight: 600; color: var(--mpc-red); background: none; border: 0; cursor: pointer; text-decoration: none; }

.login-submit {
  width: 100%; height: 52px; border-radius: 999px; border: 0;
  background: linear-gradient(135deg, var(--mpc-red), #8B0010);
  color: #fff; font-size: 15px; font-weight: 700; font-family: 'Poppins', sans-serif;
  cursor: pointer;
  box-shadow: 0 6px 24px rgba(200,16,46,.45);
  display: flex; align-items: center; justify-content: center; gap: 10px;
  transition: all .2s;
}
.login-submit:hover { filter: brightness(1.05); }
.login-submit .spinner { display: none; animation: spin 1s linear infinite; }
.login-submit.loading { background: rgba(200,16,46,.7); cursor: not-allowed; box-shadow: none; }
.login-submit.loading .spinner { display: block; }
.login-submit.loading .arrow { display: none; }

.login-mydigital {
  width: 100%; height: 52px; border-radius: 999px; border: 1.5px solid var(--line);
  background: #F9FAFB; cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: 12px;
  backdrop-filter: blur(4px); transition: all .2s; margin-top: 12px;
  font-size: 14px; font-weight: 600; color: #374151; font-family: 'Poppins', sans-serif;
  text-decoration: none;
}
.login-mydigital:hover { background: #F3F4F6; }
.login-mydigital img { width: 28px; height: 28px; border-radius: 6px; object-fit: cover; }

.login-or { display: flex; align-items: center; gap: 12px; margin: 20px 0; }
.login-or::before, .login-or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.login-or span { font-size: 12px; color: var(--muted-2); white-space: nowrap; }

.login-socials { display: flex; justify-content: center; gap: 16px; }
.soc-btn {
  width: 52px; height: 52px; border-radius: 50%;
  background: #F3F4F6; border: 1px solid var(--line);
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: all .2s; backdrop-filter: blur(4px);
  color: #374151; font-size: 16px; font-weight: 700;
}
.soc-btn:hover { background: #E9EAEB; transform: translateY(-1px); }

.login-register { text-align: center; margin-top: 20px; font-size: 13px; color: var(--muted); }
.login-register a { color: var(--mpc-red); font-weight: 700; cursor: pointer; text-decoration: none; }

.login-foot {
  display: flex; align-items: center; justify-content: center; gap: 12px;
  margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--line);
  color: var(--muted-2); font-size: 11px;
}
.login-foot .sep { width: 1px; height: 12px; background: var(--line); }
.login-foot .secure { display: flex; align-items: center; gap: 5px; }

.login-error {
  background: #FEF2F2; border: 1px solid #FECACA; color: #B91C1C;
  border-radius: 14px; padding: 10px 16px; font-size: 12.5px;
}
.demo-panel { position: fixed; right: 22px; bottom: 22px; z-index: 60; }
.demo-panel__chip {
  display: flex; align-items: center; gap: 8px; cursor: default;
  background: rgba(255,255,255,.9); color: #1F2937; padding: 10px 18px; border-radius: 999px;
  font-size: 13px; font-weight: 600; box-shadow: 0 8px 24px rgba(0,0,0,.28);
  backdrop-filter: blur(12px); border: 1px solid rgba(255,255,255,.9);
}
.demo-panel__chip svg { width: 16px; height: 16px; color: #C8102E; }
.demo-panel__list {
  position: absolute; right: 0; bottom: calc(100% + 10px); width: 300px;
  background: rgba(255,255,255,.95); border: 1px solid rgba(255,255,255,.9); border-radius: 20px;
  box-shadow: 0 18px 40px rgba(0,0,0,.22); padding: 8px;
  backdrop-filter: blur(16px);
  opacity: 0; visibility: hidden; transform: translateY(6px);
  transition: opacity .18s ease, transform .18s ease, visibility .18s;
  max-height: 70vh; overflow-y: auto;
}
.demo-panel:hover .demo-panel__list,
.demo-panel:focus-within .demo-panel__list { opacity: 1; visibility: visible; transform: translateY(0); }
.demo-panel__title { font-size: 10px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: #9CA3AF; padding: 8px 12px 4px; }
.demo-account {
  display: flex; width: 100%; align-items: center; gap: 10px; text-align: left;
  background: none; border: 0; border-radius: 14px; padding: 8px 10px; cursor: pointer;
  font-family: 'Poppins', sans-serif;
}
.demo-account:hover { background: #FEF2F2; }
.demo-account__avatar {
  width: 32px; height: 32px; border-radius: 12px; flex: 0 0 32px;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg,#D0142A,#850010); color: #fff; font-size: 11px; font-weight: 700;
}
.demo-account__role { font-size: 13px; font-weight: 600; color: #1F2937; }
.demo-account__email { font-size: 11.5px; color: #9CA3AF; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ── APP SHELL (sidebar + header) ──────────────────────────── */

.shell { display: flex; height: 100vh; overflow: hidden; background: #fff; }

.sidebar {
  height: 100vh; width: 258px; flex-shrink: 0;
  display: flex; flex-direction: column;
  border-radius: 0 32px 32px 0; overflow: hidden; position: relative;
  background: linear-gradient(160deg, var(--mpc-red-bright) 0%, var(--mpc-red-dark) 100%);
  transition: width 280ms cubic-bezier(.4,0,.2,1);
}
.sidebar::before {
  content: ""; position: absolute; top: -48px; right: -48px;
  width: 176px; height: 176px; border-radius: 50%; background: rgba(255,255,255,.08);
  pointer-events: none;
}
.sidebar::after {
  content: ""; position: absolute; top: 72px; left: -36px;
  width: 112px; height: 112px; border-radius: 50%; background: rgba(255,255,255,.04);
  pointer-events: none;
}

.sidebar__brand { position: relative; z-index: 10; display: flex; align-items: center; padding: 24px 24px 20px; flex-shrink: 0; }
.sidebar__logo {
  width: 44px; height: 44px; border-radius: 14px; background: #fff; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 10px 15px -3px rgba(0,0,0,.1);
  color: var(--mpc-red); font-weight: 800; font-size: 11px; letter-spacing: -.02em;
}
.sidebar__brand-text { margin-left: 12px; overflow: hidden; transition: opacity .2s; }
.sidebar__brand-text p { margin: 0; white-space: nowrap; }
.sidebar__brand-text .l1 { color: #fff; font-weight: 600; font-size: 13px; line-height: 1.25; }
.sidebar__brand-text .l2 { color: rgba(255,255,255,.55); font-size: 11px; line-height: 1.25; margin-top: 2px; }

.sidebar__nav {
  flex: 1;
  min-height: 0;
  position: relative;
  z-index: 10;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 0 16px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,.28) transparent;
}
.sidebar__nav::-webkit-scrollbar { width: 6px; }
.sidebar__nav::-webkit-scrollbar-track { background: transparent; }
.sidebar__nav::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,.24);
  border-radius: 999px;
}
.sidebar__section {
  font-size: 10px; text-transform: uppercase; letter-spacing: .1em; font-weight: 600;
  color: rgba(255,255,255,.38); padding: 0 16px; margin: 0 0 12px;
  white-space: nowrap;
}
.sidebar__item {
  width: 100%; display: flex; align-items: center; gap: 12px;
  border-radius: 999px; margin-bottom: 4px; padding: 10px 16px;
  font-size: 13px; font-weight: 500; font-family: 'Poppins', sans-serif;
  text-align: left; border: 0; background: none; cursor: pointer;
  color: rgba(255,255,255,.72); text-decoration: none;
  transition: all .2s; white-space: nowrap;
}
.sidebar__item:hover { background: rgba(255,255,255,.1); }
.sidebar__item.active { background: #fff; color: var(--mpc-red); box-shadow: 0 4px 16px rgba(0,0,0,.18); }
.sidebar__item.disabled { color: rgba(255,255,255,.28); cursor: not-allowed; pointer-events: none; }
.sidebar__item svg { flex-shrink: 0; }
.sidebar__logo-chip { width: 24px; height: 24px; border-radius: 50%; overflow: hidden; background: #fff; flex: 0 0 24px; display: grid; place-items: center; box-shadow: 0 2px 6px rgba(0,0,0,.16); }
.sidebar__logo-chip img { width: 100%; height: 100%; object-fit: cover; }
.sidebar__back { margin: 8px 0 24px; color: rgba(255,255,255,.72); }
.sidebar-module { display: flex; align-items: center; gap: 12px; padding: 0 16px; margin: 0 0 22px; color: #fff; }
.sidebar-module__icon { width: 40px; height: 40px; border-radius: 50%; overflow: hidden; background: #fff; border: 2px solid rgba(255,255,255,.7); box-shadow: 0 8px 18px rgba(0,0,0,.16); flex-shrink: 0; }
.sidebar-module__icon img { width: 100%; height: 100%; object-fit: cover; }
.sidebar-module__title { margin: 0; color: #fff; font-size: 15px; font-weight: 800; line-height: 1.1; }
.sidebar-module__sub { margin: 3px 0 0; color: rgba(255,255,255,.48); font-size: 11px; line-height: 1.2; }
.shell--module-prototype .sidebar {
  width: 258px;
}
.shell--module-prototype .sidebar__brand {
  padding: 24px 24px 20px;
}
.shell--module-prototype .sidebar__nav {
  padding: 0 16px;
}
.shell--module-prototype .sidebar__section {
  padding: 0 16px;
}
.shell--module-prototype .sidebar__item {
  padding: 10px 16px;
}
.sidebar-module--prototype {
  position: relative;
  z-index: 10;
  margin: 2px 14px 28px;
  padding: 12px;
  border-radius: 18px;
  background: rgba(255,255,255,.1);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.08);
}
.sidebar-module--prototype .sidebar-module__icon {
  width: 42px;
  height: 42px;
}
.sidebar-module--prototype .sidebar-module__title,
.sidebar-module--prototype .sidebar-module__sub {
  max-width: 132px;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sidebar-module--prototype .sidebar-module__sub {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.module-subnav {
  width: 232px;
  height: 100vh;
  flex: 0 0 232px;
  overflow: hidden;
  border-right: 1px solid var(--line);
  background: #fff;
  display: flex;
  flex-direction: column;
}
.module-subnav__head {
  min-height: 112px;
  padding: 24px 20px 18px;
  border-bottom: 1px solid #F1F3F7;
  display: flex;
  align-items: flex-start;
  gap: 12px;
}
.module-subnav__back {
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  border-radius: 12px;
  color: var(--muted);
  background: #F9FAFB;
  border: 1px solid #EEF0F4;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}
.module-subnav__back:hover {
  background: #FEF2F2;
  color: var(--mpc-red);
}
.module-subnav__identity {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 12px;
}
.module-subnav__icon {
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  overflow: hidden;
  border-radius: 50%;
  background: #fff;
  border: 2px solid #fff;
  box-shadow: 0 6px 18px rgba(17,24,39,.12);
}
.module-subnav__icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.module-subnav__title {
  margin: 0;
  color: var(--ink);
  font-size: 17px;
  line-height: 1.2;
  font-weight: 800;
}
.module-subnav__sub {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
  font-weight: 500;
}
.module-subnav__section {
  margin: 26px 20px 12px;
  color: var(--muted-2);
  font-size: 10px;
  line-height: 1;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .08em;
}
.module-subnav__nav {
  min-height: 0;
  overflow-y: auto;
  padding: 0 14px 20px;
  scrollbar-width: none;
}
.module-subnav__nav::-webkit-scrollbar { display: none; }
.module-subnav__item {
  min-height: 44px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  margin-bottom: 6px;
  border-radius: 12px;
  color: var(--muted);
  text-decoration: none;
  font-size: 13px;
  line-height: 1.35;
  font-weight: 700;
  transition: background .2s ease, color .2s ease, transform .2s ease;
}
.module-subnav__item:hover {
  background: #F9FAFB;
  color: var(--ink);
  transform: translateX(2px);
}
.module-subnav__item.active {
  background: #FEF2F2;
  color: var(--mpc-red);
}
.module-subnav__item svg { flex: 0 0 auto; }
.module-subnav__item span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}
.shell.collapsed .module-subnav {
  width: 220px;
  flex-basis: 220px;
}
.shell--module-prototype.collapsed .sidebar {
  width: 68px;
}

.sidebar__collapse { position: relative; z-index: 10; margin-bottom: 16px; display: flex; justify-content: center; }
.sidebar__collapse button {
  width: 32px; height: 32px; border-radius: 50%; border: 0;
  background: rgba(255,255,255,.12); color: #fff; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background .2s;
}
.sidebar__collapse button:hover { background: rgba(255,255,255,.2); }

.sidebar__version { position: relative; z-index: 10; padding: 0 32px; margin-bottom: 8px; }
.sidebar__version p { margin: 0; font-size: 10px; font-weight: 500; color: rgba(255,255,255,.3); white-space: nowrap; }

.sidebar__skyline { position: relative; z-index: 10; margin-top: auto; }
.sidebar__skyline svg { width: 100%; display: block; }

/* Keadaan runtuh */
.shell.collapsed .sidebar { width: 68px; }
.shell.collapsed .sidebar__brand { padding: 24px 0 20px; justify-content: center; }
.shell.collapsed .sidebar__brand-text,
.shell.collapsed .sidebar__section,
.shell.collapsed .sidebar__item span,
.shell.collapsed .sidebar-module,
.shell.collapsed .sidebar__version,
.shell.collapsed .sidebar__skyline { display: none; }
.shell.collapsed .sidebar__nav { padding: 0 8px; }
.shell.collapsed .sidebar__item { justify-content: center; gap: 0; padding: 10px 0; }
.shell.collapsed .sidebar__module-item .sidebar__logo-chip {
  display: grid;
  width: 28px;
  height: 28px;
  flex: 0 0 28px;
}
.shell.collapsed .sidebar__module-item .sidebar__logo-chip img {
  display: block;
}
.shell--module-prototype.collapsed .sidebar-module--prototype {
  display: flex;
  justify-content: center;
  margin: 0 8px 20px;
  padding: 8px 0;
  border-radius: 16px;
}
.shell--module-prototype.collapsed .sidebar-module--prototype .sidebar-module__icon {
  width: 42px;
  height: 42px;
}
.shell--module-prototype.collapsed .sidebar-module--prototype .sidebar-module__title,
.shell--module-prototype.collapsed .sidebar-module--prototype .sidebar-module__sub {
  display: none;
}

/* ── Header ── */

.maincol { flex: 1; display: flex; flex-direction: column; overflow: hidden; }

.topbar-wrap { position: relative; z-index: 90; padding: 20px 24px 0; flex-shrink: 0; }
.topbar {
  position: relative; z-index: 91;
  background: #fff; border-radius: 20px; padding: 0 24px; height: 68px;
  display: flex; align-items: center; justify-content: space-between;
  box-shadow: 0 4px 28px rgba(0,0,0,.07);
}
.topbar__logo img { height: 36px; width: auto; object-fit: contain; display: block; }
.topbar__right { display: flex; align-items: center; gap: 4px; }
.topbar__icon {
  position: relative; width: 40px; height: 40px; border: 0; background: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center; border-radius: 12px;
  color: var(--muted); transition: background .2s;
}
.topbar__icon:hover { background: #F9FAFB; }
.topbar__icon .dot {
  position: absolute; top: 9px; right: 9px; width: 8px; height: 8px;
  border-radius: 50%; border: 2px solid #fff; background: var(--mpc-red);
}
.topbar__icon .dot--amber { background: #F59E0B; width: 7px; height: 7px; }
.topbar__divider { width: 1px; height: 32px; background: #F3F4F6; margin: 0 8px; }

.topbar__user { display: flex; align-items: center; gap: 12px; }
.topbar__avatar {
  width: 36px; height: 36px; border-radius: 12px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 11px; font-weight: 700;
  background: linear-gradient(135deg, var(--mpc-red-bright), var(--mpc-red-dark));
  box-shadow: 0 1px 2px rgba(0,0,0,.05);
}
.topbar__user .name { margin: 0; font-size: 13px; font-weight: 600; color: #1F2937; line-height: 1.25; }
.topbar__user .role { margin: 0; font-size: 11px; color: var(--muted-2); line-height: 1.25; }

.topbar-menu { position: relative; }
.topbar-menu__trigger { font-family: 'Poppins', sans-serif; }
button.topbar__user {
  border: 0;
  background: transparent;
  cursor: pointer;
  padding: 0;
  text-align: left;
  border-radius: 14px;
}
button.topbar__user:hover { background: #F9FAFB; }
.topbar-dropdown {
  position: absolute;
  top: calc(100% + 12px);
  right: 0;
  width: 280px;
  padding: 10px;
  border: 1px solid #F1F2F6;
  border-radius: 18px;
  background: rgba(255,255,255,.98);
  box-shadow: 0 18px 44px rgba(17,24,39,.14);
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px) scale(.98);
  transform-origin: top right;
  transition: opacity .18s ease, transform .18s ease, visibility .18s;
  z-index: 120;
}
.topbar-dropdown.is-open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}
.topbar-dropdown--wide { width: 330px; }
.topbar-dropdown--profile { width: 300px; }
.topbar-dropdown__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 10px 10px;
  border-bottom: 1px solid #F3F4F6;
}
.topbar-dropdown__head strong { color: #1F2937; font-size: 13px; }
.topbar-dropdown__head span { color: #9CA3AF; font-size: 10.5px; font-weight: 600; }
.topbar-dropdown__item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px;
  border-radius: 14px;
  color: inherit;
  text-decoration: none;
}
.topbar-dropdown__item:hover { background: #FEF2F2; }
.topbar-dropdown__item i {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  flex: 0 0 9px;
  margin-top: 5px;
}
.topbar-dropdown__item strong {
  display: block;
  color: #1F2937;
  font-size: 12px;
  line-height: 1.35;
}
.topbar-dropdown__item small {
  display: block;
  margin-top: 2px;
  color: #9CA3AF;
  font-size: 10.5px;
  line-height: 1.35;
}
.topbar-dropdown__foot {
  display: block;
  margin-top: 4px;
  padding: 10px;
  border-top: 1px solid #F3F4F6;
  color: #C8102E;
  text-align: center;
  font-size: 11.5px;
  font-weight: 700;
  text-decoration: none;
}
.topbar-dropdown__empty {
  padding: 12px 10px;
  color: #9CA3AF;
  font-size: 11px;
  line-height: 1.45;
}
.profile-card-mini {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  margin-bottom: 4px;
  border-radius: 16px;
  background: linear-gradient(135deg, #FFF7F7 0%, #FFF1F1 100%);
}
.profile-card-mini strong {
  display: block;
  color: #1F2937;
  font-size: 13px;
  line-height: 1.3;
}
.profile-card-mini span {
  display: block;
  color: #9CA3AF;
  font-size: 11px;
}
.topbar-dropdown__logout {
  width: 100%;
  height: 38px;
  margin-top: 6px;
  border: 0;
  border-radius: 12px;
  background: #FEF2F2;
  color: #C8102E;
  cursor: pointer;
  font-family: 'Poppins', sans-serif;
  font-size: 12px;
  font-weight: 800;
}
.tone-red { background: #C8102E; }
.tone-amber { background: #F59E0B; }
.tone-blue { background: #3B82F6; }

/* ── Kandungan ── */

.content { flex: 1; overflow: auto; padding: 0 24px 32px; scrollbar-width: none; }
.content::-webkit-scrollbar { display: none; }

.hero-card {
  border-radius: 20px; margin-top: 20px; padding: 22px 36px;
  background: linear-gradient(115deg, #FFF5F5 0%, #FFFAFA 55%, #FFF0F0 100%);
  border: 1px solid #FCE8E8;
}
.hero-card .hi { font-size: 13px; color: var(--muted-2); margin: 0 0 4px; }
.hero-card h1 { font-size: 22px; font-weight: 800; color: var(--ink); letter-spacing: -.3px; margin: 0 0 5px; line-height: 1.2; }
.hero-card .tagline { font-size: 13px; color: var(--muted); margin: 0; }

.section-title { font-size: 15px; font-weight: 700; margin: 28px 0 14px; color: var(--ink); }

.modgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 18px; }
.modcard {
  background: #fff; border: 1px solid #F3F4F6; border-radius: 20px; padding: 22px;
  box-shadow: 0 4px 24px rgba(0,0,0,.05);
  display: flex; flex-direction: column; gap: 12px;
  text-decoration: none; color: inherit;
  transition: transform .2s, box-shadow .2s;
}
.modcard:hover { transform: translateY(-3px); box-shadow: 0 12px 32px rgba(0,0,0,.09); }
.modcard__top { display: flex; align-items: center; gap: 14px; }
.modcard__img {
  width: 52px; height: 52px; border-radius: 50%; object-fit: cover;
  border: 2px solid #fff; box-shadow: 0 4px 12px rgba(0,0,0,.12); flex-shrink: 0;
}
.modcard__name { margin: 0; font-size: 16px; font-weight: 700; line-height: 1.2; }
.modcard__full { margin: 2px 0 0; font-size: 11px; color: var(--muted-2); }
.modcard__desc { margin: 0; font-size: 12.5px; color: var(--muted); line-height: 1.55; flex: 1; }
.modcard__foot { display: flex; align-items: center; justify-content: space-between; border-top: 1px solid #F3F4F6; padding-top: 12px; }
.modcard__stat { font-size: 17px; font-weight: 800; }
.modcard__statlabel { font-size: 10.5px; color: var(--muted-2); }
.modcard__go {
  width: 34px; height: 34px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; color: #fff;
}

/* ═══════════ Motion & transitions (global) ═══════════ */
@keyframes mpc-fade-up {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes mpc-fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes mpc-scale-in {
  from { opacity: 0; transform: scale(.96); }
  to   { opacity: 1; transform: scale(1); }
}

/* Page entrance */
.maincol, .content { animation: mpc-fade-in .45s cubic-bezier(.22,.8,.36,1) both; }
.login-card { animation: mpc-scale-in .5s cubic-bezier(.22,.8,.36,1) both; }
.demo-panel { animation: mpc-fade-up .5s cubic-bezier(.22,.8,.36,1) .25s both; }
.topbar-wrap { animation: mpc-fade-in .4s ease both; }

/* Module cards: staggered entrance + lift already defined above */
.modgrid > .modcard { animation: mpc-fade-up .5s cubic-bezier(.22,.8,.36,1) both; }
.modgrid > .modcard:nth-child(1) { animation-delay: .05s; }
.modgrid > .modcard:nth-child(2) { animation-delay: .11s; }
.modgrid > .modcard:nth-child(3) { animation-delay: .17s; }
.modgrid > .modcard:nth-child(4) { animation-delay: .23s; }
.modgrid > .modcard:nth-child(5) { animation-delay: .29s; }
.modgrid > .modcard:nth-child(6) { animation-delay: .35s; }
.modcard:hover .modcard__go { transform: translateX(3px); }
.modcard__go { transition: transform .2s ease; }

/* Sidebar micro-interactions */
.sidebar__item { transition: background .2s ease, color .2s ease, transform .2s ease; }
.sidebar__item:hover:not(.disabled):not(.active) { transform: translateX(3px); }

/* Buttons & inputs */
button:not(:disabled), .login-submit { transition: background .2s ease, color .2s ease, border-color .2s ease, box-shadow .2s ease, transform .15s ease, opacity .2s ease; }
button:not(:disabled):active { transform: scale(.97); }
.login-inp { transition: border-color .2s ease, box-shadow .2s ease, background .2s ease; }

/* Respect users who prefer less motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-delay: 0ms !important;
    transition-duration: .01ms !important;
  }
}

/* Mobile shell */
@media (max-width: 900px) {
  body.mpc {
    background: #F9FAFB;
    overflow-x: hidden;
  }
  .shell {
    min-height: 100vh;
    height: auto;
    overflow: visible;
    flex-direction: column;
  }
  .sidebar {
    width: 100%;
    height: auto;
    max-height: none;
    border-radius: 0 0 22px 22px;
    position: sticky;
    top: 0;
    z-index: 40;
    overflow: visible;
  }
  .shell--module-prototype .sidebar {
    width: 100%;
  }
  .sidebar::before,
  .sidebar::after,
  .sidebar__version,
  .sidebar__skyline,
  .sidebar-module__sub {
    display: none;
  }
  .sidebar__brand { padding: 14px 64px 12px 16px; }
  .sidebar__logo { width: 38px; height: 38px; border-radius: 12px; }
  .sidebar__brand-text .l1 { font-size: 12px; }
  .sidebar__brand-text .l2 { font-size: 10px; }
  .sidebar__nav {
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 70vh;
    overflow-y: auto;
    padding: 0 14px 16px;
    transition: max-height .24s ease, opacity .2s ease, padding .24s ease;
  }
  .sidebar__section { display: none; }
  .sidebar__item,
  .sidebar__back {
    width: 100%;
    flex: 0 0 auto;
    margin: 0;
    padding: 12px 14px;
    border-radius: 16px;
    background: rgba(255,255,255,.1);
    font-size: 12px;
  }
  .sidebar__item.active { box-shadow: 0 4px 14px rgba(0,0,0,.14); }
  .sidebar-module {
    flex: 0 0 auto;
    margin: 0 0 4px;
    padding: 10px 14px;
    border-radius: 16px;
    background: rgba(255,255,255,.1);
  }
  .sidebar-module--prototype {
    margin: 0 14px 10px;
    padding: 10px 12px;
  }
  .sidebar-module--prototype .sidebar-module__title,
  .sidebar-module--prototype .sidebar-module__sub {
    max-width: none;
  }
  .sidebar-module__icon { width: 34px; height: 34px; }
  .sidebar-module__title {
    max-width: 160px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 12px;
  }
  .sidebar__collapse {
    display: block;
    position: absolute;
    top: 18px;
    right: 16px;
    z-index: 45;
    margin: 0;
  }
  .sidebar__collapse button {
    width: 38px;
    height: 38px;
    background: rgba(255,255,255,.16);
    box-shadow: 0 8px 18px rgba(0,0,0,.12);
  }
  .sidebar__collapse button svg { display: none; }
  .sidebar__collapse button::before,
  .sidebar__collapse button::after {
    content: "";
    position: absolute;
    width: 18px;
    height: 2px;
    border-radius: 999px;
    background: #fff;
    transition: transform .2s ease, box-shadow .2s ease;
  }
  .sidebar__collapse button::before {
    transform: translateY(0);
    box-shadow: 0 -6px 0 #fff, 0 6px 0 #fff;
  }
  .sidebar__collapse button::after {
    transform: scaleX(0);
  }
  .shell:not(.collapsed) .sidebar__collapse button::before {
    box-shadow: none;
    transform: rotate(45deg);
  }
  .shell:not(.collapsed) .sidebar__collapse button::after {
    transform: rotate(-45deg) scaleX(1);
  }
  .shell.collapsed .sidebar { width: 100%; }
  .shell.collapsed .sidebar__brand {
    padding: 14px 64px 12px 16px;
    justify-content: flex-start;
  }
  .shell.collapsed .sidebar__brand-text,
  .shell.collapsed .sidebar__item span,
  .shell.collapsed .sidebar-module {
    display: block;
  }
  .shell.collapsed .sidebar__nav {
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    padding-top: 0;
    padding-bottom: 0;
    pointer-events: none;
  }
  .shell.collapsed .sidebar__item {
    justify-content: flex-start;
    gap: 12px;
    padding: 12px 14px;
  }
  .maincol {
    min-height: 0;
    overflow: visible;
  }
  .module-subnav {
    width: 100%;
    height: auto;
    flex: 0 0 auto;
    overflow: visible;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    position: relative;
    z-index: 35;
  }
  .module-subnav__head {
    min-height: auto;
    padding: 14px 16px 10px;
    border-bottom: 0;
    align-items: center;
  }
  .module-subnav__back {
    width: 36px;
    height: 36px;
    border-radius: 12px;
  }
  .module-subnav__icon {
    width: 34px;
    height: 34px;
    flex-basis: 34px;
  }
  .module-subnav__title {
    font-size: 14px;
  }
  .module-subnav__sub {
    max-width: 70vw;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 10.5px;
  }
  .module-subnav__section {
    display: none;
  }
  .module-subnav__nav {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 0 16px 14px;
  }
  .module-subnav__item {
    flex: 0 0 auto;
    min-height: 38px;
    margin: 0;
    padding: 9px 12px;
    white-space: nowrap;
  }
  .module-subnav__item span {
    max-width: 170px;
  }
  .topbar-wrap { padding: 12px 12px 0; }
  .topbar {
    height: auto;
    min-height: 58px;
    padding: 10px 12px;
    border-radius: 16px;
    gap: 10px;
  }
  .topbar__logo img {
    height: 28px;
    max-width: 110px;
  }
  .topbar__right {
    min-width: 0;
    gap: 2px;
  }
  .topbar__icon {
    width: 34px;
    height: 34px;
    border-radius: 10px;
  }
  .topbar__divider { display: none; }
  .topbar__user {
    gap: 8px;
    min-width: 0;
  }
  .topbar__avatar {
    width: 32px;
    height: 32px;
    border-radius: 10px;
  }
  .topbar__user .name,
  .topbar__user .role {
    max-width: 118px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .topbar-dropdown,
  .topbar-dropdown--wide,
  .topbar-dropdown--profile {
    position: fixed;
    top: 124px;
    left: 12px;
    right: 12px;
    width: auto;
    max-width: none;
    transform-origin: top right;
  }
  .content {
    overflow: visible;
    padding: 0 12px 24px;
  }
  .hero-card {
    margin-top: 14px;
    padding: 18px;
    border-radius: 18px;
  }
  .modgrid {
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr));
    gap: 12px;
  }
  .modcard {
    padding: 16px;
    border-radius: 16px;
  }
  .demo-panel {
    right: 12px;
    bottom: 12px;
    max-width: calc(100vw - 24px);
  }
  .demo-panel__list { width: min(300px, calc(100vw - 24px)); }
}

@media (max-width: 520px) {
  .login-card {
    width: calc(100vw - 24px);
    padding: 28px 20px 24px;
    border-radius: 22px;
  }
  .login-row,
  .login-foot {
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
  }
  .login-foot .sep { display: none; }
  .topbar__user > div { display: none; }
  .topbar__logo img { max-width: 96px; }
  .sidebar__item span {
    max-width: 130px;
    overflow: hidden;
    text-overflow: ellipsis;
  }
}
