﻿/**
 * ROCAD Admin — shared mobile / tablet presentation layer.
 *
 * Screen-only. Desktop widths (>1024px) are intentionally untouched.
 * Do not import this into print/PDF capture.
 *
 * Breakpoints:
 *   <=1024  tablet adaptation
 *   <=767   mobile
 *   <=430   phone
 *   <=390   small phone
 */

/* -------------------------------------------------------------------------- */
/* <=1024 — tablet: contain overflow, keep desktop type sizes                 */
/* -------------------------------------------------------------------------- */

@media screen and (max-width: 1024px) {
  html,
  body {
    max-width: 100%;
    overflow-x: hidden;
  }

  #rocad-app.rocad-shell .wrapper,
  #rocad-app.rocad-shell .content-wrapper {
    max-width: 100%;
  }

  #rocad-app.rocad-shell .table-responsive,
  #rocad-app.rocad-shell .rocad-table-wrap,
  #rocad-app.rocad-shell .dataTables_wrapper,
  #rocad-app.rocad-shell .dataTables_scroll,
  #rocad-app.rocad-shell .dataTables_scrollBody,
  #rocad-app.rocad-shell .rocad-equipments-table-wrap,
  #rocad-app.rocad-shell .rocad-fi-an__table-wrap,
  #rocad-app.rocad-shell .rocad-dpr-batch-table-wrap {
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  #rocad-app.rocad-shell .rocad-table-page__toolbar,
  #rocad-app.rocad-shell .rocad-stock-toolbar,
  #rocad-app.rocad-shell .rocad-fi-an__toolbar,
  #rocad-app.rocad-shell .rocad-fi-an__toolbar-actions,
  #rocad-app.rocad-shell .rocad-gps-profile__actions {
    flex-wrap: wrap;
  }
}

/* -------------------------------------------------------------------------- */
/* <=767 — mobile shell, forms, tables, modals, Select2, touch targets        */
/* -------------------------------------------------------------------------- */

@media screen and (max-width: 767px) {
  #rocad-app.rocad-shell {
    --rocad-mobile-touch: 44px;
  }

  /* Page must not scroll sideways; tables scroll inside their wrap.
     AdminLTE JS sets content-wrapper min-height to the (tall) sidebar — that
     stretches the page and leaves a huge blank band under the title. */
  #rocad-app.rocad-shell .content-wrapper,
  #rocad-app.rocad-shell.rocad-shell--fixed .content-wrapper,
  #rocad-app.rocad-shell .right-side {
    min-height: 0 !important;
    height: auto !important;
  }

  #rocad-app.rocad-shell .content-wrapper,
  #rocad-app.rocad-shell section.content,
  #rocad-app.rocad-shell .rocad-table-page,
  #rocad-app.rocad-shell .rocad-form-page,
  #rocad-app.rocad-shell .rocad-dashboard-page {
    overflow-x: hidden;
    max-width: 100%;
    min-width: 0;
  }

  #rocad-app.rocad-shell .rocad-table-page {
    padding: 0.75rem 0.85rem 1.25rem !important;
  }

  #rocad-app.rocad-shell .rocad-table-page__breadcrumb {
    padding-top: 0.5rem;
    padding-bottom: 0;
  }

  #rocad-app.rocad-shell .rocad-table-page__intro {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 1rem !important;
  }

  #rocad-app.rocad-shell .rocad-table-page__intro-text {
    flex: 1 1 auto;
    min-width: 0;
  }

  #rocad-app.rocad-shell .rocad-table-page__meta {
    flex: 0 0 auto;
    margin: 0;
  }

  #rocad-app.rocad-shell .rocad-table-panel__header {
    padding: 0.85rem 0.9rem !important;
    gap: 0.75rem;
  }

  #rocad-app.rocad-shell .rocad-table-panel__body,
  #rocad-app.rocad-shell .box-body.rocad-table-panel__body {
    padding: 0.75rem !important;
  }

  #rocad-app.rocad-shell .rocad-table-page__stats {
    margin-bottom: 0.85rem;
  }

  /* Overlay drawer — do not shove the page 230px */
  body.sidebar-open #rocad-app.rocad-shell .content-wrapper,
  body.sidebar-open #rocad-app.rocad-shell .main-footer,
  body.sidebar-open .content-wrapper,
  body.sidebar-open .main-footer {
    -webkit-transform: none !important;
    transform: none !important;
  }

  /*
   * Layer order inside #rocad-app (isolation: isolate):
   * content ~820, backdrop 1040, sidebar 1050, topbar 1030 (header row).
   * Backdrop MUST live inside #rocad-app. A body-level overlay with z-index
   * 1070 paints above the isolated shell and intercepts sidebar taps.
   */
  #rocad-app.rocad-shell .rocad-mobile-sidebar-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 1040;
    pointer-events: none;
    background: rgba(15, 23, 42, 0.45);
  }

  #rocad-app.rocad-shell .rocad-mobile-sidebar-backdrop.is-visible {
    display: block;
    pointer-events: auto;
  }

  html[data-rocad-theme="dark"] #rocad-app.rocad-shell .rocad-mobile-sidebar-backdrop {
    background: rgba(2, 6, 23, 0.62);
  }

  #rocad-app.rocad-shell.rocad-shell--fixed .main-sidebar.rocad-sidebar,
  #rocad-app.rocad-shell .main-sidebar.rocad-sidebar {
    z-index: 1050;
    width: min(var(--rocad-shell-sidebar-width, 230px), calc(100vw - 48px)) !important;
    max-width: calc(100vw - 48px);
    pointer-events: none;
  }

  body.sidebar-open #rocad-app.rocad-shell.rocad-shell--fixed .main-sidebar.rocad-sidebar,
  body.sidebar-open #rocad-app.rocad-shell .main-sidebar.rocad-sidebar {
    pointer-events: auto;
  }

  body.sidebar-open #rocad-app.rocad-shell .rocad-sidebar__menu a,
  body.sidebar-open #rocad-app.rocad-shell .rocad-sidebar__menu button {
    pointer-events: auto;
    position: relative;
    z-index: 1;
  }

  #rocad-app.rocad-shell .rocad-sidebar__menu > li > a,
  #rocad-app.rocad-shell .rocad-sidebar__menu .treeview-menu > li > a {
    min-height: var(--rocad-mobile-touch);
    display: flex;
    align-items: center;
    font-size: 15px;
  }

  /* Topbar: keep controls in one row */
  #rocad-app.rocad-shell .rocad-topbar__toggle,
  #rocad-app.rocad-shell .rocad-theme-toggle,
  #rocad-app.rocad-shell .rocad-topbar__icon-btn,
  #rocad-app.rocad-shell .rocad-global-search__mobile-toggle,
  #rocad-app.rocad-shell .rocad-topbar__user-toggle {
    min-width: var(--rocad-mobile-touch);
    min-height: var(--rocad-mobile-touch);
  }

  #rocad-app.rocad-shell .navbar-nav > .notifications-menu > .dropdown-menu,
  #rocad-app.rocad-shell .rocad-topbar__dropdown--notifications,
  #rocad-app.rocad-shell .rocad-topbar__dropdown--user {
    max-width: calc(100vw - 16px);
    width: min(320px, calc(100vw - 16px));
    right: 8px;
    left: auto;
  }

  /* Restore readable table type — do not shrink to 12px to fit columns */
  #rocad-app.rocad-shell .rocad-table-page .rocad-table > thead > tr > th,
  #rocad-app.rocad-shell .rocad-table-page .rocad-table > tbody > tr > td,
  #rocad-app.rocad-shell .rocad-table-page .rocad-table > tfoot > tr > th,
  #rocad-app.rocad-shell table.table > thead > tr > th,
  #rocad-app.rocad-shell table.table > tbody > tr > td,
  #rocad-app.rocad-shell table.dataTable > thead > tr > th,
  #rocad-app.rocad-shell table.dataTable tbody td {
    font-size: 14px !important;
    line-height: 1.4;
    white-space: nowrap;
  }

  #rocad-app.rocad-shell .table-responsive > .table,
  #rocad-app.rocad-shell .rocad-table-wrap > table,
  #rocad-app.rocad-shell .dataTables_wrapper table.dataTable {
    margin-bottom: 0;
  }

  /* Frozen columns consume the phone — hide clones; source table still has all data */
  #rocad-app.rocad-shell .DTFC_LeftWrapper,
  #rocad-app.rocad-shell .DTFC_RightWrapper,
  #rocad-app.rocad-shell .DTFC_Blocker {
    display: none !important;
  }

  #rocad-app.rocad-shell .dataTables_scrollBody {
    margin-left: 0 !important;
  }

  /* Table swipe: the scrollport must be width-constrained; the table keeps min-width */
  #rocad-app.rocad-shell .box,
  #rocad-app.rocad-shell .rocad-table-panel,
  #rocad-app.rocad-shell .rocad-table-panel__body,
  #rocad-app.rocad-shell .box-body {
    min-width: 0;
    max-width: 100%;
  }

  #rocad-app.rocad-shell .table-responsive,
  #rocad-app.rocad-shell .rocad-table-wrap,
  #rocad-app.rocad-shell .dataTables_scroll,
  #rocad-app.rocad-shell .dataTables_scrollBody,
  #rocad-app.rocad-shell .rocad-equipments-table-wrap,
  #rocad-app.rocad-shell .rocad-fi-an__table-wrap,
  #rocad-app.rocad-shell .rocad-dpr-batch-table-wrap,
  #rocad-app.rocad-shell .export-area {
    display: block;
    width: 100% !important;
    max-width: 100%;
    min-width: 0;
    overflow-x: auto !important;
    overflow-y: visible;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-x pan-y;
    overscroll-behavior-x: contain;
  }

  #rocad-app.rocad-shell .dataTables_wrapper {
    display: block;
    width: 100% !important;
    max-width: 100%;
    min-width: 0;
    overflow: visible;
  }

  #rocad-app.rocad-shell .table-responsive > table,
  #rocad-app.rocad-shell .rocad-table-wrap > table,
  #rocad-app.rocad-shell .dataTables_wrapper > table,
  #rocad-app.rocad-shell .dataTables_scrollBody table,
  #rocad-app.rocad-shell table.table,
  #rocad-app.rocad-shell table.dataTable,
  #rocad-app.rocad-shell table.rocad-table {
    width: max-content !important;
    min-width: 720px;
    max-width: none !important;
  }

  /* Action / export buttons — 2-col card grid, not a tall 100% stack */
  #rocad-app.rocad-shell .rocad-table-page__btn,
  #rocad-app.rocad-shell .btn:not(.btn-xs):not(.close),
  #rocad-app.rocad-shell .rocad-row-actions__trigger,
  #rocad-app.rocad-shell .dropbtn {
    min-height: var(--rocad-mobile-touch);
    min-width: var(--rocad-mobile-touch);
  }

  #rocad-app.rocad-shell .rocad-table-page__toolbar,
  #rocad-app.rocad-shell .rocad-stock-toolbar,
  #rocad-app.rocad-shell .rocad-mobile-actions,
  #rocad-app.rocad-shell .rocad-fi-an__toolbar-actions {
    display: grid !important;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
    width: 100%;
    justify-content: stretch;
  }

  #rocad-app.rocad-shell .rocad-table-page__toolbar .rocad-table-page__btn,
  #rocad-app.rocad-shell .rocad-stock-toolbar .rocad-table-page__btn,
  #rocad-app.rocad-shell .rocad-mobile-actions .rocad-table-page__btn,
  #rocad-app.rocad-shell .rocad-fi-an__toolbar-actions .rocad-table-page__btn {
    width: 100% !important;
    max-width: none;
    flex: none !important;
    min-height: 48px;
    justify-content: center;
    border-radius: 0.7rem;
  }

  #rocad-app.rocad-shell .rocad-table-page__btn--secondary {
    background: var(--rocad-color-surface-raised, #fff);
    border-color: var(--rocad-color-border, #e2e8f0);
    color: var(--rocad-color-text, #0f172a);
  }

  #rocad-app.rocad-shell .dropdown-menu > li > a,
  #rocad-app.rocad-shell .rocad-row-actions__menu a,
  #rocad-app.rocad-shell .dropdown-content a {
    min-height: var(--rocad-mobile-touch);
    display: flex;
    align-items: center;
    padding-top: 0.65rem;
    padding-bottom: 0.65rem;
    font-size: 15px;
  }

  #rocad-app.rocad-shell .pagination > li > a,
  #rocad-app.rocad-shell .pagination > li > span,
  #rocad-app.rocad-shell .dataTables_paginate .paginate_button {
    min-width: var(--rocad-mobile-touch);
    min-height: var(--rocad-mobile-touch);
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  /* Forms: one column, 16px to stop iOS zoom, 44–48px fields */
  #rocad-app.rocad-shell .rocad-form-grid,
  #rocad-app.rocad-shell .rocad-profile-layout {
    grid-template-columns: 1fr !important;
  }

  #rocad-app.rocad-shell .form-horizontal .form-group,
  #rocad-app.rocad-shell .form-inline .form-group {
    display: block;
    width: 100%;
    margin-right: 0;
  }

  #rocad-app.rocad-shell .rocad-form-page .row > [class*="col-"],
  #rocad-app.rocad-shell .rocad-form-grid .row > [class*="col-"],
  #rocad-app.rocad-shell form.form-horizontal .row > [class*="col-"] {
    width: 100%;
    float: none;
    display: block;
  }

  #rocad-app.rocad-shell .form-control,
  #rocad-app.rocad-shell input[type="text"],
  #rocad-app.rocad-shell input[type="email"],
  #rocad-app.rocad-shell input[type="number"],
  #rocad-app.rocad-shell input[type="password"],
  #rocad-app.rocad-shell input[type="search"],
  #rocad-app.rocad-shell input[type="tel"],
  #rocad-app.rocad-shell input[type="url"],
  #rocad-app.rocad-shell input[type="date"],
  #rocad-app.rocad-shell input[type="datetime-local"],
  #rocad-app.rocad-shell input[type="file"],
  #rocad-app.rocad-shell select,
  #rocad-app.rocad-shell textarea {
    width: 100%;
    max-width: 100%;
    min-height: 48px;
    font-size: 16px !important;
  }

  #rocad-app.rocad-shell textarea {
    min-height: 96px;
  }

  #rocad-app.rocad-shell .select2-container--default .select2-selection--single,
  #rocad-app.rocad-shell .select2-container--default .select2-selection--multiple {
    min-height: 48px;
    font-size: 16px;
  }

  #rocad-app.rocad-shell .select2-container--default .select2-selection--single .select2-selection__rendered {
    line-height: 46px;
    font-size: 16px;
  }

  #rocad-app.rocad-shell .select2-container--default .select2-selection--single .select2-selection__arrow {
    height: 46px;
  }

  #rocad-app.rocad-shell label,
  #rocad-app.rocad-shell .control-label {
    display: block;
    float: none;
    width: 100%;
    text-align: left;
    margin-bottom: 0.35rem;
    padding-top: 0;
  }

  #rocad-app.rocad-shell .checkbox label,
  #rocad-app.rocad-shell .radio label,
  #rocad-app.rocad-shell .rocad-payroll-staff-item label {
    display: flex;
    align-items: center;
    min-height: var(--rocad-mobile-touch);
    font-size: 15px;
    gap: 0.65rem;
  }

  #rocad-app.rocad-shell input[type="checkbox"],
  #rocad-app.rocad-shell input[type="radio"] {
    width: 22px;
    height: 22px;
    min-width: 22px;
    min-height: 22px;
  }

  #rocad-app.rocad-shell .rocad-payroll-staff-list {
    max-height: min(60vh, 420px);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  #rocad-app.rocad-shell .rocad-payroll-staff-item {
    min-height: var(--rocad-mobile-touch);
  }

  /* Filter rows: stack; do not squeeze 6 fields into one line */
  #rocad-app.rocad-shell .rocad-penalty-filter-card .row > [class*="col-"],
  #rocad-app.rocad-shell .box-body form .row > [class*="col-"],
  #rocad-app.rocad-shell .rocad-table-page form .row > [class*="col-"],
  #rocad-app.rocad-shell .modal-body .row > [class*="col-"] {
    width: 100%;
    margin-bottom: 0.75rem;
  }

  /* Modals → near-full-screen sheets */
  #rocad-app.rocad-shell .modal-dialog,
  body > .modal .modal-dialog {
    width: calc(100vw - 16px);
    max-width: calc(100vw - 16px);
    margin: 8px auto;
  }

  #rocad-app.rocad-shell .modal-content,
  body > .modal .modal-content {
    max-height: calc(100dvh - 16px);
    display: flex;
    flex-direction: column;
  }

  #rocad-app.rocad-shell .modal-body,
  body > .modal .modal-body {
    max-height: none;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    flex: 1 1 auto;
  }

  #rocad-app.rocad-shell .modal-footer,
  body > .modal .modal-footer {
    position: sticky;
    bottom: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: stretch;
  }

  #rocad-app.rocad-shell .modal-footer .btn,
  body > .modal .modal-footer .btn {
    flex: 1 1 calc(50% - 0.5rem);
    min-height: var(--rocad-mobile-touch);
  }

  #rocad-app.rocad-shell .modal-header .close {
    min-width: var(--rocad-mobile-touch);
    min-height: var(--rocad-mobile-touch);
    opacity: 1;
  }

  /* Select2 dropdown stays in viewport */
  .select2-container--open .select2-dropdown,
  body > .select2-container .select2-dropdown {
    max-width: calc(100vw - 16px) !important;
  }

  .select2-container--open .select2-search--dropdown .select2-search__field {
    min-height: 44px;
    font-size: 16px !important;
  }

  .select2-results__option {
    min-height: 44px;
    padding-top: 10px;
    padding-bottom: 10px;
    font-size: 15px;
  }

  /*
   * App-wide mobile summary cards:
   * compact 2-column grid (not tall stacked full-width cards).
   * Covers Sites, Staffs, reports, construction-site cards, KPI hubs, LN cards.
   */
  #rocad-app.rocad-shell .rocad-table-page__stats,
  #rocad-app.rocad-shell .rocad-construction-site-cards,
  #rocad-app.rocad-shell .rocad-daily-report-cards,
  #rocad-app.rocad-shell .rocad-five-stat-cards,
  #rocad-app.rocad-shell .rocad-dashboard__kpi-grid,
  #rocad-app.rocad-shell .rocad-fi-an__kpi-grid {
    display: flex !important;
    flex-wrap: wrap;
    margin-left: -0.35rem !important;
    margin-right: -0.35rem !important;
    margin-bottom: 0.75rem !important;
  }

  #rocad-app.rocad-shell .rocad-table-page__stats > [class*="col-"],
  #rocad-app.rocad-shell .rocad-construction-site-cards > [class*="col-"],
  #rocad-app.rocad-shell .rocad-daily-report-cards > [class*="col-"],
  #rocad-app.rocad-shell .rocad-five-stat-cards > [class*="col-"],
  #rocad-app.rocad-shell .rocad-dashboard__kpi-grid > [class*="col-"],
  #rocad-app.rocad-shell .rocad-fi-an__kpi-grid > [class*="col-"],
  #rocad-app.rocad-shell .rocad-table-page__stats .col-lg-3,
  #rocad-app.rocad-shell .rocad-table-page__stats .col-lg-4,
  #rocad-app.rocad-shell .rocad-table-page__stats .col-md-4,
  #rocad-app.rocad-shell .rocad-table-page__stats .col-md-6,
  #rocad-app.rocad-shell .rocad-table-page__stats .col-sm-6,
  #rocad-app.rocad-shell .rocad-table-page__stats .col-xs-12 {
    width: 50% !important;
    float: none !important;
    display: block;
    padding-left: 0.35rem !important;
    padding-right: 0.35rem !important;
    margin-bottom: 0.7rem !important;
  }

  #rocad-app.rocad-shell .rocad-ln-cards,
  #rocad-app.rocad-shell .rocad-fin-kpis {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 0.7rem !important;
    margin-bottom: 0.85rem !important;
  }

  #rocad-app.rocad-shell .rocad-staff-stat-link {
    display: block;
    height: 100%;
  }

  #rocad-app.rocad-shell .rocad-table-stat-card,
  #rocad-app.rocad-shell .rocad-construction-site-cards .rocad-table-stat-card,
  #rocad-app.rocad-shell .rocad-kpi,
  #rocad-app.rocad-shell .rocad-fi-an__kpi {
    min-height: 0 !important;
    height: auto !important;
    padding: 0.7rem 0.8rem !important;
    border-radius: 0.85rem !important;
  }

  #rocad-app.rocad-shell .rocad-table-stat-card__title,
  #rocad-app.rocad-shell .rocad-construction-site-cards .rocad-table-stat-card__title,
  #rocad-app.rocad-shell .rocad-kpi__label,
  #rocad-app.rocad-shell .rocad-fi-an__kpi-label {
    min-height: 0 !important;
    margin: 0 !important;
    font-size: 0.72rem !important;
    font-weight: 700 !important;
    line-height: 1.25 !important;
    letter-spacing: 0.02em;
    text-transform: uppercase;
  }

  #rocad-app.rocad-shell .rocad-table-stat-card .rocad-staff-stat-value,
  #rocad-app.rocad-shell .rocad-table-stat-card__value,
  #rocad-app.rocad-shell .rocad-kpi__value,
  #rocad-app.rocad-shell .rocad-fi-an__kpi-value,
  #rocad-app.rocad-shell .rocad-ln-cards .rocad-staff-stat-value {
    margin: 0.35rem 0 0 !important;
    font-size: 1.2rem !important;
    line-height: 1.15 !important;
  }

  #rocad-app.rocad-shell .rocad-table-stat-card__hint,
  #rocad-app.rocad-shell .rocad-kpi__hint,
  #rocad-app.rocad-shell .rocad-ln-card__hint {
    margin-top: 0.25rem !important;
    font-size: 0.7rem !important;
    line-height: 1.3 !important;
  }

  #rocad-app.rocad-shell .rocad-table-stat-card .fa,
  #rocad-app.rocad-shell .rocad-kpi__icon {
    font-size: 0.95rem !important;
  }

  #rocad-app.rocad-shell .rocad-kpi__icon {
    width: 2rem !important;
    height: 2rem !important;
    min-width: 2rem !important;
  }

  /* GPS tabs: swipe row, do not crush labels */
  #rocad-app.rocad-shell .rocad-gps-profile__tabs,
  #rocad-app.rocad-shell .nav-tabs {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    gap: 0.4rem;
  }

  #rocad-app.rocad-shell .rocad-gps-profile__tab,
  #rocad-app.rocad-shell .nav-tabs > li {
    flex: 0 0 auto;
    float: none;
  }

  #rocad-app.rocad-shell .rocad-gps-profile__tab {
    min-height: var(--rocad-mobile-touch);
    white-space: nowrap;
  }

  /* Fleet operations table stays full data, scrolls inside wrap */
  #rocad-app.rocad-shell .rocad-fi-an__table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  #rocad-app.rocad-shell .rocad-fi-an__date-presets {
    flex-wrap: wrap;
  }

  #rocad-app.rocad-shell .rocad-fi-an__date-preset {
    min-height: var(--rocad-mobile-touch);
  }

  /* File inputs */
  #rocad-app.rocad-shell input[type="file"] {
    padding: 0.55rem;
  }

  /*
   * DataTables Show entries + Search — mobile friendly
   * Stack: Search first (full width), then Show entries as one tidy row.
   */
  #rocad-app.rocad-shell .dataTables_wrapper > .row:first-child,
  #rocad-app.rocad-shell .rocad-table-page .dataTables_wrapper .row:first-child,
  #rocad-app.rocad-shell .box-body > .dataTables_wrapper > .row:first-child {
    display: flex !important;
    flex-direction: column !important;
    flex-wrap: nowrap !important;
    align-items: stretch !important;
    gap: 0.65rem !important;
    margin: 0 0 0.85rem !important;
  }

  #rocad-app.rocad-shell .dataTables_wrapper .dataTables_length,
  #rocad-app.rocad-shell .dataTables_wrapper .dataTables_filter,
  #rocad-app.rocad-shell .rocad-table-page .dataTables_wrapper .row:first-child > [class*="col-"],
  #rocad-app.rocad-shell .dataTables_wrapper > .row:first-child > [class*="col-"] {
    float: none !important;
    width: 100% !important;
    max-width: 100% !important;
    flex: 0 0 auto !important;
    margin: 0 !important;
    padding: 0 !important;
    text-align: left !important;
  }

  /* Put Search above Show entries */
  #rocad-app.rocad-shell .dataTables_wrapper .dataTables_filter,
  #rocad-app.rocad-shell .dataTables_wrapper > .row:first-child > [class*="col-"]:has(.dataTables_filter) {
    order: -1;
  }

  #rocad-app.rocad-shell .dataTables_length label,
  #rocad-app.rocad-shell .rocad-table-page .dataTables_length label {
    display: flex !important;
    flex-wrap: nowrap !important;
    align-items: center !important;
    justify-content: flex-start !important;
    gap: 0.45rem !important;
    width: 100%;
    margin: 0 !important;
    font-size: 0.8125rem !important;
    font-weight: 600 !important;
    line-height: 1.2 !important;
    white-space: nowrap !important;
    color: #64748b !important;
  }

  #rocad-app.rocad-shell .dataTables_filter label,
  #rocad-app.rocad-shell .rocad-table-page .dataTables_filter label {
    display: flex !important;
    flex-direction: column !important;
    flex-wrap: nowrap !important;
    align-items: stretch !important;
    gap: 0.4rem !important;
    width: 100%;
    margin: 0 !important;
    font-size: 0.8125rem !important;
    font-weight: 600 !important;
    line-height: 1.2 !important;
    color: #64748b !important;
  }

  #rocad-app.rocad-shell .dataTables_length select,
  #rocad-app.rocad-shell .rocad-table-page .dataTables_length select {
    flex: 0 0 auto;
    width: auto !important;
    min-width: 4.75rem;
    max-width: 6.5rem;
    min-height: 44px !important;
    height: 44px !important;
    padding: 0 0.55rem !important;
    font-size: 16px !important; /* avoid iOS zoom */
    border-radius: 0.55rem !important;
  }

  #rocad-app.rocad-shell .dataTables_filter input,
  #rocad-app.rocad-shell .rocad-table-page .dataTables_filter input {
    display: block;
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    min-height: 44px !important;
    height: 44px !important;
    padding: 0 0.75rem !important;
    font-size: 16px !important; /* avoid iOS zoom */
    border-radius: 0.55rem !important;
  }

  #rocad-app.rocad-shell .dataTables_wrapper .dataTables_info,
  #rocad-app.rocad-shell .dataTables_wrapper .dataTables_paginate {
    float: none !important;
    width: 100% !important;
    text-align: left !important;
    margin-top: 0.55rem !important;
  }

  #rocad-app.rocad-shell .dataTables_wrapper .dataTables_paginate .paginate_button {
    min-height: 40px;
    min-width: 40px;
    padding: 0.45rem 0.7rem !important;
  }

  #rocad-app.rocad-shell .dataTables_wrapper .row:last-child {
    display: flex !important;
    flex-direction: column !important;
    gap: 0.5rem;
    margin: 0 !important;
  }

  #rocad-app.rocad-shell .dataTables_wrapper .row:last-child > [class*="col-"] {
    float: none !important;
    width: 100% !important;
    padding: 0 !important;
  }
}

/* -------------------------------------------------------------------------- */
/* <=430 — phone                                                              */
/* -------------------------------------------------------------------------- */

@media screen and (max-width: 430px) {
  /* Keep summary cards 2-across on small phones (avoid tall stacked cards) */
  #rocad-app.rocad-shell .rocad-table-page__stats > [class*="col-"],
  #rocad-app.rocad-shell .rocad-construction-site-cards > [class*="col-"],
  #rocad-app.rocad-shell .rocad-daily-report-cards > [class*="col-"],
  #rocad-app.rocad-shell .rocad-five-stat-cards > [class*="col-"],
  #rocad-app.rocad-shell .rocad-dashboard__kpi-grid > [class*="col-"],
  #rocad-app.rocad-shell .rocad-fi-an__kpi-grid > [class*="col-"] {
    width: 50% !important;
  }

  #rocad-app.rocad-shell .rocad-ln-cards,
  #rocad-app.rocad-shell .rocad-fin-kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  #rocad-app.rocad-shell .rocad-table-stat-card,
  #rocad-app.rocad-shell .rocad-kpi,
  #rocad-app.rocad-shell .rocad-fi-an__kpi {
    padding: 0.65rem 0.7rem !important;
  }

  #rocad-app.rocad-shell .rocad-table-stat-card .rocad-staff-stat-value,
  #rocad-app.rocad-shell .rocad-kpi__value,
  #rocad-app.rocad-shell .rocad-fi-an__kpi-value {
    font-size: 1.1rem !important;
  }

  #rocad-app.rocad-shell .navbar-nav > .notifications-menu > .dropdown-menu,
  #rocad-app.rocad-shell .rocad-topbar__dropdown--notifications,
  #rocad-app.rocad-shell .rocad-topbar__dropdown--user {
    width: calc(100vw - 12px);
    max-width: calc(100vw - 12px);
    right: 6px;
  }

  #rocad-app.rocad-shell .rocad-global-search.is-open .rocad-global-search__dropdown {
    left: 8px;
    right: 8px;
    max-height: min(70dvh, calc(100dvh - 5.5rem));
  }

  #rocad-app.rocad-shell .rocad-global-search__result,
  #rocad-app.rocad-shell .rocad-global-search a {
    min-height: 44px;
  }
}

/* -------------------------------------------------------------------------- */
/* <=390 — small phone                                                        */
/* -------------------------------------------------------------------------- */

@media screen and (max-width: 390px) {
  #rocad-app.rocad-shell .main-header.rocad-topbar .logo.rocad-topbar__logo {
    max-width: 72px;
    padding-left: 6px;
    padding-right: 6px;
  }

  #rocad-app.rocad-shell .rocad-table-page__title,
  #rocad-app.rocad-shell .rocad-dash-hero__greeting,
  #rocad-app.rocad-shell .rocad-fi-an__title {
    font-size: 1.35rem;
    line-height: 1.25;
  }

  #rocad-app.rocad-shell .content-wrapper {
    padding-left: 0;
    padding-right: 0;
  }

  #rocad-app.rocad-shell .rocad-table-page,
  #rocad-app.rocad-shell .rocad-form-page,
  #rocad-app.rocad-shell .rocad-dashboard-page {
    padding-left: 0.75rem;
    padding-right: 0.75rem;
  }
}

/* Dark mode — mobile surfaces stay on-theme */
@media screen and (max-width: 767px) {
  html[data-rocad-theme="dark"] #rocad-app.rocad-shell .modal-content,
  html[data-rocad-theme="dark"] body > .modal .modal-content,
  html[data-rocad-theme="dark"] #rocad-app.rocad-shell .rocad-topbar__dropdown,
  html[data-rocad-theme="dark"] .select2-dropdown {
    background-color: #141e2e;
    color: #e5e7eb;
    border-color: #243044;
  }

  html[data-rocad-theme="dark"] #rocad-app.rocad-shell .form-control,
  html[data-rocad-theme="dark"] #rocad-app.rocad-shell select,
  html[data-rocad-theme="dark"] #rocad-app.rocad-shell textarea,
  html[data-rocad-theme="dark"] #rocad-app.rocad-shell input[type="text"],
  html[data-rocad-theme="dark"] #rocad-app.rocad-shell input[type="date"],
  html[data-rocad-theme="dark"] #rocad-app.rocad-shell input[type="number"] {
    background-color: #111827;
    color: #e5e7eb;
    border-color: #334155;
  }

  html[data-rocad-theme="dark"] #rocad-app.rocad-shell .rocad-table-panel,
  html[data-rocad-theme="dark"] #rocad-app.rocad-shell .box,
  html[data-rocad-theme="dark"] #rocad-app.rocad-shell .rocad-table-panel__body,
  html[data-rocad-theme="dark"] #rocad-app.rocad-shell .table-responsive,
  html[data-rocad-theme="dark"] #rocad-app.rocad-shell .rocad-table-wrap,
  html[data-rocad-theme="dark"] #rocad-app.rocad-shell .dataTables_wrapper {
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }

  html[data-rocad-theme="dark"] #rocad-app.rocad-shell .rocad-table-page__btn--secondary {
    background: #1e293b;
    border-color: #334155;
    color: #e5e7eb;
  }
}

/* Daily plant report entry: one card per plant, no sideways table */
@media screen and (max-width: 1024px) {
  #rocad-app.rocad-shell .rocad-form-page--plant-dpr .rocad-dpr-entry__table-wrap {
    overflow: visible !important;
  }

  #rocad-app.rocad-shell .rocad-form-page--plant-dpr .rocad-dpr-entry__table,
  #rocad-app.rocad-shell .rocad-form-page--plant-dpr table.rocad-dpr-entry__table {
    display: block !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
  }

  #rocad-app.rocad-shell .rocad-form-page--plant-dpr .rocad-dpr-entry__table thead {
    display: none;
  }

  #rocad-app.rocad-shell .rocad-form-page--plant-dpr .rocad-dpr-entry__table tbody {
    display: block;
  }

  #rocad-app.rocad-shell .rocad-form-page--plant-dpr .rocad-dpr-entry__row {
    display: block;
    width: 100%;
    margin: 0 0 0.85rem;
    padding: 0.85rem 0.9rem 0.35rem;
    border: 1px solid var(--rocad-color-border, #e2e8f0) !important;
    border-radius: 0.85rem;
    background: var(--rocad-color-surface-raised, #fff);
  }

  #rocad-app.rocad-shell .rocad-form-page--plant-dpr .rocad-dpr-entry__row > td {
    display: block;
    width: 100% !important;
    min-width: 0 !important;
    max-width: none !important;
    padding: 0.35rem 0 0.55rem !important;
    border: 0 !important;
  }

  #rocad-app.rocad-shell .rocad-form-page--plant-dpr .rocad-dpr-entry__sn {
    display: none;
  }

  #rocad-app.rocad-shell .rocad-form-page--plant-dpr .rocad-dpr-entry__sr-only,
  #rocad-app.rocad-shell .rocad-form-page--plant-dpr .rocad-dpr-entry__field-label {
    position: static;
    display: block;
    width: auto;
    height: auto;
    margin: 0 0 0.3rem;
    overflow: visible;
    clip: auto;
    white-space: normal;
    font-size: 1rem !important;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    color: var(--rocad-color-text-muted, #64748b);
  }

  #rocad-app.rocad-shell .rocad-form-page--plant-dpr .rocad-dpr-entry__site-text {
    min-width: 0;
    max-width: none;
  }

  #rocad-app.rocad-shell .rocad-form-page--plant-dpr .rocad-dpr-entry__table .form-control {
    min-width: 0 !important;
    width: 100% !important;
    max-width: none !important;
  }

  #rocad-app.rocad-shell .rocad-form-page--plant-dpr .rocad-form-actions {
    position: sticky;
    bottom: 0;
    z-index: 20;
  }
}

/* -------------------------------------------------------------------------- */
/* Wave 1 — mobile list cards, sticky actions, notifications, login helpers   */
/* -------------------------------------------------------------------------- */

/* Desktop: hide mobile card lists / sticky notif bars */
.rocad-mlist,
.rocad-m-sticky-actions {
  display: none;
}

@media screen and (max-width: 767px) {
  /*
   * Directory / pick-a-row pages: cards only (no table under the cards).
   * Report pages below still keep swipeable tables.
   */
  #rocad-app.rocad-shell .rocad-table-page--cards-mobile .rocad-table-wrap,
  #rocad-app.rocad-shell .rocad-table-page--cards-mobile .dataTables_wrapper,
  #rocad-app.rocad-shell .rocad-table-page--cards-mobile .dataTables_length,
  #rocad-app.rocad-shell .rocad-table-page--cards-mobile .dataTables_filter,
  #rocad-app.rocad-shell .rocad-table-page--cards-mobile .dataTables_info,
  #rocad-app.rocad-shell .rocad-table-page--cards-mobile .dataTables_paginate,
  #rocad-app.rocad-shell .rocad-table-page--cards-mobile .dt-buttons {
    display: none !important;
  }

  /* Keep tables visible on numeric / compare report pages */
  #rocad-app.rocad-shell .rocad-table-page--ops-report:not(.rocad-table-page--cards-mobile) .rocad-table-wrap,
  #rocad-app.rocad-shell .rocad-table-page--ops-report:not(.rocad-table-page--cards-mobile) .dataTables_wrapper,
  #rocad-app.rocad-shell .rocad-table-page--dpr-batches .rocad-dpr-batch-table-wrap,
  #rocad-app.rocad-shell .rocad-table-page--dpr-batches #batchTable_wrapper,
  #rocad-app.rocad-shell .rocad-table-page--requisition-report:not(.rocad-table-page--cards-mobile) .rocad-table-wrap,
  #rocad-app.rocad-shell .rocad-table-page--requisition-report:not(.rocad-table-page--cards-mobile) .dataTables_wrapper,
  #rocad-app.rocad-shell .rocad-table-page--daily-report:not(.rocad-table-page--cards-mobile) .rocad-table-wrap,
  #rocad-app.rocad-shell .rocad-table-page--daily-report:not(.rocad-table-page--cards-mobile) .dataTables_wrapper,
  #rocad-app.rocad-shell .rocad-table-page--stock-expenses .rocad-table-wrap,
  #rocad-app.rocad-shell .rocad-table-page--stock-expenses .dataTables_wrapper {
    display: block !important;
    width: 100% !important;
    max-width: 100%;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
  }

  /* Ops reports (laterite etc.): one scrollport, full column width */
  #rocad-app.rocad-shell .rocad-table-page--ops-report .dataTables_scrollBody {
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
  }

  #rocad-app.rocad-shell .rocad-table-page--ops-report .dataTables_scrollHeadInner,
  #rocad-app.rocad-shell .rocad-table-page--ops-report .dataTables_scrollHeadInner table,
  #rocad-app.rocad-shell .rocad-table-page--ops-report #lateriteTable {
    width: max-content !important;
    min-width: 1800px !important;
    max-width: none !important;
  }

  /* Ops report totals — compact 2-col summary chips */
  #rocad-app.rocad-shell .rocad-table-page--ops-report .export-totals {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.5rem;
    margin: 0 0 0.85rem !important;
    text-align: left !important;
  }

  #rocad-app.rocad-shell .rocad-table-page--ops-report .export-totals .btn {
    width: 100%;
    min-height: 44px;
    margin: 0 !important;
    white-space: normal;
    line-height: 1.25;
    font-size: 0.78rem;
    font-weight: 700;
  }

  #rocad-app.rocad-shell .rocad-mlist__hint {
    margin: 0 0 0.65rem;
    font-size: 0.8125rem;
    color: var(--rocad-color-text-muted, #64748b);
  }

  /* Site hub: hide desktop feeds when mobile cards present; larger module taps */
  #rocad-app.rocad-shell .rocad-table-page--site-hub .rocad-site-hub-feed {
    display: none !important;
  }

  #rocad-app.rocad-shell .rocad-site-hub .rocad-site-hub-mod {
    min-height: 64px;
    margin-bottom: 0.7rem;
  }

  #rocad-app.rocad-shell .rocad-site-hub .rocad-site-hub-bars {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  #rocad-app.rocad-shell .rocad-site-hub .col-md-8,
  #rocad-app.rocad-shell .rocad-site-hub .col-md-6,
  #rocad-app.rocad-shell .rocad-site-hub .col-md-4 {
    width: 100%;
    float: none;
  }

  /* Stock card entry: keep history table scrollable; sticky submit */
  #rocad-app.rocad-shell .rocad-table-page--stock-expenses .rocad-table-wrap,
  #rocad-app.rocad-shell .rocad-table-page--stock-expenses .dataTables_wrapper {
    display: block !important;
  }

  #rocad-app.rocad-shell .rocad-stock-expenses-footer {
    position: sticky;
    bottom: 0;
    z-index: 25;
    margin: 0.75rem -0.75rem -0.75rem;
    padding: 0.75rem 0.85rem calc(0.75rem + env(safe-area-inset-bottom, 0px));
    background: var(--rocad-color-surface-raised, #fff);
    border-top: 1px solid var(--rocad-color-border, #e2e8f0);
    box-shadow: 0 -8px 24px rgba(15, 23, 42, 0.08);
  }

  #rocad-app.rocad-shell .rocad-stock-expenses-actions {
    display: grid !important;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
  }

  #rocad-app.rocad-shell .rocad-stock-expenses-actions .rocad-table-page__btn {
    width: 100%;
    min-height: 48px;
    float: none !important;
    justify-content: center;
  }

  #rocad-app.rocad-shell .exp-decide-actions {
    display: grid !important;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
  }

  #rocad-app.rocad-shell .exp-decide-actions .rocad-table-page__btn {
    width: 100%;
    min-height: 48px;
    justify-content: center;
  }

  /* Approve notif sticky bars */
  #rocad-app.rocad-shell .rocad-m-sticky-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
    position: sticky;
    bottom: 0;
    z-index: 30;
    margin: 1rem 0 0;
    padding: 0.75rem 0.85rem calc(0.75rem + env(safe-area-inset-bottom, 0px));
    background: var(--rocad-color-surface-raised, #fff);
    border-top: 1px solid var(--rocad-color-border, #e2e8f0);
    box-shadow: 0 -8px 24px rgba(15, 23, 42, 0.08);
  }

  #rocad-app.rocad-shell .rocad-m-sticky-actions .rocad-table-page__btn {
    width: 100%;
    min-height: 48px;
    justify-content: center;
  }

  #rocad-app.rocad-shell .rocad-m-sticky-actions--single {
    grid-template-columns: 1fr;
  }

  #rocad-app.rocad-shell .rocad-rr-filter-modal__content {
    width: calc(100vw - 16px) !important;
    max-width: none !important;
    margin: 8px auto !important;
  }

  #rocad-app.rocad-shell .rocad-mlist {
    display: flex;
    flex-direction: column;
    gap: 0.7rem;
    margin: 0 0 0.25rem;
    padding: 0;
    list-style: none;
  }

  #rocad-app.rocad-shell .rocad-mlist__card {
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
    margin: 0;
    padding: 0.9rem 0.95rem;
    border: 1px solid var(--rocad-color-border, #e2e8f0);
    border-radius: 0.9rem;
    background: var(--rocad-color-surface-raised, #fff);
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
  }

  #rocad-app.rocad-shell .rocad-mlist__top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.65rem;
  }

  #rocad-app.rocad-shell .rocad-mlist__title {
    margin: 0;
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.3;
    color: var(--rocad-color-text, #0f172a);
    word-break: break-word;
  }

  #rocad-app.rocad-shell .rocad-mlist__title a {
    color: inherit;
    text-decoration: none;
  }

  #rocad-app.rocad-shell .rocad-mlist__meta {
    margin: 0;
    font-size: 0.875rem;
    line-height: 1.4;
    color: var(--rocad-color-text-muted, #64748b);
  }

  /* Loading note / plant release — site route is primary info after the number */
  #rocad-app.rocad-shell .rocad-table-page--loading-note .rocad-mlist__meta--sites,
  #rocad-app.rocad-shell .rocad-table-page--plant-release .rocad-mlist__meta--sites,
  #rocad-app.rocad-shell .rocad-table-page--plant-release-history .rocad-mlist__meta--sites {
    font-size: 1.0625rem;
    font-weight: 700;
    line-height: 1.35;
    color: var(--rocad-color-text, #0f172a);
    word-break: break-word;
  }

  #rocad-app.rocad-shell .rocad-mlist__chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
  }

  #rocad-app.rocad-shell .rocad-mlist__chip {
    display: inline-flex;
    align-items: center;
    min-height: 1.6rem;
    padding: 0.15rem 0.5rem;
    border-radius: 999px;
    background: #f1f5f9;
    color: #334155;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.02em;
  }

  #rocad-app.rocad-shell .rocad-mlist__chip--good {
    background: #dcfce7;
    color: #166534;
  }

  #rocad-app.rocad-shell .rocad-mlist__chip--idle {
    background: #fef3c7;
    color: #92400e;
  }

  #rocad-app.rocad-shell .rocad-mlist__chip--bad {
    background: #fee2e2;
    color: #991b1b;
  }

  #rocad-app.rocad-shell .rocad-mlist__actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
    margin-top: 0.15rem;
  }

  #rocad-app.rocad-shell .rocad-mlist__actions .rocad-table-page__btn,
  #rocad-app.rocad-shell .rocad-mlist__actions .btn {
    width: 100%;
    min-height: 44px;
    justify-content: center;
    border-radius: 0.7rem;
    font-size: 0.9rem;
    font-weight: 700;
  }

  #rocad-app.rocad-shell .rocad-mlist__actions--single {
    grid-template-columns: 1fr;
  }

  /* Sticky primary actions on receive / approve forms */
  #rocad-app.rocad-shell .rocad-form-actions {
    position: sticky;
    bottom: 0;
    z-index: 25;
    margin: 0 -0.75rem -0.75rem;
    padding: 0.75rem 0.85rem calc(0.75rem + env(safe-area-inset-bottom, 0px));
    background: var(--rocad-color-surface-raised, #fff);
    border-top: 1px solid var(--rocad-color-border, #e2e8f0);
    box-shadow: 0 -8px 24px rgba(15, 23, 42, 0.08);
  }

  #rocad-app.rocad-shell .rocad-form-actions__hint {
    margin: 0 0 0.65rem;
    font-size: 0.8rem;
    line-height: 1.35;
  }

  #rocad-app.rocad-shell .ln-receive-actions,
  #rocad-app.rocad-shell .pr-receive-actions,
  #rocad-app.rocad-shell .pr-decision-actions {
    display: grid !important;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
  }

  #rocad-app.rocad-shell .pr-decision-actions {
    grid-template-columns: 1fr 1fr;
  }

  #rocad-app.rocad-shell .pr-decision-actions > a {
    grid-column: 1 / -1;
  }

  #rocad-app.rocad-shell .ln-receive-actions .rocad-table-page__btn,
  #rocad-app.rocad-shell .pr-receive-actions .rocad-table-page__btn,
  #rocad-app.rocad-shell .pr-decision-actions .rocad-table-page__btn {
    width: 100%;
    min-height: 48px;
    justify-content: center;
  }

  /* Plant release / LN filter chips stay 2-across */
  #rocad-app.rocad-shell .rocad-pr-cards,
  #rocad-app.rocad-shell .rocad-pr-cards--more {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 0.7rem !important;
  }

  /* Notification bell — readable stacked items */
  #rocad-app.rocad-shell .rocad-topbar__dropdown--notifications {
    width: calc(100vw - 12px);
    max-width: calc(100vw - 12px);
    right: 6px;
    left: auto;
  }

  #rocad-app.rocad-shell .rocad-topbar__notification-list {
    max-height: min(60dvh, 420px);
  }

  #rocad-app.rocad-shell .rocad-topbar__notification-item > a {
    display: flex;
    align-items: flex-start;
    gap: 0.65rem;
    min-height: 52px;
    padding: 0.85rem 1rem;
    font-size: 0.9375rem;
    line-height: 1.4;
    white-space: normal;
    word-break: break-word;
  }

  #rocad-app.rocad-shell .rocad-topbar__notification-item .fa {
    margin-top: 0.15rem;
    flex: 0 0 auto;
  }

  #rocad-app.rocad-shell .rocad-topbar__notif-body {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    min-width: 0;
  }

  #rocad-app.rocad-shell .rocad-topbar__notif-type {
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--rocad-color-brand, #084fa8);
  }

  #rocad-app.rocad-shell .rocad-topbar__notif-text {
    color: var(--rocad-color-text, #0f172a);
  }

  #rocad-app.rocad-shell .rocad-topbar__notif-date {
    font-size: 0.75rem;
    color: var(--rocad-color-text-muted, #64748b);
  }

  /* DPR filter modal — full-width sheet on phones */
  #filterModal {
    left: 8px !important;
    right: 8px !important;
    top: 10% !important;
    width: auto !important;
    max-width: none !important;
    max-height: 80dvh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  /* Dashboard hero tighter on phone */
  #rocad-app.rocad-shell .rocad-dash-hero {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.65rem;
  }

  #rocad-app.rocad-shell .rocad-dash-hero__greeting {
    font-size: 1.45rem;
    line-height: 1.25;
  }

  #rocad-app.rocad-shell .rocad-dash-hero__meta {
    flex-wrap: wrap;
  }

  html[data-rocad-theme="dark"] #rocad-app.rocad-shell .rocad-mlist__card {
    background: #141e2e;
    border-color: #243044;
  }

  html[data-rocad-theme="dark"] #rocad-app.rocad-shell .rocad-mlist__chip {
    background: #1e293b;
    color: #e2e8f0;
  }

  html[data-rocad-theme="dark"] #rocad-app.rocad-shell .rocad-form-actions {
    background: #141e2e;
    border-top-color: #243044;
  }
}
