:root {
  
  --pColor: #427aa1;
  --pLightColor: #ebf2fa;
  --pDarkColor: #064789 ;
  
  --pTextColor: #000000;
  --pButtonColor: #fff;
  --pPage: #f2f2f2;
  --gInput: #fff;

  /* turunan: otomatis ikut tema */
  --pCard:   var(--gInput);
  --pBorder: color-mix(in srgb, var(--pColor) 18%, #fff);
  --pMuted:  color-mix(in srgb, var(--pTextColor) 60%, #fff);
  --pShadow: color-mix(in srgb, var(--pDarkColor) 25%, transparent);
}

.main {margin-left: 200px; padding: 10px;}

.menu {
  color: white;
  margin: 0;
  height: 100%;
  padding: 0;
  width: 200px;
  position: fixed;
  overflow: hidden;
  z-index: 10;
  box-shadow: 0 0 5px var(--pLightColor);
  background-size: 40px, cover;
  background-color:var(--pColor);
  background-image: linear-gradient(var(--pColor), var(--pColor), var(--pDarkColor));
  background-repeat: repeat, no-repeat;
  background-position: center, center;
  
  display: flex;
  flex-direction: column;
  
}
.menu .sidebar-header p { padding: 5px 10px; text-align: center; }
.menu .sidebar-footer { padding: 20px 10px; margin-top: auto;  opacity: 0.7;}

.menu .logo {display: block; text-align: center; width: 100%; }

.menu ul {padding: 0; margin: 0; position: relative; }
.menu li {  padding: 10px; cursor: pointer; display: flex; align-items: center; }
.menu li.active { background-color: var(--pLightColor); color: var(--pDarkColor); font-weight: 600; }
.menu li:hover:not(.active) { background-color: var(--pLightColor); color: var(--pDarkColor); }

.menu::before {
  content: "";
  position: absolute;
  inset: -40%;
  background-image:
  url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path fill='%23ffffff14' d='M2 7 4 6 4 16 12 20 18 17 10 13 10 10 12 11 12 12 22 17 12 22 2 17 2 7M6 5 8 4 8 14 14 17 12 18 6 15 6 5M10 3 12 2 22 7 22 10 20 9 20 8 12 4 12 7 22 12 22 15 20 14 20 13 10 8 10 3'/></svg>");
  background-repeat: repeat;
  background-size: 60px 60px;
  opacity: 0.5;
  transform: rotate(-18deg);
  animation: menuPatternMove 50s linear infinite;
  pointer-events: none;
  z-index: 0;
}

.menu > * { position: relative; z-index: 1;}
@keyframes menuPatternMove {from { background-position: 0 300px; } to {background-position: 200px -300px; }
}





.footer{ text-align: center; margin-top: 50px;}

@media screen and (max-width: 700px) {
  .main {margin-left: 0px; padding: 60px 10px;}
  .menu { display: flex; justify-content: flex-end;  align-items: center; width: 100%;  height: auto; position: fixed; }
  .menu .logo { width: auto; display: flex; align-items: center;}
  .menu ul { display: flex; margin-left: auto; list-style: none;}
  .menu li { display: flex; justify-content: center; align-items: center; padding: 10px 15px; cursor: pointer; transition: all 0.3s ease;}
  .menu .sidebar-footer { display: none; }
  .menu .sidebar-header p { display: none; }
  
  .menu { flex-direction: row; align-items: center; justify-content: space-between; }
}

@media screen and (max-width: 450px) {
  .main { padding-top: 10px; padding-bottom: 90px; }
  .footer { margin-bottom: 30px; }
  
  /* ===== bottom menu ===== */
  .menu { z-index: 100; overflow: visible; bottom: 0; top: auto; position: fixed; width: 100%; height: auto;
    background: var(--pColor); box-shadow: 0 -2px 10px rgba(0,0,0,.18); padding-bottom: env(safe-area-inset-bottom, 0px); }
    .menu .logo, .menu .sidebar-header { display: none; }
    .menu::before { inset: 0; transform: none; }               /* pola tidak bocor keluar bar */
    .menu ul { display: flex; align-items: stretch; width: 100%; margin: 0; padding: 0; list-style: none; }
    
    .menu ul li { position: relative; flex: 1 1 0; min-width: 0; height: 62px; padding: 6px 2px 4px; gap: 3px;
      flex-direction: column; justify-content: center; align-items: center; text-align: center;
      font-size: 11px; line-height: 1.1; white-space: nowrap; background: transparent; color: #fff; }
      .menu ul li svg { width: 24px; height: 24px; margin: 0; flex-shrink: 0; }
      .menu ul li:hover:not(.active), .menu ul li.active { background: transparent; color: #fff; }
      .menu ul li.active { font-weight: 700; box-shadow: inset 0 3px 0 #fff; }
      .menu ul li:not(.active) { opacity: .8; }
      
      /* menu tengah: lingkaran, setengah bagian atas menonjol di atas bar */
      .menu ul li.item { justify-content: flex-end; padding-bottom: 7px; box-shadow: none; opacity: 1; overflow: visible; }
      .menu ul li.item svg { position: absolute; top: -28px; left: 50%; transform: translateX(-50%);
        box-sizing: border-box; width: 56px; height: 56px; max-width: none; padding: 13px; margin: 0;
        border-radius: 50%; border: 5px solid var(--pPage); background: var(--pDarkColor);
        box-shadow: 0 -3px 8px rgba(0,0,0,.18); transition: transform .2s ease; }
        .menu ul li.item.active svg { background: var(--pDarkColor); box-shadow: 0 -3px 10px rgba(0,0,0,.3), 0 0 0 2px #fff inset; }
        .menu ul li.item:active svg { transform: translateX(-50%) scale(.94); }
}

/* ===== mobile: kartu KPI dashboard 2 kolom ===== */
@media screen and (max-width: 450px) {
  .dash #stat-cards .card { margin: 4px; padding: 8px; font-size: 14px; }
  .dash #stat-cards .card strong { font-size: 14px; line-height: 1.25; }
  .dash #stat-cards .artikel { margin: 2px 4px 4px; gap: 2px; }
  .dash #stat-cards .artikel { font-size: 1.35em; }
  .dash #stat-cards .artikel small { font-size: 11px; }
}

button.aktif { background: var(--pColor); color: #fff; border-color: var(--pColor); }
button:disabled { opacity: 0.5; cursor: not-allowed; }
.badge { display: inline-block; min-width: 22px; padding: 0 6px; border-radius: 11px; background: var(--pColor); color: #fff; font-size: 12px; text-align: center; }

/* ===== dashboard ===== */
.dash-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 5px 5px 10px; }
.dash-head h2 { margin: 0; }
.dash-head small { color: var(--pMuted); }
.dash h3 { margin: 0 0 12px; font-size: 1.05em; }
.dash [class*='col-'] > .shadow { flex: 1; margin: 5px; padding: 14px 16px; }

.kpi-val { font-size: 1.7em; font-weight: bold; line-height: 1.2; }
.kpi-trend { color: #2e7d32 !important; display: block; }

.bars { display: flex; gap: 10px; height: 220px; }
.bar-col { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.bar-plot { position: relative; flex: 1; border-bottom: 1px solid var(--pBorder); }
.bar { position: absolute; bottom: 0; left: 50%; width: 70%; max-width: 44px; transform: translateX(-50%); background: var(--pColor); border-radius: 6px 6px 0 0; transition: filter 0.2s; }
.bar.top { background: var(--pDarkColor); }
.bar:hover { filter: brightness(1.15); }
.bar-val { position: absolute; top: -20px; left: 50%; transform: translateX(-50%); font-size: 12px; color: var(--pMuted); }
.bar-label { text-align: center; font-size: 13px; color: var(--pMuted); padding-top: 6px; }

.legend li { display: flex; align-items: center; gap: 8px; padding: 4px 0; }
.legend i { width: 12px; height: 12px; border-radius: 3px; flex-shrink: 0; }
.legend b { margin-left: auto; }
#pie-chart { margin: 4px 0 12px; }

.progress-bar-linear .progress-bar-text { display: flex; justify-content: space-between; gap: 8px; margin: 4px 0; }
.progress-bar-linear .progress-bar { height: 10px; margin-bottom: 14px; }

/* ===== dashboard: kartu sama tinggi ===== */
.dash .row { display: flex; flex-wrap: wrap; align-items: stretch; width: 100%; }
.dash .row > [class*='col-'] { float: none; display: flex; flex-direction: column; }
.dash .row.card-container > [class*='col-'] > .shadow { height: calc(100% - 10px); }
#table-container { overflow-x: auto; }
#table-container .table { min-width: 0; table-layout: auto; }
#table-container .table th, #table-container .table td { white-space: normal; }
@media screen and (max-width: 700px) {
  .dash .row > .col-2-3, .dash .row > .col-1-3, .dash .row > .col-1-2 { width: 100%; }
}

/* ===== landing page (home) ===== */
.lp { max-width: 1100px; margin: 0 auto; color: #1d1d1f; }
.lp h1, .lp h2, .lp h3 { line-height: 1.2; margin: 0; }
.lp h2 { font-size: 1.7em; margin-bottom: 8px; }
.lp-sub { color: var(--pMuted); margin: 0 0 24px; max-width: 60ch; }
.lp-section { padding: 48px 8px 8px; }

.lp-btn { border: 1px solid transparent; border-radius: 8px; padding: 10px 18px; font-weight: 600; cursor: pointer; text-decoration: none; justify-content: center; transition: filter .2s; }
.lp-btn:hover { filter: brightness(1.08); }
.lp-btn-solid { background: var(--pColor); color: #fff; }
.lp-btn-accent { background: var(--pLightColor); color: var(--pDarkColor); }
.lp-btn-outline { background: var(--pCard); color: var(--pColor); border-color: var(--pColor); padding: 6px 12px; }
.lp-btn-ghost { background: transparent; color: #fff; border-color: #ffffffaa; }
.lp a:focus-visible, .lp button:focus-visible { outline: 3px solid var(--pLightColor); outline-offset: 2px; }

.lp-nav { display: flex; align-items: center; justify-content: space-between; gap: 16px; position: sticky; top: 0; z-index: 5; margin: 0 -8px 8px; padding: 10px 16px; background: rgba(255,255,255,.94); backdrop-filter: blur(6px); border-bottom: 1px solid var(--pBorder); }
.lp-nav > .lp-menu { display: flex; align-items: center; gap: 16px; margin-left: auto; margin-right: 8px; }
.lp-links { display: flex; gap: 20px; }
.lp-burger { display: none; }
.lp-nav a { color: #333; text-decoration: none; }
.lp-nav a:hover { color: var(--pColor); }

.lp-slider { position: relative; border-radius: 16px; overflow: hidden; min-height: 380px; }
.lp-slide { position: absolute; inset: 0; display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 40px 64px; color: #fff; opacity: 0; visibility: hidden; transition: opacity .6s ease, visibility .6s; }
.lp-slide.active { position: relative; opacity: 1; visibility: visible; min-height: 380px; }
.lp-slide-text { flex: 1 1 52%; max-width: 520px; }
.lp-slide-text h1 { font-size: 2.2em; margin: 14px 0 12px; }
.lp-slide-text p { margin: 0 0 22px; opacity: .92; max-width: 46ch; }
.lp-pill { background: var(--pLightColor); display: inline-block; padding: 2px 12px; border-radius: 999px; color: var(--pDarkColor); font-size: .85em; font-weight: 600; }
.lp-slide-art { flex: 1 1 40%; display: flex; justify-content: center; }
.lp-slide-art img { width: 100%; max-width: 380px; height: auto; }
.lp-arrow { position: absolute; top: 50%; transform: translateY(-50%); width: 40px; height: 40px; border-radius: 50%; border: none; background: #ffffff33; color: #fff; font-size: 26px; line-height: 1; justify-content: center; padding: 0; z-index: 2; }
.lp-arrow:hover { background: #ffffff66; }
.lp-prev { left: 12px; } .lp-next { right: 12px; }
.lp-dots { position: absolute; bottom: 14px; left: 0; right: 0; display: flex; justify-content: center; gap: 8px; z-index: 2; }
.lp-dot { width: 10px; height: 10px; padding: 0; border-radius: 50%; border: none; background: #ffffff66; }
.lp-dot.active { background: var(--pLightColor); width: 26px; border-radius: 5px; }

.lp-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 24px; text-align: center; }
.lp-stats div { padding: 16px 8px; }
.lp-stats b { display: block; font-size: 1.9em; color: var(--pColor); }
.lp-stats span { color: var(--pMuted); font-size: .92em; }

.lp-grid { display: grid; gap: 16px; }
.lp-grid-4 { grid-template-columns: repeat(4, 1fr); }
.lp-grid-3 { grid-template-columns: repeat(3, 1fr); }
.lp-card { margin: 0; padding: 20px; background: var(--pCard); border: 1px solid var(--pBorder); border-radius: 12px; display: flex; flex-direction: column; gap: 8px; }
.lp-card h3 { font-size: 1.1em; }
.lp-card p { margin: 0; color: var(--pMuted); }
.lp-ico { width: 56px; height: 56px; border-radius: 12px; display: flex; align-items: center; justify-content: center; margin-bottom: 6px; }
.lp-ico svg { width: 32px; height: 32px; }

.lp-about { display: grid; grid-template-columns: 1.2fr 1fr; gap: 32px; align-items: center; }
.lp-about p { color: var(--pMuted); margin: 0; max-width: 56ch; }
.lp-about ul { display: grid; gap: 10px; }
.lp-about li { padding: 12px 16px 12px 44px; background: var(--pCard); border: 1px solid var(--pBorder); border-radius: 10px; position: relative; }
.lp-about li::before { content: ""; position: absolute; left: 16px; top: 50%; width: 14px; height: 8px; border-left: 3px solid var(--pColor); border-bottom: 3px solid var(--pColor); transform: translateY(-70%) rotate(-45deg); }

.lp-thumb { height: 96px; border-radius: 8px; display: flex; align-items: flex-end; padding: 10px; margin-bottom: 6px; }
.lp-thumb span { background: var(--pLightColor); color: var(--pDarkColor); padding: 1px 10px; border-radius: 999px; font-size: .8em; font-weight: 600; }
.lp-course { flex: 1; }
.lp-price { margin-top: auto; padding-top: 10px; display: flex; justify-content: space-between; align-items: center; }

.lp-quote { justify-content: space-between; }
.lp-quote blockquote { margin: 0; color: #333; }
.lp-quote figcaption { display: flex; align-items: center; gap: 12px; margin-top: 8px; }
.lp-quote figcaption img { width: 44px; height: 44px; border-radius: 50%; }
.lp-quote small { display: block; color: var(--pMuted); }

.lp-faq { max-width: 760px; margin: 0 auto; }
.lp-faq-item { border-bottom: 1px solid var(--pBorder); }
.lp-faq-item button { width: 100%; background: none; border: none; font-size: 1em; font-weight: 600; text-align: left; padding: 16px 4px; display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.lp-faq-item i { width: 10px; height: 10px; border-right: 2px solid var(--pMuted); border-bottom: 2px solid var(--pMuted); transform: rotate(45deg); transition: transform .2s; flex-shrink: 0; }
.lp-faq-item.open i { transform: rotate(-135deg); }
.lp-faq-item p { display: none; margin: 0 4px 16px; color: var(--pMuted); }
.lp-faq-item.open p { display: block; }

.lp-cta { margin-top: 56px; padding: 48px 24px; border-radius: 16px; text-align: center; color: #fff; background: linear-gradient(120deg, var(--pColor), var(--pDarkColor)); }
.lp-cta p { margin: 8px 0 22px; opacity: .92; }
.lp-cta div { display: flex; justify-content: center; gap: 12px; flex-wrap: wrap; }

@media screen and (max-width: 900px) {
  .lp-grid-4 { grid-template-columns: repeat(2, 1fr); }
  .lp-about { grid-template-columns: 1fr; }
}
@media screen and (max-width: 700px) {
  .lp-nav > .lp-menu { display: none; position: absolute; left: 0; right: 0; top: 100%; flex-direction: column; align-items: stretch; gap: 4px; margin: 0; padding: 6px 16px 16px; background: var(--pCard); border-bottom: 1px solid var(--pBorder); box-shadow: 0 12px 20px rgba(0,0,0,.12); }
  .lp-nav.open > .lp-menu { display: flex; }
  .lp-links { flex-direction: column; gap: 0; }
  .lp-links a, .lp-menu .lp-login { display: block; padding: 13px 4px; margin: 0; border-bottom: 1px solid var(--pBorder); }
  .lp-menu .lp-btn { width: 100%; margin-top: 10px; }
  .lp-nav .nf-bell { margin-left: auto; }
  .lp-burger { display: inline-flex; flex-direction: column; justify-content: center; gap: 5px; width: 40px; height: 40px; padding: 0 9px; border: none; background: transparent; }
  .lp-burger span { display: block; width: 22px; height: 2.5px; border-radius: 2px; background: #333; transition: transform .25s ease, opacity .2s ease; }
  .lp-nav.open .lp-burger span:nth-child(1) { transform: translateY(7.5px) rotate(45deg); }
  .lp-nav.open .lp-burger span:nth-child(2) { opacity: 0; }
  .lp-nav.open .lp-burger span:nth-child(3) { transform: translateY(-7.5px) rotate(-45deg); }
  .lp-slide { flex-direction: column; justify-content: center; padding: 32px 24px 48px; text-align: left; }
  .lp-slide-art { display: none; }
  .lp-slide-text h1 { font-size: 1.6em; }
  .lp-grid-3 { grid-template-columns: 1fr; }
  .lp-stats { grid-template-columns: repeat(2, 1fr); }
  .lp-arrow { display: none; }
}
@media screen and (max-width: 450px) {
  .lp-grid-4 { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) { .lp-slide { transition: none; } }

/* ===== landing page: warna mengikuti tema ===== */
.lp-slide.v0 { background: linear-gradient(120deg, var(--pColor), var(--pDarkColor)); }
.lp-slide.v1 { background: linear-gradient(120deg, var(--pDarkColor), #0b1f33); }
.lp-slide.v2 { background: linear-gradient(120deg, var(--pDarkColor), var(--pColor)); }
.lp-ico.t0, .lp-thumb.t0 { background: var(--pColor); }
.lp-ico.t1, .lp-thumb.t1 { background: var(--pDarkColor); }

/* ===== kpi: kartu sama dengan profil ===== */
.dash #stat-cards { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0; }
.dash #stat-cards::after { display: none; }
@media screen and (max-width: 900px) { .dash #stat-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media screen and (max-width: 450px) { .dash #stat-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.dash #stat-cards > [class*='col-'] { width: auto; float: none; }
.dash #stat-cards .card { flex: 1; padding: 10px; }
.dash #stat-cards .artikel { margin: 4px 10px 10px; gap: 2px; }

/* ===== isi kartu rata bawah agar proporsional ===== */
.dash .row:not(.card-container) > [class*='col-'] > .shadow { display: flex; flex-direction: column; }
.dash #bar-chart { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; }
.dash #bar-chart .bars { flex: 1; height: auto; min-height: 220px; }
.dash #pie-legend { margin-top: auto; }
.dash #progress-bars { flex: 1; display: flex; flex-direction: column; justify-content: space-between; }

/* ===== landing page: menu atas sticky (tinggi anchor) ===== */
.lp-section, .lp-cta { scroll-margin-top: 72px; }
@media screen and (max-width: 700px) and (min-width: 451px) {
  .lp-nav { top: 50px; }
  .lp-section, .lp-cta { scroll-margin-top: 130px; }
}

/* ===== profil: kartu samping + tile statistik ===== */
.pf-layout { display: grid; grid-template-columns: 340px 1fr; gap: 16px; align-items: start; padding: 5px; }
.pf-body { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.pf-body > .shadow { margin: 0; padding: 16px 18px; }
.pf-body h3 { margin: 0 0 10px; font-size: 1.15em; }
.pf-body p { margin: 0; color: #333; }

.pf-side { margin: 0; padding: 24px 20px; text-align: center; }
.pf-side h1 { margin: 14px 0 6px; font-size: 1.5em; line-height: 1.2; }
.pf-avatar .img { width: 150px; height: 150px; object-fit: cover; border-radius: 50%; border: 5px solid var(--pColor); box-shadow: 0 0 0 4px var(--pLightColor); cursor: pointer; }
.pf-badge { display: inline-block; padding: 1px 16px; border-radius: 999px; background: var(--pDarkColor); color: #fff; font-size: .9em; }
.pf-handle { margin: 6px 0 0; color: var(--pMuted); }
.pf-info { margin: 16px 0 0; text-align: left; }
.pf-info li { display: flex; align-items: center; gap: 12px; padding: 9px 4px; border-bottom: 1px solid var(--pBorder); overflow-wrap: anywhere; }
.pf-info svg { width: 26px; height: 26px; flex-shrink: 0; }
.pf-info a { color: inherit; text-decoration: none; }
.pf-info a:hover { color: var(--pColor); text-decoration: underline; }
.pf-bio { margin: 14px 0 0; color: var(--pMuted); font-size: .95em; }
.pf-progress { display: flex; justify-content: space-between; margin-top: 16px; font-size: .9em; color: var(--pMuted); }
.pf-side .progress-bar { height: 8px; margin: 4px 0 2px; }
.pf-missing { display: block; color: var(--pMuted); text-align: left; margin-bottom: 4px; }
.pf-btns { display: flex; flex-direction: column; gap: 8px; margin-top: 16px; }
.pf-btns button { width: 100%; justify-content: center; padding: 9px; background: var(--pCard); }
.pf-btns button:hover { background: var(--pLightColor); }
.pf-btns .pf-primary { background: var(--pColor); color: #fff; border-color: var(--pColor); }
.pf-btns .pf-primary:hover { background: var(--pDarkColor); }
.pf-btns svg { width: 20px; height: 20px; margin-right: 8px; }
.pf-socials { display: flex; justify-content: center; gap: 8px; margin-top: 12px; }
.pf-social { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; border: 1px solid var(--pBorder); border-radius: 8px; background: var(--pCard); }
.pf-social:hover { background: var(--pLightColor); }

.pf-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.pf-tile { padding: 14px 16px; border-radius: 10px; color: var(--pButtonColor); box-shadow: 0 4px 12px var(--pShadow); }
.pf-tile-top { display: flex; align-items: center; gap: 10px; }
.pf-tile-top b { font-size: 1.9em; line-height: 1.1; }
.pf-tile-top svg { width: 36px; height: 36px; flex-shrink: 0; filter: none; }
.pf-tile span { display: block; margin-top: 4px; }

@media screen and (max-width: 900px) { .pf-layout { grid-template-columns: 1fr; } }

/* ===== auth: login, register, lupa password ===== */
body.auth-mode #menu, body.auth-mode #footer, body.auth-mode #header { display: none; }
body.auth-mode .main { margin-left: 0; margin-right: 0; padding: 0; }
.au-wrap { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; background: linear-gradient(135deg, var(--pColor), var(--pDarkColor)); }
.au-card { position: relative; width: 100%; max-width: 420px; padding: 32px 28px 24px; background: var(--pCard); border-radius: 16px; box-shadow: 0 20px 50px rgba(0,0,0,.25); }
.au-back { position: absolute; top: 14px; left: 18px; font-size: .9em; color: var(--pMuted); text-decoration: none; }
.au-back:hover { color: var(--pColor); }
.au-logo { display: flex; justify-content: center; margin-bottom: 8px; }
.au-card h1 { margin: 0; text-align: center; font-size: 1.6em; line-height: 1.2; }
.au-sub { margin: 6px 0 18px; text-align: center; color: var(--pMuted); }
.au-field { margin-bottom: 12px; }
.au-field label { display: block; font-size: .92em; font-weight: 600; margin-bottom: 2px; }
.au-field .input { margin-top: 2px; }
.au-field .input:focus { border-color: var(--pColor); box-shadow: 0 0 0 3px var(--pLightColor); }
.au-hint { display: block; margin: -6px 0 10px; color: var(--pMuted); }
.au-check { display: flex; align-items: center; gap: 8px; font-size: .9em; margin: 0 0 12px; cursor: pointer; }
.au-cap { display: flex; gap: 8px; }
.au-cap .input { flex: 1; }
.au-refresh { width: 44px; margin-top: 5px; justify-content: center; font-size: 22px; background: var(--pLightColor); color: var(--pDarkColor); border-color: var(--pColor); }
.au-btn { width: 100%; justify-content: center; padding: 11px; margin-top: 4px; font-weight: 600; background: var(--pColor); color: #fff; border-color: var(--pColor); }
.au-btn:hover { background: var(--pDarkColor); }
.au-links { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 6px 12px; margin: 16px 0 0; font-size: .92em; }
.au-links a { color: var(--pColor); font-weight: 600; text-decoration: none; }
.au-links a:hover { text-decoration: underline; }
.au-msg { display: none; margin-bottom: 14px; padding: 10px 12px; border-radius: 8px; font-size: .92em; }
.au-msg.show { display: block; }
.au-msg.err { background: #fdecea; color: #8a1c13; border: 1px solid #f5c2bd; }
.au-msg.ok { background: #e8f5e9; color: #1b5e20; border: 1px solid #b7dfb9; }
.au-demo { margin-bottom: 14px; padding: 10px 12px; border-radius: 8px; background: var(--pLightColor); color: var(--pDarkColor); font-size: .9em; }
.au-demo strong { font-size: 1.15em; letter-spacing: 2px; }
.au-card a:focus-visible, .au-card button:focus-visible { outline: 3px solid var(--pLightColor); outline-offset: 2px; }

.auth-box { margin-top: auto; padding: 10px; }
.menu .auth-box + .sidebar-footer { margin-top: 0; }
.auth-box button { width: 100%; justify-content: center; background: #ffffff22; color: #fff; border-color: #ffffff55; }
.auth-box button:hover { background: var(--pLightColor); color: var(--pDarkColor); }
.au-user { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; min-width: 0; }
.au-ava { width: 32px; height: 32px; flex-shrink: 0; border-radius: 50%; background: var(--pLightColor); color: var(--pDarkColor); display: flex; align-items: center; justify-content: center; font-weight: 700; }
.au-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media screen and (max-width: 700px) { .menu .auth-box { display: none; } }
.lp-login { font-weight: 600; color: var(--pColor) !important; margin-right: 4px; text-decoration: none; }
.lp-login:hover { text-decoration: underline; }

/* ===== notifikasi ===== */
.nf-bell { position: relative; display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; padding: 0; border: none; border-radius: 50%; background: transparent; cursor: pointer; flex-shrink: 0; }
.nf-bell:hover { background: var(--pLightColor); }
.nf-bell svg { width: 24px; height: 24px; margin: 0; }
.nf-badge { position: absolute; top: 2px; right: 0; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: #d93025; color: #fff; font-size: 11px; font-weight: 700; line-height: 18px; text-align: center; box-sizing: border-box; }
.nf-badge[hidden] { display: none; }
.nf-tools { display: flex; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.nf-tools button { border: none; background: transparent; color: var(--pColor); font-size: 14px; padding: 6px 2px; }
.nf-tools button:hover { text-decoration: underline; }
.nf-list { list-style: none; margin: 0; padding: 0; }
.nf-item { display: flex; gap: 12px; padding: 12px 8px; border-bottom: 1px solid var(--pBorder); border-radius: 8px; cursor: pointer; }
.nf-item:hover { background: #f6f8fb; }
.nf-item.unread { background: var(--pLightColor); }
.nf-item > i { flex-shrink: 0; width: 10px; height: 10px; margin-top: 6px; border-radius: 50%; }
.nf-item:not(.unread) > i { opacity: .35; }
.nf-item b { display: block; }
.nf-item p { margin: 2px 0 4px; color: #444; font-size: .95em; }
.nf-item small { color: var(--pMuted); }
.nf-empty { text-align: center; color: var(--pMuted); padding: 24px 0; }

/* ===== font seragam, sidebar bersarang, drawer, tombol, modal, dropdown (dulu tambahan.css) ===== */
/* ---- font seragam: kontrol form, tabel, judul, badge, tombol mewarisi font body ---- */
button, input, select, textarea, table, th, td, h1, h2, h3, h4, h5, h6, label, small, strong, b, .badge, .button, .input, .label {
  font-family: inherit;
  letter-spacing: inherit;
}
input, select, textarea, button { font-size: 1rem; line-height: 1.4; }
.table th, .table td { font-size: .95rem; line-height: 1.45; }
.table th { font-weight: 600; }
.badge { font-size: .75rem; font-weight: 600; }
.side-panel .panel-body { font-size: .95rem; }
.side-panel .table th { width: 42%; }
.dash select.input, .dash input.input { width: auto; }

/* ---- sidebar: grup menu + submenu ---- */
.menu #leftmenu { flex: 0 0 auto; overflow: visible; }
/* desktop: sidebar ikut memanjang ke bawah mengikuti isi menu (tanpa scrollbar), tinggi sama dengan konten */
@media screen and (min-width: 701px) {
  body { display: flex; align-items: stretch; min-height: 100vh; }
  .menu { position: relative; flex: 0 0 200px; height: auto; min-height: 100vh; }
  .main { margin-left: 0; flex: 1 1 auto; min-width: 0; }
}
.menu #leftmenu li.grp { display: block; padding: 0; cursor: default; }
.menu #leftmenu li.grp:hover:not(.active) { background: transparent; color: inherit; }
.menu #leftmenu li.grp > .grp-t { display: flex; align-items: center; justify-content: space-between; padding: 10px; cursor: pointer; }
.menu #leftmenu li.grp > .grp-t:hover { background: var(--pLightColor); color: var(--pDarkColor); }
.menu #leftmenu li.grp > .grp-t i { width: 8px; height: 8px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg); transition: transform .2s; margin: 0 4px 3px 0; }
.menu #leftmenu li.grp.open > .grp-t i { transform: rotate(-135deg); margin-bottom: -3px; }
.menu #leftmenu li.grp.has-active > .grp-t { font-weight: 600; }
.menu #leftmenu ul.sub { display: none; background: #0000002e; }
.menu #leftmenu li.grp.open > ul.sub { display: block; }
.menu #leftmenu ul.sub li { padding: 7px 10px 7px 24px; font-size: .9rem; line-height: 1.3; display: block; }
.menu #leftmenu ul.sub ul.sub { background: #00000022; }
.menu #leftmenu ul.sub ul.sub li { padding-left: 38px; font-size: .85rem; }
.menu #leftmenu ul.sub li.grp > .grp-t { padding: 7px 10px 7px 24px; font-size: .9rem; }
.menu #leftmenu ul.sub li small { display: block; opacity: .75; font-size: .75rem; }
@media screen and (max-width: 700px) { .menu #leftmenu li.grp { display: none; } }
.menu #leftmenu ul.sub li.grp { padding: 0; }
.menu #leftmenu ul.sub ul.sub li { padding-left: 38px; }

/* ---- drawer & tabel Kelas Kuliah: ringkas ---- */
.aksi-bar { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 10px; }
.table.ringkas { margin: 0 0 10px; }
.table.ringkas th { width: 26%; vertical-align: top; }
.redup { opacity: .6; }
details.lanjut { margin: 8px 0 12px; border: 1px dashed rgba(0,0,0,.25); border-radius: 6px; padding: 0 10px; }
details.lanjut > summary { cursor: pointer; padding: 8px 0; font-weight: 600; }
details.lanjut[open] > summary { margin-bottom: 6px; }
/* kolom form DonatJS memakai float: bagian Lanjutan harus berada di bawah kolom lain dan membungkus isinya */
.side-panel form::after { content: ""; display: block; clear: both; }
details.lanjut { clear: both; display: flow-root; }

/* ---- tabel tidak keluar area: bungkus bisa digulir mendatar, kartu tidak melebar ---- */
.gTable { max-width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.shadow, .col-1-1, .col-2-3, .col-1-2, .col-1-3, .dash .row > [class*='col-'] { min-width: 0; max-width: 100%; }
.row { table-layout: fixed; }
.main #content, .main > div { min-width: 0; max-width: 100%; }
.gTable .table th, .gTable .table td { word-break: normal; overflow-wrap: anywhere; }
.gTable .table th, .table thead th { white-space: nowrap; }
.gTable .table td { min-width: 70px; }

/* ---- baris tombol drawer: Cancel, Update, Delete satu baris, rapat dan sama ukuran ---- */
.panel-body .gButton { display: flex; flex-wrap: nowrap; gap: 8px; margin: 16px 0 0; justify-content: flex-start; }
.panel-body .gButton button { flex: 1 1 0; justify-content: center; margin: 0; white-space: nowrap; }
.panel-body .aksi-bar.gButton, .panel-body .aksi-bar { flex-wrap: wrap; }
.panel-body .aksi-bar button { flex: 0 0 auto; }

/* ---- tombol seragam: font, ukuran, bobot, bentuk sama di semua tombol (drawer, toolbar, paging, konfirmasi) ---- */
.panel-body button, .aksi-bar button, .gButton button, .gPaging button, .konfirm .modal button:not(.merah) {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  font-family: inherit; font-size: .9rem; font-weight: 600; line-height: 1.4; letter-spacing: inherit;
  padding: 7px 14px; border-radius: 6px; cursor: pointer;
}
.panel-body button svg, .aksi-bar button svg, .gButton button svg, .gPaging button svg { width: 18px; height: 18px; flex-shrink: 0; }

/* ---- warna latar menurut fungsi (atribut data-action): Add hijau, Edit/Update biru tema, Delete merah, Cancel/Back abu-abu, lainnya biru muda ---- */
:root { --aksi-add: #2e7d32; --aksi-edit: var(--pColor); --aksi-delete: #d9534f; --aksi-back: #6c757d; --aksi-info: #2b9fc9; }
button[data-action] { color: #fff; border: 1px solid rgba(0,0,0,.15); background: var(--aksi-info); }
button[data-action] svg path { fill: #fff; }
button[data-action="Add"], button[data-action="Insert"] { background: var(--aksi-add); }
button[data-action="Edit"], button[data-action="Update"], button[data-action="Save"] { background: var(--aksi-edit); }
button[data-action="Delete"] { background: var(--aksi-delete); }
button[data-action="Cancel"], button[data-action="Back"] { background: var(--aksi-back); }
button[data-action]:hover:not(:disabled) { filter: brightness(.92); }
button[data-action]:focus-visible { outline: 3px solid var(--pLightColor); outline-offset: 2px; }
/* cadangan: kelas warna bawaan DonatJS (getWarna) */
button.red, .button.red { background: var(--aksi-delete); color: #fff; }
button.grey, .button.grey { background: var(--aksi-back); color: #fff; }

/* ---- modal konfirmasi (tengah layar, di atas drawer) ---- */
.depan.konfirm { display: flex; align-items: center; justify-content: center; z-index: 2000; }
.depan.konfirm .modal { width: min(420px, 92%); margin: 0; box-shadow: 0 10px 30px rgba(0,0,0,.3); overflow: hidden; }
.depan.konfirm .modalbar button.merah { background: transparent; font-size: 1.1rem; }
.depan.konfirm .modalcontent { padding: 16px 20px 20px; display: block; }
.depan.konfirm .info { text-align: left; padding: 4px 0 8px; line-height: 1.5; }
.depan.konfirm .gButton { justify-content: flex-end; margin: 12px 0 0; }

/* ---- dropdown id dengan pencarian (pilihan.js) ---- */
.pil-list { position: fixed; z-index: 3000; overflow-y: auto; background: var(--pCard); border: 1px solid #bbb; border-radius: 4px; box-shadow: 0 8px 20px rgba(0,0,0,.2); font-size: .95rem; }
.pil-item { padding: 7px 10px; cursor: pointer; }
.pil-item:hover, .pil-item.hl { background: var(--pLightColor); }
.pil-item.cur { background: var(--pColor); color: #fff; }
.pil-kosong { padding: 8px 10px; opacity: .6; }

/* ---- garis kiri baris terpilih: garis lurus, bukan kurung ---- */
.table tbody tr, #table .table tbody tr.selected { border-radius: 0; }
#table .table tbody tr.selected { box-shadow: none; border: 0; }
#table .table tbody tr.selected > td:first-child, #table .table tbody tr.selected > th:first-child { box-shadow: inset 4px 0 0 var(--pColor); }

/* ---- drawer: baris tombol (Cancel, Update, Delete, Insert, dll) berada di atas, TIDAK sticky ----
   Baris tombol ada di akhir DOM (donat.js), jadi diurutkan ke atas dengan flex order. Tombol navigasi (.aksi-bar) tetap paling atas. */
.side-panel .panel-body { display: flex; flex-direction: column; }
.side-panel .panel-body > * { flex: 0 0 auto; }
.side-panel .panel-body > .aksi-bar { order: -2; }
.side-panel .panel-body > :has(> .gButton) { order: -1; margin: 0 0 12px; padding: 0 0 10px; border-bottom: 1px solid var(--pBorder); }
.side-panel .panel-body > :has(> .gButton) > .gButton { margin: 0; }

/* ---- halaman detail: menu samping (ui.subnav) + isi (ui.panel dengan nav), dipakai dkelas.js dan kuliah.js (jadwal kelas) ---- */
.dt-layout { display: grid; grid-template-columns: 220px minmax(0, 1fr); align-items: start; }
.dt-layout > .shadow { margin: 5px; padding: 14px 16px; }
.dt-layout > .dt-nav { padding: 8px; position: sticky; top: 10px; }
.dt-menu li { padding: 9px 12px; border-left: 3px solid transparent; border-radius: 6px; cursor: pointer; }
.dt-menu li:hover { background: var(--pLightColor); }
.dt-menu li.active { background: var(--pLightColor); color: var(--pDarkColor); font-weight: 600; border-left-color: var(--pColor); }
.dt-menu li.belum:not(.active) { opacity: .6; }
.dt-main h3 { margin: 18px 0 8px; font-size: 1.05em; }
.dt-main > h3:first-child, .dt-main > .aksi-bar + h3 { margin-top: 0; }
@media screen and (max-width: 900px) {
  .dt-layout { grid-template-columns: minmax(0, 1fr); }
  .dt-layout > .dt-nav { position: static; }
  .dt-menu { display: flex; gap: 4px; overflow-x: auto; }
  .dt-menu li { flex: 0 0 auto; white-space: nowrap; }
}

/* Cetak laporan (mhspa: Daftar Mahasiswa Bimbingan). Alasan: belum ada aturan @media print; kerangka aplikasi disembunyikan agar hanya isi halaman tercetak. */
@page { size: A4 landscape; margin: 12mm; }
@media print {
  #menu, #header, #footer, #bawah, #modal, #panel-container, .dash-head, .aksi-bar, .gpaging { display: none !important; }
  /* tabel daftar dan tab anak (menu Cetak seragam, ui.cetakTabel): kontrol layar tidak tercetak; remah roti dan kartu ringkasan induk tetap */
  #filter-sel, #filter-cari, #filter-info, .dt-nav, .tabbar, .tab-isi .input { display: none !important; }
  .dt-layout { display: block; }   /* tanpa menu kiri, isi tidak boleh terjepit di kolom 220 px grid */
  .main { margin: 0; padding: 0; }
  .shadow { box-shadow: none !important; border: 0 !important; }
  /* donat.css membentuk tabel sungguhan hanya di @media screen >= 700 px; di kertas dipaksa sama untuk semua tabel (daftar, tab anak, laporan, dokumen cetak) */
  .table { display: table; font-size: .72rem; }
  .table thead { display: table-header-group; position: static; clip: auto; height: auto; width: auto; margin: 0; overflow: visible; }
  .table tbody { display: table-row-group; }
  .table tr { display: table-row; border: 0; }
  .table th, .table td, .table tbody td { display: table-cell; padding: 3px 4px; text-align: left; }   /* .table tbody td: setara aturan dasar donat.css yang rata kanan */
  .table tbody td[data-title]::before { content: none; }
}

/* ---- Sidebar datar (grup = satu item); label singkat di layar kecil, supaya bar bawah ponsel tetap memuat menu penting ---- */
.menu #leftmenu li .sg { display: none; }
@media screen and (max-width: 700px) {
  .menu #leftmenu li .lg { display: none; }
  .menu #leftmenu li .sg { display: inline; }
}

/* ---- menu kiri halaman: desktop = daftar vertikal; <= 900 px = tabs gaya Master (tabs.css), sisanya di tombol menu ---- */
.dt-nav .tabs-wrapper { display: none; }
@media screen and (max-width: 900px) {
  .dt-nav .dt-menu { display: none; }
  .dt-nav .tabs-wrapper { display: flex; }
  .dt-layout > .dt-nav { padding: 0; margin-bottom: 0; background: transparent; box-shadow: none; }
  .dt-nav .tabs li { flex: 0 0 auto; }
}

/* ---- halaman detail bertab (crud.js): remah roti, kartu ringkasan, tabs antar tabel anak ---- */
.crumb { display: flex; flex-wrap: wrap; gap: 4px 6px; align-items: center; margin: 0 0 10px; font-size: .9rem; }
.crumb a { color: var(--pColor); cursor: pointer; text-decoration: none; }
.crumb a:hover { text-decoration: underline; }
.crumb span { opacity: .5; }
.info-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px 16px; margin: 0 0 14px; padding: 10px 12px; background: var(--pLightColor); border-radius: 6px; }
.info-grid > div { display: flex; flex-direction: column; min-width: 0; }
.info-grid small { opacity: .7; }
.info-grid b { font-weight: 600; overflow-wrap: anywhere; }
.tabbar { display: flex; gap: 2px; overflow-x: auto; border-bottom: 2px solid var(--pBorder); margin: 0 0 12px; -webkit-overflow-scrolling: touch; }
.tabbar button { flex: 0 0 auto; display: inline-flex; align-items: center; gap: 6px; background: transparent; border: 0; border-bottom: 3px solid transparent; margin-bottom: -2px;
  padding: 9px 16px; font: inherit; font-weight: 600; color: inherit; opacity: .7; cursor: pointer; border-radius: 6px 6px 0 0; white-space: nowrap; }
.tabbar button:hover { background: var(--pLightColor); opacity: 1; }
.tabbar button.aktif { opacity: 1; color: var(--pDarkColor); border-bottom-color: var(--pColor); background: transparent; }
.tabbar button .n { font-size: .75rem; font-weight: 600; min-width: 1.5em; text-align: center; padding: 1px 6px; border-radius: 10px; background: #e3e6ea; }
.tabbar button.aktif .n { background: var(--pColor); color: #fff; }
.dt-main .aksi-bar button { width: auto; flex: 0 0 auto; }
@media screen and (max-width: 450px) { .info-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 12px; } .tabbar button { padding: 9px 12px; } }

/* ---- chip profil di kepala halaman ---- */
.dash-head { flex-wrap: wrap; }
.profil-chip { display: inline-flex; align-items: center; gap: 8px; margin-left: auto; padding: 3px 12px 3px 3px; border: 1px solid #d5d9de; border-radius: 999px; background: var(--pCard); font: inherit; font-weight: 600; cursor: pointer; }
.profil-chip:hover { background: var(--pLightColor); }
.profil-chip img { width: 30px; height: 30px; border-radius: 50%; }
.lp-ico img, .lp-ico svg { width: 32px; height: 32px; }
.lp-ico svg path { fill: #fff; }
.pf-info svg path { fill: var(--pColor); }
.pf-tile-top b { font-size: 2em; }
@media screen and (max-width: 450px) { .dash #stat-cards .kpi-val { font-size: .9em; overflow-wrap: normal; white-space: nowrap; } .dash #stat-cards .artikel { margin: 2px 8px 8px; } }

/* ---- landing: tombol slide, ikon besar putih; lonceng notifikasi sejajar chip profil; kelengkapan profil ---- */
.lp-aksi { display: flex; gap: 10px; flex-wrap: wrap; }
.lp-ikon svg { width: 200px; height: 200px; }
.lp-ikon svg path { fill: #fff; fill-opacity: .92; }
.dash-head .nf-bell { margin-left: auto; }
.dash-head .nf-bell + .profil-chip { margin-left: 0; }
.pf-lengkap { margin-top: 16px; text-align: left; font-size: .9em; }
.pf-lengkap .progress-bar-linear .progress-bar { height: 8px; margin-bottom: 4px; }
.pf-avatar .img:hover { filter: brightness(.92); }
.lp-stats b { white-space: nowrap; font-size: clamp(1.3em, 2.4vw, 1.9em); }


/* ---- bar bawah ponsel (<= 450 px): sheet "Lainnya" untuk grup menu yang tidak punya slot sendiri ---- */
.lainnya { display: none; }
@media screen and (max-width: 450px) {
  .lainnya { display: block; position: fixed; inset: 0; z-index: 1000; visibility: hidden; }
  .lainnya.open { visibility: visible; }
  .lainnya-bg { position: absolute; inset: 0; background: var(--pShadow); opacity: 0; transition: opacity .2s ease; }
  .lainnya.open .lainnya-bg { opacity: 1; }
  .lainnya-box { position: absolute; left: 0; right: 0; bottom: 0; padding: 10px 16px calc(16px + env(safe-area-inset-bottom, 0px)); background: var(--pCard); color: var(--pTextColor);
    border-radius: 16px 16px 0 0; box-shadow: 0 -6px 20px var(--pShadow); transform: translateY(100%); transition: transform .22s ease; }
  .lainnya.open .lainnya-box { transform: none; }
  .lainnya-grip { width: 40px; height: 4px; border-radius: 2px; background: var(--pBorder); margin: 0 auto 10px; }
  .lainnya-box h3 { margin: 0 0 8px; font-size: 1.05em; }
  .lainnya-box ul { list-style: none; margin: 0; padding: 0; }
  .lainnya-box li { display: flex; align-items: center; gap: 14px; padding: 12px 8px; border-bottom: 1px solid var(--pBorder); cursor: pointer; }
  .lainnya-box li:last-child { border-bottom: 0; }
  .lainnya-box li:active, .lainnya-box li.active { background: var(--pLightColor); }
  .lainnya-box li svg { width: 28px; height: 28px; flex-shrink: 0; padding: 7px; box-sizing: border-box; border-radius: 8px; background: var(--pColor); }
  .lainnya-box li svg path { fill: var(--pButtonColor); }
  .lainnya-box li b { display: block; }
  .lainnya-box li small { color: var(--pMuted); }
}
