/* Shell layout on top of SAP Horizon theme variables (follows light/dark automatically). */
html, body { height: 100%; margin: 0; }
body { background: var(--sapBackgroundColor); color: var(--sapTextColor); font-family: var(--sapFontFamily); font-size: var(--sapFontSize); }
[hidden] { display: none !important; }
.boot { position: fixed; inset: 0; display: grid; place-items: center; }

.login { min-height: 100%; display: grid; place-items: center; padding: 24px 16px; box-sizing: border-box;
  background: linear-gradient(160deg, var(--sapShellColor) 0%, var(--sapBackgroundColor) 55%); }
.login-card { width: 100%; max-width: 380px; }
.login-form { display: grid; gap: .4rem; padding: 0 1rem 1.25rem; }
.login-form ui5-input { width: 100%; margin-bottom: .5rem; }

.shell { height: 100%; display: flex; flex-direction: column; }
.body { flex: 1; min-height: 0; display: flex; }
#sidenav { height: 100%; }
.view { flex: 1; min-width: 0; height: 100%; outline: none; }
.view > ui5-dynamic-page { height: 100%; }
@media (max-width: 760px) { .body { position: relative; } #sidenav { position: absolute; z-index: 20; inset: 0 auto 0 0; box-shadow: var(--sapContent_Shadow2); } #sidenav.mobile-hidden { display: none; } }

.content { display: grid; gap: 1rem; padding: 1rem 0 2rem; align-content: start; }
.grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.kpis { display: flex; gap: 2.5rem; flex-wrap: wrap; padding: .25rem 0 .5rem; }
.kpi .v { font-size: 1.75rem; font-family: var(--sapFontLightFamily, var(--sapFontFamily)); color: var(--sapTextColor); line-height: 1.2; font-variant-numeric: tabular-nums; }
.kpi .l { font-size: var(--sapFontSmallSize); color: var(--sapContent_LabelColor); }
.kpi.s1 .v { color: var(--sapIndicationColor_2, #c35500); } .kpi.s2 .v { color: var(--sapIndicationColor_5, #0070f2); } .kpi.s3 .v { color: var(--sapIndicationColor_7, #7858ff); }
.card-body { padding: 0 1rem 1rem; display: grid; gap: .75rem; min-width: 0; }
.muted { color: var(--sapContent_LabelColor); font-size: var(--sapFontSmallSize); }
.mono { font-family: var(--sapFontMonospace, ui-monospace, Menlo, Consolas, monospace); font-size: .85em; }
.num { text-align: right; font-variant-numeric: tabular-nums; }
.row { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; }
.spacer { flex: 1; }
.stack { display: grid; gap: .25rem; }

/* forms */
.form { display: grid; gap: .25rem 1rem; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); align-items: start; }
.form .f { display: grid; gap: .2rem; min-width: 0; }
.form .full { grid-column: 1 / -1; }
.form ui5-input, .form ui5-select, .form ui5-combobox, .form ui5-date-picker, .form ui5-textarea, .form ui5-step-input { width: 100%; }
.form .help { font-size: var(--sapFontSmallSize); color: var(--sapContent_LabelColor); }
.form ui5-textarea { font-family: var(--sapFontMonospace, monospace); }
.dlg-body { display: grid; gap: 1rem; padding: .25rem 0; min-width: min(680px, 86vw); max-width: 900px; }
.lines { display: grid; gap: .5rem; }
.line { display: grid; grid-template-columns: minmax(130px, 1.2fr) minmax(130px, 1fr) minmax(120px, 1.2fr) auto; gap: .5rem; align-items: end; }
.line.inv { grid-template-columns: minmax(200px, 3fr) 90px 100px minmax(120px, 1fr) auto; }
.line.rc { grid-template-columns: minmax(150px, 1.3fr) minmax(150px, 1.3fr) minmax(110px, 1fr) 120px 110px minmax(150px, 1.3fr) auto; }
.line > * { min-width: 0; width: 100%; }
@media (max-width: 760px) { .line, .line.inv, .line.rc { grid-template-columns: 1fr 1fr; } }

/* data table */
.dt { display: grid; gap: .5rem; min-width: 0; }
.dt-bar { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; }
.dt-bar ui5-input { width: 16rem; max-width: 100%; }
.dt-wrap { overflow-x: auto; border: 1px solid var(--sapList_BorderColor); border-radius: var(--sapElement_BorderCornerRadius, 8px); background: var(--sapList_Background); }
.dt-foot { display: flex; justify-content: space-between; align-items: center; gap: .5rem; flex-wrap: wrap; }
.sorthead { cursor: pointer; user-select: none; display: inline-flex; gap: .25rem; align-items: center; }
.colpop { display: grid; gap: .25rem; padding: .5rem; max-height: 60vh; overflow: auto; }

/* charts */
.bars { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(28px, 1fr); gap: 8px; align-items: end; height: 200px; border-bottom: 1px solid var(--sapList_BorderColor); overflow-x: auto; }
.bar { display: flex; flex-direction: column-reverse; height: 100%; min-width: 28px; }
.bar i { display: block; width: 100%; }
.bar-l { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(28px, 1fr); gap: 8px; font-size: .72rem; color: var(--sapContent_LabelColor); text-align: center; }
.legend { display: flex; gap: 1rem; font-size: var(--sapFontSmallSize); color: var(--sapContent_LabelColor); }
.legend span::before { content: ""; display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 6px; background: var(--c); }
.c1 { --c: var(--sapIndicationColor_2, #c35500); } .c2 { --c: var(--sapIndicationColor_5, #0070f2); } .c3 { --c: var(--sapIndicationColor_7, #7858ff); }

pre.code { margin: 0; padding: .75rem; background: var(--sapField_Background); border: 1px solid var(--sapField_BorderColor); border-radius: 6px; font-family: var(--sapFontMonospace, monospace); font-size: .78rem; max-height: 340px; overflow: auto; white-space: pre-wrap; word-break: break-word; color: var(--sapTextColor); }
.userpop { display: grid; gap: .6rem; padding: .75rem; min-width: 240px; }
.totals { display: grid; grid-template-columns: auto auto; gap: .25rem 1.5rem; justify-content: end; font-variant-numeric: tabular-nums; }
.totals .g { font-weight: bold; border-top: 1px solid var(--sapList_BorderColor); padding-top: .25rem; }
