/* ==========================================================================
   Lettie — application styles (docs/FIORI_DESIGN.md)
   1. Theme   2. Layout dimensions   3. Base   4. Layout   5. Components
   6. Tables  7. Vendor overrides   8. Responsive   9. Print
   ========================================================================== */

/* 1. Theme -----------------------------------------------------------------
   Colours, fonts, font sizes, spacing, radii and shadows come ONLY from the
   UI5 theme variables (--sap*), applied to the document by the UI5 bundle
   (public/assets/vendor/ui5-webcomponents-*/ui5.js) for the theme chosen by
   lt-theme.js: sap_horizon (default), sap_horizon_dark, sap_horizon_hcb/hcw.
   The "72" font faces are declared by ui5-fonts.css (same folder).
   Shades are derived with color-mix() from theme variables, never written. */
html[data-lt-theme="sap_horizon_dark"], html[data-lt-theme="sap_horizon_hcb"] { color-scheme: dark; }

/* Until the theme variables are applied (UI5 boot), the page is not shown.
   Safety net: it appears anyway after 1.5 s if the bundle failed to load. */
html:not(.lt-ui5-ready) body { visibility: hidden; animation: lt-reveal 0s 1.5s forwards; }
@keyframes lt-reveal { to { visibility: visible; } }

/* 2. Layout dimensions (not theme values) --------------------------------- */
:root {
    color-scheme: light;
    --lt-content-max: 90rem;
    --lt-tap: 2.75rem;          /* minimum interactive size, cozy (Fiori) */
    --lt-transition: 150ms ease;
}
html.ui5-content-density-compact { --lt-tap: 2rem; }

/* 3. Base ----------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    min-height: 100vh;
    font-family: var(--sapFontFamily);
    font-size: var(--sapFontSize);
    line-height: var(--sapContent_LineHeight);
    color: var(--sapTextColor);
    background: var(--sapBackgroundColor);
}

h1, h2, h3 { margin: 0 0 var(--sapContent_Space_Small); line-height: 1.25; font-weight: 600; }
h1 { font-size: var(--sapFontHeader4Size); }
h2 { font-size: var(--sapFontHeader5Size); }
p { margin: 0 0 var(--sapContent_Space_Small); }

a { color: var(--sapLinkColor); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { color: var(--sapButton_Emphasized_Hover_Background); }

:focus-visible { outline: var(--sapContent_FocusWidth) var(--sapContent_FocusStyle) var(--sapContent_FocusColor); outline-offset: 2px; }

img, svg { max-width: 100%; }
svg.lucide { width: 1.15em; height: 1.15em; flex-shrink: 0; vertical-align: -0.2em; stroke-width: 2; }

.lt-sr-only {
    position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

.lt-skip {
    position: absolute; left: var(--sapContent_Space_Tiny); top: -100px; z-index: 100;
    padding: var(--sapContent_Space_Tiny) var(--sapContent_Space_Small);
    background: var(--sapBrandColor); color: var(--sapButton_Emphasized_TextColor); border-radius: var(--sapButton_BorderCornerRadius);
}
.lt-skip:focus { top: var(--sapContent_Space_Tiny); }

/* 4. Layout --------------------------------------------------------------- */
/* Shell: ui5-navigation-layout (ShellBar in its header, side navigation, page content).
   Only the placement of the page content is styled here; the bars are UI5 components. */
html, body { height: 100%; }
body:has(> .lt-shell) { overflow: hidden; }
.lt-shell { display: block; height: 100%; }
.lt-shell:not(:defined) > [slot] { display: none; }

/* Frame colours (docs/FIORI_DESIGN.md §3): the top bar takes the brand blue of the login page and
   the side navigation a light tint of it. Every colour is derived from the theme; the high contrast
   themes keep their own frame. */
html:not([data-lt-theme$="_hcb"]):not([data-lt-theme$="_hcw"]) ui5-shellbar {
    --sapShellColor: color-mix(in srgb, var(--sapButton_Emphasized_Background) 72%, black);
    --sapShell_Background: var(--sapShellColor);
    --sapShell_TextColor: var(--sapButton_Emphasized_TextColor);
    --sapShell_Hover_Background: color-mix(in srgb, var(--sapButton_Emphasized_TextColor) 16%, transparent);
    --sapShell_Active_Background: color-mix(in srgb, var(--sapButton_Emphasized_TextColor) 26%, transparent);
    --sapShell_Active_TextColor: var(--sapButton_Emphasized_TextColor);
    --sapShell_SubBrand_TextColor: var(--sapButton_Emphasized_TextColor);
    /* Search: the magnifier, then a translucent field on the bar. */
    --sapShell_InteractiveTextColor: var(--sapButton_Emphasized_TextColor);
    --sapShell_InteractiveBackground: color-mix(in srgb, var(--sapButton_Emphasized_TextColor) 14%, transparent);
    --sapShell_InteractiveBorderColor: color-mix(in srgb, var(--sapButton_Emphasized_TextColor) 45%, transparent);
    --sapField_TextColor: var(--sapButton_Emphasized_TextColor);
    --sapField_PlaceholderTextColor: color-mix(in srgb, var(--sapButton_Emphasized_TextColor) 75%, transparent);
    --sapContent_IconColor: var(--sapButton_Emphasized_TextColor);
    --sapButton_Lite_TextColor: var(--sapButton_Emphasized_TextColor);
    --sapButton_Lite_Hover_Background: var(--sapShell_Hover_Background);
    --sapButton_Lite_Active_Background: var(--sapShell_Active_Background);
    --sapContent_FocusColor: var(--sapButton_Emphasized_TextColor);
}
html[data-lt-theme="sap_horizon_dark"] ui5-shellbar {
    --sapShellColor: color-mix(in srgb, var(--sapButton_Emphasized_Background) 38%, black);
    --sapShell_TextColor: var(--sapTextColor);
    --sapShell_Active_TextColor: var(--sapTextColor);
    --sapShell_SubBrand_TextColor: var(--sapTextColor);
    --sapShell_InteractiveTextColor: var(--sapTextColor);
    --sapField_TextColor: var(--sapTextColor);
    --sapContent_IconColor: var(--sapTextColor);
    --sapButton_Lite_TextColor: var(--sapTextColor);
    --sapContent_FocusColor: var(--sapTextColor);
}
html:not([data-lt-theme$="_hcb"]):not([data-lt-theme$="_hcw"]) #lt-sidenav {
    --sapList_Background: color-mix(in srgb, var(--sapButton_Emphasized_Background) 7%, var(--sapBaseColor));
    --sapList_Hover_Background: color-mix(in srgb, var(--sapButton_Emphasized_Background) 14%, var(--sapBaseColor));
    --sapList_SelectionBackgroundColor: color-mix(in srgb, var(--sapButton_Emphasized_Background) 20%, var(--sapBaseColor));
    --sapList_Hover_SelectionBackground: color-mix(in srgb, var(--sapButton_Emphasized_Background) 26%, var(--sapBaseColor));
}

.lt-main {
    box-sizing: border-box;
    width: 100%; max-width: var(--lt-content-max); min-height: 100%;
    padding: calc(var(--sapContent_Space_Small) * 1.5);
}

.lt-page-header {
    display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
    gap: calc(var(--sapContent_Space_Tiny) * 1.5); margin-bottom: calc(var(--sapContent_Space_Small) * 1.5);
}
.lt-page-header h1 { margin: 0; }

.lt-guest .lt-main { margin: 0 auto; }

.lt-flash, .lt-offline-banner { margin-bottom: var(--sapContent_Space_Small); }
.lt-offline-banner { display: none; }
.lt-offline .lt-offline-banner { display: block; }

/* Launchpad (home page): groups of tiles. Tiles are ui5-card; only the grid is ours. */
.lt-launchpad__title { margin-bottom: var(--sapContent_Space_Small); }
.lt-launchpad__group { margin-bottom: calc(var(--sapContent_Space_Small) * 1.5); }
.lt-launchpad__group > ui5-title { margin-bottom: var(--sapContent_Space_Tiny); }
.lt-tiles {
    display: grid; gap: var(--sapContent_Space_Small);
    grid-template-columns: repeat(auto-fill, minmax(13rem, 1fr));
}
.lt-tile { display: block; height: 100%; }
.lt-tile::part(root) { box-sizing: border-box; height: 100%; }
.lt-tile__content {
    display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--sapContent_Space_Tiny);
    padding: 0 var(--sapContent_Space_Small) var(--sapContent_Space_Small);
}
.lt-tile__value { font-variant-numeric: tabular-nums; }
.lt-tile[data-state="Negative"] .lt-tile__value { color: var(--sapNegativeTextColor); }
.lt-tile[data-state="Critical"] .lt-tile__value { color: var(--sapCriticalTextColor); }
.lt-tile[data-state="Information"] .lt-tile__value { color: var(--sapInformativeTextColor); }
.lt-tile__state { margin-left: auto; align-self: center; }
.lt-launchpad__upcoming { max-width: 60rem; }

/* Tablet: narrower tiles; large phone: two columns; phone: one tile per row. */
@media (max-width: 1023px) {
    .lt-tiles { grid-template-columns: repeat(auto-fill, minmax(11rem, 1fr)); gap: calc(var(--sapContent_Space_Tiny) * 1.5); }
}
@media (max-width: 599px) {
    .lt-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--sapContent_Space_Tiny); }
}
@media (max-width: 479px) {
    .lt-tiles { grid-template-columns: 1fr; }
}

/* List Report (docs/FIORI_DESIGN.md, "Modèle List Report"): ui5-dynamic-page filling the content
   area, filter bar grid, table header. Components are UI5; only their placement is ours. */
[hidden] { display: none !important; }
.lt-main.lt-main--page { display: flex; flex-direction: column; height: 100%; max-width: none; padding: 0; }
.lt-main--page > .lt-flash, .lt-main--page > .lt-offline-banner { margin: var(--sapContent_Space_Small) var(--sapContent_Space_Small) 0; }
.lt-list-report { flex: 1; min-height: 0; }
.lt-list-report__content { padding-block: var(--sapContent_Space_Small); }
.lt-list-report__result { margin-bottom: var(--sapContent_Space_Small); white-space: pre-line; }

/* Compact filter bar: each field takes the width it needs, so the usual filters, the check boxes
   and the buttons share one line on a desktop screen and wrap only when the room is missing. */
.lt-filter-bar {
    display: flex; flex-wrap: wrap; align-items: flex-end;
    gap: calc(var(--sapContent_Space_Tiny) / 2) var(--sapContent_Space_Tiny);
}
.lt-filter-bar__field { display: flex; flex-direction: column; flex: 0 1 8rem; min-width: 7rem; }
.lt-filter-bar__field > ui5-input, .lt-filter-bar__field > ui5-select, .lt-filter-bar__field > ui5-date-picker { width: 100%; min-width: 0; }
.lt-filter-bar__field > ui5-label { font-size: var(--sapFontSmallSize); }
.lt-filter-bar__field--wide { flex: 1 1 12rem; max-width: 16rem; }
.lt-filter-bar__field--checks { flex: none; flex-direction: row; flex-wrap: nowrap; align-items: center; gap: 0; }
.lt-filter-bar__actions { display: flex; flex: none; justify-content: flex-end; gap: calc(var(--sapContent_Space_Tiny) / 2); margin-left: auto; }
.lt-lr-heading { display: flex; align-items: center; gap: var(--sapContent_Space_Tiny); }
/* Less white space around the filters: the title line keeps the height of its content. */
.lt-list-report ui5-dynamic-page-title { --_ui5_dynamic_page_title_min_height: 2.75rem; --_ui5_dynamic_page_title_padding_top: calc(var(--sapContent_Space_Tiny) / 2); --_ui5_dynamic_page_title_padding_bottom: 0; }
.lt-list-report ui5-dynamic-page-header { padding-block: calc(var(--sapContent_Space_Tiny) / 2) var(--sapContent_Space_Tiny); }

.lt-table-header { display: flex; align-items: center; gap: var(--sapContent_Space_Small); margin-bottom: var(--sapContent_Space_Tiny); }
.lt-table-header > ui5-title { flex: none; }
.lt-table-header__toolbar { flex: 1; min-width: 0; }
.lt-cell-strong { font-family: var(--sapFontBoldFamily); }

.lt-dialog-form { display: flex; flex-direction: column; gap: var(--sapContent_Space_Tiny); min-width: min(24rem, 78vw); padding-block: var(--sapContent_Space_Tiny); }
.lt-dialog-form > ui5-label { margin-top: calc(var(--sapContent_Space_Tiny) / 2); }
.lt-dialog-footer, .lt-popover-footer {
    display: flex; justify-content: flex-end; gap: var(--sapContent_Space_Tiny);
    width: 100%; padding-block: calc(var(--sapContent_Space_Tiny) / 2);
}
@media (max-width: 599px) {
    .lt-filter-bar__field, .lt-filter-bar__field--wide { flex: 1 1 100%; max-width: none; }
    .lt-filter-bar__field--checks { flex-wrap: wrap; }
    .lt-table-header { flex-wrap: wrap; }
    .lt-list-report__content { padding-inline: var(--sapContent_Space_Tiny); }
}

/* Object Page (docs/FIORI_DESIGN.md, "Modèle Object Page"): ui5-dynamic-page with a KPI header,
   an anchor bar, sections and a floating footer. Only the placement of the blocks is ours. */
.lt-object-page { flex: 1; min-height: 0; }
.lt-object-page__content { padding-bottom: var(--sapContent_Space_Medium); }
.lt-tags { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sapContent_Space_Tiny); }

.lt-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(8.5rem, 1fr)); gap: var(--sapContent_Space_Small) var(--sapContent_Space_Medium); }
.lt-kpi { display: flex; flex-direction: column; align-items: flex-start; gap: calc(var(--sapContent_Space_Tiny) / 2); min-width: 0; }

/* The anchor bar stays visible under the snapped header while the sections scroll. */
/* --lt-op-title and --lt-op-bar are measured by pages/object-page.js (height of the sticky title and of the bar). */
.lt-anchor-bar { position: sticky; top: var(--lt-op-title, 0px); z-index: 2; background: var(--sapBackgroundColor); padding-top: calc(var(--sapContent_Space_Tiny) * 1.5); }
.lt-op-section { padding-top: var(--sapContent_Space_Small); scroll-margin-top: calc(var(--lt-op-title, 0px) + var(--lt-op-bar, 3rem)); }
/* Titles and loose texts are indented like the text inside the blocks (and like the page header). */
.lt-op-section > ui5-title, .lt-op-section > ui5-label, .lt-op-section__header { margin-bottom: var(--sapContent_Space_Tiny); padding-inline: var(--sapContent_Space_Small); }
.lt-op-section > ui5-title, .lt-op-section > ui5-label { display: block; }
.lt-op-section__header { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sapContent_Space_Tiny); min-height: var(--lt-tap); }
/* Every section shows its content in the same white block as the ui5-form of the first one. */
.lt-op-block { overflow: hidden; background: var(--sapGroup_ContentBackground); border-radius: var(--sapElement_BorderCornerRadius); }
.lt-op-block--padded, .lt-op-block--empty { padding: var(--sapContent_Space_Small); }
.lt-op-block--empty ui5-text { color: var(--sapContent_LabelColor); }
.lt-op-section__header > ui5-title { margin-right: auto; }
.lt-op-strip { margin-top: var(--sapContent_Space_Small); }

.lt-item { display: flex; flex-direction: column; gap: calc(var(--sapContent_Space_Tiny) / 2); width: 100%; padding-block: calc(var(--sapContent_Space_Tiny) * 1.5); }
.lt-item--row { flex-direction: row; flex-wrap: wrap; align-items: center; gap: var(--sapContent_Space_Tiny) var(--sapContent_Space_Small); }
.lt-item__head { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sapContent_Space_Tiny); }
.lt-item__grow { flex: 1; min-width: 8rem; overflow-wrap: anywhere; }
.lt-change { display: block; }
.lt-prewrap { white-space: pre-wrap; }
.lt-field-stack { display: flex; flex-direction: column; align-items: flex-start; gap: calc(var(--sapContent_Space_Tiny) / 2); width: 100%; }
.lt-field-stack > ui5-input, .lt-field-stack > ui5-date-picker { width: 100%; }
ui5-form-item > ui5-input, ui5-form-item > ui5-select, ui5-form-item > ui5-textarea, ui5-form-item > ui5-date-picker, ui5-form-item > ui5-datetime-picker { width: 100%; }
.lt-dialog-form > ui5-select, .lt-dialog-form > ui5-input, .lt-dialog-form > ui5-textarea, .lt-dialog-form > ui5-date-picker, .lt-dialog-form > ui5-file-uploader { width: 100%; }
form.lt-dialog-form { margin: 0; }

/* Wizard and simple forms (docs/FIORI_DESIGN.md, "Formulaires") */
.lt-wizard-form { display: block; margin: 0; }
.lt-wizard-form ui5-wizard { height: auto; min-height: 26rem; }
.lt-wizard-step { display: flex; flex-direction: column; gap: var(--sapContent_Space_Tiny); padding-bottom: var(--sapContent_Space_Medium); }
.lt-form-actions { display: flex; justify-content: flex-end; gap: var(--sapContent_Space_Tiny); padding-top: var(--sapContent_Space_Small); }
ui5-form-item > ui5-combobox, ui5-form-item > ui5-step-input, ui5-form-item > ui5-file-uploader { width: 100%; }
.lt-field-stack > ui5-select, .lt-field-stack > ui5-file-uploader { width: 100%; }

/* Overview Page (docs/FIORI_DESIGN.md §15): a grid of ui5-card. KPI cards on one row, then the
   list cards, then the chart cards; everything stacks on small screens. */
.lt-overview-page { flex: 1; min-height: 0; }
.lt-ov-grid {
    display: grid; align-items: stretch; gap: var(--sapContent_Space_Small);
    grid-template-columns: repeat(12, minmax(0, 1fr));
    padding-block: var(--sapContent_Space_Small) var(--sapContent_Space_Medium);
}
.lt-ov-card { display: block; grid-column: span 6; min-width: 0; }
.lt-ov-card::part(root) { box-sizing: border-box; height: 100%; }
.lt-ov-card--kpi { grid-column: span 3; }
.lt-ov-grid[data-kpis="3"] .lt-ov-card--kpi { grid-column: span 4; }
.lt-ov-grid[data-lists="1"] .lt-ov-card--list { grid-column: span 12; }
.lt-ov-kpi {
    display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--sapContent_Space_Tiny);
    padding: 0 var(--sapContent_Space_Small) var(--sapContent_Space_Small);
}
.lt-ov-kpi__value { font-variant-numeric: tabular-nums; }
.lt-ov-kpi__state { margin-left: auto; align-self: center; }
.lt-ov-card[data-state="Negative"] .lt-ov-kpi__value { color: var(--sapNegativeTextColor); }
.lt-ov-card[data-state="Critical"] .lt-ov-kpi__value { color: var(--sapCriticalTextColor); }
.lt-ov-card[data-state="Positive"] .lt-ov-kpi__value { color: var(--sapPositiveTextColor); }
.lt-ov-chart { position: relative; height: 16rem; padding: 0 var(--sapContent_Space_Small) var(--sapContent_Space_Small); }
.lt-ov-data { margin: 0 var(--sapContent_Space_Small) var(--sapContent_Space_Small); }
@media (max-width: 1279px) {
    .lt-ov-card--kpi, .lt-ov-grid[data-kpis="3"] .lt-ov-card--kpi { grid-column: span 6; }
}
@media (max-width: 899px) {
    .lt-ov-card--list, .lt-ov-card--chart { grid-column: span 12; }
}
@media (max-width: 479px) {
    .lt-ov-card--kpi, .lt-ov-grid[data-kpis="3"] .lt-ov-card--kpi { grid-column: span 12; }
    .lt-ov-grid { gap: var(--sapContent_Space_Tiny); }
}

/* List Report table: a compact DataTable in a white block. One line per row, tight paddings,
   the colours of the UI5 lists. Long texts are cut with an ellipsis (full text in the tooltip). */
.lt-dt-block { overflow-x: auto; background: var(--sapGroup_ContentBackground); border-radius: var(--sapElement_BorderCornerRadius); }
table.lt-table.lt-dt { font-size: var(--sapFontSize); }
table.lt-table.lt-dt thead th, table.lt-table.lt-dt tbody td {
    height: 2rem; padding: 0 var(--sapContent_Space_Tiny);
    border-bottom: 1px solid var(--sapList_BorderColor);
    white-space: nowrap; vertical-align: middle; text-align: left;
}
table.lt-table.lt-dt thead th {
    color: var(--sapList_HeaderTextColor); background: var(--sapList_HeaderBackground);
    border-bottom: 1px solid var(--sapList_HeaderBorderColor); font-size: var(--sapFontSize);
}
table.lt-table.lt-dt tbody tr { cursor: pointer; }
/* Rows that open nothing: settings lists rendered by the server, lists without an object page. */
table.lt-table.lt-dt.lt-dt--static tbody tr { cursor: default; }
table.lt-table.lt-dt td.lt-dt__wrap { white-space: normal; }
table.lt-table.lt-dt .lt-dt__actions { width: 1%; padding-block: 0; text-align: right; }
.lt-table-header--next { margin-top: var(--sapContent_Space_Small); }
table.lt-table.lt-dt tbody tr:hover { background: var(--sapList_Hover_Background); }
table.lt-table.lt-dt tbody tr.selected { background: var(--sapList_SelectionBackgroundColor); }
table.lt-table.lt-dt tbody tr.selected > * { box-shadow: none; }
table.lt-table.lt-dt tbody tr:focus-visible { outline-offset: -2px; }
table.lt-table.lt-dt .lt-dt__select { width: 1%; cursor: default; }
.lt-dt__check { display: block; width: 1rem; height: 1rem; margin: 0; accent-color: var(--sapSelectedColor); cursor: pointer; }
/* DataTables right-aligns dates and numbers by type: a list reads better left-aligned, numbers excepted. */
table.lt-table.lt-dt th.dt-type-date, table.lt-table.lt-dt td.dt-type-date, table.lt-table.lt-dt th.dt-type-numeric:not(.lt-num), table.lt-table.lt-dt td.dt-type-numeric:not(.lt-num) { text-align: left; }
table.lt-table.lt-dt thead th.dt-type-date .dt-column-header, table.lt-table.lt-dt thead th.dt-type-numeric:not(.lt-num) .dt-column-header { flex-direction: row; }
table.lt-table.lt-dt td.lt-num, table.lt-table.lt-dt th.lt-num { text-align: right; }
.lt-dt__text { display: inline-block; max-width: clamp(8rem, 13vw, 26rem); overflow: hidden; text-overflow: ellipsis; vertical-align: bottom; }
.lt-dt-block div.dt-container .dt-layout-row { margin: 0; padding: var(--sapContent_Space_Tiny) var(--sapContent_Space_Small); }
.lt-dt-block div.dt-container .dt-layout-row.dt-layout-table { padding: 0; }
.lt-dt-block div.dt-container .dt-layout-cell.dt-layout-start { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sapContent_Space_Small); }
.lt-dt-block div.dt-container .dt-info { padding-top: 0; color: var(--sapContent_LabelColor); }
.lt-dt-block td.dt-empty { cursor: default; white-space: normal; }
@media (max-width: 640px) {
    table.lt-table.lt-dt tbody td { height: auto; min-height: 2rem; padding-block: calc(var(--sapContent_Space_Tiny) / 2); white-space: normal; }
    .lt-dt__text { display: inline; max-width: none; overflow: visible; white-space: normal; }
    table.lt-table.lt-dt .lt-dt__select { width: 100%; }
    table.lt-table.lt-dt td.lt-num { text-align: left; }
}

/* 5. Components ----------------------------------------------------------- */
.lt-card {
    background: var(--sapGroup_ContentBackground);
    border: 1px solid var(--sapList_BorderColor);
    border-radius: var(--sapElement_BorderCornerRadius);
    box-shadow: var(--sapContent_Shadow0);
    padding: calc(var(--sapContent_Space_Small) * 1.5);
}

.lt-btn, button, input[type="submit"] {
    display: inline-flex; align-items: center; justify-content: center; gap: var(--sapContent_Space_Tiny);
    min-height: var(--lt-tap);
    padding: var(--sapContent_Space_Tiny) var(--sapContent_Space_Small);
    font: inherit; font-weight: 500;
    color: var(--sapTextColor);
    background: var(--sapGroup_ContentBackground);
    border: 1px solid var(--sapList_BorderColor);
    border-radius: var(--sapButton_BorderCornerRadius);
    cursor: pointer;
    text-decoration: none;
    transition: background var(--lt-transition), border-color var(--lt-transition);
}
.lt-btn:hover, button:hover { background: var(--sapNeutralBackground); }
.lt-btn--primary, button[type="submit"]:not(.lt-btn--ghost):not(.lt-btn) {
    color: var(--sapButton_Emphasized_TextColor); background: var(--sapBrandColor); border-color: var(--sapBrandColor);
}
.lt-btn--primary:hover, button[type="submit"]:not(.lt-btn--ghost):not(.lt-btn):hover { background: var(--sapButton_Emphasized_Hover_Background); }
.lt-btn--ghost { background: transparent; border-color: transparent; }
button:disabled, .is-loading { opacity: .6; cursor: progress; }

.lt-form { display: flex; flex-direction: column; gap: var(--sapContent_Space_Small); }
.lt-field { display: flex; flex-direction: column; gap: calc(var(--sapContent_Space_Tiny) / 2); }
.lt-field label, label { font-weight: 500; }
.lt-field__error { font-size: var(--sapFontSmallSize); color: var(--sapNegativeTextColor); }

input[type="text"], input[type="email"], input[type="password"], input[type="search"], input[type="date"], input[type="datetime-local"], input[type="number"], input[type="tel"], select, textarea {
    width: 100%;
    min-height: var(--lt-tap);
    padding: var(--sapContent_Space_Tiny) calc(var(--sapContent_Space_Tiny) * 1.5);
    font: inherit;
    color: var(--sapTextColor);
    background: var(--sapGroup_ContentBackground);
    border: 1px solid var(--sapList_BorderColor);
    border-radius: var(--sapButton_BorderCornerRadius);
}
textarea { min-height: 6rem; resize: vertical; }
[aria-invalid="true"] { border-color: var(--sapNegativeTextColor); }

.lt-inline-form { display: inline-flex; align-items: center; gap: var(--sapContent_Space_Tiny); margin: 0; }
.lt-inline-form select { width: auto; }

.lt-alert {
    padding: calc(var(--sapContent_Space_Tiny) * 1.5) var(--sapContent_Space_Small);
    border: 1px solid; border-radius: var(--sapButton_BorderCornerRadius);
    margin-bottom: var(--sapContent_Space_Small);
}
.lt-alert--error { color: var(--sapNegativeTextColor); background: var(--sapErrorBackground); border-color: currentColor; }
.lt-alert--warning { color: var(--sapCriticalTextColor); background: var(--sapWarningBackground); border-color: currentColor; }
.lt-alert--success { color: var(--sapPositiveTextColor); background: var(--sapSuccessBackground); border-color: currentColor; }

.lt-badge {
    display: inline-block;
    padding: 1px var(--sapContent_Space_Tiny);
    font-size: var(--sapFontSmallSize); font-weight: 500; line-height: 1.6;
    color: var(--sapContent_LabelColor); background: var(--sapNeutralBackground);
    border-radius: 999px; white-space: nowrap;
}
.lt-badge--incoming { color: var(--sapInformativeTextColor); background: var(--sapInformationBackground); }
.lt-badge--outgoing { color: var(--sapAccentColor5); background: var(--sapNeutralBackground); }
.lt-badge--urgent { color: var(--sapNegativeTextColor); background: var(--sapErrorBackground); }
.lt-badge--high { color: var(--sapCriticalTextColor); background: var(--sapWarningBackground); }
.lt-badge--normal { color: var(--sapInformativeTextColor); background: var(--sapInformationBackground); }
.lt-badge--low { color: var(--sapContent_LabelColor); }
.lt-badge--closed, .lt-badge--archived { color: var(--sapContent_LabelColor); }
.lt-badge--answered { color: var(--sapPositiveTextColor); background: var(--sapSuccessBackground); }

.lt-due--overdue { color: var(--sapNegativeTextColor); font-weight: 600; }
.lt-due--soon { color: var(--sapCriticalTextColor); font-weight: 600; }

/* Login page: illustrated hero + form panel */
/* Doubled class: must win over the responsive .lt-main paddings declared later. */
.lt-main.lt-main--bleed { display: flex; flex-direction: column; max-width: none; padding: 0; }
.lt-main--bleed > .lt-login-page { flex: 1; }
.lt-main--bleed > .lt-flash { margin: var(--sapContent_Space_Small); }

.lt-login-page {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(360px, 1fr);
    min-height: 100%;
}

.lt-login-hero {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    display: flex; flex-direction: column; justify-content: space-between; gap: calc(var(--sapContent_Space_Small) * 1.5);
    padding: clamp(1.25rem, 3vw, 2.5rem) clamp(1.5rem, 4vw, 3.5rem);
    color: var(--sapButton_Emphasized_TextColor);
    background:
        radial-gradient(60% 50% at 85% 10%, color-mix(in srgb, var(--sapInformativeElementColor) 45%, transparent), transparent 70%),
        radial-gradient(50% 45% at 10% 95%, color-mix(in srgb, var(--sapCriticalElementColor) 22%, transparent), transparent 70%),
        linear-gradient(150deg, color-mix(in srgb, var(--sapButton_Emphasized_Background) 35%, black) 0%, color-mix(in srgb, var(--sapButton_Emphasized_Background) 65%, black) 45%, var(--sapButton_Emphasized_Background) 100%);
}
/* Dot grid, like a sorting table */
.lt-login-hero::before {
    content: "";
    position: absolute; inset: 0; z-index: -1;
    background-image: radial-gradient(color-mix(in srgb, var(--sapButton_Emphasized_TextColor) 14%, transparent) 1px, transparent 1.5px);
    background-size: 22px 22px;
    mask-image: linear-gradient(180deg, rgba(0, 0, 0, .9), rgba(0, 0, 0, .25));
    -webkit-mask-image: linear-gradient(180deg, rgba(0, 0, 0, .9), rgba(0, 0, 0, .25));
}
.lt-login-hero__title {
    max-width: 22ch;
    margin: 0 0 calc(var(--sapContent_Space_Tiny) * 1.5);
    font-size: var(--sapFontHeader2Size); font-weight: 700; line-height: 1.15;
}
.lt-login-hero__subtitle { max-width: 46ch; margin: 0; color: color-mix(in srgb, var(--sapButton_Emphasized_TextColor) 82%, transparent); font-size: var(--sapFontHeader5Size); }
.lt-login-hero__art {
    display: block;
    /* Height-bound so title, illustration and features fit a 900 px screen. */
    width: auto; height: auto;
    max-width: min(100%, 620px); max-height: 44vh;
    margin: 0 auto;
    animation: lt-float 9s ease-in-out infinite;
}
@keyframes lt-float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}
.lt-login-hero__features {
    display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: calc(var(--sapContent_Space_Tiny) * 1.5);
    margin: 0; padding: 0; list-style: none;
}
.lt-login-hero__features li {
    display: flex; align-items: center; gap: var(--sapContent_Space_Tiny);
    padding: var(--sapContent_Space_Tiny) calc(var(--sapContent_Space_Tiny) * 1.5);
    font-size: var(--sapFontSmallSize); color: color-mix(in srgb, var(--sapButton_Emphasized_TextColor) 92%, transparent);
    background: color-mix(in srgb, var(--sapButton_Emphasized_TextColor) 8%, transparent); border: 1px solid color-mix(in srgb, var(--sapButton_Emphasized_TextColor) 14%, transparent); border-radius: var(--sapButton_BorderCornerRadius);
}
.lt-login-hero__features svg.lucide { color: var(--sapCriticalElementColor); }

.lt-login-panel {
    display: flex; align-items: center; justify-content: center;
    padding: clamp(1.5rem, 4vw, 3rem);
    background: var(--sapGroup_ContentBackground);
}
.lt-login-form { width: 100%; max-width: 24rem; }
.lt-login-form h1 { font-size: var(--sapFontHeader3Size); margin-bottom: var(--sapContent_Space_Tiny); }
.lt-login-form > .lt-muted { margin-bottom: calc(var(--sapContent_Space_Small) * 1.5); }
.lt-input-icon { position: relative; }
.lt-input-icon svg.lucide {
    position: absolute; left: .75rem; top: 50%; transform: translateY(-50%);
    color: var(--sapContent_LabelColor); pointer-events: none;
}
.lt-input-icon input { padding-left: 2.5rem; }
.lt-login-submit { width: 100%; min-height: calc(var(--lt-tap) + 4px); margin-top: var(--sapContent_Space_Tiny); }
.lt-login-footnote {
    display: flex; align-items: center; gap: var(--sapContent_Space_Tiny);
    margin: calc(var(--sapContent_Space_Small) * 1.5) 0 0; font-size: var(--sapFontSmallSize); color: var(--sapContent_LabelColor);
}

@media (max-width: 960px) {
    /* The presentation stretches to the bottom of the screen: no empty band below. */
    .lt-login-page { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
    /* Phones and tablets: the form comes first, the presentation after it. */
    .lt-login-panel { order: -1; padding-top: var(--sapContent_Space_Medium); padding-bottom: var(--sapContent_Space_Medium); }
    .lt-login-hero__art { width: min(100%, 460px); }
}
@media (max-width: 640px) {
    .lt-login-hero__art { display: none; }
    /* Without the illustration, keep text and features together at the top. */
    .lt-login-hero { justify-content: flex-start; }
    .lt-login-hero__features { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
    .lt-login-hero__art { animation: none; }
}

.lt-login { max-width: 24rem; margin: 8vh auto 0; }

.lt-chart { position: relative; min-height: 260px; }

.lt-muted { color: var(--sapContent_LabelColor); }
.lt-actions { display: flex; flex-wrap: wrap; gap: var(--sapContent_Space_Tiny); }
.lt-card + .lt-card, .lt-columns + .lt-card { margin-top: var(--sapContent_Space_Small); }

.lt-check { display: inline-flex; align-items: center; gap: var(--sapContent_Space_Tiny); min-height: var(--lt-tap); font-weight: 400; cursor: pointer; }
.lt-check input { width: 1.15rem; height: 1.15rem; accent-color: var(--sapBrandColor); }
fieldset.lt-field { border: 0; padding: 0; margin: 0; flex-direction: row; flex-wrap: wrap; gap: var(--sapContent_Space_Small); }
fieldset.lt-field legend { font-weight: 500; margin-bottom: calc(var(--sapContent_Space_Tiny) / 2); width: 100%; }

/* Two-column forms, one column on small screens */

/* Table filters */
.lt-filters { display: flex; flex-wrap: wrap; align-items: flex-end; gap: calc(var(--sapContent_Space_Tiny) * 1.5); margin-bottom: var(--sapContent_Space_Small); padding: var(--sapContent_Space_Small); }
.lt-filters .lt-field { min-width: 150px; flex: 1 1 150px; }
.lt-filters__actions { margin-left: auto; }

/* Detail page */
.lt-columns { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: var(--sapContent_Space_Small); align-items: start; }
.lt-columns .lt-card + .lt-card { margin-top: 0; }
table.lt-table--compact th, table.lt-table--compact td { padding: calc(var(--sapContent_Space_Tiny) / 2) var(--sapContent_Space_Tiny); font-size: var(--sapFontSmallSize); }
table.lt-table--compact th { width: 30%; color: var(--sapContent_LabelColor); background: transparent; }
del { color: var(--sapNegativeTextColor); text-decoration-thickness: 1px; }
ins { color: var(--sapPositiveTextColor); text-decoration: none; }

/* Workflow */
.lt-list { list-style: none; margin: 0 0 var(--sapContent_Space_Small); padding: 0; }
.lt-list > li { display: flex; flex-direction: column; gap: calc(var(--sapContent_Space_Tiny) / 2); padding: calc(var(--sapContent_Space_Tiny) * 1.5) 0; border-bottom: 1px solid var(--sapList_BorderColor); }
.lt-list > li:last-child { border-bottom: 0; }
.lt-list p { margin: 0; }
.lt-badge--for_action { color: var(--sapBrandColor); background: var(--sapInformationBackground); }

/* Deadlines */
.lt-due--today { color: var(--sapCriticalTextColor); font-weight: 600; }
.lt-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: calc(var(--sapContent_Space_Tiny) * 1.5); }
.lt-stat {
    display: flex; flex-direction: column; align-items: flex-start; gap: calc(var(--sapContent_Space_Tiny) / 2);
    padding: calc(var(--sapContent_Space_Tiny) * 1.5); border-radius: var(--sapButton_BorderCornerRadius); background: var(--sapNeutralBackground);
}
.lt-stat__value { font-size: var(--sapFontHeader3Size); font-weight: 700; line-height: 1; font-variant-numeric: tabular-nums; }
.lt-stat__label { font-size: var(--sapFontSmallSize); color: var(--sapContent_LabelColor); }
.lt-stat--overdue.is-set { background: var(--sapErrorBackground); color: var(--sapNegativeTextColor); }
.lt-stat--today.is-set { background: var(--sapWarningBackground); color: var(--sapCriticalTextColor); }

/* Notifications */
.lt-notifications form { margin: 0; }
.lt-notification {
    display: grid; grid-template-columns: auto 1fr auto; align-items: start; gap: calc(var(--sapContent_Space_Tiny) * 1.5);
    width: 100%; border: 0; background: transparent; text-align: left; font-weight: 400;
}
.lt-notification--overdue svg.lucide { color: var(--sapNegativeTextColor); }
.lt-notification--due_soon svg.lucide { color: var(--sapCriticalTextColor); }
.lt-notifications .is-unread .lt-notification { font-weight: 600; }
.lt-notifications .is-unread .lt-notification::before {
    content: ""; position: absolute; left: 0; width: 4px; height: 1.5rem; border-radius: 2px; background: var(--sapBrandColor);
}
.lt-notifications > li { position: relative; padding-left: var(--sapContent_Space_Tiny); }
.lt-notification__date { white-space: nowrap; font-size: var(--sapFontSmallSize); }
@media (max-width: 640px) {
    .lt-stats { grid-template-columns: 1fr; }
    .lt-notification { grid-template-columns: auto 1fr; }
    .lt-notification__date { grid-column: 2; }
}

/* Statistics */
.lt-stats--kpi { grid-template-columns: repeat(4, minmax(0, 1fr)); margin-bottom: var(--sapContent_Space_Small); }
.lt-stats--kpi .lt-stat { background: var(--sapGroup_ContentBackground); border: 1px solid var(--sapList_BorderColor); box-shadow: var(--sapContent_Shadow0); padding: var(--sapContent_Space_Small); }
.lt-stat__hint { font-size: var(--sapFontSmallSize); color: var(--sapContent_LabelColor); }
.lt-stat--overdue .lt-stat__value { color: var(--sapNegativeTextColor); }
.lt-chart-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--sapContent_Space_Small); }
.lt-chart-grid .lt-card + .lt-card { margin-top: 0; }
.lt-chart-card--wide { grid-column: 1 / -1; }
.lt-chart-card .lt-chart { height: 280px; }
.lt-chart-card--wide .lt-chart { height: 320px; }
.lt-chart-card__empty { display: none; }
.lt-chart-card.is-empty .lt-chart { display: none; }
.lt-chart-card.is-empty .lt-chart-card__empty { display: block; }
.lt-chart-card__data summary { cursor: pointer; font-size: var(--sapFontSmallSize); color: var(--sapContent_LabelColor); margin-top: var(--sapContent_Space_Tiny); }
.lt-stats-page.is-loading { opacity: .55; transition: opacity var(--lt-transition); }
@media (max-width: 960px) {
    .lt-chart-grid { grid-template-columns: 1fr; }
    .lt-stats--kpi { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* Registration slip (screen preview + print) */
.lt-print-page { background: var(--sapNeutralBackground); }
.lt-print-toolbar { display: flex; justify-content: space-between; max-width: 210mm; margin: var(--sapContent_Space_Small) auto; padding: 0 var(--sapContent_Space_Small); }
.lt-slip {
    box-sizing: border-box;
    width: 100%; max-width: 210mm; margin: 0 auto var(--sapContent_Space_Medium); padding: 14mm 14mm 10mm;
    color: var(--sapTextColor); background: var(--sapBaseColor); box-shadow: var(--sapContent_Shadow2);
    font-size: var(--sapFontSize);
}
.lt-slip__header { display: flex; justify-content: space-between; align-items: flex-start; gap: 8mm; padding-bottom: 5mm; border-bottom: 2px solid var(--sapBrandColor); }
.lt-slip__org { margin: 0 0 2mm; font-weight: 600; color: var(--sapContent_LabelColor); }
.lt-slip__title { margin: 0; font-size: var(--sapFontHeader4Size); color: var(--sapBrandColor); }
.lt-slip__ref { display: flex; flex-direction: column; align-items: flex-end; gap: 1mm; text-align: right; }
.lt-slip__ref-label { font-size: var(--sapFontSmallSize); text-transform: uppercase; letter-spacing: .06em; color: var(--sapContent_LabelColor); }
.lt-slip__ref strong { font-size: var(--sapFontHeader4Size); letter-spacing: .02em; }
.lt-barcode { display: block; width: 62mm; height: 12mm; }
.lt-slip__fields { width: 100%; margin: 6mm 0; border-collapse: collapse; }
.lt-slip__fields th, .lt-slip__fields td { padding: 2.2mm 2.5mm; border: 1px solid var(--sapList_BorderColor); text-align: left; vertical-align: top; }
.lt-slip__fields th { width: 18%; font-weight: 600; color: var(--sapTextColor); background: var(--sapNeutralBackground); font-size: var(--sapFontSmallSize); }
.lt-slip__signatures { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4mm; margin-top: 4mm; }
.lt-slip__box { display: flex; flex-direction: column; justify-content: space-between; min-height: 30mm; padding: 3mm; border: 1px dashed var(--sapNeutralBorderColor); border-radius: var(--sapButton_BorderCornerRadius); font-weight: 600; }
.lt-slip__box-line { font-weight: 400; font-size: var(--sapFontSmallSize); color: var(--sapContent_LabelColor); border-top: 1px solid var(--sapList_BorderColor); padding-top: 1.5mm; }
.lt-slip__footer { margin-top: 6mm; font-size: var(--sapFontSmallSize); color: var(--sapContent_LabelColor); text-align: right; }

@page { size: A4; margin: 10mm; }
@media print {
    .lt-print-page { background: var(--sapBaseColor); }
    .lt-print-toolbar { display: none !important; }
    .lt-slip { box-shadow: none; margin: 0; padding: 0; max-width: none; }
    .lt-slip__fields th { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* Autocomplete */
[data-lt-picker] { position: relative; }

@media (max-width: 860px) {
    .lt-columns { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
    .lt-filters__actions { margin-left: 0; }
}

/* 6. Tables --------------------------------------------------------------- */
.lt-table-wrap { overflow-x: auto; }

table.lt-table { width: 100%; border-collapse: collapse; background: var(--sapGroup_ContentBackground); }
table.lt-table th, table.lt-table td {
    padding: var(--sapContent_Space_Tiny) calc(var(--sapContent_Space_Tiny) * 1.5);
    border-bottom: 1px solid var(--sapList_BorderColor);
    text-align: left; vertical-align: top;
}
table.lt-table thead th {
    font-size: var(--sapFontSmallSize); font-weight: 600;
    color: var(--sapContent_LabelColor); background: var(--sapNeutralBackground);
    white-space: nowrap;
}
table.lt-table tbody tr:hover { background: var(--sapInformationBackground); }
table.lt-table td.lt-num { text-align: right; font-variant-numeric: tabular-nums; }

/* 7. Vendor overrides (DataTables 2) ------------------------- */
div.dt-container { color: var(--sapTextColor); font-size: var(--sapFontSize); }
div.dt-container .dt-search input, div.dt-container .dt-length select {
    min-height: var(--lt-tap); width: auto;
    color: var(--sapTextColor); background: var(--sapGroup_ContentBackground);
    border: 1px solid var(--sapList_BorderColor); border-radius: var(--sapButton_BorderCornerRadius);
}
div.dt-container .dt-paging .dt-paging-button {
    min-width: var(--lt-tap); min-height: var(--lt-tap);
    border-radius: var(--sapButton_BorderCornerRadius) !important;
    color: var(--sapTextColor) !important;
}
div.dt-container .dt-paging .dt-paging-button.current, div.dt-container .dt-paging .dt-paging-button.current:hover {
    color: var(--sapButton_Emphasized_TextColor) !important;
    background: var(--sapBrandColor) !important;
    border-color: var(--sapBrandColor) !important;
}
div.dt-container .dt-processing > div:last-child > div { background: var(--sapBrandColor); }
table.dataTable > tbody > tr.selected > * { box-shadow: inset 0 0 0 9999px var(--sapInformationBackground); color: var(--sapTextColor); }

/* 8. Responsive ----------------------------------------------------------- */
@media (max-width: 1024px) {
    .lt-main { padding: var(--sapContent_Space_Small); }
}

/* Stacked "card" rows for tables on small screens (labels set by lt-tables.js). */
@media (max-width: 640px) {
    :root { --lt-tap: 44px; }
    .lt-main { padding: calc(var(--sapContent_Space_Tiny) * 1.5); }
    .lt-card { padding: var(--sapContent_Space_Small); }

    table.lt-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); }
    table.lt-table, table.lt-table tbody, table.lt-table tr, table.lt-table td { display: block; width: 100%; }
    table.lt-table tr {
        margin-bottom: calc(var(--sapContent_Space_Tiny) * 1.5);
        border: 1px solid var(--sapList_BorderColor); border-radius: var(--sapElement_BorderCornerRadius);
        background: var(--sapGroup_ContentBackground);
    }
    table.lt-table td { display: flex; gap: calc(var(--sapContent_Space_Tiny) * 1.5); border-bottom: 1px solid var(--sapNeutralBackground); }
    table.lt-table td:last-child { border-bottom: 0; }
    table.lt-table td[data-label]::before {
        content: attr(data-label);
        flex: 0 0 38%;
        font-size: var(--sapFontSmallSize); font-weight: 600; color: var(--sapContent_LabelColor);
    }
    table.lt-table td.lt-num { text-align: left; }

    div.dt-container .dt-layout-row { flex-direction: column; align-items: stretch; gap: var(--sapContent_Space_Tiny); }
    div.dt-container .dt-search input { width: 100%; margin-left: 0; }
}

/* 9. Print ---------------------------------------------------------------- */
@media print {
    ui5-shellbar, ui5-side-navigation, .lt-offline-banner, .lt-flash, .dt-paging, .dt-search, .dt-length, button { display: none !important; }
    .lt-main { padding: 0; max-width: none; }
    body { background: var(--sapBaseColor); color: var(--sapTextColor); }
    .lt-card { box-shadow: none; border: 0; padding: 0; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { transition: none !important; animation: none !important; }
}
