/* Simulated Fiori-style application screens.
   Deliberately light-only: it imitates the look of a business app screen,
   so it keeps one fixed palette regardless of the site's theme. */

.s-app {
  --s-bg: #f5f6f7;
  --s-surface: #ffffff;
  --s-text: #1d2d3e;
  --s-muted: #556b82;
  --s-line: #d9dfe6;
  --s-brand: #0064d9;
  --s-brand-ink: #ffffff;
  --s-hover: #eaecee;
  --s-ok: #256f3a;
  --s-ok-bg: #f5fae5;
  --s-warn: #b44f00;
  --s-warn-bg: #fff8d6;
  --s-hot: #e09a0c;
  color-scheme: light;
  position: relative;
  min-height: 100%;
  display: flex;
  flex-direction: column;
  background: var(--s-bg);
  color: var(--s-text);
  font-family: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 14px;
  line-height: 1.4;
}
.s-app *, .s-app *::before, .s-app *::after { box-sizing: border-box; }
.s-ico { width: 18px; height: 18px; flex: none; }

/* Shell bar */
.s-shell { display: flex; align-items: center; gap: 12px; height: 46px; padding: 0 14px; background: var(--s-surface); border-bottom: 1px solid var(--s-line); flex: none; }
.s-shell-logo { width: 28px; height: 20px; border-radius: 4px; background: linear-gradient(135deg, #1b6fe0, #0a3d91); flex: none; }
.s-shell-title { font-weight: 600; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.s-shell-search { margin-left: auto; display: flex; align-items: center; gap: 8px; color: var(--s-muted); border: 1px solid var(--s-line); background: #f7f8f9; border-radius: 18px; padding: 5px 12px; font-size: 13px; min-width: 0; }
.s-shell-avatar { width: 30px; height: 30px; border-radius: 50%; background: #5d36ff; color: #fff; display: grid; place-items: center; font-size: 12px; font-weight: 700; flex: none; }
@media (max-width: 520px) { .s-shell-search span { display: none; } }

/* Launchpad */
.s-lp { padding: 0 22px 28px; }
.s-lp-tabs { display: flex; gap: 22px; border-bottom: 1px solid var(--s-line); margin: 0 -22px; padding: 0 22px; background: var(--s-surface); overflow-x: auto; }
.s-lp-tabs span { padding: 12px 0 10px; color: var(--s-muted); font-weight: 500; white-space: nowrap; border-bottom: 3px solid transparent; }
.s-lp-tabs .is-active { color: var(--s-brand); border-bottom-color: var(--s-brand); }
.s-lp-greet { font-size: 20px; font-weight: 600; margin: 22px 0 4px; }
.s-lp-group { font-size: 15px; font-weight: 600; margin: 20px 0 10px; }
.s-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 176px)); gap: 12px; }
.s-tile { all: unset; box-sizing: border-box; cursor: pointer; aspect-ratio: 1 / 1; max-width: 100%; background: var(--s-surface); border-radius: 14px; padding: 14px; display: flex; flex-direction: column; gap: 4px; box-shadow: 0 0 2px rgb(34 53 72 / .16), 0 2px 4px rgb(34 53 72 / .1); }
.s-tile:hover { box-shadow: 0 0 2px rgb(34 53 72 / .2), 0 6px 14px rgb(34 53 72 / .16); }
.s-tile:focus-visible { outline: 2px solid var(--s-brand); outline-offset: 2px; }
.s-tile-title { font-weight: 600; font-size: 14px; line-height: 1.25; }
.s-tile-sub { color: var(--s-muted); font-size: 12px; }
.s-tile-foot { margin-top: auto; display: flex; align-items: end; justify-content: space-between; gap: 6px; color: var(--s-muted); }
.s-tile-foot .s-ico { width: 26px; height: 26px; color: var(--s-brand); }
.s-kpi { font-size: 30px; font-weight: 300; color: var(--s-text); line-height: 1; }
.s-kpi small { font-size: 12px; color: var(--s-muted); margin-left: 3px; font-weight: 400; }
.s-kpi.is-warn { color: var(--s-warn); }

/* Dynamic page */
.s-page { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.s-page-head { background: var(--s-surface); padding: 12px 22px 0; border-bottom: 1px solid var(--s-line); }
.s-crumbs { color: var(--s-brand); font-size: 12px; margin-bottom: 4px; }
.s-page-title { font-size: 20px; font-weight: 600; margin: 0; line-height: 1.25; }
.s-page-sub { color: var(--s-muted); font-size: 13px; margin-top: 2px; }
.s-head-row { display: flex; justify-content: space-between; align-items: start; gap: 12px; flex-wrap: wrap; }
.s-head-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.s-facets { display: flex; gap: 32px; flex-wrap: wrap; padding: 12px 0 14px; }
.s-facet span { display: block; color: var(--s-muted); font-size: 12px; }
.s-facet strong { font-size: 15px; font-weight: 600; font-variant-numeric: tabular-nums; }
.s-facet .is-ok { color: var(--s-ok); }
.s-facet .is-warn { color: var(--s-warn); }
.s-tabs { display: flex; gap: 22px; overflow-x: auto; margin-top: 4px; }
.s-tab { all: unset; cursor: pointer; padding: 10px 0 9px; border-bottom: 3px solid transparent; color: var(--s-text); white-space: nowrap; font-weight: 500; }
.s-tab.is-active { color: var(--s-brand); border-bottom-color: var(--s-brand); }
.s-tab:focus-visible { outline: 2px solid var(--s-brand); }
.s-page-body { padding: 16px 22px 24px; display: grid; gap: 16px; align-content: start; flex: 1; }
.s-footer { position: sticky; bottom: 0; display: flex; justify-content: flex-end; gap: 8px; padding: 9px 16px; background: var(--s-surface); border-top: 1px solid var(--s-line); box-shadow: 0 -2px 6px rgb(34 53 72 / .06); z-index: 5; }

.s-section { background: var(--s-surface); border-radius: 12px; padding: 16px 18px 18px; box-shadow: 0 0 2px rgb(34 53 72 / .12), 0 1px 3px rgb(34 53 72 / .08); min-width: 0; }
.s-section-title { font-size: 15px; font-weight: 600; margin: 0 0 14px; }

/* Forms */
.s-form { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 14px 22px; }
.s-field { display: grid; gap: 4px; min-width: 0; }
.s-field.is-wide { grid-column: 1 / -1; }
.s-field label { font-size: 13px; color: var(--s-muted); }
.s-req { color: #aa0808; margin-left: 2px; }
.s-input-wrap { display: flex; align-items: stretch; border: 1px solid #8396a8; border-radius: 6px; background: #fff; overflow: hidden; min-height: 34px; }
.s-input-wrap:focus-within { border-color: var(--s-brand); box-shadow: 0 0 0 1px var(--s-brand); }
.s-input, .s-select { all: unset; box-sizing: border-box; flex: 1; min-width: 0; padding: 6px 10px; font-size: 14px; color: var(--s-text); width: 100%; }
.s-input[readonly] { color: var(--s-text); }
.s-input-wrap.is-ro { border-color: transparent; background: transparent; }
.s-input-wrap.is-ro .s-input { padding-left: 0; }
.s-select { appearance: none; background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%23556b82' stroke-width='1.6'/%3E%3C/svg%3E") no-repeat right 10px center; padding-right: 30px; cursor: pointer; }
.s-select:disabled { cursor: default; }
.s-vh { all: unset; cursor: pointer; display: grid; place-items: center; width: 34px; color: var(--s-brand); border-left: 1px solid var(--s-line); }
.s-vh:hover { background: var(--s-hover); }
.s-note { font-size: 12px; color: var(--s-muted); }
.s-note b { color: var(--s-text); font-weight: 600; }

/* Buttons */
.s-btn { all: unset; box-sizing: border-box; cursor: pointer; padding: 7px 14px; border-radius: 8px; font-size: 14px; font-weight: 600; white-space: nowrap; border: 1px solid transparent; }
.s-btn--emph { background: var(--s-brand); color: var(--s-brand-ink); }
.s-btn--emph:hover { background: #0057bf; }
.s-btn--ghost { color: var(--s-brand); border-color: #bcc3ca; background: #fff; }
.s-btn--ghost:hover { background: var(--s-hover); }
.s-btn--trans { color: var(--s-brand); }
.s-btn--trans:hover { background: var(--s-hover); }
.s-btn:focus-visible { outline: 2px solid var(--s-brand); outline-offset: 2px; }

/* Tables */
.s-table-wrap { overflow-x: auto; margin: 0 -4px; }
.s-table { width: 100%; border-collapse: collapse; font-size: 13.5px; font-variant-numeric: tabular-nums; }
.s-table th { text-align: left; font-weight: 600; color: var(--s-muted); font-size: 12.5px; padding: 8px 10px; border-bottom: 1px solid var(--s-line); white-space: nowrap; background: #f7f8f9; }
.s-table td { padding: 8px 10px; border-bottom: 1px solid #eceff2; vertical-align: middle; white-space: nowrap; }
.s-table .num { text-align: right; }
.s-table tr.is-click { cursor: pointer; }
.s-table tr.is-click:hover td { background: #f1f6fd; }
.s-table tr.is-click:focus-visible { outline: 2px solid var(--s-brand); outline-offset: -2px; }
.s-table tr.is-total td { font-weight: 600; border-top: 2px solid var(--s-line); }
.s-table .s-cell-input { border: 1px solid #8396a8; border-radius: 6px; background: #fff; display: flex; min-width: 96px; }
.s-table .s-cell-input .s-input { padding: 4px 8px; font-size: 13.5px; }
.s-muted { color: var(--s-muted); }
.s-link { color: var(--s-brand); }

/* Status text */
.s-status { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; font-size: 13px; }
.s-status::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.s-status.is-ok { color: var(--s-ok); }
.s-status.is-warn { color: var(--s-warn); }
.s-status.is-none { color: var(--s-muted); }

/* Message strip */
.s-strip { display: flex; gap: 10px; align-items: start; padding: 10px 14px; border-radius: 8px; border: 1px solid; font-size: 14px; }
.s-strip.is-ok { background: var(--s-ok-bg); border-color: #b5d99b; color: var(--s-ok); }
.s-strip.is-info { background: #f1f6fd; border-color: #b4cdf0; color: #0a4fa8; }
.s-strip.is-warn { background: var(--s-warn-bg); border-color: #f2c66b; color: var(--s-warn); }
.s-strip .s-ico { margin-top: 1px; }

/* Dialog */
.s-overlay { position: absolute; inset: 0; background: rgb(29 45 62 / .45); display: grid; place-items: center; padding: 18px; z-index: 20; }
.s-dialog { background: var(--s-surface); border-radius: 14px; width: min(640px, 100%); max-height: 100%; display: flex; flex-direction: column; box-shadow: 0 16px 40px rgb(0 0 0 / .28); overflow: hidden; }
.s-dialog-head { padding: 14px 18px; font-weight: 600; font-size: 16px; border-bottom: 1px solid var(--s-line); }
.s-dialog-body { padding: 14px 18px; overflow: auto; display: grid; gap: 12px; }
.s-dialog-foot { padding: 10px 14px; border-top: 1px solid var(--s-line); display: flex; justify-content: flex-end; gap: 8px; }
.s-search-field { display: flex; align-items: center; gap: 8px; border: 1px solid #8396a8; border-radius: 6px; padding: 6px 10px; color: var(--s-muted); }

/* Option cards (choices in dialogs) */
.s-options { display: grid; gap: 10px; }
.s-option { all: unset; box-sizing: border-box; cursor: pointer; border: 1px solid var(--s-line); border-radius: 10px; padding: 12px 14px; display: grid; gap: 3px; }
.s-option:hover { border-color: var(--s-brand); background: #f7fafe; }
.s-option:focus-visible { outline: 2px solid var(--s-brand); }
.s-option b { font-size: 14px; }
.s-option span { color: var(--s-muted); font-size: 13px; }

/* Document flow */
.s-flow { display: grid; gap: 0; list-style: none; margin: 0; padding: 0; }
.s-flow li { display: grid; grid-template-columns: 34px minmax(0, 1fr); gap: 12px; position: relative; padding-bottom: 14px; }
.s-flow li:not(:last-child)::before { content: ""; position: absolute; left: 16px; top: 34px; bottom: 0; border-left: 2px solid var(--s-line); }
.s-flow-dot { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: #eef1f4; color: var(--s-muted); }
.s-flow .is-done .s-flow-dot { background: var(--s-ok-bg); color: var(--s-ok); }
.s-flow-card { all: unset; box-sizing: border-box; display: grid; gap: 2px; padding: 9px 12px; border-radius: 10px; border: 1px solid var(--s-line); background: #fff; }
button.s-flow-card { cursor: pointer; }
button.s-flow-card:hover { border-color: var(--s-brand); }
.s-flow-card b { font-size: 14px; }
.s-flow-card span { font-size: 12.5px; color: var(--s-muted); }

/* Guided hotspot, applied by the player */
.ff-hot { position: relative; z-index: 2; outline: 3px solid var(--s-hot, #e09a0c) !important; outline-offset: 3px; border-radius: 8px; animation: ff-pulse 1.6s ease-out infinite; }
tr.ff-hot { outline-offset: -3px; }
@keyframes ff-pulse {
  0% { box-shadow: 0 0 0 0 rgb(224 154 12 / .55); }
  70% { box-shadow: 0 0 0 12px rgb(224 154 12 / 0); }
  100% { box-shadow: 0 0 0 0 rgb(224 154 12 / 0); }
}
.ff-shake { animation: ff-shake .35s; }
@keyframes ff-shake { 25% { transform: translateX(-4px); } 75% { transform: translateX(4px); } }
