/* HUD Command Panels: the sci-fi heads-up-display look of the theme "hud" (POS and Call Center share this file).
   The colours come from the theme (themes.py); this file adds the shape: panels with a thin blue outline and sharp corners, an orange corner mark, a blue glow on what is
   selected, a hazard stripe, a faint grid on the page. Everything is scoped to [data-theme="hud"], so no other theme changes. */
html[data-theme="hud"] {
  --hud-blue: #1c5ba8; --hud-blue-hi: #2f8cff; --hud-orange: #f5951f; --hud-grid: rgba(47, 140, 255, .07);
}
html[data-theme="hud"]:not(.night):not([data-mode="night"]) { --hud-blue: #6f9ad4; --hud-blue-hi: #1f6fd6; --hud-orange: #b45309; --hud-grid: rgba(31, 111, 214, .08); }

/* the Frost glass look of the cashier screens and the Call Center (pos-frost.css) draws every card, bar and field from the --s-* tokens: the HUD gives its own
   (deep navy page with a measuring grid, panels in the pin's blue, a blue line for every edge, sharp 3 px corners, no blur) */
html[data-theme="hud"].dark body:is(.pg, .pos-ui), html[data-theme="hud"].night body:is(.pg, .pos-ui) {
  --s-page: radial-gradient(120% 90% at 50% 45%, transparent 55%, rgba(0, 4, 18, .6) 100%), linear-gradient(rgba(47, 140, 255, .07) 1px, transparent 1px) 0 0 / 32px 32px,
            linear-gradient(90deg, rgba(47, 140, 255, .07) 1px, transparent 1px) 0 0 / 32px 32px, #030b22;
  --s-card: rgba(11, 35, 66, .94); --s-inner: rgba(47, 140, 255, .08); --s-in: rgba(4, 16, 42, .85); --s-line: #1c5ba8;
  --s-bar: rgba(5, 18, 44, .96); --s-blur: none; --s-text: #e6f1ff; --s-mut: #a5bedf; --s-r: 3px;
  --s-shadow: inset 0 0 0 1px rgba(47, 140, 255, .10), 0 0 22px -10px rgba(47, 140, 255, .35);
  --c-outline-variant: #1c5ba8; --c-surface: #071733; --c-surface-container-low: rgba(11, 35, 66, .94); --c-surface-container: rgba(15, 47, 87, .70);
  --c-surface-container-high: rgba(22, 64, 116, .75); --c-surface-container-highest: rgba(28, 91, 168, .55);
}
html[data-theme="hud"]:not(.dark):not(.night) body:is(.pg, .pos-ui) {
  --s-page: linear-gradient(rgba(31, 111, 214, .08) 1px, transparent 1px) 0 0 / 32px 32px, linear-gradient(90deg, rgba(31, 111, 214, .08) 1px, transparent 1px) 0 0 / 32px 32px, #dce8f8;
  --s-card: rgba(255, 255, 255, .96); --s-inner: rgba(31, 111, 214, .07); --s-in: #ffffff; --s-line: #6f9ad4; --s-bar: rgba(244, 249, 255, .98); --s-blur: none;
  --s-text: #0b1b33; --s-mut: #3a5373; --s-r: 3px; --s-shadow: inset 0 0 0 1px rgba(31, 111, 214, .12), 0 0 18px -10px rgba(31, 111, 214, .4);
  --c-outline-variant: #6f9ad4;
}

/* the same look as an option on any other theme: the shape (outlines, sharp corners, corner marks, glow), with that theme's own colours */
html[data-fx~="hud"]:not([data-theme="hud"]) { --hud-blue: color-mix(in srgb, var(--c-primary, #4f8cff) 50%, var(--c-outline-variant, #64748b)); --hud-blue-hi: var(--c-primary, #4f8cff); --hud-orange: var(--c-tertiary, #f59e0b); --hud-grid: transparent; }
html[data-fx~="hud"]:not([data-theme="hud"]) body:is(.pg, .pos-ui) { --s-line: var(--hud-blue); --s-r: 3px; --s-blur: none; --s-shadow: inset 0 0 0 1px color-mix(in srgb, var(--hud-blue-hi) 14%, transparent), 0 0 22px -10px color-mix(in srgb, var(--hud-blue-hi) 45%, transparent); --c-outline-variant: var(--hud-blue); }
html:is([data-theme="hud"], [data-fx~="hud"]) body:is(.pg, .pos-ui) :is(.pp-btn, .btn, button.rounded-lg, button.rounded-xl, a.rounded-lg.border, a.rounded-xl.border) { border-radius: 3px; }
html:is([data-theme="hud"], [data-fx~="hud"]) body:is(.pg, .pos-ui) :is(input, select, textarea):not([type=checkbox]):not([type=radio]):not([type=range]):not([type=color]), html:is([data-theme="hud"], [data-fx~="hud"]) body:is(.pg, .pos-ui) .pp-input { border-radius: 3px !important; border-width: 1px !important; }
html:is([data-theme="hud"], [data-fx~="hud"]) body:is(.pg, .pos-ui) :is(.pp-card, .card, [class*="bg-surface-container-low"][class*="rounded"]) { border-radius: 3px !important; }
html:is([data-theme="hud"], [data-fx~="hud"]) body:is(.pg, .pos-ui) :is(header, nav, footer, [class*="topbar"], [class*="bottombar"]) { border-bottom-color: var(--hud-blue) !important; }
html:is([data-theme="hud"], [data-fx~="hud"]) body:is(.pg, .pos-ui) :is(dialog, [role="dialog"], .modal, [class*="modal"] > div) { background: #071733; }

/* the page: deep navy with a faint measuring grid and a vignette */
html:is([data-theme="hud"], [data-fx~="hud"]) body:not(.pg):not(.pos-ui) {
  background-image: radial-gradient(120% 90% at 50% 45%, transparent 55%, rgba(0, 4, 18, .55) 100%),
                    linear-gradient(var(--hud-grid) 1px, transparent 1px), linear-gradient(90deg, var(--hud-grid) 1px, transparent 1px);
  background-size: 100% 100%, 32px 32px, 32px 32px;
  background-attachment: fixed;
}
html:is([data-theme="hud"], [data-fx~="hud"]):not(.night):not([data-mode="night"]) body:not(.pg):not(.pos-ui) { background-image: linear-gradient(var(--hud-grid) 1px, transparent 1px), linear-gradient(90deg, var(--hud-grid) 1px, transparent 1px); background-size: 32px 32px; }

/* panels: a thin blue outline, sharp corners, an orange wedge in the top corner, a quiet inner glow */
html:is([data-theme="hud"], [data-fx~="hud"]) :is(main, aside, section, article, .card, dialog, [role="dialog"]):not(.hidden):not([hidden]),
html:is([data-theme="hud"], [data-fx~="hud"]) :is(.bg-surface-container, .bg-surface-container-low, .bg-surface-container-high):is(.rounded-xl, .rounded-2xl, .rounded-lg, [class*="rounded-["]):not(button):not(input):not(.menu-key):not(.menu-key-empty) {
  border-radius: 3px !important;
  box-shadow: inset 0 0 0 1px rgba(47, 140, 255, .10), 0 0 22px -10px rgba(47, 140, 255, .35);
}
html:is([data-theme="hud"], [data-fx~="hud"]) :is(main, aside, section, article, .card):not(.hidden):not([hidden]):not([class*="fixed"]):not(.h-full):not(.w-full) {
  border: 1px solid var(--hud-blue);
}
/* the orange corner mark: a pseudo-element, because the Frost glass paints panel backgrounds with !important */
html:is([data-theme="hud"], [data-fx~="hud"]) :is(main, aside, .card, article):not(.hidden):not([hidden]):not([class*="fixed"]):not(.h-full) { position: relative; }
html:is([data-theme="hud"], [data-fx~="hud"]) :is(main, aside, .card, article):not(.hidden):not([hidden]):not([class*="fixed"]):not(.h-full)::after {
  content: ""; position: absolute; top: -1px; left: -1px; width: 16px; height: 16px; pointer-events: none; z-index: 2;
  background: linear-gradient(135deg, var(--hud-orange) 50%, transparent 50%);
}
html:is([data-theme="hud"], [data-fx~="hud"]) [class*="border-outline-variant"] { border-color: var(--hud-blue) !important; }

/* buttons and keys: sharp, outlined in blue, an orange corner mark; the pressed or chosen one glows */
html:is([data-theme="hud"], [data-fx~="hud"]) button:not(.menu-key-empty):not(.xf-key):not(.xf-go):not([class*="rounded-full"]):not([role="switch"]),
html:is([data-theme="hud"], [data-fx~="hud"]) .menu-key, html:is([data-theme="hud"], [data-fx~="hud"]) .branch-feed-card {
  border-radius: 3px !important;
}
html:is([data-theme="hud"], [data-fx~="hud"]) :is(.tactile-key, .menu-key, .branch-feed-card, .xf-key):not(.menu-key-empty) { border-color: var(--hud-blue) !important; }
html:is([data-theme="hud"], [data-fx~="hud"]) :is(.menu-key, .branch-feed-card):not(.menu-key-empty) {
  background-image: linear-gradient(135deg, var(--hud-orange) 0 9px, transparent 9px);
  background-repeat: no-repeat; background-position: top left;
}
html:is([data-theme="hud"], [data-fx~="hud"]) :is(.tactile-key, .menu-key, .branch-feed-card, .xf-key):not(.menu-key-empty):hover { border-color: var(--hud-blue-hi) !important; box-shadow: 0 0 14px -2px rgba(47, 140, 255, .55); }
html:is([data-theme="hud"], [data-fx~="hud"]) :is(.tactile-key, .menu-key):not(.menu-key-empty):active { box-shadow: inset 0 0 0 2px var(--hud-blue-hi), 0 0 18px rgba(47, 140, 255, .6); }
html:is([data-theme="hud"], [data-fx~="hud"]) button[class*="rounded-full"]:not(.menu-key-empty) { border-radius: 6px !important; }

/* the unused places keep the light-gray rule of the Call Center, drawn as outlined slots */
html:is([data-theme="hud"], [data-fx~="hud"]) button.menu-key-empty, html:is([data-theme="hud"], [data-fx~="hud"]) #branchesGrid .branch-empty-place {
  background: #4f5b70 !important; border: 1px dashed #aab2c0 !important; border-radius: 3px !important; box-shadow: none !important;
}

html:is([data-theme="hud"], [data-fx~="hud"]):not(.night):not(.dark) button.menu-key-empty, html:is([data-theme="hud"], [data-fx~="hud"]):not(.night):not(.dark) #branchesGrid .branch-empty-place { background: #d1d5db !important; border-color: #9aa3b2 !important; }

/* the top bar: a blue line under it with a short orange stretch, like a HUD rail */
html:is([data-theme="hud"], [data-fx~="hud"]) :is(header, #lugmaTopbar) {
  border-bottom: 1px solid var(--hud-blue) !important;
  background-image: linear-gradient(90deg, var(--hud-orange) 0 160px, transparent 160px), linear-gradient(90deg, var(--hud-blue-hi) 0 48px, transparent 48px);
  background-repeat: no-repeat; background-size: 100% 2px, 100% 1px; background-position: left bottom, 164px bottom;
}
html:is([data-theme="hud"], [data-fx~="hud"]) :is(footer, #unifiedConsoleBottomDock) { border-top: 1px solid var(--hud-blue) !important; }

/* fields */
html:is([data-theme="hud"], [data-fx~="hud"]) :is(input, select, textarea):not([type="checkbox"]):not([type="radio"]):not([type="range"]) {
  border: 1px solid var(--hud-blue) !important; border-radius: 3px !important; background-color: rgba(3, 14, 40, .55);
}
html:is([data-theme="hud"], [data-fx~="hud"]):not(.night):not([data-mode="night"]) :is(input, select, textarea) { background-color: #fff; }
html:is([data-theme="hud"], [data-fx~="hud"]) :is(input, select, textarea):focus { outline: none; border-color: var(--hud-blue-hi) !important; box-shadow: 0 0 0 1px var(--hud-blue-hi), 0 0 14px rgba(47, 140, 255, .45); }
html:is([data-theme="hud"], [data-fx~="hud"]) :focus-visible { outline: 2px solid var(--hud-blue-hi); outline-offset: 2px; }

/* a chosen tab or key: bright blue edge and glow, with a hazard stripe underneath */
html:is([data-theme="hud"], [data-fx~="hud"]) :is(.bg-primary, [aria-pressed="true"], [aria-selected="true"], .active, .on):is(button, a, [role="tab"]):not(.menu-key-empty) {
  box-shadow: 0 0 0 1px var(--hud-blue-hi), 0 0 16px rgba(47, 140, 255, .5);
}
html:is([data-theme="hud"], [data-fx~="hud"]) .bg-primary:is(button) {
  background-image: repeating-linear-gradient(135deg, rgba(0, 0, 0, .22) 0 3px, transparent 3px 7px); background-size: 100% 4px; background-repeat: no-repeat; background-position: left bottom;
}

/* scrollbars */
html:is([data-theme="hud"], [data-fx~="hud"]) ::-webkit-scrollbar { width: 8px; height: 8px; }
html:is([data-theme="hud"], [data-fx~="hud"]) ::-webkit-scrollbar-thumb { background: var(--hud-blue); border-radius: 0; }
html:is([data-theme="hud"], [data-fx~="hud"]) ::-webkit-scrollbar-track { background: transparent; }

/* the Call Center's in-call bar and windows keep their own look, with the HUD outline */
html:is([data-theme="hud"], [data-fx~="hud"]) .lc-glass { border-color: var(--hud-blue); border-radius: 6px; }
html:is([data-theme="hud"], [data-fx~="hud"]) .fixed.inset-0 > div { border-color: var(--hud-blue-hi); box-shadow: 0 0 0 1px var(--hud-blue), 0 0 40px -8px rgba(47, 140, 255, .55); }
