/* =============================================
   SIMPEL SPJ - Main Stylesheet
   ============================================= */

@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap');

:root {
  --primary: #7C5CBF;
  --primary-light: #9B7ED4;
  --primary-dark: #5E3FA3;
  --primary-bg: #F0EBF9;
  --secondary: #6EC6F5;
  --accent-pink: #F06292;
  --accent-green: #4CAF7D;
  --accent-yellow: #F9A825;
  --sidebar-width: 240px;
  --bg: #F4F6FB;
  --white: #FFFFFF;
  --text-dark: #2D3748;
  --text-muted: #8492A6;
  --border: #E8ECF4;
  --shadow: 0 2px 12px rgba(124,92,191,0.08);
  --shadow-card: 0 4px 20px rgba(0,0,0,0.06);
  --radius: 12px;
  --radius-sm: 8px;
  --transition: 0.25s ease;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: 'Poppins', sans-serif;
  background: var(--bg);
  color: var(--text-dark);
  min-height: 100vh;
  font-size: 14px;
}

/* ====================== SCROLLBAR ====================== */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: #f1f1f1; }
::-webkit-scrollbar-thumb { background: var(--primary-light); border-radius: 3px; }

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

/* ====================== SIDEBAR ====================== */
.sidebar {
  width: var(--sidebar-width);
  background: var(--white);
  min-height: 100vh;
  position: fixed;
  left: 0; top: 0; bottom: 0;
  z-index: 100;
  box-shadow: 2px 0 20px rgba(124,92,191,0.07);
  display: flex;
  flex-direction: column;
  transition: transform var(--transition);
}

.sidebar-brand {
  padding: 22px 20px 18px;
  border-bottom: 1px solid var(--border);
}

.sidebar-brand .brand-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}

.brand-icon {
  width: 38px; height: 38px;
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  color: white; font-size: 18px;
  box-shadow: 0 4px 12px rgba(124,92,191,0.35);
}

.brand-name {
  font-weight: 700;
  font-size: 15px;
  color: var(--primary);
  line-height: 1.2;
}
.brand-name span { display: block; font-size: 11px; font-weight: 400; color: var(--text-muted); }

.sidebar-nav { flex: 1; padding: 16px 0 10px; overflow-y: auto; }

.nav-section-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  text-transform: uppercase;
  padding: 12px 20px 6px;
}

.nav-item { margin: 2px 10px; }

.nav-link {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  color: var(--text-dark);
  text-decoration: none;
  font-size: 13.5px;
  font-weight: 400;
  transition: all var(--transition);
  position: relative;
}

.nav-link:hover {
  background: var(--primary-bg);
  color: var(--primary);
}

.nav-link.active {
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  color: white;
  font-weight: 500;
  box-shadow: 0 4px 12px rgba(124,92,191,0.3);
}

.nav-link .nav-icon {
  width: 20px; text-align: center; font-size: 15px;
}

.nav-link .nav-arrow {
  margin-left: auto; font-size: 11px;
  transition: transform var(--transition);
}

.nav-link.active .nav-arrow { transform: rotate(90deg); }

.nav-divider { height: 1px; background: var(--border); margin: 8px 10px; }

/* Submenu */
.nav-submenu {
  list-style: none;
  padding: 4px 0 4px 0;
  display: none;
}
.nav-submenu.open { display: block; }
.nav-submenu .nav-item { margin-left: 0; }
.nav-submenu .nav-link {
  font-size: 13px;
  padding: 8px 14px 8px 44px;
  color: var(--text-muted);
}
.nav-submenu .nav-link:hover { color: var(--primary); background: var(--primary-bg); }
.nav-submenu .nav-link.active {
  background: var(--primary-bg);
  color: var(--primary);
  font-weight: 500;
  box-shadow: none;
}
.nav-submenu .nav-link.active::before {
  content: '';
  position: absolute;
  left: 26px;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--primary);
}

.sidebar-footer {
  padding: 14px 10px;
  border-top: 1px solid var(--border);
}
.sidebar-footer .nav-link { color: #EF5350; }
.sidebar-footer .nav-link:hover { background: #FFEBEE; color: #C62828; }

/* ====================== MAIN CONTENT ====================== */
.main-content {
  margin-left: var(--sidebar-width);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ====================== TOPBAR ====================== */
.topbar {
  background: var(--white);
  padding: 14px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 50;
  box-shadow: 0 2px 10px rgba(0,0,0,0.04);
}

.topbar-left h4 {
  font-size: 17px; font-weight: 600; color: var(--text-dark);
}
.topbar-left .breadcrumb {
  font-size: 12px; color: var(--text-muted); margin-top: 1px;
}
.topbar-left .breadcrumb a { color: var(--primary); text-decoration: none; }
.topbar-left .breadcrumb span { color: var(--text-muted); margin: 0 5px; }

.topbar-right { display: flex; align-items: center; gap: 16px; }

.topbar-btn {
  width: 36px; height: 36px;
  border-radius: 50%; border: none; cursor: pointer;
  background: var(--bg);
  color: var(--text-muted);
  display: flex; align-items: center; justify-content: center;
  font-size: 16px;
  transition: all var(--transition);
  position: relative;
}
.topbar-btn:hover { background: var(--primary-bg); color: var(--primary); }
.topbar-btn .badge {
  position: absolute; top: -2px; right: -2px;
  width: 16px; height: 16px;
  background: var(--accent-pink);
  border-radius: 50%; font-size: 9px;
  color: white; display: flex; align-items: center; justify-content: center;
  font-weight: 600;
}

.topbar-user {
  display: flex; align-items: center; gap: 10px;
  cursor: pointer; padding: 6px 12px;
  border-radius: var(--radius-sm);
  transition: background var(--transition);
}
.topbar-user:hover { background: var(--bg); }

.user-avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  display: flex; align-items: center; justify-content: center;
  color: white; font-weight: 700; font-size: 14px;
  box-shadow: 0 3px 10px rgba(124,92,191,0.3);
}
.user-info .name { font-size: 13px; font-weight: 600; color: var(--text-dark); }
.user-info .role { font-size: 11px; color: var(--text-muted); }

/* ====================== PAGE CONTENT ====================== */
.page-content {
  padding: 24px 28px;
  flex: 1;
}

/* ====================== BANNER / HERO ====================== */
.dashboard-hero {
  background: linear-gradient(135deg, #EDE7F6 0%, #E3F2FD 60%, #E8F5E9 100%);
  border-radius: var(--radius);
  padding: 28px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  overflow: hidden;
  position: relative;
}

.hero-text h2 {
  font-size: 22px; font-weight: 700;
  color: var(--primary-dark);
  margin-bottom: 6px;
}
.hero-text p {
  font-size: 13px; color: #6B6B8E;
  max-width: 320px; line-height: 1.6;
}

.hero-illustration {
  display: flex; gap: 16px; align-items: flex-end;
}

.hero-figure {
  width: 60px; height: 70px;
  border-radius: 50% 50% 40% 40%;
  display: flex; align-items: center; justify-content: center;
  font-size: 28px;
  background: var(--white);
  box-shadow: var(--shadow-card);
  animation: float 3s ease-in-out infinite;
}
.hero-figure:nth-child(2) { animation-delay: 0.5s; height: 80px; }
.hero-figure:nth-child(3) { animation-delay: 1s; }
.hero-figure:nth-child(4) { animation-delay: 1.5s; height: 80px; }

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

/* ====================== STAT CARDS ====================== */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 20px 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: var(--shadow-card);
  border: 1px solid var(--border);
  transition: transform var(--transition), box-shadow var(--transition);
  cursor: default;
}
.stat-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 28px rgba(124,92,191,0.12);
}

.stat-info { flex: 1; }
.stat-label {
  font-size: 12px; font-weight: 500;
  color: var(--text-muted); text-transform: uppercase;
  letter-spacing: 0.05em; margin-bottom: 6px;
}
.stat-value {
  font-size: 28px; font-weight: 700;
  color: var(--text-dark); line-height: 1;
}
.stat-value small {
  font-size: 12px; font-weight: 500; color: var(--text-muted);
  margin-left: 4px; vertical-align: middle;
}
.stat-change {
  font-size: 11px; margin-top: 4px;
  display: flex; align-items: center; gap: 3px;
}
.stat-change.up { color: var(--accent-green); }
.stat-change.down { color: var(--accent-pink); }

.stat-chart { width: 80px; height: 40px; }

/* ====================== CARDS ====================== */
.card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  border: 1px solid var(--border);
  overflow: hidden;
}

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

.card-title {
  font-size: 15px; font-weight: 600; color: var(--text-dark);
  display: flex; align-items: center; gap: 8px;
}
.card-title .icon {
  width: 30px; height: 30px;
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  font-size: 14px;
}

.card-body { padding: 20px 22px; }

/* ====================== TABLE ====================== */
.table-wrapper { overflow-x: auto; }

.data-table {
  width: 100%; border-collapse: collapse;
  font-size: 13px;
}
.data-table th {
  background: var(--bg);
  padding: 11px 14px;
  text-align: left;
  font-weight: 600; font-size: 12px;
  color: var(--text-muted);
  text-transform: uppercase; letter-spacing: 0.04em;
  border-bottom: 2px solid var(--border);
  white-space: nowrap;
}
.data-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  color: var(--text-dark);
  vertical-align: middle;
}
.data-table tr:last-child td { border-bottom: none; }
.data-table tbody tr:hover { background: var(--primary-bg); }
.data-table tbody tr { transition: background var(--transition); }

/* ====================== BADGES ====================== */
.badge-pill {
  display: inline-flex; align-items: center;
  padding: 3px 10px; border-radius: 20px;
  font-size: 11px; font-weight: 600;
}
.badge-success { background: #E8F5E9; color: #2E7D32; }
.badge-warning { background: #FFF8E1; color: #F57F17; }
.badge-danger  { background: #FFEBEE; color: #C62828; }
.badge-info    { background: #E3F2FD; color: #1565C0; }
.badge-purple  { background: #EDE7F6; color: #6A1B9A; }

/* ====================== BUTTONS ====================== */
.btn {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 9px 18px; border-radius: var(--radius-sm);
  font-family: 'Poppins', sans-serif;
  font-size: 13px; font-weight: 500;
  cursor: pointer; border: none; text-decoration: none;
  transition: all var(--transition);
}
.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  color: white; box-shadow: 0 4px 12px rgba(124,92,191,0.3);
}
.btn-primary:hover { box-shadow: 0 6px 18px rgba(124,92,191,0.4); transform: translateY(-1px); }
.btn-outline {
  background: transparent; color: var(--primary);
  border: 1.5px solid var(--primary);
}
.btn-outline:hover { background: var(--primary-bg); }
.btn-danger { background: #FFEBEE; color: #C62828; }
.btn-danger:hover { background: #FFCDD2; }
.btn-sm { padding: 5px 12px; font-size: 12px; }

/* ====================== FORM ====================== */
.form-group { margin-bottom: 18px; }
.form-label {
  display: block; font-size: 13px;
  font-weight: 500; color: var(--text-dark); margin-bottom: 6px;
}
.form-label span { color: var(--accent-pink); }
.form-control {
  width: 100%; padding: 10px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: 'Poppins', sans-serif; font-size: 13px;
  color: var(--text-dark); background: var(--white);
  transition: border-color var(--transition), box-shadow var(--transition);
  outline: none;
}
.form-control:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(124,92,191,0.12);
}
.form-control::placeholder { color: #B0BEC5; }
select.form-control { cursor: pointer; }

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; }

/* ====================== SEARCH & FILTER ====================== */
.table-toolbar {
  display: flex; align-items: center;
  justify-content: space-between; gap: 12px;
  margin-bottom: 16px; flex-wrap: wrap;
}
.search-box {
  position: relative; flex: 1; max-width: 280px;
}
.search-box input {
  width: 100%; padding: 9px 14px 9px 38px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: 'Poppins', sans-serif; font-size: 13px;
  background: var(--bg); color: var(--text-dark); outline: none;
  transition: all var(--transition);
}
.search-box input:focus { background: white; border-color: var(--primary); }
.search-box .icon {
  position: absolute; left: 12px; top: 50%;
  transform: translateY(-50%); color: var(--text-muted); font-size: 14px;
}

/* ====================== MODAL ====================== */
.modal-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,0.45); z-index: 1000;
  align-items: center; justify-content: center;
}
.modal-overlay.show { display: flex; }

.modal-box {
  background: var(--white); border-radius: 16px;
  width: 90%; max-width: 560px;
  max-height: 90vh; overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0,0,0,0.2);
  animation: slideUp 0.25s ease;
}
@keyframes slideUp {
  from { transform: translateY(20px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}
.modal-header {
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
}
.modal-header h5 { font-size: 16px; font-weight: 600; }
.modal-close {
  width: 30px; height: 30px; border: none; cursor: pointer;
  background: var(--bg); border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; color: var(--text-muted);
  transition: all var(--transition);
}
.modal-close:hover { background: #FFEBEE; color: #C62828; }
.modal-body { padding: 22px 24px; }
.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  display: flex; justify-content: flex-end; gap: 10px;
}

/* ====================== ALERT ====================== */
.alert {
  padding: 12px 16px; border-radius: var(--radius-sm);
  font-size: 13px; margin-bottom: 16px;
  display: flex; align-items: center; gap: 10px;
}
.alert-success { background: #E8F5E9; color: #2E7D32; border-left: 4px solid #4CAF50; }
.alert-danger  { background: #FFEBEE; color: #C62828; border-left: 4px solid #EF5350; }
.alert-info    { background: #E3F2FD; color: #1565C0; border-left: 4px solid #42A5F5; }
.alert-warning { background: #FFF8E1; color: #F57F17; border-left: 4px solid #FFC107; }

/* ====================== EMPTY STATE ====================== */
.empty-state {
  text-align: center; padding: 48px 24px;
  color: var(--text-muted);
}
.empty-state .empty-icon { font-size: 48px; margin-bottom: 12px; }
.empty-state h6 { font-size: 15px; color: var(--text-dark); margin-bottom: 4px; }
.empty-state p { font-size: 13px; }

/* ====================== FOOTER ====================== */
.page-footer {
  padding: 16px 28px;
  border-top: 1px solid var(--border);
  background: var(--white);
  text-align: center;
  font-size: 12px; color: var(--text-muted);
}

/* ====================== LOGIN PAGE ====================== */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #7C5CBF 0%, #5E3FA3 50%, #3A2570 100%);
  position: relative;
  overflow: hidden;
}

.login-page::before {
  content: '';
  position: absolute;
  width: 400px; height: 400px;
  border-radius: 50%;
  background: rgba(255,255,255,0.05);
  top: -100px; right: -100px;
}
.login-page::after {
  content: '';
  position: absolute;
  width: 300px; height: 300px;
  border-radius: 50%;
  background: rgba(255,255,255,0.04);
  bottom: -80px; left: -80px;
}

.login-card {
  background: white;
  border-radius: 20px;
  padding: 44px 44px 36px;
  width: 100%; max-width: 420px;
  box-shadow: 0 30px 80px rgba(0,0,0,0.25);
  position: relative; z-index: 10;
}

.login-header { text-align: center; margin-bottom: 32px; }
.login-logo {
  width: 64px; height: 64px;
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  border-radius: 16px;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 28px; color: white;
  box-shadow: 0 8px 24px rgba(124,92,191,0.4);
  margin-bottom: 16px;
}
.login-header h2 {
  font-size: 22px; font-weight: 700; color: var(--primary-dark);
  margin-bottom: 4px;
}
.login-header p { font-size: 13px; color: var(--text-muted); }

.input-icon-wrap { position: relative; }
.input-icon-wrap .input-icon {
  position: absolute; left: 13px; top: 50%;
  transform: translateY(-50%); color: var(--text-muted); font-size: 15px;
}
.input-icon-wrap .form-control { padding-left: 40px; }
.input-icon-wrap .toggle-pass {
  position: absolute; right: 13px; top: 50%;
  transform: translateY(-50%); background: none; border: none;
  cursor: pointer; color: var(--text-muted); font-size: 15px;
  transition: color var(--transition);
}
.input-icon-wrap .toggle-pass:hover { color: var(--primary); }

.login-btn {
  width: 100%; padding: 12px;
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  color: white; border: none; border-radius: var(--radius-sm);
  font-family: 'Poppins', sans-serif;
  font-size: 14px; font-weight: 600;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(124,92,191,0.35);
  transition: all var(--transition);
  margin-top: 6px;
}
.login-btn:hover {
  box-shadow: 0 8px 28px rgba(124,92,191,0.5);
  transform: translateY(-1px);
}

.login-footer {
  text-align: center; margin-top: 24px;
  font-size: 12px; color: var(--text-muted);
}

/* ====================== PROFIL ====================== */
.profil-cover {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  height: 140px; border-radius: var(--radius) var(--radius) 0 0;
  position: relative;
}
.profil-avatar {
  width: 90px; height: 90px;
  border-radius: 50%;
  background: white;
  border: 4px solid white;
  box-shadow: 0 6px 20px rgba(0,0,0,0.15);
  position: absolute; bottom: -45px; left: 32px;
  display: flex; align-items: center; justify-content: center;
  font-size: 36px; color: var(--primary); font-weight: 700;
}
.profil-info { padding: 56px 32px 24px; }
.profil-name { font-size: 20px; font-weight: 700; margin-bottom: 2px; }
.profil-role { color: var(--text-muted); font-size: 13px; }

.profil-meta {
  display: flex; gap: 24px; margin-top: 16px; flex-wrap: wrap;
}
.meta-item { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-muted); }
.meta-item strong { color: var(--text-dark); }

/* ====================== RESPONSIVE ====================== */

/* ── Sidebar overlay backdrop ── */
.sidebar-backdrop {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.45);
  z-index: 199;
}
.sidebar-backdrop.show { display: block; }

@media (max-width: 1024px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  /* ── Sidebar slide-in ── */
  .sidebar {
    position: fixed; top: 0; left: 0; height: 100vh;
    transform: translateX(-100%);
    z-index: 200;
    transition: transform 0.28s cubic-bezier(.4,0,.2,1);
    box-shadow: 4px 0 24px rgba(0,0,0,0.15);
  }
  .sidebar.open { transform: translateX(0); }
  .main-content { margin-left: 0; }

  /* ── Topbar ── */
  .topbar { padding: 10px 14px; gap: 8px; }
  #sidebarToggle {
    display: flex !important;
    align-items: center; justify-content: center;
    width: 36px; height: 36px;
    background: var(--primary-bg);
    border-radius: 8px;
    color: var(--primary);
    font-size: 20px;
    border: none; cursor: pointer;
    flex-shrink: 0;
  }
  .topbar-left h4 { font-size: 14px; }
  .topbar-left .breadcrumb { display: none; }
  .user-info { display: none; }
  .topbar-btn:not(:first-child) { display: none; }

  /* ── Page Content ── */
  .page-content { padding: 14px; }

  /* ── Page Header ── */
  .page-header {
    flex-direction: column;
    align-items: flex-start !important;
    gap: 12px;
  }
  .page-header > div:last-child {
    width: 100%;
    display: flex; gap: 8px; flex-wrap: wrap;
  }
  .page-header .btn { flex: 1; justify-content: center; }

  /* ── Dashboard Hero ── */
  .dashboard-hero { padding: 20px; flex-direction: column; gap: 0; }
  .hero-illustration { display: none; }
  .hero-text p { max-width: 100%; }

  /* ── Stats Grid ── */
  .stats-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .stat-card { padding: 14px 14px; }
  .stat-value { font-size: 22px !important; }

  /* ── Status cards (4 col → 2 col) ── */
  .status-cards-grid { grid-template-columns: 1fr 1fr !important; }

  /* ── Grid 2 → 1 ── */
  .grid-2 { grid-template-columns: 1fr !important; }
  .two-col-grid { grid-template-columns: 1fr !important; }

  /* ── Cards ── */
  .card-header { padding: 14px 16px 12px; flex-wrap: wrap; gap: 8px; }
  .card-body { padding: 14px 16px; }

  /* ── Forms ── */
  .form-row, .form-row-3 { grid-template-columns: 1fr; }
  .table-toolbar { flex-direction: column; align-items: stretch; }
  .search-box { max-width: 100%; }

  /* ── Modal ── */
  .modal-box { width: 96%; max-height: 95vh; border-radius: 12px; }
  .modal-body { padding: 16px; }
  .modal-header { padding: 16px 16px 12px; }
  .modal-footer { padding: 12px 16px; flex-wrap: wrap; }
  .modal-footer .btn { flex: 1; justify-content: center; }

  /* ── Profil ── */
  .profil-info { padding: 56px 16px 20px; }
  .profil-meta { gap: 12px; }
  .profil-avatar { left: 16px; }

  /* ── Tables ── */
  .data-table th, .data-table td { padding: 9px 10px; font-size: 12px; }
}

@media (max-width: 480px) {
  /* ── Stats grid 1 col on very small ── */
  .stats-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
  .stat-card { padding: 12px; }
  .stat-label { font-size: 11px; }
  .stat-value { font-size: 20px !important; }

  /* ── Login card ── */
  .login-card { padding: 28px 20px 24px; margin: 12px; }
  .login-header h2 { font-size: 18px; }

  /* ── Dashboard hero compact ── */
  .dashboard-hero { padding: 16px; }
  .hero-text h2 { font-size: 17px; }

  /* ── Status cards 2 col ── */
  .status-cards-grid { gap: 8px !important; }

  /* ── Topbar ── */
  .topbar { padding: 8px 10px; }
  .topbar-user { padding: 4px 6px; }
  .user-avatar { width: 32px; height: 32px; font-size: 12px; }

  /* ── Breadcrumb page ── */
  .page-header .page-title { font-size: 15px; }
}

/* ====================== UTILITIES ====================== */
.d-flex { display: flex; }
.align-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.mt-1 { margin-top: 4px; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 16px; }
.mt-4 { margin-top: 24px; }
.mb-2 { margin-bottom: 8px; }
.mb-3 { margin-bottom: 16px; }
.text-muted { color: var(--text-muted); }
.text-primary { color: var(--primary); }
.fw-600 { font-weight: 600; }
.text-sm { font-size: 12px; }
.w-100 { width: 100%; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }

/* ====================== TOPBAR LOGOUT BUTTON ====================== */
.topbar-logout {
  width: 36px; height: 36px;
  border-radius: 50%; border: none; cursor: pointer;
  background: #FFEBEE; color: #C62828;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; text-decoration: none;
  transition: all var(--transition);
  flex-shrink: 0;
}
.topbar-logout:hover { background: #FFCDD2; transform: scale(1.05); }

/* ====================== LOGO IN BRAND ICON ====================== */
.brand-icon img { width: 100%; height: 100%; object-fit: cover; border-radius: 10px; }

/* ====================== REKAP CARDS GRID (responsive) ====================== */
.rekap-cards-3 { display: grid; grid-template-columns: repeat(3,1fr); gap: 14px; margin-bottom: 20px; }

/* ====================== MOBILE TABLE HELPERS ====================== */
/* Sembunyikan kolom tertentu di HP */
@media (max-width: 768px) {
  .hide-mobile { display: none !important; }

  /* Toolbar jadi vertikal */
  .table-toolbar {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }
  .table-toolbar .search-box { max-width: 100%; }
  .toolbar-actions {
    display: flex; flex-wrap: wrap; gap: 6px; align-items: center;
  }
  .toolbar-actions .btn { flex: 1; justify-content: center; min-width: 120px; }
  .toolbar-actions select.form-control { flex: 1; min-width: 120px; padding: 8px 10px; }

  /* Rekap cards: 3 kolom → 1 kolom */
  .rekap-cards-3 { grid-template-columns: 1fr; gap: 8px; }

  /* Tabel: kolom aksi jangan terlalu lebar */
  .data-table td, .data-table th { padding: 8px 10px; font-size: 12px; }
  .data-table .aksi-col { white-space: nowrap; }
}

@media (max-width: 480px) {
  /* Rekap cards: masih 1 kolom */
  .rekap-cards-3 { grid-template-columns: 1fr; }
}

/* ====================== RESPONSIVE: SEMUA MODUL ====================== */

/* Card header wrap di mobile */
@media (max-width: 768px) {
  .card-header { flex-wrap: wrap; gap: 8px; padding: 12px 14px; }
  .card-header .d-flex, .card-header > div:last-child { flex-wrap: wrap; gap: 6px; }
  .card-header .btn { flex: 1; justify-content: center; min-width: 80px; }

  /* Detail 2-kolom → 1 kolom */
  .resp-grid-2 { grid-template-columns: 1fr !important; }
  .resp-grid-2 > div { border-right: none !important; padding-right: 0 !important; }

  /* Rekap cards 4-kolom → 2 kolom */
  .rekap-cards-4 { grid-template-columns: 1fr 1fr !important; }

  /* Form submit btn full-width */
  .form-submit-row { flex-direction: column; }
  .form-submit-row .btn { width: 100%; justify-content: center; }

  /* Info box dalam detail */
  .detail-info-row {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 0 !important;
  }
}

@media (max-width: 480px) {
  .rekap-cards-4 { grid-template-columns: 1fr !important; }
}

/* Class untuk grid detail */
.resp-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 28px;
}
.rekap-cards-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 20px;
}

/* ── Page header (laporan, detail) wrap pada mobile ── */
.page-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; flex-wrap: wrap; gap: 10px; }
@media (max-width: 768px) {
  .page-header { flex-direction: column; align-items: flex-start; }
  .page-header > div:last-child { display: flex; gap: 8px; flex-wrap: wrap; width: 100%; }
  .page-header > div:last-child .btn { flex: 1; justify-content: center; }

  /* Form dalam tambah.php: submit buttons full-width */
  .form-submit-row { flex-direction: column !important; }
  .form-submit-row .btn { width: 100%; justify-content: center; }

  /* Laporan filter form */
  .card-body form[method="GET"] { flex-direction: column; }
  .card-body form[method="GET"] .form-group { margin: 0; }
  .card-body form[method="GET"] select,
  .card-body form[method="GET"] input { width: 100%; }
}
