/* ==========================================================================
   SISTEM MANAJEMEN SEKOLAH & ABSENSI - MODERN SKY BLUE DESIGN SYSTEM
   ========================================================================== */

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

:root {
  /* Primary Palette: Sky Blue */
  --primary-50: #f0f9ff;
  --primary-100: #e0f2fe;
  --primary-200: #bae6fd;
  --primary-300: #7dd3fc;
  --primary-400: #38bdf8;
  --primary-500: #0ea5e9;
  --primary-600: #0284c7;
  --primary-700: #0369a1;
  --primary-800: #075985;
  --primary-900: #0c4a6e;

  /* Secondary Palette: Deep Navy Blue */
  --secondary-950: #020617;
  --secondary-900: #0f172a;
  --secondary-800: #1e293b;
  --secondary-700: #334155;
  --secondary-600: #475569;
  --secondary-500: #64748b;

  /* Accent Gold */
  --accent-gold: #d97706;
  --accent-gold-light: #fef3c7;
  --accent-gold-dark: #b45309;

  /* Status Colors */
  --success: #10b981;
  --success-bg: #d1fae5;
  --warning: #f59e0b;
  --warning-bg: #fef3c7;
  --danger: #ef4444;
  --danger-bg: #fee2e2;
  --info: #3b82f6;
  --info-bg: #dbeafe;

  /* Neutrals */
  --bg-main: #f8fafc;
  --bg-card: #ffffff;
  --border-color: #e2e8f0;
  --text-main: #0f172a;
  --text-muted: #64748b;

  /* Elevation 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);

  /* Radius */
  --radius-sm: 0.375rem;
  --radius-md: 0.5rem;
  --radius-lg: 0.75rem;
  --radius-xl: 1rem;
}

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

html, body {
  height: 100%;
}

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background-color: var(--bg-main);
  color: var(--text-main);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6 {
  font-family: 'Outfit', 'Inter', sans-serif;
  font-weight: 700;
  color: var(--secondary-900);
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: var(--bg-main);
}
::-webkit-scrollbar-thumb {
  background: var(--primary-300);
  border-radius: 99px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--primary-500);
}

/* ==========================================================================
   LAYOUT STRUCTURE
   ========================================================================== */

#app-wrapper {
  display: flex;
  min-height: 100vh;
  width: 100%;
  overflow-x: hidden;
}

/* Sidebar */
.app-sidebar {
  width: 260px;
  background-color: var(--secondary-900);
  color: #ffffff;
  display: flex;
  flex-direction: column;
  transition: transform 0.3s ease, left 0.3s ease;
  z-index: 1000;
  flex-shrink: 0;
  min-height: 100vh;
}

.sidebar-header {
  padding: 1.25rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  background: linear-gradient(135deg, var(--secondary-950), var(--primary-900));
}

img {
  max-width: 100%;
  height: auto;
}

.sidebar-brand-logo {
  width: 38px;
  height: 38px;
  max-width: 38px;
  max-height: 38px;
  object-fit: contain;
  border-radius: 8px;
  background: #ffffff;
  padding: 3px;
  flex-shrink: 0;
}

.sidebar-brand-title {
  font-size: 1rem;
  font-weight: 700;
  color: #ffffff;
  line-height: 1.2;
}

.sidebar-brand-subtitle {
  font-size: 0.725rem;
  color: var(--primary-300);
}

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

.menu-category {
  font-size: 0.68rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #64748b;
  margin: 1.2rem 0.75rem 0.4rem 0.75rem;
}

.nav-item {
  margin-bottom: 0.2rem;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem 0.85rem;
  color: #94a3b8;
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  border-radius: var(--radius-md);
  transition: all 0.2s ease;
}

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

.nav-link.active {
  color: #ffffff;
  background: linear-gradient(90deg, var(--primary-600), var(--primary-700));
  box-shadow: 0 4px 12px rgba(2, 132, 199, 0.35);
}

.nav-link i {
  font-size: 1.05rem;
  width: 20px;
  text-align: center;
}

/* Sidebar Accordion Dropdown Submenu Styling */
.nav-dropdown {
  margin-bottom: 0.25rem;
}

.nav-dropdown-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 0.65rem 0.85rem;
  color: #94a3b8;
  background: transparent;
  border: none;
  font-size: 0.875rem;
  font-weight: 600;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: left;
}

.nav-dropdown-toggle:hover {
  color: #ffffff;
  background-color: rgba(255, 255, 255, 0.08);
}

.nav-dropdown.active > .nav-dropdown-toggle {
  color: #ffffff;
  background-color: rgba(255, 255, 255, 0.06);
}

.nav-dropdown-toggle .toggle-title {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.nav-dropdown-toggle .toggle-title i {
  font-size: 1.05rem;
  width: 20px;
  text-align: center;
}

.nav-dropdown-toggle .chevron-icon {
  font-size: 0.75rem;
  transition: transform 0.25s ease;
  color: #64748b;
}

.nav-dropdown.open > .nav-dropdown-toggle .chevron-icon,
.nav-dropdown.active > .nav-dropdown-toggle .chevron-icon {
  transform: rotate(180deg);
  color: var(--primary-300);
}

.nav-sub-menu {
  display: none;
  padding-left: 0.5rem;
  margin-top: 0.2rem;
  margin-bottom: 0.4rem;
  border-left: 2px solid rgba(255, 255, 255, 0.12);
  margin-left: 1.25rem;
}

.nav-dropdown.open > .nav-sub-menu,
.nav-dropdown.active > .nav-sub-menu {
  display: block;
}

.nav-sub-menu .nav-link {
  padding: 0.5rem 0.75rem;
  font-size: 0.825rem;
  color: #94a3b8;
  margin-bottom: 0.15rem;
}

.nav-sub-menu .nav-link:hover {
  color: #ffffff;
  background-color: rgba(255, 255, 255, 0.08);
}

.nav-sub-menu .nav-link.active {
  color: #ffffff;
  background: linear-gradient(90deg, var(--primary-600), var(--primary-700));
  box-shadow: 0 2px 8px rgba(2, 132, 199, 0.3);
  font-weight: 600;
}

/* Main Content Column */
.app-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  background-color: var(--bg-main);
}

/* Navbar */
.app-navbar {
  height: 64px;
  background-color: var(--bg-card);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.5rem;
  position: sticky;
  top: 0;
  z-index: 900;
  box-shadow: var(--shadow-sm);
}

.navbar-toggle-btn {
  background: var(--primary-50);
  border: 1px solid var(--primary-200);
  color: var(--primary-700);
  width: 38px;
  height: 38px;
  border-radius: var(--radius-md);
  display: none;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

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

.user-profile-dropdown {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.user-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--primary-300);
  box-shadow: var(--shadow-sm);
}

.user-info {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.user-name {
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--secondary-900);
}

.user-role-badge {
  font-size: 0.675rem;
  font-weight: 700;
  color: var(--primary-700);
  background-color: var(--primary-100);
  padding: 0.1rem 0.5rem;
  border-radius: var(--radius-sm);
  display: inline-block;
  margin-top: 2px;
}

/* Main Container */
.content-container {
  padding: 1.75rem;
  flex: 1;
}

/* Page Header */
.page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.page-title {
  font-size: 1.5rem;
  color: var(--secondary-900);
  line-height: 1.2;
}

.page-breadcrumb {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 0.2rem;
}

/* ==========================================================================
   CARDS & STATS
   ========================================================================== */

.card {
  background-color: var(--bg-card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
  margin-bottom: 1.5rem;
  overflow: hidden;
  transition: box-shadow 0.2s ease;
}

.card:hover {
  box-shadow: var(--shadow-md);
}

.card-header {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background-color: #ffffff;
}

.card-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--secondary-900);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.card-body {
  padding: 1.25rem;
}

.card-footer {
  padding: 0.875rem 1.25rem;
  background-color: var(--bg-main);
  border-top: 1px solid var(--border-color);
}

/* Grid Layouts */
.grid-4 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.25rem;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.25rem;
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1.25rem;
}

/* Stat Card */
.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

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

.stat-icon {
  width: 50px;
  height: 50px;
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  flex-shrink: 0;
}

.stat-icon.primary { background-color: var(--primary-100); color: var(--primary-600); }
.stat-icon.success { background-color: var(--success-bg); color: var(--success); }
.stat-icon.warning { background-color: var(--warning-bg); color: var(--warning); }
.stat-icon.danger { background-color: var(--danger-bg); color: var(--danger); }
.stat-icon.gold { background-color: var(--accent-gold-light); color: var(--accent-gold); }

.stat-value {
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--secondary-900);
  line-height: 1.2;
}

.stat-label {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 600;
}

/* ==========================================================================
   BUTTONS & FORM INPUTS
   ========================================================================== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.6rem 1.2rem;
  font-size: 0.875rem;
  font-weight: 600;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.btn-primary {
  background-color: var(--primary-600);
  color: #ffffff;
  box-shadow: 0 2px 4px rgba(2, 132, 199, 0.2);
}
.btn-primary:hover { background-color: var(--primary-700); box-shadow: 0 4px 8px rgba(2, 132, 199, 0.3); }

.btn-secondary {
  background-color: var(--secondary-700);
  color: #ffffff;
}
.btn-secondary:hover { background-color: var(--secondary-800); }

.btn-success {
  background-color: var(--success);
  color: #ffffff;
  box-shadow: 0 2px 4px rgba(16, 185, 129, 0.2);
}
.btn-success:hover { background-color: #059669; }

.btn-warning {
  background-color: var(--warning);
  color: #ffffff;
}
.btn-warning:hover { background-color: #d97706; }

.btn-danger {
  background-color: var(--danger);
  color: #ffffff;
}
.btn-danger:hover { background-color: #dc2626; }

.btn-outline {
  background-color: #ffffff;
  border-color: var(--border-color);
  color: var(--secondary-700);
}
.btn-outline:hover { background-color: var(--primary-50); border-color: var(--primary-300); color: var(--primary-700); }

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

.btn-lg {
  padding: 0.8rem 1.75rem;
  font-size: 1rem;
}

/* Form controls */
.form-group {
  margin-bottom: 1.25rem;
}

.form-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--secondary-800);
  margin-bottom: 0.4rem;
}

.form-control, .form-select {
  width: 100%;
  padding: 0.6rem 0.875rem;
  font-size: 0.9rem;
  color: var(--text-main);
  background-color: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-control:focus, .form-select:focus {
  border-color: var(--primary-500);
  box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.2);
}

/* ==========================================================================
   TABLES & BADGES
   ========================================================================== */

.table-responsive {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

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

.table th {
  background-color: var(--primary-50);
  color: var(--secondary-900);
  font-weight: 700;
  padding: 0.85rem 1rem;
  border-bottom: 2px solid var(--border-color);
  white-space: nowrap;
}

.table td {
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--border-color);
  vertical-align: middle;
}

.table tbody tr:hover {
  background-color: rgba(240, 249, 255, 0.6);
}

/* Badges */
.badge {
  display: inline-block;
  padding: 0.25rem 0.65rem;
  font-size: 0.75rem;
  font-weight: 700;
  border-radius: 9999px;
  text-align: center;
  white-space: nowrap;
}

.badge-success { background-color: var(--success-bg); color: #065f46; }
.badge-warning { background-color: var(--warning-bg); color: #92400e; }
.badge-danger { background-color: var(--danger-bg); color: #991b1b; }
.badge-info { background-color: var(--info-bg); color: #1e40af; }
.badge-primary { background-color: var(--primary-100); color: var(--primary-800); }
.badge-gold { background-color: var(--accent-gold-light); color: var(--accent-gold-dark); }

/* ==========================================================================
   RESPONSIVE DESIGN (MOBILE OVERRIDES)
   ========================================================================== */

.navbar-title {
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--secondary-900);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

@media (max-width: 992px) {
  .app-sidebar {
    position: fixed;
    top: 0;
    bottom: 0;
    left: -260px;
    box-shadow: none;
  }

  .app-sidebar.show {
    left: 0;
    box-shadow: 10px 0 30px rgba(0, 0, 0, 0.4);
  }

  .navbar-toggle-btn {
    display: flex;
  }

  .content-container {
    padding: 1rem;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }
}

@media (max-width: 768px) {
  html, body {
    overflow-x: hidden;
  }

  #app-wrapper {
    overflow-x: hidden;
  }

  .app-navbar {
    padding: 0 0.75rem !important;
    height: 56px !important;
  }

  .navbar-title {
    font-size: 0.925rem !important;
    max-width: 140px !important;
  }

  .user-info {
    display: none !important;
  }

  .user-profile-dropdown {
    gap: 0.35rem !important;
  }

  .user-avatar {
    width: 32px !important;
    height: 32px !important;
  }

  .navbar-logout-btn {
    padding: 0.3rem 0.5rem !important;
  }

  .content-container {
    padding: 0.75rem !important;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box;
  }

  .page-header {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 0.5rem !important;
    margin-bottom: 1rem !important;
  }

  .page-header div:last-child {
    width: 100%;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
  }

  .page-header div:last-child .btn {
    flex: 1;
    text-align: center;
    justify-content: center;
  }

  .page-title {
    font-size: 1.2rem !important;
    word-break: break-word;
  }

  .page-breadcrumb {
    font-size: 0.8rem !important;
  }

  .grid-4, .grid-3, .grid-2 {
    grid-template-columns: 1fr !important;
    gap: 0.85rem !important;
  }

  .card {
    border-radius: var(--radius-lg);
    margin-bottom: 1rem !important;
  }

  .card-header {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 0.5rem !important;
    padding: 0.85rem 1rem !important;
  }

  .card-body {
    padding: 0.85rem !important;
  }

  .form-control, .form-select {
    font-size: 16px !important;
  }

  .table-responsive {
    width: 100% !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
    display: block;
    border-radius: var(--radius-md);
  }

  .table th, .table td {
    padding: 0.6rem 0.65rem !important;
    font-size: 0.8rem !important;
  }

  .stat-card {
    padding: 1rem !important;
  }

  #webcam-video, #qr-reader, video {
    max-width: 100% !important;
    height: auto !important;
  }
}

/* ==========================================================================
   DISTINCT CAMERA & QR SCANNER VIEWPORT STYLES
   ========================================================================== */
.qr-container-box {
  background: #090d16;
  border: 2px solid #2563eb;
  border-radius: var(--radius-xl);
  padding: 1.25rem;
  box-shadow: 0 8px 25px rgba(37, 99, 235, 0.25);
  position: relative;
  margin-bottom: 1rem;
}

.qr-container-box .scanner-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 1px solid #10b981;
  padding: 0.4rem 0.85rem;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
}

.selfie-container-box {
  background: #0f172a;
  border: 2px solid #475569;
  border-radius: var(--radius-xl);
  padding: 1.25rem;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
  position: relative;
  margin-bottom: 1rem;
}

.selfie-container-box .selfie-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(56, 189, 248, 0.15);
  color: #38bdf8;
  border: 1px solid #0284c7;
  padding: 0.4rem 0.85rem;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
}

.btn-shutter-selfie {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: #ffffff;
  border: none;
  border-radius: 30px;
  font-weight: 800;
  font-size: 1.05rem;
  padding: 0.9rem 1.75rem;
  width: 100%;
  box-shadow: 0 4px 15px rgba(16, 185, 129, 0.4);
  transition: all 0.2s ease;
  cursor: pointer;
}

.btn-shutter-selfie:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(16, 185, 129, 0.6);
}

.btn-shutter-selfie:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  box-shadow: none;
}

/* ==========================================================================
   UNIFIED KIOSK TAB BUTTONS
   ========================================================================== */
.kiosk-tab-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 0.85rem;
  font-size: 0.85rem;
  font-weight: 700;
  border-radius: var(--radius-md);
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.08);
  color: #cbd5e1;
  cursor: pointer;
  transition: all 0.2s ease;
}

.kiosk-tab-btn:hover {
  background: rgba(255, 255, 255, 0.15);
  color: #ffffff;
}

.kiosk-tab-btn.active {
  background: var(--primary-600);
  color: #ffffff;
  border-color: var(--primary-500);
  box-shadow: 0 4px 12px rgba(2, 132, 199, 0.4);
}

.kiosk-tab-btn.tab-light {
  border: 1px solid var(--border-color);
  background: var(--bg-main);
  color: var(--secondary-700);
}

.kiosk-tab-btn.tab-light:hover {
  background: var(--primary-50);
  color: var(--primary-700);
}

.kiosk-tab-btn.tab-light.active {
  background: var(--primary-600);
  color: #ffffff;
  border-color: var(--primary-500);
  box-shadow: 0 4px 12px rgba(2, 132, 199, 0.4);
}

/* ==========================================================================
   GENERIC RESPONSIVE MODAL SYSTEM
   ========================================================================== */
.app-modal-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 9999;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
  overflow-y: auto;
}

.app-modal-card {
  background: #ffffff;
  width: 100%;
  max-width: 520px;
  border-radius: var(--radius-lg, 12px);
  padding: 1.5rem;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.2), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
  max-height: calc(100vh - 2.5rem);
  overflow-y: auto;
  margin: auto;
  position: relative;
  box-sizing: border-box;
}

.app-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  border-bottom: 1px solid var(--border-color, #e2e8f0);
  padding-bottom: 0.75rem;
  position: sticky;
  top: -1.5rem;
  background: #ffffff;
  z-index: 10;
  margin-top: -0.5rem;
  padding-top: 0.5rem;
}

.app-modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  margin-top: 1.25rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border-color, #e2e8f0);
  position: sticky;
  bottom: -1.5rem;
  background: #ffffff;
  z-index: 10;
  margin-bottom: -0.5rem;
  padding-bottom: 0.5rem;
}

/* ==========================================================================
   PRINT MEDIA STYLES (PDF & PRINT OPTIMIZATION FOR REPORTS)
   ========================================================================== */
@media print {
  @page {
    size: auto;
    margin: 10mm 10mm 15mm 10mm;
  }

  /* Explicitly reset visibility for report printing */
  body, body * {
    visibility: visible !important;
  }

  /* Show Print-only Kop Surat and Signature */
  .print-only-kop,
  .print-only-signature {
    display: block !important;
  }

  /* Hide non-printable UI elements */
  .app-sidebar,
  .app-navbar,
  .navbar-toggle-btn,
  .app-modal-overlay,
  .btn,
  .no-print,
  .page-header,
  form,
  .card:has(form),
  .stat-card,
  .grid-4,
  .grid-3,
  .grid-2 {
    display: none !important;
  }

  /* Unset flex containers & overflow clipping */
  html, body, #app-wrapper, .app-main, .content-container {
    background: #ffffff !important;
    color: #000000 !important;
    width: 100% !important;
    height: auto !important;
    min-height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: visible !important;
    display: block !important;
    position: static !important;
    box-shadow: none !important;
  }

  .content-container {
    padding: 0 !important;
  }

  /* Card and Tables */
  .card {
    border: none !important;
    box-shadow: none !important;
    margin: 0 !important;
    padding: 0 !important;
    background: transparent !important;
    overflow: visible !important;
    display: block !important;
  }

  .card-header {
    background: transparent !important;
    border: none !important;
    padding: 0 0 10px 0 !important;
    display: block !important;
    text-align: center !important;
  }

  .card-title {
    font-size: 13pt !important;
    font-weight: bold !important;
    color: #000000 !important;
    text-align: center !important;
    display: block !important;
  }

  .card-body {
    padding: 0 !important;
    overflow: visible !important;
    display: block !important;
  }

  .table-responsive {
    overflow: visible !important;
    width: 100% !important;
    display: block !important;
  }

  .table {
    display: table !important;
    width: 100% !important;
    border-collapse: collapse !important;
    font-size: 9pt !important;
    color: #000000 !important;
    margin-top: 0.5rem !important;
  }

  .table thead {
    display: table-header-group !important;
  }

  .table tbody {
    display: table-row-group !important;
  }

  .table tr {
    display: table-row !important;
    page-break-inside: avoid !important;
  }

  .table th, .table td {
    display: table-cell !important;
    border: 1px solid #000000 !important;
    padding: 5px 8px !important;
    background: #ffffff !important;
    color: #000000 !important;
    vertical-align: middle !important;
  }

  .table th {
    background-color: #f1f5f9 !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
    font-weight: bold !important;
  }

  .badge {
    border: 1px solid #64748b !important;
    color: #000000 !important;
    background: transparent !important;
    font-size: 8pt !important;
    padding: 2px 4px !important;
  }

  code {
    background: transparent !important;
    color: #000000 !important;
    font-weight: bold !important;
  }

  a {
    text-decoration: none !important;
    color: #000000 !important;
  }

  .print-only-kop img {
    max-width: 80px !important;
    max-height: 80px !important;
  }
}


