/* ================================================================
   SI-AKPD — Stylesheet
   Upload ke: public_html/style.css
   ================================================================ */

/* ── RESET & BASE ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Plus Jakarta Sans', sans-serif;
  background: #f0f4f8;
  color: #2d3748;
  min-height: 100vh;
  -webkit-text-size-adjust: 100%;
}

.hidden { display: none !important; }

::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: #eef2ff; }
::-webkit-scrollbar-thumb { background: #2563eb; border-radius: 99px; }

/* ── CSS VARIABLES ── */
:root {
  --primary:       #1565c0;
  --primary-dark:  #0d47a1;
  --primary-light: #e3f2fd;
  --accent:        #1976d2;
  --orange:        #f57c00;
  --green:         #2e7d32;
  --teal:          #00695c;
  --purple:        #6a1b9a;
  --red:           #c62828;
  --sidebar-bg:    #0d1b3e;
  --sidebar-active: rgba(255,255,255,.15);
}

/* ================================================================
   LOGIN PAGE
   ================================================================ */
#screen-login {
  min-height: 100vh;
  background: linear-gradient(135deg, #0d1b3e 0%, #1565c0 50%, #0288d1 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 32px 20px;
  gap: 16px;
  position: relative;
  overflow-x: hidden;
  overflow-y: auto;
}

#screen-login::before {
  content: '';
  position: absolute;
  inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.03'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}

.login-container {
  width: 100%;
  max-width: 960px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  background: #fff;
  border-radius: 20px;
  box-shadow: 0 25px 80px rgba(0,0,0,.35);
  overflow: hidden;
  position: relative;
  z-index: 1;
}

/* Left branding panel */
.login-left {
  background: linear-gradient(150deg, #0d1b3e 0%, #1565c0 100%);
  padding: 50px 40px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  color: #fff;
}

.ll-logo { display: flex; align-items: center; gap: 14px; margin-bottom: 36px; }
.ll-logo-icon {
  width: 52px; height: 52px;
  background: rgba(255,255,255,.15);
  border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px;
  backdrop-filter: blur(8px);
  flex-shrink: 0;
}
.ll-logo-text { font-size: 26px; font-weight: 800; letter-spacing: -.5px; }
.ll-title { font-size: 28px; font-weight: 800; line-height: 1.3; margin-bottom: 14px; }
.ll-sub { font-size: 14px; opacity: .7; line-height: 1.7; margin-bottom: 36px; }
.ll-features li {
  list-style: none;
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 12px; font-size: 13.5px; opacity: .85;
}
.ll-features li::before {
  content: '✓';
  width: 22px; height: 22px;
  background: rgba(255,255,255,.2);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; flex-shrink: 0; text-align: center; line-height: 22px;
}

/* Right form panel */
.login-right {
  padding: 44px 40px;
  overflow-y: auto;
  max-height: 100vh;
}
.lr-top { text-align: center; margin-bottom: 28px; }
.lr-top h2 { font-size: 22px; font-weight: 800; color: #0d1b3e; margin-bottom: 6px; }
.lr-top p { font-size: 13px; color: #78909c; }

/* Login tabs */
.login-tabs {
  display: flex;
  background: #f5f7fa;
  border-radius: 10px;
  padding: 4px;
  margin-bottom: 24px;
  gap: 4px;
}
.lt {
  flex: 1; padding: 9px 6px; border: none;
  background: transparent;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 12.5px; font-weight: 600; color: #78909c;
  cursor: pointer; border-radius: 8px; transition: all .2s;
  display: flex; align-items: center; justify-content: center; gap: 6px;
}
.lt.active {
  background: #fff; color: #1565c0;
  box-shadow: 0 2px 8px rgba(21,101,192,.15);
}

/* ── FORM ELEMENTS ── */
.lf-group { margin-bottom: 16px; text-align: left; }
.lf-label { font-size: 12.5px; font-weight: 600; color: #546e7a; display: block; margin-bottom: 6px; }

.lf-input, .lf-select {
  width: 100%;
  padding: 11px 14px;
  border: 1.5px solid #e8edf2;
  border-radius: 10px;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 13.5px; color: #37474f;
  outline: none; background: #fff;
  transition: border .2s;
  -webkit-appearance: none;
  appearance: none;
}
.lf-input:focus, .lf-select:focus {
  border-color: #1565c0;
  box-shadow: 0 0 0 3px rgba(21,101,192,.1);
}

.input-group { position: relative; }
.input-group .lf-input { padding-right: 44px; }
.input-group .eye-btn {
  position: absolute; right: 12px; top: 50%; transform: translateY(-50%);
  border: none; background: none; color: #90a4ae; cursor: pointer;
  font-size: 14px; padding: 4px;
}

/* Buttons */
.btn-login {
  width: 100%; padding: 13px;
  background: linear-gradient(135deg, #1565c0, #1976d2);
  color: #fff; border: none; border-radius: 10px;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 14px; font-weight: 700; cursor: pointer;
  transition: all .2s; margin-top: 6px; letter-spacing: .3px;
  display: flex; align-items: center; justify-content: center; gap: 8px;
}
.btn-login:hover { transform: translateY(-1px); box-shadow: 0 6px 20px rgba(21,101,192,.35); }
.btn-login:disabled { opacity: .7; cursor: not-allowed; transform: none; }

.lupa-link { text-align: right; margin-top: -8px; margin-bottom: 12px; }
.lupa-link a { font-size: 12px; color: #1565c0; text-decoration: none; font-weight: 600; }
.lupa-link a:hover { text-decoration: underline; }

.login-hint {
  margin-top: 16px; padding: 11px 13px;
  background: #e3f2fd; border-radius: 8px;
  font-size: 12px; color: #1565c0; line-height: 1.7;
}
.login-hint b { font-weight: 700; }
.daftar-link { text-align: center; margin-top: 14px; font-size: 13px; color: #78909c; }
.daftar-link a { color: #1565c0; font-weight: 700; text-decoration: none; }
.daftar-link a:hover { text-decoration: underline; }

/* Password strength */
.pw-strength { margin-top: 6px; }
.pw-bars { display: flex; gap: 3px; margin-bottom: 4px; }
.pw-bar { flex: 1; height: 4px; background: #e8edf2; border-radius: 99px; transition: background .3s; }
.pw-bar.weak   { background: #ef5350; }
.pw-bar.medium { background: #ffa726; }
.pw-bar.strong { background: #66bb6a; }
.pw-label { font-size: 11px; color: #90a4ae; }

/* ================================================================
   APP SHELL
   ================================================================ */
#screen-app { min-height: 100vh; display: flex; flex-direction: column; }

/* TOPBAR */
.topbar {
  height: 56px; background: #fff;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 20px; border-bottom: 1px solid #e8edf2;
  box-shadow: 0 2px 8px rgba(0,0,0,.06);
  position: sticky; top: 0; z-index: 200;
}
.tb-left  { display: flex; align-items: center; gap: 12px; }
.tb-hamburger {
  width: 36px; height: 36px; border-radius: 8px; border: none;
  background: transparent; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; color: #546e7a; transition: .2s;
}
.tb-hamburger:hover { background: #f5f5f5; }
.tb-brand { font-size: 15px; font-weight: 800; color: #0d1b3e; }
.tb-school { font-size: 12px; color: #78909c; }
.tb-right { display: flex; align-items: center; gap: 10px; }
.tb-notif {
  position: relative; width: 36px; height: 36px; border-radius: 8px;
  border: 1px solid #e8edf2; background: #fff; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; color: #78909c;
}
.tb-notif:hover { background: #f5f5f5; }
.notif-dot {
  position: absolute; top: 6px; right: 6px;
  width: 8px; height: 8px; background: #ef5350;
  border-radius: 50%; border: 2px solid #fff;
}
.tb-user {
  display: flex; align-items: center; gap: 8px; cursor: pointer;
  padding: 6px 12px; border-radius: 10px; transition: .2s; border: 1px solid transparent;
}
.tb-user:hover { background: #f5f5f5; border-color: #e8edf2; }
.tb-avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: linear-gradient(135deg, #1565c0, #1976d2);
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; color: #fff; flex-shrink: 0;
}
.tb-uname { font-size: 13px; font-weight: 600; color: #37474f; }
.tb-role  { font-size: 11px; color: #90a4ae; }

/* ── LAYOUT ── */
.app-body { display: flex; flex: 1; min-height: calc(100vh - 56px); }

/* SIDEBAR */
.sidebar {
  width: 230px; background: var(--sidebar-bg);
  flex-shrink: 0; display: flex; flex-direction: column;
  position: sticky; top: 56px; height: calc(100vh - 56px);
  overflow-y: auto; transition: width .25s ease;
}
.sidebar.collapsed { width: 60px; }

.sidebar-brand {
  padding: 18px 16px 14px;
  border-bottom: 1px solid rgba(255,255,255,.08);
  display: flex; align-items: center; gap: 10px;
}
.sb-icon {
  width: 36px; height: 36px;
  background: rgba(255,255,255,.12); border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  font-size: 15px; color: #fff; flex-shrink: 0;
}
.sb-brand-text .t1 { font-size: 13px; font-weight: 800; color: #fff; }
.sb-brand-text .t2 { font-size: 10px; color: rgba(255,255,255,.5); }
.sidebar-nav { padding: 10px 0; flex: 1; }
.sb-section-label {
  font-size: 9.5px; font-weight: 700;
  color: rgba(255,255,255,.35); text-transform: uppercase;
  letter-spacing: 1.5px; padding: 10px 16px 4px;
}
.sb-item {
  display: flex; align-items: center; gap: 11px;
  padding: 10px 16px; width: 100%; border: none;
  background: transparent; color: rgba(255,255,255,.65);
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 13px; font-weight: 500; cursor: pointer;
  text-align: left; transition: all .18s; position: relative;
}
.sb-item i { width: 20px; font-size: 14px; flex-shrink: 0; text-align: center; }
.sb-item:hover { background: rgba(255,255,255,.08); color: #fff; padding-left: 20px; }
.sb-item.active { background: var(--sidebar-active); color: #fff; font-weight: 700; }
.sb-item.active::before {
  content: ''; position: absolute; left: 0; top: 5px; bottom: 5px;
  width: 3px; background: #42a5f5; border-radius: 0 3px 3px 0;
}
.sb-badge {
  margin-left: auto; background: rgba(239,83,80,.9); color: #fff;
  font-size: 10px; font-weight: 700; padding: 2px 7px; border-radius: 99px;
}
.sidebar-bottom { padding: 10px 0; border-top: 1px solid rgba(255,255,255,.08); }

.sidebar.collapsed .sb-brand-text,
.sidebar.collapsed .sb-item span,
.sidebar.collapsed .sb-section-label,
.sidebar.collapsed .sb-badge { display: none; }
.sidebar.collapsed .sidebar-brand { justify-content: center; padding: 16px 8px; }

/* CONTENT */
.content { flex: 1; padding: 24px 28px; overflow-y: auto; min-width: 0; }

/* PAGE VIEWS */
.pv { display: none; }
.pv.active { display: block; }

/* PAGE HEADER */
.ph {
  margin-bottom: 22px;
  display: flex; align-items: flex-start;
  justify-content: space-between;
  gap: 16px; flex-wrap: wrap;
}
.ph-text h1 { font-size: 22px; font-weight: 800; color: #0d1b3e; }
.ph-text p  { font-size: 13px; color: #78909c; margin-top: 3px; }
.ph-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

/* ── STAT CARDS ── */
.stat-row   { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 22px; }
.stat-row-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 22px; }
.scard {
  border-radius: 14px; padding: 20px 22px; color: #fff;
  display: flex; align-items: center; justify-content: space-between;
  box-shadow: 0 4px 18px rgba(0,0,0,.14);
  overflow: hidden; position: relative;
}
.scard::after {
  content: ''; position: absolute; right: -15px; top: -15px;
  width: 80px; height: 80px; border-radius: 50%;
  background: rgba(255,255,255,.08);
}
.scard.orange  { background: linear-gradient(135deg, #f57c00, #ff9800); }
.scard.green   { background: linear-gradient(135deg, #2e7d32, #43a047); }
.scard.blue    { background: linear-gradient(135deg, #1565c0, #1976d2); }
.scard.purple  { background: linear-gradient(135deg, #6a1b9a, #8e24aa); }
.scard.teal    { background: linear-gradient(135deg, #00695c, #00897b); }
.scard.red     { background: linear-gradient(135deg, #c62828, #e53935); }
.scard-left .lbl { font-size: 12px; opacity: .85; margin-bottom: 4px; font-weight: 500; }
.scard-left .val { font-size: 34px; font-weight: 800; line-height: 1; }
.scard-right { font-size: 30px; opacity: .25; }

/* ── CARD ── */
.card {
  background: #fff; border-radius: 14px;
  border: 1px solid #e8edf2;
  box-shadow: 0 2px 10px rgba(0,0,0,.04);
  overflow: hidden; margin-bottom: 20px;
}
.card-head {
  padding: 16px 20px; border-bottom: 1px solid #f0f0f0;
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 8px;
}
.card-head .ct { font-size: 14.5px; font-weight: 700; color: #0d1b3e; }
.card-head .cs { font-size: 12px; color: #90a4ae; margin-top: 2px; }
.card-body { padding: 18px 20px; }

/* ── TABLE ── */
.tbl-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.tbl { width: 100%; border-collapse: collapse; min-width: 500px; }
.tbl th {
  font-size: 11px; font-weight: 700; color: #546e7a;
  text-transform: uppercase; letter-spacing: .5px;
  padding: 10px 14px; background: #f8fafc;
  text-align: left; border-bottom: 1.5px solid #e8edf2;
  white-space: nowrap;
}
.tbl td { padding: 12px 14px; font-size: 13px; border-bottom: 1px solid #f5f5f5; }
.tbl tr:last-child td { border-bottom: none; }
.tbl tr:hover td { background: #f8fafc; }

/* ── BADGE ── */
.badge {
  display: inline-flex; align-items: center;
  padding: 3px 10px; border-radius: 99px;
  font-size: 11.5px; font-weight: 700; white-space: nowrap;
}
.b-green  { background: #e8f5e9; color: #2e7d32; }
.b-red    { background: #ffebee; color: #c62828; }
.b-orange { background: #fff3e0; color: #e65100; }
.b-blue   { background: #e3f2fd; color: #1565c0; }
.b-purple { background: #f3e5f5; color: #6a1b9a; }
.b-gray   { background: #f5f5f5; color: #546e7a; }
.b-teal   { background: #e0f2f1; color: #00695c; }

/* ── TOGGLE ── */
.toggle { position: relative; width: 42px; height: 23px; display: inline-block; }
.toggle input { opacity: 0; width: 0; height: 0; }
.t-slider {
  position: absolute; cursor: pointer; inset: 0;
  background: #ccc; border-radius: 99px; transition: .3s;
}
.t-slider::before {
  content: ''; position: absolute;
  width: 17px; height: 17px; left: 3px; top: 3px;
  background: #fff; border-radius: 50%; transition: .3s;
  box-shadow: 0 1px 4px rgba(0,0,0,.25);
}
input:checked + .t-slider { background: #1565c0; }
input:checked + .t-slider::before { transform: translateX(19px); }

/* ── BUTTONS ── */
.btn-p {
  padding: 9px 18px;
  background: linear-gradient(135deg, #1565c0, #1976d2);
  color: #fff; border: none; border-radius: 9px;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 13px; font-weight: 600; cursor: pointer;
  display: inline-flex; align-items: center; gap: 7px;
  transition: all .2s; white-space: nowrap;
}
.btn-p:hover { box-shadow: 0 4px 14px rgba(21,101,192,.3); transform: translateY(-1px); }

.btn-s {
  padding: 8px 16px; background: #fff; color: #546e7a;
  border: 1.5px solid #e0e0e0; border-radius: 9px;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 13px; font-weight: 600; cursor: pointer;
  display: inline-flex; align-items: center; gap: 7px;
  transition: all .2s; white-space: nowrap;
}
.btn-s:hover { border-color: #1976d2; color: #1565c0; background: #e3f2fd; }

.btn-dl {
  padding: 9px 18px;
  background: linear-gradient(135deg, #2e7d32, #43a047);
  color: #fff; border: none; border-radius: 9px;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 13px; font-weight: 600; cursor: pointer;
  display: inline-flex; align-items: center; gap: 7px;
  transition: all .2s; white-space: nowrap;
}
.btn-dl:hover { box-shadow: 0 4px 14px rgba(46,125,50,.3); transform: translateY(-1px); }

.btn-red {
  padding: 7px 13px; background: #e53935; color: #fff;
  border: none; border-radius: 7px;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 12px; font-weight: 600; cursor: pointer; transition: .2s;
}
.btn-red:hover { background: #c62828; }

.btn-edit {
  padding: 7px 13px; background: #1565c0; color: #fff;
  border: none; border-radius: 7px;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 12px; font-weight: 600; cursor: pointer; transition: .2s;
}
.btn-edit:hover { background: #1976d2; }

.btn-ic {
  width: 32px; height: 32px; border-radius: 8px;
  border: 1.5px solid #e0e0e0; background: #fff;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 13px; color: #78909c; cursor: pointer; transition: .18s;
  text-decoration: none;
}
.btn-ic:hover { border-color: #1976d2; color: #1565c0; background: #e3f2fd; }

/* ── SEARCH BAR ── */
.sfbar { display: flex; gap: 10px; margin-bottom: 18px; flex-wrap: wrap; align-items: center; }
.si { flex: 1; min-width: 200px; position: relative; }
.si i { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: #90a4ae; font-size: 13px; }
.si input {
  width: 100%; padding: 9px 12px 9px 34px;
  border: 1.5px solid #e0e0e0; border-radius: 9px;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 13px; outline: none; background: #fff; transition: border .2s;
}
.si input:focus { border-color: #1976d2; box-shadow: 0 0 0 3px rgba(21,101,192,.1); }

.sel {
  padding: 9px 12px; border: 1.5px solid #e0e0e0; border-radius: 9px;
  font-family: 'Plus Jakarta Sans', sans-serif; font-size: 13px; color: #37474f;
  background: #fff; outline: none; cursor: pointer;
  -webkit-appearance: none; appearance: none;
}
.sel:focus { border-color: #1976d2; }

/* ── CHARTS ── */
.bchart { display: flex; flex-direction: column; gap: 12px; }
.bc-item {}
.bc-top { display: flex; justify-content: space-between; font-size: 12.5px; margin-bottom: 5px; font-weight: 500; }
.bc-top span:last-child { font-weight: 700; color: #546e7a; }
.bc-track { height: 9px; background: #e8edf2; border-radius: 99px; overflow: hidden; }
.bc-fill  { height: 100%; border-radius: 99px; transition: width 1s ease; }

.pie-wrap { display: flex; align-items: center; gap: 24px; flex-wrap: wrap; }
.pie-leg { display: flex; align-items: center; gap: 8px; font-size: 12.5px; margin-bottom: 9px; }
.pie-dot { width: 12px; height: 12px; border-radius: 3px; flex-shrink: 0; }

/* ── PAGINATION ── */
.pag {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 20px; border-top: 1px solid #f0f0f0; flex-wrap: wrap; gap: 8px;
}
.pag-info { font-size: 12px; color: #78909c; }
.pag-btns { display: flex; gap: 4px; }
.pb {
  width: 30px; height: 30px; border-radius: 7px;
  border: 1.5px solid #e0e0e0; background: #fff;
  font-size: 12.5px; font-weight: 600; color: #546e7a;
  cursor: pointer; display: flex; align-items: center; justify-content: center; transition: .18s;
}
.pb:hover { border-color: #1976d2; color: #1565c0; }
.pb.active { background: #1565c0; border-color: #1565c0; color: #fff; }
.pb:disabled { opacity: .4; cursor: not-allowed; }

/* ── MODAL ── */
.modal-ov {
  position: fixed; inset: 0; background: rgba(0,0,0,.5);
  z-index: 999; display: flex; align-items: center;
  justify-content: center; padding: 20px; backdrop-filter: blur(2px);
}
.modal {
  background: #fff; border-radius: 16px;
  width: 100%; max-width: 480px;
  box-shadow: 0 25px 70px rgba(0,0,0,.25);
  max-height: 90vh; overflow-y: auto;
}
.modal-hd {
  padding: 20px 24px; border-bottom: 1px solid #f0f0f0;
  display: flex; align-items: center; justify-content: space-between;
  position: sticky; top: 0; background: #fff; z-index: 1;
}
.modal-hd h3 { font-size: 16px; font-weight: 800; color: #0d1b3e; }
.modal-close {
  width: 28px; height: 28px; border-radius: 7px;
  border: none; background: #f5f5f5; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; color: #78909c;
}
.modal-close:hover { background: #ffebee; color: #e53935; }
.modal-bd { padding: 20px 24px; }
.modal-ft {
  padding: 16px 24px; border-top: 1px solid #f0f0f0;
  display: flex; gap: 10px; justify-content: flex-end;
}

/* ── DOWNLOAD BAR ── */
.dl-bar {
  background: linear-gradient(135deg, #e8f5e9, #f1f8e9);
  border: 1.5px solid #a5d6a7; border-radius: 12px;
  padding: 16px 20px; margin-bottom: 20px;
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; flex-wrap: wrap;
}
.dl-bar-text .t1 { font-size: 14px; font-weight: 700; color: #2e7d32; }
.dl-bar-text .t2 { font-size: 12px; color: #4caf50; margin-top: 2px; }
.dl-bar-btns { display: flex; gap: 8px; flex-wrap: wrap; }

/* ── PROFIL ── */
.profil-avatar-wrap { text-align: center; padding: 24px; border-bottom: 1px solid #f0f0f0; }
.profil-avatar {
  width: 80px; height: 80px; border-radius: 50%;
  background: linear-gradient(135deg, #1565c0, #1976d2);
  margin: 0 auto 12px; display: flex; align-items: center; justify-content: center;
  font-size: 30px; font-weight: 800; color: #fff;
}
.profil-name { font-size: 18px; font-weight: 800; color: #0d1b3e; }
.profil-sub  { font-size: 13px; color: #78909c; margin-top: 2px; }

/* ── CETAK LAPORAN ── */
.laporan-card {
  border: 1.5px solid #e8edf2; border-radius: 12px;
  padding: 20px; background: #fff; transition: all .2s; cursor: pointer;
}
.laporan-card:hover { border-color: #1565c0; box-shadow: 0 4px 16px rgba(21,101,192,.15); }
.lc-icon {
  width: 44px; height: 44px; border-radius: 12px;
  margin-bottom: 12px; display: flex; align-items: center; justify-content: center; font-size: 20px;
}
.lc-title { font-size: 14px; font-weight: 700; color: #0d1b3e; margin-bottom: 4px; }
.lc-desc  { font-size: 12.5px; color: #78909c; line-height: 1.6; }

/* ── TOAST ── */
#toast {
  position: fixed; bottom: 24px; left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: #323232; color: #fff; padding: 12px 22px;
  border-radius: 10px; font-size: 13px; font-weight: 600;
  box-shadow: 0 6px 20px rgba(0,0,0,.3); z-index: 9999;
  opacity: 0; transition: all .3s; pointer-events: none;
  white-space: nowrap; max-width: 90vw; text-align: center;
}
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ================================================================
   SISWA LANDING PAGE
   ================================================================ */
#screen-siswa-landing {
  min-height: 100vh;
  background: linear-gradient(135deg, #0d1b3e 0%, #1565c0 100%);
  display: flex; align-items: center; justify-content: center; padding: 16px;
}
.landing-box {
  background: #fff; border-radius: 20px; width: 100%; max-width: 520px;
  box-shadow: 0 25px 80px rgba(0,0,0,.3); overflow: hidden;
}
.landing-header {
  background: linear-gradient(135deg, #1565c0, #0d47a1);
  padding: 24px 24px 20px; color: #fff;
  display: flex; align-items: center; gap: 14px;
}
.lh-icon {
  width: 52px; height: 52px; background: rgba(255,255,255,.15);
  border-radius: 14px; display: flex; align-items: center; justify-content: center;
  font-size: 22px; flex-shrink: 0;
}
.lh-text .lh-t1 { font-size: 16px; font-weight: 800; }
.lh-text .lh-t2 { font-size: 12px; opacity: .7; margin-top: 2px; }
.landing-body { padding: 24px; }
.landing-steps { display: flex; gap: 8px; margin-bottom: 20px; }
.ls-step { flex: 1; height: 4px; border-radius: 99px; background: #e8edf2; transition: background .3s; }
.ls-step.done   { background: #1565c0; }
.ls-step.active { background: #42a5f5; }
.landing-step-label { font-size: 12px; color: #90a4ae; text-align: center; margin-bottom: 16px; font-weight: 600; }

/* ================================================================
   SURVEY — MOBILE FIRST (siswa asesmen)
   ================================================================ */
.survey-wrap {
  max-width: 600px;
  margin: 0 auto;
  padding-bottom: 80px; /* ruang untuk bottom nav di mobile */
}

.survey-header {
  background: linear-gradient(135deg, #1565c0, #0d47a1);
  color: #fff; border-radius: 16px 16px 0 0;
  padding: 18px 20px;
  display: flex; align-items: center; gap: 12px;
  position: sticky; top: 56px; z-index: 10;
}
.survey-header .sh-icon {
  width: 40px; height: 40px;
  background: rgba(255,255,255,.15); border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; flex-shrink: 0;
}
.survey-header .sh-text .s1 { font-size: 14px; font-weight: 700; }
.survey-header .sh-text .s2 { font-size: 11.5px; opacity: .75; }

.survey-prog-wrap {
  background: #e3f2fd; padding: 12px 20px;
  border: 1px solid #bbdefb;
  position: sticky; top: calc(56px + 76px); z-index: 9;
}
.survey-prog-label {
  display: flex; justify-content: space-between;
  font-size: 12px; color: #1565c0; font-weight: 700; margin-bottom: 6px;
}
.survey-prog-bar { height: 8px; background: #bbdefb; border-radius: 99px; overflow: hidden; }
.survey-prog-fill { height: 100%; background: #1565c0; border-radius: 99px; transition: width .4s ease; }

.survey-body {
  background: #fff; border: 1px solid #e0e0e0;
  border-top: none; border-radius: 0 0 16px 16px;
  padding: 16px 16px 24px;
}

/* Slide info */
.slide-info {
  font-size: 12px; font-weight: 700; color: #78909c;
  margin-bottom: 14px;
  display: flex; align-items: center; gap: 6px;
}

/* Question list */
.q-slide { display: flex; flex-direction: column; gap: 10px; }

.q-item {
  background: #f8fafc;
  border: 1.5px solid #e8edf2;
  border-radius: 14px; padding: 14px;
  transition: border .2s, background .2s;
}
.q-item.answered-ya   { border-color: #1565c0; background: #e3f2fd; }
.q-item.answered-tidak { border-color: #e0e0e0; background: #f5f5f5; }

.q-item-num {
  font-size: 11px; font-weight: 700; color: #90a4ae;
  margin-bottom: 6px; text-transform: uppercase; letter-spacing: .5px;
}
.q-item-text {
  font-size: 14px; font-weight: 600; color: #1565c0;
  line-height: 1.55; margin-bottom: 14px;
}

/* YA / TIDAK buttons — bigger touch targets for mobile */
.q-item-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

.qbtn-ya {
  padding: 13px 10px;
  background: #f5f5f5; color: #90a4ae;
  border: 2px solid #e0e0e0; border-radius: 12px;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 15px; font-weight: 700; cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  transition: .2s;
  min-height: 52px; /* fat finger friendly */
  -webkit-tap-highlight-color: transparent;
}
.qbtn-ya:hover:not(.sel) { background: #e8f5e9; color: #4caf50; border-color: #a5d6a7; }
.qbtn-ya:active { transform: scale(.97); }
.qbtn-ya.sel { background: #4caf50; color: #fff; border-color: #388e3c; box-shadow: 0 3px 10px rgba(76,175,80,.30); }

.qbtn-tidak {
  padding: 13px 10px;
  background: #f5f5f5; color: #90a4ae;
  border: 2px solid #e0e0e0; border-radius: 12px;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 15px; font-weight: 700; cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  transition: .2s;
  min-height: 52px;
  -webkit-tap-highlight-color: transparent;
}
.qbtn-tidak:hover:not(.sel) { background: #ffebee; color: #ef5350; border-color: #ef9a9a; }
.qbtn-tidak:active { transform: scale(.97); }
.qbtn-tidak.sel { background: #ef5350; color: #fff; border-color: #c62828; box-shadow: 0 0 0 3px rgba(239,83,80,.3); }

/* Slide navigation */
.slide-nav {
  display: flex; justify-content: space-between; align-items: center;
  margin-top: 20px; gap: 12px;
}
.slide-nav-btn {
  background: none; border: none; color: #1565c0;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 14px; font-weight: 700; cursor: pointer;
  padding: 10px 0; display: flex; align-items: center; gap: 6px;
  min-height: 44px; /* touch target */
  -webkit-tap-highlight-color: transparent;
}
.slide-nav-btn:hover { text-decoration: underline; }
.slide-nav-btn:disabled { color: #ccc; cursor: not-allowed; }

/* Fixed bottom navigation bar — mobile only */
.slide-nav-fixed {
  display: none; /* shown via media query */
  position: fixed; bottom: 0; left: 0; right: 0;
  background: #fff; border-top: 1px solid #e8edf2;
  padding: 10px 16px; gap: 12px; z-index: 100;
  box-shadow: 0 -4px 16px rgba(0,0,0,.08);
}
.slide-nav-fixed .btn-nav-prev {
  flex: 0 0 auto; padding: 14px 20px;
  background: #f5f5f5; color: #546e7a; border: none; border-radius: 12px;
  font-family: 'Plus Jakarta Sans', sans-serif; font-size: 14px; font-weight: 700;
  cursor: pointer; display: flex; align-items: center; gap: 6px;
  min-height: 52px;
}
.slide-nav-fixed .btn-nav-next {
  flex: 1; padding: 14px 20px;
  background: linear-gradient(135deg, #1565c0, #1976d2);
  color: #fff; border: none; border-radius: 12px;
  font-family: 'Plus Jakarta Sans', sans-serif; font-size: 15px; font-weight: 700;
  cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 52px;
}

/* ── HASIL SISWA ── */
.hasil-hero {
  background: linear-gradient(135deg, #1565c0, #1976d2);
  border-radius: 14px; padding: 24px; color: #fff;
  margin-bottom: 18px; display: flex; align-items: center; gap: 20px;
  flex-wrap: wrap;
}
.hh-icon {
  width: 60px; height: 60px; background: rgba(255,255,255,.15); border-radius: 50%;
  display: flex; align-items: center; justify-content: center; font-size: 24px; flex-shrink: 0;
}
.hh-text .hl { font-size: 12px; opacity: .75; margin-bottom: 4px; }
.hh-text h2  { font-size: 20px; font-weight: 800; }
.hh-text p   { font-size: 13px; opacity: .8; margin-top: 3px; }
.hh-score .sn { font-size: 44px; font-weight: 800; color: #fff; line-height: 1; text-align: center; }
.hh-score .sl { font-size: 11px; opacity: .65; text-align: center; }

.cat-grid {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 12px; margin-bottom: 18px;
}
.cg-card {
  background: #fff; border: 1.5px solid #e8edf2;
  border-radius: 12px; padding: 16px; text-align: center;
  box-shadow: 0 2px 10px rgba(0,0,0,.05);
}
.cg-card.top { border-color: #1565c0; background: #e3f2fd; }
.cg-icon {
  width: 40px; height: 40px; border-radius: 10px;
  margin: 0 auto 8px; display: flex; align-items: center; justify-content: center; font-size: 18px;
}
.cg-name { font-size: 12.5px; font-weight: 700; color: #37474f; margin-bottom: 6px; }
.cg-num  { font-size: 30px; font-weight: 800; color: #1565c0; line-height: 1; }
.cg-of   { font-size: 11px; color: #90a4ae; }

/* ── SIDEBAR OVERLAY ── */
.sidebar-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,.5);
  z-index: 299;
  -webkit-tap-highlight-color: transparent;
}
.sidebar-overlay.active { display: block; }

/* ================================================================
   RESPONSIVE — TABLET & MOBILE
   ================================================================ */
@media (max-width: 900px) {
  /* Login */
  .login-container { grid-template-columns: 1fr; max-width: 480px; }
  .login-left { display: flex; padding: 24px 22px 20px; }
  .login-right { padding: 24px 22px; }

  /* Dashboard grid */
  .stat-row, .stat-row-4 { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .cat-grid { grid-template-columns: repeat(2, 1fr); }

  /* ── Sidebar: fixed overlay on mobile ── */
  .sidebar {
    position: fixed;
    top: 56px; left: 0;
    height: calc(100vh - 56px);
    width: 260px;
    z-index: 300;
    transform: translateX(-100%);
    overflow-y: auto; overflow-x: hidden;
    transition: transform .28s ease, box-shadow .28s ease;
  }
  .sidebar.mobile-open {
    transform: translateX(0);
    box-shadow: 4px 0 28px rgba(0,0,0,.4);
  }
  .sidebar.collapsed {
    transform: translateX(-100%);
  }

  /* Overlay when sidebar open */
  .sidebar-overlay {
    display: none;
    position: fixed; inset: 0;
    background: rgba(0,0,0,.5);
    z-index: 299;
    -webkit-tap-highlight-color: transparent;
  }
  .sidebar-overlay.active { display: block; }

  /* Content always full width — sidebar is overlay, not pushes content */
  .app-body { display: flex; flex: 1; }
  .content {
    flex: 1;
    width: 100%;
    padding: 16px 12px;
    margin-left: 0 !important;
    overflow-x: hidden;
  }

  /* Page header stack */
  .ph { flex-direction: column; gap: 12px; }
  .ph-actions { width: 100%; }

  /* Two-column grids → single */
  [style*="grid-template-columns:1fr 1fr"],
  [style*="grid-template-columns: 1fr 1fr"] {
    /* Can't override inline styles easily; use class override instead */
  }
}

@media (max-width: 600px) {
  /* Full-screen login form */
  #screen-login {
    padding: 0;
    align-items: flex-start;
    overflow-x: hidden;
    overflow-y: auto;
  }
  .login-container {
    border-radius: 14px;
    min-height: unset;
    overflow: visible;
    max-width: 100%;
  }
  .login-right {
    padding: 22px 18px 32px;
    max-height: none;
    overflow-y: visible;
  }
  .lr-top { margin-bottom: 20px; }
  .lr-top h2 { font-size: 20px; }

  /* Tabs smaller text */
  .lt { font-size: 11px; padding: 8px 4px; gap: 4px; }

  /* Daftar form: single column */
  .reg-grid-2 { grid-template-columns: 1fr !important; }

  /* Topbar user: hide name/role */
  .tb-uname, .tb-role { display: none; }
  .tb-user { padding: 6px; }

  /* Stat cards single col on very small */
  .stat-row, .stat-row-4 { grid-template-columns: 1fr 1fr; gap: 10px; }
  .scard { padding: 14px 16px; }
  .scard-left .val { font-size: 26px; }
  .scard-right { font-size: 22px; }

  /* Content padding */
  .content { padding: 12px 10px; }

  /* Siswa landing fullscreen */
  #screen-siswa-landing { padding: 0; align-items: flex-start; }
  .landing-box { border-radius: 0; min-height: 100vh; }
  .landing-header { border-radius: 0; }
  .landing-body { padding: 20px 16px; }

  /* Survey — mobile optimized */
  .survey-wrap { max-width: 100%; padding-bottom: 80px; }
  .survey-header {
    border-radius: 0;
    position: sticky; top: 0; /* no topbar in student view */
  }
  .survey-prog-wrap { position: sticky; top: 76px; }
  .survey-body { border-radius: 0; padding: 12px 12px 16px; }

  .q-item { padding: 12px; border-radius: 12px; }
  .q-item-text { font-size: 14px; }

  /* Show fixed bottom nav */
  .slide-nav { display: none; }
  .slide-nav-fixed { display: flex; }

  /* Result page */
  .hasil-hero { padding: 18px; gap: 14px; }
  .hh-score .sn { font-size: 36px; }
  .cat-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .cg-card { padding: 12px 10px; }
  .cg-num { font-size: 24px; }

  /* Card body padding */
  .card-body { padding: 14px 14px; }
  .card-head { padding: 14px 14px; }

  /* Ph */
  .ph-text h1 { font-size: 18px; }
}

@media (max-width: 400px) {
  .stat-row, .stat-row-4 { grid-template-columns: 1fr; }
  .lt span { display: none; } /* show only icons in tabs on tiny screens */
  .q-item-text { font-size: 13.5px; }
  .qbtn-ya, .qbtn-tidak { font-size: 14px; padding: 11px 8px; }
}

/* ================================================================
   UTILITY GRIDS — used via class instead of inline styles
   for mobile override
   ================================================================ */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.grid-lap { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 20px; }

@media (max-width: 700px) {
  .grid-2 { grid-template-columns: 1fr; }
  .grid-3 { grid-template-columns: 1fr 1fr; }
  .grid-4 { grid-template-columns: 1fr 1fr; }
  .grid-lap { grid-template-columns: 1fr; }
}
@media (max-width: 400px) {
  .grid-3 { grid-template-columns: 1fr; }
  .grid-4 { grid-template-columns: 1fr 1fr; }
}

/* ================================================================
   MOBILE FIX — Grid & Table overrides (v5.6)
   ================================================================ */

/* Grid profil: avatar + form */
.grid-profil { display: grid; grid-template-columns: 1fr 2fr; gap: 20px; }

/* Link generate form */
.grid-link-gen {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr 1fr auto;
  gap: 14px; align-items: end;
}

/* Backup preview cards */
#backup-preview-cards { display: grid; grid-template-columns: repeat(4,1fr); gap: 14px; margin-bottom: 20px; }

/* ── Tablet (max 900px) ── */
@media (max-width: 900px) {
  .grid-2  { grid-template-columns: 1fr !important; }
  .grid-3  { grid-template-columns: 1fr 1fr !important; }
  .grid-profil { grid-template-columns: 1fr !important; }
  .grid-link-gen { grid-template-columns: 1fr 1fr !important; }
  #backup-preview-cards { grid-template-columns: 1fr 1fr !important; }

  /* Tabel: horizontal scroll */
  .tbl-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; width: 100%; }
  .tbl { min-width: 500px; }

  /* DL bar stack */
  .dl-bar { flex-direction: column; gap: 12px; align-items: flex-start; }
  .dl-bar-btns { width: 100%; }
  .dl-bar-btns .btn-dl,
  .dl-bar-btns .btn-p { width: 100%; justify-content: center; }

  /* Page header */
  .ph { flex-direction: column; align-items: flex-start; gap: 10px; }
  .ph-actions { width: 100%; display: flex; flex-wrap: wrap; gap: 8px; }
  .ph-actions .btn-dl,
  .ph-actions .btn-p,
  .ph-actions .btn-s { flex: 1; justify-content: center; min-width: 120px; }

  /* Laporan cards */
  .laporan-card { width: 100%; }
}

/* ── Mobile (max 600px) ── */
@media (max-width: 600px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr !important; }
  .grid-link-gen { grid-template-columns: 1fr !important; }
  #backup-preview-cards { grid-template-columns: 1fr 1fr !important; }
  .grid-profil { grid-template-columns: 1fr !important; }

  /* Cards stat di dashboard: tetap 2 kolom */
  .stat-row, .stat-row-4 { grid-template-columns: 1fr 1fr !important; gap: 10px; }

  /* Tabel scroll */
  .tbl-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .tbl { min-width: 480px; font-size: 12px; }
  .tbl th { padding: 8px 10px; font-size: 10px; }
  .tbl td { padding: 9px 10px; font-size: 12px; }

  /* Tombol dalam card body: full width */
  .card-body .btn-p,
  .card-body .btn-dl,
  .card-body .btn-s { width: 100%; justify-content: center; margin-bottom: 6px; }

  /* sfbar (search bar area) */
  .sfbar { flex-direction: column; }
  .sfbar .si { width: 100%; min-width: unset; }
  .sfbar .sel { width: 100%; }

  /* Chart wrap */
  .pie-wrap { flex-direction: column; align-items: center; }

  /* Backup section */
  #backup-dl-section .grid-2 { grid-template-columns: 1fr !important; }

  /* Topbar: hide school name, show initials */
  .tb-school { display: none; }
  .tb-uname, .tb-role { display: none; }

  /* Sidebar tap highlight off */
  .sidebar.mobile-open { box-shadow: 4px 0 24px rgba(0,0,0,.3); }

  /* Page title smaller */
  .ph-text h1 { font-size: 17px; }
  .ph-text p { font-size: 12px; }

  /* Card head & body */
  .card-head { padding: 12px 14px; }
  .card-body { padding: 14px; }
  .card-head .ct { font-size: 13.5px; }
}


/* ================================================================
   SIDEBAR MOBILE — FORCE OVERRIDE (harus di paling bawah)
   ================================================================ */
/* Pastikan sidebar selalu muncul saat mobile-open, 
   override apapun termasuk inline style */
#screen-app .sidebar.mobile-open {
  display: flex !important;
  flex-direction: column;
  width: 260px !important;
  overflow-y: auto !important;
  overflow-x: hidden !important;
  position: fixed !important;
  top: 56px !important;
  left: 0 !important;
  height: calc(100vh - 56px) !important;
  z-index: 300 !important;
  box-shadow: 4px 0 28px rgba(0,0,0,.4) !important;
  background: var(--sidebar-bg) !important;
}

/* Sidebar item di mobile: lebih mudah di-tap */
@media (max-width: 900px) {
  .sb-item {
    padding: 13px 18px;
    font-size: 14px;
    min-height: 48px;
    -webkit-tap-highlight-color: transparent;
  }
  .sb-item i { font-size: 16px; }
  .sidebar-bottom .sb-item { padding: 13px 18px; }

  /* Topbar hamburger lebih besar di mobile */
  .tb-hamburger {
    width: 42px; height: 42px;
    font-size: 18px;
  }
}

/* ── Analisis Individu layout ── */
@media (max-width: 900px) {
  [style*="grid-template-columns:280px"] {
    grid-template-columns: 1fr !important;
  }
  #individu-siswa-list { max-height: 260px !important; }
}

/* ================================================================
   MOBILE FIX KOMPREHENSIF v6.0
   Semua fitur Guru BK & Super Admin bisa diakses dari HP/Android
   ================================================================ */

/* ── Global: pastikan tidak ada overflow horizontal ── */
@media (max-width: 900px) {
  html, body { overflow-x: hidden; }

  /* ── App body: content harus full width ── */
  .app-body { overflow-x: hidden; }
  .content {
    padding: 12px 10px;
    overflow-x: hidden;
    width: 100%;
    max-width: 100vw;
    box-sizing: border-box;
  }

  /* ── Semua card: pastikan tidak keluar layar ── */
  .card { overflow: hidden; }
  .card-body { overflow-x: auto; }

  /* ── Page header: stack vertikal ── */
  .ph {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }
  .ph-actions {
    width: 100%;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
  }
  .ph-actions .btn-p,
  .ph-actions .btn-dl,
  .ph-actions .btn-s {
    flex: 1;
    min-width: 120px;
    justify-content: center;
  }

  /* ── Topbar ── */
  .topbar { padding: 0 10px; }
  .tb-school { display: none; }
  .tb-uname, .tb-role { display: none; }

  /* ── Modal: full screen di HP ── */
  .modal-ov {
    align-items: flex-end;
    padding: 0;
  }
  .modal {
    width: 100% !important;
    max-width: 100% !important;
    border-radius: 20px 20px 0 0 !important;
    max-height: 92vh;
    overflow-y: auto;
  }
  .modal-hd { position: sticky; top: 0; background: #fff; z-index: 2; }

  /* ── Grid: semua jadi 1 kolom ── */
  .grid-2, .grid-3, .grid-4, .grid-lap { grid-template-columns: 1fr !important; }
  .grid-profil { grid-template-columns: 1fr !important; }
  .grid-link-gen { grid-template-columns: 1fr !important; }
  #backup-preview-cards { grid-template-columns: 1fr 1fr !important; gap: 10px !important; }

  /* Stat cards: tetap 2 kolom */
  .stat-row, .stat-row-4 { grid-template-columns: 1fr 1fr !important; gap: 10px; }

  /* ── Override SEMUA inline grid style yang tidak responsive ── */
  /* Analisis individu: sidebar list + detail */
  [style*="grid-template-columns:280px"],
  [style*="grid-template-columns: 280px"] {
    grid-template-columns: 1fr !important;
    display: flex !important;
    flex-direction: column !important;
  }
  /* Export per sekolah: flex → stack */
  [style*="display:flex;gap:12px;align-items:flex-end"],
  [style*="display: flex; gap: 12px; align-items: flex-end"] {
    flex-direction: column !important;
    align-items: stretch !important;
  }
  /* Laporan individu: 4-col grid → 1 col */
  [style*="grid-template-columns:1fr 1fr auto auto"],
  [style*="grid-template-columns: 1fr 1fr auto auto"] {
    grid-template-columns: 1fr 1fr !important;
  }

  /* ── Tabel: horizontal scroll wajib ── */
  .tbl-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    width: 100%;
  }
  .tbl { min-width: 480px; font-size: 12px; }
  .tbl th { padding: 8px 10px; font-size: 11px; white-space: nowrap; }
  .tbl td { padding: 8px 10px; font-size: 12px; }

  /* ── Tombol: min touch target 44px ── */
  .btn-p, .btn-s, .btn-dl, .btn-login {
    min-height: 44px;
    font-size: 13px;
  }
  .btn-ic {
    width: 38px;
    height: 38px;
    min-height: 38px;
  }

  /* ── DL bar (backup/export) ── */
  .dl-bar { flex-direction: column; gap: 12px; align-items: stretch; }
  .dl-bar-btns { width: 100%; }
  .dl-bar-btns .btn-dl,
  .dl-bar-btns .btn-p { width: 100%; justify-content: center; }

  /* ── Search & filter bar ── */
  .sfbar { flex-direction: column; gap: 8px; }
  .sfbar .si { width: 100%; min-width: unset; }
  .sfbar .sel, .sfbar select { width: 100%; }

  /* ── Individu siswa list ── */
  #individu-siswa-list {
    max-height: 200px !important;
    margin-bottom: 12px;
  }

  /* ── Chart/grafik: pie wrap stack ── */
  .pie-wrap { flex-direction: column; align-items: center; }

  /* ── Link aktif table wrapper ── */
  #link-tbl-wrap, .link-tbl-outer { overflow-x: auto; }

  /* ── Bank soal table ── */
  #soal-tbl-wrap { overflow-x: auto; }

  /* ── Laporan cards ── */
  .laporan-card { width: 100% !important; }

  /* ── Page title ── */
  .ph-text h1 { font-size: 17px; }
  .ph-text p { font-size: 12px; }

  /* ── Card head ── */
  .card-head { padding: 12px 14px; flex-wrap: wrap; gap: 8px; }
  .card-head .ct { font-size: 13.5px; }

  /* ── Form di modal edit guru & detail ── */
  .grid-2[style] { grid-template-columns: 1fr !important; }

  /* ── Backup download section ── */
  #backup-dl-section .card-body { padding: 12px; }

  /* ── Export per sekolah wrapper ── */
  #pv-sa-export .lf-select { width: 100%; }
}

/* ── Extra small screens (< 480px) ── */
@media (max-width: 480px) {
  .content { padding: 10px 8px; }
  .card-body { padding: 12px 10px; }
  .card-head { padding: 10px 12px; }
  .stat-row, .stat-row-4 { grid-template-columns: 1fr 1fr !important; gap: 8px; }
  .scard { padding: 12px 12px; }
  .scard-left .val { font-size: 24px; }
  .scard-right { font-size: 20px; }

  /* Tabel lebih compact */
  .tbl { min-width: 420px; font-size: 11.5px; }
  .tbl th { font-size: 10px; padding: 7px 8px; }
  .tbl td { font-size: 11.5px; padding: 7px 8px; }

  /* Tombol action di card head: wrap */
  .card-head { flex-direction: column; align-items: flex-start; }
  .card-head > *:last-child { width: 100%; }
  .card-head button, .card-head .btn-p, .card-head .btn-s, .card-head .btn-dl {
    width: 100%;
    justify-content: center;
  }

  /* Backup preview: 1 kolom */
  #backup-preview-cards { grid-template-columns: 1fr 1fr !important; }

  /* Modal full screen */
  .modal { max-height: 95vh; }

  /* Inline grid di modal detail guru */
  [style*="grid-template-columns:1fr 1fr"] { grid-template-columns: 1fr !important; }

  /* Topbar: lebih compact */
  .tb-brand { font-size: 13px; }
  .tb-hamburger { width: 38px; height: 38px; }

  /* Grid link gen: 1 col, tombol full width */
  .grid-link-gen { grid-template-columns: 1fr !important; }
  .grid-link-gen button { width: 100%; }

  /* Laporan: tombol stack */
  [style*="display:flex;gap:10px;align-items:center;margin-top:4px"] {
    flex-direction: column !important;
    align-items: stretch !important;
  }
  [style*="display:flex;gap:10px;align-items:center;margin-top:4px"] button {
    width: 100%;
    justify-content: center;
  }
}

/* ── Touch-specific: hapus hover glow di HP ── */
@media (hover: none) and (pointer: coarse) {
  .btn-p:hover, .btn-s:hover, .btn-dl:hover, .btn-login:hover {
    transform: none;
    box-shadow: none;
  }
  .sb-item:hover { background: transparent; }
  .sb-item.active { background: var(--sidebar-active); }

  /* Perbesar tap area sidebar item */
  .sb-item {
    padding: 14px 20px;
    min-height: 52px;
  }

  /* Perbesar tombol aksi di tabel */
  .btn-ic { width: 42px; height: 42px; font-size: 15px; }

  /* Checkbox lebih mudah di-tap */
  input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
  }
}

/* ── Fix: screen-app overflow harus tersembunyi ── */
@media (max-width: 900px) {
  #screen-app {
    overflow-x: hidden;
    max-width: 100vw;
  }

  /* Pastikan .pv tidak overflow */
  .pv { max-width: 100%; overflow-x: hidden; }

  /* Grafik kelas selector */
  #grafik-kelas { width: 100%; }

  /* Analisis kelompok filter area */
  #kelompok-kelas-checkboxes label {
    font-size: 12px;
    padding: 4px 9px;
  }

  /* Dashboard filter kelas */
  #dash-kelas-checkboxes label {
    font-size: 12px;
    padding: 4px 9px;
  }

  /* Dash bidang cards: 2x2 grid on mobile */
  #dash-bidang-cards > div { font-size: 12px; }

  /* Link table: pastikan scroll */
  #pv-guru-link .card-body { padding: 0; }
  #pv-guru-link .tbl-wrap { overflow-x: auto; border-radius: 0 0 12px 12px; }

  /* Resp filter area */
  #pv-guru-responden .sfbar { flex-direction: column; }

  /* SA guru table actions */
  #guru-tbl .btn-ic { margin: 1px; }

  /* SA schools table */
  #school-tbl .btn-ic { margin: 1px; }
}

/* ── Targeted class overrides for formerly-inline-only styles ── */
@media (max-width: 900px) {
  /* Analisis individu: list di atas, detail di bawah */
  .individu-main-grid {
    display: flex !important;
    flex-direction: column !important;
    gap: 0 !important;
  }
  /* Laporan individu: 2 col select + 2 tombol */
  .lap-ind-grid {
    grid-template-columns: 1fr 1fr !important;
  }
  /* Modal detail guru: 1 kolom */
  .modal-detail-grid {
    grid-template-columns: 1fr !important;
  }
  /* Export per sekolah: stack */
  .export-school-row {
    flex-direction: column !important;
    align-items: stretch !important;
  }
  .export-school-row .lf-group { margin-bottom: 0; }
  .export-school-row .btn-dl { width: 100%; justify-content: center; }
}

@media (max-width: 480px) {
  /* Laporan individu: 1 kolom */
  .lap-ind-grid {
    grid-template-columns: 1fr !important;
  }
  .lap-ind-grid button { width: 100%; justify-content: center; }
}

/* ================================================================
   LOGIN BUTTON FIX — Pastikan tombol login selalu bisa diklik di mobile
   ================================================================ */
@media (max-width: 900px) {
  /* Pastikan login-right bisa scroll dan tombol tidak terpotong */
  #screen-login {
    align-items: flex-start !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch;
  }

  .login-container {
    overflow: visible !important;
    min-height: unset !important;
  }

  .login-right {
    overflow-y: visible !important;
    max-height: none !important;
    padding-bottom: 48px !important;
  }

  /* Tombol login: z-index tinggi, pointer-events paksa aktif */
  .btn-login {
    position: relative;
    z-index: 10;
    pointer-events: auto !important;
    -webkit-tap-highlight-color: rgba(21,101,192,0.2);
    touch-action: manipulation;
    cursor: pointer;
  }

  /* Form login tidak boleh overflow hidden */
  #form-masuk, #form-guru, #form-superadmin,
  #form-daftar, #form-lupa {
    overflow: visible !important;
  }

  /* Login tabs tombol: touch target cukup */
  .lt {
    min-height: 44px;
    touch-action: manipulation;
    -webkit-tap-highlight-color: rgba(21,101,192,0.15);
  }
}

/* ── SA Dashboard: stat cards clickable ── */
.scard[onclick] {
  transition: transform .15s ease, box-shadow .15s ease;
  user-select: none;
  -webkit-tap-highlight-color: rgba(255,255,255,.15);
}
.scard[onclick]:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(0,0,0,.18);
}
.scard[onclick]:active {
  transform: translateY(0);
  box-shadow: 0 2px 8px rgba(0,0,0,.12);
}

/* ── Topbar: tombol Keluar terpisah ── */
#btn-topbar-logout {
  display: flex; align-items: center; gap: 6px;
  padding: 7px 13px; border-radius: 8px;
  border: 1.5px solid #ffcdd2;
  background: #fff5f5; color: #c62828;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 12.5px; font-weight: 700;
  cursor: pointer; transition: all .2s;
  white-space: nowrap; min-height: 36px;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
#btn-topbar-logout:hover {
  background: #ffebee; border-color: #ef9a9a;
  transform: translateY(-1px);
}
#btn-topbar-logout:active { transform: translateY(0); }

/* Sembunyikan label "Keluar" di HP kecil, tampilkan ikon saja */
@media (max-width: 480px) {
  #btn-topbar-logout .tb-logout-text { display: none; }
  #btn-topbar-logout { padding: 7px 10px; }
}

/* tb-user: jangan ada efek login/logout, cukup hover halus */
.tb-user {
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
.tb-user:hover .tb-avatar {
  box-shadow: 0 0 0 3px rgba(21,101,192,.2);
}

/* ── Tombol Keluar di topbar ── */
#btn-topbar-logout:hover {
  background: #ffebee !important;
  border-color: #ef9a9a !important;
  transform: translateY(-1px);
  box-shadow: 0 3px 10px rgba(198,40,40,.15);
}
#btn-topbar-logout:active {
  transform: translateY(0);
}
@media (max-width: 600px) {
  /* Di HP: sembunyikan teks "Keluar", tampilkan ikon saja */
  .tb-logout-text { display: none; }
  #btn-topbar-logout {
    padding: 7px 10px !important;
    min-width: 38px;
    justify-content: center;
  }
}

/* ================================================================
   LOADING SPLASH SCREEN
   ================================================================ */
#screen-loading {
  position: fixed;
  inset: 0;
  background: linear-gradient(135deg, #0d1b3e 0%, #1565c0 60%, #0288d1 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 99999;
  transition: opacity .35s ease;
}
#screen-loading.fade-out {
  opacity: 0;
  pointer-events: none;
}
#screen-loading.hidden { display: none !important; }

.loading-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.loading-logo {
  position: relative;
  width: 80px;
  height: 80px;
}

.loading-spinner {
  position: absolute;
  inset: 0;
  border: 3px solid rgba(255,255,255,.2);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.loading-icon {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  color: rgba(255,255,255,.85);
}

.loading-brand {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 26px;
  font-weight: 800;
  color: #fff;
  letter-spacing: -.5px;
}

.loading-text {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 13px;
  color: rgba(255,255,255,.6);
  letter-spacing: .5px;
}

/* Pastikan screen-login tidak flash sebelum Firebase siap */
#screen-login {
  opacity: 1 !important; /* selalu jernih, opacity dikontrol via JS hanya sesaat */
}

/* ================================================================
   IMPOR DATA — Dropzone & UI
   ================================================================ */
#impor-dropzone:hover,
#impor-dropzone.dz-hover {
  border-color: #1565c0 !important;
  background: #e3f2fd !important;
}
#impor-dropzone.dz-hover .fa-file-excel {
  opacity: 1 !important;
  transform: scale(1.1);
}

/* ================================================================
   MOBILE SIDEBAR FIX — Override semua agar sidebar tidak menutupi konten
   ================================================================ */
@media (max-width: 900px) {
  /* Sidebar selalu overlay (bukan push), konten selalu full width */
  #screen-app .app-body {
    display: block;
    position: relative;
  }
  #screen-app .sidebar {
    position: fixed !important;
    top: 56px !important;
    left: 0 !important;
    width: 260px !important;
    height: calc(100vh - 56px) !important;
    transform: translateX(-100%) !important;
    z-index: 300 !important;
    transition: transform .28s ease, box-shadow .28s ease !important;
    overflow: hidden !important;
    overflow-y: auto !important;
  }
  #screen-app .sidebar.mobile-open {
    transform: translateX(0) !important;
    box-shadow: 6px 0 32px rgba(0,0,0,.45) !important;
    overflow-y: auto !important;
  }
  /* Content selalu full width tanpa margin */
  #screen-app .content {
    margin-left: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    padding: 16px 12px !important;
  }
  /* Overlay di bawah sidebar */
  .sidebar-overlay {
    position: fixed !important;
    inset: 0 !important;
    z-index: 299 !important;
    background: rgba(0,0,0,.5) !important;
    display: none !important;
  }
  .sidebar-overlay.active {
    display: block !important;
  }
  /* Topbar hamburger visible */
  .menu-btn { display: flex !important; }
}

/* ================================================================
   LOGIN CONTACT BOX — di bawah kotak login, terpisah
   ================================================================ */
.login-contact-box {
  width: 100%;
  max-width: 900px;
  background: rgba(255,255,255,.09);
  border: 1.5px solid rgba(255,255,255,.18);
  border-radius: 16px;
  padding: 20px 28px;
  color: rgba(255,255,255,.9);
}
.lcb-grid {
  display: grid;
  grid-template-columns: 1.6fr 1fr 1.2fr;
  gap: 20px;
  align-items: start;
}
.lcb-col { display: flex; flex-direction: column; gap: 10px; }
.lcb-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 13.5px;
  line-height: 1.65;
  color: rgba(255,255,255,.88);
}
.lcb-item a {
  color: rgba(255,255,255,.88);
  text-decoration: none;
  font-size: 13.5px;
}
.lcb-item a:hover { text-decoration: underline; color: #fff; }
.lcb-icon {
  color: rgba(255,255,255,.65);
  font-size: 14px;
  margin-top: 3px;
  flex-shrink: 0;
  width: 16px;
  text-align: center;
}
.lcb-label {
  display: block;
  font-weight: 700;
  font-size: 13.5px;
  color: #fff;
  margin-bottom: 3px;
}
.lcb-map {
  border-radius: 10px;
  overflow: hidden;
  border: 1.5px solid rgba(255,255,255,.2);
}
.lcb-map-link {
  display: block;
  text-decoration: none;
  position: relative;
  cursor: pointer;
}
.lcb-map-overlay {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  background: rgba(21,101,192,.8);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  text-align: center;
  padding: 6px 0;
  opacity: 0;
  transition: opacity .2s;
}
.lcb-map-link:hover .lcb-map-overlay { opacity: 1; }

@media (max-width: 900px) {
  .login-contact-box { padding: 16px 18px; max-width: 100%; border-radius: 12px; }
  .lcb-grid { grid-template-columns: 1fr; gap: 12px; }
  .lcb-item { font-size: 13px; }
  .lcb-item a { font-size: 13px; }
  .lcb-label { font-size: 13px; }
}

/* ================================================================
   MOBILE LOGIN — Override final: 3 kotak terpisah dari atas ke bawah
   1. Kotak branding (login-left)
   2. Kotak form (login-right)
   3. Kotak alamat (login-contact-box)
   ================================================================ */
@media (max-width: 900px) {
  #screen-login {
    flex-direction: column !important;
    align-items: center !important;
    justify-content: flex-start !important;
    padding: 16px 14px 28px !important;
    gap: 14px !important;
    overflow-y: auto !important;
    min-height: 100vh;
  }
  .login-container {
    grid-template-columns: 1fr !important;
    min-height: unset !important;
    max-width: 100% !important;
    width: 100% !important;
    border-radius: 16px !important;
    overflow: visible !important;
    box-shadow: 0 12px 40px rgba(0,0,0,.35) !important;
  }
  .login-left {
    display: flex !important;
    flex-direction: column !important;
    padding: 20px 18px 16px !important;
    max-height: none !important;
    overflow: hidden !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }
  /* Logo kecil dan rata tengah di mobile */
  .ll-logo { text-align: center !important; display: flex !important; justify-content: center !important; margin-bottom: 14px !important; }
  .ll-logo > div { display: inline-block !important; max-width: calc(100% - 32px) !important; padding: 10px 16px !important; }
  .ll-logo-img, .ll-logo img { height: 85px !important; width: auto !important; max-width: 260px !important; object-fit: contain !important; display: block !important; margin: 0 auto !important; }
  .ll-title { font-size: 15px !important; }
  .ll-sub { font-size: 11px !important; margin-bottom: 10px !important; }
  .ll-features li { font-size: 11.5px !important; margin-bottom: 5px !important; }
  .login-right {
    padding: 20px 18px 28px !important;
    max-height: none !important;
    overflow: hidden !important;
    min-height: unset !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }
  /* Kotak alamat di bawah */
  .login-contact-box {
    width: 100% !important;
    max-width: 100% !important;
    border-radius: 14px !important;
    padding: 16px 16px !important;
  }
  .lcb-grid { grid-template-columns: 1fr !important; gap: 10px !important; }
  
  .lcb-item { font-size: 13px !important; }
  .lcb-label { font-size: 13px !important; }
  /* Tampilkan peta di mobile */
  .lcb-map {
    display: block !important;
    margin-top: 10px;
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid rgba(255,255,255,.2);
    height: 140px;
  }
  .lcb-map iframe { height: 140px !important; }
}

/* ================================================================
   MOBILE PARITY PATCH v7.0
   Memastikan SEMUA fitur & tampilan mobile = desktop
   ================================================================ */

/* ── 1. SIDEBAR: Tombol hamburger visible, ukuran & fungsi benar ── */
.tb-hamburger {
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ── 2. TOPBAR: tampilan lengkap di desktop, compact di mobile ── */
@media (min-width: 901px) {
  .tb-uname, .tb-role { display: block; }
  .tb-school { display: block; }
  .tb-logout-text { display: inline; }
}

/* ── 3. SA DASHBOARD: stat-row konsisten ── */
.stat-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 20px;
  position: relative;
}

@media (max-width: 900px) {
  .stat-row {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 12px !important;
  }
  /* SA stat-row baris kedua (kota/prov/tahun) */
  .stat-row + .stat-row {
    grid-template-columns: repeat(2, 1fr) !important;
  }
}
@media (max-width: 400px) {
  .stat-row { grid-template-columns: 1fr !important; }
}

/* ── 4. BACKUP PREVIEW CARDS — tetap 2×2 di mobile ── */
@media (max-width: 900px) {
  #backup-preview-cards {
    grid-template-columns: 1fr 1fr !important;
  }
}

/* ── 5. BACKUP DOWNLOAD SECTION: grid-2 tetap 2 kolom sampai ≤480 ── */
@media (max-width: 480px) {
  #backup-dl-section .grid-2 {
    grid-template-columns: 1fr !important;
  }
}

/* ── 6. IMPOR PAGE: panduan cards auto-fit tetap ok, tapi dropzone full ── */
@media (max-width: 900px) {
  #impor-dropzone {
    padding: 28px 16px !important;
  }
  #impor-dropzone > div:first-of-type {
    font-size: 14px !important;
  }
  /* Tombol template di ph-actions: full width di mobile kecil */
  #pv-guru-impor .ph-actions {
    flex-direction: column;
  }
  #pv-guru-impor .ph-actions .btn-dl {
    width: 100%;
    justify-content: center;
  }
}

/* ── 7. LAPORAN INDIVIDU: lap-ind-grid ── */
@media (max-width: 900px) {
  .lap-ind-grid {
    grid-template-columns: 1fr 1fr !important;
  }
}
@media (max-width: 480px) {
  .lap-ind-grid {
    grid-template-columns: 1fr !important;
  }
  .lap-ind-grid button {
    width: 100% !important;
    justify-content: center;
  }
}

/* ── 8. LAPORAN KELAS: tombol pilih/hapus + unduh stack rapi ── */
@media (max-width: 600px) {
  #pv-guru-laporan .card-body [style*="display:flex;gap:10px"] {
    flex-direction: column !important;
    align-items: stretch !important;
  }
  #pv-guru-laporan .card-body [style*="display:flex;gap:10px"] button {
    width: 100% !important;
    justify-content: center;
  }
  #pv-guru-laporan .card-body [style*="flex:1"] {
    display: none;
  }
}

/* ── 9. PROFIL PAGE: grid-profil ── */
@media (max-width: 900px) {
  .grid-profil {
    grid-template-columns: 1fr !important;
  }
  .profil-avatar-wrap {
    padding: 16px !important;
  }
  .profil-avatar {
    width: 72px !important;
    height: 72px !important;
    font-size: 28px !important;
  }
}

/* Profil form grid-2 di dalam card: tetap 2 col sampai 480px */
@media (max-width: 480px) {
  .profil-avatar {
    width: 64px !important;
    height: 64px !important;
  }
  /* grid-column: 1/-1 tetap span full */
  .card-body.grid-2 .lf-group[style*="grid-column"] {
    grid-column: 1 / -1 !important;
  }
}

/* ── 10. ANALISIS KELOMPOK: filter kelas checkboxes ── */
@media (max-width: 900px) {
  #pv-guru-kelompok > div:first-of-type {
    padding: 10px 12px !important;
  }
  #kelompok-kelas-checkboxes {
    gap: 6px !important;
  }
}

/* ── 11. ANALISIS INDIVIDU: individu-main-grid ── */
@media (max-width: 900px) {
  .individu-main-grid {
    grid-template-columns: 1fr !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 12px !important;
  }
  #individu-siswa-list {
    max-height: 220px !important;
    overflow-y: auto;
  }
}

/* ── 12. GRAFIK PAGE: canvas responsif ── */
@media (max-width: 900px) {
  #pv-guru-grafik canvas {
    max-width: 100% !important;
    height: auto !important;
  }
  #g-per-kelas, #g-top10-full {
    overflow-x: auto;
  }
}

/* ── 13. SISWA HASIL: cat-grid & hasil-hero ── */
@media (max-width: 900px) {
  .cat-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 10px !important;
  }
  .hasil-hero {
    flex-wrap: wrap;
  }
  .hh-score {
    margin-left: auto;
  }
}
@media (max-width: 480px) {
  .cat-grid {
    grid-template-columns: 1fr 1fr !important;
  }
  .hasil-hero {
    padding: 14px !important;
    gap: 12px !important;
  }
  .hh-score .sn { font-size: 32px !important; }
  /* Tombol isi ulang & selesai */
  #pv-siswa-hasil > [style*="display:flex;gap:10px"] {
    flex-direction: column !important;
  }
  #pv-siswa-hasil > [style*="display:flex;gap:10px"] button {
    width: 100% !important;
  }
}

/* ── 14. MODAL: semua modal bottom-sheet di mobile ── */
@media (max-width: 900px) {
  .modal-ov {
    align-items: flex-end !important;
    padding: 0 !important;
  }
  .modal {
    width: 100% !important;
    max-width: 100% !important;
    border-radius: 20px 20px 0 0 !important;
    max-height: 93vh !important;
    overflow-y: auto;
  }
  .modal-hd {
    position: sticky;
    top: 0;
    background: #fff;
    z-index: 2;
    border-radius: 20px 20px 0 0;
  }
  .modal-ft {
    position: sticky;
    bottom: 0;
    background: #fff;
    z-index: 2;
    padding: 12px 16px !important;
    border-top: 1px solid #f0f0f0;
  }
  /* Modal detail guru */
  .modal-detail-grid {
    grid-template-columns: 1fr !important;
  }
  /* Modal QR: lebar penuh */
  #m-qr .modal {
    width: 100% !important;
  }
  #qr-modal-img {
    width: min(72vw, 320px) !important;
    height: min(72vw, 320px) !important;
  }
  /* Modal footer buttons */
  .modal-ft {
    display: flex;
    gap: 8px;
  }
  .modal-ft button {
    flex: 1;
    justify-content: center;
  }
}

/* ── 15. TABEL: semua tabel scroll horizontal, tidak terpotong ── */
@media (max-width: 900px) {
  /* Pastikan semua tbl-wrap terbaca */
  .tbl-wrap {
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
    width: 100%;
    max-width: 100vw;
  }
  /* Kolom aksi di tabel: jangan dipersempit */
  .tbl td:last-child, .tbl th:last-child {
    white-space: nowrap;
  }
}

/* ── 16. TOPBAR LAYOUT: jaga agar tidak overflow ── */
@media (max-width: 900px) {
  .topbar {
    padding: 0 10px !important;
    gap: 8px !important;
  }
  .tb-right {
    gap: 6px !important;
  }
  .tb-brand {
    max-width: 150px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
}
@media (max-width: 400px) {
  .tb-brand {
    max-width: 110px;
    font-size: 12px !important;
  }
}

/* ── 17. DL-BAR (backup/export status bar) ── */
@media (max-width: 900px) {
  .dl-bar {
    flex-direction: column !important;
    gap: 12px !important;
    align-items: stretch !important;
  }
  .dl-bar-btns {
    width: 100% !important;
  }
  .dl-bar-btns .btn-dl {
    width: 100% !important;
    justify-content: center;
  }
}

/* ── 18. SFBAR (search/filter bar) ── */
@media (max-width: 900px) {
  .sfbar {
    flex-direction: column !important;
    gap: 8px !important;
  }
  .sfbar .si,
  .sfbar .sel,
  .sfbar select,
  .sfbar input[type="text"],
  .sfbar input[type="search"] {
    width: 100% !important;
    min-width: unset !important;
  }
}

/* ── 19. PIE CHART WRAP ── */
@media (max-width: 900px) {
  .pie-wrap {
    flex-direction: column !important;
    align-items: center !important;
    gap: 12px !important;
  }
  .pie-legend {
    width: 100% !important;
  }
}

/* ── 20. CARD HEAD: tombol aksi wrap ── */
@media (max-width: 480px) {
  .card-head {
    flex-wrap: wrap !important;
    gap: 8px !important;
  }
  .card-head .btn-p,
  .card-head .btn-s,
  .card-head .btn-dl {
    font-size: 12px;
    padding: 7px 12px;
  }
}

/* ── 21. SOAL SECTION (bank soal SA) ── */
@media (max-width: 900px) {
  #soal-tbl-wrap {
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
  }
  #pv-sa-soal .ph-actions {
    width: 100%;
    flex-wrap: wrap;
  }
  #pv-sa-soal .ph-actions button {
    flex: 1;
    min-width: 120px;
    justify-content: center;
  }
}

/* ── 22. LINK TABLE (kelola link & kelas) ── */
@media (max-width: 900px) {
  #link-tbl-wrap,
  .link-tbl-outer,
  #pv-guru-link .tbl-wrap {
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
  }
  /* grid-link-gen: 1 kolom penuh */
  .grid-link-gen {
    grid-template-columns: 1fr !important;
  }
  .grid-link-gen button {
    width: 100% !important;
    justify-content: center;
  }
}

/* ── 23. RESPONDEN SECTION ── */
@media (max-width: 900px) {
  #pv-guru-responden .sfbar {
    flex-direction: column !important;
  }
  #pv-guru-responden .tbl-wrap {
    overflow-x: auto !important;
  }
}

/* ── 24. DASHBOARD GURU: filter kelas bar ── */
@media (max-width: 900px) {
  #pv-guru-dashboard > div:nth-child(2) {
    padding: 10px 12px !important;
  }
  #dash-kelas-checkboxes {
    gap: 6px !important;
  }
  /* Tombol semua/reset filter */
  #pv-guru-dashboard > div:nth-child(2) .btn-s {
    font-size: 11px !important;
    padding: 5px 9px !important;
    white-space: nowrap;
  }
}

/* ── 25. DASHBOARD GURU: stat cards 4 kolom → 2×2 ── */
@media (max-width: 900px) {
  .stat-row-4 {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 12px !important;
  }
}
@media (max-width: 400px) {
  .stat-row-4 {
    grid-template-columns: 1fr 1fr !important;
  }
}

/* ── 26. SA CHART SUMMARY: flex wrap ── */
@media (max-width: 900px) {
  #sa-chart-summary {
    flex-direction: column !important;
    gap: 8px !important;
  }
  #sa-chart-summary > div {
    width: 100% !important;
  }
}

/* ── 27. EXPORT PER SEKOLAH ── */
@media (max-width: 900px) {
  .export-school-row {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 10px !important;
  }
  .export-school-row .lf-group {
    margin-bottom: 0 !important;
  }
  .export-school-row .btn-dl {
    width: 100% !important;
    justify-content: center;
    white-space: normal !important;
  }
}

/* ── 28. SISWA INSTRUMEN: survey navigasi sticky ── */
@media (max-width: 600px) {
  .survey-wrap {
    padding-bottom: 72px !important;
  }
  .survey-header {
    padding: 14px 16px !important;
  }
  .sh-icon {
    width: 36px !important;
    height: 36px !important;
    font-size: 16px !important;
  }
  .sh-text .hn {
    font-size: 14px !important;
  }
  .sh-text .hs {
    font-size: 11px !important;
  }
  /* Progress bar */
  .survey-prog-wrap {
    padding: 8px 14px !important;
    top: 64px !important;
  }
}

/* ── 29. LOGIN PAGE: kotak branding lebih compact di mobile ── */
@media (max-width: 600px) {
  .login-container {
    border-radius: 0 !important;
    box-shadow: none !important;
    min-height: 100vh !important;
  }
  #screen-login {
    padding: 0 !important;
    gap: 0 !important;
  }
  .login-left {
    border-radius: 0 !important;
  }
  .login-right {
    border-radius: 0 !important;
  }
  .login-contact-box {
    border-radius: 0 !important;
  }
}

/* ── 30. FORM INPUT: font size 16px mencegah zoom di iOS ── */
@media (max-width: 900px) {
  .lf-input,
  .lf-select,
  input[type="text"],
  input[type="email"],
  input[type="tel"],
  input[type="password"],
  input[type="search"],
  select,
  textarea {
    font-size: 16px !important;
    -webkit-text-size-adjust: 100%;
  }
}

/* ── 31. CHECKBOX LABEL (kelas filter): readable di mobile ── */
@media (max-width: 900px) {
  #kelompok-kelas-checkboxes label,
  #dash-kelas-checkboxes label,
  #lap-kelas-checkboxes label {
    font-size: 12px !important;
    padding: 5px 10px !important;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
  }
}

/* ── 32. BIDANG BARS (dashboard): font size ── */
@media (max-width: 900px) {
  #dash-bidang-bars {
    font-size: 12px !important;
  }
  #dash-bidang-bars > div {
    font-size: 12px !important;
  }
}

/* ── 33. CONTENT OVERFLOW: pastikan tidak ada horizontal scroll ── */
@media (max-width: 900px) {
  .pv {
    overflow-x: hidden;
    max-width: 100%;
  }
  .card {
    max-width: 100%;
  }
  .card-body {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
}

/* ── 34. TOMBOL AKSI DALAM TABEL: tidak kepotong ── */
@media (max-width: 900px) {
  .tbl .btn-ic {
    width: 34px !important;
    height: 34px !important;
    font-size: 13px !important;
    margin: 1px !important;
  }
}

/* ── 35. SA CARD DETAIL MODAL: scroll bebas ── */
@media (max-width: 900px) {
  #m-sa-card-detail .modal-bd {
    max-height: 75vh !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
  }
  #m-sa-card-detail .modal-bd .tbl-wrap {
    overflow-x: auto !important;
  }
}

/* ── 36. TOUCH TARGET: semua elemen interaktif ≥44px ── */
@media (max-width: 900px) {
  .sb-item,
  .lt,
  .btn-login,
  .btn-p,
  .btn-s,
  .btn-dl {
    min-height: 44px !important;
    touch-action: manipulation;
    -webkit-tap-highlight-color: rgba(0,0,0,.05);
  }
  .btn-ic {
    min-height: 38px !important;
    min-width: 38px !important;
  }
  /* Checkbox tap area */
  input[type="checkbox"] {
    min-width: 20px;
    min-height: 20px;
    cursor: pointer;
  }
}

/* ── 37. SURVEY ITEM (siswa): q-item responsive ── */
@media (max-width: 900px) {
  .q-item {
    padding: 12px 14px !important;
  }
  .q-item-text {
    font-size: 14px !important;
    line-height: 1.6 !important;
  }
  .qbtn-ya,
  .qbtn-tidak {
    min-height: 44px !important;
    font-size: 14px !important;
  }
}
@media (max-width: 400px) {
  .q-item-text { font-size: 13.5px !important; }
  .qbtn-ya, .qbtn-tidak {
    font-size: 13px !important;
    padding: 10px 8px !important;
  }
}

/* ── 38. LANDING PAGE SISWA: full height, scroll ok ── */
@media (max-width: 600px) {
  #screen-siswa-landing {
    padding: 0 !important;
    align-items: flex-start !important;
  }
  .landing-box {
    border-radius: 0 !important;
    min-height: 100vh !important;
    width: 100% !important;
  }
  .landing-header {
    border-radius: 0 !important;
    padding: 16px !important;
  }
  .landing-body {
    padding: 16px !important;
  }
}

/* ── 39. SCREEN LOADING: centered tetap di semua size ── */
#screen-loading {
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ── 40. UTILITY: safe-area inset untuk iPhone notch ── */
@supports (padding-bottom: env(safe-area-inset-bottom)) {
  @media (max-width: 900px) {
    .slide-nav-fixed {
      padding-bottom: calc(8px + env(safe-area-inset-bottom));
    }
    #screen-login {
      padding-bottom: calc(28px + env(safe-area-inset-bottom)) !important;
    }
  }
}


/* ================================================================
   MOBILE PARITY v8.0 — Super Admin & Guru BK
   ================================================================ */

/* ── Chart filter bar: wrap di HP ── */
@media (max-width: 900px) {
  .card-head[style*="flex-wrap"] {
    gap: 10px !important;
  }
  /* Filter tombol tahunan/bulanan + selects */
  #chart-btn-year, #chart-btn-month {
    font-size: 11px !important;
    padding: 5px 10px !important;
  }
  #chart-year-sel, #chart-month-sel {
    font-size: 13px !important;
    width: 100%;
    min-width: unset !important;
  }
  /* Chart tooltip: max width di HP */
  #chart-tooltip {
    max-width: 260px !important;
    font-size: 11px !important;
  }
  /* Summary strip: stack vertikal */
  #sa-chart-summary {
    flex-direction: column !important;
    gap: 8px !important;
  }
  #sa-chart-summary > div {
    min-width: unset !important;
    width: 100% !important;
  }
}

/* ── Backup & Export page: mobile ── */
@media (max-width: 900px) {
  /* Status bar */
  #backup-status-bar {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 8px !important;
  }
  /* Backup preview cards: 2×2 */
  #backup-preview-cards {
    grid-template-columns: 1fr 1fr !important;
    gap: 10px !important;
  }
  /* Grid-2 rows: stack di mobile kecil */
  #backup-dl-section .grid-2 {
    grid-template-columns: 1fr !important;
  }
  /* Preview mini tabel: overflow scroll */
  #backup-school-preview,
  #backup-guru-preview {
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
  }
  /* Dashboard preview stat grid: tetap 2×2 */
  #backup-dl-section [style*="grid-template-columns:1fr 1fr"] {
    grid-template-columns: 1fr 1fr !important;
  }
  /* Tombol export: full width */
  #backup-dl-section .card-body button {
    width: 100% !important;
    justify-content: center;
  }
  /* Export per sekolah: stack */
  .export-school-row {
    flex-direction: column !important;
    align-items: stretch !important;
  }
}

/* ── SA Dashboard: stat row baris kedua tetap responsive ── */
@media (max-width: 900px) {
  .stat-row {
    grid-template-columns: 1fr 1fr !important;
    gap: 10px !important;
  }
  .stat-row + .stat-row {
    grid-template-columns: 1fr 1fr !important;
    margin-top: 10px;
  }
  /* Ringkasan sekolah mitra: tabel scroll */
  #sa-school-tbl, #school-tbl {
    min-width: 540px;
  }
}

/* ── SA Modal card detail: full bottom sheet ── */
@media (max-width: 900px) {
  #m-sa-card-detail .modal {
    max-height: 88vh !important;
    overflow-y: auto !important;
  }
  #m-sa-card-detail .modal-bd {
    padding: 0 !important;
    overflow-x: hidden !important;
  }
  #m-sa-card-detail .tbl-wrap {
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
  }
}

/* ── Guru BK: Dashboard filter bar ── */
@media (max-width: 900px) {
  #pv-guru-dashboard > div:nth-child(2) {
    flex-wrap: wrap !important;
    gap: 8px !important;
  }
  #dash-kelas-checkboxes {
    width: 100%;
    gap: 6px !important;
  }
  /* Tombol Semua/Reset: auto size */
  #pv-guru-dashboard .btn-s[onclick*="dashPilihSemua"],
  #pv-guru-dashboard .btn-s[onclick*="dashHapusSemua"] {
    font-size: 11px !important;
    padding: 5px 9px !important;
  }
}

/* ── Guru BK: Dashboard grid-2 cards ── */
@media (max-width: 700px) {
  #pv-guru-dashboard .grid-2 {
    grid-template-columns: 1fr !important;
  }
}

/* ── Guru BK: Analisis kelompok ── */
@media (max-width: 900px) {
  #pv-guru-kelompok > div:first-child {
    flex-wrap: wrap !important;
    padding: 10px 12px !important;
  }
  #kelompok-kelas-checkboxes {
    width: 100%;
  }
  /* Progress bar / bidang bars wrap */
  #dash-bidang-bars > div {
    flex-wrap: wrap;
  }
}

/* ── Guru BK: Analisis individu ── */
@media (max-width: 900px) {
  .individu-main-grid {
    grid-template-columns: 1fr !important;
    display: flex !important;
    flex-direction: column !important;
  }
  #individu-siswa-list {
    max-height: 200px !important;
    overflow-y: auto;
  }
}

/* ── Guru BK: Laporan page ── */
@media (max-width: 600px) {
  /* Tombol kelas action row */
  #pv-guru-laporan .card-body > div[style*="display:flex"] {
    flex-wrap: wrap !important;
  }
  #pv-guru-laporan .card-body > div[style*="display:flex"] button {
    flex: 1;
    min-width: 120px;
    justify-content: center;
  }
  /* spacer flex:1 hilang */
  #pv-guru-laporan .card-body > div[style*="display:flex"] > div[style*="flex:1"] {
    display: none !important;
  }
}

/* ── Guru BK: Impor page ── */
@media (max-width: 600px) {
  #pv-guru-impor .ph-actions {
    flex-direction: column !important;
  }
  #pv-guru-impor .ph-actions .btn-dl {
    width: 100% !important;
    justify-content: center;
  }
  #impor-dropzone {
    padding: 24px 14px !important;
  }
}

/* ── Guru BK: Profil page ── */
@media (max-width: 900px) {
  .grid-profil {
    grid-template-columns: 1fr !important;
  }
  /* grid-column: 1/-1 di dalam grid-2 ── tetap full span */
  .card-body.grid-2 .lf-group[style*="grid-column"] {
    grid-column: 1 / -1 !important;
  }
}

/* ── Topbar: compact ── */
@media (max-width: 480px) {
  .topbar {
    padding: 0 8px !important;
  }
  .tb-right {
    gap: 4px !important;
  }
  .tb-brand {
    max-width: 100px !important;
    font-size: 12px !important;
  }
  /* Sembunyikan notif icon di HP terkecil */
  .tb-notif {
    display: none !important;
  }
}

/* ── Input font-size 16px: cegah zoom iOS ── */
@media (max-width: 900px) {
  .lf-input, .lf-select, select, input[type="text"],
  input[type="email"], input[type="tel"], input[type="password"],
  input[type="search"], textarea, #chart-year-sel, #chart-month-sel {
    font-size: 16px !important;
  }
}

/* ── Touch targets: min 44px ── */
@media (max-width: 900px) {
  .btn-p, .btn-s, .btn-dl, .btn-login, .lt, .sb-item {
    min-height: 44px !important;
    touch-action: manipulation;
  }
  .btn-ic {
    min-height: 38px !important;
    min-width: 38px !important;
  }
  /* Chart mode toggle buttons */
  #chart-btn-year, #chart-btn-month {
    min-height: 34px !important;
    touch-action: manipulation;
  }
}

/* ── Overflow guard: no horizontal scroll ── */
@media (max-width: 900px) {
  html, body { overflow-x: hidden; }
  .pv, .card, #screen-app { overflow-x: hidden; max-width: 100vw; }
  .content { overflow-x: hidden !important; }
  .card-body { overflow-x: auto; -webkit-overflow-scrolling: touch; }
}

/* ── Safe area inset (iPhone notch) ── */
@supports (padding-bottom: env(safe-area-inset-bottom)) {
  @media (max-width: 900px) {
    .slide-nav-fixed {
      padding-bottom: calc(8px + env(safe-area-inset-bottom)) !important;
    }
  }
}

