/* Mobile guard (loaded last): nothing may be wider than the screen; every table becomes stacked cards on phones. */
html, body { max-width: 100%; overflow-x: hidden; -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
img, svg { max-width: 100%; }
.app-shell, .app-main, .content, #page-content, .card { min-width: 0; max-width: 100%; }
td, th, .card, .summary-card, .topbar-title { overflow-wrap: anywhere; }

@media (max-width: 700px) {
  .login-screen { padding: 12px; }
  .login-card { width: 100%; max-width: 380px; padding: 28px 20px; }

  .topbar { padding: 0 12px; gap: 8px; }
  .topbar-title { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; }
  #nav-user { display: none; }
  .content { padding: 16px 12px; }
  .card { padding: 14px; }
  h2.page-title { font-size: 18px; margin-bottom: 14px; }

  .toolbar { gap: 8px; }
  .toolbar-spacer { display: none; }
  .search-wrap { min-width: 0; max-width: none; flex: 1 1 100%; }
  .toolbar select, .toolbar button, .toolbar input { flex: 1 1 auto; min-width: 0; }
  .summary-row { gap: 10px; }
  .steps .step { padding: 8px 2px; font-size: 11px; }
  .form-actions { flex-wrap: wrap; }
  .form-actions button { flex: 1 1 auto; justify-content: center; }
  .pagination { flex-direction: column; align-items: flex-start; gap: 8px; }
  .pagination .pages { flex-wrap: wrap; }
  .notif-panel { position: fixed; left: 12px; right: 12px; top: 64px; width: auto; max-width: none; }

  /* every other table -> stacked cards (column titles come from data-label, filled by mobile-guard.js) */
  .content table:not(#asset-table) { display: block; width: 100%; }
  .content table:not(#asset-table) thead { display: none; }
  .content table:not(#asset-table) tbody { display: grid; gap: 8px; }
  .content table:not(#asset-table) tr { display: grid; border: 1px solid var(--border); border-radius: 10px; padding: 6px 12px; background: #fff; }
  .content table:not(#asset-table) tr:hover td { background: none; }
  .content table:not(#asset-table) td, .content table:not(#asset-table) th { display: flex; justify-content: space-between; gap: 12px; border: 0;
                                                                              padding: 4px 0; text-align: right; background: none; }
  .content table:not(#asset-table) td::before { content: attr(data-label); color: var(--muted); font-weight: 600; font-size: 12px;
                                                text-align: left; flex: 0 0 34%; }
  .content table:not(#asset-table) td:not([data-label])::before { content: none; }
  .content table:not(#asset-table) td:empty { display: none; }
}

/* Vasu logo */
.login-logo { display: block; height: 30px; width: auto; max-width: 70%; margin: 0 0 16px; }
.brand-logo { display: block; height: 22px; width: auto; max-width: 160px; margin-bottom: 8px; }
.topbar-logo { display: none; height: 20px; width: auto; max-width: 90px; flex: 0 0 auto; }
@media (max-width: 700px) { .topbar-logo { display: block; } }
