/* ==========================================================================
   AGENDA SURAT MASUK POLSEK BAROS - ULTRA ELEGANT WEB APP STYLESHEET
   Supports: Dark Theme (Default) & Light Theme, Ultra Mobile Responsive,
   Touch-Optimized UI, PWA, and Kedinasan Legal/Folio Print Stylesheet.
   ========================================================================== */

:root {
  /* Dark Navy Theme (Default) */
  --bg-app: #070d19;
  --bg-header: rgba(11, 19, 43, 0.92);
  --bg-card: rgba(22, 33, 62, 0.75);
  --bg-card-hover: rgba(30, 45, 80, 0.85);
  --bg-input: #0f1c35;
  --bg-modal: #0d172a;
  --bg-modal-overlay: rgba(3, 7, 18, 0.78);
  --border-color: rgba(255, 255, 255, 0.08);
  --border-highlight: #d97706;
  
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  
  --accent-gold: #f59e0b;
  --accent-gold-hover: #d97706;
  --accent-blue: #3b82f6;
  --accent-blue-hover: #2563eb;
  --accent-emerald: #10b981;
  --accent-rose: #ef4444;
  
  --badge-warning-bg: rgba(245, 158, 11, 0.15);
  --badge-warning-text: #fbbf24;
  --badge-success-bg: rgba(16, 185, 129, 0.15);
  --badge-success-text: #34d399;
  --badge-info-bg: rgba(59, 130, 246, 0.15);
  --badge-info-text: #60a5fa;

  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.25);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 16px 36px rgba(0, 0, 0, 0.45);
  
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-full: 9999px;
  
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --transition: all 0.22s cubic-bezier(0.4, 0, 0.2, 1);
}

[data-theme="light"] {
  --bg-app: #f1f5f9;
  --bg-header: rgba(255, 255, 255, 0.94);
  --bg-card: rgba(255, 255, 255, 0.9);
  --bg-card-hover: #ffffff;
  --bg-input: #ffffff;
  --bg-modal: #ffffff;
  --bg-modal-overlay: rgba(15, 23, 42, 0.6);
  --border-color: #cbd5e1;
  --border-highlight: #0f2c59;
  
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #94a3b8;
  
  --accent-gold: #d97706;
  --accent-gold-hover: #b45309;
  --accent-blue: #0f2c59;
  --accent-blue-hover: #1e3a8a;
  --accent-emerald: #059669;
  --accent-rose: #dc2626;

  --badge-warning-bg: #fef3c7;
  --badge-warning-text: #b45309;
  --badge-success-bg: #d1fae5;
  --badge-success-text: #065f46;
  --badge-info-bg: #e0f2fe;
  --badge-info-text: #0369a1;

  --shadow-sm: 0 2px 6px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 6px 18px rgba(0, 0, 0, 0.09);
  --shadow-lg: 0 12px 30px rgba(0, 0, 0, 0.12);
}

/* ==========================================================================
   RESET & DASAR
   ========================================================================== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

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

body {
  font-family: var(--font-sans);
  background-color: var(--bg-app);
  color: var(--text-primary);
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  padding-bottom: 76px; /* Space for mobile nav */
}

@media (min-width: 768px) {
  body {
    padding-bottom: 24px;
  }
}

a {
  color: var(--accent-blue);
  text-decoration: none;
}

/* ==========================================================================
   HEADER DINAS & NAVIGASI
   ========================================================================== */
.app-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--bg-header);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
}

.header-container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 10px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

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

.brand-logo {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  object-fit: contain;
  background: rgba(255, 255, 255, 0.05);
  padding: 2px;
  border: 1px solid var(--border-color);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.brand-titles {
  display: flex;
  flex-direction: column;
}

.brand-main {
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: 0.3px;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 6px;
}

.brand-sub {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--accent-gold);
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.tailscale-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.3);
  color: #34d399;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  cursor: pointer;
}

.tailscale-badge .pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 8px #10b981;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% { transform: scale(0.95); opacity: 0.8; }
  50% { transform: scale(1.2); opacity: 1; }
  100% { transform: scale(0.95); opacity: 0.8; }
}

.btn-icon {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-md);
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
  font-size: 1.1rem;
}

.btn-icon:hover {
  background: var(--bg-card-hover);
  border-color: var(--accent-gold);
}

/* ==========================================================================
   KONTEN UTAMA & CONTAINER
   ========================================================================== */
.main-container {
  max-width: 1280px;
  width: 100%;
  margin: 0 auto;
  padding: 16px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* Jam Digital & Banner Tanggal */
.clock-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  padding: 8px 16px;
  border-radius: var(--radius-md);
  font-size: 0.82rem;
  color: var(--text-secondary);
}

.clock-banner .clock-time {
  font-weight: 700;
  color: var(--accent-gold);
}

/* Grid Kartu Metrik / Statistik */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

@media (min-width: 768px) {
  .stats-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
  }
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  padding: 14px;
  border-radius: var(--radius-lg);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  gap: 12px;
  transition: var(--transition);
  box-shadow: var(--shadow-sm);
}

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

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

.stat-icon.blue { background: rgba(59, 130, 246, 0.15); color: #60a5fa; }
.stat-icon.amber { background: rgba(245, 158, 11, 0.15); color: #fbbf24; }
.stat-icon.emerald { background: rgba(16, 185, 129, 0.15); color: #34d399; }
.stat-icon.purple { background: rgba(168, 85, 247, 0.15); color: #c084fc; }

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

.stat-label {
  font-size: 0.75rem;
  color: var(--text-secondary);
  font-weight: 500;
  text-transform: uppercase;
}

.stat-value {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1.2;
}

/* ==========================================================================
   TOOLBAR PENCARIAN, FILTER & AKSI
   ========================================================================== */
.toolbar-section {
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  padding: 12px 16px;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

@media (min-width: 768px) {
  .toolbar-section {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }
}

.search-box {
  position: relative;
  flex: 1;
  max-width: 480px;
}

.search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 1rem;
}

.search-input {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  padding: 10px 14px 10px 40px;
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  outline: none;
  transition: var(--transition);
}

.search-input:focus {
  border-color: var(--accent-gold);
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.2);
}

.filter-group {
  display: flex;
  align-items: center;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 2px;
}

.btn-filter {
  background: transparent;
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  padding: 6px 12px;
  border-radius: var(--radius-md);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: var(--transition);
}

.btn-filter:hover,
.btn-filter.active {
  background: var(--accent-gold);
  color: #ffffff;
  border-color: var(--accent-gold);
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: linear-gradient(135deg, #d97706 0%, #b45309 100%);
  border: 1px solid #92400e;
  color: #ffffff;
  padding: 9px 18px;
  border-radius: var(--radius-md);
  font-weight: 700;
  font-size: 0.9rem;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(217, 119, 6, 0.35);
  transition: var(--transition);
  white-space: nowrap;
}

.btn-primary:hover {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(245, 158, 11, 0.45);
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  padding: 8px 14px;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
  transition: var(--transition);
}

.btn-secondary:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-highlight);
}

/* ==========================================================================
   TAMPILAN DATA (MOBILE CARDS & DESKTOP TABLE)
   ========================================================================== */
.data-view-container {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* Mobile Cards View (Tampil default pada layar kecil) */
.mobile-cards-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

@media (min-width: 1024px) {
  .mobile-cards-list {
    display: none;
  }
}

.letter-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
  backdrop-filter: blur(8px);
}

.letter-card:hover {
  border-color: var(--accent-gold);
}

.card-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  padding-bottom: 8px;
}

.agenda-pill {
  background: var(--badge-info-bg);
  color: var(--badge-info-text);
  font-weight: 800;
  font-size: 0.8rem;
  padding: 3px 10px;
  border-radius: var(--radius-full);
}

.date-text {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.card-sender-title {
  font-weight: 800;
  font-size: 1.05rem;
  color: var(--text-primary);
  line-height: 1.3;
}

.card-subject {
  font-size: 0.88rem;
  color: var(--text-secondary);
  line-height: 1.4;
}

.card-meta-box {
  background: rgba(0, 0, 0, 0.15);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  font-size: 0.8rem;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.meta-item {
  display: flex;
  gap: 6px;
  color: var(--text-muted);
}

.meta-item strong {
  color: var(--text-secondary);
  min-width: 80px;
}

.card-disposisi-box {
  border-left: 3px solid var(--accent-gold);
  background: rgba(245, 158, 11, 0.06);
  padding: 8px 12px;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-size: 0.84rem;
}

.dispo-tag {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--accent-gold);
  margin-bottom: 2px;
}

.card-actions-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding-top: 6px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.action-btn-group {
  display: flex;
  gap: 6px;
}

.btn-action-small {
  padding: 7px 12px;
  font-size: 0.8rem;
  font-weight: 700;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  background: var(--bg-input);
  color: var(--text-primary);
  display: inline-flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  transition: var(--transition);
}

.btn-action-small:hover {
  background: var(--bg-card-hover);
}

.btn-action-small.primary {
  background: var(--accent-gold);
  border-color: var(--accent-gold-hover);
  color: #ffffff;
}

.btn-action-small.success {
  background: #059669;
  border-color: #047857;
  color: #ffffff;
}

/* Desktop Table View */
.desktop-table-card {
  display: none;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

@media (min-width: 1024px) {
  .desktop-table-card {
    display: block;
  }
}

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

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

.custom-table th {
  background: rgba(0, 0, 0, 0.25);
  color: var(--accent-gold);
  font-weight: 700;
  padding: 12px 14px;
  text-transform: uppercase;
  font-size: 0.76rem;
  letter-spacing: 0.5px;
  border-bottom: 1px solid var(--border-color);
  white-space: nowrap;
}

.custom-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-secondary);
  vertical-align: middle;
}

.custom-table tbody tr:hover {
  background: var(--bg-card-hover);
}

.custom-table tbody tr:hover td {
  color: var(--text-primary);
}

/* ==========================================================================
   KONTROL PAGINASI DESKTOP & LAZY LOAD MOBILE
   ========================================================================== */
.desktop-pagination-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 18px;
  border-top: 1px solid var(--border-color);
  background: rgba(0, 0, 0, 0.12);
  flex-wrap: wrap;
  gap: 12px;
}

[data-theme="light"] .desktop-pagination-bar {
  background: rgba(241, 245, 249, 0.7);
}

.pagination-info {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.pagination-size-picker {
  display: flex;
  align-items: center;
  gap: 6px;
}

.pagination-select {
  background: var(--bg-input);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 4px 8px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  outline: none;
  transition: var(--transition);
}

.pagination-select:hover,
.pagination-select:focus {
  border-color: var(--accent-gold);
}

.pagination-nav {
  display: flex;
  align-items: center;
  gap: 4px;
}

.btn-page {
  min-width: 32px;
  height: 32px;
  padding: 0 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 700;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  background: var(--bg-card);
  color: var(--text-secondary);
  cursor: pointer;
  transition: var(--transition);
  user-select: none;
}

.btn-page:hover:not(:disabled) {
  background: var(--bg-card-hover);
  color: var(--accent-gold);
  border-color: var(--accent-gold);
}

.btn-page.active {
  background: var(--accent-gold);
  color: #ffffff;
  border-color: var(--accent-gold);
  box-shadow: 0 2px 8px rgba(217, 119, 6, 0.4);
}

.btn-page:disabled {
  opacity: 0.35;
  cursor: not-allowed;
  border-color: transparent;
}

.pagination-ellipsis {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 32px;
  font-size: 0.8rem;
  color: var(--text-muted);
  user-select: none;
}

/* Mobile Lazy Loading */
.mobile-load-more-container {
  padding: 8px 0 16px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.btn-mobile-load-more {
  width: 100%;
  padding: 12px 18px;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(217, 119, 6, 0.4);
  background: linear-gradient(135deg, rgba(217, 119, 6, 0.12) 0%, rgba(180, 83, 9, 0.22) 100%);
  color: var(--accent-gold);
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 3px 12px rgba(0, 0, 0, 0.15);
  transition: var(--transition);
}

.btn-mobile-load-more:active {
  transform: scale(0.98);
}

.btn-mobile-load-more:hover {
  background: linear-gradient(135deg, rgba(217, 119, 6, 0.22) 0%, rgba(180, 83, 9, 0.32) 100%);
  border-color: var(--accent-gold);
}

.mobile-load-counter {
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(217, 119, 6, 0.4);
  padding: 2px 10px;
  border-radius: var(--radius-full);
  font-size: 0.74rem;
  font-weight: 800;
  color: #ffffff;
}

[data-theme="light"] .mobile-load-counter {
  background: rgba(217, 119, 6, 0.15);
  color: #b45309;
}

.mobile-all-loaded-text {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-weight: 600;
  padding: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.badge-status {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: var(--radius-full);
  font-size: 0.74rem;
  font-weight: 700;
}

.badge-status.warning {
  background: var(--badge-warning-bg);
  color: var(--badge-warning-text);
}

.badge-status.success {
  background: var(--badge-success-bg);
  color: var(--badge-success-text);
}

/* Kategori Surat Badges (Internal / Eksternal) */
.badge-category {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: var(--radius-full);
  font-size: 0.73rem;
  font-weight: 700;
  white-space: nowrap;
}

.badge-category.internal {
  background: rgba(37, 99, 235, 0.18);
  color: #60a5fa;
  border: 1px solid rgba(59, 130, 246, 0.4);
}

.badge-category.eksternal {
  background: rgba(16, 185, 129, 0.18);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.4);
}

/* JRA Retensi Badges */
.badge-jra {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 7px;
  border-radius: var(--radius-full);
  font-size: 0.71rem;
  font-weight: 700;
  white-space: nowrap;
}

.badge-jra.aktif {
  background: rgba(16, 185, 129, 0.16);
  color: #10b981;
  border: 1px solid rgba(16, 185, 129, 0.35);
}

.badge-jra.inaktif {
  background: rgba(245, 158, 11, 0.16);
  color: #f59e0b;
  border: 1px solid rgba(245, 158, 11, 0.35);
}

/* Category Radio Selector in Modal Form */
.category-radio-group {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 4px;
}

@media (max-width: 480px) {
  .category-radio-group {
    grid-template-columns: 1fr;
  }
}

.category-radio-card {
  display: block;
  position: relative;
  cursor: pointer;
  margin: 0;
}

.category-radio-card input[type="radio"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.category-radio-content {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  border: 1.5px solid var(--border-color);
  background: var(--bg-input);
  transition: all 0.2s ease;
}

.category-radio-card .cat-icon {
  font-size: 1.4rem;
  line-height: 1;
}

.category-radio-card .cat-title {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: 0.3px;
}

.category-radio-card .cat-desc {
  font-size: 0.70rem;
  color: var(--text-muted);
  line-height: 1.2;
  margin-top: 2px;
}

.category-radio-card.internal input[type="radio"]:checked + .category-radio-content {
  border-color: #3b82f6;
  background: rgba(59, 130, 246, 0.15);
  box-shadow: 0 0 0 1px #3b82f6;
}

.category-radio-card.internal input[type="radio"]:checked + .category-radio-content .cat-title {
  color: #60a5fa;
}

.category-radio-card.eksternal input[type="radio"]:checked + .category-radio-content {
  border-color: #10b981;
  background: rgba(16, 185, 129, 0.15);
  box-shadow: 0 0 0 1px #10b981;
}

.category-radio-card.eksternal input[type="radio"]:checked + .category-radio-content .cat-title {
  color: #34d399;
}

/* ==========================================================================
   MOBILE BOTTOM NAVIGATION & FLOATING ACTION BUTTON (FAB)
   ========================================================================== */
.mobile-bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 64px;
  background: var(--bg-header);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-top: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-around;
  z-index: 90;
  box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.25);
}

@media (min-width: 768px) {
  .mobile-bottom-nav {
    display: none;
  }
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  color: var(--text-muted);
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
  padding: 6px 12px;
  border-radius: var(--radius-md);
  transition: var(--transition);
  background: transparent;
  border: none;
}

.nav-item.active,
.nav-item:hover {
  color: var(--accent-gold);
}

.nav-item .nav-icon {
  font-size: 1.25rem;
}

.fab-btn {
  position: fixed;
  bottom: 78px;
  right: 18px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  color: #ffffff;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.7rem;
  box-shadow: 0 6px 20px rgba(245, 158, 11, 0.5);
  cursor: pointer;
  z-index: 80;
  transition: var(--transition);
}

.fab-btn:active {
  transform: scale(0.92);
}

@media (min-width: 768px) {
  .fab-btn {
    display: none;
  }
}

/* ==========================================================================
   MODAL DIALOG (BOTTOM SHEET DI MOBILE / CENTER DI DESKTOP)
   ========================================================================== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: var(--bg-modal-overlay);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 100;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

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

.modal-dialog {
  width: 100%;
  max-width: 680px;
  background: var(--bg-modal);
  border-top: 1px solid var(--border-color);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  box-shadow: var(--shadow-lg);
  max-height: 92vh;
  display: flex;
  flex-direction: column;
  transform: translateY(100%);
  transition: transform 0.28s cubic-bezier(0.33, 1, 0.68, 1);
  overflow: hidden;
}

.modal-overlay.active .modal-dialog {
  transform: translateY(0);
}

@media (min-width: 768px) {
  .modal-overlay {
    align-items: center;
    padding: 20px;
  }

  .modal-dialog {
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    transform: scale(0.95);
    max-height: 88vh;
  }

  .modal-overlay.active .modal-dialog {
    transform: scale(1);
  }
}

.modal-header {
  padding: 14px 18px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(0, 0, 0, 0.1);
}

.modal-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-close-modal {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1.4rem;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  transition: var(--transition);
}

.btn-close-modal:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.08);
}

.modal-body {
  padding: 16px 18px;
  overflow-y: auto;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 14px;
  -webkit-overflow-scrolling: touch;
}

.modal-footer {
  padding: 12px 18px;
  border-top: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  background: rgba(0, 0, 0, 0.08);
}

/* Form Styles dalam Modal */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.form-label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.form-control {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  padding: 9px 12px;
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  outline: none;
  font-family: inherit;
  transition: var(--transition);
}

.form-control:focus {
  border-color: var(--accent-gold);
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.2);
}

textarea.form-control {
  resize: vertical;
  min-height: 80px;
}

.input-with-button {
  display: flex;
  gap: 6px;
}

.input-with-button .form-control {
  flex: 1;
}

.grid-2-col {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

@media (min-width: 600px) {
  .grid-2-col {
    grid-template-columns: 1fr 1fr;
  }
}

/* Checkbox Grid Diteruskan */
.checkbox-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  background: rgba(0, 0, 0, 0.15);
  padding: 12px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
}

@media (min-width: 600px) {
  .checkbox-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.custom-checkbox {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
  color: var(--text-primary);
  cursor: pointer;
  user-select: none;
}

.custom-checkbox input {
  width: 16px;
  height: 16px;
  accent-color: var(--accent-gold);
  cursor: pointer;
}

/* Styling untuk 23 Butir Checklist Disposisi */
.badge-count {
  font-size: 0.74rem;
  color: var(--accent-gold);
  font-weight: 700;
  background: rgba(234, 179, 8, 0.12);
  padding: 2px 8px;
  border-radius: var(--radius-full);
  border: 1px solid rgba(234, 179, 8, 0.3);
}

.dispo-checkbox-wrapper {
  background: rgba(0, 0, 0, 0.18);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 10px;
}

.btn-clear-dispo {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 4px;
  transition: all 0.2s ease;
}

.btn-clear-dispo:hover {
  color: #ef4444;
  background: rgba(239, 68, 68, 0.1);
}

.dispo-grid-container {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 6px;
  max-height: 200px;
  overflow-y: auto;
  padding-right: 4px;
}

@media (min-width: 650px) {
  .dispo-grid-container {
    grid-template-columns: repeat(3, 1fr);
  }
}

.dispo-check-item {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 8px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.07);
  font-size: 0.76rem;
  color: var(--text-primary);
  cursor: pointer;
  user-select: none;
  transition: all 0.15s ease;
}

.dispo-check-item:hover {
  background: rgba(255, 255, 255, 0.07);
  border-color: rgba(255, 255, 255, 0.2);
}

.dispo-check-item.active {
  background: rgba(59, 130, 246, 0.2);
  border-color: #3b82f6;
  color: #93c5fa;
  font-weight: 700;
}

.dispo-check-item input[type="checkbox"] {
  width: 15px;
  height: 15px;
  accent-color: var(--accent-gold);
  cursor: pointer;
  flex-shrink: 0;
}

/* File Upload Dropzone */
.dropzone-box {
  border: 2px dashed var(--border-color);
  border-radius: var(--radius-md);
  padding: 16px;
  text-align: center;
  background: rgba(0, 0, 0, 0.08);
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.dropzone-box:hover {
  border-color: var(--accent-gold);
  background: rgba(245, 158, 11, 0.05);
}

.dropzone-icon {
  font-size: 1.8rem;
  color: var(--accent-gold);
}

/* Multi-File Image Thumbnails & Preview */
#multi-file-preview-container {
  background: rgba(0, 0, 0, 0.12);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 10px 12px;
}

#multi-file-thumbnails {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding: 6px 2px;
  scrollbar-width: thin;
}

.multi-thumb-card {
  position: relative;
  width: 80px;
  height: 105px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  overflow: hidden;
  background: var(--bg-card);
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-sm);
  transition: transform 0.15s ease;
}

.multi-thumb-card:hover {
  transform: translateY(-2px);
  border-color: var(--accent-gold);
}

.multi-thumb-card img {
  width: 100%;
  height: 80px;
  object-fit: cover;
  background: #111;
}

.multi-thumb-card .thumb-badge {
  font-size: 0.65rem;
  font-weight: 700;
  text-align: center;
  background: rgba(15, 23, 42, 0.85);
  color: var(--accent-gold);
  padding: 3px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.multi-thumb-card .thumb-del-btn {
  position: absolute;
  top: 3px;
  right: 3px;
  background: rgba(225, 29, 72, 0.92);
  color: white;
  border: none;
  border-radius: 50%;
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 0.75rem;
  font-weight: bold;
  line-height: 1;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.5);
  transition: background 0.15s;
}

.multi-thumb-card .thumb-del-btn:hover {
  background: #be123c;
  transform: scale(1.1);
}

/* ==========================================================================
   KEDINASAN PRINT PREVIEW (LEMBAR DISPOSISI DINAS POLRI)
   Menggunakan format standar Legal / Folio (8.5 x 14 inci) 2 disposisi per lembar
   dengan TERIMA TGL : 08 September 2026 yang sejajar rapi
   ========================================================================== */
.print-dialog-responsive {
  max-width: 860px;
  width: 100%;
}

/* Toolbar Pengontrol Skala & Zoom Pratinjau Dokumen */
.preview-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 14px;
  background: rgba(15, 23, 42, 0.95);
  border-bottom: 1px solid var(--border-color);
  gap: 8px;
  flex-shrink: 0;
  z-index: 10;
}

.preview-toolbar-left,
.preview-toolbar-right {
  display: flex;
  align-items: center;
  gap: 6px;
}

.btn-preview-tool {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: var(--text-primary);
  font-size: 0.78rem;
  font-weight: 600;
  padding: 5px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: all 0.15s ease;
  user-select: none;
}

.btn-preview-tool:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.3);
}

.btn-preview-tool.active {
  background: rgba(59, 130, 246, 0.25);
  border-color: #3b82f6;
  color: #60a5fa;
  font-weight: 700;
}

.btn-preview-tool.icon-only {
  padding: 5px 8px;
  font-size: 0.85rem;
}

.preview-zoom-badge {
  font-family: 'Consolas', monospace;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--accent-gold);
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.3);
  padding: 3px 8px;
  border-radius: var(--radius-full);
}

.print-modal-body {
  background: #383b40 !important;
  padding: 12px !important;
  overflow-y: auto !important;
  overflow-x: hidden !important;
  display: block !important;
  -webkit-overflow-scrolling: touch;
}

.print-viewport-wrapper {
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  overflow-x: auto;
  overflow-y: visible;
  -webkit-overflow-scrolling: touch;
  padding: 4px 0;
  box-sizing: border-box;
}

.disposisi-print-container {
  width: 760px;
  min-width: 760px;
  max-width: 760px;
  margin: 0 auto;
  background: #ffffff;
  color: #000000;
  padding: 16px 20px;
  font-family: Arial, Helvetica, sans-serif;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  border-radius: 4px;
  transform-origin: top center;
  transition: transform 0.15s ease-out;
  box-sizing: border-box;
}

.print-block {
  padding: 10px 14px;
  margin-bottom: 16px;
  page-break-inside: avoid;
  font-size: 9.5pt;
  background: #ffffff;
  color: #000000;
}

.print-kop {
  font-weight: bold;
  font-size: 9.5pt;
  line-height: 1.25;
  margin-bottom: 6px;
  color: #000000;
}

.print-title {
  text-align: center;
  font-weight: bold;
  font-size: 13pt;
  margin: 6px 0 10px 0;
  letter-spacing: 0.5px;
  color: #000000;
}

.print-table-agenda {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 4px;
}

.print-table-agenda td {
  border: 1px solid #000000;
  padding: 4px 6px;
  font-weight: bold;
  font-size: 9pt;
  vertical-align: middle;
  color: #000000;
}

.print-table-main {
  width: 100%;
  border-collapse: collapse;
}

.print-table-main th,
.print-table-main td {
  border: 1px solid #000000;
  padding: 4px 6px;
  vertical-align: top;
  font-size: 8.5pt;
  color: #000000;
}

.print-table-main th {
  text-align: center;
  font-weight: bold;
  font-size: 9pt;
  background-color: #f8f8f8;
}

/* Tabel Checklist ISI DISPOSISI (23 Butir Kedinasan) */
.nested-table-dispo {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 4px;
}

.nested-table-dispo td {
  border: 1px solid #000000 !important;
  padding: 1px 3px;
  font-size: 7.5pt;
  line-height: 1.15;
  color: #000000;
}

.nested-table-dispo .chk-cell {
  width: 16px;
  min-width: 16px;
  max-width: 16px;
  text-align: center;
  font-weight: bold;
  font-size: 8pt;
  padding: 0;
  vertical-align: middle;
}

.nested-table-dispo .item-label {
  font-weight: bold;
  color: #000000;
  letter-spacing: 0.15px;
  vertical-align: middle;
}

/* Tabel Checklist Unit DITERUSKAN (12 Unit Kerja) */
.nested-table-unit {
  width: 100%;
  border-collapse: collapse;
  margin: 3px 0;
}

.nested-table-unit td {
  border: 1px solid #000000 !important;
  padding: 1.5px 3px;
  font-size: 7.5pt;
  line-height: 1.15;
  color: #000000;
}

.nested-table-unit .chk-cell {
  width: 16px;
  min-width: 16px;
  max-width: 16px;
  text-align: center;
  font-weight: bold;
  font-size: 8pt;
  padding: 0;
  vertical-align: middle;
}

.nested-table-unit .unit-label {
  font-weight: bold;
  color: #000000;
  vertical-align: middle;
}

.disposisi-custom-text {
  font-weight: bold;
  font-size: 8.5pt;
  line-height: 1.3;
  color: #000000;
  margin-top: 4px;
  padding-top: 2px;
  word-break: break-word;
}

.keterangan-text {
  font-size: 8.5pt;
  line-height: 1.3;
  color: #000000;
  word-break: break-word;
}

.dit-text-item {
  font-size: 8.5pt;
  font-weight: normal;
  line-height: 1.3;
  color: #000000;
}

.print-cut-line {
  text-align: center;
  border-top: 1px dashed #444444;
  margin: 14px 0;
  padding-top: 3px;
  font-size: 8pt;
  color: #444444;
  font-style: italic;
  letter-spacing: 1px;
}

/* Badge Pilihan Cepat 23 Butir Disposisi */
.dispo-item-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 8px;
  font-size: 0.72rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  cursor: pointer;
  user-select: none;
  transition: all 0.2s ease;
}

.dispo-item-badge:hover {
  border-color: var(--accent-blue);
  color: var(--text-primary);
  transform: translateY(-1px);
}

.dispo-item-badge.active {
  background: rgba(59, 130, 246, 0.2);
  border-color: #3b82f6;
  color: #60a5fa;
  font-weight: bold;
}

/* ==========================================================================
   PORTAL LOGIN CYBER PRESISI ULTRA CANGGIH & ULTRA ELEGAN
   ========================================================================== */
.cyber-portal-overlay {
  position: fixed;
  inset: 0;
  z-index: 99999;
  background: radial-gradient(circle at center, #0a1128 0%, #030712 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: max(20px, env(safe-area-inset-top)) 16px max(20px, env(safe-area-inset-bottom)) 16px;
  overflow-y: auto;
  overflow-x: hidden;
  transition: opacity 0.5s ease, transform 0.5s cubic-bezier(0.16, 1, 0.3, 1), filter 0.5s ease;
  -webkit-overflow-scrolling: touch;
}

.cyber-portal-overlay.unlocked {
  opacity: 0;
  transform: scale(1.05);
  filter: blur(12px);
  pointer-events: none;
}

#cyber-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
}

.portal-top-bar {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 760px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  padding: 0 4px;
  flex-shrink: 0;
}

.system-status-indicator {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(6, 182, 212, 0.1);
  border: 1px solid rgba(6, 182, 212, 0.3);
  padding: 5px 12px;
  border-radius: var(--radius-full);
}

.status-pulse-dot {
  width: 7px;
  height: 7px;
  background: #06b6d4;
  border-radius: 50%;
  box-shadow: 0 0 8px #06b6d4;
  animation: pulse-dot 1.5s infinite;
}

.status-text {
  font-family: 'Consolas', 'Courier New', monospace;
  font-size: 0.68rem;
  font-weight: 700;
  color: #38bdf8;
  letter-spacing: 0.8px;
}

.btn-sound-toggle {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #e2e8f0;
  padding: 5px 12px;
  border-radius: var(--radius-full);
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: var(--transition);
}

.btn-sound-toggle:hover {
  background: rgba(217, 119, 6, 0.2);
  border-color: var(--accent-gold);
  color: #fbbf24;
}

/* SHIELD CARD UTAMA - DESKTOP 2-COLUMN SPLIT CONSOLE */
.cyber-shield-card {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 760px;
  background: rgba(11, 20, 42, 0.92);
  backdrop-filter: blur(28px) saturate(190%);
  -webkit-backdrop-filter: blur(28px) saturate(190%);
  border: 1px solid rgba(217, 119, 6, 0.45);
  border-radius: 24px;
  padding: 24px 28px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.85),
              0 0 35px rgba(217, 119, 6, 0.15),
              inset 0 0 25px rgba(6, 182, 212, 0.08);
  margin: auto;
  display: grid;
  grid-template-columns: 290px 1fr;
  gap: 28px;
  align-items: center;
  transition: var(--transition);
}

/* KOLOM KIRI: IDENTITAS KEDINASAN & HOLOGRAM */
.shield-col-left {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding-right: 22px;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
}

.logo-hologram-wrap {
  position: relative;
  width: 74px;
  height: 74px;
  margin: 0 auto 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.cyber-brand-logo {
  width: 58px;
  height: 58px;
  object-fit: contain;
  position: relative;
  z-index: 2;
  filter: drop-shadow(0 0 12px rgba(217, 119, 6, 0.65));
  animation: logo-float 4s ease-in-out infinite alternate;
}

@keyframes logo-float {
  0% { transform: translateY(0px) rotate(0deg); }
  100% { transform: translateY(-4px) rotate(1deg); }
}

.hologram-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 2px dashed rgba(6, 182, 212, 0.5);
  animation: rotate-hologram 12s linear infinite;
}

.hologram-ring.outer {
  inset: -6px;
  border: 1px solid rgba(217, 119, 6, 0.4);
  animation: rotate-hologram 8s linear infinite reverse;
}

@keyframes rotate-hologram {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.portal-title {
  font-size: 1.08rem;
  font-weight: 800;
  letter-spacing: 0.8px;
  color: #ffffff;
  margin: 0 0 4px;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.6);
}

.portal-subtitle {
  font-size: 0.74rem;
  color: var(--accent-gold);
  font-weight: 700;
  letter-spacing: 0.6px;
  margin-bottom: 10px;
}

.clearance-clock-row {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  margin-bottom: 12px;
}

.clearance-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  background: rgba(217, 119, 6, 0.15);
  border: 1px solid rgba(217, 119, 6, 0.4);
  border-radius: 99px;
  font-size: 0.68rem;
  font-weight: 800;
  color: #fbbf24;
  letter-spacing: 0.6px;
}

.portal-clock-time {
  font-family: 'Consolas', 'Courier New', monospace;
  font-size: 0.76rem;
  font-weight: 700;
  color: #38bdf8;
  letter-spacing: 1px;
}

.shield-cyber-specs {
  width: 100%;
  background: rgba(0, 0, 0, 0.28);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: var(--radius-md);
  padding: 8px 12px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  font-family: 'Consolas', 'Courier New', monospace;
  font-size: 0.68rem;
  text-align: left;
}

.spec-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.spec-tag {
  color: #64748b;
  font-weight: 700;
}

.spec-val {
  color: #cbd5e1;
  font-weight: 600;
}

/* KOLOM KANAN: FORMULIR AUTENTIKASI */
.shield-col-right {
  display: flex;
  flex-direction: column;
}

/* HEADER KEDINASAN AUTENTIKASI NRP */
.auth-header-badge {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: linear-gradient(135deg, rgba(217, 119, 6, 0.25) 0%, rgba(15, 23, 42, 0.7) 100%);
  border: 1px solid rgba(217, 119, 6, 0.5);
  border-radius: var(--radius-lg);
  padding: 9px 16px;
  margin-bottom: 14px;
  color: #fbbf24;
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.8px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.3);
}

.auth-header-badge .badge-icon {
  font-size: 1.15rem;
}

.auth-panel {
  display: block;
  animation: fadeInPanel 0.3s ease;
}

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

.nrp-instruction,
.biometric-instruction {
  font-size: 0.74rem;
  color: var(--text-secondary);
  text-align: center;
  margin-bottom: 8px;
}

/* SLOT DIGIT NRP */
.nrp-digit-slots {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin-bottom: 10px;
}

.digit-slot {
  width: 35px;
  height: 42px;
  background: rgba(15, 23, 42, 0.75);
  border: 1.5px solid rgba(255, 255, 255, 0.15);
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  transition: all 0.2s ease;
  user-select: none;
}

.digit-slot .digit-val {
  font-family: 'Consolas', 'Courier New', monospace;
  font-size: 1.3rem;
  font-weight: 800;
  color: #ffffff;
  text-shadow: 0 0 10px rgba(6, 182, 212, 0.8);
}

.digit-slot.active {
  border-color: #06b6d4;
  box-shadow: 0 0 14px rgba(6, 182, 212, 0.6);
  background: rgba(6, 182, 212, 0.1);
}

.digit-slot.filled {
  border-color: var(--accent-gold);
  background: rgba(217, 119, 6, 0.12);
}

.digit-caret {
  position: absolute;
  bottom: 5px;
  width: 12px;
  height: 2px;
  background: #06b6d4;
  display: none;
  animation: blink-caret 0.8s infinite;
}

.digit-slot.active:not(.filled) .digit-caret {
  display: block;
}

@keyframes blink-caret {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

.auth-error-msg {
  color: #ef4444;
  font-size: 0.74rem;
  font-weight: 700;
  text-align: center;
  min-height: 16px;
  margin-bottom: 8px;
  text-shadow: 0 0 8px rgba(239, 68, 68, 0.4);
}

/* KEYPAD CYBER VIRTUAL */
.cyber-keypad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 10px;
}

.keypad-btn {
  height: 42px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  color: #ffffff;
  font-family: 'Consolas', 'Courier New', monospace;
  font-size: 1.18rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.12s ease;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.keypad-btn:hover {
  background: rgba(217, 119, 6, 0.2);
  border-color: var(--accent-gold);
  color: #fbbf24;
  transform: translateY(-1px);
}

.keypad-btn:active {
  transform: scale(0.92);
  background: rgba(6, 182, 212, 0.3);
  border-color: #06b6d4;
  color: #38bdf8;
  box-shadow: 0 0 15px rgba(6, 182, 212, 0.6);
}

.keypad-btn.btn-action {
  font-size: 1rem;
  color: #94a3b8;
  background: rgba(255, 255, 255, 0.03);
}

.keypad-btn.btn-action:hover {
  color: #ef4444;
  border-color: rgba(239, 68, 68, 0.4);
}

/* TOMBOL AKSI CYBER */
.btn-cyber-action {
  width: 100%;
  padding: 10px 16px;
  background: linear-gradient(135deg, #d97706 0%, #b45309 100%);
  border: 1px solid rgba(251, 191, 36, 0.6);
  border-radius: var(--radius-md);
  color: #ffffff;
  font-size: 0.84rem;
  font-weight: 800;
  letter-spacing: 0.8px;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  box-shadow: 0 5px 16px rgba(217, 119, 6, 0.4);
  transition: all 0.25s ease;
}

.btn-cyber-action:hover {
  transform: translateY(-1px);
  box-shadow: 0 7px 20px rgba(217, 119, 6, 0.6);
}

.btn-cyber-action:active {
  transform: scale(0.97);
}

.btn-glow-bar {
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.35), transparent);
  animation: glow-bar-sweep 2.8s infinite;
}

@keyframes glow-bar-sweep {
  0% { left: -100%; }
  50%, 100% { left: 100%; }
}

.keyboard-tip {
  font-size: 0.68rem;
  color: var(--text-muted);
  text-align: center;
  margin-top: 6px;
}


/* SELECTOR KUNCI OTOMATIS (AUTO-LOCK TIMEOUT) */
.autolock-selector-badge {
  display: flex;
  align-items: center;
  gap: 4px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  padding: 4px 8px;
  border-radius: 8px;
  transition: all 0.2s ease;
}

.autolock-selector-badge:hover {
  background: rgba(6, 182, 212, 0.1);
  border-color: rgba(6, 182, 212, 0.35);
}

.autolock-icon {
  font-size: 0.85rem;
}

.autolock-select {
  background: transparent;
  border: none;
  color: #38bdf8;
  font-size: 0.76rem;
  font-weight: 700;
  cursor: pointer;
  outline: none;
  font-family: inherit;
}

.autolock-select option {
  background: #0f172a;
  color: #ffffff;
}

/* BANNER PERINGATAN TIMEOUT INAKTIVITAS */
.inactivity-warning-banner {
  position: fixed;
  top: 72px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10000;
  width: max-content;
  max-width: 92vw;
  animation: slideDownWarning 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.inactivity-warning-inner {
  background: rgba(15, 23, 42, 0.95);
  border: 1.5px solid #f59e0b;
  box-shadow: 0 10px 35px rgba(245, 158, 11, 0.35), 0 0 25px rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-radius: 12px;
  padding: 10px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  color: #ffffff;
}

.inactivity-warning-icon {
  font-size: 1.4rem;
  filter: drop-shadow(0 0 8px rgba(245, 158, 11, 0.6));
  animation: pulseGuard 1.5s infinite;
}

.inactivity-warning-msg {
  font-size: 0.82rem;
  color: #f1f5f9;
  line-height: 1.35;
}

.countdown-sec {
  color: #ef4444;
  font-weight: 900;
  font-size: 1.1rem;
  font-family: 'Consolas', monospace;
  text-shadow: 0 0 8px rgba(239, 68, 68, 0.7);
  display: inline-block;
  min-width: 22px;
  text-align: center;
}

.btn-inactivity-keep {
  background: linear-gradient(135deg, #0284c7, #0369a1);
  color: #ffffff;
  border: 1px solid rgba(56, 189, 248, 0.4);
  border-radius: 7px;
  padding: 6px 14px;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  box-shadow: 0 4px 12px rgba(2, 132, 199, 0.3);
  transition: all 0.2s ease;
}

.btn-inactivity-keep:hover {
  filter: brightness(1.15);
  transform: translateY(-1px);
}

/* KARTU SUKSES VERIFIKASI OVERLAY */
.auth-success-card {
  display: none;
  text-align: center;
  padding: 16px 8px;
  animation: scaleSuccess 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.auth-success-card.active {
  display: block;
}

@keyframes scaleSuccess {
  from { opacity: 0; transform: scale(0.85); }
  to { opacity: 1; transform: scale(1); }
}

.success-icon-wrap {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: rgba(16, 185, 129, 0.15);
  border: 2px solid #10b981;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 10px;
  box-shadow: 0 0 25px rgba(16, 185, 129, 0.5);
}

.success-check-icon {
  color: #10b981;
  font-size: 1.8rem;
  font-weight: 900;
}

.success-title {
  font-size: 1.1rem;
  font-weight: 800;
  color: #34d399;
  letter-spacing: 0.8px;
  margin-bottom: 2px;
}

.success-subtitle {
  font-size: 0.7rem;
  color: #94a3b8;
  letter-spacing: 0.6px;
  margin-bottom: 12px;
}

.operator-profile-box {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(217, 119, 6, 0.35);
  border-radius: var(--radius-lg);
  padding: 10px 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
  text-align: left;
}

.op-avatar {
  font-size: 2rem;
  background: rgba(217, 119, 6, 0.15);
  width: 46px;
  height: 46px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(217, 119, 6, 0.4);
}

.op-nama {
  font-weight: 800;
  color: #ffffff;
  font-size: 0.88rem;
}

.op-nrp {
  font-family: 'Consolas', 'Courier New', monospace;
  font-weight: 700;
  color: var(--accent-gold);
  font-size: 0.8rem;
}

.op-jabatan {
  font-size: 0.72rem;
  color: var(--text-secondary);
}

.op-kesatuan {
  font-size: 0.68rem;
  color: var(--text-muted);
}

.portal-progress-track {
  width: 100%;
  height: 4px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 99px;
  overflow: hidden;
  margin-bottom: 6px;
}

.portal-progress-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #10b981, #06b6d4);
  box-shadow: 0 0 10px #10b981;
  transition: width 0.7s ease;
}

.opening-text {
  font-size: 0.72rem;
  color: var(--text-muted);
  letter-spacing: 0.4px;
}


/* OPERATOR ACTIVE BADGE IN HEADER */
.operator-active-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: rgba(217, 119, 6, 0.15);
  border: 1px solid rgba(217, 119, 6, 0.4);
  padding: 4px 10px;
  border-radius: var(--radius-full);
}

.op-status-dot {
  width: 7px;
  height: 7px;
  background: #10b981;
  border-radius: 50%;
  box-shadow: 0 0 8px #10b981;
}

.op-label-text {
  font-family: 'Consolas', 'Courier New', monospace;
  font-size: 0.72rem;
  font-weight: 800;
  color: var(--accent-gold);
}

.btn-quick-lock {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.4);
  color: #fca5a5;
  font-size: 0.68rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  cursor: pointer;
  margin-left: 2px;
  transition: var(--transition);
}

.btn-quick-lock:hover {
  background: rgba(239, 68, 68, 0.3);
  color: #ffffff;
}

/* RESPONSIVE MOBILE OPTIMIZATION */
@media (max-width: 767px) {
  .portal-top-bar {
    max-width: 410px;
    margin-bottom: 10px;
  }

  .cyber-shield-card {
    display: flex;
    flex-direction: column;
    max-width: 410px;
    padding: 16px 14px;
    gap: 0;
    border-radius: 20px;
  }

  .shield-col-left {
    padding-right: 0;
    border-right: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    padding-bottom: 10px;
    margin-bottom: 10px;
  }

  .logo-hologram-wrap {
    width: 60px;
    height: 60px;
    margin-bottom: 6px;
  }

  .cyber-brand-logo {
    width: 48px;
    height: 48px;
  }

  .portal-title {
    font-size: 1.02rem;
  }

  .portal-subtitle {
    font-size: 0.72rem;
    margin-bottom: 6px;
  }

  .clearance-clock-row {
    flex-direction: row;
    justify-content: center;
    gap: 8px;
    margin-bottom: 0;
  }

  .clearance-badge {
    padding: 3px 10px;
    font-size: 0.65rem;
  }

  .portal-clock-time {
    font-size: 0.72rem;
  }

  .shield-cyber-specs {
    display: none;
  }

  .digit-slot {
    width: clamp(30px, 8.5vw, 36px);
    height: 40px;
  }

  .digit-slot .digit-val {
    font-size: 1.25rem;
  }

  .keypad-btn {
    height: 42px;
    font-size: 1.15rem;
  }

  .keyboard-tip {
    display: none;
  }

  .operator-active-badge .op-label-text {
    display: none;
  }
}

/* ==========================================================================
   OPTIMASI DASHBOARD & KOMPONEN WEB MOBILE ULTRA ELEGAN (NO CUTOFF)
   ========================================================================== */
@media (max-width: 767px) {
  /* Header Dinas Mobile Presisi & Elegan */
  .header-container {
    padding: 8px 10px;
    gap: 8px;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
    justify-content: space-between;
  }

  .brand-section {
    gap: 8px;
    min-width: 0;
    flex-shrink: 1;
    overflow: hidden;
  }

  .brand-logo {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    flex-shrink: 0;
  }

  .brand-titles {
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    overflow: hidden;
  }

  .brand-main {
    font-size: 0.92rem;
    font-weight: 800;
    white-space: nowrap;
    line-height: 1.2;
    letter-spacing: 0.2px;
    text-overflow: ellipsis;
    overflow: hidden;
  }

  .brand-sub {
    font-size: 0.65rem;
    font-weight: 700;
    white-space: nowrap;
    line-height: 1.2;
    letter-spacing: 0.3px;
    color: var(--accent-gold);
    text-overflow: ellipsis;
    overflow: hidden;
  }

  .header-actions {
    display: flex;
    align-items: center;
    gap: 5px;
    flex-shrink: 0;
  }

  /* Sembunyikan badge Tailscale di header mobile karena sudah ada di tab navigasi bawah */
  .header-actions .tailscale-badge {
    display: none !important;
  }

  .operator-active-badge {
    padding: 2px 5px;
    gap: 4px;
    border-radius: var(--radius-full);
  }

  .operator-active-badge .op-label-text {
    display: none !important;
  }

  .btn-quick-lock {
    font-size: 0.68rem;
    padding: 2px 6px;
    margin-left: 0;
    border-radius: var(--radius-full);
  }

  .autolock-selector-badge {
    padding: 2px 5px;
    gap: 2px;
    border-radius: 6px;
  }

  .autolock-icon {
    font-size: 0.75rem;
  }

  .autolock-select {
    font-size: 0.72rem;
    padding: 0 1px;
  }

  #btn-toggle-theme {
    width: 32px;
    height: 32px;
    font-size: 0.95rem;
    border-radius: 8px;
    flex-shrink: 0;
  }

  /* Main Container Terkunci Rapat Tanpa Side-Scroll */
  .main-container {
    padding: 10px 10px 80px 10px;
    gap: 12px;
    width: 100%;
    max-width: 100vw;
    min-width: 0;
    box-sizing: border-box;
    overflow-x: hidden;
  }

  /* Jam Digital & Banner Tanggal Mobile */
  .clock-banner {
    padding: 6px 12px;
    font-size: 0.76rem;
    border-radius: var(--radius-md);
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    min-width: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
  }

  .clock-banner #clock-date {
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .clock-banner .clock-time {
    font-weight: 800;
    white-space: nowrap;
    flex-shrink: 0;
  }

  /* Grid Kartu Metrik / Statistik 2 Kolom Ringkas */
  .stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }

  .stat-card {
    padding: 10px 10px;
    gap: 8px;
    border-radius: var(--radius-md);
    min-width: 0;
  }

  .stat-icon {
    width: 36px;
    height: 36px;
    font-size: 1.15rem;
    border-radius: 8px;
    flex-shrink: 0;
  }

  .stat-info {
    min-width: 0;
    overflow: hidden;
  }

  .stat-label {
    font-size: 0.65rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .stat-value {
    font-size: 1.25rem;
    line-height: 1.15;
  }

  /* Toolbar Pencarian & Filter Horisontal Scroll Mandiri */
  .toolbar-section {
    padding: 10px;
    gap: 8px;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
    overflow: hidden;
    border-radius: var(--radius-md);
  }

  .search-box {
    width: 100%;
    max-width: 100%;
    min-width: 0;
  }

  .search-input {
    width: 100%;
    box-sizing: border-box;
    padding: 8px 12px 8px 34px;
    font-size: 0.82rem;
    border-radius: var(--radius-md);
  }

  .search-icon {
    left: 10px;
    font-size: 0.9rem;
  }

  .filter-group {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    gap: 6px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding-bottom: 2px;
  }

  .filter-group::-webkit-scrollbar {
    display: none;
  }

  .btn-filter,
  .filter-group .btn-secondary,
  .filter-group .btn-primary {
    padding: 5px 10px;
    font-size: 0.74rem;
    border-radius: var(--radius-full);
    white-space: nowrap;
    flex-shrink: 0;
  }

  /* Kartu Surat Masuk Mobile Ultra Rapi */
  .mobile-cards-list {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
    gap: 10px;
  }

  .letter-card {
    padding: 12px;
    gap: 8px;
    border-radius: var(--radius-md);
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    min-width: 0;
  }

  .card-sender-title {
    font-size: 0.98rem;
    line-height: 1.25;
    word-break: break-word;
  }

  .card-subject {
    font-size: 0.82rem;
    line-height: 1.35;
    word-break: break-word;
  }

  .card-meta-box {
    padding: 7px 9px;
    font-size: 0.75rem;
    gap: 3px;
  }

  .meta-item {
    flex-wrap: wrap;
    gap: 4px;
  }

  .meta-item strong {
    min-width: 70px;
  }

  .card-disposisi-box {
    padding: 7px 10px;
    font-size: 0.78rem;
  }

  .card-actions-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    padding-top: 6px;
  }

  .action-btn-group {
    display: flex;
    align-items: center;
    gap: 5px;
    flex-wrap: wrap;
  }

  .btn-action-small {
    padding: 5px 9px;
    font-size: 0.74rem;
    border-radius: 6px;
  }

  /* FAB & Navigasi Bawah Presisi */
  .fab-btn {
    bottom: calc(72px + env(safe-area-inset-bottom));
    right: 14px;
    width: 50px;
    height: 50px;
    font-size: 1.4rem;
    box-shadow: 0 4px 16px rgba(245, 158, 11, 0.45);
  }

  /* Modal Print Kedinasan di HP */
  #modal-print .modal-dialog {
    max-height: 100dvh !important;
    height: 100% !important;
    border-radius: 0 !important;
    border: none !important;
    max-width: 100% !important;
  }

  #modal-print .print-modal-body {
    padding: 6px 2px !important;
  }

  .preview-toolbar {
    padding: 6px 10px;
    gap: 4px;
  }

  .btn-preview-tool {
    padding: 4px 8px;
    font-size: 0.72rem;
  }
}

@media (max-width: 480px) {
  .checkbox-grid {
    grid-template-columns: 1fr;
    gap: 6px;
    padding: 8px 10px;
  }

  .dispo-grid-container {
    grid-template-columns: 1fr;
    gap: 4px;
  }
}

@media (max-width: 600px) {
  /* Footer Modal Umum */
  .modal-footer {
    padding: 10px 14px max(10px, env(safe-area-inset-bottom)) 14px;
  }

  /* Footer Khusus Pratinjau Lembar Disposisi di HP */
  .print-modal-footer {
    display: grid !important;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: auto auto;
    gap: 8px;
    padding: 10px 14px max(12px, env(safe-area-inset-bottom)) 14px;
    background: var(--bg-modal);
    border-top: 1px solid var(--border-color);
  }

  .print-modal-footer .btn-modal-print {
    grid-column: 1 / -1;
    order: 1;
    width: 100%;
    height: 44px;
    font-size: 0.92rem;
    font-weight: 700;
    justify-content: center;
    border-radius: var(--radius-md);
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: #0f172a;
    box-shadow: 0 4px 15px rgba(245, 158, 11, 0.35);
  }

  .print-modal-footer .btn-modal-word {
    grid-column: 1 / 2;
    order: 2;
    width: 100%;
    height: 38px;
    font-size: 0.78rem;
    font-weight: 600;
    justify-content: center;
    border-radius: var(--radius-md);
  }

  .print-modal-footer .btn-modal-close {
    grid-column: 2 / 3;
    order: 3;
    width: 100%;
    height: 38px;
    font-size: 0.8rem;
    font-weight: 600;
    justify-content: center;
    border-radius: var(--radius-md);
  }

  /* Footer Khusus Modal Disposisi di HP */
  .dispo-modal-footer {
    display: grid !important;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: auto auto auto;
    gap: 8px;
    padding: 10px 14px max(12px, env(safe-area-inset-bottom)) 14px;
  }

  .dispo-modal-footer .btn-dispo-save {
    grid-column: 1 / -1;
    order: 1;
    width: 100%;
    height: 44px;
    font-size: 0.92rem;
    font-weight: 700;
    justify-content: center;
  }

  .dispo-modal-footer .btn-dispo-print {
    grid-column: 1 / 2;
    order: 2;
    width: 100%;
    height: 38px;
    font-size: 0.78rem;
    justify-content: center;
  }

  .dispo-modal-footer .btn-dispo-word {
    grid-column: 2 / 3;
    order: 3;
    width: 100%;
    height: 38px;
    font-size: 0.78rem;
    justify-content: center;
  }

  .dispo-modal-footer .btn-dispo-cancel {
    grid-column: 1 / -1;
    order: 4;
    width: 100%;
    height: 36px;
    font-size: 0.8rem;
    justify-content: center;
  }

  /* Footer Khusus Form Tambah/Edit */
  .form-modal-footer {
    display: flex;
    gap: 8px;
    width: 100%;
  }

  .form-modal-footer button {
    flex: 1;
    height: 42px;
    justify-content: center;
  }

  .form-modal-footer #btn-save-form {
    flex: 2;
  }
}

/* ==========================================================================
   BANNER PERINGATAN KONEKSI TAILSCALE / OFFLINE
   ========================================================================== */
.connection-alert-banner {
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.15) 0%, rgba(185, 28, 28, 0.25) 100%);
  border: 1.5px solid rgba(239, 68, 68, 0.45);
  border-radius: var(--radius-lg);
  padding: 12px 16px;
  margin-bottom: 14px;
  box-shadow: 0 4px 15px rgba(239, 68, 68, 0.15);
  animation: fadeIn 0.3s ease;
}

[data-theme="light"] .connection-alert-banner {
  background: #fee2e2;
  border-color: #ef4444;
}

.conn-alert-content {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.conn-alert-icon {
  font-size: 1.8rem;
  line-height: 1;
}

.conn-alert-text {
  flex: 1;
  min-width: 200px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  font-size: 0.82rem;
  color: #fca5a5;
  line-height: 1.4;
}

[data-theme="light"] .conn-alert-text {
  color: #991b1b;
}

.conn-alert-text strong {
  color: #ffffff;
  font-size: 0.92rem;
  font-weight: 800;
}

[data-theme="light"] .conn-alert-text strong {
  color: #7f1d1d;
}

.conn-alert-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.btn-conn-retry {
  background: #ef4444;
  color: #ffffff;
  border: none;
  padding: 7px 14px;
  border-radius: var(--radius-md);
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
  box-shadow: 0 2px 8px rgba(239, 68, 68, 0.35);
}

.btn-conn-retry:hover {
  background: #dc2626;
  transform: translateY(-1px);
}

.btn-conn-guide {
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.25);
  padding: 7px 14px;
  border-radius: var(--radius-md);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}

[data-theme="light"] .btn-conn-guide {
  background: rgba(0, 0, 0, 0.05);
  color: #334155;
  border-color: #cbd5e1;
}

.btn-conn-guide:hover {
  background: rgba(255, 255, 255, 0.2);
}

/* Aturan Khusus Cetak (@media print) */
@media print {
  body {
    background: #ffffff !important;
    color: #000000 !important;
    padding: 0 !important;
  }

  .app-header,
  .clock-banner,
  .stats-grid,
  .toolbar-section,
  .data-view-container,
  .mobile-bottom-nav,
  .fab-btn,
  .cyber-portal-overlay,
  .modal-overlay:not(#modal-print),
  .modal-header,
  .modal-footer,
  .preview-toolbar {
    display: none !important;
  }

  .modal-overlay#modal-print {
    position: static !important;
    background: none !important;
    opacity: 1 !important;
    padding: 0 !important;
  }

  .modal-overlay#modal-print .modal-dialog {
    max-width: 100% !important;
    max-height: none !important;
    border: none !important;
    box-shadow: none !important;
    border-radius: 0 !important;
    transform: none !important;
  }

  .print-viewport-wrapper {
    display: block !important;
    overflow: visible !important;
    width: 100% !important;
    height: auto !important;
    padding: 0 !important;
    margin: 0 !important;
  }

  .disposisi-print-container {
    transform: none !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    box-shadow: none !important;
    padding: 0 !important;
    margin: 0 !important;
  }

  @page {
    size: legal portrait;
    margin: 8mm 8mm 8mm 8mm;
  }
}
