/* PSK Business ERP — responsive behaviour */
@media (max-width: 1280px) {
  .today { display: none; }
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 1024px) {
  .sidebar { position: fixed; left: 0; top: 0; bottom: 0; width: 272px; transform: translateX(-102%); box-shadow: var(--shadow-lg); }
  body.nav-open .sidebar { transform: none; }
  body.nav-open .sidebar-scrim { display: block; position: fixed; inset: 0; z-index: 55; background: rgba(13, 28, 51, .5); animation: fade .2s; }
  .sidebar .sidebar-close { display: inline-grid; }
  .sidebar .sidebar-close:hover { background: rgba(255, 255, 255, .1); color: #fff; }
  .page-inner { padding: 20px 18px 40px; }
  .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-2-1, .grid-1-2 { grid-template-columns: minmax(0, 1fr); }
  .welcome-card { grid-template-columns: minmax(0, 1fr); max-width: 620px; gap: 28px; }
  .welcome-right { display: none; }
  .details-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@media (max-width: 760px) {
  .topbar { padding: 0 10px 0 6px; gap: 6px; }
  .breadcrumb { display: none; }
  .search { max-width: none; margin-left: 0; }
  .search kbd { display: none; }
  .search input { padding-right: 12px; }
  .search-results { position: fixed; left: 8px; right: 8px; top: calc(var(--topbar-h) + 4px); }
  #quick-action span { display: none; }
  #quick-action { width: 38px; padding: 0; }
  .profile-text, .profile > .icon { display: none; }
  .profile { padding: 2px; }
  .page-inner { padding: 16px 12px 36px; }
  h1 { font-size: 19px; }
  .page-header { margin-bottom: 16px; }
  .page-actions { width: 100%; }
  .page-actions .btn { flex: 1; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: minmax(0, 1fr); }
  .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .kpi { padding: 13px 14px; }
  .kpi-value { font-size: 19px; }
  .kpi .spark { display: none; }
  .form-grid { grid-template-columns: minmax(0, 1fr); }
  .span-full, .span-half, .span-third, .span-two-thirds { grid-column: span 1; }
  .details-2, .details-3, .details-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .modal-backdrop { padding: 0; align-items: flex-end; }
  .modal, .modal-sm, .modal-lg, .modal-xl { max-width: none; border-radius: 18px 18px 0 0; max-height: 94dvh; margin: 0; }
  .modal-body { overflow-y: auto; padding: 16px; }
  .modal-head { padding: 16px 16px 12px; }
  .modal-foot { padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); border-radius: 0; }
  .modal-foot .btn { flex: 1; }
  .toast-root { left: 12px; right: 12px; bottom: 12px; align-items: stretch; transform: none; width: auto; max-width: none; }
  .toast { max-width: none; }
  .hide-sm { display: none !important; }
  .table-search { max-width: none; flex-basis: 100%; }
  .table-tools { margin-left: 0; }
  .table-filter { flex: 1; max-width: none; }
  .table td, .table th { padding: 10px 12px; }
  .table-foot { justify-content: center; }
  .segmented { width: 100%; max-width: calc(100vw - 24px); overflow-x: auto; scrollbar-width: none; }
  .range, .rep-range > * { min-width: 0; max-width: 100%; }
  .segmented button { flex: 1; padding: 0 10px; }
  .range { width: 100%; }
  .btn, .input, .icon-btn { min-height: 40px; }
  .btn-sm, .input-sm { min-height: 34px; }
  .welcome h1 { font-size: 30px; }
  .welcome-sub { font-size: 15px; }
  .welcome-actions .btn { width: 100%; }
  .welcome-brand { margin-bottom: 24px; }
  .donut-legend { min-width: 0; width: 100%; }
}
@media (max-width: 420px) {
  .details-2, .details-3, .details-4 { grid-template-columns: minmax(0, 1fr); }
}
