:root {
  color-scheme: light;

  /* Text */
  --ink: #20335F;
  --muted: #566B9C;

  /* Borders and surfaces */
  --line: #E2E8F0;
  --surface: #FFFFFF;
  --page: #F5F7FB;

  /* Primary: blue */
  --primary: #29477F;
  --primary-hover: #20335F;
  --primary-soft: #BED0F4;

  /* Warning: yellow */
  --warning: #9A6700;
  --warning-soft: #FFF0AD;

  /* Danger: red */
  --danger: #B42318;
  --danger-soft: #FFF0EE;

  /* Accent colors */
  --accent-yellow: #FFD91A;
  --accent-orange: #FCAF17;
  --accent-teal: #AAD7D5;

  /* Additional palette */
  --blue-light: #8297C9;
  --blue-mid: #40588E;
  --cream: #FFFAE5;
  --gray: #ADADAD;
  --gray-dark: #606060;

  /* Shadow */
  --shadow: 0 12px 36px rgba(32, 51, 95, .12);

  /* Warna yang dulu tertulis langsung, dijadikan token agar bisa berganti tema */
  --primary-ink: #29477F;
  --danger-solid: #B42318;
  --surface-2: #F8FAFC;
  --hover: #F1F5F9;
  --row-hover: #FBFDFC;
  --line-soft: #EDF1F5;
  --line-strong: #CBD5E1;
  --input-bg: #FFFFFF;
  --placeholder: #A0ACBB;
  --chip-bg: #EEF2F6;
  --badge-ok-ink: #176B55;
  --nav-ink: #526174;
  --welcome-line: #DCEBE4;
  --welcome-from: #F0FAF5;
  --accent-line: #B6D7C8;
}

/* Tema gelap. js/theme.js mengisi data-theme="dark" (pilihan Gelap, atau Sistem saat perangkat memakai mode gelap). */
:root[data-theme="dark"] {
  color-scheme: dark;
  --ink: #E6ECFA;
  --muted: #9DB0D6;
  --line: #2B3A5E;
  --surface: #151E36;
  --page: #0E1527;
  --primary: #3F66B8;
  --primary-hover: #5278CC;
  --primary-soft: #223763;
  --primary-ink: #A9C1F5;
  --warning: #F2C14E;
  --warning-soft: #3A2F10;
  --danger: #FF9A8F;
  --danger-soft: #3B2024;
  --danger-solid: #D92D20;
  --gray: #6B7690;
  --shadow: 0 12px 36px rgba(0, 0, 0, .45);
  --surface-2: #1A2442;
  --hover: #1F2B4D;
  --row-hover: #1A2442;
  --line-soft: #243152;
  --line-strong: #3A4B75;
  --input-bg: #0F1830;
  --placeholder: #6F82AB;
  --chip-bg: #223055;
  --badge-ok-ink: #A9E5CC;
  --nav-ink: #B4C3E3;
  --welcome-line: #2B3A5E;
  --welcome-from: #1B2A4F;
  --accent-line: #3A5185;
}

* { box-sizing: border-box; }
body {
  margin: 0; background: var(--page); color: var(--ink);
  font: 15px/1.5 Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
button, input, select { font: inherit; }
button { cursor: pointer; }
button:focus-visible, input:focus-visible, select:focus-visible {
  outline: 3px solid rgba(23, 107, 85, .22); outline-offset: 2px;
}
.clear-a{
  text-decoration: none;
}
.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.topbar {
  display: flex; justify-content: space-between; align-items: center; gap: 20px;
  padding: 14px max(18px, calc((100% - 1320px) / 2)); background: var(--surface);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 12px; }
/* .brand-mark, .login-icon {
  display: grid; place-items: center; width: 44px; height: 44px; border-radius: 14px;
  background: var(--primary); color: white; font-size: 22px; font-weight: 800;
  } */
  .brand-logo {
   display: grid; 
   place-items: center;
   border-radius: 14px;
  width: 60px;
  height: 60px;
  object-fit: contain;
  display: block;
  flex-shrink: 0;
}
.eyebrow { margin: 0 0 3px; color: var(--primary-ink); font-size: 11px; letter-spacing: .12em; font-weight: 800; }
h1, h2, h3, p { margin-top: 0; }
h1 { font-size: 19px; margin-bottom: 0; letter-spacing: -.02em; }
h2 { font-size: 25px; line-height: 1.2; margin-bottom: 8px; letter-spacing: -.035em; }
h3 { font-size: 16px; margin-bottom: 6px; }
.account-area, .right-side { display: flex; align-items: center; gap: 12px; min-width: 0; }
.user-email { max-width: 280px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); font-size: 13px; }
.page-shell { max-width: 1180px; margin: 34px auto 64px; padding: 0 24px; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; box-shadow: 0 2px 8px rgba(15,23,42,.02); }
.loading-panel { display: flex; align-items: center; justify-content: center; gap: 12px; min-height: 180px; color: var(--muted); }
.spinner { width: 20px; height: 20px; border: 2px solid var(--line); border-top-color: var(--primary); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.login-panel { max-width: 440px; margin: 5vh auto 0; padding: 38px; text-align: center; }
.login-icon { margin: 0 auto 20px; width: 54px; height: 54px; font-size: 26px; }
.login-panel p { color: var(--muted); }
.login-panel .button { margin-top: 12px; }
.google-mark { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: white; color: #4285f4; font-weight: 800; margin-right: 8px; }
.warning-icon { display: grid; place-items: center; width: 48px; height: 48px; margin: 0 auto 18px; border-radius: 50%; background: var(--warning-soft); color: var(--warning); font-size: 24px; font-weight: 800; }
.button { display: inline-flex; justify-content: center; align-items: center; gap: 6px; min-height: 42px; padding: 10px 15px; border: 1px solid transparent; border-radius: 10px; font-weight: 700; font-size: 13px; transition: background .15s, border-color .15s; }
.button:disabled { opacity: .55; cursor: not-allowed; }
.button-primary { background: var(--primary); color: white; }
.button-primary:hover:not(:disabled) { background: var(--primary-hover); }
.button-secondary { color: var(--ink); background: var(--surface); border-color: var(--line); }
.button-secondary:hover { background: var(--surface-2); border-color: var(--line-strong); }
.button-ghost { background: transparent; color: var(--muted); border-color: transparent; }
.button-ghost:hover { background: var(--hover); color: var(--ink); }
.button-wide { width: 100%; }
.page-heading { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; margin-bottom: 24px; }
.page-heading h2 { margin-bottom: 7px; }
.muted { color: var(--muted); }
.page-heading p:last-child { margin-bottom: 0; }
.heading-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.stats-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin-bottom: 22px; }
.stat-card { background: var(--surface); border: 1px solid var(--line); border-radius: 15px; padding: 19px 20px; }
.stat-label, .stat-note { display: block; color: var(--muted); font-size: 12px; }
.stat-value { display: block; margin: 8px 0 4px; font-size: 30px; line-height: 1.15; letter-spacing: -.04em; }
.directory-panel { overflow: hidden; }
.toolbar { display: flex; gap: 12px; padding: 18px 20px; border-bottom: 1px solid var(--line); }
.search-field { position: relative; flex: 1; min-width: 160px; }
.search-field input, .filter-field select { width: 100%; height: 42px; border: 1px solid var(--line); border-radius: 10px; background: var(--input-bg); color: var(--ink); }
.search-field input { padding: 0 14px 0 40px; }
.search-icon { position: absolute; top: 7px; left: 13px; font-size: 22px; color: var(--muted); }
.filter-field { width: 170px; }
.filter-field select { padding: 0 10px; }
.table-meta { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 14px 20px 8px; }
.table-meta p { margin: 0; font-size: 12px; }
.table-wrap { width: 100%; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; text-align: left; white-space: nowrap; }
th { padding: 12px 18px; background: var(--surface-2); color: var(--muted); font-size: 11px; letter-spacing: .04em; text-transform: uppercase; font-weight: 800; }
td { padding: 15px 18px; border-top: 1px solid var(--line-soft); font-size: 13px; vertical-align: middle; }
tbody tr:hover { background: var(--row-hover); }
.teacher-name { font-weight: 750; }
.cell-subtext { display: block; margin-top: 3px; color: var(--muted); font-size: 11px; }
.account-cell { max-width: 220px; overflow: hidden; text-overflow: ellipsis; }
.badge { display: inline-flex; align-items: center; padding: 5px 9px; border-radius: 999px; font-size: 11px; font-weight: 750; }
.badge-complete { color: var(--badge-ok-ink); background: var(--primary-soft); }
.badge-incomplete { color: var(--warning); background: var(--warning-soft); }
.badge-active { color: var(--badge-ok-ink); background: var(--primary-soft); }
.badge-inactive { color: var(--muted); background: var(--chip-bg); }
.row-action { border: 1px solid var(--line); background: var(--surface); border-radius: 8px; padding: 7px 10px; font-size: 12px; font-weight: 700; color: var(--ink); }
.row-action:hover { background: var(--surface-2); }
.empty-cell { padding: 36px; text-align: center; color: var(--muted); }
.empty-state { padding: 34px 20px 40px; text-align: center; }
.empty-state p { color: var(--muted); margin-bottom: 0; }
.empty-state-icon { font-size: 28px; color: var(--muted); margin-bottom: 10px; }
.privacy-note { margin: 15px 2px; color: var(--muted); font-size: 11px; }
.notice { padding: 12px 15px; margin-bottom: 18px; border-radius: 10px; font-size: 13px; }
.notice-success { background: var(--primary-soft); color: var(--primary-ink); }
.notice-error { background: var(--danger-soft); color: var(--danger); }
.message { min-height: 20px; margin: 10px 0 0; font-size: 12px; color: var(--danger); }
.form-dialog { width: min(520px, calc(100% - 28px)); max-height: min(90vh, 900px); overflow-y: auto; border: 1px solid var(--line); border-radius: 18px; padding: 0; box-shadow: var(--shadow); }
.form-dialog::backdrop { background: rgba(15, 23, 42, .45); backdrop-filter: blur(2px); }
.form-dialog form { padding: 25px; }
.form-field select { width: 100%; min-height: 43px; border: 1px solid var(--line-strong); border-radius: 9px; padding: 0 12px; background: var(--input-bg); }
.teacher-dialog { width: min(520px, calc(100% - 28px)); max-height: min(90vh, 900px); overflow-y: auto; border: 1px solid var(--line); border-radius: 18px; padding: 0; box-shadow: var(--shadow); }
.teacher-dialog::backdrop { background: rgba(15, 23, 42, .45); backdrop-filter: blur(2px); }
.teacher-dialog form { padding: 25px; }
.dialog-heading { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 22px; }
.dialog-heading h2 { font-size: 22px; margin-bottom: 0; }
.icon-button { border: 0; background: transparent; color: var(--muted); font-size: 27px; line-height: 1; padding: 0 5px; }
.form-field { display: block; margin-bottom: 15px; }
.form-field > span { display: block; margin-bottom: 7px; font-size: 12px; font-weight: 750; }
.form-field input { width: 100%; height: 43px; border: 1px solid var(--line-strong); border-radius: 9px; padding: 0 12px; background: var(--input-bg); }
.form-field input::placeholder { color: var(--placeholder); }
.required { color: var(--danger); }
.form-section-title { padding-top: 8px; margin-bottom: 13px; font-size: 12px; font-weight: 800; color: var(--primary-ink); }
.checkbox-field { display: flex; align-items: center; gap: 9px; margin: 6px 0 12px; font-size: 13px; font-weight: 650; }
.checkbox-field input { width: 17px; height: 17px; accent-color: var(--primary); }
.form-hint { color: var(--muted); font-size: 11px; margin-bottom: 5px; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 9px; margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--line); }
@media (max-width: 760px) {
  .topbar { padding: 14px 16px; }
  .page-shell { margin-top: 22px; padding: 0 14px; }
  .user-email { max-width: 130px; }
  .page-heading { align-items: flex-start; flex-direction: column; }
  .heading-actions { width: 100%; }
  .heading-actions .button { flex: 1; }
  .stats-grid { gap: 9px; }
  .stat-card { padding: 14px 12px; }
  .stat-value { font-size: 25px; }
  .stat-label { font-size: 11px; }
  .toolbar { flex-wrap: wrap; padding: 14px; }
  .search-field { flex-basis: 100%; }
  .filter-field { flex: 1; min-width: 120px; }
  .table-meta { align-items: flex-start; flex-direction: column; padding: 13px 14px 8px; }
  th, td { padding-left: 14px; padding-right: 14px; }
  .login-panel { padding: 28px 22px; }
}
@media (max-width: 450px) {
  .brand-logo { width: 48px; height: 48px; }
  .eyebrow { font-size: 9px; }
  h1 { font-size: 16px; }
  .account-area { gap: 4px; }
  .user-email { display: none; }
  .stats-grid { grid-template-columns: 1fr; }
  .stat-card { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 2px 10px; }
  .stat-value { grid-column: 2; grid-row: 1 / span 2; margin: 0; }
  .stat-note { grid-column: 1; }
  .heading-actions { flex-direction: column; }
}


/* Teacher attendance view */
.attendance-panel { max-width: 720px; margin: 0 auto; padding: 24px; }
.attendance-form, .session-card { display: grid; gap: 16px; }
.attendance-form h3, .session-card h3 { margin: 0; }
.session-card { padding: 18px; margin-bottom: 24px; border: 1px solid var(--line); border-radius: 14px; }
.session-card .eyebrow { margin: 0; }
.attendance-form .form-field, .session-card .form-field { display: grid; gap: 8px; }
.attendance-form input[type="file"], .session-card input[type="file"] { width: 100%; padding: 12px; border: 1px solid var(--line-strong); border-radius: 10px; background: var(--input-bg); }
.attendance-form select, .attendance-form input[type="number"] { width: 100%; min-height: 44px; padding: 10px 12px; border: 1px solid var(--line-strong); border-radius: 10px; background: var(--input-bg); color: var(--ink); font: inherit; }
.attendance-form .form-hint { color: var(--muted); font-size: 13px; }
@media (max-width: 760px) { .attendance-panel { padding: 18px; } }

.program-assignment-list { display: grid; gap: 8px; margin: 8px 0 12px; }
.program-assignment-option { display: flex; align-items: center; gap: 10px; padding: 11px 12px; border: 1px solid var(--line); border-radius: 10px; }
.program-assignment-option input { width: 17px; height: 17px; }
.program-tags { display: flex; flex-wrap: wrap; gap: 5px; }
.program-tag { display: inline-flex; padding: 3px 8px; border-radius: 999px; background: var(--chip-bg); font-size: 12px; white-space: nowrap; }

/* Daftar adik dan pilihan nama pada absensi */
#attendance-students {
  width: 100%;
  min-height: 150px;
  padding: 8px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: var(--input-bg);
  font: inherit;
}
#attendance-students option { padding: 8px 10px; }
.student-roster-panel { margin-top: 22px; }
.roster-heading { align-items: center; }
#student-roster-message { margin: 10px 0; }
@media (max-width: 640px) {
  .roster-heading { align-items: stretch; }
  .roster-heading .heading-actions { width: 100%; }
  .roster-heading .heading-actions .button { flex: 1 1 100%; }
  #attendance-students { min-height: 190px; }
}

/* PSD dashboard with sidebar navigation */
.psd-layout { max-width: 1480px; margin: 0 auto; padding: 26px 28px 56px; display: grid; grid-template-columns: 230px minmax(0, 1fr); gap: 26px; align-items: start; }
.psd-sidebar { position: sticky; top: 20px; min-height: 520px; display: flex; flex-direction: column; padding: 20px 13px; background: var(--surface); border: 1px solid var(--line); border-radius: 18px; box-shadow: 0 5px 20px rgba(15,23,42,.035); }
.sidebar-heading { padding: 4px 10px 23px; border-bottom: 1px solid var(--line); }
.sidebar-kicker { display: block; color: var(--primary-ink); font-size: 10px; font-weight: 850; letter-spacing: .13em; }
.sidebar-caption { display: block; margin-top: 5px; font-size: 13px; font-weight: 750; }
.sidebar-nav { display: grid; gap: 7px; padding-top: 18px; }
.sidebar-link { width: 100%; display: flex; align-items: center; gap: 12px; min-height: 46px; padding: 11px 12px; border: 0; border-radius: 11px; background: transparent; color: var(--nav-ink); text-align: left; font-weight: 700; font-size: 13px; }
.sidebar-link:hover { background: var(--row-hover); color: var(--primary-ink); }
.sidebar-link.active { background: var(--primary-soft); color: var(--primary-ink); }
.nav-icon { width: 23px; text-align: center; font-size: 20px; }
.sidebar-foot { display: flex; align-items: center; gap: 8px; margin-top: auto; padding: 18px 10px 4px; color: var(--muted); font-size: 11px; }
.sidebar-dot { width: 8px; height: 8px; border-radius: 50%; background: #16a34a; }
.psd-main { min-width: 0; }
.psd-main > .notice { margin-bottom: 18px; }
.psd-section { min-width: 0; }
.dashboard-welcome { display: flex; justify-content: space-between; align-items: center; gap: 20px; margin: 3px 0 25px; padding: 28px 30px; border: 1px solid var(--welcome-line); border-radius: 18px; background: linear-gradient(115deg, var(--welcome-from) 0%, var(--surface) 72%); }
.dashboard-welcome h2 { margin-bottom: 8px; }
.dashboard-welcome p:last-child { margin-bottom: 0; }
.welcome-mark { display: grid; place-items: center; width: 62px; height: 62px; flex: 0 0 auto; border-radius: 19px; background: var(--primary); color: #fff; font-size: 31px; font-weight: 850; box-shadow: 0 10px 24px rgba(23,107,85,.17); }
.dashboard-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.dashboard-stats .stat-card { min-height: 135px; padding: 20px; }
.dashboard-stats .stat-value { font-size: 34px; }
.dashboard-shortcuts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin-top: 23px; }
.shortcut-card { display: flex; align-items: center; gap: 13px; min-width: 0; padding: 19px; border: 1px solid var(--line); border-radius: 15px; background: var(--surface); color: var(--ink); text-align: left; }
.shortcut-card:hover { border-color: var(--accent-line); box-shadow: 0 8px 20px rgba(15,23,42,.04); transform: translateY(-1px); }
.shortcut-icon { display: grid; place-items: center; width: 43px; height: 43px; flex: 0 0 auto; border-radius: 13px; background: var(--primary-soft); color: var(--primary-ink); font-size: 22px; }
.shortcut-card > span:nth-child(2) { display: grid; gap: 5px; min-width: 0; }
.shortcut-card strong { font-size: 13px; }
.shortcut-card small { color: var(--muted); font-size: 11px; line-height: 1.45; }
.shortcut-arrow { margin-left: auto; color: var(--primary-ink); font-size: 20px; }
.dashboard-note { margin: 18px 2px; color: var(--muted); font-size: 11px; }
.psd-main .student-roster-panel { margin-top: 0; }
@media (max-width: 1000px) { .psd-layout { grid-template-columns: 190px minmax(0,1fr); gap: 16px; padding: 20px 16px 44px; } .dashboard-stats { grid-template-columns: repeat(2,minmax(0,1fr)); } }
@media (max-width: 700px) { .psd-layout { display: block; padding: 16px 12px 36px; } .psd-sidebar { position: static; min-height: auto; margin-bottom: 18px; padding: 12px; } .sidebar-heading { padding: 4px 8px 12px; } .sidebar-nav { grid-template-columns: repeat(3,minmax(0,1fr)); gap: 5px; padding-top: 10px; } .sidebar-link { justify-content: center; flex-direction: column; gap: 3px; min-height: 66px; padding: 8px 4px; font-size: 10px; } .nav-icon { font-size: 18px; } .sidebar-foot { padding: 12px 8px 0; } .dashboard-welcome { padding: 21px 18px; } .welcome-mark { width: 48px; height: 48px; border-radius: 14px; font-size: 24px; } .dashboard-shortcuts { grid-template-columns: 1fr; } }
@media (max-width: 420px) { .dashboard-stats { grid-template-columns: 1fr 1fr; } .dashboard-stats .stat-card { min-height: 118px; padding: 13px; } .dashboard-stats .stat-value { font-size: 27px; } .dashboard-stats .stat-label { min-height: 30px; } .dashboard-welcome { align-items: flex-start; } }

/* Rekap Absensi PSD — memakai gaya panel, tabel, dan badge yang sudah ada */
.recap-toolbar { align-items: flex-end; flex-wrap: wrap; }
.filter-caption { display: block; margin-bottom: 5px; color: var(--muted); font-size: 11px; font-weight: 750; }
.filter-field input[type="date"] { width: 100%; height: 42px; padding: 0 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--input-bg); color: var(--ink); }
.recap-toolbar .search-icon { top: auto; bottom: 7px; }
.recap-detail-list { display: grid; grid-template-columns: 120px 1fr; gap: 8px 12px; margin: 0 0 18px; font-size: 13px; }
.recap-detail-list dt { color: var(--muted); font-weight: 700; }
.recap-detail-list dd { margin: 0; }
.recap-student-list { margin: 0 0 18px; padding-left: 20px; font-size: 13px; }
.recap-student-list li { padding: 5px 0; }
.recap-photo-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.recap-photo { display: block; width: 100%; max-height: 220px; margin-top: 6px; object-fit: cover; border: 1px solid var(--line); border-radius: 10px; }
@media (max-width: 700px) { .sidebar-nav { grid-template-columns: repeat(5, minmax(0, 1fr)); } }
/* Agar label .sr-only di header tabel tidak membuat halaman bisa digeser ke samping di HP */
.table-wrap { position: relative; }

/* Absensi v2: catatan, status, riwayat guru, cek PJ/PSD */
.form-field textarea, .session-card textarea, .attendance-form textarea { width: 100%; padding: 10px 12px; border: 1px solid var(--line-strong); border-radius: 9px; background: var(--input-bg); color: var(--ink); font: inherit; resize: vertical; }
.attendance-form #attendance-subject, .attendance-form #attendance-method { width: 100%; }
#fix-students { width: 100%; min-height: 150px; padding: 8px; border: 1px solid var(--line-strong); border-radius: 10px; background: var(--input-bg); font: inherit; }
.badge-rejected { color: var(--danger); background: var(--danger-soft); }
.reject-note { max-width: 220px; white-space: normal; color: var(--danger); }
.review-box { margin-top: 6px; padding-top: 4px; border-top: 1px solid var(--line); }
.review-actions { display: flex; justify-content: flex-end; gap: 9px; }
.history-panel { max-width: 720px; margin: 22px auto 0; padding-bottom: 6px; }
.history-heading { padding: 20px 20px 0; margin-bottom: 14px; align-items: flex-end; }
.history-panel > .notice { margin: 0 20px 14px; }
.history-stats { padding: 0 20px; margin-bottom: 14px; }
.history-stats .stat-card { padding: 13px 14px; }
.history-stats .stat-value { font-size: 24px; }
.pj-tabs { display: flex; gap: 6px; margin-bottom: 20px; padding: 5px; width: fit-content; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; }
.pj-tab { border: 0; border-radius: 9px; padding: 9px 14px; background: transparent; color: var(--nav-ink); font-weight: 700; font-size: 13px; }
.pj-tab.active { background: var(--primary-soft); color: var(--primary-ink); }
.filter-field input[type="month"] { width: 100%; height: 42px; padding: 0 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--input-bg); color: var(--ink); }
@media (max-width: 760px) { .history-heading { padding: 16px 14px 0; } .history-stats { padding: 0 14px; } .history-panel > .notice { margin: 0 14px 12px; } }

/* Impor absen lama (sementara) */
.legacy-panel { display: flex; justify-content: space-between; align-items: center; gap: 18px; margin-top: 22px; padding: 20px; }
.legacy-panel h3 { margin-bottom: 4px; }
.legacy-panel .form-hint { margin: 0; max-width: 560px; }
.legacy-dialog { width: min(640px, calc(100% - 28px)); }
.legacy-list { margin: 0 0 14px; padding-left: 18px; font-size: 13px; max-height: 240px; overflow-y: auto; }
.legacy-list li { padding: 3px 0; }
@media (max-width: 760px) { .legacy-panel { flex-direction: column; align-items: stretch; } }

/* Penugasan PJ */
.manager-form-panel { padding: 20px; margin-bottom: 18px; }
.manager-form { display: grid; grid-template-columns: 1fr 1.4fr 1.2fr auto; gap: 12px; align-items: end; }
.manager-form .form-field { margin-bottom: 0; }
.manager-form .button { height: 43px; }
.manager-form-panel .form-hint { margin: 12px 0 0; }
@media (max-width: 900px) { .manager-form { grid-template-columns: 1fr; } }
#reload-managers-btn { white-space: nowrap; }

/* Tarif Fee & Rekap Gaji */
@media (max-width: 700px) { .sidebar-nav { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.fee-panel { padding: 20px; margin-bottom: 18px; }
.fee-panel h3 { margin: 0; }
.fee-panel-heading { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.fee-table td, .fee-table th { padding: 8px 10px; }
.fee-input { width: 130px; height: 38px; padding: 0 10px; border: 1px solid var(--line-strong); border-radius: 8px; font: inherit; }
.payroll-dialog { width: min(980px, calc(100% - 28px)); }
.payroll-program { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); flex-wrap: wrap; font-size: 13px; }
.payroll-return { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin: 6px 0 12px; }
.payroll-return input { height: 38px; min-width: 180px; padding: 0 10px; border: 1px solid var(--line-strong); border-radius: 8px; font: inherit; }
.fee-control { white-space: nowrap; }
.fee-control select, .fee-control input { height: 34px; padding: 0 8px; border: 1px solid var(--line-strong); border-radius: 8px; font: inherit; font-size: 12px; }
.fee-control input { width: 120px; }
.payroll-total { margin: 14px 0 0; font-size: 15px; text-align: right; }
.history-payroll { padding: 0 20px; }
.payroll-card { margin-bottom: 14px; padding: 16px; border: 1px solid var(--line); border-radius: 14px; }
.payroll-card h3 { font-size: 24px; margin: 4px 0; }
@media (max-width: 760px) { .history-payroll { padding: 0 14px; } }

/* Daftar kehadiran adik */
.present-box { margin: 0; padding: 14px; border: 1px solid var(--line); border-radius: 12px; display: grid; gap: 12px; }
.present-box legend { padding: 0 6px; font-size: 13px; font-weight: 800; color: var(--primary-ink); }
.present-box .form-hint { margin: 0; }
.present-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.present-list { display: grid; gap: 8px; }
.present-item { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); cursor: pointer; }
.present-item input { width: 20px; height: 20px; flex: none; accent-color: var(--primary); }
.present-item span { font-size: 14px; }
.present-item small { color: var(--muted); }
.absent-note { color: var(--danger); font-weight: 700; }
.absent-title { color: var(--danger); }
.swal2-container { font-family: inherit; }

/* Angka pengingat di menu */
.nav-badge { display: inline-flex; align-items: center; justify-content: center; min-width: 20px; height: 20px; padding: 0 6px; margin-left: 6px; border-radius: 999px; font-size: 11px; font-weight: 800; line-height: 1; color: #fff; }
.nav-badge-action { background: var(--danger-solid); }
.nav-badge-info { background: var(--gray); }
.sidebar-link .nav-badge { margin-left: auto; }
.sidebar-link .nav-badge + .nav-badge { margin-left: 6px; }

/* Ringkasan PSD: aktivitas bulan ini */
.overview-activity { margin-top: 28px; }
.overview-activity-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 14px; }
.overview-activity-head h3 { margin: 0 0 4px; }
.overview-activity-head p { margin: 0; }
.overview-activity .panel { margin-top: 4px; }
.stat-value-money { font-size: 26px; }
@media (max-width: 640px) { .overview-activity-head { align-items: flex-start; flex-direction: column; } .overview-activity-head .button { width: 100%; } }
@media (max-width: 640px) { .dashboard-stats .stat-value.stat-value-money { font-size: 19px; } }

/* Tema: kontrol formulir, dialog, dan popup SweetAlert mengikuti warna tema */
input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="range"]), select, textarea { background-color: var(--input-bg); color: var(--ink); }
dialog { background: var(--surface); color: var(--ink); }
.swal2-popup { background: var(--surface); color: var(--ink); }
.swal2-title, .swal2-html-container { color: var(--ink); }
.theme-toggle { gap: 8px; }
.theme-toggle i { font-size: 14px; }
@media (max-width: 640px) { .theme-toggle .theme-label { display: none; } }

/* Data Siswa: catatan impor di dalam kartu, dengan jarak seperti kartu lain */
.roster-note { padding: 14px 20px 4px; border-bottom: 1px solid var(--line); }
.roster-note .form-hint { margin: 0 0 4px; }
.roster-note #student-roster-message { min-height: 0; margin: 6px 0 10px; }
.roster-note #student-roster-message:empty { display: none; }

/* Pesan hasil impor adik: tersembunyi kalau kosong */
.student-roster-panel > #student-roster-message { min-height: 0; margin: 0; padding: 12px 20px 0; }
.student-roster-panel > #student-roster-message:empty { display: none; }

/* Animasi hover dan klik: ringan, hanya transform/opacity/warna (tanpa menggeser layout) */
.button, .sidebar-link, .row-action, .shortcut-card { transition: background .15s, border-color .15s, color .15s, box-shadow .15s, transform .12s; }
tbody tr { transition: background .12s; }
.button:active:not(:disabled), .row-action:active, .sidebar-link:active, .shortcut-card:active { transform: scale(.97); }
@media (hover: hover) {
  .button-primary:hover:not(:disabled), .button-secondary:hover:not(:disabled) { transform: translateY(-1px); box-shadow: 0 4px 10px rgba(15, 23, 42, .10); }
  .button-primary:active:not(:disabled), .button-secondary:active:not(:disabled) { transform: scale(.97); box-shadow: none; }
}
@keyframes dialog-in { from { opacity: 0; transform: translateY(8px) scale(.98); } to { opacity: 1; transform: none; } }
dialog[open] { animation: dialog-in .18s ease-out; }
@media (prefers-reduced-motion: reduce) {
  .button, .sidebar-link, .row-action, .shortcut-card, tbody tr { transition: none; }
  .button:active, .row-action:active, .sidebar-link:active, .shortcut-card:active, .button:hover { transform: none !important; }
  dialog[open] { animation: none; }
}
