/* ===== Shared responsive layer: Mobile + Tablet + PC ===== */
html { -webkit-text-size-adjust: 100%; }
img, video, svg { max-width: 100%; height: auto; }
pre, code { max-width: 100%; overflow-x: auto; word-break: break-word; }
.table-responsive { -webkit-overflow-scrolling: touch; }
table td, table th { vertical-align: middle; }

/* ---------- PC / large screens ---------- */
@media (min-width: 1200px) {
    .content, .main { max-width: 1400px; }
    .stats-grid { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
}
@media (min-width: 1600px) {
    .content, .main { max-width: 1600px; }
}

/* ---------- Tablet ---------- */
@media (max-width: 992px) {
    .stats-grid { grid-template-columns: repeat(2, 1fr) !important; }
    .modal-box { width: 92%; max-width: 560px; }
}

/* ---------- Mobile ---------- */
@media (max-width: 768px) {
    /* 16px inputs stop iOS from zooming on focus */
    input, select, textarea, .form-control, .form-select { font-size: 16px !important; }
    .btn, button { min-height: 40px; }
    .btn-sm { min-height: 34px; }
    .card-body, .card-box { padding: 14px; }
    h1, .h1 { font-size: 1.5rem; }
    h3, .h3 { font-size: 1.2rem; }
    .row > [class*="col-"] { margin-bottom: 2px; }
    .d-flex.gap-2.flex-wrap > .form-control { max-width: 100% !important; width: 100%; }
    .modal-box { width: 94%; max-height: 90vh; overflow-y: auto; }
    .table-responsive table, .data-table { min-width: 560px; }
    .mobile-nav { padding-bottom: env(safe-area-inset-bottom, 0); }
}
@media (max-width: 480px) {
    .stats-grid { grid-template-columns: 1fr 1fr !important; gap: 10px !important; }
    .container { padding-left: 12px; padding-right: 12px; }
    .btn-group, .actions { flex-wrap: wrap; }
}
@media (hover: none) {
    .sidebar a, .nav-link { padding-top: 13px; padding-bottom: 13px; }
}
