/* ==========================================================================
   PRESENSI RAPAT SUBSTANSI - DESIGN SYSTEM & STYLESHEET
   Sesuai Dokumen UI/UX Rekap & Ekspor Laporan Presensi
   ========================================================================== */

:root {
  /* Color Palette */
  --color-primary: #0f766e;
  --color-primary-hover: #115e59;
  --color-primary-light: #f0fdfa;
  --color-primary-border: #99f6e4;
  
  --color-slate-900: #0f172a;
  --color-slate-800: #1e293b;
  --color-slate-700: #334155;
  --color-slate-600: #475569;
  --color-slate-500: #64748b;
  --color-slate-400: #94a3b8;
  --color-slate-300: #cbd5e1;
  --color-slate-200: #e2e8f0;
  --color-slate-100: #f1f5f9;
  --color-slate-50: #f8fafc;
  
  --color-surface: #ffffff;
  --color-border: #e2e8f0;
  --color-text: #1e293b;
  --color-text-muted: #64748b;

  /* Substansi Color Badges */
  --substansi-serdos: #059669;
  --substansi-serdos-bg: #ecfdf5;
  --substansi-bkd: #2563eb;
  --substansi-bkd-bg: #eff6ff;
  --substansi-ikd: #d97706;
  --substansi-ikd-bg: #fffbeb;
  --substansi-plp: #7c3aed;
  --substansi-plp-bg: #f5f3ff;
  --substansi-jad: #e11d48;
  --substansi-jad-bg: #fff1f2;

  /* Status Colors */
  --status-selesai: #16a34a;
  --status-selesai-bg: #dcfce7;
  --status-aktif: #2563eb;
  --status-aktif-bg: #dbeafe;
  --status-draft: #eab308;
  --status-draft-bg: #fef9c3;
  --status-ditutup: #64748b;
  --status-ditutup-bg: #f1f5f9;
  --status-arsip: #475569;
  --status-arsip-bg: #e2e8f0;

  /* Typography & Sizing */
  --font-sans: 'Plus Jakarta Sans', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --sidebar-width: 240px;
  --header-height: 64px;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 18px;

  /* Shadows */
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
  --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
}

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

body {
  font-family: var(--font-sans);
  background-color: var(--color-slate-50);
  color: var(--color-text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* Layout */
.app-container {
  display: flex;
  min-height: 100vh;
}

/* Sidebar */
.sidebar {
  width: var(--sidebar-width);
  background-color: var(--color-slate-900);
  color: #fff;
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: 40;
  transition: transform 0.25s ease;
}

.sidebar-header {
  padding: 1.25rem 1.25rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.sidebar-brand-icon {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, #0f766e, #14b8a6);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1.1rem;
  color: #fff;
  box-shadow: 0 2px 8px rgba(15, 118, 110, 0.5);
}

.sidebar-brand-text h1 {
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  line-height: 1.2;
}

.sidebar-brand-text p {
  font-size: 0.7rem;
  color: var(--color-slate-400);
}

.sidebar-nav {
  padding: 1rem 0.75rem;
  flex: 1;
  overflow-y: auto;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem 0.85rem;
  margin-bottom: 0.25rem;
  border-radius: var(--radius-md);
  color: var(--color-slate-300);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  transition: all 0.15s ease;
  cursor: pointer;
}

.nav-item:hover {
  background-color: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.nav-item.active {
  background-color: var(--color-primary);
  color: #fff;
  font-weight: 600;
  box-shadow: 0 2px 6px rgba(15, 118, 110, 0.4);
}

/* Top Horizontal Quick Nav Tabs */
.top-nav-tabs {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  background: #ffffff;
  padding: 0.6rem 1.75rem;
  border-bottom: 1px solid var(--color-border);
  overflow-x: auto;
  scrollbar-width: none;
  position: sticky;
  top: var(--header-height);
  z-index: 25;
}
.top-nav-tabs::-webkit-scrollbar {
  display: none;
}
.top-nav-tab {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.45rem 0.95rem;
  border-radius: var(--radius-md);
  font-size: 0.825rem;
  font-weight: 600;
  color: var(--color-slate-600);
  text-decoration: none;
  white-space: nowrap;
  transition: all 0.15s ease;
  border: 1px solid transparent;
  cursor: pointer;
}
.top-nav-tab:hover {
  background: var(--color-slate-100);
  color: var(--color-slate-900);
}
.top-nav-tab.active {
  background: var(--color-primary-light);
  color: var(--color-primary);
  border-color: var(--color-primary-border);
  box-shadow: 0 1px 3px rgba(15, 118, 110, 0.12);
}


.nav-badge {
  margin-left: auto;
  font-size: 0.7rem;
  background-color: rgba(255, 255, 255, 0.15);
  padding: 2px 6px;
  border-radius: 10px;
}

.sidebar-footer {
  padding: 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  background-color: rgba(0, 0, 0, 0.2);
}

.db-status-pill {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(255, 255, 255, 0.06);
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  cursor: pointer;
  border: 1px solid rgba(255, 255, 255, 0.1);
  transition: background 0.15s;
}

.db-status-pill:hover {
  background: rgba(255, 255, 255, 0.12);
}

.db-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: #22c55e;
  box-shadow: 0 0 8px #22c55e;
}

.db-dot.demo {
  background-color: #f59e0b;
  box-shadow: 0 0 8px #f59e0b;
}

/* Main Content Area */
.main-wrapper {
  margin-left: var(--sidebar-width);
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

/* Topbar */
.topbar {
  height: var(--header-height);
  background-color: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.75rem;
  position: sticky;
  top: 0;
  z-index: 30;
}

.mobile-menu-btn {
  display: none;
  background: none;
  border: none;
  font-size: 1.25rem;
  color: var(--color-slate-700);
  cursor: pointer;
}

.topbar-title {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.topbar-title h2 {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--color-slate-800);
}

.topbar-tag {
  background-color: var(--color-primary-light);
  color: var(--color-primary);
  border: 1px solid var(--color-primary-border);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 12px;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.topbar-btn {
  background: var(--color-slate-100);
  border: 1px solid var(--color-slate-200);
  padding: 0.45rem 0.85rem;
  border-radius: var(--radius-md);
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--color-slate-700);
  display: flex;
  align-items: center;
  gap: 0.4rem;
  cursor: pointer;
  transition: all 0.15s ease;
}

.topbar-btn:hover {
  background: var(--color-slate-200);
  color: var(--color-slate-900);
}

.admin-profile {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding-left: 0.75rem;
  border-left: 1px solid var(--color-border);
}

.admin-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, #0ea5e9, #0284c7);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.85rem;
}

.admin-info {
  display: flex;
  flex-direction: column;
}

.admin-name {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--color-slate-800);
}

.admin-role {
  font-size: 0.7rem;
  color: var(--color-slate-500);
}

/* Page Body */
.page-content {
  padding: 1.5rem 1.75rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

/* Page Header */
.page-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
}

.page-header h3 {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--color-slate-900);
}

.page-header p {
  font-size: 0.85rem;
  color: var(--color-slate-500);
  margin-top: 2px;
}

/* Top Stats Cards (Section 2) */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
}

.stat-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 1.15rem 1.25rem;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.stat-card-title {
  font-size: 0.775rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--color-slate-500);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.stat-card-value {
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--color-slate-900);
  margin-top: 0.35rem;
}

.stat-card-desc {
  font-size: 0.75rem;
  color: var(--color-slate-500);
  margin-top: 0.25rem;
}

/* Filter Laporan Panel (Section 2 & 3) */
.filter-panel {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  box-shadow: var(--shadow-sm);
}

.filter-panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.filter-panel-title {
  font-size: 0.875rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: var(--color-slate-700);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.saved-views-dropdown-wrapper {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.filter-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.85rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.form-group.col-span-2 {
  grid-column: span 2;
}

.form-group label {
  font-size: 0.775rem;
  font-weight: 600;
  color: var(--color-slate-700);
}

.form-control {
  font-family: inherit;
  font-size: 0.825rem;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--color-slate-300);
  border-radius: var(--radius-md);
  background-color: #fff;
  color: var(--color-slate-800);
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.form-control:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.15);
}

.date-range-inputs {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.date-range-inputs .form-control {
  flex: 1;
}

.date-separator {
  color: var(--color-slate-400);
  font-weight: 600;
}

/* Advanced Filter Section */
.advanced-filter-drawer {
  margin-top: 0.85rem;
  padding-top: 0.85rem;
  border-top: 1px dashed var(--color-border);
  display: none;
}

.advanced-filter-drawer.open {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.85rem;
  animation: fadeIn 0.2s ease-out;
}

/* Filter Actions */
.filter-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 1rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--color-slate-100);
}

.btn-link {
  background: none;
  border: none;
  color: var(--color-primary);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.btn-link:hover {
  text-decoration: underline;
}

.filter-btn-group {
  display: flex;
  gap: 0.5rem;
}

.btn {
  font-family: inherit;
  font-size: 0.825rem;
  font-weight: 600;
  padding: 0.5rem 1rem;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  transition: all 0.15s ease;
}

.btn-primary {
  background-color: var(--color-primary);
  color: #fff;
}

.btn-primary:hover {
  background-color: var(--color-primary-hover);
}

.btn-outline {
  background-color: #fff;
  border-color: var(--color-slate-300);
  color: var(--color-slate-700);
}

.btn-outline:hover {
  background-color: var(--color-slate-50);
  border-color: var(--color-slate-400);
}

.btn-sm {
  padding: 0.35rem 0.65rem;
  font-size: 0.75rem;
}

.btn-warning {
  background-color: #f59e0b;
  color: #fff;
}

.btn-danger {
  background-color: #e11d48;
  color: #fff;
}

/* Active Filter Chips (Section 3) */
.active-chips-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.65rem;
  padding-top: 0.65rem;
  border-top: 1px solid var(--color-slate-100);
}

.chips-label {
  font-size: 0.725rem;
  font-weight: 600;
  color: var(--color-slate-500);
  text-transform: uppercase;
}

.chip {
  background-color: var(--color-slate-100);
  border: 1px solid var(--color-slate-200);
  color: var(--color-slate-700);
  font-size: 0.75rem;
  padding: 2px 8px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.chip-remove {
  background: none;
  border: none;
  color: var(--color-slate-400);
  cursor: pointer;
  font-weight: bold;
  font-size: 0.85rem;
  line-height: 1;
}

.chip-remove:hover {
  color: var(--color-slate-700);
}

.chip-clear-all {
  font-size: 0.725rem;
  color: #e11d48;
  background: none;
  border: none;
  cursor: pointer;
  margin-left: 0.4rem;
  text-decoration: underline;
}

/* Dual View Tabs (Section 4) */
.view-tabs-container {
  display: flex;
  border-bottom: 2px solid var(--color-slate-200);
  gap: 1.5rem;
}

.view-tab {
  background: none;
  border: none;
  padding: 0.65rem 0.25rem;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--color-slate-500);
  cursor: pointer;
  position: relative;
  transition: color 0.15s;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.view-tab:hover {
  color: var(--color-slate-800);
}

.view-tab.active {
  color: var(--color-primary);
}

.view-tab.active::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  right: 0;
  height: 2px;
  background-color: var(--color-primary);
}

.view-tab-count {
  font-size: 0.725rem;
  background-color: var(--color-slate-200);
  color: var(--color-slate-700);
  padding: 2px 7px;
  border-radius: 10px;
}

.view-tab.active .view-tab-count {
  background-color: var(--color-primary-light);
  color: var(--color-primary);
}

/* Results Toolbar (Section 1 & 2) */
.results-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.results-count-wrapper {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.results-count {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--color-slate-800);
}

.action-btn-group {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Export Dropdown */
.dropdown-container {
  position: relative;
  display: inline-block;
}

.dropdown-menu {
  position: absolute;
  right: 0;
  top: 100%;
  margin-top: 4px;
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  min-width: 220px;
  z-index: 50;
  display: none;
  padding: 0.35rem 0;
}

.dropdown-container:hover .dropdown-menu,
.dropdown-menu.show {
  display: block;
}

.dropdown-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.55rem 0.85rem;
  font-size: 0.8rem;
  color: var(--color-slate-700);
  text-decoration: none;
  cursor: pointer;
  transition: background 0.15s;
}

.dropdown-item:hover {
  background-color: var(--color-slate-50);
  color: var(--color-primary);
}

.dropdown-divider {
  height: 1px;
  background: var(--color-border);
  margin: 0.25rem 0;
}

/* Table Card & Data Tables */
.table-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.table-responsive {
  overflow-x: auto;
  max-height: 540px;
  position: relative;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8rem;
  text-align: left;
}

.data-table th {
  background-color: var(--color-slate-100);
  color: var(--color-slate-700);
  font-weight: 700;
  padding: 0.65rem 0.85rem;
  border-bottom: 1px solid var(--color-border);
  position: sticky;
  top: 0;
  z-index: 10;
  white-space: nowrap;
}

.data-table td {
  padding: 0.65rem 0.85rem;
  border-bottom: 1px solid var(--color-slate-100);
  color: var(--color-slate-700);
  white-space: nowrap;
}

.data-table tr:hover td {
  background-color: #f8fafc;
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 7px;
  border-radius: 4px;
  font-size: 0.725rem;
  font-weight: 600;
}

.badge-substansi-serdos { background: var(--substansi-serdos-bg); color: var(--substansi-serdos); }
.badge-substansi-bkd { background: var(--substansi-bkd-bg); color: var(--substansi-bkd); }
.badge-substansi-ikd { background: var(--substansi-ikd-bg); color: var(--substansi-ikd); }
.badge-substansi-plp { background: var(--substansi-plp-bg); color: var(--substansi-plp); }
.badge-substansi-jad { background: var(--substansi-jad-bg); color: var(--substansi-jad); }

.badge-status-selesai { background: var(--status-selesai-bg); color: var(--status-selesai); }
.badge-status-aktif { background: var(--status-aktif-bg); color: var(--status-aktif); }
.badge-status-draft { background: var(--status-draft-bg); color: var(--status-draft); }
.badge-status-ditutup { background: var(--status-ditutup-bg); color: var(--status-ditutup); }
.badge-status-arsip { background: var(--status-arsip-bg); color: var(--status-arsip); }

.badge-hadir { background: #dcfce7; color: #15803d; }
.badge-terlambat { background: #ffedd5; color: #c2410c; }
.badge-izin { background: #e0f2fe; color: #0369a1; }
.badge-sakit { background: #fee2e2; color: #b91c1c; }

/* Warning Alert banner (misal data terlalu besar) */
.alert-banner {
  padding: 0.75rem 1rem;
  border-radius: var(--radius-md);
  font-size: 0.8rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.alert-warning {
  background-color: #fffbeb;
  border: 1px solid #fde68a;
  color: #92400e;
}

/* Empty State & Skeleton (Section 9) */
.empty-state {
  text-align: center;
  padding: 3rem 1.5rem;
}

.empty-state-icon {
  font-size: 2.5rem;
  color: var(--color-slate-300);
  margin-bottom: 0.75rem;
}

.empty-state h4 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--color-slate-800);
}

.empty-state p {
  font-size: 0.825rem;
  color: var(--color-slate-500);
  margin: 0.25rem 0 1rem;
}

/* Skeleton Loading */
.skeleton-row {
  height: 38px;
  background: linear-gradient(90deg, #f1f5f9 25%, #e2e8f0 50%, #f1f5f9 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-bottom: 1px solid var(--color-slate-100);
}

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Modals & Dialogs (Section 5 & 6) */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(4px);
  z-index: 100;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.modal-overlay.active {
  display: flex;
}

.modal-content {
  background: #fff;
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xl);
  width: 100%;
  max-width: 650px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: modalIn 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-content.modal-xl {
  max-width: 950px;
}

@keyframes modalIn {
  from { transform: scale(0.95); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.modal-header {
  padding: 1.15rem 1.5rem;
  border-bottom: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-header h3 {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--color-slate-900);
}

.modal-close-btn {
  background: none;
  border: none;
  font-size: 1.25rem;
  color: var(--color-slate-400);
  cursor: pointer;
  line-height: 1;
}

.modal-close-btn:hover {
  color: var(--color-slate-700);
}

.modal-body {
  padding: 1.25rem 1.5rem;
  overflow-y: auto;
  flex: 1;
}

.modal-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--color-border);
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  background: var(--color-slate-50);
}

/* Kolom Konfigurasi Layout (Section 5) */
.column-group-title {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--color-slate-500);
  margin-bottom: 0.5rem;
}

.column-checkbox-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8rem;
  color: var(--color-slate-800);
  padding: 0.35rem 0.5rem;
  border-radius: var(--radius-sm);
  background: var(--color-slate-50);
  border: 1px solid var(--color-slate-200);
  cursor: pointer;
  user-select: none;
}

.checkbox-label:hover {
  background: var(--color-slate-100);
}

.checkbox-label.sensitive {
  border-color: #fde68a;
  background-color: #fffbeb;
}

.order-list {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  max-height: 220px;
  overflow-y: auto;
  border: 1px solid var(--color-slate-200);
  padding: 0.5rem;
  border-radius: var(--radius-md);
}

.order-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.35rem 0.65rem;
  background: #fff;
  border: 1px solid var(--color-slate-200);
  border-radius: var(--radius-sm);
  font-size: 0.775rem;
  cursor: grab;
}

.order-item-actions {
  display: flex;
  gap: 2px;
}

.order-item-btn {
  background: none;
  border: none;
  color: var(--color-slate-400);
  cursor: pointer;
  padding: 2px 4px;
}

.order-item-btn:hover {
  color: var(--color-slate-800);
}

/* Kop Instansi & Pratinjau Laporan (Section 6) */
.report-paper {
  background: #fff;
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-sm);
  padding: 2rem 2.5rem;
  font-family: 'Times New Roman', Times, serif;
  color: #000;
}

.report-kop {
  text-align: center;
  margin-bottom: 1rem;
}

.report-kop-logo-area {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.25rem;
  margin-bottom: 0.5rem;
}

.report-kop-logo {
  width: 64px;
  height: 64px;
  object-fit: contain;
}

.report-kop-text h2 {
  font-size: 1.15rem;
  font-weight: bold;
  letter-spacing: 0.5px;
  margin-bottom: 1px;
}

.report-kop-text h3 {
  font-size: 1rem;
  font-weight: bold;
  margin-bottom: 2px;
}

.report-kop-text p {
  font-size: 0.8rem;
  font-family: var(--font-sans);
}

.kop-divider {
  border: none;
  border-top: 3px double #000;
  margin: 0.65rem 0 1.25rem;
}

.report-title-section {
  text-align: center;
  margin-bottom: 1.25rem;
  font-family: var(--font-sans);
}

.report-title-section h4 {
  font-size: 1.05rem;
  font-weight: 800;
  text-transform: uppercase;
}

.report-meta-pills {
  display: flex;
  justify-content: center;
  gap: 1.25rem;
  margin-top: 0.35rem;
  font-size: 0.775rem;
  color: var(--color-slate-600);
}

.report-stats-tag {
  display: inline-block;
  background: var(--color-slate-100);
  border: 1px solid var(--color-slate-200);
  padding: 2px 10px;
  border-radius: 20px;
  font-size: 0.725rem;
  font-weight: 600;
  margin-top: 0.4rem;
  font-family: var(--font-sans);
}

.preview-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.75rem;
  font-family: var(--font-sans);
  margin-top: 0.75rem;
}

.preview-table th, 
.preview-table td {
  border: 1px solid #333;
  padding: 0.4rem 0.5rem;
}

.preview-table th {
  background: #f1f5f9;
  font-weight: bold;
  text-align: left;
}

/* Toast Notifications */
.toast-container {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 120;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.toast {
  background: var(--color-slate-900);
  color: #fff;
  padding: 0.75rem 1.15rem;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  font-size: 0.825rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  animation: toastIn 0.25s ease;
  min-width: 260px;
}

@keyframes toastIn {
  from { transform: translateY(100%); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

/* Responsive & Print */
@media (max-width: 1024px) {
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .filter-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
  }
  .sidebar.open {
    transform: translateX(0);
  }
  .main-wrapper {
    margin-left: 0;
  }
  .mobile-menu-btn {
    display: block;
  }
  .stats-grid {
    grid-template-columns: 1fr;
  }
  .filter-grid {
    grid-template-columns: 1fr;
  }
  .form-group.col-span-2 {
    grid-column: span 1;
  }
  .advanced-filter-drawer.open {
    grid-template-columns: 1fr;
  }
  .column-checkbox-grid {
    grid-template-columns: 1fr;
  }
/* Page Views Navigation */
.app-page-view {
  animation: fadeIn 0.25s ease-out;
}

/* Action button icons & groups in Rapat */
.rapat-action-buttons {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  justify-content: flex-end;
}

.rapat-action-btn {
  padding: 0.3rem 0.55rem;
  font-size: 0.75rem;
  border-radius: var(--radius-sm);
  background: #fff;
  border: 1px solid var(--color-slate-200);
  color: var(--color-slate-700);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  transition: all 0.15s ease;
}

.rapat-action-btn:hover {
  background: var(--color-slate-100);
  border-color: var(--color-slate-300);
  color: var(--color-slate-900);
}

.rapat-action-btn.primary {
  background-color: var(--color-primary-light);
  border-color: var(--color-primary-border);
  color: var(--color-primary);
}

.rapat-action-btn.primary:hover {
  background-color: var(--color-primary);
  color: #fff;
}

/* QR Code Display Container */
.qr-display-box {
  background: #fff;
  border: 2px dashed var(--color-slate-300);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin: 1rem 0;
}

.qr-code-img {
  width: 200px;
  height: 200px;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  border: 4px solid #fff;
}

.link-copy-container {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--color-slate-100);
  border: 1px solid var(--color-slate-200);
  padding: 0.4rem 0.75rem;
  border-radius: var(--radius-md);
  width: 100%;
  margin-top: 1rem;
}

.link-copy-input {
  flex: 1;
  background: none;
  border: none;
  font-family: inherit;
  font-size: 0.8rem;
  color: var(--color-slate-700);
  outline: none;
/* Dashboard Layout & Analytics */
.dashboard-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 1.25rem;
}

@media (max-width: 1024px) {
  .dashboard-grid {
    grid-template-columns: 1fr;
  }
}

.dashboard-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.dashboard-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--color-slate-100);
  padding-bottom: 0.75rem;
}

.dashboard-card-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--color-slate-800);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.substansi-stat-row {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-bottom: 0.85rem;
}

.substansi-stat-header {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--color-slate-700);
}

.progress-track {
  width: 100%;
  height: 8px;
  background-color: var(--color-slate-100);
  border-radius: 4px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.6s ease;
}

/* Substansi Cards Grid */
.substansi-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
}

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

@media (max-width: 640px) {
  .substansi-grid {
    grid-template-columns: 1fr;
  }
}

.substansi-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 1.35rem;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  overflow: hidden;
  transition: transform 0.2s, box-shadow 0.2s;
}

.substansi-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

.substansi-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
}

.substansi-card.serdos::before { background-color: var(--substansi-serdos); }
.substansi-card.bkd::before { background-color: var(--substansi-bkd); }
.substansi-card.ikd::before { background-color: var(--substansi-ikd); }
.substansi-card.plp::before { background-color: var(--substansi-plp); }
.substansi-card.jad::before { background-color: var(--substansi-jad); }

.substansi-card-badge {
  display: inline-flex;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 4px;
  margin-bottom: 0.75rem;
}

.substansi-card h4 {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--color-slate-900);
  margin-bottom: 0.35rem;
}

.substansi-card p {
  font-size: 0.8rem;
  color: var(--color-slate-600);
  line-height: 1.5;
  margin-bottom: 1rem;
}

.substansi-metrics {
  display: grid;
  grid-template-columns: 1fr 1fr;
  background: var(--color-slate-50);
  padding: 0.75rem;
  border-radius: var(--radius-md);
  margin-bottom: 1rem;
  border: 1px solid var(--color-slate-200);
}

.substansi-metric-item {
  display: flex;
  flex-direction: column;
}

.substansi-metric-label {
  font-size: 0.7rem;
  color: var(--color-slate-500);
  text-transform: uppercase;
}

.substansi-metric-val {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--color-slate-900);
}

.substansi-card-actions {
  display: flex;
  gap: 0.5rem;
}

/* Print Stylesheet for Official Reports */
@media print {
  body {
    background: #fff;
    color: #000;
  }
  .sidebar, .topbar, .stats-grid, .filter-panel, .view-tabs-container, 
  .results-toolbar, .modal-header, .modal-footer, .toast-container,
  .table-card {
    display: none !important;
  }
  .modal-overlay {
    position: static;
    background: transparent;
    padding: 0;
    display: block !important;
  }
  .modal-content {
    box-shadow: none;
    max-width: 100%;
    max-height: none;
    border: none;
  }
  .modal-body {
    padding: 0;
  }
  .report-paper {
    border: none;
    box-shadow: none;
    padding: 0;
  }
}
