/* ============================================================
   Responsive / Media Queries
   ============================================================ */

@media (max-width: 1180px) {
  .three-col-form { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .card-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .clamp-summary { flex-wrap: wrap; }
  .clamp-summary .summary-item:nth-child(3),
  .clamp-summary .summary-item:nth-child(4) { display: none; }
  .tree-entry-form { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 900px) {
  .mobile-only { display: flex !important; }
  .app-shell { display: block; }
  .main-area { min-height: 100vh; }
  .sidebar {
    transform: translateX(-100%);
    transition: transform .22s ease, visibility .22s ease;
    visibility: hidden;
    box-shadow: 25px 0 60px rgba(12,31,24,.23);
  }
  .sidebar.open {
    transform: translateX(0);
    visibility: visible;
  }
  .sidebar-overlay { position: fixed; inset: 0; z-index: 35; background: rgba(11,29,23,.45); visibility: hidden; }
  .sidebar-overlay.open { visibility: visible; }
  .topbar { height: 82px; padding-right: 30px; padding-left: 30px; }
  .online-indicator { right: 20px !important; left: auto !important; }
  .icon-btn.mobile-only { margin-left: -10px; width: 32px; height: 32px; }
  .two-col { grid-template-columns: 1fr; }
  .summary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .master-stats { grid-template-columns: 1fr 1fr; }
  .master-actions .btn { min-width: 100%; }
  .clamp-summary .summary-item { display: none; }
  .clamp-summary .summary-item:first-of-type { display: block; }
  .tree-entry-form { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 650px) {
  .topbar { padding: 14px 15px; padding-left: 20px; }
  .online-indicator { right: 15px !important; left: auto !important; }
  .icon-btn.mobile-only { margin-left: 0; }
  .status-dot { width: 12px; height: 12px; }
  .topbar .eyebrow { display: none; }
  .topbar h2 { font-size: 18px; }
  .user-chip div { display: none; }
  .content-wrap { padding: 16px 13px 45px; }
  .panel { border-radius: 17px; padding: 17px 14px; }
  .form-grid, .three-col-form { grid-template-columns: 1fr; }
  .card-list { grid-template-columns: 1fr; }
  .clamp-summary { flex-direction: column; align-items: flex-start; }
  .clamp-summary > div:first-child { flex: 1 1 100%; }
  .clamp-summary .summary-item { display: none; }
  .clamp-summary .summary-item:first-of-type { display: block; }
  .clamp-actions { margin-left: 0; margin-top: 8px; }
  /* Perbesar tombol aksi di mobile untuk penggunaan di lapangan */
  .clamp-actions { gap: 12px; }
  .eye-btn, .export-clamp-btn, .edit-clamp-btn, .trash-btn { width: 52px !important; height: 52px !important; border-radius: 14px; }
  .eye-btn svg, .export-clamp-btn svg, .edit-clamp-btn svg, .trash-btn svg { width: 24px !important; height: 24px !important; }
  .row-actions { gap: 8px; }
  .row-edit, .row-delete { width: 44px !important; height: 44px !important; padding: 10px !important; border-radius: 10px; }
  .row-edit svg, .row-delete svg { width: 20px !important; height: 20px !important; }
  .tree-entry-form { grid-template-columns: 1fr; padding: 12px; }
  .summary-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .summary-card { padding: 14px; }
  .summary-card strong { font-size: 21px; }
  .panel-heading { align-items: center; flex-wrap: wrap; }
  .clamp-panel-tools { width: 100%; flex-direction: column; align-items: stretch; }
  .clamp-search { flex: 1 1 100%; max-width: 100%; }
  .clamp-panel-tools .badge { text-align: center; }
  .side-nav { padding: 12px; gap: 4px; }
  .nav-item { padding: 10px; gap: 10px; }
  .tree-search-bar { flex-wrap: wrap; }
  .tree-search-input { min-width: 100%; max-width: 100%; }
  .tree-search-count { width: 100%; text-align: center; margin-top: 6px; }
  .master-stats { grid-template-columns: 1fr; }
  .modal-overlay { padding: 10px; align-items: flex-end; }
  .modal-content { border-radius: 20px 20px 0 0; max-height: 88vh; }
  .modal-body { padding: 16px; }
  .modal-body .clamp-detail-meta { grid-template-columns: 1fr; }
  .about-panel { max-width: 100%; }
  .about-header { flex-direction: column; text-align: center; }
  .about-actions .btn { width: 100%; }
  .table-wrap { font-size: 12px; }
  th, td { padding: 10px 8px; }
  .about-info { padding: 0 4px; }
  .info-row { flex-direction: column; align-items: flex-start; gap: 6px; padding: 12px 14px; }
  .about-date-badge { font-size: 11px; padding: 6px 10px; }
}

@media print {
  .sidebar, .topbar, .notice, .btn, .clamp-actions { display: none !important; }
  .main-area { grid-column: 1; }
  .content-wrap { padding: 0; }
  .page { display: none !important; }
  #page-recap { display: block !important; }
  .panel, .summary-card { box-shadow: none; break-inside: avoid; }
}
