:root {
  --brand: #1e3a5f;
  --brand-light: #2c5282;
  --accent: #2f9e6e;
}

html, body { height: 100%; overscroll-behavior-y: contain; }
body { -webkit-tap-highlight-color: transparent; }

/* Safe-area padding for notched phones */
.safe-top { padding-top: env(safe-area-inset-top); }
.safe-bottom { padding-bottom: env(safe-area-inset-bottom); }

/* ---------- Responsive table -> card list (works on any phone, pure CSS) ---------- */
.responsive-table { width: 100%; border-collapse: collapse; font-size: 0.875rem; }
.responsive-table th {
  text-align: left; font-weight: 600; color: #64748b; text-transform: uppercase;
  font-size: 0.7rem; letter-spacing: 0.03em; padding: 0.6rem 0.75rem; border-bottom: 1px solid #e2e8f0;
}
.responsive-table td { padding: 0.6rem 0.75rem; border-bottom: 1px solid #f1f5f9; vertical-align: middle; }
.responsive-table tbody tr:hover { background: #f8fafc; }

@media (max-width: 768px) {
  .responsive-table thead { display: none; }
  .responsive-table, .responsive-table tbody, .responsive-table tr, .responsive-table td { display: block; width: 100%; }
  .responsive-table tr {
    margin-bottom: 0.75rem; border: 1px solid #e2e8f0; border-radius: 0.75rem;
    padding: 0.25rem 0; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,0.04);
  }
  .responsive-table td {
    display: flex; justify-content: space-between; align-items: center; gap: 0.75rem;
    border-bottom: 1px dashed #f1f5f9; text-align: right;
  }
  .responsive-table td:last-child { border-bottom: none; }
  .responsive-table td::before {
    content: attr(data-label); font-weight: 600; color: #64748b; text-align: left; flex-shrink: 0;
  }
  .responsive-table td.rt-actions { justify-content: flex-end; }
  .responsive-table td.rt-actions::before { content: none; }
  .responsive-table td.rt-select { justify-content: flex-start; }
  .responsive-table td.rt-select::before { content: none; }
}

/* ---------- Skeleton loading ---------- */
.skeleton {
  background: linear-gradient(90deg, #eef1f4 25%, #e2e8f0 37%, #eef1f4 63%);
  background-size: 400% 100%;
  animation: skeleton-loading 1.4s ease infinite;
  border-radius: 0.5rem;
}
@keyframes skeleton-loading { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }

/* ---------- Bottom nav active indicator ---------- */
.bottom-nav-item.active { color: var(--accent); }
.bottom-nav-item.active svg { transform: translateY(-1px); }

/* Scrollbar (desktop) */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 4px; }

/* Toast */
.toast { animation: toast-in 0.2s ease-out; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

/* Modal fade */
.modal-backdrop { animation: fade-in 0.15s ease-out; }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }

/* Combobox (field.autoSuggest di crud.js) dropdown panel */
.combobox-panel { animation: fade-in 0.1s ease-out; }
