/* ===========================================================================
 * STFWorks console — app shell (phase 1 of the modernization).
 * Sidebar, top bar, home dashboard, base typography.
 * Loaded LAST by index.html so it wins over stfwMain/stfwSidebar/css-pro-layout
 * without !important wherever possible. Approved design: mockup/index.html.
 * Behaviour: javascript/stfwShell.js.
 * ======================================================================== */
:root {
    --sh-brand: #1E5BFF;
    --sh-brand-strong: #1E5BFF;
    --sh-brand-deep: #0A1030;
    --sh-nav: #0A1030;
    --sh-nav-2: #060A1F;
    --sh-nav-ink: #C5CCE6;
    --sh-nav-muted: #7A84AD;
    --sh-ink: #0f1d2b;
    --sh-ink-2: #344454;
    --sh-muted: #5b6b7b;
    --sh-line: #e3e9ef;
    --sh-line-strong: #d5dde6;
    --sh-canvas: #f3f6f9;
    --sh-hover: #f6f9fc;
    --sh-info-bg: #EEF2FF;
    --sh-ok: #067647;  --sh-ok-bg: #ecfdf3;
    --sh-warn: #b54708; --sh-warn-bg: #fffaeb;
    --sh-err: #b42318;  --sh-err-bg: #fef3f2;
    --sh-ring: 0 0 0 4px rgba(30, 91, 255, .25);
    --sh-shadow-sm: 0 1px 2px rgba(16, 24, 40, .05);
    --sh-shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 12px 32px -8px rgba(16, 24, 40, .14);
    --sh-font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --sh-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

    /* Read by stfwMenu.js when it builds the menu: smaller, crisper icons. */
    --menu-title-text: CommandEdge;   /* read by loginsuccess for the pushbar title */
    --menu-image-height: 18;
    --menu-image-width: 18;
}

body { font-family: var(--sh-font); -webkit-font-smoothing: antialiased; }

/* ---------------------------------------------------------------- sidebar */
.layout .sidebar { width: 260px; min-width: 260px; }
.layout .sidebar .sidebar-layout {
    background: linear-gradient(180deg, var(--sh-nav), var(--sh-nav-2));
    color: var(--sh-nav-ink);
}
.layout .sidebar.has-bg-image .image-wrapper { display: none; }

.layout .sidebar .sidebar-layout .sidebar-header {
    height: 64px;
    min-height: 64px;
    padding: 0 20px;
    border-bottom: 1px solid rgba(255, 255, 255, .06);
}
/* Brand: CommandEdge mark (the "S" badge) + wordmark (the h5 text), reverse
   variants for the navy. Collapsed, pro-sidebar fades the h5 out -> mark only. */
.layout .sidebar .pro-sidebar-logo > div {
    width: 32px; min-width: 32px; height: 32px; min-height: 32px;
    margin-right: 10px;
    font-size: 0;
    background: url("../img/brand/commandedge-mark-reverse.svg") center / contain no-repeat;
    border-radius: 0;
}
.layout .sidebar .pro-sidebar-logo > h5 {
    margin: 0;
    width: 146px; height: 24px;
    font-size: 0;
    color: transparent;
    background: url("../img/brand/commandedge-wordmark-reverse.svg") left center / contain no-repeat;
}

.layout .sidebar .sidebar-layout .sidebar-content { padding: 10px 12px; }
.layout .sidebar .menu .menu-header {
    padding: 14px 10px 6px !important;     /* one header carries an inline padding-top */
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--sh-nav-muted);
}
.layout .sidebar .menu .menu-header span { color: var(--sh-nav-muted); }
#stfwmenunav li.menu-header:empty::before { content: "Operations"; }

.layout .sidebar .menu .menu-item a {
    height: 38px;
    margin: 1px 0;
    padding: 0 10px;
    border-radius: 8px;
    color: var(--sh-nav-ink);
    background: transparent !important;    /* menuFocus() used to paint inline hover colours */
    transition: background-color .12s, color .12s;
}
.layout .sidebar .menu .menu-item a:hover { background: rgba(255, 255, 255, .06) !important; color: #fff; }
.layout .sidebar .menu .menu-item a:focus-visible { outline: none; box-shadow: var(--sh-ring); }
.layout .sidebar .menu .menu-item a .menu-icon {
    width: 22px; min-width: 22px; height: 22px; line-height: 22px;
    margin-right: 12px;
    display: inline-flex; align-items: center; justify-content: center;
}
.layout .sidebar .menu .menu-item a .menu-icon svg,
.layout .sidebar .menu .menu-item a .menu-icon img { width: 18px; height: 18px; opacity: .85; }
.layout .sidebar .menu .menu-item a:hover .menu-icon svg { opacity: 1; }
.layout .sidebar .menu .menu-item a .menu-title { font-size: 14px; font-weight: 500; color: inherit; }
.layout .sidebar .menu .menu-item a:hover .menu-title { color: #fff; }
.layout .sidebar .menu .menu-item.sub-menu > a::after { width: 6px; height: 6px; border-width: 1.5px; opacity: .6; }
.layout .sidebar .menu .menu-item.sub-menu.open > a { color: #fff; }

/* expanded sub-menus: indented list with a guide line, no coloured slab */
.layout .sidebar .menu > ul > .sub-menu > .sub-menu-list,
.layout .sidebar.has-bg-image:not(.collapsed) .menu > ul > .sub-menu > .sub-menu-list {
    background: transparent;
    padding-left: 0;
}
.layout .sidebar:not(.collapsed) .menu .sub-menu-list > ul {
    margin: 2px 0 6px 21px !important;
    padding-left: 12px !important;
    border-left: 1px solid rgba(255, 255, 255, .1);
}
.layout .sidebar:not(.collapsed) .menu .sub-menu-list .menu-item a { height: 32px; }
.layout .sidebar:not(.collapsed) .menu .sub-menu-list .menu-item a .menu-title { font-size: 13.5px; color: #A9B2D6; }
.layout .sidebar:not(.collapsed) .menu .sub-menu-list .menu-item a .menu-icon { display: none; }

/* current page */
.layout .sidebar .menu .menu-item.sh-active > a {
    background: rgba(79, 139, 255, .20) !important;
    box-shadow: inset 3px 0 0 var(--sh-brand);
}
.layout .sidebar .menu .menu-item.sh-active > a .menu-title { color: #fff !important; font-weight: 600; }
.layout .sidebar .menu .menu-item.sh-active > a .menu-icon svg { opacity: 1; }

/* collapsed: flyouts on the same navy */
.layout .sidebar.collapsed .menu > ul > .menu-item.sub-menu > .sub-menu-list {
    background: var(--sh-nav) !important;
    border: 1px solid rgba(255, 255, 255, .08);
    border-radius: 10px;
    box-shadow: var(--sh-shadow);
    padding: 6px;
}

/* footer: a quiet line instead of the big "Powered by" box */
.layout .sidebar .sidebar-layout .sidebar-footer {
    height: auto; min-height: 0;
    padding: 12px 20px 16px;
    border-top: 1px solid rgba(255, 255, 255, .06);
}
.layout .sidebar .footer-box {
    flex-direction: row; gap: 10px;
    width: auto; min-width: 0;
    margin: 0; padding: 0;
    background: transparent;
    color: var(--sh-nav-muted);
    font-size: 11.5px;
    text-align: left;
}
.layout .sidebar .footer-box #stfworksfooterlogo { display: none; }   /* old server-side STFWorks image */
.layout .sidebar .footer-box span { margin: 0 !important; font-size: 11.5px !important; line-height: 1.35; }

.layout .sidebar .sidebar-collapser {
    left: 260px;
    top: 22px;
    width: 22px; height: 22px;
    background: var(--sh-surface);
    color: var(--sh-nav);
    border: 1px solid var(--sh-line-strong);
    box-shadow: var(--sh-shadow-sm);
}

/* ---------------------------------------------------------------- content */
.layout .content { background: var(--sh-page); min-height: 100vh; }
.layout .content.sh-canvas { background: var(--sh-canvas); }
#mainpage { min-height: 100vh; }
#hello { margin: 0 !important; padding: 20px 28px 32px; }

/* ---------------------------------------------------------------- top bar */
#stfwbanner.sh-topbar {
    position: sticky; top: 0; z-index: 20;
    height: 64px;
    background: var(--sh-topbar-bg);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--sh-line);
    font-family: var(--sh-font);
}
.sh-topbar-inner { display: flex; align-items: center; gap: 14px; height: 64px; padding: 0 28px; }
.sh-crumbs { display: flex; align-items: center; gap: 8px; min-width: 0; font-size: 13.5px; color: var(--sh-muted); white-space: nowrap; }
.sh-crumbs b { color: var(--sh-ink); font-weight: 600; overflow: hidden; text-overflow: ellipsis; }
.sh-crumbs svg { width: 14px; height: 14px; opacity: .5; flex: none; }
.sh-spacer { flex: 1; }

.sh-search { position: relative; width: 260px; }
.sh-search > svg { position: absolute; left: 10px; top: 9px; width: 18px; height: 18px; color: var(--sh-faint); pointer-events: none; }
.sh-search input {
    width: 100%; height: 36px;
    padding: 0 44px 0 36px;
    font: inherit; font-size: 13.5px; color: var(--sh-ink);
    background: var(--sh-surface);
    border: 1px solid var(--sh-line-strong);
    border-radius: 8px;
    outline: none;
}
.sh-search input:focus { border-color: var(--sh-brand); box-shadow: var(--sh-ring); }
.sh-search kbd {
    position: absolute; right: 8px; top: 8px;
    font: 11px var(--sh-font); color: var(--sh-muted);
    border: 1px solid var(--sh-line-strong); border-radius: 5px;
    padding: 1px 6px; background: var(--sh-canvas);
}
.sh-results {
    position: absolute; top: 42px; left: 0; right: 0; z-index: 30;
    max-height: 360px; overflow: auto;
    background: var(--sh-surface); border: 1px solid var(--sh-line); border-radius: 10px;
    box-shadow: var(--sh-shadow);
    padding: 6px;
}
.sh-results[hidden] { display: none; }
.sh-results button {
    display: flex; align-items: center; gap: 10px; width: 100%;
    padding: 8px 10px; border: 0; border-radius: 7px;
    background: transparent; text-align: left; cursor: pointer;
    font: inherit; font-size: 13.5px; color: var(--sh-ink);
}
.sh-results button small { margin-left: auto; color: var(--sh-muted); font-size: 12px; }
.sh-results button.on, .sh-results button:hover { background: var(--sh-info-bg); }
.sh-results .none { padding: 10px; color: var(--sh-muted); font-size: 13px; }

.sh-server {
    display: inline-flex; align-items: center; gap: 8px;
    height: 30px; padding: 0 12px;
    border-radius: 999px;
    background: var(--sh-info-bg);
    color: var(--sh-brand-deep);
    font-size: 12.5px; font-weight: 600;
    white-space: nowrap; max-width: 320px; overflow: hidden;
}
.sh-server > i { width: 8px; height: 8px; border-radius: 50%; background: #12b76a; box-shadow: 0 0 0 3px rgba(18, 183, 106, .2); flex: none; }
.sh-server #topbannertagtext { font-weight: 500; color: var(--sh-muted); }
.sh-server #topbannertagtext:not(:empty)::before { content: "·"; margin: 0 6px; color: var(--sh-muted); }

#bannerright0.sh-user {
    display: inline-flex; align-items: center; gap: 10px;
    height: 38px; padding: 4px 12px 4px 4px;
    border: 1px solid var(--sh-line); border-radius: 999px;
    background: var(--sh-surface);
    font-size: 13px; font-weight: 600; color: var(--sh-ink);
    cursor: pointer; white-space: nowrap;
    position: static; transform: none;
}
#bannerright0.sh-user:hover { background: var(--sh-hover); }
#bannerright0.sh-user::before {
    content: attr(data-initials);
    display: grid; place-items: center;
    width: 28px; height: 28px; border-radius: 50%;
    background: var(--sh-brand-strong); color: #fff;
    font-size: 11.5px; font-weight: 700; letter-spacing: .02em;
}

/* ---------------------------------------------------------------- home */
.sh-home { font-family: var(--sh-font); color: var(--sh-ink); font-size: 14px; line-height: 1.5; max-width: 1400px; }
.sh-home * { box-sizing: border-box; }
.sh-head { display: flex; align-items: flex-end; gap: 16px; margin: 8px 0 20px; }
.sh-head h1 { margin: 0; font-size: 24px; font-weight: 700; letter-spacing: -.01em; color: var(--sh-ink); }
.sh-head p { margin: 4px 0 0; color: var(--sh-muted); }
.sh-head .sh-actions { margin-left: auto; display: flex; gap: 8px; }

.sh-btn {
    display: inline-flex; align-items: center; gap: 8px;
    height: 36px; padding: 0 14px;
    border-radius: 8px; border: 1px solid var(--sh-line-strong);
    background: var(--sh-surface); color: var(--sh-ink-2);
    font: inherit; font-weight: 600; font-size: 13.5px;
    cursor: pointer; box-shadow: var(--sh-shadow-sm); white-space: nowrap;
}
.sh-btn:hover { background: var(--sh-hover); }
.sh-btn.primary { background: var(--sh-brand-strong); border-color: var(--sh-brand-strong); color: #fff; }
.sh-btn.primary:hover { background: #1748D6; }
.sh-btn svg { width: 16px; height: 16px; }

.sh-card { background: var(--sh-surface); border: 1px solid var(--sh-line); border-radius: 14px; box-shadow: var(--sh-shadow-sm); overflow: hidden; }
.sh-card-h { display: flex; align-items: center; padding: 16px 20px; border-bottom: 1px solid var(--sh-line); }
.sh-card-h h3 { margin: 0; font-size: 15px; font-weight: 650; color: var(--sh-ink); }
.sh-card-h a { margin-left: auto; color: var(--sh-brand-strong); font-weight: 600; font-size: 13px; cursor: pointer; }

.sh-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 20px; }
.sh-stat { padding: 18px 20px; cursor: pointer; transition: border-color .12s, box-shadow .12s; }
.sh-stat:hover { border-color: #C7D3F5; box-shadow: var(--sh-shadow); }
.sh-stat .k { display: flex; align-items: center; gap: 8px; color: var(--sh-muted); font-weight: 600; font-size: 13px; }
.sh-stat .k span { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 8px; background: var(--sh-info-bg); color: var(--sh-brand-strong); }
.sh-stat .k svg { width: 17px; height: 17px; }
.sh-stat .v { font-size: 30px; font-weight: 700; letter-spacing: -.02em; margin-top: 10px; color: var(--sh-ink); font-variant-numeric: tabular-nums; }
.sh-stat .d { font-size: 12.5px; color: var(--sh-muted); }
.sh-stat .d b { color: var(--sh-ok); }
.sh-stat .d b.bad { color: var(--sh-err); }

.sh-two { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 16px; }
.sh-side { display: grid; gap: 16px; align-content: start; }

table.sh-t { width: 100%; border-collapse: separate; border-spacing: 0; }
.sh-t th { text-align: left; font-size: 12px; font-weight: 600; color: var(--sh-muted); text-transform: uppercase; letter-spacing: .04em; padding: 10px 16px; background: var(--sh-surface-2); border-bottom: 1px solid var(--sh-line); white-space: nowrap; }
.sh-t td { padding: 0 16px; height: 46px; border-bottom: 1px solid var(--sh-line); font-size: 13.5px; color: var(--sh-ink); }
.sh-t tr:last-child td { border-bottom: 0; }
.sh-t tr:hover td { background: var(--sh-hover); }
.sh-t .name { font-weight: 600; }
.sh-t .sub { color: var(--sh-muted); font-size: 12.5px; }
.sh-t .mono { font-family: var(--sh-mono); font-size: 12.5px; color: var(--sh-muted); white-space: nowrap; }
.sh-t .num { font-variant-numeric: tabular-nums; white-space: nowrap; }
.sh-empty { padding: 28px 20px; text-align: center; color: var(--sh-muted); }

.sh-pill { display: inline-flex; align-items: center; gap: 6px; height: 22px; padding: 0 9px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; background: var(--sh-chip-bg); color: var(--sh-ink-2); }
.sh-pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .8; }
.sh-pill.ok { background: var(--sh-ok-bg); color: var(--sh-ok); }
.sh-pill.warn { background: var(--sh-warn-bg); color: var(--sh-warn); }
.sh-pill.err { background: var(--sh-err-bg); color: var(--sh-err); }
.sh-pill.run { background: var(--sh-info-bg); color: var(--sh-brand-strong); }

.sh-chart { display: flex; align-items: flex-end; gap: 6px; height: 140px; padding: 18px 20px 6px; }
.sh-chart .col { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; height: 100%; position: relative; }
.sh-chart .col i { display: block; border-radius: 4px 4px 0 0; min-height: 2px; background: linear-gradient(180deg, var(--sh-brand), #8FB2FF); }
.sh-chart .col i.f { background: linear-gradient(180deg, #f97066, #fecdca); }
.sh-chart .col i.z { background: var(--sh-line); }
.sh-chart-x { display: flex; gap: 6px; padding: 0 20px 4px; }
.sh-chart-x span { flex: 1; text-align: center; font-size: 10.5px; color: var(--sh-muted); }
.sh-legend { display: flex; gap: 16px; padding: 4px 20px 14px; color: var(--sh-muted); font-size: 12px; }
.sh-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }

.sh-quick { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding: 16px 20px; }
.sh-quick button {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 12px; border: 1px solid var(--sh-line); border-radius: 10px;
    background: var(--sh-surface); color: var(--sh-ink); cursor: pointer;
    font: inherit; font-weight: 600; font-size: 13.5px; text-align: left;
}
.sh-quick button:hover { border-color: var(--sh-brand); background: var(--sh-hover); }
.sh-quick button span { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 8px; background: var(--sh-info-bg); flex: none; }
.sh-quick button span svg { width: 16px; height: 16px; }

.sh-kv { display: grid; grid-template-columns: auto 1fr; gap: 10px 16px; padding: 16px 20px; margin: 0; font-size: 13.5px; }
.sh-kv dt { color: var(--sh-muted); }
.sh-kv dd { margin: 0; font-weight: 600; text-align: right; color: var(--sh-ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.sh-skel { display: inline-block; height: 12px; width: 60%; border-radius: 6px; background: linear-gradient(90deg, var(--sh-skel-1) 25%, var(--sh-skel-2) 50%, var(--sh-skel-1) 75%); background-size: 200% 100%; animation: sh-shimmer 1.2s infinite linear; }
@keyframes sh-shimmer { to { background-position: -200% 0; } }

@media (max-width: 1100px) {
    .sh-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .sh-two { grid-template-columns: 1fr; }
    .sh-search { display: none; }
}
@media (prefers-reduced-motion: reduce) { .sh-skel { animation: none; } }

/* quick links reuse the sidebar's own icons, which are drawn white for the navy */
.sh-quick button span svg path { fill: var(--sh-brand-strong); }
.sh-quick button span img { width: 16px; height: 16px; }
.sh-stat:focus-visible { outline: none; box-shadow: var(--sh-ring); }

/* ---- fixes after first real-data pass ---- */
.sh-topbar-inner { padding-left: 44px; }                    /* clear the sidebar collapse button */
.sh-home .sh-card-h a, .sh-home .sh-card-h a:visited { color: var(--sh-brand-strong); }
.sh-home .sh-card-h a:hover { text-decoration: underline; }

/* collapsed sidebar: icons only */
.layout .sidebar.collapsed .menu .menu-item a { justify-content: center; padding: 0; }
.layout .sidebar.collapsed .menu .menu-item a .menu-icon { margin-right: 0; }
.layout .sidebar.collapsed #stfwmenunav > ul > li > a .menu-title,
.layout .sidebar.collapsed #stfwmenunav > li > a .menu-title,
.layout .sidebar.collapsed #stfwmenunav > ul > li > a .menu-suffix,
.layout .sidebar.collapsed #stfwmenunav > li > a .menu-suffix { display: none; }
.layout .sidebar.collapsed .menu > ul > .menu-item.sub-menu > a::after { display: none; }
.layout .sidebar.collapsed .menu .menu-header {
    font-size: 0 !important; height: 1px; padding: 0 !important; margin: 10px 14px;
    background: rgba(255, 255, 255, .1); opacity: 1;
}
.layout .sidebar.collapsed #stfwmenunav li.menu-header:empty::before { content: none; }
.layout .sidebar.collapsed .sidebar-footer .footer-box span { display: none; }
.layout .sidebar.collapsed .sidebar-footer { justify-content: center; padding: 12px 0; }

/* ===========================================================================
 * Light / dark theme. <html data-theme="light|dark"> is set by stfwShell.js
 * before first paint (stored choice, else the OS preference).
 * ======================================================================== */
:root {
    --sh-page: #ffffff;           /* behind legacy pages */
    --sh-surface: #ffffff;        /* cards, inputs, menus */
    --sh-surface-2: #f9fafb;      /* table headers */
    --sh-topbar-bg: rgba(255, 255, 255, .92);
    --sh-faint: #98a2b3;
    --sh-chip-bg: #f2f4f7;
    --sh-skel-1: #eef1f4;
    --sh-skel-2: #f6f8fa;
    --sh-link: var(--sh-brand-strong);
}
html[data-theme="dark"] {
    --sh-page: #0B1026;
    --sh-canvas: #070B1D;
    --sh-surface: #0F1530;
    --sh-surface-2: #131A3A;
    --sh-topbar-bg: rgba(10, 16, 48, .86);
    --sh-ink: #E7EAF6;
    --sh-ink-2: #C3C9E3;
    --sh-muted: #8F98BF;
    --sh-faint: #6E77A0;
    --sh-line: #222A4D;
    --sh-line-strong: #2C355C;
    --sh-hover: #161E42;
    --sh-info-bg: rgba(79, 139, 255, .16);
    --sh-chip-bg: #1A2247;
    --sh-skel-1: #161D3D;
    --sh-skel-2: #1D2550;
    --sh-ok: #47CD89;  --sh-ok-bg: rgba(18, 183, 106, .14);
    --sh-warn: #FDB022; --sh-warn-bg: rgba(247, 144, 9, .14);
    --sh-err: #F97066;  --sh-err-bg: rgba(240, 68, 56, .16);
    --sh-link: #8FB2FF;
    --sh-shadow-sm: 0 1px 2px rgba(0, 0, 0, .3);
    --sh-shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 12px 32px -8px rgba(0, 0, 0, .55);
    --sh-ring: 0 0 0 4px rgba(79, 139, 255, .35);
}
html[data-theme="dark"] body { background: var(--sh-page); }
html[data-theme="dark"] .sh-topbar,
html[data-theme="dark"] .sh-home { color-scheme: dark; }

/* links and icon tints that use the brand blue need a lighter blue on navy */
.sh-home .sh-card-h a, .sh-home .sh-card-h a:visited { color: var(--sh-link); }
html[data-theme="dark"] .sh-stat .k span,
html[data-theme="dark"] .sh-quick button span { color: var(--sh-link); }
html[data-theme="dark"] .sh-quick button span svg path { fill: var(--sh-link); }
html[data-theme="dark"] .sh-quick button:hover,
html[data-theme="dark"] .sh-stat:hover { border-color: #3A4A8A; }
html[data-theme="dark"] .sh-server { color: var(--sh-ink-2); }
html[data-theme="dark"] .layout .sidebar .sidebar-collapser { color: var(--sh-ink); }

/* Legacy pages (tiles, grids, Executions...) paint light colours inline. Until
   they are restyled (phase 3) they sit on a light panel inside the dark frame. */
html[data-theme="dark"] .layout main.content:not(.sh-canvas) #hello:not(.ob-page) {
    margin: 16px 20px 24px !important;
    background: #ffffff;
    color: #222;
    border-radius: 14px;
    box-shadow: 0 0 0 1px rgba(255, 255, 255, .04), 0 12px 32px -8px rgba(0, 0, 0, .6);
    min-height: calc(100vh - 64px - 40px);
}

/* ---- the toggle button (top bar, after the page search) ---- */
.sh-iconbtn {
    display: inline-grid; place-items: center;
    width: 36px; height: 36px; flex: none;
    border: 1px solid var(--sh-line-strong); border-radius: 8px;
    background: var(--sh-surface); color: var(--sh-ink-2);
    cursor: pointer;
    transition: background-color .12s, color .12s;
}
.sh-iconbtn:hover { background: var(--sh-hover); color: var(--sh-ink); }
.sh-iconbtn:focus-visible { outline: none; box-shadow: var(--sh-ring); }
.sh-iconbtn svg { width: 18px; height: 18px; }
#shtheme .sun { display: none; }
html[data-theme="dark"] #shtheme .sun { display: block; }
html[data-theme="dark"] #shtheme .moon { display: none; }
@media (max-width: 1100px) { .sh-iconbtn { display: inline-grid; } }

/* Home: recent executions open the run (like the Executions page) */
.sh-t tr.sh-run { cursor: pointer; }
.sh-t tr.sh-run:focus-visible { outline: none; }
.sh-t tr.sh-run:focus-visible td { background: var(--sh-hover); box-shadow: inset 0 2px 0 var(--sh-brand), inset 0 -2px 0 var(--sh-brand); }
.sh-t tr.sh-run td.name { transition: color .12s; }
.sh-t tr.sh-run:hover td.name { color: var(--sh-brand); }


/* Sidebar footer: InfinitesEdge icon + wordmark above the CommandEdge line. The
   wordmark is the "reverse" copy (white "Infinites") - the color one's navy text
   is the sidebar's own background colour. Collapsed: the icon only. */
.layout .sidebar .footer-box { flex-direction: column; align-items: flex-start; gap: 6px; }
.layout .sidebar .footer-box > div[style] { padding: 0 !important; }
.ce-footer-brand { display: flex; align-items: center; gap: 7px; }
.ce-footer-icon { width: 22px; height: 22px; flex: none; }
.ce-footer-wordmark { height: 14px; width: auto; }
.layout .sidebar.collapsed .ce-footer-wordmark { display: none; }
.layout .sidebar.collapsed .footer-box { align-items: center; }
.layout .sidebar.collapsed .footer-box .ce-footer-property { display: none; }

/* ---- notification bell (stfwSms.js) ---- */
.sh-bellwrap { position: relative; display: inline-flex; }
#shbell[hidden] { display: none; }
#shbell { position: relative; }
.sh-bell-badge { position: absolute; top: -6px; right: -6px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: #d92d20; color: #fff;
    font: 700 11px/18px -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; text-align: center; box-shadow: 0 0 0 2px var(--sh-surface); }
.sh-bell-badge[hidden] { display: none; }
#shbell.sh-bell-on { color: var(--sh-ink); }
.sh-bellpop { position: absolute; top: 44px; right: 0; z-index: 1000; width: 320px; padding: 8px; border-radius: 12px; background: var(--sh-surface);
    border: 1px solid var(--sh-line-strong); box-shadow: 0 16px 36px rgba(16,24,40,.18), 0 3px 8px rgba(16,24,40,.08); color: var(--sh-ink); }
.sh-bellpop[hidden] { display: none; }
.sh-bell-h { padding: 6px 8px 8px; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--sh-ink-2); }
.sh-bell-none { padding: 14px 8px; font-size: 13.5px; color: var(--sh-ink-2); text-align: center; }
.sh-bell-item { display: flex; gap: 10px; width: 100%; padding: 10px 8px; border: 0; border-radius: 8px; background: none; text-align: left; cursor: pointer; color: inherit; font: inherit; }
.sh-bell-item:hover { background: var(--sh-hover); }
.sh-bell-item b { display: block; font-size: 14px; }
.sh-bell-item small { display: block; margin-top: 2px; font-size: 12.5px; color: var(--sh-ink-2); line-height: 1.4; }
.sh-bell-dot { width: 9px; height: 9px; margin-top: 5px; flex: none; border-radius: 50%; background: #d92d20; }

/* ---------------------------------------------------------------------------
 * About dialog (aboutFunction): brand badge, product + version, then a
 * two-column details list whose values never wrap (long ones ellipsize, with
 * the full value in the tooltip).
 */
.ce-about { box-sizing: border-box; width: 100%; padding: 1em 1.25em 0; text-align: left; }
.ce-about-head { display: flex; align-items: center; gap: 1.1em; padding-bottom: 1.1em; border-bottom: 1px solid var(--ob-line, rgba(127,127,127,.25)); }
.ce-about-mark { flex: 0 0 64px; width: 64px; height: 64px; border-radius: 14px; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.ce-about-mark:not(.ok) { background: var(--ob-hover, rgba(127,127,127,.12)); }
.ce-about-mark img { width: 100%; height: 100%; object-fit: contain; }
.ce-about-id { min-width: 0; }
.ce-about-product { font-size: 1.6em; font-weight: 600; line-height: 1.15; color: var(--menu-menu-entry-color); }
.ce-about-version { margin-top: .2em; font-size: .95em; color: var(--ob-muted, #888); font-variant-numeric: tabular-nums; }
.ce-about-desc { margin-top: .35em; font-size: .9em; color: var(--ob-muted, #888); }
.ce-about-list { display: grid; grid-template-columns: max-content minmax(0, 1fr); column-gap: 1.5em; row-gap: 0; margin: .9em 0 0; }
.ce-about-list dt, .ce-about-list dd { margin: 0; padding: 0 0; height: 2.4em; line-height: 2.4em; font-size: 14px; border-bottom: 1px solid var(--ob-line, rgba(127,127,127,.15)); white-space: nowrap; }
.ce-about-list dt { color: var(--ob-muted, #888); }
.ce-about-list dd { overflow: hidden; text-overflow: ellipsis; user-select: text; }
.ce-about-list dd.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 13px; }
.ce-about-list dt:nth-last-of-type(1), .ce-about-list dd:last-child { border-bottom: none; }
