/* ==========================================================================
   SIPANDU WBP KALSEL - MODERN CLEAN & MINIMALIST THEME
   Rapi, Ringkas, dan Profesional (Executive Government Reporting Portal)
   ========================================================================== */

:root {
  --primary-navy: #071e3d;
  --secondary-navy: #0c2d54;
  --accent-gold: #f59e0b;
  --green-brand: #059669;
  --green-highlight: #00ff00;
  --red-highlight: #ff0000;
  
  --bg-app: #f1f5f9;
  --card-bg: #ffffff;
  --border-light: #e2e8f0;
  --border-input: #cbd5e1;
  --text-dark: #0f172a;
  --text-muted: #64748b;
  
  --slide-width: 1440px;
  --slide-height: 810px;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

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

body {
  font-family: var(--font-sans);
  background-color: var(--bg-app);
  color: var(--text-dark);
  min-height: 100vh;
  line-height: 1.4;
  -webkit-font-smoothing: antialiased;
}

/* ==========================================================================
   STICKY TOP NAVIGATION WRAPPER (COMPACT & RAPI)
   ========================================================================== */
.sticky-top-nav {
  position: sticky;
  top: 0;
  z-index: 1000;
  width: 100%;
  background: #ffffff;
  box-shadow: 0 4px 16px -2px rgba(0, 0, 0, 0.08), 0 1px 3px rgba(0, 0, 0, 0.05);
}

/* 1. Header Utama (Official Deep Navy) - Ringkas & Padat */
.app-header {
  background: linear-gradient(180deg, #071e3d 0%, #0c2d54 100%);
  color: #ffffff;
  padding: 10px 28px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 2px solid var(--accent-gold);
}

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

.app-logo {
  height: 42px;
  width: auto;
  object-fit: contain;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

.brand-text h1 {
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: 0.5px;
  color: #ffffff;
  line-height: 1.15;
}

.brand-text p {
  font-size: 0.72rem;
  color: #94a3b8;
  font-weight: 500;
  margin-top: 2px;
}

.btn-mobile-text,
.swipe-hint-pill {
  display: none;
}

/* Tombol Aksi Kanan Header */
.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn {
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: 6px;
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.btn-primary {
  background: linear-gradient(135deg, #00e676 0%, #00c853 100%);
  color: #064e3b;
  font-weight: 700;
  box-shadow: 0 2px 6px rgba(0, 200, 83, 0.25);
}

.btn-primary:hover {
  background: #00ff00;
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(0, 230, 118, 0.35);
}

.btn-secondary {
  background: #1e293b;
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.15);
}

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

.btn-outline-light {
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.btn-outline-light:hover {
  background: rgba(255, 255, 255, 0.16);
  border-color: rgba(255, 255, 255, 0.35);
}

/* 2. Control Strip / Bilah Kontrol 1 Baris Saja (Ultra Clean & Single Line) */
.control-strip {
  background: #ffffff;
  padding: 6px 28px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border-light);
  gap: 16px;
  height: 42px;
}

.control-left {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: nowrap;
}

.status-dot-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.74rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 12px;
  background: #ecfdf5;
  color: #059669;
  border: 1px solid #a7f3d0;
  white-space: nowrap;
}

.status-dot-pill .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background-color: #10b981;
  display: inline-block;
}

.status-dot-pill.loading {
  background: #fefce8;
  color: #ca8a04;
  border-color: #fde047;
}

.status-dot-pill.loading .dot {
  background-color: #eab308;
}

.status-dot-pill.error {
  background: #fef2f2;
  color: #dc2626;
  border-color: #fecaca;
}

.status-dot-pill.error .dot {
  background-color: #ef4444;
}

.filter-group {
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.filter-label {
  font-size: 0.76rem;
  font-weight: 600;
  color: #64748b;
  white-space: nowrap;
}

.form-select-clean {
  background: #f8fafc;
  border: 1px solid var(--border-input);
  border-radius: 6px;
  padding: 2px 8px;
  color: #0f172a;
  font-weight: 600;
  font-size: 0.76rem;
  cursor: pointer;
  outline: none;
  height: 28px;
  transition: all 0.15s;
  max-width: 240px;
}

.form-select-clean:hover {
  background: #ffffff;
  border-color: #94a3b8;
}

.form-select-clean:focus {
  border-color: #0284c7;
  background: #ffffff;
}

.cache-pill {
  font-size: 0.72rem;
  color: #475569;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  padding: 3px 8px;
  border-radius: 12px;
  font-weight: 600;
  white-space: nowrap;
}

.control-right {
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}

.date-toolbar {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #f8fafc;
  border: 1px solid var(--border-input);
  border-radius: 6px;
  padding: 2px 8px;
  height: 28px;
}

.date-toolbar input[type="text"] {
  border: none;
  background: transparent;
  font-size: 0.78rem;
  font-weight: 700;
  color: #0f172a;
  width: 185px;
  outline: none;
  text-transform: uppercase;
}

.btn-mini-today {
  background: #e2e8f0;
  color: #334155;
  border: none;
  border-radius: 4px;
  padding: 2px 8px;
  font-size: 0.7rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s;
}

.btn-mini-today:hover {
  background: #cbd5e1;
  color: #0f172a;
}

.chk-auto-label {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.72rem;
  font-weight: 600;
  color: #64748b;
  cursor: pointer;
  white-space: nowrap;
  user-select: none;
}

.chk-auto-label input[type="checkbox"] {
  accent-color: #059669;
  cursor: pointer;
}

/* 3. Slide Navigation Tabs - Sleek, Flat & Minimal */
.slide-nav-bar {
  background: #f1f5f9;
  display: flex;
  padding: 0 28px;
  overflow-x: auto;
  border-bottom: 1px solid var(--border-light);
  height: 38px;
  align-items: stretch;
  gap: 2px;
}

.nav-tab-item {
  padding: 0 16px;
  font-size: 0.78rem;
  font-weight: 600;
  color: #475569;
  border: none;
  background: transparent;
  cursor: pointer;
  white-space: nowrap;
  position: relative;
  transition: all 0.15s ease;
  height: 38px;
  border-bottom: 2px solid transparent;
  display: inline-flex;
  align-items: center;
}

.nav-tab-item:hover {
  color: #0f172a;
  background: rgba(255, 255, 255, 0.6);
}

.nav-tab-item.active {
  color: #071e3d;
  font-weight: 800;
  border-bottom-color: #f59e0b;
  background: #ffffff;
}

/* ==========================================================================
   MAIN VIEWPORT & SLIDES PRESENTATION CONTAINER
   ========================================================================== */
.main-viewport {
  padding: 28px 28px 80px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.slides-wrapper {
  display: flex;
  flex-direction: column;
  gap: 40px;
  width: 100%;
  max-width: var(--slide-width);
}

.slide-card-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
}

.slide-badge-title {
  align-self: flex-start;
  margin-bottom: 6px;
  font-size: 0.78rem;
  font-weight: 700;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

.slide-viewport-scaler {
  position: relative;
  width: var(--slide-width);
  height: var(--slide-height);
}

.btn-slide-zoom {
  display: none;
}

/* Single Slide Canvas 16:9 Landscape */
.slide-page {
  position: relative;
  width: var(--slide-width);
  height: var(--slide-height);
  background-color: #ffffff;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.12), 0 4px 10px -2px rgba(0, 0, 0, 0.05);
  border-radius: 6px;
  overflow: hidden;
  page-break-after: always;
  break-after: page;
}

/* Slide 1 Cover Specific */
.slide-cover {
  background-image: url('../assets/cover_template.png');
}

.cover-date-text {
  position: absolute;
  left: 122px;
  top: 618px;
  color: #ffffff;
  font-size: 32px;
  font-weight: 800;
  letter-spacing: 1px;
  text-transform: uppercase;
  font-family: inherit;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.8);
}

/* Slide 8 Closing Specific */
.slide-closing {
  background-image: url('../assets/closing.png');
}

/* Slide 2 to 7 Data Table Slides */
.slide-table-page {
  background-image: url('../assets/table_bg.jpg');
  padding: 38px 46px;
  display: flex;
  flex-direction: column;
}

.slide-title-bar {
  text-align: center;
  margin-bottom: 18px;
}

.slide-title-bar h2 {
  font-size: 28px;
  font-weight: 800;
  color: #111827;
  letter-spacing: 1px;
  text-transform: uppercase;
  margin: 0;
}

/* ==========================================================================
   DATA TABLE STYLES (MATCHING OFFICIAL REPORT 100%)
   ========================================================================== */
.table-container {
  width: 100%;
  flex: 1;
  display: flex;
  align-items: stretch;
}

.data-table {
  width: 100%;
  height: 100%;
  border-collapse: collapse;
  font-size: 11px;
  line-height: 1.1;
  font-family: Arial, Helvetica, sans-serif;
  color: #000000;
  background-color: #ffffff;
}

.data-table th, 
.data-table td {
  border: 1px solid #777777;
  padding: 3px 2px;
  text-align: center;
  vertical-align: middle;
}

.data-table th {
  background-color: #404040;
  color: #ffffff;
  font-weight: 700;
  text-transform: uppercase;
  font-size: 10px;
}

.data-table td.col-upt {
  text-align: left;
  padding-left: 6px;
  font-weight: 600;
  font-size: 10px;
  white-space: nowrap;
}

/* Highlight Colors Matching PDF */
.bg-lime {
  background-color: var(--green-highlight) !important;
  color: #000000 !important;
  font-weight: 700 !important;
}

.bg-red {
  background-color: var(--red-highlight) !important;
  color: #000000 !important;
  font-weight: 700 !important;
}

.row-jumlah td {
  background-color: var(--green-highlight) !important;
  color: #000000 !important;
  font-weight: 800 !important;
  font-size: 11px;
}

.row-jumlah td.col-label {
  text-align: center;
  font-weight: 800 !important;
}

/* ==========================================================================
   MODAL DIALOG (MODERN, CLEAN & BEST-PRACTICE SAAS THEME)
   ========================================================================== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(6px);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 10000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.modal-card {
  background: #ffffff;
  border-radius: 16px;
  width: 92%;
  max-width: 680px;
  box-shadow: 0 25px 50px -12px rgba(15, 23, 42, 0.25), 0 0 0 1px rgba(15, 23, 42, 0.08);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transform: translateY(8px) scale(0.98);
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-overlay.active .modal-card {
  transform: translateY(0) scale(1);
}

/* Modal Header */
.modal-header {
  padding: 16px 22px;
  background: linear-gradient(180deg, #071e3d 0%, #0c2d54 100%);
  color: #ffffff;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 2px solid var(--accent-gold);
}

.modal-title-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
}

.modal-title-icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
  flex-shrink: 0;
}

.modal-title-text h3 {
  font-size: 0.98rem;
  font-weight: 700;
  color: #ffffff;
  line-height: 1.2;
}

.modal-title-text p {
  font-size: 0.72rem;
  color: #94a3b8;
  margin-top: 2px;
}

.modal-close-btn {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #94a3b8;
  font-size: 1.25rem;
  cursor: pointer;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  transition: all 0.15s ease;
}

.modal-close-btn:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.3);
}

/* Modal Segmented Tabs */
.modal-tabs-bar {
  background: #f8fafc;
  padding: 10px 22px;
  border-bottom: 1px solid var(--border-light);
  display: flex;
  align-items: center;
}

.modal-tabs-nav {
  display: inline-flex;
  gap: 4px;
  background: #e2e8f0;
  padding: 3px;
  border-radius: 8px;
}

.modal-tab-btn {
  padding: 5px 14px;
  border-radius: 6px;
  border: none;
  background: transparent;
  color: #64748b;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.15s ease;
  user-select: none;
}

.modal-tab-btn:hover:not(.active) {
  color: #0f172a;
}

.modal-tab-btn.active {
  background: #ffffff;
  color: #071e3d;
  font-weight: 700;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.tab-pill-badge {
  background: #059669;
  color: #ffffff;
  font-size: 0.68rem;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 10px;
  line-height: 1.2;
}

/* Modal Body & Tab Panes */
.modal-body {
  padding: 20px 22px;
  max-height: 60vh;
  overflow-y: auto;
  color: #334155;
}

.modal-tab-pane {
  display: none;
}

.modal-tab-pane.active {
  display: block;
}

/* Tab 1: Document Cards List */
.doc-list-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.doc-list-info {
  font-size: 0.76rem;
  font-weight: 600;
  color: #64748b;
}

.btn-link-add {
  font-size: 0.76rem;
  font-weight: 700;
  color: #059669;
  background: none;
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: color 0.15s;
}

.btn-link-add:hover {
  color: #047857;
  text-decoration: underline;
}

.doc-cards-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.doc-card-item {
  border: 1px solid var(--border-light);
  border-radius: 10px;
  padding: 12px 14px;
  background: #ffffff;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  transition: all 0.15s ease;
}

.doc-card-item:hover {
  border-color: #cbd5e1;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.03);
}

.doc-card-item.is-active {
  border-color: #a7f3d0;
  background: #f0fdf4;
}

.doc-card-left {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  min-width: 0;
  flex: 1;
}

.doc-card-icon {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: #f1f5f9;
  color: #0c2d54;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  flex-shrink: 0;
  margin-top: 2px;
}

.doc-card-item.is-active .doc-card-icon {
  background: #dcfce7;
  color: #15803d;
}

.doc-card-details {
  min-width: 0;
  flex: 1;
}

.doc-card-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 4px;
}

.doc-card-name {
  font-size: 0.88rem;
  font-weight: 700;
  color: #0f172a;
}

.badge-tag {
  font-size: 0.68rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  white-space: nowrap;
}

.badge-tag-default {
  background: #fef3c7;
  color: #b45309;
  border: 1px solid #fde68a;
}

.badge-tag-active {
  background: #dcfce7;
  color: #15803d;
  border: 1px solid #bbf7d0;
}

.doc-card-submeta {
  font-size: 0.74rem;
  color: #64748b;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.doc-card-submeta code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  background: #f1f5f9;
  padding: 1px 5px;
  border-radius: 3px;
  font-size: 0.7rem;
  color: #334155;
}

.meta-link {
  color: #0284c7;
  text-decoration: none;
  font-weight: 600;
}

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

.doc-card-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.btn-card-use {
  padding: 5px 12px;
  font-size: 0.76rem;
  font-weight: 700;
  background: #0284c7;
  color: #ffffff;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-card-use:hover {
  background: #0369a1;
}

.btn-card-active-pill {
  padding: 4px 10px;
  font-size: 0.72rem;
  font-weight: 700;
  color: #15803d;
  background: #dcfce7;
  border: 1px solid #86efac;
  border-radius: 6px;
  cursor: default;
  display: inline-flex;
  align-items: center;
}

.btn-card-icon {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  border: 1px solid #e2e8f0;
  background: #f8fafc;
  color: #475569;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  transition: all 0.15s ease;
}

.btn-card-icon:hover {
  background: #e2e8f0;
  color: #0f172a;
}

.btn-card-icon.danger:hover {
  background: #fee2e2;
  color: #dc2626;
  border-color: #fca5a5;
}

.btn-card-action-text {
  padding: 4px 10px;
  border-radius: 6px;
  border: 1px solid #e2e8f0;
  background: #f8fafc;
  color: #334155;
  font-size: 0.74rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.btn-card-action-text:hover {
  background: #e2e8f0;
  color: #0f172a;
}

.btn-card-action-text.danger {
  color: #dc2626;
  border-color: #fecaca;
  background: #fef2f2;
}

.btn-card-action-text.danger:hover {
  background: #fee2e2;
  color: #b91c1c;
}

/* Tab 2: Modern Form */
.modern-form-wrap {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.banner-notice {
  display: flex;
  gap: 10px;
  padding: 10px 14px;
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-radius: 8px;
  color: #166534;
  font-size: 0.76rem;
  line-height: 1.45;
}

.banner-notice-badge {
  display: inline-block;
  font-size: 0.65rem;
  font-weight: 800;
  background: #166534;
  color: #ffffff;
  padding: 2px 6px;
  border-radius: 4px;
  letter-spacing: 0.5px;
  height: fit-content;
  flex-shrink: 0;
  margin-top: 2px;
}

.field-block {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.field-label {
  font-size: 0.78rem;
  font-weight: 700;
  color: #334155;
}

.required-star {
  color: #ef4444;
}

.field-input {
  background: #ffffff;
  border: 1px solid var(--border-input);
  border-radius: 6px;
  padding: 8px 12px;
  font-size: 0.82rem;
  color: #0f172a;
  font-family: inherit;
  outline: none;
  transition: all 0.15s ease;
}

.field-input:focus {
  border-color: #059669;
  box-shadow: 0 0 0 3px rgba(5, 150, 105, 0.12);
}

.field-hint {
  font-size: 0.7rem;
  color: #64748b;
}

.field-grid-two {
  display: grid;
  grid-template-columns: 3fr 2fr;
  gap: 12px;
  align-items: flex-start;
}

.switch-card {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border: 1px solid var(--border-input);
  border-radius: 6px;
  background: #f8fafc;
  cursor: pointer;
  user-select: none;
  height: 48px;
  box-sizing: border-box;
}

.switch-card:hover {
  background: #f1f5f9;
}

.switch-card input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: #059669;
  cursor: pointer;
  flex-shrink: 0;
}

.switch-card-text strong {
  display: block;
  font-size: 0.76rem;
  color: #0f172a;
}

.switch-card-text span {
  display: block;
  font-size: 0.68rem;
  color: #64748b;
  line-height: 1.2;
}

.form-submit-row {
  margin-top: 4px;
}

.btn-submit-modern {
  width: 100%;
  background: #059669;
  color: #ffffff;
  font-size: 0.84rem;
  font-weight: 700;
  padding: 9px 16px;
  border-radius: 6px;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.15s ease;
  box-shadow: 0 1px 3px rgba(5, 150, 105, 0.2);
}

.btn-submit-modern:hover {
  background: #047857;
  transform: translateY(-1px);
}

/* Modal Footer */
.modal-footer {
  padding: 12px 22px;
  background: #f8fafc;
  border-top: 1px solid var(--border-light);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.btn-footer-link {
  background: transparent;
  border: none;
  color: #64748b;
  font-size: 0.76rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: color 0.15s;
}

.btn-footer-link:hover {
  color: #0f172a;
  text-decoration: underline;
}

.btn-footer-secondary {
  background: #e2e8f0;
  color: #334155;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: 6px;
  border: none;
  cursor: pointer;
  transition: all 0.15s;
}

.btn-footer-secondary:hover {
  background: #cbd5e1;
  color: #0f172a;
}

/* ==========================================================================
   LOADING MODAL & FOOTER
   ========================================================================== */
.loading-modal {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.7);
  backdrop-filter: blur(4px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  z-index: 9999;
  color: #ffffff;
}

.loading-modal.hidden {
  display: none;
}

.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid rgba(255, 255, 255, 0.15);
  border-left-color: #00e676;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin-bottom: 12px;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.app-footer {
  background: #ffffff;
  border-top: 1px solid #e2e8f0;
  padding: 20px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

/* ==========================================================================
   RESPONSIVE DESIGN FOR TABLET & MOBILE PHONES (BEST PRACTICE UI/UX)
   ========================================================================== */

html, body {
  max-width: 100vw;
  overflow-x: hidden;
}

.sticky-top-nav {
  position: sticky;
  top: 0;
  z-index: 1000;
  width: 100%;
  max-width: 100vw;
  box-sizing: border-box;
}

/* --------------------------------------------------------------------------
   A. TABLET SCREENS (769px to 1200px)
   -------------------------------------------------------------------------- */
@media screen and (min-width: 769px) and (max-width: 1200px) {
  .main-viewport {
    padding: 20px 16px 60px;
    width: 100%;
    max-width: 100vw;
    box-sizing: border-box;
    overflow-x: hidden;
  }

  .slides-wrapper {
    width: 100%;
    max-width: 100%;
    gap: 24px;
  }

  /* All Slides 1-8 Full Proportional 16:9 Scaling on Tablet */
  .slide-card-container {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    margin-bottom: 0;
  }

  .slide-viewport-scaler {
    width: 100% !important;
    max-width: 100% !important;
    height: var(--slide-height-mobile, auto) !important;
    min-height: unset !important;
    max-height: unset !important;
    aspect-ratio: 16 / 9 !important;
    position: relative !important;
    overflow: hidden !important;
    border-radius: 8px !important;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08) !important;
    background: transparent !important;
  }

  .slide-viewport-scaler .slide-page {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 1440px !important;
    height: 810px !important;
    min-width: 1440px !important;
    min-height: 810px !important;
    transform-origin: 0 0 !important;
    transform: scale(var(--slide-scale, 0.5)) !important;
    margin: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
  }
}

/* --------------------------------------------------------------------------
   B. MOBILE PHONE SCREENS (max-width: 768px) - ULTRA COMPACT BEST PRACTICE
   -------------------------------------------------------------------------- */
@media screen and (max-width: 768px) {
  /* 1. Typography & Responsive Visibility */
  .btn-full-text {
    display: none !important;
  }

  .btn-mobile-text {
    display: inline-block !important;
  }

  .swipe-hint-pill {
    display: inline-flex !important;
    align-items: center !important;
    background: #e0f2fe !important;
    color: #0284c7 !important;
    font-size: 0.62rem !important;
    font-weight: 600 !important;
    padding: 2px 7px !important;
    border-radius: 9999px !important;
    margin-left: auto !important;
  }

  /* 2. Top App Bar - Mobile Best Practice (Foto 2 Official Identity + Clean Action Bar) */
  .app-header {
    height: auto !important;
    min-height: auto !important;
    padding: 9px 12px 10px 12px !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 8px !important;
    background: #0f172a !important;
    box-sizing: border-box !important;
    border-bottom: 2px solid var(--accent-gold) !important;
  }

  .brand-wrapper {
    display: flex !important;
    align-items: center !important;
    gap: 10px !important;
    width: 100% !important;
    min-width: 0 !important;
  }

  .app-logo {
    height: 38px !important;
    width: auto !important;
    flex-shrink: 0 !important;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.4)) !important;
  }

  .brand-text {
    min-width: 0 !important;
    flex: 1 1 auto !important;
  }

  .brand-text h1 {
    font-size: 0.84rem !important;
    font-weight: 800 !important;
    letter-spacing: 0.3px !important;
    color: #ffffff !important;
    line-height: 1.2 !important;
    margin: 0 !important;
    text-transform: uppercase !important;
  }

  .brand-text p {
    font-size: 0.60rem !important;
    color: #94a3b8 !important;
    font-weight: 500 !important;
    line-height: 1.25 !important;
    margin-top: 2px !important;
    letter-spacing: 0.2px !important;
    text-transform: uppercase !important;
  }

  .header-actions {
    display: flex !important;
    align-items: center !important;
    gap: 6px !important;
    width: 100% !important;
  }

  .header-actions .btn {
    flex: 1 1 0 !important;
    padding: 7px 6px !important;
    font-size: 0.74rem !important;
    font-weight: 600 !important;
    border-radius: 6px !important;
    height: 32px !important;
    box-sizing: border-box !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    text-align: center !important;
    white-space: nowrap !important;
  }

  .header-actions .btn-primary {
    padding: 7px 8px !important;
    font-weight: 700 !important;
    background: #059669 !important;
  }

  /* 3. Control Strip - Compact 2-Row Layout */
  .control-strip {
    height: auto !important;
    padding: 6px 10px !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 5px !important;
    background: #f8fafc !important;
    border-bottom: 1px solid #e2e8f0 !important;
    box-sizing: border-box !important;
  }

  .control-left {
    display: flex !important;
    align-items: center !important;
    gap: 6px !important;
    width: 100% !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
    scrollbar-width: none !important;
  }

  .control-left::-webkit-scrollbar {
    display: none !important;
  }

  .status-dot-pill {
    padding: 3px 7px !important;
    font-size: 0.68rem !important;
    max-width: 130px !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    flex-shrink: 0 !important;
  }

  .filter-group {
    display: flex !important;
    align-items: center !important;
    gap: 4px !important;
    flex: 1 1 auto !important;
    min-width: 110px !important;
  }

  .filter-label {
    font-size: 0.66rem !important;
    color: #64748b !important;
    white-space: nowrap !important;
    flex-shrink: 0 !important;
  }

  .form-select-clean {
    width: 100% !important;
    max-width: 100% !important;
    font-size: 0.7rem !important;
    height: 26px !important;
    padding: 0 4px !important;
    border-radius: 4px !important;
  }

  .cache-pill {
    display: none !important;
  }

  .control-right {
    width: 100% !important;
    box-sizing: border-box !important;
  }

  .date-toolbar {
    width: 100% !important;
    height: 28px !important;
    padding: 0 4px !important;
    display: flex !important;
    align-items: center !important;
    gap: 4px !important;
    box-sizing: border-box !important;
    background: #ffffff !important;
    border: 1px solid #cbd5e1 !important;
    border-radius: 5px !important;
  }

  .chk-auto-label {
    font-size: 0.66rem !important;
    flex-shrink: 0 !important;
    padding-left: 2px !important;
  }

  .date-toolbar input[type="text"] {
    flex: 1 !important;
    min-width: 0 !important;
    height: 24px !important;
    font-size: 0.7rem !important;
    padding: 0 4px !important;
    border: none !important;
    font-weight: 600 !important;
    color: #1e293b !important;
  }

  .btn-mini-today {
    font-size: 0.66rem !important;
    padding: 2px 7px !important;
    height: 22px !important;
    flex-shrink: 0 !important;
    background: #f1f5f9 !important;
    border: 1px solid #cbd5e1 !important;
    border-radius: 4px !important;
  }

  /* 4. Slide Navigation Bar - Momentum Scrollable */
  .slide-nav-bar {
    height: 36px !important;
    padding: 0 6px !important;
    display: flex !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
    scrollbar-width: none !important;
    background: #ffffff !important;
    border-bottom: 2px solid #e2e8f0 !important;
  }

  .slide-nav-bar::-webkit-scrollbar {
    display: none !important;
  }

  .nav-tab-item {
    height: 36px !important;
    padding: 0 10px !important;
    font-size: 0.72rem !important;
    font-weight: 600 !important;
    white-space: nowrap !important;
    flex-shrink: 0 !important;
  }

  /* 5. Main Viewport & Presentation Canvas */
  .main-viewport {
    padding: 12px 8px 40px !important;
    width: 100% !important;
    max-width: 100vw !important;
    overflow-x: hidden !important;
    box-sizing: border-box !important;
  }

  .slides-wrapper {
    width: 100% !important;
    max-width: 100% !important;
    gap: 16px !important;
  }

  /* Slide Card Container */
  .slide-card-container {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    overflow: visible !important;
    background: transparent !important;
    box-shadow: none !important;
    border: none !important;
    padding: 0 !important;
    margin-bottom: 0 !important;
  }

  .slide-badge-title {
    width: 100% !important;
    box-sizing: border-box !important;
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    padding: 4px 2px !important;
    margin-bottom: 6px !important;
    font-size: 0.7rem !important;
    font-weight: 700 !important;
    color: #64748b !important;
    background: transparent !important;
    border: none !important;
  }

  .slide-badge-label {
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    margin-right: 6px !important;
  }

  .btn-slide-zoom {
    display: inline-flex !important;
    align-items: center !important;
    gap: 3px !important;
    padding: 3px 8px !important;
    font-size: 0.64rem !important;
    font-weight: 700 !important;
    color: #0284c7 !important;
    background: #e0f2fe !important;
    border: 1px solid #bae6fd !important;
    border-radius: 9999px !important;
    cursor: pointer !important;
    flex-shrink: 0 !important;
  }

  .btn-slide-zoom:hover {
    background: #bae6fd !important;
  }

  /* =========================================================================
     SLIDE VIEWPORT SCALER (16:9 PROPORTION MATCHING SLIDE 1 ON MOBILE)
     Semua slide 1 s.d. 8 pas 16:9 di layar HP tanpa overflow horizontal
     ========================================================================= */
  .slide-viewport-scaler {
    width: 100% !important;
    max-width: 100% !important;
    height: var(--slide-height-mobile, auto) !important;
    min-height: unset !important;
    max-height: unset !important;
    aspect-ratio: 16 / 9 !important;
    position: relative !important;
    overflow: hidden !important;
    border-radius: 8px !important;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.08) !important;
    background: transparent !important;
    cursor: pointer !important;
    -webkit-tap-highlight-color: transparent !important;
  }

  .slide-viewport-scaler .slide-page {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 1440px !important;
    height: 810px !important;
    min-width: 1440px !important;
    min-height: 810px !important;
    transform-origin: 0 0 !important;
    transform: scale(var(--slide-scale, 0.26)) !important;
    margin: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    pointer-events: auto !important;
  }

  /* Dynamic Date text on Slide 1 */
  .cover-date-text {
    position: absolute !important;
    left: 122px !important;
    top: 618px !important;
    font-size: 32px !important;
    line-height: 1 !important;
  }

  /* 6. Modal Dialog Mobile */
  .modal-card {
    width: 95% !important;
    max-height: 92vh !important;
    border-radius: 12px !important;
  }

  .modal-header {
    padding: 12px 14px !important;
  }

  .modal-title-text h3 {
    font-size: 0.88rem !important;
  }

  .modal-title-text p {
    font-size: 0.66rem !important;
  }

  .modal-tabs-bar {
    padding: 8px 12px !important;
  }

  .modal-tab-btn {
    font-size: 0.72rem !important;
    padding: 4px 10px !important;
  }

  .modal-body {
    padding: 12px 14px !important;
    max-height: 60vh !important;
  }

  .doc-card-item {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 8px !important;
    padding: 10px 12px !important;
  }

  .doc-card-actions {
    justify-content: flex-end !important;
    border-top: 1px solid #f1f5f9 !important;
    padding-top: 8px !important;
    width: 100% !important;
  }

  .field-grid-two {
    grid-template-columns: 1fr !important;
    gap: 8px !important;
  }

  .modal-footer {
    padding: 10px 14px !important;
    flex-direction: column-reverse !important;
    gap: 8px !important;
    align-items: stretch !important;
  }

  .btn-footer-link,
  .btn-footer-secondary {
    justify-content: center !important;
    text-align: center !important;
    width: 100% !important;
  }
}

/* ==========================================================================
   SLIDE ZOOM MODAL (HIGH RESOLUTION LIGHTBOX VIEWER)
   ========================================================================== */
.slide-zoom-modal {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px;
}

.slide-zoom-modal.hidden {
  display: none !important;
}

.slide-zoom-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(4px);
}

.slide-zoom-wrapper {
  position: relative;
  z-index: 2001;
  background: #ffffff;
  border-radius: 12px;
  width: 98vw;
  max-width: 1480px;
  height: 94vh;
  max-height: 94vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.35);
}

.slide-zoom-header {
  padding: 10px 16px;
  background: #0f172a;
  color: #ffffff;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 2px solid var(--accent-gold);
  flex-shrink: 0;
}

.slide-zoom-title-area h3 {
  font-size: 0.92rem;
  font-weight: 800;
  color: #ffffff;
  margin: 0;
}

.slide-zoom-title-area p {
  font-size: 0.68rem;
  color: #94a3b8;
  margin: 2px 0 0 0;
}

.btn-zoom-close {
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.2);
  width: 32px;
  height: 32px;
  border-radius: 6px;
  font-size: 1.2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-zoom-close:hover {
  background: rgba(239, 68, 68, 0.8);
  border-color: #ef4444;
}

.slide-zoom-body {
  flex: 1;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  padding: 14px;
  background: #f1f5f9;
  display: flex;
  align-items: flex-start;
  justify-content: flex-start;
}

.slide-zoom-content {
  margin: auto;
}

.slide-zoom-content .slide-page {
  width: 1440px !important;
  height: 810px !important;
  min-width: 1440px !important;
  min-height: 810px !important;
  transform: none !important;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.18) !important;
  border-radius: 8px !important;
  position: relative !important;
}

.slide-zoom-footer {
  padding: 8px 16px;
  background: #ffffff;
  border-top: 1px solid #e2e8f0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-shrink: 0;
}

.btn-zoom-nav {
  padding: 5px 12px;
  font-size: 0.72rem;
  font-weight: 600;
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  color: #1e293b;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-zoom-nav:hover {
  background: #e2e8f0;
}

.zoom-counter {
  font-size: 0.74rem;
  font-weight: 700;
  color: #64748b;
}

body.modal-open {
  overflow: hidden !important;
}

/* Toast notifikasi unduhan PDF (Non-intrusive mobile toast) */
.pdf-download-toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: #0f172a;
  color: #ffffff;
  padding: 12px 20px;
  border-radius: 8px;
  border-left: 4px solid #10b981;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.4);
  z-index: 10000;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.85rem;
  max-width: 90%;
  box-sizing: border-box;
  animation: toastFadeIn 0.3s ease;
}

.pdf-download-toast a {
  color: #34d399;
  font-weight: 700;
  text-decoration: underline;
}

@keyframes toastFadeIn {
  from { opacity: 0; transform: translate(-50%, 15px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}

/* ==========================================================================
   PRINT / PDF EXPORT CSS (EXACT DIMENSION 1440x810 LANDSCAPE)
   ========================================================================== */
@media print {
  @page {
    size: landscape;
    margin: 0;
  }
  
  html, body {
    margin: 0 !important;
    padding: 0 !important;
    width: 1440px !important;
    height: auto !important;
    background: #ffffff !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
    color-adjust: exact !important;
  }
  
  .no-print,
  .sticky-top-nav,
  .app-header,
  .control-strip,
  .slide-nav-bar,
  .slide-badge-title,
  .btn-slide-zoom,
  .slide-zoom-modal,
  .loading-modal,
  .modal-modern,
  .pdf-download-toast,
  .app-footer {
    display: none !important;
  }
  
  .main-viewport {
    padding: 0 !important;
    margin: 0 !important;
    width: 1440px !important;
    display: block !important;
  }
  
  .slides-wrapper {
    gap: 0 !important;
    width: 1440px !important;
    max-width: 1440px !important;
    display: block !important;
  }
  
  .slide-card-container {
    margin: 0 !important;
    padding: 0 !important;
    display: block !important;
  }
  
  .slide-viewport-scaler {
    width: 1440px !important;
    height: 810px !important;
    max-width: 1440px !important;
    max-height: 810px !important;
    margin: 0 !important;
    padding: 0 !important;
    display: block !important;
    transform: none !important;
    overflow: visible !important;
    box-shadow: none !important;
    border-radius: 0 !important;
    aspect-ratio: auto !important;
  }

  .slide-page {
    position: relative !important;
    width: 1440px !important;
    height: 810px !important;
    max-width: 1440px !important;
    max-height: 810px !important;
    box-shadow: none !important;
    border-radius: 0 !important;
    page-break-after: always !important;
    page-break-inside: avoid !important;
    break-after: page !important;
    break-inside: avoid !important;
    margin: 0 !important;
    overflow: hidden !important;
    display: flex !important;
    background-size: cover !important;
    background-position: center !important;
    transform: none !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }
  
  .slide-page:last-child {
    page-break-after: auto !important;
    break-after: auto !important;
  }
}
