/* Shared office workspace layout. Printing and kiosk routes have their own styles. */
@layer kmd-screen {
  @media screen {
    /* The shared material layer paints the portal and each embedded application. */
    html:root {
      --kmd-ui-bg: #edf4fb !important;
      --kmd-action: #1e75bb !important;
      --kmd-action-hover: #165d96 !important;
      --kmd-action-soft: #e5f0fc !important;
      --kmd-selection: #dcecfb !important;
      --kmd-selection-ink: #174e7d !important;
      --kmd-selection-edge: #a9c9e7;
      --kmd-table-heading-bg: #e6f0fa;
    }
    html:root :where(.fi-ta-table, .fn-table, .accounts-table, .ledger, .cdr-table table, .panel table)
      > thead > tr > th {
      background-color: var(--kmd-table-heading-bg) !important;
    }
    html:root :is(.toolbar nav, .anchor-nav, .sheet-tabs, .fi-tabs)
      :is(.pill.selected, .pill.active, button.selected, [aria-current=page], .fi-tabs-item.fi-active) {
      border-color: var(--kmd-selection-edge) !important;
    }
  }
}
@media screen {
  html:is(.kmd-workspace-frame, .kmd-managed-window, .kmd-more-embedded, .more-embedded, .embedded, .kmd-settings-frame, .kmd-phone-notes, :where(.fi:has(> body.fi-body-has-navigation))),
  html:has(> body[data-kmd-workspace]) {
    --kmd-erp-paper: #fff;
    --kmd-ui-border: #cedeed !important;
    --kmd-ui-divider: #dce7f2 !important;
    --kmd-ui-heading: #1e3d5a !important;
    --kmd-ui-shadow: 0 1px 3px rgb(26 46 67 / 7%) !important;
  }
  :is(.kmd-workspace-frame, .kmd-managed-window, .kmd-more-embedded, .more-embedded, .embedded, .kmd-settings-frame, .kmd-phone-notes, :where(.fi:has(> body.fi-body-has-navigation))) :is(main, .main, .fi-main, .fi-page, .fi-page-content, .fn-page, .table-wrap, .fn-table-wrap, .kd-scroll) { min-inline-size: 0; }
  :is(.kmd-workspace-frame, .kmd-managed-window, .kmd-more-embedded, .more-embedded, .embedded, .kmd-settings-frame, .kmd-phone-notes, :where(.fi:has(> body.fi-body-has-navigation))) :is(.panel, .fn-panel, .kd-box, .fi-section, .fi-ta-ctn, .card-head, .settings-panel) {
    min-inline-size: 0; border-color: var(--kmd-ui-border) !important;
    border-radius: 9px !important; box-shadow: var(--kmd-ui-shadow) !important;
  }
  :is(.kmd-workspace-frame, .kmd-managed-window, .kmd-more-embedded, .more-embedded, .embedded, .kmd-settings-frame, .kmd-phone-notes, :where(.fi:has(> body.fi-body-has-navigation))) :is(.panel-head, .fn-heading, .kd-section-head, .fi-header, .kd-context, .actions, .fi-ac) {
    min-inline-size: 0; flex-wrap: wrap; row-gap: 8px;
  }
  :is(.kmd-workspace-frame, .kmd-managed-window, .kmd-more-embedded, .more-embedded, .embedded, .kmd-settings-frame, .kmd-phone-notes, :where(.fi:has(> body.fi-body-has-navigation))) :is(.panel-head, .fn-heading, .fi-header, .kd-context, .form-grid, .fn-form-grid, .kd-fields, .filters) > * { min-inline-size: 0; }
  :is(.kmd-workspace-frame, .kmd-managed-window, .kmd-more-embedded, .more-embedded, .embedded, .kmd-settings-frame, .kmd-phone-notes, :where(.fi:has(> body.fi-body-has-navigation))) :is(.form-grid, .fn-form-grid, .filters, .kd-fields) :is(input, select, textarea) { max-inline-size: 100%; box-sizing: border-box; }
  :is(.kmd-workspace-frame, .kmd-managed-window, .kmd-more-embedded, .more-embedded, .embedded, .kmd-settings-frame, .kmd-phone-notes, :where(.fi:has(> body.fi-body-has-navigation))) :is(.table-wrap,.fn-table-wrap,.kd-scroll,.fi-ta-content) { max-inline-size: 100%; }
  :is(.kmd-workspace-frame,.kmd-managed-window,.kmd-more-embedded, .more-embedded, .embedded, .kmd-settings-frame, .kmd-phone-notes, :where(.fi:has(> body.fi-body-has-navigation))) :is(main,.main,.kd,.fi-ta) table thead th {
    background-color: var(--kmd-table-heading-bg) !important; color: #34536d !important;
    font-weight: 600; vertical-align: middle;
  }
  :is(.kmd-workspace-frame,.kmd-managed-window,.kmd-more-embedded, .more-embedded, .embedded, .kmd-settings-frame, .kmd-phone-notes, :where(.fi:has(> body.fi-body-has-navigation))) :is(.num,.numeric,.kd-line-table td[data-label]) { font-variant-numeric: tabular-nums; }
  :is(.kmd-workspace-frame,.kmd-managed-window,.kmd-more-embedded, .more-embedded, .embedded, .kmd-settings-frame, .kmd-phone-notes, :where(.fi:has(> body.fi-body-has-navigation))) :is(.stock-action-menu,.fi-dropdown-panel,[popover].actions-menu) { max-inline-size: calc(100vw - 16px); box-shadow: 0 8px 24px rgb(27 43 59 / 16%); }
  :is(.kmd-workspace-frame,.kmd-managed-window,.kmd-more-embedded, .more-embedded, .embedded, .kmd-settings-frame, .kmd-phone-notes, :where(.fi:has(> body.fi-body-has-navigation))) :is(a,button,summary):focus-visible { outline: 2px solid #1e75bb; outline-offset: 2px; }
  body[data-kmd-workspace] .sidebar :is(.nav-link.active,.module-subnav .nav-link.active) { background: var(--kmd-selection) !important; color: var(--kmd-selection-ink) !important; }
  body[data-kmd-workspace] .topbar { background: #fff !important; border-bottom-color: #d4e2ef !important; }
  body[data-kmd-workspace] .more-window { border-color: #aabed2 !important; box-shadow: 0 14px 40px rgb(25 40 57 / 23%) !important; }
  body[data-kmd-workspace] .more-window > .more-window-header { background: #dce8f4 !important; color: #263e55 !important; }
  form.filters.kmd-card-filters { display: flex; flex-wrap: wrap; align-items: end; gap: 10px 12px; }
  form.kmd-card-filters > label.grow { flex: 1 1 18rem; }
  form.kmd-card-filters > label:not(.grow) { flex: 0 1 15rem; }
  form.kmd-card-filters > .kmd-filter-more { flex: 1 0 100%; min-width: 0; }
  .kmd-filter-more > summary { width: fit-content; cursor: pointer; color: #355574; font-weight: 600; padding-block: 4px; }
  .kmd-filter-more .kmd-filter-fields { display: grid; grid-template-columns: repeat(auto-fit,minmax(min(155px,100%),1fr)); gap: 8px 12px; margin-top: 8px; }
  .kmd-filter-fields > label { min-width: 0; }
  .kd .kd-workflow { display: flex; flex-wrap: wrap; padding: 0 0 9px; margin: 0 0 12px; list-style: none; gap: 6px 18px; border-bottom: 1px solid #dbe2e9; }
  .kd .kd-workflow li { display: flex; align-items: center; gap: 7px; color: #546476; font-size: 13px; }
  .kd .kd-workflow li[aria-current=step] { color: #165987; font-weight: 600; }
  .kd .kd-workflow b { border-radius: 50%; background: #e8edf2; display: inline-grid; place-items: center; width: 22px; height: 22px; font-size: 12px; }
  .kd .kd-workflow [aria-current=step] b { background: #1e689f; color: white; }
  .kd .kd-pick-lines tbody .kd-order-group > th { background: #e4eff9; border-block: 1px solid #d8e1e9; }
  .kd .kd-source-heading { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 12px; align-items: center; }
  .kd .kd-candidate-products { display:block; margin-top:3px; overflow-wrap:anywhere; }
  .kd .kd-source-picker { margin-block: 12px; }
  .kd .kd-box td small { display: block; line-height: 1.4; }
  .kd .kd-pick-footer { border-top: 1px solid #dbe2e9; padding-top: 10px; }
}

/* Allow office lists to use the available width without dropping fields or actions. */
@media screen {
  :is(.fi-ta-content-ctn, .table-wrap, .fn-table-wrap, .table-scroll, .kmd-table-scroll, .gl-register-scroll, .cdr-table) {
    min-inline-size: 0;
    max-inline-size: 100%;
    overflow-x: auto;
  }
  :is(.fi-ta-table, .table-wrap > table, .fn-table-wrap > table, .kmd-table-scroll > table, .table-scroll > table, .cdr-table > table):not(:has(tbody :is(input:not([type=checkbox],[type=radio],[type=hidden]), textarea, select))) {
    min-width: 0 !important;
    width: 100%;
  }
  :is(.fi-ta-table, .fn-table, .kmd-table-scroll > table, .table-scroll > table, .cdr-table > table, .table-wrap > table) > thead > tr > th,
  .fi-ta-header-cell :is(button, .fi-ta-header-cell-label) {
    white-space: normal;
    overflow-wrap: break-word;
  }
  .fi-ta-table .fi-ta-cell :is(.fi-ta-text, .fi-ta-text-item-label, .fi-ta-text-description),
  :is(.kmd-table-scroll, .table-scroll, .table-wrap, .cdr-table) > table > tbody > tr > td:not(.num,.numeric,.kmd-actions-cell) {
    white-space: normal;
    overflow-wrap: anywhere;
  }
  .fi-ta-table .fi-ta-cell:is(.fi-align-end, .fi-ta-cell-plaka) .fi-ta-text,
  .fi-ta-table .fi-ta-cell .fi-ta-actions { white-space: nowrap; overflow-wrap: normal; }
  .fi-ta-table .fi-ta-cell-firma { min-inline-size: 0 !important; max-inline-size: clamp(10rem, 20vw, 24rem); }
  .fi-ta-table :is(.fi-ta-cell-sure-dk, .fi-ta-cell-planlanan-tarih, .fi-ta-cell-bitis) .fi-ta-text { overflow-wrap: normal; }
  .fn-security-list .fn-table :is(td, th) { white-space: normal; }
  .fn-security-list .fn-table .fn-name { max-inline-size: clamp(8rem, 16vw, 18rem); }
  .fn-security-list .fn-table .fn-name :is(a, small), .fn-security-list .fn-table td > small { white-space: normal; overflow-wrap: anywhere; }
  .fn-security-list .fn-table .num { white-space: nowrap; font-variant-numeric: tabular-nums; }
}
