/*
 * HRConnect Mobile App Polish
 * Scope: responsive UI layer only. No workflow, data, API, route, or permission changes.
 */
:root {
  --hrc-mobile-bg: #f4f7fb;
  --hrc-mobile-surface: #ffffff;
  --hrc-mobile-surface-soft: #f8fafc;
  --hrc-mobile-border: rgba(15, 23, 42, .1);
  --hrc-mobile-text: #0f172a;
  --hrc-mobile-muted: #64748b;
  --hrc-mobile-primary: #2563eb;
  --hrc-mobile-accent: #14b8a6;
  --hrc-mobile-danger: #dc2626;
  --hrc-radius-sm: 12px;
  --hrc-radius-md: 16px;
  --hrc-radius-lg: 20px;
  --hrc-shadow-card: 0 10px 28px rgba(15, 23, 42, .08);
  --hrc-shadow-float: 0 18px 48px rgba(15, 23, 42, .16);
  --hrc-transition: 180ms cubic-bezier(.2, .8, .2, 1);
}

*,
*::before,
*::after {
  -webkit-tap-highlight-color: transparent;
}

html {
  max-width: 100%;
  overflow-x: hidden;
  text-size-adjust: 100%;
}

body.qm-erp2050 {
  max-width: 100%;
  overflow-x: hidden;
  color: var(--hrc-mobile-text);
  background:
    radial-gradient(circle at top right, rgba(20, 184, 166, .1), transparent 30rem),
    linear-gradient(180deg, #f8fbff 0%, var(--hrc-mobile-bg) 100%);
  font-family: "Be Vietnam Pro", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body.qm-erp2050 img,
body.qm-erp2050 video,
body.qm-erp2050 canvas,
body.qm-erp2050 svg {
  max-width: 100%;
}

body.qm-erp2050 a,
body.qm-erp2050 button,
body.qm-erp2050 input,
body.qm-erp2050 select,
body.qm-erp2050 textarea,
body.qm-erp2050 .btn,
body.qm-erp2050 .card,
body.qm-erp2050 .dropdown-menu,
body.qm-erp2050 .modal-content,
body.qm-erp2050 .offcanvas {
  transition:
    background-color var(--hrc-transition),
    border-color var(--hrc-transition),
    box-shadow var(--hrc-transition),
    color var(--hrc-transition),
    opacity var(--hrc-transition),
    transform var(--hrc-transition);
}

body.qm-erp2050 :where(.container, .container-fluid, .row, .col, [class*="col-"], .card, .modal, .offcanvas, .dropdown-menu, form, table) {
  min-width: 0;
}

body.qm-erp2050 :where(h1, h2, h3, h4, h5, h6, p, span, a, button, label, small, strong, td, th, .badge, .btn) {
  overflow-wrap: anywhere;
}

body.qm-erp2050 :where(.badge, .btn, .dropdown-item, .nav-link, .qm-nav-link) {
  overflow-wrap: normal;
}

body.qm-erp2050 .badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 24px;
  padding: 5px 10px;
  border-radius: 999px;
  font-weight: 800;
  line-height: 1.15;
  white-space: normal;
  text-align: center;
}

body.qm-erp2050 .btn,
body.qm-erp2050 button.btn {
  min-height: 40px;
  border-radius: 14px;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

body.qm-erp2050 .btn-sm {
  min-height: 34px;
  border-radius: 12px;
}

body.qm-erp2050 .btn-primary,
body.qm-erp2050 .btn-success,
body.qm-erp2050 .btn-info {
  border: 0;
  box-shadow: 0 10px 22px rgba(37, 99, 235, .18);
}

body.qm-erp2050 :where(.form-control, .form-select, .form-check-input, .select2-selection, .choices__inner) {
  border-color: var(--hrc-mobile-border);
}

body.qm-erp2050 :where(.form-control, .form-select) {
  min-height: 44px;
  border-radius: 14px;
  font-weight: 650;
}

body.qm-erp2050 textarea.form-control {
  min-height: 104px;
}

body.qm-erp2050 :where(.form-control, .form-select, .btn, .qm-icon-btn, .qm-nav-link):focus,
body.qm-erp2050 :where(.form-control, .form-select, .btn, .qm-icon-btn, .qm-nav-link):focus-visible {
  outline: 0;
  box-shadow: 0 0 0 4px rgba(37, 99, 235, .14);
}

body.qm-erp2050 :where(.card, .stat-card, .metric-card, .dashboard-card, .module-card, .filter-card, .table-card, .panel, .section-card, .erp-card, .kpi-card) {
  border-radius: var(--hrc-radius-md);
  border-color: var(--hrc-mobile-border);
  box-shadow: var(--hrc-shadow-card);
}

body.qm-erp2050 :where(.card, .stat-card, .metric-card, .dashboard-card, .module-card, .filter-card, .table-card, .panel, .section-card, .erp-card, .kpi-card) > :where(.card-body, .card-header, .card-footer) {
  min-width: 0;
}

body.qm-erp2050 :where(.table-responsive, .dataTables_wrapper, .dt-container) {
  width: 100%;
  max-width: 100%;
}

body.qm-erp2050 :where(.table-responsive, .table-scroll, .overflow-auto) {
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}

body.qm-erp2050 table {
  vertical-align: middle;
}

body.qm-erp2050 table :where(th, td) {
  max-width: 320px;
}

body.qm-erp2050 .dropdown-menu {
  border: 1px solid var(--hrc-mobile-border);
  border-radius: var(--hrc-radius-md);
  box-shadow: var(--hrc-shadow-float);
  padding: 8px;
}

body.qm-erp2050 .dropdown-item {
  min-height: 40px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 750;
}

body.qm-erp2050 .modal-content {
  border: 1px solid rgba(15, 23, 42, .08);
  border-radius: var(--hrc-radius-lg);
  box-shadow: var(--hrc-shadow-float);
}

body.qm-erp2050 .modal-header,
body.qm-erp2050 .modal-footer {
  padding: 14px 16px;
}

body.qm-erp2050 .modal-body {
  padding: 16px;
}

body.qm-erp2050 .toast,
body.qm-erp2050 .alert {
  border-radius: var(--hrc-radius-md);
  border-color: rgba(15, 23, 42, .08);
  box-shadow: 0 12px 30px rgba(15, 23, 42, .1);
}

body.qm-erp2050 .placeholder,
body.qm-erp2050 .skeleton,
body.qm-erp2050 [data-loading="true"] {
  position: relative;
  overflow: hidden;
  border-radius: 12px;
  background: linear-gradient(90deg, #eef2f7 0%, #f8fafc 46%, #e5edf6 100%);
  background-size: 220% 100%;
  animation: hrcSkeletonShimmer 1.25s ease-in-out infinite;
}

@keyframes hrcSkeletonShimmer {
  from { background-position: 120% 0; }
  to { background-position: -120% 0; }
}

@media (prefers-reduced-motion: reduce) {
  body.qm-erp2050 *,
  body.qm-erp2050 *::before,
  body.qm-erp2050 *::after {
    animation-duration: .001ms;
    animation-iteration-count: 1;
    scroll-behavior: auto;
    transition-duration: .001ms;
  }
}

/* 2026-07-05 public footer alignment: keep shared public footer centered with page content. */
body.qm-public .tcv-footer {
  width: min(1140px, calc(100% - 32px));
  max-width: 1140px;
  margin: 36px auto 0;
  overflow: hidden;
}

body.qm-public .tcv-footer-grid,
body.qm-public .tcv-footer-bottom {
  width: 100%;
  max-width: none;
}

body.qm-public .tcv-footer-grid {
  margin-left: 0;
  margin-right: 0;
  padding-left: 16px;
  padding-right: 16px;
}

@media (max-width: 680px) {
  body.qm-public .tcv-footer {
    width: min(100% - 20px, 1140px);
    margin-top: 24px;
  }
}

@media (max-width: 991.98px) {
  body.qm-erp2050 {
    padding-bottom: max(12px, env(safe-area-inset-bottom));
  }

  body.qm-erp2050 .qm-app {
    display: block;
    min-height: 100dvh;
    background: transparent;
  }

  body.qm-erp2050 .qm-main {
    width: 100%;
    min-width: 0;
    margin: 0;
    padding: 0;
  }

  body.qm-erp2050 .qm-topbar {
    position: sticky;
    top: 0;
    z-index: 1020;
    min-height: 56px;
    height: auto;
    padding: max(8px, env(safe-area-inset-top)) 12px 8px;
    gap: 10px;
    border-bottom: 1px solid rgba(15, 23, 42, .08);
    background: rgba(255, 255, 255, .94);
    box-shadow: 0 8px 24px rgba(15, 23, 42, .06);
    backdrop-filter: blur(18px);
  }

  body.qm-erp2050 .qm-topbar-title {
    display: none;
  }

  body.qm-erp2050 .qm-topbar-actions {
    margin-left: auto;
    gap: 8px;
    min-width: 0;
  }

  body.qm-erp2050 .qm-icon-btn,
  body.qm-erp2050 .qm-topbar .qm-icon-btn {
    width: 44px;
    height: 44px;
    min-width: 44px;
    border-radius: 14px;
    border: 1px solid rgba(15, 23, 42, .08);
    background: #fff;
    color: #0f172a;
    box-shadow: 0 8px 18px rgba(15, 23, 42, .06);
  }

  body.qm-erp2050 .qm-user-chip {
    width: 44px;
    height: 44px;
    min-width: 44px;
    padding: 0;
    border-radius: 14px;
    justify-content: center;
    overflow: hidden;
  }

  body.qm-erp2050 .qm-user-chip img,
  body.qm-erp2050 .qm-avatar-img,
  body.qm-erp2050 .qm-avatar {
    width: 34px;
    height: 34px;
    min-width: 34px;
    border-radius: 12px;
  }

  body.qm-erp2050 .erp-global-search {
    display: none;
  }

  body.qm-erp2050 .qm-content {
    width: 100%;
    max-width: 100%;
    padding: 12px 12px calc(16px + env(safe-area-inset-bottom));
  }

  body.qm-erp2050 :where(.container, .container-fluid) {
    width: 100%;
    max-width: 100%;
    padding-left: 12px;
    padding-right: 12px;
  }

  body.qm-erp2050 :where(.row) {
    --bs-gutter-x: 12px;
    --bs-gutter-y: 12px;
  }

  body.qm-erp2050 :where(h1, .h1) {
    font-size: 28px;
    line-height: 1.12;
  }

  body.qm-erp2050 :where(h2, .h2) {
    font-size: 24px;
    line-height: 1.16;
  }

  body.qm-erp2050 :where(h3, .h3) {
    font-size: 20px;
    line-height: 1.22;
  }

  body.qm-erp2050 :where(h4, .h4) {
    font-size: 18px;
    line-height: 1.26;
  }

  body.qm-erp2050 :where(p, .text-muted, .small, small) {
    line-height: 1.55;
  }

  body.qm-erp2050 :where(.card, .stat-card, .metric-card, .dashboard-card, .module-card, .filter-card, .table-card, .panel, .section-card, .erp-card, .kpi-card) {
    border-radius: var(--hrc-radius-md);
    box-shadow: 0 8px 22px rgba(15, 23, 42, .07);
  }

  body.qm-erp2050 :where(.card-body, .card-header, .card-footer) {
    padding: 14px 16px;
  }

  body.qm-erp2050 :where(.card-header, .modal-header, .offcanvas-header) {
    min-height: 52px;
  }

  body.qm-erp2050 .btn,
  body.qm-erp2050 button.btn {
    min-height: 44px;
    padding: 9px 14px;
    line-height: 1.2;
  }

  body.qm-erp2050 .btn-sm {
    min-height: 38px;
    padding: 7px 11px;
  }

  body.qm-erp2050 :where(.form-control, .form-select) {
    min-height: 48px;
    padding: 10px 14px;
    font-size: 16px;
  }

  body.qm-erp2050 :where(label, .form-label) {
    margin-bottom: 6px;
    color: #334155;
    font-weight: 800;
  }

  body.qm-erp2050 :where(form, .filters, .filter-bar, .toolbar, .actions, .page-actions, .card-actions) {
    gap: 10px;
  }

  body.qm-erp2050 :where(.filters, .filter-bar, .toolbar, .page-actions, .card-actions) {
    max-width: 100%;
    flex-wrap: wrap;
  }

  body.qm-erp2050 :where(.filters, .filter-bar) :where(.btn, button, .form-control, .form-select) {
    width: 100%;
  }

  body.qm-erp2050 .table-responsive {
    margin-left: -2px;
    margin-right: -2px;
    border-radius: var(--hrc-radius-md);
    border: 1px solid rgba(15, 23, 42, .08);
    background: #fff;
  }

  body.qm-erp2050 .table {
    margin-bottom: 0;
    min-width: 680px;
    font-size: 14px;
  }

  body.qm-erp2050 .table > :not(caption) > * > * {
    padding: 12px;
  }

  body.qm-erp2050 .table thead th {
    position: sticky;
    top: 0;
    z-index: 2;
    background: #f8fafc;
    color: #475569;
    font-size: 12px;
    font-weight: 900;
    text-transform: uppercase;
  }

  body.qm-erp2050 .dataTables_wrapper :where(.row, .dataTables_filter, .dataTables_length) {
    gap: 10px;
  }

  body.qm-erp2050 .dataTables_wrapper :where(.dataTables_filter, .dataTables_length, .dataTables_info, .dataTables_paginate) {
    width: 100%;
    text-align: left;
  }

  body.qm-erp2050 .dataTables_wrapper :where(.dataTables_filter input, .dataTables_length select) {
    width: 100%;
    margin: 6px 0 0;
  }

  body.qm-erp2050 .pagination {
    gap: 6px;
    flex-wrap: wrap;
  }

  body.qm-erp2050 .page-link {
    min-width: 40px;
    min-height: 40px;
    border-radius: 12px;
    display: grid;
    place-items: center;
    font-weight: 800;
  }

  body.qm-erp2050 .modal {
    padding: 0;
  }

  body.qm-erp2050 .modal-dialog {
    width: calc(100% - 20px);
    max-width: calc(100% - 20px);
    margin: 10px auto max(10px, env(safe-area-inset-bottom));
  }

  body.qm-erp2050 .modal-dialog-scrollable {
    height: calc(100dvh - 20px - env(safe-area-inset-top) - env(safe-area-inset-bottom));
  }

  body.qm-erp2050 .modal-dialog-scrollable .modal-content {
    max-height: 100%;
  }

  body.qm-erp2050 .modal-content {
    border-radius: 20px;
  }

  body.qm-erp2050 .modal-footer {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
  }

  body.qm-erp2050 .modal-footer > * {
    width: 100%;
    margin: 0;
  }

  body.qm-erp2050 .dropdown-menu {
    max-width: calc(100vw - 24px);
  }

  body.qm-erp2050 .dropdown-menu.show {
    transform: translate3d(0, 0, 0);
  }

  body.qm-erp2050 .offcanvas.qm-mobile-drawer {
    width: min(90vw, 360px);
    border-right: 1px solid rgba(255, 255, 255, .08);
    background:
      radial-gradient(circle at top left, rgba(37, 99, 235, .22), transparent 20rem),
      linear-gradient(180deg, #08111f 0%, #0b1220 100%);
    color: #e5edf7;
  }

  body.qm-erp2050 .qm-mobile-drawer .offcanvas-header {
    min-height: 74px;
    padding: max(14px, env(safe-area-inset-top)) 18px 14px;
    border-bottom: 1px solid rgba(255, 255, 255, .08);
  }

  body.qm-erp2050 .qm-mobile-drawer .offcanvas-body {
    padding: 14px 14px calc(18px + env(safe-area-inset-bottom));
    overflow-y: auto;
  }

  body.qm-erp2050 .qm-mobile-drawer .btn-close {
    width: 42px;
    height: 42px;
    margin: 0;
    border-radius: 14px;
    background-color: rgba(255, 255, 255, .1);
    filter: invert(1) grayscale(1);
    opacity: .9;
  }

  body.qm-erp2050 .qm-mobile-drawer .qm-brand {
    min-width: 0;
    color: #fff;
  }

  body.qm-erp2050 .qm-mobile-drawer .qm-brand-logo,
  body.qm-erp2050 .qm-mobile-drawer .qm-brand-mark {
    width: 44px;
    height: 44px;
    border-radius: 14px;
  }

  body.qm-erp2050 .qm-mobile-drawer .qm-nav {
    display: grid;
    gap: 12px;
  }

  body.qm-erp2050 .qm-mobile-drawer .qm-nav-group {
    display: grid;
    gap: 6px;
  }

  body.qm-erp2050 .qm-mobile-drawer .qm-nav-title {
    padding: 10px 12px 4px;
    color: rgba(226, 232, 240, .68);
    font-size: 11px;
    font-weight: 900;
    line-height: 1.2;
    text-transform: uppercase;
  }

  body.qm-erp2050 .qm-mobile-drawer .qm-nav-link {
    min-height: 48px;
    padding: 11px 14px;
    border-radius: 16px;
    display: grid;
    grid-template-columns: 24px minmax(0, 1fr);
    align-items: center;
    gap: 12px;
    color: rgba(226, 232, 240, .82);
    font-weight: 850;
    text-decoration: none;
  }

  body.qm-erp2050 .qm-mobile-drawer .qm-nav-link i {
    width: 24px;
    text-align: center;
    color: rgba(226, 232, 240, .74);
    font-size: 17px;
  }

  body.qm-erp2050 .qm-mobile-drawer .qm-nav-link span {
    min-width: 0;
    white-space: normal;
  }

  body.qm-erp2050 .qm-mobile-drawer .qm-nav-link.active {
    color: #fff;
    background: linear-gradient(135deg, #2563eb 0%, #14b8a6 100%);
    box-shadow: 0 16px 34px rgba(20, 184, 166, .24);
  }

  body.qm-erp2050 .qm-mobile-drawer .qm-nav-link.active i {
    color: #fff;
  }

  body.qm-erp2050 :where(.fixed-bottom, .sticky-bottom, .bottom-nav, .mobile-bottom-nav, .floating-action, .fab, .sticky-action) {
    bottom: max(12px, env(safe-area-inset-bottom));
  }

  body.qm-erp2050 :where(.fab, .floating-action, .sticky-action) {
    z-index: 1030;
    border-radius: 18px;
    box-shadow: var(--hrc-shadow-float);
  }

  body.qm-erp2050 :where(.empty-state, .blank-state, .no-data) {
    padding: 24px 16px;
    border-radius: var(--hrc-radius-lg);
    border: 1px dashed rgba(100, 116, 139, .24);
    background: rgba(255, 255, 255, .72);
    text-align: center;
  }
}

@media (max-width: 767.98px) {
  body.qm-erp2050 .qm-content {
    padding-left: 10px;
    padding-right: 10px;
  }

  body.qm-erp2050 :where(.card, .stat-card, .metric-card, .dashboard-card, .module-card, .filter-card, .table-card, .panel, .section-card, .erp-card, .kpi-card) {
    margin-bottom: 12px;
  }

  body.qm-erp2050 :where(.card-body, .card-header, .card-footer) {
    padding: 14px;
  }

  body.qm-erp2050 :where(.btn-group, .btn-toolbar) {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
  }

  body.qm-erp2050 :where(.btn-group) > .btn {
    width: 100%;
    border-radius: 14px;
  }

  body.qm-erp2050 :where(.input-group) {
    flex-wrap: nowrap;
  }

  body.qm-erp2050 :where(.input-group) > :where(.form-control, .form-select) {
    min-width: 0;
  }

  body.qm-erp2050 :where(.nav-tabs, .nav-pills) {
    flex-wrap: nowrap;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 4px;
    scrollbar-width: none;
  }

  body.qm-erp2050 :where(.nav-tabs, .nav-pills)::-webkit-scrollbar {
    display: none;
  }

  body.qm-erp2050 :where(.nav-tabs .nav-link, .nav-pills .nav-link) {
    min-height: 40px;
    border-radius: 999px;
    white-space: nowrap;
    font-weight: 800;
  }

  body.qm-erp2050 .alert {
    padding: 12px 14px;
  }

  body.qm-erp2050 .toast-container {
    width: calc(100% - 20px);
    left: 10px;
    right: 10px;
  }

  body.qm-erp2050 .toast {
    width: 100%;
  }
}

@media (max-width: 480px) {
  body.qm-erp2050 .qm-topbar {
    min-height: 54px;
    padding-left: 10px;
    padding-right: 10px;
  }

  body.qm-erp2050 .qm-icon-btn,
  body.qm-erp2050 .qm-topbar .qm-icon-btn,
  body.qm-erp2050 .qm-user-chip {
    width: 42px;
    height: 42px;
    min-width: 42px;
  }

  body.qm-erp2050 :where(h1, .h1) {
    font-size: 25px;
  }

  body.qm-erp2050 :where(h2, .h2) {
    font-size: 22px;
  }

  body.qm-erp2050 :where(.container, .container-fluid) {
    padding-left: 10px;
    padding-right: 10px;
  }

  body.qm-erp2050 .modal-dialog {
    width: calc(100% - 16px);
    max-width: calc(100% - 16px);
    margin-top: 8px;
  }

  body.qm-erp2050 .dropdown-menu {
    min-width: min(280px, calc(100vw - 20px));
  }
}

@media (max-width: 360px) {
  body.qm-erp2050 .qm-content {
    padding-left: 8px;
    padding-right: 8px;
  }

  body.qm-erp2050 :where(.card-body, .card-header, .card-footer, .modal-body) {
    padding: 12px;
  }

  body.qm-erp2050 .btn,
  body.qm-erp2050 button.btn {
    padding-left: 11px;
    padding-right: 11px;
  }

  body.qm-erp2050 :where(.form-control, .form-select) {
    padding-left: 12px;
    padding-right: 12px;
  }
}

@media (min-width: 992px) {
  body.qm-erp2050 .qm-topbar {
    min-height: 64px;
  }

  body.qm-erp2050 .qm-content {
    max-width: 100%;
  }
}

[data-qm-theme="dark"] body.qm-erp2050,
body.qm-erp2050[data-bs-theme="dark"] {
  --hrc-mobile-bg: #08111f;
  --hrc-mobile-surface: #0f172a;
  --hrc-mobile-surface-soft: #111c2e;
  --hrc-mobile-border: rgba(226, 232, 240, .12);
  --hrc-mobile-text: #e5edf7;
  --hrc-mobile-muted: #94a3b8;
  background:
    radial-gradient(circle at top right, rgba(20, 184, 166, .14), transparent 30rem),
    linear-gradient(180deg, #08111f 0%, #0b1220 100%);
  color: var(--hrc-mobile-text);
}

[data-qm-theme="dark"] body.qm-erp2050 :where(.qm-topbar, .card, .modal-content, .dropdown-menu, .table-responsive, .offcanvas:not(.qm-mobile-drawer), .toast, .alert),
body.qm-erp2050[data-bs-theme="dark"] :where(.qm-topbar, .card, .modal-content, .dropdown-menu, .table-responsive, .offcanvas:not(.qm-mobile-drawer), .toast, .alert) {
  background-color: rgba(15, 23, 42, .94);
  border-color: rgba(226, 232, 240, .12);
  color: var(--hrc-mobile-text);
}

[data-qm-theme="dark"] body.qm-erp2050 :where(.form-control, .form-select, .qm-icon-btn),
body.qm-erp2050[data-bs-theme="dark"] :where(.form-control, .form-select, .qm-icon-btn) {
  background-color: #111c2e;
  border-color: rgba(226, 232, 240, .14);
  color: var(--hrc-mobile-text);
}

[data-qm-theme="dark"] body.qm-erp2050 .table thead th,
body.qm-erp2050[data-bs-theme="dark"] .table thead th {
  background: #111c2e;
  color: #cbd5e1;
}

body:has(.auth-shell),
body.qm-public {
  max-width: 100%;
  overflow-x: hidden;
  background:
    radial-gradient(circle at top right, rgba(20, 184, 166, .1), transparent 28rem),
    linear-gradient(180deg, #f8fbff 0%, #f4f7fb 100%);
  font-family: "Be Vietnam Pro", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  text-size-adjust: 100%;
}

body:has(.auth-shell) :where(.auth-shell, .auth-card, .auth-main, .auth-panel, form),
body.qm-public :where(main, section, article, header, footer, .container, .tcv-footer-grid, .job-card, .apply-card, .public-card) {
  min-width: 0;
}

body:has(.auth-shell) :where(.auth-card, .auth-panel),
body.qm-public :where(.job-card, .apply-card, .public-card, .tcv-card, .tcv-footer) {
  border-radius: 18px;
  box-shadow: 0 10px 28px rgba(15, 23, 42, .08);
}

body:has(.auth-shell) :where(.form-control, .form-select, .btn),
body.qm-public :where(.form-control, .form-select, .btn, input, select, textarea, button) {
  min-height: 44px;
  border-radius: 14px;
}

body:has(.auth-shell) :where(.btn),
body.qm-public :where(.btn, button, a[class*="btn"]) {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-weight: 800;
}

body.qm-public :where(img, video, canvas, svg) {
  max-width: 100%;
}

body.qm-public :where(h1, h2, h3, h4, p, a, span, label, button, input, select, textarea) {
  overflow-wrap: anywhere;
}

@media (max-width: 860px) {
  body:has(.auth-shell) .auth-shell {
    width: 100%;
    max-width: 100%;
    margin: 0;
    padding: 12px;
    min-height: 100dvh;
    display: grid;
    align-items: center;
  }

  body:has(.auth-shell) .auth-card {
    border-radius: 22px;
  }

  body:has(.auth-shell) .auth-hero {
    padding: 22px;
  }

  body:has(.auth-shell) .auth-hero h1 {
    font-size: 26px;
  }

  body:has(.auth-shell) .auth-main {
    padding: 16px;
  }

  body:has(.auth-shell) .auth-tabs {
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 4px;
  }

  body:has(.auth-shell) .auth-tabs a {
    min-height: 42px;
    padding: 10px 12px;
    white-space: nowrap;
  }

  body:has(.auth-shell) .auth-panel {
    padding: 16px;
  }
}

@media (max-width: 768px) {
  body.qm-public {
    padding-bottom: max(12px, env(safe-area-inset-bottom));
  }

  body.qm-public :where(.container, .container-fluid, main, section) {
    max-width: 100%;
  }

  body.qm-public :where(.tcv-footer-grid, .jobs-grid, .job-grid, .public-grid, .apply-grid, .hero-grid) {
    display: grid;
    grid-template-columns: 1fr;
    gap: 14px;
  }

  body.qm-public :where(.job-card, .apply-card, .public-card, .tcv-card) {
    padding: 14px;
  }

  body.qm-public :where(h1) {
    font-size: 28px;
    line-height: 1.12;
  }

  body.qm-public :where(h2) {
    font-size: 23px;
    line-height: 1.18;
  }

  body.qm-public :where(.btn, button, a[class*="btn"]) {
    min-height: 44px;
    width: 100%;
  }

  body.qm-public :where(.form-control, .form-select, input, select, textarea) {
    min-height: 48px;
    font-size: 16px;
  }

  body.qm-public table {
    min-width: 640px;
  }

body.qm-public :where(.table-responsive, .overflow-auto) {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
}

/* 2026-07-01 mobile overlap rescue: keep drawer labels visible and fully framed. */
@media (max-width: 991.98px) {
  body.qm-erp2050 .qm-mobile-drawer.offcanvas {
    width: min(92vw, 380px) !important;
    max-width: min(92vw, 380px) !important;
    border: 1px solid rgba(226, 232, 240, .22) !important;
    border-left: 0 !important;
    border-radius: 0 18px 18px 0 !important;
    box-shadow: 18px 0 48px rgba(15, 23, 42, .34) !important;
    overflow: hidden !important;
  }

  body.qm-erp2050 .qm-mobile-drawer .offcanvas-body {
    overflow-x: hidden !important;
  }

  body.qm-erp2050 .qm-mobile-drawer .qm-nav-link {
    width: 100% !important;
    min-width: 0 !important;
    display: grid !important;
    grid-template-columns: 34px minmax(0, 1fr) !important;
    align-items: center !important;
    column-gap: 12px !important;
    overflow: visible !important;
  }

  body.qm-erp2050 .qm-mobile-drawer .qm-nav-link span,
  body.qm-erp2050 .qm-mobile-drawer .qm-nav-link small {
    position: static !important;
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    width: auto !important;
    height: auto !important;
    max-width: 100% !important;
    clip: auto !important;
    clip-path: none !important;
    transform: none !important;
    white-space: normal !important;
    overflow: visible !important;
    text-indent: 0 !important;
    color: inherit !important;
    font-size: 15px !important;
    line-height: 1.25 !important;
  }
}
