/* ILUX menu system: top bar, sidebar, phone drawer, Go-to box, Home page.  Look = the live app (Bootstrap 5.3 light theme, blue accent, 12px cards, dark-mode switch). */
:root {
    --nav-bg: #ffffff; --nav-line: #e5e7eb; --nav-ink: #1f2937; --nav-sub: #475569; --nav-muted: #6b7280; --nav-faint: #9aa3b2;
    --nav-tint: #e8f0fe; --nav-active: #0b4fc4; --nav-star: #f5a623; --nav-hover: #f1f5f9; --nav-field: #f3f5f9; --app-bg: #f5f7fa;
    --acc-violet: #6f42c1; --acc-blue: #0d6efd; --acc-green: #198754; --acc-orange: #e8590c; --acc-red: #dc3545; --acc-teal: #0b8fa6; --acc-gray: #6b7280;
    --acc-violet-t: #efe9fb; --acc-blue-t: #e3eeff; --acc-green-t: #e0f4ea; --acc-orange-t: #feeadb; --acc-red-t: #fde6e8; --acc-teal-t: #dcf3f7; --acc-gray-t: #eceff3;
    --nav-w: 252px; --nav-w-rail: 64px; --topbar-h: 56px;
}
body.dark-mode {
    --nav-bg: #2d3748; --nav-line: #4b5563; --nav-ink: #e9ecef; --nav-sub: #cbd5e1; --nav-muted: #a0aec0; --nav-faint: #8d99ae;
    --nav-tint: #34476b; --nav-active: #9cc2ff; --nav-hover: #3b475a; --nav-field: #374151; --app-bg: #1a1a1a;
    --acc-violet-t: #3b2f5a; --acc-blue-t: #243a63; --acc-green-t: #1f4435; --acc-orange-t: #55321c; --acc-red-t: #55262b; --acc-teal-t: #1c4650; --acc-gray-t: #3b4351;
}

/* ---- accents ---- */
.acc-violet { color: var(--acc-violet); } .acc-blue { color: var(--acc-blue); } .acc-green { color: var(--acc-green); }
.acc-orange { color: var(--acc-orange); } .acc-red { color: var(--acc-red); } .acc-teal { color: var(--acc-teal); } .acc-gray { color: var(--acc-gray); }
.acc-bg-violet { background: var(--acc-violet); } .acc-bg-blue { background: var(--acc-blue); } .acc-bg-green { background: var(--acc-green); }
.acc-bg-orange { background: var(--acc-orange); } .acc-bg-red { background: var(--acc-red); } .acc-bg-teal { background: var(--acc-teal); } .acc-bg-gray { background: var(--acc-gray); }
.acc-tint-violet { background: var(--acc-violet-t); color: var(--acc-violet); } .acc-tint-blue { background: var(--acc-blue-t); color: var(--acc-blue); }
.acc-tint-green { background: var(--acc-green-t); color: var(--acc-green); } .acc-tint-orange { background: var(--acc-orange-t); color: var(--acc-orange); }
.acc-tint-red { background: var(--acc-red-t); color: var(--acc-red); } .acc-tint-teal { background: var(--acc-teal-t); color: var(--acc-teal); }
.acc-tint-gray { background: var(--acc-gray-t); color: var(--acc-gray); }

kbd { font-family: inherit; font-size: 11.5px; background: var(--nav-bg); color: var(--nav-sub); border: 1px solid #d3d9e4; border-bottom-width: 2px; border-radius: 6px; padding: 2px 7px; }
body.dark-mode kbd { border-color: #4b5563; }

/* ---- top bar ---- */
.app-topbar {
    position: relative; z-index: 1020; min-height: var(--topbar-h); display: flex; align-items: center; gap: 12px; padding: 8px 16px;
    background: var(--nav-bg); border-bottom: 1px solid var(--nav-line); box-shadow: 0 2px 4px rgba(0, 0, 0, .06);
}
.nav-burger, .nav-icon-btn {
    width: 36px; height: 36px; border: 0; border-radius: 8px; background: transparent; color: var(--nav-sub); font-size: 17px;
    display: inline-flex; align-items: center; justify-content: center; flex: 0 0 36px; padding: 0;
}
.nav-icon-btn { font-size: 15px; }
.nav-burger:hover, .nav-icon-btn:hover { background: var(--nav-hover); }
body.dark-mode .nav-icon-btn { color: #f6c453; }
.app-brand { display: inline-flex; align-items: center; gap: 9px; font-weight: 700; font-size: 21px; letter-spacing: .2px; color: #0056b3; text-decoration: none; white-space: nowrap; }
body.dark-mode .app-brand { color: #9cc2ff; }
.app-brand:hover { color: #0056b3; }
.app-logo { width: 30px; height: 30px; border-radius: 8px; background: linear-gradient(135deg, #007bff, #0056b3); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-size: 15px; }

.go-box {
    flex: 0 1 540px; min-width: 0; height: 38px; margin-left: 10px; padding: 0 8px 0 15px; display: flex; align-items: center; gap: 10px;
    border: 1px solid var(--nav-line); border-radius: 19px; background: var(--nav-field); color: var(--nav-muted); font-size: 14px; text-align: left; cursor: text;
}
.go-box:hover { border-color: #b8c4d8; }
.go-ph { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.go-ph-s { display: none; flex: 1; white-space: nowrap; }
.go-keys { display: inline-flex; gap: 4px; }

.app-user { display: flex; align-items: center; gap: 9px; position: relative; }
.app-avatar-btn { border: 0; background: transparent; padding: 0; }
.app-avatar { width: 32px; height: 32px; border-radius: 50%; background: #dbe7ff; color: #1b4fb3; font-weight: 700; font-size: 13px; display: inline-flex; align-items: center; justify-content: center; flex: 0 0 32px; }
body.dark-mode .app-avatar { background: #34476b; color: #cfe0ff; }
.app-user-text { display: flex; flex-direction: column; line-height: 1.2; }
.app-user-name { border: 0; background: transparent; padding: 0; font-size: 14px; font-weight: 600; color: var(--nav-ink); text-align: left; }
.app-user-name.dropdown-toggle::after { margin-left: .45em; vertical-align: .15em; }
.app-loc { font-size: 12px; color: var(--nav-muted); display: inline-flex; align-items: center; gap: 5px; margin-top: 1px; text-decoration: none; white-space: nowrap; }
.app-loc i { font-size: 10.5px; color: #8a94a6; }
.app-loc:hover { color: var(--acc-blue); text-decoration: underline; }
.loc-abbr { display: none; }
.nav-version { font-size: 12.5px; color: var(--nav-muted); }          /* "ILUX version 3.0" in the user menu (Infrastructure/AppInfo.cs) */

/* ---- shell: sidebar column + page ---- */
.app-shell { display: flex; align-items: stretch; min-height: calc(100vh - var(--topbar-h)); background: var(--app-bg); }
.app-side-col { flex: 0 0 var(--nav-w); width: var(--nav-w); background: var(--nav-bg); border-right: 1px solid var(--nav-line); }
.app-sidebar { position: sticky; top: 0; max-height: calc(100vh - var(--topbar-h)); overflow-x: hidden; overflow-y: auto; padding: 10px 10px 18px; }
.app-main { flex: 1 1 auto; min-width: 0; background: var(--app-bg); }
body:not(.has-nav) .app-shell { display: block; background: transparent; }
body:not(.has-nav) .app-main { background: transparent; }

/* ---- the list (sidebar and drawer) ---- */
.nav-row {
    display: flex; align-items: center; gap: 10px; height: 34px; padding: 0 10px; border-radius: 8px; color: var(--nav-sub);
    font-size: 14px; text-decoration: none; white-space: nowrap;
}
.nav-row:hover { background: var(--nav-hover); color: var(--nav-ink); }
.nav-row.active { background: var(--nav-tint); color: var(--nav-active); font-weight: 600; box-shadow: inset 3px 0 0 var(--acc-blue); }
.nav-ic { width: 18px; text-align: center; font-size: 15px; flex: 0 0 18px; }
.nav-text { flex: 1; overflow: hidden; text-overflow: ellipsis; }
.nav-lab { display: flex; align-items: center; gap: 6px; margin: 14px 10px 5px; font-size: 10.5px; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; color: var(--nav-faint); }
.nav-lab i { color: var(--nav-star); font-size: 11px; }
.nav-favs:empty::after { content: "Star a page below to pin it here."; display: block; margin: 2px 10px 4px; font-size: 12px; color: var(--nav-faint); }
.nav-grp {
    display: flex; align-items: center; gap: 10px; width: 100%; height: 36px; padding: 0 10px; margin-top: 1px; border: 0; border-radius: 8px;
    background: transparent; color: var(--nav-ink); font-size: 14px; font-weight: 600; text-align: left;
}
.nav-grp:hover { background: var(--nav-hover); }
.nav-chev { width: 14px; flex: 0 0 14px; font-size: 11px; color: #8a94a6; transition: transform .12s ease; }
.nav-group.is-open > .nav-grp .nav-chev { transform: rotate(90deg); }
.nav-dot { width: 9px; height: 9px; border-radius: 3px; flex: 0 0 9px; }
.nav-kids { display: none; }
.nav-group.is-open > .nav-kids { display: block; }
.nav-row-wrap { position: relative; display: block; }
.nav-row.nav-kid { height: 31px; padding-left: 34px; padding-right: 36px; font-size: 13.5px; }
.nav-row.nav-kid .nav-ic { font-size: 13px; }
.nav-row-wrap .nav-star { position: absolute; right: 6px; top: 50%; margin-top: -13px; }
.nav-star {
    width: 26px; height: 26px; padding: 0; border: 0; border-radius: 6px; background: transparent; color: #cbd2de; font-size: 13px;
    display: inline-flex; align-items: center; justify-content: center; flex: 0 0 26px;
}
.nav-star:hover, .nav-star:focus-visible { color: var(--nav-star); background: var(--nav-hover); }
.nav-star.on { color: var(--nav-star); }
.nav-star.busy { opacity: .5; pointer-events: none; }
.nav-note { margin: 12px 8px; padding: 8px 10px; border-radius: 8px; font-size: 12px; color: #8a5a00; background: #fff4d6; }

/* ---- phone drawer ---- */
.nav-drawer { --bs-offcanvas-width: 292px; background: var(--nav-bg); color: var(--nav-ink); }
.nav-drawer .offcanvas-header { border-bottom: 1px solid var(--nav-line); padding: 10px 14px; }
.nav-drawer .offcanvas-body { padding: 8px 8px 12px; }
body.dark-mode .nav-drawer .btn-close { filter: invert(1); }
.nav-drawer-foot { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-top: 1px solid var(--nav-line); font-size: 13px; }
.nav-drawer-who { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
.nav-drawer-who a { color: var(--nav-muted); font-size: 12px; text-decoration: none; }
.nav-drawer-who a i { font-size: 10.5px; }

/* ---- Go-to box ---- */
.nav-palette { position: fixed; inset: 0; z-index: 2100; }
.nav-palette[hidden] { display: none; }
.nav-palette-backdrop { position: absolute; inset: 0; background: rgba(15, 23, 42, .45); }
.nav-palette-card {
    position: relative; width: min(640px, calc(100vw - 24px)); margin: 11vh auto 0; background: var(--nav-bg); color: var(--nav-ink);
    border: 1px solid var(--nav-line); border-radius: 14px; box-shadow: 0 18px 50px rgba(15, 23, 42, .38); overflow: hidden;
}
.np-input { display: flex; align-items: center; gap: 11px; padding: 0 16px; height: 54px; border-bottom: 1px solid var(--nav-line); }
.np-input > i { color: var(--nav-muted); }
.np-input input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--nav-ink); font-size: 17px; }
.np-list { max-height: min(52vh, 420px); overflow-y: auto; padding-bottom: 4px; }
.np-sec { padding: 11px 16px 4px; font-size: 10.5px; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; color: var(--nav-faint); }
.np-it { display: flex; align-items: center; gap: 12px; height: 46px; padding: 0 12px 0 16px; font-size: 14.5px; color: var(--nav-ink); cursor: pointer; text-decoration: none; }
.np-it.sel { background: var(--nav-tint); }
.np-ic { width: 30px; height: 30px; border-radius: 8px; display: inline-flex; align-items: center; justify-content: center; font-size: 13px; flex: 0 0 30px; }
.np-meta { color: var(--nav-muted); font-size: 12.5px; margin-left: 4px; }
.np-right { margin-left: auto; display: inline-flex; align-items: center; gap: 8px; color: var(--nav-muted); font-size: 12.5px; }
.np-empty { padding: 18px 16px; color: var(--nav-muted); font-size: 14px; }
/* record rows (customers, vendors, repairs, POs, invoices): bold title + one muted line, cut off with an ellipsis */
.np-t { flex: 1; min-width: 0; display: flex; align-items: baseline; gap: 9px; }
.np-t b { font-weight: 600; white-space: nowrap; flex: 0 1 auto; overflow: hidden; text-overflow: ellipsis; }
.np-t small { color: var(--nav-muted); font-size: 12.5px; font-weight: 400; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; flex: 1 1 0; }
.np-it.stale { opacity: .5; cursor: default; }                      /* the answer to older text, shown until the new one arrives */
.np-status { padding: 10px 16px; font-size: 13px; color: var(--nav-muted); }
.np-status.warn { color: #b45309; }
body.dark-mode .np-status.warn { color: #fbbf24; }
.np-foot { display: flex; gap: 16px; padding: 9px 16px; border-top: 1px solid var(--nav-line); background: var(--nav-field); font-size: 12px; color: var(--nav-muted); flex-wrap: wrap; }

/* ---- Home ---- */
.home .card { border: 0; }
.home-chip { width: 42px; height: 42px; border-radius: 11px; display: inline-flex; align-items: center; justify-content: center; font-size: 18px; flex: 0 0 42px; background: var(--acc-gray-t); color: var(--acc-gray); }
.home-chip.sm { width: 30px; height: 30px; flex-basis: 30px; font-size: 13px; border-radius: 8px; }
.home-sku { padding: 18px 20px 16px; }
.home-sku-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.home-sku-name { font-size: 17px; font-weight: 700; color: var(--nav-ink); }
.home-sku-more { margin-left: auto; font-size: 13px; font-weight: 600; text-decoration: none; }
.home-sku-row { display: flex; gap: 9px; align-items: stretch; }
.home-sku-input { flex: 1; min-width: 0; height: 54px; padding: 0 16px; font-size: 20px; border: 1.5px solid #cfd6e3; border-radius: 10px; background: var(--nav-bg); color: var(--nav-ink); box-shadow: inset 0 1px 2px rgba(0, 0, 0, .04); }
.home-sku-input:focus { outline: 0; border-color: #86b7fe; box-shadow: 0 0 0 .2rem rgba(0, 123, 255, .25); }
body.dark-mode .home-sku-input { border-color: #4b5563; }
.home-icon-btn { width: 54px; height: 54px; border: 1.5px solid #cfd6e3; border-radius: 10px; background: var(--nav-bg); color: var(--nav-sub); font-size: 19px; display: inline-flex; align-items: center; justify-content: center; flex: 0 0 54px; padding: 0; }
.home-icon-btn:hover { background: var(--nav-hover); }
body.dark-mode .home-icon-btn { border-color: #4b5563; }
.home-search-btn { height: 54px; padding: 0 26px; border-radius: 10px; font-size: 16px; font-weight: 600; white-space: nowrap; }
.home-hint { margin-top: 10px; font-size: 12.5px; color: var(--nav-muted); }
.home-h2 { display: flex; align-items: center; gap: 8px; margin: 18px 0 12px; font-size: 15.5px; font-weight: 700; color: var(--nav-ink); }
.home-h2 i { color: var(--nav-star); }
.home-h2 i.home-clock { color: var(--nav-muted); }
.home-h2-hint { margin-left: auto; font-weight: 400; font-size: 12.5px; color: var(--nav-muted); }
.home-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 12px; }
.home-tile-wrap { position: relative; }
.home-tile {
    display: flex; align-items: center; gap: 12px; width: 100%; padding: 14px; background: var(--nav-bg); border: 1px solid var(--nav-line); border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, .04); color: var(--nav-ink); text-decoration: none; text-align: left;
}
a.home-tile:hover { border-color: #b8c4d8; box-shadow: 0 4px 12px rgba(0, 0, 0, .08); color: var(--nav-ink); }
.home-tile .home-chip { width: 40px; height: 40px; flex-basis: 40px; font-size: 17px; }
.home-tile-text { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; }
.home-tile-text b { font-size: 14.5px; }
.home-tile-text small { font-size: 12px; color: var(--nav-muted); margin-top: 2px; }
.home-tile.ghost { background: transparent; border: 1.5px dashed #c3ccdb; box-shadow: none; color: #7b879b; }
.home-tile.ghost .home-chip { background: var(--acc-gray-t); color: #a6b0c1; }
.home-tile.ghost:hover { border-color: var(--acc-blue); color: var(--acc-blue); }
.tile-star { position: absolute; top: 6px; right: 6px; opacity: 0; transition: opacity .12s; }
.home-tile-wrap:hover .tile-star, .tile-star:focus-visible { opacity: 1; }
@media (hover: none) { .tile-star { opacity: 1; } }
.home-recent { padding: 6px 12px; }
.home-recent-row { display: flex; align-items: center; border-bottom: 1px solid var(--nav-line); }
.home-recent-row:last-child { border-bottom: 0; }
.home-recent-link { flex: 1; min-width: 0; display: flex; align-items: center; gap: 11px; padding: 9px 4px; font-size: 14px; color: var(--nav-ink); text-decoration: none; }
.home-recent-link:hover { color: var(--acc-blue); }
.home-recent-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.home-recent-when { color: var(--nav-muted); font-size: 12.5px; white-space: nowrap; }
.home-empty { padding: 14px 6px; color: var(--nav-muted); font-size: 13.5px; }
/* Common Tasks: one strip of "New ..." tiles under the SKU box (rows of dbo.SecurityNavigationTask) */
.home-tasks { margin-top: 16px; padding: 16px 20px 18px; }
.home-tasks-head { display: flex; align-items: center; gap: 9px; font-size: 17px; font-weight: 700; color: var(--nav-ink); }
.home-tasks-head i { color: var(--nav-star); }
.home-task-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; margin-top: 14px; }
.home-task {
    display: flex; align-items: center; gap: 12px; padding: 13px 14px; background: var(--nav-bg); border: 1px solid var(--nav-line); border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, .04); color: var(--nav-ink); text-decoration: none; font-size: 14.5px; font-weight: 600;
}
a.home-task:hover { border-color: #b8c4d8; box-shadow: 0 4px 12px rgba(0, 0, 0, .08); color: var(--nav-ink); }
a.home-task:focus-visible { outline: 2px solid var(--acc-blue); outline-offset: 2px; }
.home-task-ic { width: 24px; flex: 0 0 24px; text-align: center; font-size: 18px; }
.home-task-name { flex: 1; min-width: 0; line-height: 1.2; }
.home-task-go { margin-left: auto; font-size: 12px; color: var(--nav-faint); }

/* camera scan overlay (Home SKU box) */
.scan-overlay { position: fixed; inset: 0; z-index: 3000; display: flex; align-items: center; justify-content: center; background: rgba(0, 0, 0, .75); }
.scan-card { width: min(92vw, 480px); background: #111; color: #fff; border-radius: 14px; padding: 12px; text-align: center; }
.scan-video { width: 100%; max-height: 60vh; border-radius: 10px; background: #000; }
.scan-msg { margin: 10px 0; font-size: 14px; }

/* ---- narrow windows ---- */
@media (max-width: 991.98px) {
    .app-side-col { display: none; }
    .loc-full { display: none; }
    .loc-abbr { display: inline; }
}
@media (max-width: 575.98px) {
    .app-topbar { gap: 8px; padding: 8px 10px; }
    .app-user-text { display: none; }
    .go-box { flex: 1 1 auto; margin-left: 0; padding: 0 12px; }
    .go-keys { display: none; }
    .go-ph { display: none; }
    .go-ph-s { display: inline; }
    .home-sku { padding: 14px 12px; }
    .home-sku-name { font-size: 16px; }
    .home-sku-more .more-text { display: none; }
    .home-sku-input { height: 46px; font-size: 16px; }
    .home-icon-btn { width: 46px; height: 46px; flex-basis: 46px; font-size: 16px; }
    .home-sku-row { display: grid; grid-template-columns: minmax(0, 1fr) 46px 46px; gap: 7px; }
    .home-sku-row .home-sku-input { grid-column: 1; width: 100%; min-width: 0; }
    .home-search-btn { grid-column: 1 / -1; height: 46px; }
    .home-tiles { grid-template-columns: 1fr 1fr; gap: 9px; }
    .home-tile { padding: 10px 9px; gap: 8px; }
    .home-tile-wrap .home-tile { padding-right: 34px; }              /* room for the pinned star (always shown on touch screens) so it does not sit on the end of a long name */
    .home-tile .home-chip { width: 30px; height: 30px; flex-basis: 30px; font-size: 13px; border-radius: 8px; }
    .home-tile-text b { font-size: 12.5px; }
    .home-tile-text small { font-size: 11px; }
    .home-tasks { padding: 12px 12px 14px; }
    .home-tasks-head { font-size: 16px; }
    .home-task-grid { grid-template-columns: 1fr 1fr; gap: 9px; margin-top: 10px; }
    .home-task { padding: 10px 9px; gap: 8px; font-size: 13px; }
    .home-task-ic { width: 20px; flex-basis: 20px; font-size: 15px; }
    .home-task-go { display: none; }
}

/* ---- collapsed to icons (desktop only; remembered per device in localStorage) ---- */
@media (min-width: 992px) {
    html.nav-collapsed .app-side-col { flex-basis: var(--nav-w-rail); width: var(--nav-w-rail); }
    html.nav-collapsed .app-sidebar { padding: 10px 6px 18px; }
    html.nav-collapsed .nav-text, html.nav-collapsed .nav-star, html.nav-collapsed .nav-chev, html.nav-collapsed .nav-lab-all, html.nav-collapsed .nav-note { display: none; }
    html.nav-collapsed .nav-lab { justify-content: center; margin: 10px 0 4px; }
    html.nav-collapsed .nav-lab:not(.nav-lab-all) .nav-text { display: none; }
    html.nav-collapsed .nav-row, html.nav-collapsed .nav-row.nav-kid { justify-content: center; padding: 0; height: 36px; }
    html.nav-collapsed .nav-ic { font-size: 16px; }
    html.nav-collapsed .nav-grp { width: auto; height: 1px; padding: 0; margin: 8px 12px; background: var(--nav-line); overflow: hidden; pointer-events: none; }
    html.nav-collapsed .nav-grp > * { display: none; }
    html.nav-collapsed .nav-kids { display: block; }
}
