/* App layout from react/afromix_erp/src/components_static (jmt_app.jsx + index.css), plus the inline styles the React
   components set. PrimeReact's own structural CSS is in primereact.css (extracted from the component JS); colours,
   spacing and states come from the lara-light-blue theme. Avoid restyling .p-* classes here — that is what made the
   port drift from the React look. */
html { font-size: var(--app-font-size, 0.9rem); overflow: hidden; }
body { height: 100%; margin: 0; background: var(--surface-ground, #f8f9fa); font-family: var(--font-family); }

.app-root { height: 100vh; display: flex; flex-direction: column; }
.layout-topbar { position: sticky; top: 0; z-index: 1000; height: 56px; }
.layout-main { flex: 1; display: flex; min-height: 0; }
.layout-content { flex: 1; min-height: 0; overflow-y: auto; padding: 1rem; background: var(--surface-ground, #f8f9fa); border-top-left-radius: 10px; }

.jmt-topbar { display: flex; align-items: center; justify-content: space-between; padding: 0 1rem; }
.jmt-topbar-logo { height: 36px; margin-right: .75rem; border-radius: 8px; }
.jmt-topbar-title { font-weight: 700; font-size: 1.2rem; }

/* JMT_APP_SIDE_MENU: 170px column holding a PrimeReact Menu (styled by the theme) that scrolls on its own, with the
   logo and version locked to the bottom of the column, as in React */
.jmt-side-menu { width: 170px; padding: 2px 10px 10px 10px; flex-shrink: 0; display: flex; flex-direction: column; min-height: 0; overflow: hidden; }
.jmt-side-menu-items { flex: 1 1 auto; min-height: 0; overflow-y: auto; }
.jmt-side-menu-footer { flex: none; padding-top: 10px; }
.jmt-side-menu .p-menu { width: 100%; }
body.jmt-menu-hidden .jmt-side-menu { display: none; }
@media (max-width: 768px) {
  .jmt-side-menu { position: fixed; top: 56px; bottom: 0; left: 0; z-index: 999; display: none; }
  body.jmt-menu-open .jmt-side-menu { display: flex; }
  .jmt-topbar-title { display: none; }
}

/* html is overflow:hidden (the shell scrolls its own panels), so the login screen is its own viewport-high scroller.
   The card centres with auto margins rather than align-items:center, which would push its top out of reach when the
   window is shorter than the card. */
.jmt-login { height: 100vh; height: 100dvh; overflow-y: auto; }
.jmt-login > * { margin-top: auto; margin-bottom: auto; }
.jmt-login h1 { margin: .5rem 0 0; }

/* <a> styled as a button (LinkButton) */
a.p-button { text-decoration: none; }

/* JMT_FIELD_* (react/afromix_erp/src/components/jmt_field_*.jsx): ruled row (border-bottom 1px solid, padding 0),
   300px caption with 2px padding, then the value: white for labels, lavender boxes for edits, light green lookups. */
.jmt-field { padding: 0; border-bottom: 1px solid; }
.jmt-field > .p-inputgroup { align-items: stretch; }
/* 300px like React, but in a narrow panel the caption gives way before the value does */
.jmt-field-caption { flex: 0 0 300px; max-width: 45%; min-width: 0; padding: 2px; display: flex; align-items: center; overflow-wrap: anywhere; }
.jmt-field-value { flex: 1 1 auto; width: 100%; min-width: 0; padding: 2px; border: 0; overflow-wrap: anywhere; white-space: pre-wrap; }
.jmt-field-unit { flex: 0 0 100px; padding: 2px; }
.jmt-field .p-inputtext { flex: 1 1 auto; width: 100%; min-width: 5rem; border: 0; border-radius: 0; padding: 2px; background-color: lavender;
                          font-size: inherit; box-shadow: none; }
.jmt-field .p-inputtext:focus { box-shadow: inset 0 0 0 1px var(--primary-color, #3B82F6); }
.jmt-field textarea.p-inputtext { resize: vertical; }
.jmt-field .p-inputtext.jmt-field-error, .jmt-field .jmt-dropdown.jmt-field-error { background-color: red; }
.jmt-field-checkbox { flex: 1 1 auto; display: flex; align-items: center; padding: 2px; background-color: lavender; }
.jmt-field .p-inputtext.jmt-lookup-input { background-color: lightgreen; cursor: pointer; }
.jmt-field .p-datepicker-trigger { height: auto; width: 2.25rem; border-radius: 0; padding: 0; }
@media (max-width: 768px) {  /* phones: caption above the value */
  .jmt-field .p-inputgroup { flex-wrap: wrap; }
  .jmt-field-caption { flex-basis: 100%; max-width: none; font-weight: 500; }
}
/* PrimeReact InputSwitch look for FieldSwitch */
.jmt-switch { position: relative; display: inline-block; width: 3rem; height: 1.75rem; margin: 0; cursor: pointer; }
.jmt-switch-input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.jmt-switch .p-inputswitch-slider { position: absolute; inset: 0; border-radius: 30px; background: #d1d5db; transition: background-color .2s; }
.jmt-switch .p-inputswitch-slider::before { content: ""; position: absolute; top: 50%; left: .25rem; width: 1.25rem; height: 1.25rem; margin-top: -.625rem;
                                            border-radius: 50%; background: #fff; transition: transform .2s; }
.jmt-switch-input:checked + .p-inputswitch-slider { background: var(--primary-color, #3B82F6); }
.jmt-switch-input:checked + .p-inputswitch-slider::before { transform: translateX(1.25rem); }
.jmt-switch-input:focus-visible + .p-inputswitch-slider { outline: 2px solid var(--primary-color, #3B82F6); outline-offset: 2px; }

/* DataTable extras: wide grids scroll sideways inside their panel instead of being cut off (PrimeReact: overflow auto) */
.p-datatable .p-sortable-column { white-space: nowrap; }
.p-datatable-wrapper { overflow-x: auto; }
.jmt-group-total td { background-color: #aaffaa; }

/* Dialog: the mask's positioning is an inline style in PrimeReact (DialogBase); position="center" | "top" */
.p-dialog-mask { position: fixed; inset: 0; z-index: 1100; display: flex; justify-content: center; align-items: center; }
.p-dialog-mask.p-dialog-top { align-items: flex-start; }
.p-dialog-top .p-dialog { margin: .75rem; }
.p-dialog { max-width: 95vw; }
/* A Dialog without a width (most React POPUP_*s) takes its content's width: field rows get their 300px caption plus a
   box of InputText's natural width, as in React */
.jmt-dialog-auto { min-width: 30rem; }
.jmt-dialog-auto .jmt-field .p-inputtext, .jmt-dialog-auto .jmt-field .jmt-dropdown { min-width: 14rem; }
/* InputText in a table cell (quantity grids): its natural width, not the whole cell */
.p-datatable td .p-inputtext { width: auto; max-width: 12rem; }
@media (max-width: 768px) { .p-dialog { width: 95vw !important; } }

/* Toast container placement (PrimeReact sets it inline) and long API errors: a narrow stack in the bottom-right corner;
   the container lets clicks through, only the messages themselves catch them */
.p-toast { position: fixed; bottom: 16px; right: 16px; z-index: 1200; width: auto; max-width: min(25rem, calc(100vw - 32px)); pointer-events: none; }
.p-toast-message { pointer-events: auto; }
.p-toast-message-success .p-toast-message-content { padding: 0.5rem 0.75rem; }
.p-toast-detail { white-space: pre-wrap; word-break: break-word; }

/* Global request indicator */
.jmt-global-loading { position: fixed !important; top: 0; left: 0; right: 0; z-index: 1300; }

/* htmx: indicators only show while a request is in flight */
.htmx-indicator { display: none; }
.htmx-request .htmx-indicator, .htmx-request.htmx-indicator { display: block; }

/* User endpoint permissions: one scrolling lane per folder (POPUP_USER_ENDPOINT_UPDATE) */
.jmt-lanes { display: flex; gap: 1rem; overflow-x: auto; align-items: flex-start; padding: .5rem 0 1rem; }
.jmt-lane { flex: 0 0 300px; max-height: 60vh; overflow-y: auto; background: var(--surface-card, #fff); border-radius: 6px;
            box-shadow: 0 2px 6px rgb(0 0 0 / .15); padding: .5rem .75rem; }
.jmt-lane summary { cursor: pointer; display: flex; align-items: center; }
.jmt-lane label { cursor: pointer; overflow-wrap: anywhere; }

/* JMT_API_BUTTON: style={{ margin: '-1px', height: '22px' }} (PrimeFlex mr-2/mb-2 still win on right/bottom) */
.jmt-api-button { height: 22px; margin: -1px; }
/* JMT_API_SPAN: the icon-only row button — same style={{ margin: '-1px', height: '22px' }}, kept square */
.p-button.jmt-api-span { height: 22px; width: 2rem; margin: -1px; padding: 0; }
.p-button.jmt-api-span .p-button-icon { font-size: .8rem; margin: 0; }
.jmt-api-button .p-badge { margin-left: .5rem; }

/* FileFrame: loader shown until the PDF has rendered in the iframe */
.jmt-file-frame { position: relative; }
.jmt-file-frame.jmt-file-loaded .jmt-file-loading { display: none; }
.jmt-file-frame:not(.jmt-file-loaded) iframe { position: absolute; inset: 0; visibility: hidden; }
.jmt-file-frame:not(.jmt-file-loaded) { min-height: 75vh; }

/* Top bar (JMT_APP_TOPBAR): round cog + sign-out buttons, cog opens the options list */
.jmt-topbar-title { text-decoration: none; margin-left: 10px; }
.jmt-topbar-button { width: 2.25rem; height: 2.25rem; cursor: pointer; }
.jmt-options-menu { position: relative; }
.jmt-options-menu > summary { list-style: none; }
.jmt-options-menu > summary::-webkit-details-marker { display: none; }
.jmt-options { position: absolute; top: 42px; right: 0; min-width: 190px; background: #fff; border: 1px solid #dcdcdc;
               border-radius: 8px; box-shadow: 0 4px 14px rgba(0,0,0,.15); z-index: 9999; overflow: hidden; }
.jmt-option { display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px 12px; border: 0; border-bottom: 1px solid #eee;
              background: none; cursor: pointer; font: inherit; color: var(--text-color, #4b5563); text-align: left; }
.jmt-option:last-child { border-bottom: none; }
.jmt-option:hover, .jmt-option:focus-visible { background: var(--surface-hover, #f3f4f6); }

/* Login splash (React: 2.5s black screen with the pulsing logo) */
.jmt-splash { position: fixed; inset: 0; z-index: 2000; display: flex; align-items: center; justify-content: center; background: #000;
              animation: jmt-splash-out .3s ease 2.5s forwards; }
.jmt-splash img { max-width: 80%; max-height: 80%; border-radius: 30%; animation: jmt-pulse 1.5s ease-in-out infinite; }
@keyframes jmt-pulse { 0% { transform: scale(1); } 50% { transform: scale(.85); } 100% { transform: scale(1); } }
@keyframes jmt-splash-out { to { opacity: 0; visibility: hidden; } }
@media (prefers-reduced-motion: reduce) { .jmt-splash { display: none; } }

/* Lookup dialog (jmt_field_lookup.jsx): Status / Sort By dropdowns — same panel look as the top bar menus */
.jmt-dropdown { position: relative; flex: 1 1 auto; width: 1%; display: block; background: var(--surface-0, #fff);
                border: 1px solid var(--surface-border, #d1d5db); transition: border-color .15s, box-shadow .15s; }
.jmt-dropdown:hover { border-color: var(--primary-color, #3B82F6); }
/* open: its list must cover the grid and the other filters below it, so it sits well above the dialog's own layers
   (PrimeReact puts focused inputs, sticky headers and overlays at 1-10), still under the top bar (1000) */
.jmt-dropdown[open] { border-color: var(--primary-color, #3B82F6); box-shadow: 0 0 0 .2rem #BFDBFE; z-index: 50; }
.jmt-dropdown > summary { list-style: none; }
.jmt-dropdown > summary::-webkit-details-marker { display: none; }
.jmt-dropdown-trigger { display: flex; align-items: center; gap: .5rem; height: 100%; min-height: 2.5rem; padding: 0 .75rem; cursor: pointer; user-select: none; }
.jmt-dropdown-trigger:focus-visible { outline: none; }
.jmt-dropdown-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.jmt-dropdown-placeholder { color: var(--text-color-secondary, #6b7280); }
.jmt-dropdown-clear { color: var(--text-color-secondary, #6b7280); padding: .25rem; border-radius: 50%; }
.jmt-dropdown-clear:hover { background: var(--surface-hover, #f3f4f6); color: var(--text-color, #4b5563); }
.jmt-dropdown-chevron { font-size: .75rem; color: var(--text-color-secondary, #6b7280); transition: transform .15s; }
.jmt-dropdown[open] .jmt-dropdown-chevron { transform: rotate(180deg); }
.jmt-options.jmt-dropdown-panel { top: calc(100% + 4px); left: -1px; right: auto; min-width: calc(100% + 2px); max-height: 18rem; overflow-y: auto; z-index: 20; }
/* Open lists float over the page like PrimeReact's overlays (web.js jmtPlaceDropdown), so a dialog or a scrolling panel
   never cuts them off */
.jmt-options.jmt-dropdown-panel.jmt-floating { position: fixed; min-width: 0; z-index: 1150; }
/* PrimeReact-style checkbox on the status rows */
.jmt-check-option { cursor: pointer; }
.jmt-check-input { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.jmt-check-box { flex-shrink: 0; width: 1.25rem; height: 1.25rem; display: inline-flex; align-items: center; justify-content: center;
                 border: 2px solid var(--surface-border, #d1d5db); border-radius: 6px; color: transparent; font-size: .75rem;
                 transition: background-color .15s, border-color .15s; }
.jmt-check-option:hover .jmt-check-box { border-color: var(--primary-color, #3B82F6); }
.jmt-check-input:checked + .jmt-check-box { background: var(--primary-color, #3B82F6); border-color: var(--primary-color, #3B82F6); color: #fff; }
.jmt-check-input:focus-visible + .jmt-check-box { outline: 2px solid var(--primary-color, #3B82F6); outline-offset: 2px; }
.jmt-pager .p-inputgroup-addon.jmt-pager-arrow { cursor: pointer; }
.jmt-pager .p-button { border-radius: 0; }
.jmt-pager .p-button-blank { background-color: white; color: blue; border: 1px solid var(--surface-border, #d1d5db); }

.jmt-options-header { padding: 8px 12px; font-size: .75rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase;
                      color: var(--text-color-secondary, #6b7280); border-bottom: 1px solid #eee; }
.jmt-option-current { font-weight: 700; color: var(--primary-color, #3B82F6); }


/* Flatpickr date picker, themed to match PrimeReact lara-light-blue */
.flatpickr-calendar { font-family: var(--font-family); box-shadow: 0 2px 12px rgba(0,0,0,.1); border-radius: 6px; z-index: 1150; }
.flatpickr-day.selected, .flatpickr-day.selected:hover, .flatpickr-day.selected:focus {
  background: var(--highlight-bg, #EFF6FF); border-color: var(--highlight-bg, #EFF6FF); color: var(--highlight-text-color, #1D4ED8); font-weight: 700; }
.flatpickr-day.today { border-color: var(--primary-color, #3B82F6); }
.flatpickr-day:hover { background: var(--surface-hover, #f3f4f6); border-color: transparent; }
.flatpickr-months .flatpickr-month, .flatpickr-current-month .flatpickr-monthDropdown-months { font-weight: 600; }
.jmt-datepicker-buttonbar { display: flex; justify-content: space-between; padding: .25rem .5rem .5rem; border-top: 1px solid var(--surface-border, #dee2e6); }
.jmt-datepicker-toggle { cursor: pointer; }

/* Top bar cog + sign-out (colours inline from config.THEME, as React sets them) */
.jmt-topbar-button:focus-visible { outline: 2px solid var(--primary-color, #3B82F6); outline-offset: 2px; }

/* Side menu: the current page (jmt_app.jsx activeMenuCSS) */
/* selected menu item: colours chosen for contrast against the menu (components/layout.py _menu_active) */
.jmt-menu-item-active .p-menuitem-link { background-color: var(--jmt-menu-active-bg, #231f20) !important; border-radius: 6px; margin: 4px; }
.jmt-menu-item-active .p-menuitem-icon, .jmt-menu-item-active .p-menuitem-text { color: var(--jmt-menu-active-text, #fff) !important; }

/* Dark mode (jmt_theme_provider.jsx): panels and tables follow the dark palette */
.jmt-dark .p-panel .p-panel-header, .jmt-dark .p-panel .p-panel-content, .jmt-dark .p-card,
.jmt-dark .p-datatable .p-datatable-thead > tr > th, .jmt-dark .p-datatable .p-datatable-tbody > tr { background: #1e1e1e; color: #f5f5f5; }

/* XlsxUpload preview */
.jmt-upload-preview td { white-space: nowrap; }

/* A screen change in flight (web.js jmtScreenBusy): the current screen whitened under a spinner in the middle of the
   window, taking no input (#content is inert), until the next one swaps in */
body.jmt-navigating #content { pointer-events: none; }
body.jmt-navigating .layout-content { position: relative; }
body.jmt-navigating .layout-content::before {
  content: ""; position: absolute; inset: 0; z-index: 900; background: rgb(255 255 255 / .65); cursor: progress;
  animation: jmt-fade-in .15s ease-in;
}
body.jmt-navigating .layout-content::after {
  content: ""; position: fixed; top: 50%; left: 50%; z-index: 901; width: 3rem; height: 3rem; margin: -1.5rem 0 0 -1.5rem;
  border: 4px solid var(--jmt-menu-active-bg, #133518); border-right-color: transparent; border-radius: 50%;
  animation: jmt-spin .8s linear infinite;
}
body.jmt-navigating .jmt-dark .layout-content::before { background: rgb(18 18 18 / .6); }
@keyframes jmt-spin { to { transform: rotate(360deg); } }
@keyframes jmt-fade-in { from { opacity: 0; } }

/* The same veil and spinner over a dialog's content while it loads, saves or re-renders (web.js jmtLoadingMask) */
.p-dialog .jmt-dialog-loading { position: relative; flex: 1 1 auto; min-height: 8rem; }
.p-dialog-content.jmt-dialog-busy { position: relative; pointer-events: none; }
.jmt-loading-mask {
  position: absolute; inset: 0; z-index: 5; display: flex; align-items: center; justify-content: center;
  background: rgb(255 255 255 / .65); cursor: progress; animation: jmt-fade-in .15s ease-in;
}
.jmt-dark .jmt-loading-mask { background: rgb(18 18 18 / .6); }
.jmt-spinner {
  width: 2.75rem; height: 2.75rem; border: 4px solid var(--jmt-menu-active-bg, #133518); border-right-color: transparent;
  border-radius: 50%; animation: jmt-spin .8s linear infinite;
}

/* FieldDropdown / FieldMultiselect (components/fields.py): the app's dropdown in a field row */
.jmt-field .p-inputgroup { position: relative; }
.jmt-dropdown-value { position: absolute; left: 50%; bottom: 0; width: 1px; height: 1px; opacity: 0; pointer-events: none; border: 0; padding: 0; }
.jmt-field .jmt-dropdown { border: 0; border-radius: 0; background-color: lavender; }
.jmt-field .jmt-dropdown-trigger { min-height: 0; padding: 0 2px; }
.jmt-field .jmt-dropdown[open] { box-shadow: inset 0 0 0 1px var(--primary-color, #3B82F6); }
.jmt-dropdown-disabled { opacity: .6; pointer-events: none; background: var(--surface-200, #e5e7eb); }
.jmt-dropdown-panel .jmt-option[hidden] { display: none; }

/* [data-row-toggle] tables: the whole line ticks its checkbox (static/web.js) */
[data-row-toggle] .p-datatable-tbody > tr:not(.p-datatable-emptymessage) { cursor: pointer; user-select: none; }
/* rowClassName highlights (react/afromix_erp/src/index.css "AMX ONLY CSS") */
.p-datatable .p-datatable-tbody > tr.p-highlight-success > td { background: #a0e6ba; color: #000000; }
.p-datatable .p-datatable-tbody > tr.p-highlight-primary > td,
.p-datatable .p-datatable-tbody > tr.p-highlight-secondary > td { background: #d0e1fd; color: #000000; }
.p-datatable .p-datatable-tbody > tr.p-highlight-warning > td { background: #facf85; color: #000000; }
.p-datatable .p-datatable-tbody > tr.p-highlight-blue > td { background: #bfdbfe; color: #0f172a; }

/* Update User Endpoint (POPUP_USER_ENDPOINT_UPDATE): Folder | Manually Denied | Manually Granted, 65vh scrolling tables */
.jmt-endpoints-heading { display: flex; align-items: center; gap: .5rem; margin-bottom: .5rem; min-height: 22px; }
.jmt-endpoints-heading h4 { margin: 0; }
.jmt-endpoints-heading .p-button { margin: -1px; }
.jmt-endpoints-table { max-height: 65vh; overflow-y: auto; font-size: .75rem; }
.jmt-endpoints-table td { overflow-wrap: anywhere; }
.jmt-endpoints .p-selectable-row { cursor: pointer; }
.jmt-endpoint-changed td { font-weight: 700; }
/* scrollable={true}: the header row stays put while the rows scroll under it */
.jmt-endpoints-table thead th { position: sticky; top: 0; z-index: 1; }

/* PrimeReact TabView structure (not in primereact.css): one row of headers that scrolls sideways when there are many */
.p-tabview-nav-container { position: relative; }
.p-tabview-nav-content { overflow-x: auto; overflow-y: hidden; scroll-behavior: smooth; }
.p-tabview-nav { display: flex; margin: 0; padding: 0; list-style-type: none; flex: 1 1 auto; }
.p-tabview-nav-link { cursor: pointer; user-select: none; display: flex; align-items: center; position: relative; text-decoration: none; overflow: hidden; }
.p-tabview-title { line-height: 1; white-space: nowrap; }
.p-tabview-title .p-badge { margin-left: .5rem; }

/* ---------------------------------------------------------------- Born Free */
/* JMT_APP_SCREEN_BAR: the open category's screens as buttons across the top of the page (the open one filled) */
.jmt-screen-bar { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 1rem 0; padding: .75rem; background: var(--surface-card, #fff);
  border: 1px solid var(--surface-border, #dee2e6); border-radius: 6px; }
.jmt-screen-bar .jmt-screen-button { margin: 0; text-decoration: none; }
.jmt-dark .jmt-screen-bar { background: #262626; border-color: #333; }
/* JMT_APP_SCREEN_BAR for web_main.TILE_CATEGORIES: BizBot's big screen tiles (JMT_CUSTOM_BUTTON) — a gradient square, the
   icon in a frosted box over the name, the open screen's name underlined; the screen itself shows below them */
.jmt-screen-tiles { display: flex; flex-wrap: wrap; gap: 10px; margin: 0 0 1rem 0; }
.jmt-screen-tile { width: 108px; min-height: 96px; border-radius: 16px; padding: 10px 8px; color: #fff; text-decoration: none; display: flex;
  flex-direction: column; align-items: center; justify-content: center; gap: 8px; text-align: center; user-select: none;
  box-shadow: 0 8px 20px rgba(0,0,0,.15); transition: transform .25s ease, box-shadow .25s ease, opacity .25s ease; opacity: .85; }
.jmt-screen-tile:hover { transform: translateY(-3px); box-shadow: 0 12px 30px rgba(0,0,0,.25); color: #fff; opacity: 1; }
.jmt-screen-tile-open { opacity: 1; box-shadow: 0 0 0 3px #fff, 0 8px 20px rgba(0,0,0,.25); }
.jmt-screen-tile .jmt-tile-icon { width: 40px; height: 40px; min-height: 40px; border-radius: 12px; background: rgba(255,255,255,.25);
  display: flex; align-items: center; justify-content: center; font-size: 1.35rem; }
.jmt-screen-tile .jmt-tile-caption { font-size: .8rem; font-weight: 700; line-height: 1.15; max-width: 100%; overflow: hidden;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; padding-bottom: 2px; border-bottom: 3px solid transparent; }
.jmt-screen-tile .jmt-tile-selected { font-weight: 800; border-bottom-color: #fff; }
@media (max-width: 640px) { .jmt-screen-tile { width: calc(33.333% - 7px); min-height: 88px; } .jmt-screen-tile .jmt-tile-caption { font-size: .75rem; } }
/* The category page's panels (pages/home.py): one section per converted screen, each its own lookup and dialogs, in two
   columns that each fill from the top (panels 1, 3, ... left; 2, 4, ... right), one column in screen order when narrow */
.jmt-workspace { display: flex; flex-direction: column; gap: .75rem; margin-bottom: .75rem; }
.jmt-workspace-column { display: contents; }
@media (min-width: 1200px) {
  .jmt-workspace-two { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: start; }
  .jmt-workspace-two .jmt-workspace-column { display: flex; flex-direction: column; gap: .75rem; min-width: 0; }
  /* in a half-width column a screen's own side-by-side parts (lg:col-*) stack, so each section is one tall block */
  .jmt-workspace-two [class*="lg:col-"] { flex: 0 0 auto; width: 100%; }
}
.jmt-workspace-section { background: var(--surface-card, #fff); border: 1px solid var(--surface-border, #dee2e6);
  border-top: 3px solid var(--primary-color, #dc3545); border-radius: 6px; padding: 0 .5rem .25rem; min-width: 0; }
.jmt-workspace-head { display: flex; align-items: baseline; gap: .75rem; padding: .4rem .25rem; }
.jmt-workspace-title { font-size: 1.1rem; font-weight: 700; }
.jmt-dark .jmt-workspace-section { background: #262626; border-color: #333; border-top-color: var(--primary-color, #dc3545); }
/* inside a section: the screen's grid without its outer gutter, its panels closer together */
.jmt-workspace-section > [id^="panel-"] > .grid { margin: 0 -.25rem; }
.jmt-workspace-section .grid > [class*="col-"] { padding: .25rem; }
.jmt-workspace-section .p-panel { margin-bottom: .5rem !important; }
.jmt-workspace-section .p-panel .p-panel-header { padding: .5rem .75rem; }
.jmt-workspace-section .p-panel .p-panel-content { padding: .5rem .75rem; }
.jmt-workspace-section .p-datatable-wrapper, .jmt-workspace-section .p-datatable { overflow-x: auto; }
/* a category's screen count beside its name in the side menu; the user's name in the top bar */
.jmt-menu-count { margin-left: auto; padding-left: 6px; font-size: .75em; opacity: .7; }
.jmt-topbar-user { font-size: .9em; margin-right: .5rem; }
@media (max-width: 640px) { .jmt-topbar-user { display: none; } }
/* the login card and other plain panels (PrimeFlex 4's surface-card is !important on variables this theme never sets) */
.jmt-panel { background-color: var(--surface-card, #fff); color: var(--text-color, #212529); }
.jmt-dark .jmt-panel { background-color: #262626; color: #f5f5f5; }
/* a read-only field inside a screen form (still posted with it): drawn as a label row, not a lavender edit box */
.jmt-field .p-inputtext[readonly]:not(.jmt-lookup-input), .jmt-field .p-inputtext[disabled] { background-color: transparent; cursor: default; }
/* JMT_SCREEN_FORM panels side by side on wide screens */
.jmt-screen-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(420px, 1fr)); gap: 0 1rem; align-items: start; }
.jmt-menu-item-active .jmt-menu-count { color: var(--jmt-menu-active-text, #fff); opacity: .85; }
/* A category page's Pop-ups (pages/home.py, static/web.js jmtPopupScreen): the screen in a large dialog, in an iframe
   whose page leaves out the shell (responses.py marks it jmt-embedded) */
.jmt-popup-screen { width: 95vw; height: 90vh; }
.jmt-popup-screen .p-dialog-content { padding: 0; flex: 1 1 auto; overflow: hidden; }
.jmt-popup-screen iframe { width: 100%; height: 100%; border: 0; display: block; }
.jmt-embedded .jmt-topbar, .jmt-embedded .jmt-side-menu, .jmt-embedded .jmt-screen-bar, .jmt-embedded .jmt-screen-tiles { display: none !important; }
.jmt-embedded .layout-content { border-radius: 0; }
.jmt-popups { display: flex; flex-wrap: wrap; }
.jmt-popups-panel .p-panel-content { padding-bottom: .25rem; }
