html, body { max-width: 100%; overflow-x: hidden; }
img, svg, video, canvas { max-width: 100%; height: auto; }
.container { max-width: calc(100vw - 24px); }
.table-wrap { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
table { min-width: 720px; }
.actions, .sort-row, .period-buttons, .register-actions, .admin-quick-actions, .footer-legal-links { flex-wrap: wrap; }
button, .btn, .btn-link, .modal-btn, input, select, textarea { max-width: 100%; }
.user-area-head, .box summary { gap: 12px; }
.legal-modal-box, .modal-box, .access-box, .user-form-box { max-width: calc(100vw - 28px); }
@media (max-width: 900px) {
  header { font-size: 28px; letter-spacing: 2px; padding: 22px 14px; }
  .container { width: calc(100% - 24px); margin-left: auto; margin-right: auto; padding-left: 0; padding-right: 0; }
  .grid, .form-grid, .stats-cards, .user-grid, .quick-stats { grid-template-columns: 1fr !important; }
  .card, .box-content, .stats-board, .user-area { padding: 18px !important; }
  .actions, .sort-row, .period-buttons, .register-actions { gap: 8px; }
  .actions .btn, .sort-row .btn, .period-buttons .period-btn, .register-actions .modal-btn { width: 100%; justify-content: center; text-align: center; }
  .tabs { flex-direction: column; }
  .tab { width: 100%; text-align: center; }
  .filter-grid { grid-template-columns: 1fr !important; }
}
@media (max-width: 640px) {
  header { font-size: 23px; }
  h1, .box-title { font-size: 24px !important; }
  .stats-title { font-size: 21px !important; }
  .plan-price { font-size: 27px !important; }
  .user-area-head { align-items: center; }
  .btn-logout-inline { white-space: nowrap; }
  footer { padding-left: 12px; padding-right: 12px; line-height: 1.65; }
  .footer-legal-links { display: flex; justify-content: center; gap: 7px; }
  .footer-legal-links .sep { display: inline-flex; }
  .legal-modal-body { max-height: 68vh; }
}
