:root { --nav-height: 56px; }

/* Improve touch usability */
.btn, .form-control, .form-select { min-height: 44px; font-size: 1rem; }
input[type="date"], input[type="time"], input[type="datetime-local"] { font-size: 1rem; }

/* Sticky filter bar right below navbar */
.filterbar { position: sticky; top: var(--nav-height); z-index: 1020; background: var(--bs-body-bg); border-bottom: 1px solid var(--bs-border-color); }
.filterbar .quick-scroll { overflow-x: auto; white-space: nowrap; -webkit-overflow-scrolling: touch; }

/* Offcanvas list spacing */
.offcanvas .list-group-item { padding: .9rem 1rem; }

/* Floating Add Button */
.fab-add { position: fixed; right: 16px; bottom: 16px; width: 56px; height: 56px; border-radius: 50%; display: flex; align-items: center; justify-content: center; background: var(--bs-primary); color: #fff; text-decoration: none; box-shadow: 0 12px 24px rgba(0,0,0,.15); }
.fab-add:hover { color: #fff; filter: brightness(0.95); }

/* Stackable tables: become card-like on < 768px */
@media (max-width: 767.98px) {
  .table-stack thead { display: none; }
  .table-stack tbody tr { display: block; margin-bottom: .875rem; border: 1px solid var(--bs-border-color); border-radius: .75rem; overflow: hidden; box-shadow: 0 2px 6px rgba(0,0,0,.04); }
  .table-stack tbody tr td { display: grid; grid-template-columns: 40% 1fr; gap: .5rem; padding: .625rem .75rem; border-bottom: 1px solid var(--bs-border-color); }
  .table-stack tbody tr td:last-child { border-bottom: 0; }
  .table-stack tbody tr td::before { content: attr(data-label); font-weight: 600; color: var(--bs-secondary-color); }
  .table-stack .btn-group { width: 100%; display: flex; gap: .5rem; }
  .table-stack .btn-group .btn { flex: 1 1 auto; }
}

/* Make navbar height consistent */
.navbar { min-height: var(--nav-height); }

/* Improve readability on very small screens */
@media (max-width: 360px) {
  .navbar .navbar-brand { font-size: 1rem; }
}