/* =====================================================
   MA Bahrul Ulum Kepohbaru — Sistem Surat Tugas & SPPD
   Main Stylesheet — Professional Islamic School Theme
   ===================================================== */

@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@600;700&family=IBM+Plex+Sans:wght@300;400;500;600&family=IBM+Plex+Mono:wght@400;500&display=swap');

/* ── CSS Variables ── */
:root {
  --primary:       #1a4731;
  --primary-light: #2d6a4f;
  --primary-dark:  #0f2d1e;
  --accent:        #c8973a;
  --accent-light:  #e6b85c;
  --accent-pale:   #fdf3e3;
  --surface:       #ffffff;
  --surface-2:     #f8faf9;
  --surface-3:     #f0f4f2;
  --border:        #d9e4de;
  --border-light:  #edf2ef;
  --text-primary:  #0f2d1e;
  --text-secondary:#4a6358;
  --text-muted:    #8fa89e;
  --sidebar-w:     260px;
  --topbar-h:      64px;
  --radius:        10px;
  --radius-sm:     6px;
  --shadow-sm:     0 1px 3px rgba(0,0,0,.06), 0 1px 2px rgba(0,0,0,.04);
  --shadow:        0 4px 16px rgba(26,71,49,.08);
  --shadow-lg:     0 8px 32px rgba(26,71,49,.12);
  --transition:    .2s ease;
  --font-display:  'Playfair Display', Georgia, serif;
  --font-body:     'IBM Plex Sans', system-ui, sans-serif;
  --font-mono:     'IBM Plex Mono', monospace;
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-primary);
  background: var(--surface-2);
  display: flex;
  min-height: 100vh;
}

/* ── Sidebar ── */
.sidebar {
  width: var(--sidebar-w);
  min-height: 100vh;
  background: var(--primary-dark);
  background-image:
    radial-gradient(ellipse at 0% 0%, rgba(200,151,58,.12) 0%, transparent 50%),
    radial-gradient(ellipse at 100% 100%, rgba(45,106,79,.3) 0%, transparent 60%);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0;
  z-index: 100;
  transition: transform var(--transition);
  overflow-y: auto;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 24px 20px 20px;
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.logo-circle {
  width: 44px; height: 44px;
  background: linear-gradient(135deg, var(--accent), var(--accent-light));
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(200,151,58,.4);
}
.logo-text { font-family: var(--font-display); font-size: 14px; font-weight: 700; color: #fff; }
.brand-title { font-family: var(--font-display); font-size: 15px; color: #fff; font-weight: 600; line-height: 1.2; }
.brand-sub { font-size: 11px; color: rgba(255,255,255,.5); margin-top: 2px; }

.sidebar-nav { flex: 1; padding: 16px 0; }
.nav-section { margin-bottom: 8px; }
.nav-label {
  font-size: 10px; font-weight: 600; letter-spacing: .12em;
  color: rgba(255,255,255,.35);
  padding: 12px 20px 6px;
  display: block;
}
.nav-item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 20px;
  color: rgba(255,255,255,.65);
  text-decoration: none;
  transition: all var(--transition);
  font-size: 13.5px;
  position: relative;
}
.nav-item i { width: 18px; text-align: center; font-size: 14px; }
.nav-item:hover { color: #fff; background: rgba(255,255,255,.06); }
.nav-item.active {
  color: var(--accent-light);
  background: rgba(200,151,58,.12);
}
.nav-item.active::before {
  content: '';
  position: absolute; left: 0; top: 6px; bottom: 6px;
  width: 3px; border-radius: 0 3px 3px 0;
  background: var(--accent);
}

.sidebar-footer {
  padding: 16px 20px;
  border-top: 1px solid rgba(255,255,255,.08);
  display: flex; align-items: center; gap: 12px;
}
.user-avatar {
  width: 36px; height: 36px;
  background: linear-gradient(135deg, var(--primary-light), var(--accent));
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 600; color: #fff;
  flex-shrink: 0;
}
.user-detail { flex: 1; min-width: 0; }
.user-name { display: block; font-size: 12.5px; color: #fff; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-role { font-size: 11px; color: rgba(255,255,255,.4); }
.logout-btn {
  color: rgba(255,255,255,.4); font-size: 16px;
  transition: color var(--transition);
  padding: 4px;
}
.logout-btn:hover { color: #ff7b7b; }

/* ── Main Wrapper ── */
.main-wrapper {
  margin-left: var(--sidebar-w);
  flex: 1;
  display: flex; flex-direction: column;
  min-height: 100vh;
  transition: margin var(--transition);
}

/* ── Topbar ── */
.topbar {
  height: var(--topbar-h);
  background: var(--surface);
  border-bottom: 1px solid var(--border-light);
  display: flex; align-items: center; gap: 16px;
  padding: 0 28px;
  position: sticky; top: 0; z-index: 50;
  box-shadow: var(--shadow-sm);
}
.sidebar-toggle {
  background: none; border: none;
  font-size: 18px; color: var(--text-secondary);
  cursor: pointer; padding: 4px;
  display: none;
}
.topbar-breadcrumb { display: flex; align-items: center; gap: 8px; }
.breadcrumb-institution { font-weight: 600; color: var(--primary); font-size: 13px; }
.breadcrumb-sep { font-size: 10px; color: var(--text-muted); }
.breadcrumb-page { color: var(--text-secondary); font-size: 13px; }
.topbar-right { margin-left: auto; }
.topbar-date { font-size: 12.5px; color: var(--text-muted); display: flex; align-items: center; gap: 6px; }

/* ── Page Content ── */
.page-content { flex: 1; padding: 28px; }
.page-footer {
  padding: 16px 28px;
  font-size: 12px; color: var(--text-muted);
  border-top: 1px solid var(--border-light);
  background: var(--surface);
}

/* ── Page Header ── */
.page-header {
  display: flex; align-items: flex-start; justify-content: space-between;
  margin-bottom: 28px;
}
.page-header-left h1 {
  font-family: var(--font-display);
  font-size: 24px; font-weight: 700;
  color: var(--primary-dark);
  line-height: 1.2;
}
.page-header-left p {
  font-size: 13px; color: var(--text-secondary);
  margin-top: 4px;
}

/* ── Cards ── */
.card {
  background: var(--surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.card-header {
  padding: 18px 24px;
  border-bottom: 1px solid var(--border-light);
  display: flex; align-items: center; justify-content: space-between;
}
.card-title {
  font-size: 15px; font-weight: 600;
  color: var(--text-primary);
  display: flex; align-items: center; gap: 8px;
}
.card-title i { color: var(--primary-light); }
.card-body { padding: 24px; }

/* ── Stat Cards ── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
  margin-bottom: 28px;
}
.stat-card {
  background: var(--surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  padding: 20px 24px;
  display: flex; align-items: center; gap: 16px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--transition), transform var(--transition);
  position: relative; overflow: hidden;
}
.stat-card::before {
  content: '';
  position: absolute; right: -20px; top: -20px;
  width: 80px; height: 80px;
  border-radius: 50%;
  opacity: .06;
}
.stat-card:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.stat-card.green .stat-icon { background: #e8f5ee; color: var(--primary-light); }
.stat-card.gold  .stat-icon { background: var(--accent-pale); color: var(--accent); }
.stat-card.blue  .stat-icon { background: #e8f0fe; color: #4285f4; }
.stat-card.red   .stat-icon { background: #fde8e8; color: #d93025; }
.stat-card.green::before { background: var(--primary-light); }
.stat-card.gold::before  { background: var(--accent); }
.stat-card.blue::before  { background: #4285f4; }
.stat-card.red::before   { background: #d93025; }
.stat-icon {
  width: 52px; height: 52px;
  border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; flex-shrink: 0;
}
.stat-info h3 { font-size: 26px; font-weight: 700; color: var(--text-primary); line-height: 1; }
.stat-info p  { font-size: 13px; color: var(--text-secondary); margin-top: 4px; }

/* ── Tables ── */
.table-responsive { overflow-x: auto; }
table {
  width: 100%; border-collapse: collapse;
  font-size: 13.5px;
}
thead th {
  background: var(--surface-3);
  color: var(--text-secondary);
  font-weight: 600; font-size: 12px;
  letter-spacing: .04em;
  padding: 12px 16px;
  text-align: left;
  border-bottom: 2px solid var(--border);
  white-space: nowrap;
}
tbody tr {
  border-bottom: 1px solid var(--border-light);
  transition: background var(--transition);
}
tbody tr:hover { background: var(--surface-2); }
tbody td { padding: 12px 16px; color: var(--text-primary); vertical-align: middle; }
tbody tr:last-child { border-bottom: none; }

/* ── Badges ── */
.badge {
  display: inline-flex; align-items: center;
  padding: 3px 10px; border-radius: 20px;
  font-size: 11.5px; font-weight: 600; letter-spacing: .03em;
}
.badge-success   { background: #e8f5ee; color: #1a7f3c; }
.badge-warning   { background: #fff8e1; color: #b45309; }
.badge-primary   { background: #e3f0ff; color: #1a56db; }
.badge-danger    { background: #fde8e8; color: #d93025; }
.badge-secondary { background: var(--surface-3); color: var(--text-secondary); }

/* ── Buttons ── */
.btn {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 9px 18px; border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: 13.5px; font-weight: 500;
  cursor: pointer; border: none;
  text-decoration: none;
  transition: all var(--transition);
  white-space: nowrap;
}
.btn-primary {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 2px 6px rgba(26,71,49,.25);
}
.btn-primary:hover { background: var(--primary-light); box-shadow: 0 4px 12px rgba(26,71,49,.35); }
.btn-accent {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 2px 6px rgba(200,151,58,.3);
}
.btn-accent:hover { background: var(--accent-light); }
.btn-outline {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border);
}
.btn-outline:hover { border-color: var(--primary-light); color: var(--primary); background: var(--surface-3); }
.btn-danger  { background: #d93025; color: #fff; }
.btn-danger:hover { background: #b52a20; }
.btn-sm { padding: 6px 12px; font-size: 12.5px; }
.btn-icon { padding: 7px; border-radius: var(--radius-sm); }
.btn-group { display: flex; gap: 6px; }

/* ── Forms ── */
.form-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
.form-grid-3 { grid-template-columns: repeat(3, 1fr); }
.form-full { grid-column: 1 / -1; }
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-label {
  font-size: 12.5px; font-weight: 600;
  color: var(--text-secondary);
  letter-spacing: .03em;
}
.form-label .required { color: #d93025; margin-left: 2px; }
.form-control {
  padding: 10px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: 13.5px; color: var(--text-primary);
  background: var(--surface);
  transition: border-color var(--transition), box-shadow var(--transition);
  width: 100%;
}
.form-control:focus {
  outline: none;
  border-color: var(--primary-light);
  box-shadow: 0 0 0 3px rgba(45,106,79,.12);
}
.form-control::placeholder { color: var(--text-muted); }
select.form-control { cursor: pointer; }
textarea.form-control { resize: vertical; min-height: 90px; }
.form-hint { font-size: 12px; color: var(--text-muted); }
.form-nomor {
  font-family: var(--font-mono);
  background: var(--surface-3) !important;
  color: var(--primary) !important;
  font-weight: 500;
}

/* ── Alert ── */
.flash-container { padding: 16px 28px 0; }
.alert {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 16px; border-radius: var(--radius-sm);
  font-size: 13.5px; font-weight: 500;
  animation: slideDown .3s ease;
}
.alert-success { background: #e8f5ee; color: #1a7f3c; border: 1px solid #b7dfcb; }
.alert-danger   { background: #fde8e8; color: #d93025; border: 1px solid #f5c2c2; }
.alert-info     { background: #e3f0ff; color: #1a56db; border: 1px solid #bdd4f7; }
.alert-close { margin-left: auto; background: none; border: none; font-size: 18px; cursor: pointer; color: inherit; opacity: .6; }

/* ── Empty State ── */
.empty-state {
  text-align: center; padding: 60px 20px;
  color: var(--text-muted);
}
.empty-state i { font-size: 48px; opacity: .3; margin-bottom: 16px; display: block; }
.empty-state p { font-size: 14px; }

/* ── Filter Bar ── */
.filter-bar {
  display: flex; align-items: center; gap: 12px;
  flex-wrap: wrap; margin-bottom: 20px;
}
.filter-bar .form-control { max-width: 200px; }
.search-input { position: relative; }
.search-input input { padding-left: 36px; }
.search-input i {
  position: absolute; left: 12px; top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted); font-size: 13px;
}

/* ── Print / Cetak Modal ── */
@media print {
  .sidebar, .topbar, .page-footer, .btn, .filter-bar, .flash-container { display: none !important; }
  .main-wrapper { margin: 0 !important; }
  .page-content { padding: 0 !important; }
}

/* ── Print Template ── */
.print-page {
  font-family: 'Times New Roman', Times, serif;
  font-size: 12pt; color: #000;
  max-width: 800px; margin: 0 auto; padding: 40px;
  background: #fff;
}
.print-header {
  display: grid; grid-template-columns: 80px 1fr;
  gap: 16px; align-items: center;
  border-bottom: 3px solid #000;
  padding-bottom: 12px; margin-bottom: 24px;
}
.print-logo { width: 70px; height: 70px; object-fit: contain; }
.print-institution h2 { font-size: 16pt; font-weight: 700; text-align: center; }
.print-institution p  { font-size: 10pt; text-align: center; color: #333; margin-top: 2px; }
.print-title { text-align: center; margin: 20px 0; }
.print-title h3 { font-size: 14pt; font-weight: 700; text-transform: uppercase; text-decoration: underline; }
.print-number { font-size: 12pt; }
.print-body table { width: 100%; border-collapse: collapse; margin: 12px 0; }
.print-body td { padding: 4px 8px; vertical-align: top; font-size: 12pt; }
.print-body td:first-child { width: 160px; }
.print-body td:nth-child(2) { width: 20px; }
.print-sign {
  margin-top: 40px; display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}
.sign-block { text-align: center; }
.sign-space { height: 70px; }
.sign-name { font-weight: 700; text-decoration: underline; }

/* ── Responsive ── */
@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .main-wrapper { margin-left: 0; }
  .sidebar-toggle { display: block; }
  .form-grid { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .page-content { padding: 16px; }
  .page-header { flex-direction: column; gap: 12px; }
}
@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr; }
}

/* ── Animations ── */
@keyframes slideDown {
  from { opacity: 0; transform: translateY(-10px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
.page-content { animation: fadeIn .3s ease; }

/* ── Overlay for mobile sidebar ── */
.sidebar-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,.5);
  z-index: 99;
}
.sidebar-overlay.show { display: block; }

/* ── Table action icons ── */
.action-group { display: flex; gap: 4px; align-items: center; }
.action-group .btn { padding: 5px 9px; font-size: 12px; }

/* ── Number/currency ── */
.text-mono { font-family: var(--font-mono); font-size: 13px; }
.text-right { text-align: right; }
.text-center { text-align: center; }
.text-success { color: #1a7f3c; }
.text-danger  { color: #d93025; }
.text-muted   { color: var(--text-muted); }
.text-primary-color { color: var(--primary); }

/* ── Divider ── */
.divider { height: 1px; background: var(--border-light); margin: 20px 0; }

/* ── Login Page ── */
.login-page {
  min-height: 100vh; width: 100%;
  display: flex; align-items: center; justify-content: center;
  background:
    radial-gradient(ellipse at 20% 50%, rgba(200,151,58,.15) 0%, transparent 60%),
    radial-gradient(ellipse at 80% 20%, rgba(45,106,79,.2) 0%, transparent 50%),
    linear-gradient(135deg, #0f2d1e 0%, #1a4731 50%, #0f2d1e 100%);
  padding: 20px;
}
.login-card {
  background: var(--surface);
  border-radius: 16px;
  padding: 48px 44px;
  width: 100%; max-width: 420px;
  box-shadow: var(--shadow-lg);
}
.login-logo {
  text-align: center; margin-bottom: 32px;
}
.login-logo-circle {
  width: 72px; height: 72px;
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  margin-bottom: 16px;
  box-shadow: 0 4px 16px rgba(26,71,49,.3);
}
.login-logo-circle span { font-family: var(--font-display); font-size: 22px; font-weight: 700; color: #fff; }
.login-institution { font-family: var(--font-display); font-size: 18px; font-weight: 700; color: var(--primary-dark); }
.login-subtitle   { font-size: 12.5px; color: var(--text-secondary); margin-top: 4px; }
.login-title { font-size: 15px; font-weight: 600; color: var(--text-primary); margin-bottom: 24px; }
.login-btn {
  width: 100%; padding: 12px;
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  color: #fff; border: none; border-radius: var(--radius-sm);
  font-family: var(--font-body); font-size: 14px; font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  margin-top: 8px;
  box-shadow: 0 4px 12px rgba(26,71,49,.3);
}
.login-btn:hover { transform: translateY(-1px); box-shadow: 0 6px 18px rgba(26,71,49,.4); }

/* =====================================================
   FITUR BARU v2: Notifikasi, Laporan, Arsip, Riwayat
   ===================================================== */

/* ── Nav Badge ── */
.nav-badge {
  margin-left: auto;
  background: var(--accent);
  color: #fff;
  font-size: 10px; font-weight: 700;
  padding: 2px 6px; border-radius: 10px;
  min-width: 18px; text-align: center;
}

/* ── Topbar Notifikasi Bell ── */
.topbar-notif-btn {
  position: relative;
  color: var(--text-secondary);
  font-size: 17px;
  text-decoration: none;
  padding: 4px 6px;
  border-radius: var(--radius-sm);
  transition: color var(--transition), background var(--transition);
}
.topbar-notif-btn:hover { color: var(--primary); background: var(--surface-3); }
.topbar-notif-badge {
  position: absolute; top: -3px; right: -3px;
  background: #d93025; color: #fff;
  font-size: 9px; font-weight: 700;
  width: 16px; height: 16px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  border: 2px solid #fff;
}

/* ── Notifikasi List ── */
.notif-item {
  display: flex; gap: 14px; align-items: flex-start;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border-light);
  transition: background var(--transition);
  cursor: pointer;
}
.notif-item:last-child { border-bottom: none; }
.notif-item:hover { background: var(--surface-2); }
.notif-item.unread { background: #f0f7ff; }
.notif-item.unread:hover { background: #e5f0fc; }
.notif-icon {
  width: 40px; height: 40px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 15px; flex-shrink: 0;
}
.notif-icon.info    { background: #e3f0ff; color: #1a56db; }
.notif-icon.success { background: #e8f5ee; color: #1a7f3c; }
.notif-icon.warning { background: #fff8e1; color: #b45309; }
.notif-icon.danger  { background: #fde8e8; color: #d93025; }
.notif-body { flex: 1; }
.notif-title { font-weight: 600; font-size: 13.5px; color: var(--text-primary); }
.notif-msg   { font-size: 12.5px; color: var(--text-secondary); margin-top: 2px; line-height: 1.5; }
.notif-time  { font-size: 11.5px; color: var(--text-muted); margin-top: 4px; }
.notif-dot   { width: 8px; height: 8px; border-radius: 50%; background: #1a56db; flex-shrink: 0; margin-top: 6px; }

/* ── Laporan ── */
.laporan-tabs {
  display: flex; gap: 4px;
  background: var(--surface-3);
  padding: 4px; border-radius: var(--radius);
  margin-bottom: 24px;
}
.laporan-tab {
  flex: 1; padding: 9px 16px;
  border: none; background: none;
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: 13px; font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer; transition: all var(--transition);
  text-align: center; text-decoration: none;
  display: flex; align-items: center; justify-content: center; gap: 6px;
}
.laporan-tab.active, .laporan-tab:hover {
  background: var(--surface); color: var(--primary);
  box-shadow: var(--shadow-sm);
}
.laporan-tab.active { color: var(--primary); font-weight: 600; }

/* ── Chart placeholder ── */
.chart-bar-wrap { padding: 8px 0; }
.chart-bar-row { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.chart-bar-label { width: 110px; font-size: 12.5px; color: var(--text-secondary); text-align: right; flex-shrink: 0; }
.chart-bar-track { flex: 1; background: var(--surface-3); border-radius: 4px; height: 18px; overflow: hidden; }
.chart-bar-fill  { height: 100%; border-radius: 4px; background: linear-gradient(90deg, var(--primary-light), var(--primary)); transition: width .6s ease; display: flex; align-items: center; padding-left: 8px; }
.chart-bar-fill span { font-size: 11px; font-weight: 600; color: #fff; }
.chart-bar-val { width: 60px; font-size: 12px; font-weight: 600; color: var(--text-primary); }

/* ── Riwayat timeline ── */
.timeline { position: relative; padding: 8px 0; }
.timeline::before {
  content: ''; position: absolute; left: 20px; top: 0; bottom: 0;
  width: 2px; background: var(--border);
}
.timeline-item { display: flex; gap: 16px; margin-bottom: 20px; position: relative; }
.timeline-icon {
  width: 42px; height: 42px;
  border-radius: 50%;
  background: var(--surface);
  border: 2px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; flex-shrink: 0;
  position: relative; z-index: 1;
}
.timeline-icon.create  { border-color: #1a7f3c; color: #1a7f3c; background: #e8f5ee; }
.timeline-icon.update  { border-color: #1a56db; color: #1a56db; background: #e3f0ff; }
.timeline-icon.delete  { border-color: #d93025; color: #d93025; background: #fde8e8; }
.timeline-icon.status  { border-color: var(--accent); color: var(--accent); background: var(--accent-pale); }
.timeline-icon.comment { border-color: #7c3aed; color: #7c3aed; background: #ede9fe; }
.timeline-body { flex: 1; padding-top: 6px; }
.timeline-title { font-weight: 600; font-size: 13.5px; color: var(--text-primary); }
.timeline-detail { font-size: 12.5px; color: var(--text-secondary); margin-top: 3px; }
.timeline-time   { font-size: 11.5px; color: var(--text-muted); margin-top: 4px; }

/* ── Arsip ── */
.arsip-badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 10px; border-radius: 20px;
  font-size: 11.5px; font-weight: 600;
  background: #f3e8ff; color: #7c3aed;
}

/* ── Pencarian Lanjutan ── */
.search-panel {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 24px;
}
.search-panel-title {
  font-size: 14px; font-weight: 600; color: var(--primary);
  margin-bottom: 16px;
  display: flex; align-items: center; gap: 8px;
}
.search-highlight { background: #fff3cd; padding: 1px 3px; border-radius: 2px; }

/* ── User Management ── */
.user-card {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border-light);
  transition: background var(--transition);
}
.user-card:last-child { border-bottom: none; }
.user-card:hover { background: var(--surface-2); }
.user-avatar-lg {
  width: 46px; height: 46px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary-light), var(--accent));
  display: flex; align-items: center; justify-content: center;
  font-size: 17px; font-weight: 700; color: #fff;
  flex-shrink: 0;
}
.user-card-info { flex: 1; }
.user-card-name { font-weight: 600; font-size: 14px; color: var(--text-primary); }
.user-card-meta { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.role-badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 10px; border-radius: 20px;
  font-size: 11.5px; font-weight: 600;
}
.role-admin    { background: #fde8e8; color: #d93025; }
.role-operator { background: #e3f0ff; color: #1a56db; }
.role-viewer   { background: var(--surface-3); color: var(--text-secondary); }

/* ── Pengingat ── */
.reminder-item {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border-light);
}
.reminder-item:last-child { border-bottom: none; }
.reminder-date {
  width: 56px; flex-shrink: 0;
  background: var(--primary);
  color: #fff; border-radius: 8px;
  text-align: center; padding: 6px 4px;
}
.reminder-date .day   { font-size: 20px; font-weight: 700; line-height: 1; }
.reminder-date .month { font-size: 10px; text-transform: uppercase; opacity: .8; }
.reminder-body { flex: 1; }
.reminder-title  { font-weight: 600; font-size: 13.5px; }
.reminder-detail { font-size: 12.5px; color: var(--text-secondary); margin-top: 2px; }
.reminder-overdue { background: #d93025; }
.reminder-today   { background: var(--accent); }

/* ── Topbar Profile Dropdown ── */
.topbar-profile { position: relative; }
.topbar-profile-btn {
  display: flex; align-items: center; gap: 8px;
  background: none; border: none; cursor: pointer;
  padding: 5px 10px; border-radius: var(--radius-sm);
  transition: background var(--transition);
  font-family: var(--font-body);
}
.topbar-profile-btn:hover { background: var(--surface-3); }
.topbar-avatar {
  width: 30px; height: 30px; border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; color: #fff;
  flex-shrink: 0;
}
.topbar-uname { font-size: 13px; font-weight: 500; color: var(--text-primary); }
.topbar-dropdown {
  position: absolute; right: 0; top: calc(100% + 8px);
  background: var(--surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  min-width: 220px;
  z-index: 200;
  display: none;
  animation: slideDown .15s ease;
}
.topbar-dropdown.open { display: block; }
.topbar-dropdown-header {
  padding: 14px 16px 10px;
  border-bottom: 1px solid var(--border-light);
}
.topbar-dropdown-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 16px;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 13px;
  transition: background var(--transition), color var(--transition);
}
.topbar-dropdown-item i { width: 16px; text-align: center; font-size: 13px; color: var(--text-muted); }
.topbar-dropdown-item:hover { background: var(--surface-2); color: var(--primary); }
.topbar-dropdown-item:hover i { color: var(--primary); }
.topbar-dropdown-divider { height: 1px; background: var(--border-light); margin: 4px 0; }
.topbar-dropdown-danger { color: #d93025 !important; }
.topbar-dropdown-danger i { color: #d93025 !important; }
.topbar-dropdown-danger:hover { background: #fde8e8 !important; }

/* ── Cetak / Print page enhancements ── */
.cetak-action-bar {
  position: fixed; top: 0; left: 0; right: 0;
  background: var(--primary-dark); color: #fff;
  padding: 10px 24px;
  display: flex; align-items: center; gap: 12px;
  z-index: 999;
  box-shadow: 0 2px 8px rgba(0,0,0,.3);
}
.cetak-action-bar .btn-cetak {
  background: var(--accent); color: #fff; border: none;
  padding: 8px 18px; border-radius: var(--radius-sm);
  font-size: 13px; font-weight: 600; cursor: pointer;
  display: flex; align-items: center; gap: 7px;
  transition: background .2s;
}
.cetak-action-bar .btn-cetak:hover { background: var(--accent-light); }
.cetak-action-bar .btn-tutup {
  background: rgba(255,255,255,.12); color: #fff; border: none;
  padding: 8px 14px; border-radius: var(--radius-sm);
  font-size: 13px; cursor: pointer; display: flex; align-items: center; gap: 6px;
}
.cetak-action-bar .btn-tutup:hover { background: rgba(255,255,255,.2); }
.cetak-action-bar .doc-info { font-size: 13px; opacity: .8; margin-left: 8px; }
@media print {
  .cetak-action-bar { display: none !important; }
}

/* ── Error pages ── */
.error-page {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: var(--surface-2); padding: 20px;
}
.error-card {
  text-align: center; max-width: 480px;
  background: var(--surface);
  border-radius: 16px;
  padding: 56px 40px;
  box-shadow: var(--shadow-lg);
}
.error-code {
  font-family: var(--font-display);
  font-size: 80px; font-weight: 700;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  line-height: 1;
}
.error-title { font-size: 22px; font-weight: 700; color: var(--primary-dark); margin: 12px 0 8px; }
.error-msg   { font-size: 14px; color: var(--text-secondary); line-height: 1.7; }

/* ── Laporan Cetak ── */
.laporan-cetak {
  font-family: 'Times New Roman', Times, serif;
  font-size: 11pt; color: #000;
  max-width: 900px; margin: 0 auto; padding: 30px 50px;
  background: #fff;
}
.lc-header { border-bottom: 3px double #000; padding-bottom: 10px; margin-bottom: 16px; }
.lc-kop    { display: flex; align-items: center; gap: 16px; }
.lc-logo   { width: 60px; height: 60px; background: linear-gradient(135deg,#1a4731,#2d6a4f); border-radius: 50%; display:flex;align-items:center;justify-content:center;flex-shrink:0; }
.lc-logo span { font-size:18pt;font-weight:700;color:#fff;font-family:Georgia,serif; }
.lc-inst   { flex: 1; text-align: center; }
.lc-inst h2 { font-size: 14pt; font-weight: 700; text-transform: uppercase; }
.lc-inst p  { font-size: 9.5pt; }
.lc-title   { text-align: center; margin: 14px 0 4px; }
.lc-title h3 { font-size: 13pt; font-weight: 700; text-transform: uppercase; text-decoration: underline; letter-spacing: 1.5px; }
.lc-perihal { text-align: center; font-size: 10.5pt; margin-bottom: 16px; }
.lc-table   { width: 100%; border-collapse: collapse; font-size: 10.5pt; margin: 10px 0; }
.lc-table th { border: 1px solid #000; padding: 5px 8px; background: #f0f0f0; text-align: center; font-weight: 700; }
.lc-table td { border: 1px solid #000; padding: 5px 8px; vertical-align: top; }
.lc-total   { font-weight: 700; }
.lc-sign    { margin-top: 30px; display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.lc-sign-box { text-align: center; font-size: 11pt; }
.lc-sign-space { height: 60px; }
.lc-sign-name  { font-weight: 700; text-decoration: underline; }

/* ── Pagination ── */
.pagination {
  display: flex; align-items: center; gap: 4px;
  flex-wrap: wrap; margin-top: 16px; padding: 0 4px;
}
.page-btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 34px; height: 34px; padding: 0 10px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13px; font-weight: 500;
  color: var(--text-secondary);
  text-decoration: none;
  transition: all var(--transition);
  background: var(--surface);
}
.page-btn:hover { border-color: var(--primary); color: var(--primary); background: var(--surface-3); }
.page-btn.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.page-btn.disabled { opacity: .4; cursor: not-allowed; pointer-events: none; }
.page-dots { display: inline-flex; align-items: center; padding: 0 4px; color: var(--text-muted); font-size: 13px; }
.page-info { margin-left: 8px; font-size: 12px; color: var(--text-muted); }

/* ── Per-page selector ── */
.table-footer {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 20px; border-top: 1px solid var(--border-light);
  background: var(--surface-2); flex-wrap: wrap; gap: 8px;
}
.perpage-select {
  display: flex; align-items: center; gap: 8px;
  font-size: 12.5px; color: var(--text-secondary);
}
.perpage-select select {
  padding: 4px 8px; border: 1.5px solid var(--border);
  border-radius: var(--radius-sm); font-size: 12.5px;
  font-family: var(--font-body); background: var(--surface);
}

/* ── SPPD Lapor Badge ── */
.lapor-badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 10px; border-radius: 20px;
  font-size: 11.5px; font-weight: 600;
}
.lapor-belum { background: #fff8e1; color: #b45309; }
.lapor-sudah { background: #e8f5ee; color: #1a7f3c; }

/* ── Sumber biaya chart ── */
.biaya-pie-row {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 0; border-bottom: 1px solid var(--border-light);
}
.biaya-pie-row:last-child { border-bottom: none; }
.biaya-dot { width: 12px; height: 12px; border-radius: 50%; flex-shrink: 0; }
.biaya-bar-wrap { flex: 1; background: var(--surface-3); border-radius: 4px; height: 14px; overflow: hidden; }
.biaya-bar-fill { height: 100%; border-radius: 4px; transition: width .6s ease; }
