/* Mobile workspace controls, surfaces and typography based on Personal Home. */
.approved-mobile-claim-limited,
.approved-mobile-loaded-claims { display: none; }

@media (max-width: 700px) {
  #app {
    --workspace-hero: radial-gradient(ellipse at 98% 0, #ceeeea, transparent 70%),
      linear-gradient(150deg, #e9f3ff, #f9fbff 85%);
    --workspace-accent: linear-gradient(95deg, #175ec5, #218ed0 56%, #17a595);
    --workspace-primary: linear-gradient(150deg, #1765c9, #164fa5);
    --workspace-depth: inset 0 1px 0 #ffffff7d, 0 3px 9px #183d7117;
  }

  #app :is(.mobile-workspace-hero, .mobile-leave-balance .leave-balance-feature, #profile .profile-hero) {
    position: relative;
    overflow: hidden;
    min-width: 0;
    padding: 13px;
    border: 1px solid #c9e1ed;
    border-radius: 16px;
    background: var(--workspace-hero);
    box-shadow: var(--workspace-depth);
  }

  #app :is(.mobile-workspace-hero, .mobile-leave-balance .leave-balance-feature, #profile .profile-hero)::before {
    position: absolute;
    inset: 0 0 auto;
    height: 3px;
    background: var(--workspace-accent);
    content: "";
    pointer-events: none;
  }

  #app .mobile-workspace-screen h2 {
    margin: 0;
    font-size: clamp(21px, 6vw, 26px);
    line-height: 1.12;
    letter-spacing: -.035em;
  }

  #app :is(.mobile-workspace-screen h3, .mobile-leave-balance .leave-balance-feature h3) {
    margin: 0;
    color: #132e54;
    font-size: 15px;
    line-height: 1.25;
  }

  #app .mobile-workspace-screen .mobile-workspace-icon {
    width: 35px;
    height: 35px;
    border-radius: 10px;
  }

  #app .mobile-workspace-screen .btn { min-height: 44px; }
  #app .mobile-workspace-screen .mobile-workspace-primary {
    background: var(--workspace-primary);
    box-shadow: inset 0 -3px 0 #0b32744d, 0 3px 7px #164c9221;
  }

  #app :is(.mobile-workspace-values strong, .dc-mobile-cash-summary dd) {
    font-variant-numeric: tabular-nums;
  }

  #app .mobile-workspace-values > div:first-child { background: #eef5ff; }
  #app .mobile-workspace-values > div:last-child { background: #eaf8f1; }
  #app .mobile-workspace-values > div:last-child strong { color: #176546; }

  #app .mobile-workspace-list .mobile-workspace-row-content { min-height: 50px; }
  #app .mobile-workspace-list .mobile-workspace-row-aside { max-inline-size: 110px; }
  #app .mobile-workspace-list .mobile-workspace-row-aside > * {
    max-inline-size: 100%;
    overflow-wrap: anywhere;
    white-space: normal;
  }

  #claims .claims-overview-head { display: grid; gap: 10px; margin-bottom: 8px; }
  #claims .claims-overview-head .section-title { margin: 0; }
  #claims .claims-overview-head .section-title h2 { font-size: clamp(21px, 6vw, 26px); }
  #claims .claims-overview-head .section-title p { margin: 4px 0 0; font-size: 12px; line-height: 1.35; }
  #claims .claims-overview-toolbar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    align-items: end;
    gap: 7px;
  }
  #claims .claims-overview-toolbar > .badge-lite { display: none; }
  #claims .claims-overview-toolbar .field { min-width: 0; margin: 0; }
  #claims .claims-overview-toolbar input { width: 100%; min-width: 0; text-align: start; }

  #claims .approved-mobile-claim-scope {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 4px 8px;
    padding: 5px 8px;
    border: 1px solid #d7e6f2;
    border-radius: 10px;
    background: #edf5fc;
    color: #224c76;
    font-size: 12px;
    overflow-wrap: anywhere;
  }

  #claimsTicketsPanel > .card:has(.mobile-claims-tickets) .section-title { margin: 0; }
  #claimsTicketsPanel .section-title .approved-mobile-claim-scope { margin-top: 6px; }

  #claims .approved-mobile-claim-scope:has(> strong:only-child) { padding-block: 8px; }
  #claims .approved-mobile-claim-scope .btn { padding-inline: 8px; font-size: 12px; }
  #claims :is(.claims-workspace-tabs, .claim-view-tabs, .claim-filter-bar) button { min-height: 44px; }
  #claims :is(.claims-overview-toolbar, .claims-overview-head) .btn { min-height: 44px; white-space: normal; }

  #claims .claims-overview-kpis {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7px;
  }
  #claims .claims-overview-kpi {
    min-width: 0;
    padding: 10px;
    border: 1px solid #d7e5f1;
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 2px 6px #183d7110;
  }
  #claims .claims-overview-kpi:first-child { background: #eef5ff; }
  #claims .claims-overview-kpi[data-claim-kpi="amount"].good { background: #eaf7ef; }
  #claims .claims-overview-kpi strong {
    font-size: clamp(17px, 5.2vw, 23px);
    line-height: 1.2;
    font-variant-numeric: tabular-nums;
    overflow-wrap: anywhere;
  }
  #claims .claims-overview-kpi :is(small, span) { overflow-wrap: anywhere; }

  /* The existing pager exposes both disabled controls only for a single result page. */
  :is(#claims.approved-mobile-paged-claims:not(:has(.cloud-pager[data-page="claims"] [data-prev]:disabled ~ [data-next]:disabled)), #claimsOverviewContent.approved-mobile-filtered-claims)
    :is(.claims-overview-kpi[data-claim-kpi="amount"], .claims-overview-kpi[data-claim-kpi="count"] > span, .mobile-claims-summary .mobile-workspace-hero) {
    display: none;
  }
  :is(#claims.approved-mobile-paged-claims:not(:has(.cloud-pager[data-page="claims"] [data-prev]:disabled ~ [data-next]:disabled)), #claimsOverviewContent.approved-mobile-filtered-claims)
    .approved-mobile-claim-limited {
    display: block;
    margin: 2px 0 8px;
    padding: 9px 10px;
    border: 1px solid #dce7f1;
    border-radius: 9px;
    background: #fff;
    color: #35506f;
    font-size: 12px;
    line-height: 1.4;
  }
  :is(#claims.approved-mobile-paged-claims:not(:has(.cloud-pager[data-page="claims"] [data-prev]:disabled ~ [data-next]:disabled)), #claimsOverviewContent.approved-mobile-filtered-claims)
    .approved-mobile-loaded-claims {
    display: block;
    margin: 0 0 4px;
    color: #35506f;
    font-size: 12px;
    font-weight: 700;
  }

  #app .mobile-leave-balance .leave-balance-feature { gap: 9px; }
  #app .mobile-leave-balance .leave-annual-values { padding-block: 2px; }
  #app .mobile-leave-balance .leave-annual-values dd { overflow-wrap: anywhere; }
  #app .mobile-leave-actions .mini-btn,
  #app :is(.leave-team-card, .mobile-leave-filters, .ot-mobile-filters) > summary { min-height: 44px; }
  #app .leave-team-controls .btn { min-height: 44px; }

  body:has(#mobileBottomNav.mobile-workspace-dock:not(.hide)) #app #dailyClosing.active {
    --daily-closing-dock-clearance: calc(73px + env(safe-area-inset-bottom));
    padding-block-end: var(--daily-closing-dock-clearance);
  }
  #app .dc-mobile-overview :is(.dc-mobile-footer button, .dc-mobile-reports-link) {
    scroll-margin-block-end: var(--daily-closing-dock-clearance, 0px);
  }
  #app .dc-mobile-overview .dc-mobile-date { min-width: 0; padding-inline: 6px; }
  #app .dc-mobile-overview .dc-mobile-date input { min-width: 0; }
  #app .dc-mobile-overview .dc-mobile-record-actions { gap: 6px; }
  #app .dc-mobile-overview .dc-mobile-record-actions .btn { min-width: 0; padding-inline: 6px; white-space: normal; }
  #app .dc-mobile-overview .dc-mobile-reports-link { white-space: normal; }
  #app .dc-mobile-cash-summary dd { white-space: nowrap; }

  #payslips .mobile-payslip-card h3 { font-size: 18px; }
  #payslips .mobile-payslip-card p { line-height: 1.35; }
  #profile .profile-mobile-heading { font-size: clamp(21px, 6vw, 26px); letter-spacing: -.035em; }
  #profile .profile-hero .profile-title { min-width: 0; }
  #profile .profile-hero .profile-title h2 { overflow-wrap: anywhere; }
  #profile .profile-hero .profile-avatar { border-radius: 12px; box-shadow: inset 0 -2px 0 #10334d40, 0 3px 7px #173f7340; }

  #claims :is(#claimSearch, #claimMonthFilter, #claimOverviewMonth),
  #app :is(.dc-mobile-date, .leave-team-controls, .ot-mobile-filters) input {
    box-sizing: border-box;
    min-height: 44px;
    font-size: 16px !important;
  }

  #claims .claim-search-toolbar .claim-smart-search { min-width: 0; }
  #claims .claim-search-toolbar .claim-smart-search input { width: 100%; min-width: 0; }
}

@media (max-width: 700px), (max-width: 1000px) and (max-height: 600px) and (orientation: landscape) and (pointer: coarse) {
  #modal .modal-card:has(:is(.leave-application-form, .staff-request-form)) .modal-body {
    scroll-padding-block: 10px;
  }
  #modal :is(.leave-application-form, .staff-request-form) .field :is(input:not([type="file"]):not([type="hidden"]), select, textarea),
  #modal .daily-closing-modal .field :is(input:not([type="file"]):not([type="hidden"]), select, textarea) {
    min-width: 0;
    font-size: 16px !important;
  }
  #modal :is(.leave-application-form, .staff-request-form, .daily-closing-modal, .leave-team-controls) :is(input, textarea)::placeholder,
  #claims .claim-search-toolbar input::placeholder {
    font-size: 12px;
    font-weight: 500;
  }
  #modal .manual-ot-entry .mot-mode-option {
    min-height: 66px;
    border-radius: 11px;
    background: #eef5fd;
    color: #164b81;
  }
  #modal .manual-ot-entry .mot-mode-option + .mot-mode-option {
    border-color: #cce6e2;
    background: #eaf7f5;
    color: #145d61;
  }
  #modal :is(.request-disclosure > summary, .request-checkbox, .leave-team-card > summary) { min-height: 44px; }

  #modal .daily-closing-modal .modal-head {
    border-color: #315671;
    background: linear-gradient(110deg, #10284a, #163d5f);
    color: #fff;
  }
  #modal .daily-closing-modal #dcMobileEditorTitle { color: #fff !important; }
  #modal .daily-closing-modal :is(.dc-mobile-editor-context, .dc-mobile-editor-count) { color: #d7eafa; }
  #modal .daily-closing-modal #modalClose {
    border-color: #ffffff42;
    background: #ffffff14;
    color: #fff;
  }
  #modal .daily-closing-modal .dc-mobile-editor-progress { background: #55718a; }
  #modal .daily-closing-modal .dc-mobile-editor-progress .complete { background: #61daca; }
}

@media (max-width: 350px) {
  #app :is(.mobile-workspace-hero, .mobile-leave-balance .leave-balance-feature, #profile .profile-hero) { padding: 10px; }
  #claims .claims-overview-kpi { padding: 8px; }
  #app .mobile-workspace-list .mobile-workspace-row-aside { max-inline-size: 90px; }
  #app .dc-mobile-overview .dc-mobile-date input { width: min(36vw, 118px); }
}

/* Responsive admin workspaces share the app's compact shell through 850px. */
@media screen and (max-width: 850px) {
  #app :where(.page) :is(.section-title, .dashboard-section-title, .report-header, .workspace-head) {
    min-inline-size: 0;
    flex-wrap: wrap;
    gap: 8px;
  }

  #app :where(.page) :is(.section-title, .report-header, .workspace-head) h2 {
    font-size: clamp(16px, 4.5vw, 21px);
    line-height: 1.2;
    overflow-wrap: anywhere;
  }

  #app :where(.page) :is(.toolbar, .toolbar > .left, .toolbar > .right, .payroll-toolbar, .report-context-actions) {
    flex-wrap: wrap;
    min-inline-size: 0;
  }

  #app :where(.page) :is(.toolbar, .payroll-toolbar, .report-context-actions) > * {
    min-inline-size: 0;
    max-inline-size: 100%;
  }

  #app :where(.page) :where(.table-wrap, .staff-list-wrap, .leave-manager-balance-table, .leave-entitlement-table, .exec-attention-table) {
    min-inline-size: 0;
    max-inline-size: 100%;
    overflow-x: auto;
    overscroll-behavior-inline: contain;
  }

  #app :where(.page) :is(.finance-flow-strip, .operations-workspace-tabs, .attendance-workspace-tabs) {
    min-inline-size: 0;
    max-inline-size: 100%;
    scroll-padding-inline: 6px;
  }

  #app :where(.page) :is(.toolbar, .toolbar > .left, .toolbar > .right, .payroll-toolbar, .section-title, .dashboard-section-title, .report-context-actions, .finance-flow-strip, .operations-workspace-tabs, .attendance-workspace-tabs) > .btn,
  #app :where(.page) :is(.finance-flow-strip, .operations-workspace-tabs, .attendance-workspace-tabs) > button {
    min-block-size: 44px;
  }

  #app :where(.page) :is(.toolbar, .report-selector-grid, .field) > :is(input:not([type="file"], [type="checkbox"], [type="radio"], [type="range"], [type="hidden"]), select, textarea),
  #modal .modal-body :is(input:not([type="file"], [type="checkbox"], [type="radio"], [type="range"], [type="hidden"]), select, textarea) {
    min-inline-size: 0;
    max-inline-size: 100%;
    font-size: 16px !important;
  }

  #app :where(.page) :is(.toolbar, .report-selector-grid, .field) > :is(input:not([type="file"], [type="checkbox"], [type="radio"], [type="range"], [type="hidden"]), select),
  #modal .modal-actions > :is(.btn, button) {
    min-block-size: 44px;
  }

  body:has(#mobileBottomNav:not(.hide, .mobile-workspace-dock)) #app .content,
  body:has(#mobileBottomNav.mobile-workspace-dock:not(.hide)) #app .content:not(:has(#home.active .mobile-personal-home, #dailyClosing.active .dc-mobile-overview)) {
    --workspace-dock-clearance: calc(73px + env(safe-area-inset-bottom));
    padding-block-end: var(--workspace-dock-clearance);
  }

  #app :where(.page) :is(button, input, select, summary, a[href]) {
    scroll-margin-block-end: var(--workspace-dock-clearance, 0px);
  }

  #app #locumRates .locum-setting-actions { justify-content: flex-end; }
  #app #locumRates .locum-action-menu > summary {
    min-inline-size: 44px;
    min-block-size: 44px;
  }
  #app #locumRates .locum-action-popover {
    max-inline-size: calc(100vw - 32px);
    inset-block-start: calc(100% + 4px);
  }
  #app #locumRates .locum-action-popover > button { min-block-size: 44px; }

  #app #reports #reportContent .executive-summary-formal,
  #app #reports #reportContent .exec-primary-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  #app #reports #reportContent :is(.exec-card, .exec-stack, .exec-report-heading, .exec-report-meta, .exec-trend-chart-area) {
    min-inline-size: 0;
  }
}

@media screen and (max-width: 760px) {
  #app #reports #reportContent :is(.exec-lower-grid, .exec-stack) {
    grid-template-columns: minmax(0, 1fr);
  }
  #app #reports #reportContent .exec-attention-table { overflow-x: auto; }
}

@media screen and (max-width: 390px) {
  #app :where(.page) :is(.toolbar, .section-title, .report-header) { column-gap: 6px; }
  #app :where(.page) :is(.toolbar > .left, .toolbar > .right, .report-context-actions) > .btn {
    white-space: normal;
    overflow-wrap: anywhere;
  }
}
