:root{
  --primary:#1d4ed8;
  --primary2:#2563eb;
  --bg:#f3f6fb;
  --card:#ffffff;
  --muted:#6b7280;
  --border:#e5e7eb;
  --green:#16a34a;
  --orange:#f59e0b;
  --red:#ef4444;
}
*{box-sizing:border-box}
body{margin:0;font-family:system-ui,-apple-system,Segoe UI,Roboto,Arial,sans-serif;background:var(--bg);color:#111827}
a{text-decoration:none;color:inherit}

.layout{display:flex;min-height:100vh}
.sidebar{
  width:260px;background:#0b2f9f;color:#fff;padding:16px 14px;
}
.brand{
  display:flex;align-items:center;gap:10px;padding:10px 10px;border-radius:14px;
  background:rgba(255,255,255,.10)
}
.logo{
  width:40px;height:40px;border-radius:999px;
  background:rgba(255,255,255,.25);display:flex;align-items:center;justify-content:center;
  font-weight:900
}
.meta .title{font-weight:900}
.meta .sub{font-size:12px;opacity:.85}

.nav{margin-top:14px;display:flex;flex-direction:column;gap:8px}
.nav a{
  display:flex;align-items:center;gap:10px;padding:10px 12px;border-radius:12px;
  color:#fff;opacity:.92
}
.nav a:hover{background:rgba(255,255,255,.12);opacity:1}
.nav a.active{background:rgba(255,255,255,.18);opacity:1}
.icon{
  width:24px;height:24px;border-radius:9px;
  background:rgba(255,255,255,.14);
  display:flex;align-items:center;justify-content:center;font-size:12px
}

.main{flex:1;display:flex;flex-direction:column}
.topbar{
  background:var(--card);border-bottom:1px solid var(--border);
  padding:14px 18px;display:flex;align-items:center;justify-content:space-between
}
.topbar .h{font-weight:900}
.topbar .p{font-size:12px;color:var(--muted)}
.badge{
  padding:6px 10px;border-radius:999px;background:#fff;border:1px solid var(--border);
  font-size:12px
}
.content{padding:16px 18px}
.container{max-width:1200px}

.card{
  background:var(--card);border:1px solid var(--border);
  border-radius:16px;padding:14px
}
.grid-4{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px}
.grid-2{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}

.section-title{display:flex;align-items:center;justify-content:space-between;margin:12px 0 10px}
.section-title h3{margin:0;font-size:16px}
.muted{color:var(--muted);font-size:12px}

.kpi{display:flex;align-items:center;justify-content:space-between}
.kpi .label{font-size:12px;color:var(--muted)}
.kpi .value{font-size:26px;font-weight:900}

.chip{padding:6px 10px;border-radius:999px;font-size:12px;font-weight:900}
.chip.blue{background:#e8efff;color:var(--primary)}
.chip.green{background:#dcfce7;color:#166534}
.chip.orange{background:#ffedd5;color:#9a3412}
.chip.red{background:#fee2e2;color:#991b1b}

.bars{display:flex;gap:10px;align-items:flex-end;height:140px;padding:10px 6px}
.bar{flex:1;background:#dbe7ff;border-radius:10px}
.bar-labels{display:flex;gap:10px;justify-content:space-between;color:var(--muted);font-size:12px;padding:0 6px}

.activity{display:flex;align-items:center;gap:10px;padding:10px 0;border-bottom:1px solid var(--border)}
.activity:last-child{border-bottom:none}
.avatar{
  width:36px;height:36px;border-radius:999px;background:#e8efff;color:var(--primary);
  display:flex;align-items:center;justify-content:center;font-weight:900
}
.info .name{font-weight:800}
.time{margin-left:auto;color:var(--muted);font-size:12px;font-weight:800}

.quick{display:grid;grid-template-columns:1fr 1fr;gap:10px}
.quick-btn{
  padding:12px;border-radius:14px;background:var(--primary);color:#fff;font-weight:900;text-align:center
}
.quick-btn:hover{background:var(--primary2)}
.quick-btn.outline{
  background:#fff;border:1px solid var(--border);color:#111827
}
.quick-btn.outline:hover{background:#f9fafb}

.btn{
  width:100%;padding:10px 12px;border-radius:12px;border:1px solid rgba(255,255,255,.25);
  background:rgba(255,255,255,.12);color:#fff;font-weight:900;cursor:pointer
}
.btn.danger{background:rgba(239,68,68,.20);border-color:rgba(239,68,68,.35)}
.btn.danger:hover{background:rgba(239,68,68,.30)}

@media (max-width:1100px){
  .grid-4{grid-template-columns:repeat(2,minmax(0,1fr))}
}
@media (max-width:820px){
  .layout{flex-direction:column}
  .sidebar{width:auto}
  .grid-4,.grid-2{grid-template-columns:1fr}
}
.flash{padding:12px 14px;border-radius:14px;margin:0 0 12px;border:1px solid var(--border);background:#fff}
.flash.success{border-color:#bbf7d0;background:#f0fdf4}
.flash.error{border-color:#fecaca;background:#fef2f2}
.input{width:100%;padding:10px 12px;border-radius:12px;border:1px solid var(--border);background:#fff;outline:none}
.btn.primary{background:var(--primary);color:#fff;border:0}
.btn.primary:hover{background:var(--primary2)}
.pill{display:inline-flex;padding:5px 10px;border-radius:999px;font-size:12px;font-weight:900}
.pill.green{background:#dcfce7;color:#166534}
.pill.orange{background:#ffedd5;color:#9a3412}
.pill.gray{background:#e5e7eb;color:#374151}
:root{
  --primary:#1d4ed8;
  --primary2:#2563eb;
  --sidebar:#0b2f9f;
  --bg:#f3f6fb;
  --card:#ffffff;
  --muted:#6b7280;
  --border:#e5e7eb;
  --green:#16a34a;
  --orange:#f59e0b;
  --red:#ef4444;
}

/* RESET */
*{box-sizing:border-box}
body{
  margin:0;
  font-family:system-ui,-apple-system,Segoe UI,Roboto,Arial,sans-serif;
  background:var(--bg);
  color:#111827;
}
a{text-decoration:none;color:inherit}

/* =========================
   LAYOUT
========================= */
.layout{
  display:flex;
  min-height:100vh;
}

/* =========================
   SIDEBAR (VERSI AWAL NORMAL)
========================= */
.sidebar{
  width:260px;
  background:var(--sidebar);
  color:#fff;
  padding:16px 14px;
  flex-shrink:0;
}

.brand{
  display:flex;
  align-items:center;
  gap:10px;
  padding:10px;
  border-radius:16px;
  background:rgba(255,255,255,.10);
}

.logo{
  width:40px;
  height:40px;
  border-radius:999px;
  background:rgba(255,255,255,.25);
  display:flex;
  align-items:center;
  justify-content:center;
  font-weight:900;
}

.meta .title{
  font-weight:900;
  font-size:16px;
}
.meta .sub{
  font-size:12px;
  opacity:.85;
}

/* MENU */
.nav{
  margin-top:16px;
  display:flex;
  flex-direction:column;
  gap:10px;
}

.nav a{
  display:flex;
  align-items:center;
  gap:12px;
  padding:12px 14px;
  border-radius:16px;
  font-weight:800;
  transition:.2s;
}

.nav a:hover{
  background:rgba(255,255,255,.12);
}

.nav a.active{
  background:rgba(255,255,255,.18);
}

.icon{
  width:34px;
  height:34px;
  border-radius:14px;
  background:rgba(255,255,255,.14);
  display:flex;
  align-items:center;
  justify-content:center;
  font-size:14px;
}

/* LOGOUT BUTTON */
.btn{
  width:100%;
  padding:12px;
  border-radius:16px;
  border:1px solid rgba(255,255,255,.25);
  background:rgba(255,255,255,.12);
  color:#fff;
  font-weight:900;
  cursor:pointer;
  margin-top:20px;
}
.btn:hover{
  background:rgba(255,255,255,.18);
}

/* =========================
   MAIN AREA
========================= */
.main{
  flex:1;
  display:flex;
  flex-direction:column;
}

.topbar{
  background:var(--card);
  border-bottom:1px solid var(--border);
  padding:14px 18px;
  display:flex;
  justify-content:space-between;
  align-items:center;
}

.topbar .h{font-weight:900}
.topbar .p{font-size:12px;color:var(--muted)}

.content{
  padding:18px;
}

/* =========================
   CARD
========================= */
.card{
  background:var(--card);
  border:1px solid var(--border);
  border-radius:16px;
  padding:16px;
}

/* =========================
   TABLE (BERSIH & TIDAK GANGGU SIDEBAR)
========================= */
.table-wrap{
  background:#fff;
  border-radius:16px;
  overflow:hidden;
  border:1px solid var(--border);
}

.table{
  width:100%;
  border-collapse:collapse;
}

.table th{
  background:#f3f4f6;
  padding:12px;
  text-align:left;
  font-weight:900;
  border-bottom:1px solid var(--border);
}

.table td{
  padding:12px;
  border-bottom:1px solid #eef2f7;
  vertical-align:middle;
}

/* =========================
   BADGE
========================= */
.badge{
  display:inline-flex;
  padding:6px 10px;
  border-radius:999px;
  font-size:12px;
  font-weight:900;
}

.badge.green{
  background:#dcfce7;
  color:#166534;
}

.badge.orange{
  background:#ffedd5;
  color:#9a3412;
}

.badge.gray{
  background:#e5e7eb;
  color:#374151;
}

.badge.blue{
  background:#dbeafe;
  color:#1d4ed8;
}

/* =========================
   AVATAR
========================= */
.avatar{
  width:44px;
  height:44px;
  border-radius:12px;
  object-fit:cover;
  border:1px solid var(--border);
}

/* =========================
   BUTTON ICON (EDIT / DELETE)
========================= */
.btn-icon{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  width:36px;
  height:36px;
  border-radius:12px;
  border:none;
  cursor:pointer;
  margin-right:6px;
}

.btn-edit{
  background:#fbbf24;
}

.btn-delete{
  background:#ef4444;
  color:#fff;
}

.btn-edit:hover,
.btn-delete:hover{
  filter:brightness(.95);
}

/* =========================
   RESPONSIVE (UNTUK HP)
========================= */
@media (max-width: 820px) {
  .layout {
    flex-direction: column; /* Sidebar jadi di atas, konten di bawah */
  }

  .sidebar {
    width: 100%;
    padding: 10px;
    height: auto;
  }

  /* Sembunyikan sub-teks di logo agar hemat tempat */
  .meta .sub {
    display: none;
  }

  /* Buat menu navigasi berjejer ke samping (opsional) 
     atau tetap ke bawah tapi lebih rapat */
  .nav {
    flex-direction: row; 
    overflow-x: auto; /* Menu bisa di-geser ke samping */
    padding-bottom: 5px;
    gap: 5px;
  }

  .nav a {
    white-space: nowrap; /* Teks menu tidak turun ke bawah */
    padding: 8px 12px;
    font-size: 13px;
  }

  .icon {
    width: 28px;
    height: 28px;
  }

  /* Hilangkan tombol logout di HP atau buat lebih kecil */
  .sidebar .btn {
    margin-top: 10px;
    padding: 8px;
  }

  /* BAGIAN PALING PENTING: Supaya tabel tidak memotong layar */
  .table-wrap {
    overflow-x: auto; /* Munculkan scrollbar horizontal khusus di tabel */
    -webkit-overflow-scrolling: touch;
    border-radius: 8px;
  }

  .table {
    min-width: 600px; /* Paksa tabel punya lebar minimal agar tidak rapat sekali */
  }

  /* Header H2 di HP jangan terlalu besar */
  .page-h2 {
    font-size: 20px !important;
  }
}

/* header & content lebih rapat */
.topbar{ padding:12px 16px !important; }
.content{ padding:14px 16px !important; }
.page-h2{ font-size:26px !important; }

/* tabel lebih rapat */
.table.clean thead th{ padding:10px !important; font-size:13px !important; }
.table.clean tbody td{ padding:10px !important; font-size:13px !important; }
.avatar, .avatar-placeholder{ width:38px !important; height:38px !important; }

/* ===== pastikan tombol aksi tidak hilang ===== */
.table.clean td.col-aksi,
.table.clean th.col-aksi{
  overflow:visible !important;
  text-overflow:unset !important;
  white-space:nowrap !important;
  width:140px !important;
}
/* =========================
   GURU PAGE - RAPIIH & KECIL
   Tempel di paling bawah
   ========================= */

/* padding halaman */
.guru-page{ padding:12px !important; }

/* header atas */
.guru-page-header{ margin:0 0 10px !important; }
.guru-title h2{ font-size:26px !important; }            /* dari 34 -> 26 */
.guru-btn-add{
  padding:8px 12px !important;
  border-radius:10px !important;
  font-size:13px !important;
}

/* card */
.guru-card{ border-radius:16px !important; }
.guru-card-head{
  padding:10px 12px !important;                          /* lebih kecil */
}
.guru-card-title{ font-size:16px !important; }
.guru-card-body{ padding:10px !important; }

/* search */
.guru-search{
  height:36px !important;
  min-width:280px !important;
}
.guru-search input{
  height:36px !important;
  font-size:13px !important;
  padding:0 12px !important;
}
.guru-search button{
  height:36px !important;
  padding:0 14px !important;
  font-size:13px !important;
}

/* tabel wrapper */
.guru-table-wrap{
  border-radius:12px !important;
}

/* tabel */
.guru-table th{
  padding:10px !important;
  font-size:13px !important;
}
.guru-table td{
  padding:10px !important;
  font-size:13px !important;
}

/* foto */
.guru-avatar{
  width:38px !important;
  height:38px !important;
  border-radius:10px !important;
}
.guru-avatar-ph{
  width:38px !important;
  height:38px !important;
  border-radius:10px !important;
  font-size:13px !important;
}

/* badge status/jk */
.guru-badge{
  padding:5px 9px !important;
  font-size:11px !important;
}

/* tombol aksi */
.guru-btn-icon{
  width:32px !important;
  height:32px !important;
  border-radius:10px !important;
  margin:0 3px !important;
}