/* ==========================================================================
   KAS TK AR-ROHMANIYAH - Modern & Playful Kindergarten Design System
   ========================================================================== */

:root {
  /* Color Tokens */
  --bg-main: #fcf9f2;
  --bg-card: #ffffff;
  --text-main: #2d3748;
  --text-muted: #718096;
  
  /* Primary & Accent Colors */
  --color-orange: #f97316;
  --color-orange-light: #fff7ed;
  --color-teal: #0d9488;
  --color-teal-light: #f0fdfa;
  --color-green: #10b981;
  --color-green-light: #ecfdf5;
  --color-purple: #8b5cf6;
  --color-purple-light: #f5f3ff;
  --color-red: #ef4444;
  --color-red-light: #fef2f2;
  
  /* Paper Card Theme (Matching Uploaded Image) */
  --paper-bg: #fffdfa;
  --paper-border: #333333;
  --paper-title-orange: #e67e22;
  --paper-sub-teal: #16a085;
  
  /* UI Elements */
  --border-radius-sm: 8px;
  --border-radius: 14px;
  --border-radius-lg: 20px;
  --box-shadow-subtle: 0 4px 20px rgba(0, 0, 0, 0.05);
  --box-shadow-hover: 0 8px 30px rgba(0, 0, 0, 0.1);
  --transition-fast: 0.2s ease;
}

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

body {
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  background-color: var(--bg-main);
  color: var(--text-main);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ==========================================================================
   Header & Navigation
   ========================================================================== */

.app-header {
  background-color: #ffffff;
  border-bottom: 2px solid #f1f5f9;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 10px rgba(0,0,0,0.03);
}

.header-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 12px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-icon {
  width: 46px;
  height: 46px;
  background: linear-gradient(135deg, var(--color-orange), #fb923c);
  color: white;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  box-shadow: 0 4px 12px rgba(249, 115, 22, 0.3);
}

.brand-title {
  font-family: 'Fredoka', cursive;
  font-size: 1.35rem;
  font-weight: 700;
  color: #1e293b;
  letter-spacing: 0.5px;
}

.brand-subtitle {
  font-size: 0.82rem;
  color: var(--text-muted);
  font-weight: 500;
}

/* Navigation Tabs */
.nav-tabs {
  display: flex;
  gap: 6px;
  background-color: #f8fafc;
  padding: 5px;
  border-radius: 12px;
  border: 1px solid #e2e8f0;
}

.nav-btn {
  border: none;
  background: transparent;
  padding: 8px 16px;
  border-radius: 9px;
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  color: #64748b;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: var(--transition-fast);
}

.nav-btn:hover {
  color: var(--color-orange);
  background-color: rgba(249, 115, 22, 0.05);
}

.nav-btn.active {
  background-color: #ffffff;
  color: var(--color-orange);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

/* Role Toggle Badge & Button */
.role-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  background-color: var(--color-orange-light);
  border: 1.5px solid var(--color-orange);
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--color-orange);
  cursor: pointer;
  user-select: none;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  position: relative;
  z-index: 10;
}

.role-badge:hover {
  transform: scale(1.04);
  box-shadow: 0 3px 12px rgba(249, 115, 22, 0.25);
}

.role-indicator {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background-color: var(--color-orange);
  display: inline-block;
  box-shadow: 0 0 8px var(--color-orange);
}

.btn-outline-role {
  background: white;
  border: 1px solid var(--color-orange);
  color: var(--color-orange);
  padding: 4px 10px;
  border-radius: 8px;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  pointer-events: auto;
}

.btn-outline-role:hover {
  background: var(--color-orange);
  color: white;
}

/* ==========================================================================
   Main Content Layout
   ========================================================================== */

.main-content {
  max-width: 1200px;
  width: 100%;
  margin: 24px auto;
  padding: 0 24px;
  flex: 1;
}

.tab-pane {
  display: none;
}

.tab-pane.active {
  display: block;
  animation: fadeIn 0.3s ease;
}

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

@media (max-width: 768px) {
  .header-container {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
    padding: 12px 15px;
  }

  .brand {
    flex-direction: column;
    justify-content: center;
    text-align: center;
    width: 100%;
    gap: 4px;
  }

  .brand-title {
    font-size: 1.15rem;
    white-space: normal;
    word-wrap: break-word;
    line-height: 1.2;
  }
  
  .brand-subtitle {
    white-space: normal;
    word-wrap: break-word;
    font-size: 0.75rem;
  }

  .mobile-menu-btn {
    display: block !important;
    width: 100%;
    padding: 10px;
    background: white;
    border: 1.5px solid #cbd5e1;
    border-radius: 8px;
    font-weight: 700;
    color: var(--color-orange);
    margin-bottom: 4px;
    cursor: pointer;
  }

  .nav-tabs {
    display: none; /* hidden by default, toggled by JS */
    flex-direction: column;
    width: 100%;
    white-space: normal;
    padding: 8px;
    gap: 8px;
  }
  
  .nav-tabs.show {
    display: flex;
  }

  .nav-btn {
    width: 100%;
    text-align: left;
    padding: 10px 14px;
    font-size: 0.95rem;
  }

  .role-badge {
    align-self: center;
    width: auto;
    justify-content: center;
    padding: 4px 12px;
    font-size: 0.78rem;
  }

  .card-toolbar {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }

  .student-select-group {
    flex-direction: column;
    align-items: stretch;
    width: 100%;
  }

  .student-select-group .form-select,
  .student-select-group .btn {
    width: 100% !important;
    box-sizing: border-box;
  }

  .action-buttons {
    flex-direction: column;
    width: 100%;
  }

  .action-buttons .btn {
    width: 100% !important;
  }

  .digital-card {
    padding: 16px 12px;
    border-radius: 16px;
  }

  .card-head {
    flex-direction: column;
    text-align: center;
    gap: 10px;
  }

  .card-titles h2 {
    font-size: 1.1rem;
  }

  .card-titles h3 {
    font-size: 0.95rem;
  }

  .student-meta {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .bca-info-banner {
    flex-direction: column;
    text-align: center;
    align-items: center;
  }

  .card-table th, .card-table td {
    padding: 8px 6px;
    font-size: 0.78rem;
  }

  .modal-box {
    width: 92% !important;
    padding: 18px 15px !important;
    max-height: 90vh;
    overflow-y: auto;
  }

  .card-paper-wrapper {
    padding: 0;
    margin: 0 -15px; /* Pull out of section padding */
  }

  .card-paper {
    padding: 12px 4px;
    border-radius: 0;
    border: none;
    box-shadow: none;
    width: 100vw;
  }
  
  .card-decor {
    display: none; /* Hide background decorative images on mobile to avoid covering content */
  }

  .card-header-art {
    flex-direction: column;
    gap: 8px;
    margin-bottom: 12px;
  }

  .avatar-img-art {
    width: 65px;
    height: 65px;
  }

  .card-main-title {
    font-size: 1.15rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .card-school-name {
    font-size: 0.85rem;
  }

  .sub-header-tag {
    font-size: 0.8rem;
  }

  .card-meta-bar {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    font-size: 0.9rem;
    padding: 8px 12px;
  }

  .meta-value {
    min-width: 0;
    flex: 1;
    text-align: right;
  }

  .kas-table th, .kas-table td {
    padding: 8px 6px;
    font-size: 0.78rem;
    border-width: 1px;
    white-space: nowrap;
  }
  
  .kas-table th {
    font-size: 0.78rem;
    letter-spacing: -0.5px;
  }
  
  .month-cell {
    padding-left: 6px !important;
  }

  .status-badge, .paraf-stamp {
    font-size: 0.7rem;
    padding: 4px 8px;
    white-space: nowrap;
    display: inline-block;
  }

  /* Force table to expand inside table-responsive so it can be swiped */
  .kas-table {
    min-width: 500px;
    table-layout: auto !important;
  }

  .card-footer-info {
    flex-direction: column;
    align-items: center;
    gap: 16px;
    text-align: center;
    margin-top: 16px;
    padding-top: 12px;
  }

  .footer-note {
    max-width: 100%;
    font-size: 0.7rem;
  }

  .matrix-table th, .matrix-table td {
    padding: 6px 4px;
    font-size: 0.75rem;
  }

  .sticky-col {
    min-width: 110px;
    font-size: 0.7rem;
    padding: 6px 4px !important;
  }
  
  .gallery-grid {
    grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
    gap: 8px;
  }
}

/* ==========================================================================
   Card Toolbar Controls
   ========================================================================== */

.card-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 16px;
}

.student-select-group {
  display: flex;
  align-items: center;
  gap: 12px;
}

.student-select-group label {
  font-weight: 700;
  color: #334155;
  font-size: 0.95rem;
}

.form-select, .form-control {
  padding: 9px 14px;
  border: 1.5px solid #cbd5e1;
  border-radius: var(--border-radius-sm);
  font-family: inherit;
  font-size: 0.9rem;
  outline: none;
  transition: var(--transition-fast);
  background-color: white;
}

.form-select:focus, .form-control:focus {
  border-color: var(--color-orange);
  box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.15);
}

.action-buttons {
  display: flex;
  gap: 10px;
}

/* Buttons */
.btn {
  padding: 10px 18px;
  border-radius: var(--border-radius-sm);
  font-family: inherit;
  font-weight: 600;
  font-size: 0.88rem;
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: var(--transition-fast);
}

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

.btn-primary:hover {
  background-color: #ea580c;
  box-shadow: 0 4px 12px rgba(234, 88, 12, 0.25);
}

.btn-secondary {
  background-color: #475569;
  color: white;
}

.btn-secondary:hover {
  background-color: #334155;
}

.btn-success {
  background-color: #16a34a;
  color: white;
}

.btn-success:hover {
  background-color: #15803d;
}

.btn-outline {
  background-color: white;
  border: 1.5px solid #cbd5e1;
  color: #475569;
}

.btn-outline:hover {
  border-color: var(--color-orange);
  color: var(--color-orange);
}

.btn-block {
  width: 100%;
  justify-content: center;
}

.btn-sm {
  padding: 4px 10px;
  font-size: 0.8rem;
}

/* ==========================================================================
   DIGITAL KARTU PEMBAYARAN (EXACT MATCH FOR UPLOADED IMAGE DESIGN)
   ========================================================================== */

.card-paper-wrapper {
  display: flex;
  justify-content: center;
}

.card-paper {
  background-color: #fffbf4;
  background-image: radial-gradient(#e5e7eb 1px, transparent 1px);
  background-size: 16px 16px;
  width: 100%;
  max-width: 680px;
  border: 3px solid #2d2d2d;
  border-radius: 18px;
  padding: 32px;
  position: relative;
  box-shadow: 0 12px 35px rgba(0, 0, 0, 0.08);
  overflow: hidden;
}

/* Decorative background elements */
.card-decor {
  position: absolute;
  pointer-events: none;
  opacity: 0.35;
}

.star-top-left {
  top: 15px;
  left: 20px;
  font-size: 1.8rem;
  color: #f59e0b;
}

.star-top-right {
  top: 12px;
  right: 180px;
  font-size: 2rem;
  color: #eab308;
}

.number-123 {
  right: 15px;
  top: 180px;
  font-family: 'Fredoka', cursive;
  font-size: 2.2rem;
  font-weight: 700;
  color: #ec4899;
}

.magnifying {
  left: 15px;
  bottom: 120px;
  font-size: 2.5rem;
  color: #fb923c;
  transform: rotate(-15deg);
}

/* Card Header Artwork */
.card-header-art {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  text-align: center;
}

.avatar-img-art {
  width: 90px;
  height: 90px;
  object-fit: contain;
}

.card-title-block {
  flex: 1;
  padding: 0 10px;
}

.sub-header-tag {
  font-family: 'Fredoka', cursive;
  font-size: 1.4rem;
  color: #e67e22;
  font-weight: 600;
  display: block;
}

.card-main-title {
  font-family: 'Fredoka', cursive;
  font-size: 2.3rem;
  font-weight: 700;
  color: #d97706;
  line-height: 1.1;
  letter-spacing: 1px;
}

.card-school-name {
  font-family: 'Fredoka', cursive;
  font-size: 1.5rem;
  color: #ea580c;
  font-weight: 600;
  margin-top: 4px;
}

/* Metadata Row */
.card-meta-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  padding: 10px 16px;
  background-color: rgba(255, 255, 255, 0.85);
  border-radius: 10px;
  border: 1.5px solid #2d2d2d;
  font-size: 1.05rem;
  font-weight: 700;
}

.meta-field {
  display: flex;
  align-items: center;
  gap: 8px;
}

.meta-label {
  color: #1e293b;
}

.meta-value {
  color: #0f172a;
  border-bottom: 2px solid #0f172a;
  padding: 0 12px;
  min-width: 140px;
  display: inline-block;
}

/* Progress bar inside card */
.card-progress-bar-container {
  margin-bottom: 16px;
  background: white;
  padding: 10px 14px;
  border-radius: 10px;
  border: 1.5px solid #cbd5e1;
}

.progress-info {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  margin-bottom: 6px;
  color: #475569;
}

.progress-track {
  height: 8px;
  background: #e2e8f0;
  border-radius: 4px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #f97316, #10b981);
  transition: width 0.4s ease;
}

/* Table Style matching printed paper */
.table-responsive {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin-bottom: 10px;
}

.kas-table {
  width: 100%;
  border-collapse: collapse;
  background-color: white;
  border: 2px solid #2d2d2d;
  table-layout: fixed; /* Ensures columns respect width */
}

.kas-table th, .kas-table td {
  border: 1.5px solid #2d2d2d;
  padding: 9px 10px;
  text-align: center;
  font-size: 0.95rem;
}

.kas-table th {
  background-color: #f8fafc;
  font-weight: 700;
  color: #0f172a;
  font-size: 0.9rem;
}

.kas-table tr:nth-child(even) {
  background-color: #fafafa;
}

.month-cell {
  font-weight: 600;
  text-align: left !important;
  padding-left: 16px !important;
}

.amount-cell {
  font-weight: 700;
  color: #334155;
}

/* Payment Status Badges & Paraf */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.15s ease;
}

.status-badge:hover {
  transform: scale(1.05);
}

.status-lunas {
  background-color: #dcfce7;
  color: #15803d;
  border: 1px solid #86efac;
}

.status-belum {
  background-color: #fee2e2;
  color: #b91c1c;
  border: 1px solid #fca5a5;
}

.paraf-stamp {
  font-family: 'Fredoka', cursive;
  color: #0284c7;
  font-weight: 700;
  font-size: 0.88rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

/* Card Footer */
.card-footer-info {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1.5px dashed #cbd5e1;
}

.footer-note {
  max-width: 60%;
  font-size: 0.78rem;
  color: #64748b;
  line-height: 1.4;
}

.footer-signature {
  text-align: center;
}

.sig-stamp {
  margin-bottom: 6px;
}

.stamp-circle {
  border: 2px dashed #0284c7;
  color: #0284c7;
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 0.72rem;
  font-weight: 800;
  display: inline-block;
  transform: rotate(-4deg);
}

.sig-label {
  font-size: 0.8rem;
  color: #475569;
  font-weight: 600;
}

.sig-name {
  font-size: 0.88rem;
  font-weight: 700;
  color: #0f172a;
  margin-top: 28px;
}

/* ==========================================================================
   REKAP KELAS (SUMMARY & MATRIX)
   ========================================================================== */

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  background: white;
  border-radius: var(--border-radius);
  padding: 18px;
  display: flex;
  align-items: center;
  gap: 16px;
  box-shadow: var(--box-shadow-subtle);
  border: 1px solid #f1f5f9;
}

.stat-icon {
  width: 50px;
  height: 50px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
}

.bg-orange .stat-icon { background: var(--color-orange-light); color: var(--color-orange); }
.bg-teal .stat-icon { background: var(--color-teal-light); color: var(--color-teal); }
.bg-green .stat-icon { background: var(--color-green-light); color: var(--color-green); }
.bg-purple .stat-icon { background: var(--color-purple-light); color: var(--color-purple); }

.stat-content h3 {
  font-size: 0.82rem;
  color: var(--text-muted);
  font-weight: 600;

}

.stat-number {
  font-size: 1.35rem;
  font-weight: 800;
  color: #0f172a;
  line-height: 1.2;
  margin: 2px 0;
}

.stat-sub {
  font-size: 0.75rem;
  color: #94a3b8;
}

/* Section Cards */
.section-card {
  background: white;
  border-radius: var(--border-radius);
  padding: 24px;
  box-shadow: var(--box-shadow-subtle);
  border: 1px solid #f1f5f9;
  margin-bottom: 24px;
}

.section-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 18px;
  flex-wrap: wrap;
  gap: 12px;
}

.section-card-header h2 {
  font-size: 1.2rem;
  font-weight: 700;
  color: #1e293b;
  display: flex;
  align-items: center;
  gap: 10px;
}

.filter-bar {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.search-input-group {
  position: relative;
  flex: 1;
  min-width: 240px;
}

.search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: #94a3b8;
}

.search-input-group .form-control {
  padding-left: 36px;
  width: 100%;
}

.filter-status-group {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.88rem;
  font-weight: 600;
}

/* Matrix Table */
.matrix-table-container {
  max-height: 520px;
  overflow-y: auto;
}

.matrix-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 0.85rem;
}

.matrix-table th, .matrix-table td {
  padding: 10px 8px;
  text-align: center;
  border-bottom: 1px solid #f1f5f9;
  border-right: 1px solid #f8fafc;
}

.matrix-table th {
  background-color: #f8fafc;
  position: sticky;
  top: 0;
  z-index: 10;
  font-weight: 700;
  color: #475569;
}

.sticky-col {
  position: sticky;
  left: 0;
  background-color: white !important;
  z-index: 11;
  text-align: left !important;
  font-weight: 700;
  min-width: 160px;
  box-shadow: 2px 0 5px rgba(0,0,0,0.03);
}

.matrix-table th.sticky-col {
  z-index: 12;
  background-color: #f8fafc !important;
}

.dot-status {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.65rem;
  cursor: pointer;
}

.dot-lunas { background-color: #10b981; color: white; }
.dot-belum { background-color: #cbd5e1; color: #64748b; }

/* ==========================================================================
   PENGELUARAN & WA TOOLS
   ========================================================================== */

.two-column-layout {
  display: grid;
  grid-template-columns: 340px 1fr;
  gap: 24px;
}

@media (max-width: 850px) {
  .two-column-layout {
    grid-template-columns: 1fr;
  }
}

.form-group {
  margin-bottom: 14px;
}

.form-group label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 4px;
  color: #334155;
}

.form-control, .form-select {
  width: 100%;
}

.badge {
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 0.78rem;
  font-weight: 700;
}

.badge-info { background: #e0f2fe; color: #0369a1; }
.badge-warning { background: #fef3c7; color: #b45309; }

.wa-generator-grid {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 20px;
}

@media (max-width: 768px) {
  .wa-generator-grid { grid-template-columns: 1fr; }
}

.wa-preset-select {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.wa-textarea {
  font-family: monospace;
  font-size: 0.9rem;
  line-height: 1.5;
  background-color: #f8fafc;
  resize: vertical;
}

.wa-action-row {
  display: flex;
  gap: 12px;
  margin-top: 14px;
}

.color-whatsapp { color: #25d366; }

/* ==========================================================================
   MODAL WINDOWS & TOASTS
   ========================================================================== */

.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(15, 23, 42, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-box {
  background: white;
  width: 90%;
  max-width: 480px;
  border-radius: var(--border-radius);
  box-shadow: var(--box-shadow-hover);
  overflow: hidden;
  animation: modalSlide 0.3s ease;
}

@keyframes modalSlide {
  from { transform: translateY(20px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.modal-header {
  padding: 16px 20px;
  background-color: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-header h3 {
  font-size: 1.05rem;
  color: #1e293b;
}

.close-modal-btn {
  background: none;
  border: none;
  font-size: 1.5rem;
  color: #94a3b8;
  cursor: pointer;
}

.modal-body {
  padding: 20px;
}

.modal-info-box {
  background: var(--color-orange-light);
  border-left: 4px solid var(--color-orange);
  padding: 10px 14px;
  border-radius: 6px;
  font-size: 0.88rem;
  margin-bottom: 16px;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 20px;
}

/* Toast Notifications */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.toast {
  background: #1e293b;
  color: white;
  padding: 12px 20px;
  border-radius: var(--border-radius-sm);
  font-size: 0.88rem;
  box-shadow: var(--box-shadow-hover);
  display: flex;
  align-items: center;
  gap: 10px;
  animation: toastIn 0.3s ease;
}

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

/* Photo Thumbnails in Tables & Cards */
.photo-preview-group {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.thumb-img {
  width: 44px;
  height: 44px;
  object-fit: cover;
  border-radius: 8px;
  border: 1.5px solid #cbd5e1;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.thumb-img:hover {
  transform: scale(1.15);
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  border-color: var(--color-orange);
}

.btn-view-all-photos {
  background: var(--color-orange-light);
  color: var(--color-orange);
  border: 1px dashed var(--color-orange);
  padding: 4px 8px;
  border-radius: 8px;
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.btn-view-all-photos:hover {
  background: var(--color-orange);
  color: white;
}

/* Modal Large & Gallery Grid */
.modal-box.modal-lg {
  max-width: 720px;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 14px;
  max-height: 520px;
  overflow-y: auto;
  padding: 4px;
}

.gallery-item {
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  border: 1.5px solid #e2e8f0;
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
  background: #f8fafc;
}

.gallery-img {
  width: 100%;
  height: 140px;
  object-fit: cover;
  display: block;
  cursor: pointer;
  transition: transform 0.25s ease;
}

.gallery-img:hover {
  transform: scale(1.05);
}

.gallery-caption {
  padding: 6px 10px;
  font-size: 0.75rem;
  font-weight: 600;
  color: #475569;
  background: white;
  text-align: center;
  border-top: 1px solid #f1f5f9;
}

/* ==========================================================================
   PRINT STYLESHEET (FOR CLEAN PHYSICAL PAPER PRINTING)
   ========================================================================== */

@media print {
  body {
    background: white;
    color: black;
  }

  .app-header, .card-toolbar, .nav-tabs, .modal-overlay, .toast-container {
    display: none !important;
  }

  .main-content {
    margin: 0;
    padding: 0;
    max-width: 100%;
  }

  .tab-pane {
    display: block !important;
  }

  #tab-rekap, #tab-pengeluaran, #tab-wa-tools {
    display: none !important;
  }

  .card-paper-wrapper {
    margin: 0;
    padding: 0;
  }

  .card-paper {
    box-shadow: none !important;
    border: 2px solid black !important;
    width: 100% !important;
    max-width: 100% !important;
    padding: 20px !important;
    page-break-inside: avoid;
  }

  .card-progress-bar-container {
    display: none !important;
  }
}
