/* Header pencarian dan ruang kerja. */
:root {
  --sidebar-width: 224px;
  --shell-header-height: 64px;
}
.workspace { margin-left: var(--sidebar-width); overflow: visible; min-width: 0; }
.topbar {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
  min-height: 64px; height: auto; padding: 9px 24px; gap: 14px;
  background: #fbfdff; box-shadow: 0 3px 18px #152b480b;
}
.topbar .user-menu { display: flex; align-items: center; gap: 9px; flex-shrink: 0; margin-left: auto; }
.account-trigger { display: flex; align-items: center; gap: 9px; color: #24475e; padding: 5px 8px; border-radius: 9px; min-width: 0; }
.account-trigger:hover { background: #eaf2f7; text-decoration: none; }
.account-trigger-label { display: grid; min-width: 0; line-height: 1.35; }
.account-trigger-label strong { font-size: .875rem; font-weight: 650; max-width: 150px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.account-trigger-label small { color: #62788b; font-size: .75rem; max-width: 175px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.topbar .user-menu .icon-button { display: flex; align-items: center; justify-content: center; width: 42px; height: 42px; border: 1px solid #dbe5ed; border-radius: 9px; background: #fff; }
.topbar .user-menu .icon-button:hover { background: #edf4f8; }
.topbar .user-menu .avatar { display: flex; width: 31px; height: 31px; }
.page { scroll-margin-top: calc(var(--shell-header-height) + 18px); }
.page :is(section[id], details[id], article[id], h2[id], h3[id], div[id]) {
  scroll-margin-top: calc(var(--shell-header-height) + 20px);
}
.skip { z-index: 100; }

/* Seluruh menu inti muat dalam tinggi layar desktop tanpa gulir di sidebar. */
.sidebar {
  position: fixed; inset: 0 auto 0 0; z-index: 60;
  width: var(--sidebar-width); height: 100vh; height: 100dvh;
  display: flex; flex-direction: column; overflow: hidden;
  padding: 18px 16px 15px;
  background: radial-gradient(ellipse at 0 0, #2c58644d, transparent 60%), linear-gradient(170deg, #152c43, #101c31);
}
.sidebar .sidebar-brand { display: flex; align-items: center; justify-content: space-between; min-height: 48px; }
.sidebar .brand { margin: 0; padding: 0; font-size: 42px; line-height: 1.1; letter-spacing: -2px; }
.sidebar .brand-dot { color: #a6e2d3; }
.sidebar .sidebar-role { flex-shrink: 0; margin: 13px 0 0; padding: 8px 10px; font-size: .8125rem; line-height: 1.4; background: #ffffff07; border-color: #9dc6d52b; }
.sidebar .nav-label { flex-shrink: 0; display: block; color: #a3bcca; font-size: .75rem; margin: 18px 0 7px 10px; letter-spacing: .105em; }
.sidebar #main-navigation { flex-shrink: 0; display: grid; gap: 9px; margin: 0 0 12px; }
.sidebar-links { display: grid; grid-template-columns: minmax(0, 1fr); gap: 3px; }
.sidebar-utilities { border-top: 1px solid #a7c8da28; padding-top: 8px; }
.sidebar .nav-item { display: flex; align-items: center; gap: 10px; padding: 6px 10px; margin: 0; min-height: 37px; font-size: .875rem; line-height: 1.4; border-radius: 8px; }
.sidebar .nav-item .icon { width: 18px; height: 18px; flex-shrink: 0; }
.sidebar .nav-item.active { color: #eefcf8; background: #35808046; box-shadow: inset 2px 0 #a8e3d5; }
.sidebar .nav-item:focus-visible { outline: 2px solid #b1eada; outline-offset: 1px; }
.sidebar .sidebar-clock {
  flex-shrink: 0; margin: auto 0 13px; padding: 13px 12px;
  border: 1px solid #9ccec132; border-radius: 12px;
  background: linear-gradient(130deg, #c2f2df0d, #8fbfd408);
}
.sidebar-clock-heading { display: flex; align-items: center; gap: 7px; color: #aac7d4; font-size: .6875rem; line-height: 1.4; margin-bottom: 8px; }
.sidebar-clock-heading .icon { width: 13px; height: 13px; flex-shrink: 0; }
.sidebar-clock-heading>span { flex: 1; }
.sidebar-clock-heading>i { width: 5px; height: 5px; border-radius: 50%; background: #9ee3c5; box-shadow: 0 0 0 3px #9ee3c50c; }
.sidebar .sidebar-clock-date { font-size: .8125rem; line-height: 1.5; margin: 0 0 5px; color: #cbdde6; }
.sidebar .sidebar-clock-time { display: flex; align-items: baseline; justify-content: space-between; gap: 7px; }
.sidebar-clock-time time { font-size: 1.5rem; letter-spacing: .02em; line-height: 1.25; color: #bdf0df; }
.sidebar-clock-time>span { color: #b7cfdb; font-size: .6875rem; padding: 2px 5px; background: #ffffff08; border-radius: 4px; }
.sidebar .sidebar-hijri { display: flex; align-items: center; gap: 7px; margin-top: 9px; padding-top: 8px; border-top-color: #bedcc923; }
.sidebar-hijri .icon { color: #d7d5ad; width: 14px; height: 14px; flex-shrink: 0; }
.sidebar .sidebar-hijri time { color: #d4e5e8; font-size: .8125rem; line-height: 1.5; }
.sidebar-footer { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-shrink: 0; font-size: .6875rem; line-height: 1.5; color: #7e9db1; }
.sidebar-footer>a { color: #bad3de; font-size: .75rem; }

/* Dashboard memakai seluruh lebar ruang kerja. */
.page:has(>.control-dashboard) { max-width: none; padding-left: 24px; padding-right: 24px; }

.control-roster { background: #fff; }
.development-hero { padding: 25px 28px; margin: 0; border-radius: 16px; background: linear-gradient(115deg, #142b42, #24445e); color: #fff; }
.development-hero h1 { margin: 0 0 9px; color: #fff; font-size: clamp(1.875rem, 3vw, 2.5rem); }
.development-hero p { color: #cee0eb; font-size: 1rem; max-width: 75ch; }
.development-hero.overview-hero {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 390px), 1fr));
  align-items: center;
  gap: 14px 22px;
  padding: clamp(16px, 2vw, 23px);
}
.overview-hero-filters {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas: "period actions" "filters filters";
  align-items: end;
  min-width: 0;
  gap: 9px 12px;
  padding: 13px 15px;
  border: 1px solid #9fc4d14d;
  border-radius: 11px;
  background: #ffffff0b;
}
.overview-hero-filters:has(details[open]) {
  grid-template-columns: minmax(0, 1fr);
  grid-template-areas: "period" "filters" "actions";
}
.overview-hero-filters .ov-period-fields {
  grid-area: period;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px 10px;
}
.overview-hero-filters .ov-filter-actions { grid-area: actions; margin: 0; gap: 7px 12px; }
.overview-hero-filters .ov-filter-actions>a { color: #d0f1ed; font-size: .875rem; }
.overview-hero-filters details { grid-area: filters; }
.overview-hero-filters summary { color: #d0f1ed; cursor: pointer; font-weight: 650; font-size: .875rem; }
.overview-hero-filters details .ov-fields { margin-top: 8px; }
.overview-hero-filters label { color: #e1edf5; line-height: 1.3; }
.overview-hero-filters :is(select, input[type=month]) { margin: 0; color: #223b54; background: #f8fbfd; }
.overview-hero-filters .field-error { color: #ffd3b8; }
.overview-hero-filters .message {
  grid-column: 1/-1;
  max-width: none;
  margin: 0;
  color: #633c19;
}
@media (min-width: 541px) and (max-width: 1270px) {
  .overview-hero-filters:not(:has(details[open])) .ov-filter-actions { display: grid; justify-items: center; gap: 3px; }
}
@media (max-width: 540px) {
  .overview-hero-filters {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas: "period" "filters" "actions";
  }
}
@media (max-width: 360px) {
  .overview-hero-filters .ov-period-fields { grid-template-columns: minmax(0, 1fr); }
}

/* Nama mentor membawa langsung ke kartu santri, dengan jumlah dari profil aktif. */
.mentor-directory { margin: 0; background: #f4f7fb; }
.mentor-directory-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.mentor-directory-heading h2 { margin: 0 0 5px; font-size: 1.25rem; }
.mentor-directory-heading p { margin: 0; color: #5b7186; font-size: .9375rem; }
.mentor-directory-heading>a { font-size: .875rem; white-space: nowrap; }
.mentor-directory-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 245px), 1fr)); gap: 10px; margin-top: 13px; }
.mentor-directory-card { display: flex; align-items: center; gap: 12px; padding: 13px 14px; color: #294a61; background: #fff; border: 1px solid #d9e4ed; border-radius: 11px; }
.mentor-directory-card:hover { background: #f0f8f8; border-color: #89b9bd; text-decoration: none; }
.mentor-directory-card.is-selected { border-color: #2f7d83; background: #e9f5f3; box-shadow: inset 0 0 0 1px #2f7d83; }
.mentor-initial { display: flex; justify-content: center; align-items: center; flex-shrink: 0; width: 38px; height: 38px; border-radius: 11px; background: #e9f0f7; color: #3b607b; font-weight: 650; }
.mentor-directory-person { display: grid; min-width: 0; gap: 3px; flex: 1; }
.mentor-directory-person strong { font-size: 1rem; overflow-wrap: anywhere; }
.mentor-directory-person small { font-size: .8125rem; color: #647b8e; }
.mentor-directory-count { font-size: 1.75rem; font-weight: 650; line-height: 1; color: #216c72; font-variant-numeric: tabular-nums; }
.mentor-cohort-banner { display: flex; justify-content: space-between; align-items: center; gap: 18px; border: 1px solid #cddfe4; border-radius: 12px; background: #edf6f6; padding: 18px 22px; margin-bottom: 18px; }
.workbench>.mentor-cohort-banner { margin-bottom: 0; }
.mentor-cohort-banner>div { display: grid; gap: 4px; min-width: 0; }
.mentor-cohort-banner strong { color: #27566b; font-size: 1.0625rem; }
.mentor-cohort-banner span { color: #5e788b; font-size: .875rem; }
.self-account { display: grid; gap: 22px; }
.self-account-grid { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 22px; align-items: start; }
.self-account-grid>.panel { margin: 0; }
.self-account-actions { background: #f3f7fb; }
.account-action { display: flex; align-items: flex-start; gap: 12px; padding: 17px 0; color: #345a72; border-top: 1px solid #dce6ee; }
.account-action>.icon { margin-top: 4px; flex-shrink: 0; }
.account-action>span { display: grid; gap: 3px; }
.account-action strong { font-size: 1rem; }
.account-action small { font-size: .875rem; color: #657d90; }
.self-account-actions>form { border-top: 1px solid #dce6ee; padding-top: 18px; }
.page :is(.account-trigger, .mentor-directory-card, .account-action):focus-visible { outline: 3px solid #1b8288; outline-offset: 4px; }

@media (max-width: 1200px) {
  .account-trigger { padding-inline: 3px; }
  .account-trigger-label strong { max-width: 100px; }
  .account-trigger-label small { max-width: 120px; }
}
@media (max-width: 1050px) {
  .control-hero .control-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 901px) and (max-height: 740px) {
  .sidebar { padding: 13px 15px; }
  .sidebar .sidebar-brand { min-height: 39px; }
  .sidebar .brand { font-size: 36px; }
  .sidebar .sidebar-role { margin-top: 9px; padding: 7px 9px; }
  .sidebar .nav-label { margin-top: 15px; }
  .sidebar .nav-item { min-height: 35px; padding-block: 6px; }
  .sidebar .sidebar-clock { padding: 11px; margin-bottom: 10px; }
  .sidebar-clock-time time { font-size: 1.375rem; }
}
@media (min-width: 901px) and (max-height: 635px) {
  .sidebar-links { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px; }
  .sidebar .nav-item { min-height: 42px; font-size: .8125rem; padding: 5px; gap: 5px; }
  .sidebar .nav-item .icon { width: 15px; height: 15px; }
  .sidebar .sidebar-clock { padding: 9px 10px; }
  .sidebar-clock-heading { margin-bottom: 5px; }
}
@media (min-width: 901px) and (max-height: 560px) {
  .sidebar { padding-block: 10px; }
  .sidebar .sidebar-brand { min-height: 33px; }
  .sidebar .brand { font-size: 32px; }
  .sidebar .sidebar-role { margin-top: 7px; padding: 5px 9px; }
  .sidebar .nav-label { margin-bottom: 6px; }
  .sidebar .sidebar-clock { margin-bottom: 8px; }
  .sidebar .sidebar-hijri { margin-top: 6px; padding-top: 6px; }
}
/* Layar yang sangat pendek menggunakan menu ringkas, agar menu tidak terpotong. */
@media (max-width: 900px), (max-height: 500px) {
  :root { --sidebar-width: 0px; }
  .sidebar { position: static; width: auto; height: auto; padding: 13px 18px; display: block; overflow: visible; }
  .sidebar .sidebar-brand { min-height: 36px; }
  .sidebar .brand { font-size: 34px; }
  .js .sidebar .mobile-menu-toggle { display: flex; min-height: 40px; }
  .sidebar .sidebar-role { display: flex; max-width: 360px; margin-top: 13px; }
  .sidebar-links { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 5px; }
  .sidebar .nav-item { min-height: 42px; font-size: .875rem; padding: 8px 10px; }
  .sidebar .sidebar-clock { max-width: 360px; margin: 18px 0 12px; }
  .sidebar .sidebar-footer { max-width: 360px; }
  .js .sidebar:not(.menu-open) :is(.sidebar-role, .nav-label, #main-navigation, .sidebar-clock, .sidebar-footer) { display: none; }
  .development-hero { padding: 23px; }
}
@media (max-width: 700px) {
  .topbar { padding: 8px 13px; gap: 8px; min-height: 58px; }
  .topbar .user-menu { gap: 4px; }
  .account-trigger-label { display: none; }
  .topbar .account-trigger { padding: 5px; }
  .topbar .user-menu .icon-button { width: 38px; height: 40px; }
  .page:has(>.control-dashboard) { padding-inline: 17px; }
  .mentor-directory { padding: 20px; }
  .mentor-directory-heading { align-items: flex-start; flex-wrap: wrap; }
  .mentor-directory-card { padding: 16px; }
  .mentor-cohort-banner { align-items: flex-start; flex-direction: column; padding: 18px; }
  .mentor-cohort-banner>.button { width: 100%; }
  .self-account-grid { grid-template-columns: minmax(0, 1fr); }
}
@media print {
  .sidebar, .topbar { display: none !important; }
  .workspace { margin-left: 0; }
  .development-hero { color: #193c54; background: #edf3f7; }
  .development-hero h1, .development-hero p { color: #193c54; }
}

/* Satu permukaan navigasi untuk empat ruang kerja. */
@media screen {
  :root {
    --workspace-hero: radial-gradient(ellipse at top right, #24536580, transparent 58%),
      linear-gradient(112deg, #14283f, #193749);
    --workspace-divider: #d8e3e9;
    --workspace-focus: #087681;
  }
  .control-dashboard .control-hero, .work-hero, .development-hero.overview-hero,
  .student-workspace .student-list-hero { background: var(--workspace-hero); }

  .control-dashboard { container: dashboard / inline-size; }
  .control-dashboard .control-hero {
    grid-template-columns: minmax(0, 1fr);
    align-items: center;
    justify-content: stretch;
    gap: 14px 20px;
    padding: clamp(16px, 2vw, 24px);
  }
  .control-hero .control-hero-heading { display: grid; justify-content: start; gap: 4px; }
  .control-hero-heading h1 { margin: 0; }
  .control-hero-heading small { color: #b5cbd7; font-size: .8125rem; }
  .control-hero .control-kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }
  .control-dashboard .control-kpis > a {
    grid-template: "label" auto "value" 1fr "meta" auto / minmax(0, 1fr);
    gap: 4px;
    padding: 10px 12px;
    border: 1px solid #adc9d147;
    border-radius: 10px;
    background: #c7e2e612;
  }
  .control-dashboard .control-kpis > a > span { color: #e0ecf2; line-height: 1.3; }
  .control-dashboard .control-kpis > a strong { color: #f4fafc; font-size: 1.65rem; }
  .control-dashboard .control-kpis > a small { color: #c2d6e0; line-height: 1.4; }
  .control-kpi-icon .icon { width: 1.5rem; height: 1.5rem; }
  .control-dashboard .control-kpis > .needs-attention { border-color: #bf986e; }
  .control-dashboard .control-kpis > .needs-attention strong { color: #ffdfae; }
  .control-dashboard .control-kpis > a:is(:hover, :focus-visible) {
    background: #c7e2e623;
    border-color: #a7d6d5;
  }
  .control-dashboard .control-kpis > a:focus-visible { outline-color: #b4ede4; }
  .control-chart:has(#control-stack-title), .control-side-panels > #control-data {
    background: #f6f9fb;
    border-color: var(--workspace-divider);
  }
  .control-side-panels > #control-mentoring { background: #f4f9f7; }
  .control-lower-grid > #control-attention { background: #fff; }
  .page :is(.button, input, select, textarea, summary):focus-visible {
    outline: 2px solid var(--workspace-focus);
    outline-offset: 3px;
  }
  .page :is(.work-hero,.development-hero,.student-list-hero) :focus-visible { outline-color: #b4ede4; }
  @container dashboard (min-width: 42rem) {
    .control-hero .control-kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  }
  @container dashboard (min-width: 61rem) {
    .control-dashboard .control-hero:has(.control-kpis) {
      grid-template-columns: minmax(14rem, .9fr) minmax(0, 2.7fr);
    }
  }
  @container dashboard (max-width: 20rem) {
    .control-hero .control-kpis { grid-template-columns: minmax(0, 1fr); }
    .control-dashboard .control-kpis > a {
      grid-template: "label value" auto "meta value" auto / minmax(0, 1fr) auto;
    }
  }
}

.leadership { display:grid; gap:16px; max-width:1050px; margin:auto; }
.leadership .panel { margin:0; }
.leadership textarea { display:block; width:100%; min-height:5rem; }
.leadership .lead-filters,.pair-row { display:flex; flex-wrap:wrap; gap:10px 18px; align-items:end; }
.lead-result { border-left:4px solid #28776e; background:linear-gradient(115deg,#edf6f2,#fff 70%); }
.lead-result h3 { color:#215e54; font-size:1.6rem; }
.leadership details summary,.ops-detail summary,.pillar-expand summary { cursor:pointer; padding:8px 0; }
.lead-bar { display:flex; height:13px; border-radius:5px; overflow:hidden; background:#ecf0f4; }
.lead-bar span { background:#64748b; }
.lead-bar .segment-accelerating { background:#0d8179; }
.lead-bar .segment-growing { background:#3674d9; }
.lead-bar .segment-on_track { background:#7959ba; }
.lead-bar .segment-at_risk { background:#b76c0d; }
.lead-bar .segment-off_track { background:#c54a51; }
.ops-detail,.pillar-expand { border-top:1px solid #d4dfe5; padding-top:8px; margin-top:10px; }
.pair-row { border-top:1px solid #dce4ea; padding:8px 0; font-size:.9rem; }
.pair-row strong { flex-basis:100%; }
.pillar-expand { grid-column:1/-1; }
.pillar-expand td,.pillar-expand th { padding:5px 10px; text-align:left; }
.control-hero a.pending-review { color:#ffe2ae; }
@media print { .leadership .no-print, .leadership form { display:none; } .leadership { display:block; } .leadership .panel { break-inside:avoid; } }

.control-board {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
  gap: 20px;
}
.control-lane { display: grid; gap: 20px; min-width: 0; }
.control-dashboard #control-mentoring { background: #f4f9f7; }
.control-dashboard #control-data { background: #f3f6fa; }
.control-status-guide > summary { cursor: pointer; font-weight: 650; color: #284c61; }
.control-status-guide[open] > summary { margin-bottom: .75rem; }
.weekly-shared-summary {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: .45rem 1.25rem;
  margin: .9rem 0;
  padding: .7rem .9rem;
  background: #edf6f5;
  color: #264d57;
  border: 1px solid #cbdedc;
  border-radius: .6rem;
}
.weekly-shared-summary p { margin: 0; }
.weekly-shared-summary a { font-weight: 650; }
.control-dashboard [id] { scroll-margin-top: 6rem; }
@media (max-width: 1000px) {
  .control-board { grid-template-columns: minmax(0, 1fr); }
  .control-lane-analysis, .control-lane-operations { display: contents; }
  .control-board #control-attention { grid-row: 3; }
}
@media print { .control-board { display: block; } }

.control-dashboard #control-data {
  padding: clamp(1rem, 2vw, 1.5rem);
  background: #f6f8fb;
}
#control-data h2 { margin-bottom: .8rem; }
.quality-metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 12rem), 1fr));
  gap: .5rem;
}
#control-data .quality-metrics .control-data-row {
  gap: .6rem;
  padding: .6rem .75rem;
  background: white;
  border: 1px solid #d9e3eb;
  border-radius: .5rem;
  line-height: 1.4;
}
#control-data .ops-detail form, #control-data .ops-detail label {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: .45rem .65rem;
}
#control-data .ops-detail form { margin: .6rem 0; }
#control-data .pair-row { flex-wrap: wrap; overflow-wrap: anywhere; }
#control-data details[open] { max-height: 20rem; overflow: auto; }
@media (max-width: 1000px) {
  .control-board #control-data { grid-row: 5; }
}
