/* ==========================================================================
   RT DIGITAL - RESPONSIVE LAYOUT & PRINT STYLES
   ========================================================================== */

/* Tablet & Desktop View (min-width: 768px) */
@media (min-width: 768px) {
  .app-wrapper {
    flex-direction: row;
    max-width: 1300px;
  }

  .bottom-nav {
    display: none;
  }

  .desktop-nav {
    display: flex;
    flex-direction: column;
    width: 260px;
    height: 100vh;
    position: sticky;
    top: 0;
    background: var(--bg-surface);
    border-right: 1px solid var(--border-subtle);
    padding: 1.25rem 1rem;
    gap: 0.5rem;
    flex-shrink: 0;
  }

  .desktop-nav-header {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    margin-bottom: 1.5rem;
    padding: 0 0.5rem;
  }

  .desktop-nav-links {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    flex: 1;
  }

  .desktop-nav-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.65rem 0.85rem;
    border-radius: var(--radius-md);
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all var(--transition-fast);
    cursor: pointer;
    border: none;
    background: transparent;
    width: 100%;
    text-align: left;
  }

  .desktop-nav-item:hover {
    background: var(--bg-surface-elevated);
    color: var(--text-main);
  }

  .desktop-nav-item.active {
    background: var(--primary-light);
    color: var(--primary);
    border-left: 3px solid var(--primary);
  }

  .desktop-nav-item svg {
    width: 20px;
    height: 20px;
  }

  .main-viewport {
    flex: 1;
    min-width: 0;
  }

  .content-area {
    padding: 1.75rem;
    padding-bottom: 1.75rem;
  }

  .stat-grid {
    grid-template-columns: repeat(4, 1fr);
  }

  .stat-card-full {
    grid-column: span 1;
  }

  .modal-overlay {
    align-items: center;
  }

  .modal-sheet {
    border-radius: var(--radius-lg);
    transform: scale(0.96);
  }

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

  .sheet-handle {
    display: none;
  }
}

@media (max-width: 480px) {
  .theme-switcher .theme-label {
    display: none;
  }
  .theme-btn {
    padding: 0.3rem 0.45rem;
  }
}

@media (max-width: 400px) {
  .stat-grid {
    grid-template-columns: 1fr;
  }
  .stat-card-full {
    grid-column: span 1;
  }
}

/* --------------------------------------------------------------------------
   PRINT STYLES - KHUSUS CETAK SLIP KWITANSI RESMI (COMPACT SLIP)
   -------------------------------------------------------------------------- */
@page {
  size: 100mm 150mm; /* Standar Slip Kwitansi / Thermal Compact */
  margin: 0;
}

@media print {
  html, body {
    background: #ffffff !important;
    color: #000000 !important;
    margin: 0 !important;
    padding: 0 !important;
    height: auto !important;
    overflow: visible !important;
  }

  /* Sembunyikan SEMUA elemen website */
  .app-wrapper,
  .top-header,
  .bottom-nav,
  .desktop-nav,
  .btn,
  .filter-pills-bar,
  .search-box,
  .theme-switcher,
  .card,
  .sheet-handle,
  .card-header,
  .toast-container,
  .modal-overlay:not(#modal-kwitansi) {
    display: none !important;
  }

  /* Tampilkan HANYA slip kwitansi */
  .modal-overlay#modal-kwitansi {
    position: static !important;
    display: block !important;
    background: #ffffff !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    opacity: 1 !important;
    pointer-events: auto !important;
    margin: 0 !important;
    padding: 5mm !important;
    width: 100% !important;
  }

  .modal-overlay#modal-kwitansi .modal-sheet {
    position: static !important;
    transform: none !important;
    max-width: 90mm !important;
    width: 90mm !important;
    margin: 0 auto !important;
    border: none !important;
    padding: 0 !important;
    box-shadow: none !important;
    background: #ffffff !important;
  }

  .modal-overlay#modal-kwitansi .card-header,
  .modal-overlay#modal-kwitansi .flex-col.gap-2 {
    display: none !important;
  }

  .receipt-paper {
    box-shadow: none !important;
    border: 1px solid #64748b !important;
    margin: 0 auto !important;
    padding: 5mm !important;
    width: 100% !important;
    max-width: 90mm !important;
    page-break-inside: avoid !important;
    page-break-after: avoid !important;
  }
}
