/* =============================================================================
 * FILE    : static/css/style.css
 * PURPOSE : Project theme layer on top of the Skydash compiled stylesheet
 *           (assets/css/vertical-layout-light/style.css, Bootstrap 5.3.2 inside).
 *
 * HOW TO USE / CHANGE THE LOOK
 * ----------------------------------------------------------------------------
 * 1. All colours are CSS variables in section 1 (LIGHT) and section 2 (DARK).
 *    Change the --app-* values only; every component below reads from them.
 * 2. Accent presets (section 3) let you switch the brand hue without touching
 *    the palette: <html data-app-accent="...">. Default = blue. 12 presets: blue, teal,
 *    indigo, slate, emerald, cyan, violet, plum, amber, copper, crimson, graphite.
 *    Add your own preset by copying one block and changing 4 values.
 * 3. Theme (light/dark) is set on <html data-bs-theme="light|dark"> by
 *    static/js/liri_app.js (toggle button in the top bar, saved per browser).
 * 4. DENSITY: <html data-app-density="compact|comfortable">. COMPACT is the default
 *    (MES / shop-floor screens: maximum data per screen, small even gaps).
 *    Users can switch to comfortable in the top-bar palette menu. Section 17.
 * 5. Legacy variable names used by older projects (--menu-left-*, --btn-*,
 *    --table-header-*, ...) are kept and mapped onto the new palette, so old
 *    controllers that use classes like .table-header-bg keep working.
 *
 * DESIGN NOTES (industrial / 24x7 use)
 *  - Low-glare surfaces: light theme uses a cool grey canvas (not pure white),
 *    dark theme uses deep navy (not pure black) to reduce eye strain on
 *    control-room / shop-floor screens that stay on all day.
 *  - Status colours are reserved for state (OK / warning / alarm) only.
 *  - Touch devices (tablets) get >= 40px tap targets automatically (section 9).
 *  - Numbers in tables use tabular figures so columns line up.
 * ========================================================================== */


/* -----------------------------------------------------------------------------
 * 0. Font (local, no internet needed) - Inter, latin subset
 * -------------------------------------------------------------------------- */
@font-face { font-family: "Inter"; font-style: normal; font-weight: 400; font-display: swap; src: url("../vendor/fonts/inter/inter-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 500; font-display: swap; src: url("../vendor/fonts/inter/inter-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 600; font-display: swap; src: url("../vendor/fonts/inter/inter-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 700; font-display: swap; src: url("../vendor/fonts/inter/inter-latin-700-normal.woff2") format("woff2"); }


/* -----------------------------------------------------------------------------
 * 1. LIGHT THEME PALETTE (default)
 * -------------------------------------------------------------------------- */
:root,
[data-bs-theme="light"] {
  /* Brand / accent (steel blue) */
  --app-primary:            #1d5fa7;
  --app-primary-rgb:        29, 95, 167;
  --app-primary-hover:      #174d88;
  --app-primary-soft:       #e3edf8;   /* tinted backgrounds, selected rows */

  /* Surfaces */
  --app-bg:                 #eef2f7;   /* page canvas */
  --app-surface:            #ffffff;   /* cards, forms, tables */
  --app-surface-2:          #f5f7fa;   /* zebra rows, input-group labels */
  --app-border:             #d5dde8;
  --app-text:               #1b2735;
  --app-text-muted:         #5b6b7f;

  /* Top bar */
  --app-navbar-bg:          #ffffff;
  --app-navbar-text:        #1b2735;

  /* Left menu (dark navy in both themes - classic industrial HMI look) */
  --app-sidebar-bg:         #0f2740;
  --app-sidebar-text:       #c5d3e3;
  --app-sidebar-icon:       #8fb3db;
  --app-sidebar-hover-bg:   #173a5e;
  --app-sidebar-active-bg:  #1d5fa7;
  --app-sidebar-active-text:#ffffff;
  --app-sidebar-sub-bg:     #0b1f33;
  --app-sidebar-strong:     #ffffff;                  /* hover / open-group text + icon */
  --app-sidebar-hover-tint: rgba(255, 255, 255, .06); /* hover row, logout button */
  --app-sidebar-line:       rgba(255, 255, 255, .12); /* sub-menu guide line, logout divider */
  --app-sidebar-scroll:     rgba(255, 255, 255, .15);
  --app-sidebar-edge:       transparent;              /* right edge line (white menu) */

  /* Tables */
  --app-table-head-bg:      #1f3a5c;
  --app-table-head-text:    #ffffff;
  --app-table-head-border:  #2c4c73;
  --app-table-hover:        #eaf1fa;

  /* Status (reserved for state - always pair with icon/text) */
  --app-success:            #2f8f5b;
  --app-warning:            #c98a12;
  --app-danger:             #c8423b;
  --app-info:               #2a86b5;

  /* Chart series (validated categorical order: blue, orange, aqua) */
  --app-chart-1:            #2a78d6;
  --app-chart-2:            #eb6834;
  --app-chart-3:            #1baf7a;
  --app-chart-grid:         #e3e8ef;

  --app-shadow:             0 1px 2px rgba(16, 32, 56, .06), 0 2px 8px rgba(16, 32, 56, .05);
  --app-radius:             10px;
}

/* -----------------------------------------------------------------------------
 * 2. DARK THEME PALETTE  (<html data-bs-theme="dark">)
 * -------------------------------------------------------------------------- */
[data-bs-theme="dark"] {
  --app-primary:            #4a90d9;
  --app-primary-rgb:        74, 144, 217;
  --app-primary-hover:      #67a5e6;
  --app-primary-soft:       #1a3150;

  --app-bg:                 #0d1520;
  --app-surface:            #142030;
  --app-surface-2:          #1a283a;
  --app-border:             #26384d;
  --app-text:               #d7e1ec;
  --app-text-muted:         #8ea0b5;

  --app-navbar-bg:          #111c2a;
  --app-navbar-text:        #d7e1ec;

  --app-sidebar-bg:         #0a121c;
  --app-sidebar-text:       #b4c3d4;
  --app-sidebar-icon:       #6f97c4;
  --app-sidebar-hover-bg:   #13243a;
  --app-sidebar-active-bg:  #1f4f86;
  --app-sidebar-active-text:#ffffff;
  --app-sidebar-sub-bg:     #08101a;

  --app-table-head-bg:      #1c3350;
  --app-table-head-text:    #e6eef7;
  --app-table-head-border:  #2a4466;
  --app-table-hover:        #1b2c42;

  --app-success:            #3fae74;
  --app-warning:            #e0a83a;
  --app-danger:             #e0625b;
  --app-info:               #4bb0db;

  --app-chart-1:            #3987e5;
  --app-chart-2:            #d95926;
  --app-chart-3:            #199e70;
  --app-chart-grid:         #22334a;

  --app-shadow:             0 1px 2px rgba(0, 0, 0, .35);
  color-scheme: dark;
}

/* -----------------------------------------------------------------------------
 * 3. ACCENT PRESETS  (<html data-app-accent="...">) - 12 presets, switchable in the top bar.
 *    Names must match LIRI_ACCENTS in static/js/liri_app.js (swatches) and ACCENT_DEFAULT in .env
 * -------------------------------------------------------------------------- */
[data-app-accent|="teal"]                          { --app-primary:#0f7c80; --app-primary-rgb:15,124,128; --app-primary-hover:#0b6366; --app-primary-soft:#dff1f1; --app-sidebar-active-bg:#0f7c80; --app-sidebar-bg:#0d2a2e; --app-sidebar-hover-bg:#14413f; --app-table-head-bg:#164448; }
[data-bs-theme="dark"][data-app-accent|="teal"]    { --app-primary:#3fb4b4; --app-primary-rgb:63,180,180; --app-primary-hover:#5ccaca; --app-primary-soft:#123536; --app-sidebar-active-bg:#1f6d6f; --app-sidebar-bg:#08151a; --app-sidebar-hover-bg:#10292b; --app-table-head-bg:#173c40; }
[data-app-accent|="indigo"]                        { --app-primary:#3f4fb0; --app-primary-rgb:63,79,176; --app-primary-hover:#323f8f; --app-primary-soft:#e5e8f7; --app-sidebar-active-bg:#3f4fb0; --app-sidebar-bg:#18193a; --app-sidebar-hover-bg:#262a5a; --app-table-head-bg:#2a3170; }
[data-bs-theme="dark"][data-app-accent|="indigo"]  { --app-primary:#7d8be0; --app-primary-rgb:125,139,224; --app-primary-hover:#98a3ea; --app-primary-soft:#22284f; --app-sidebar-active-bg:#3c4796; --app-sidebar-bg:#0d0e20; --app-sidebar-hover-bg:#1a1d3d; --app-table-head-bg:#262c5e; }
[data-app-accent|="slate"]                         { --app-primary:#3d5a73; --app-primary-rgb:61,90,115; --app-primary-hover:#2f475b; --app-primary-soft:#e4eaf0; --app-sidebar-active-bg:#3d5a73; --app-sidebar-bg:#1c2731; --app-sidebar-hover-bg:#2a3946; --app-table-head-bg:#2f4253; }
[data-bs-theme="dark"][data-app-accent|="slate"]   { --app-primary:#7f9db8; --app-primary-rgb:127,157,184; --app-primary-hover:#9ab3ca; --app-primary-soft:#1f2c38; --app-sidebar-active-bg:#3b5469; --app-sidebar-bg:#0c1117; --app-sidebar-hover-bg:#18222c; --app-table-head-bg:#2a3b4b; }
/* added accents - light primaries pass 4.5:1 with white text; dark ones balance white text and the dark page.
   Note: crimson / amber / copper sit close to the danger / warning status colours - avoid them where alarms must stand out. */
[data-app-accent|="emerald"]               { --app-primary:#1f8455; --app-primary-rgb:31,132,85; --app-primary-hover:#186742; --app-primary-soft:#e7f9f0; --app-sidebar-active-bg:#1f8455; --app-sidebar-bg:#123022; --app-sidebar-hover-bg:#1f4734; --app-table-head-bg:#25563f; }
[data-bs-theme="dark"][data-app-accent|="emerald"]{ --app-primary:#27a56a; --app-primary-rgb:39,165,106; --app-primary-hover:#2ec27d; --app-primary-soft:#1a3d2d; --app-sidebar-active-bg:#26734f; --app-sidebar-bg:#0b1912; --app-sidebar-hover-bg:#14291f; --app-table-head-bg:#204b37; }
[data-app-accent|="cyan"]                  { --app-primary:#187c95; --app-primary-rgb:24,124,149; --app-primary-hover:#136376; --app-primary-soft:#e7f5f9; --app-sidebar-active-bg:#187c95; --app-sidebar-bg:#122a30; --app-sidebar-hover-bg:#1f3f47; --app-table-head-bg:#254c56; }
[data-bs-theme="dark"][data-app-accent|="cyan"]{ --app-primary:#248ea8; --app-primary-rgb:36,142,168; --app-primary-hover:#2aa7c6; --app-primary-soft:#1a363d; --app-sidebar-active-bg:#266373; --app-sidebar-bg:#0b1619; --app-sidebar-hover-bg:#142529; --app-table-head-bg:#20424b; }
[data-app-accent|="violet"]                { --app-primary:#6337ae; --app-primary-rgb:99,55,174; --app-primary-hover:#532f93; --app-primary-soft:#eee8f8; --app-sidebar-active-bg:#6337ae; --app-sidebar-bg:#1d1230; --app-sidebar-hover-bg:#2e1f47; --app-table-head-bg:#372556; }
[data-bs-theme="dark"][data-app-accent|="violet"]{ --app-primary:#916cd0; --app-primary-rgb:145,108,208; --app-primary-hover:#a587d9; --app-primary-soft:#271a3d; --app-sidebar-active-bg:#422673; --app-sidebar-bg:#100b19; --app-sidebar-hover-bg:#1c1429; --app-table-head-bg:#30204b; }
[data-app-accent|="plum"]                  { --app-primary:#9e479e; --app-primary-rgb:158,71,158; --app-primary-hover:#863c86; --app-primary-soft:#f6eaf6; --app-sidebar-active-bg:#9e479e; --app-sidebar-bg:#2e152e; --app-sidebar-hover-bg:#462046; --app-table-head-bg:#542654; }
[data-bs-theme="dark"][data-app-accent|="plum"]{ --app-primary:#b65db6; --app-primary-rgb:182,93,182; --app-primary-hover:#c176c1; --app-primary-soft:#3c1b3c; --app-sidebar-active-bg:#6a2f6a; --app-sidebar-bg:#190b19; --app-sidebar-hover-bg:#291429; --app-table-head-bg:#4a214a; }
[data-app-accent|="amber"]                 { --app-primary:#aa610e; --app-primary-rgb:170,97,14; --app-primary-hover:#894e0b; --app-primary-soft:#f9f0e7; --app-sidebar-active-bg:#aa610e; --app-sidebar-bg:#302212; --app-sidebar-hover-bg:#47341f; --app-table-head-bg:#563f25; }
[data-bs-theme="dark"][data-app-accent|="amber"]{ --app-primary:#b17025; --app-primary-rgb:177,112,37; --app-primary-hover:#ce822c; --app-primary-soft:#3d2d1a; --app-sidebar-active-bg:#734f26; --app-sidebar-bg:#19120b; --app-sidebar-hover-bg:#291f14; --app-table-head-bg:#4b3720; }
[data-app-accent|="copper"]                { --app-primary:#ba522c; --app-primary-rgb:186,82,44; --app-primary-hover:#9d4525; --app-primary-soft:#f9ebe7; --app-sidebar-active-bg:#ba522c; --app-sidebar-bg:#301a12; --app-sidebar-hover-bg:#47291f; --app-table-head-bg:#563225; }
[data-bs-theme="dark"][data-app-accent|="copper"]{ --app-primary:#cf5b30; --app-primary-rgb:207,91,48; --app-primary-hover:#d5724d; --app-primary-soft:#3d231a; --app-sidebar-active-bg:#733b26; --app-sidebar-bg:#190f0b; --app-sidebar-hover-bg:#291a14; --app-table-head-bg:#4b2c20; }
[data-app-accent|="crimson"]               { --app-primary:#ba2c43; --app-primary-rgb:186,44,67; --app-primary-hover:#9d2539; --app-primary-soft:#f9e7ea; --app-sidebar-active-bg:#ba2c43; --app-sidebar-bg:#301217; --app-sidebar-hover-bg:#471f25; --app-table-head-bg:#56252d; }
[data-bs-theme="dark"][data-app-accent|="crimson"]{ --app-primary:#d65168; --app-primary-rgb:214,81,104; --app-primary-hover:#dd6e81; --app-primary-soft:#3d1a20; --app-sidebar-active-bg:#732633; --app-sidebar-bg:#190b0d; --app-sidebar-hover-bg:#291417; --app-table-head-bg:#4b2027; }
[data-app-accent|="graphite"]              { --app-primary:#67717e; --app-primary-rgb:103,113,126; --app-primary-hover:#575f6b; --app-primary-soft:#eeeff1; --app-sidebar-active-bg:#67717e; --app-sidebar-bg:#1d2025; --app-sidebar-hover-bg:#2d3239; --app-table-head-bg:#363c45; }
[data-bs-theme="dark"][data-app-accent|="graphite"]{ --app-primary:#76808f; --app-primary-rgb:118,128,143; --app-primary-hover:#89929f; --app-primary-soft:#272b30; --app-sidebar-active-bg:#454b54; --app-sidebar-bg:#101214; --app-sidebar-hover-bg:#1c1e22; --app-table-head-bg:#30353b; }



/* -----------------------------------------------------------------------------
 * 3b. LIGHT / WHITE LEFT MENU accents  (<html data-app-accent="teal-light"> / "teal-white")
 *     "<colour>-light" : menu tinted with the accent colour, dark text
 *     "<colour>-white" : white menu with a thin edge line, dark text
 *     The accent colour itself comes from the "<colour>" preset above ([data-app-accent|=...]).
 *     Light theme only - in dark theme these keep the dark menu.
 * -------------------------------------------------------------------------- */
html:not([data-bs-theme="dark"])[data-app-accent$="-light"],
html:not([data-bs-theme="dark"])[data-app-accent$="-white"] {
  --app-sidebar-text:       #3a4a5c;
  --app-sidebar-icon:       var(--app-primary);
  --app-sidebar-strong:     var(--app-primary);
  --app-sidebar-hover-tint: rgba(var(--app-primary-rgb), .09);
  --app-sidebar-line:       rgba(var(--app-primary-rgb), .22);
  --app-sidebar-scroll:     rgba(var(--app-primary-rgb), .25);
  --app-sidebar-active-bg:  var(--app-primary);
}
html:not([data-bs-theme="dark"])[data-app-accent$="-light"] {
  --app-sidebar-bg:         color-mix(in srgb, var(--app-primary) 9%, #ffffff);
  --app-sidebar-hover-bg:   color-mix(in srgb, var(--app-primary) 16%, #ffffff);
  --app-sidebar-edge:       rgba(var(--app-primary-rgb), .14);
}
html:not([data-bs-theme="dark"])[data-app-accent$="-white"] {
  --app-sidebar-bg:         #ffffff;
  --app-sidebar-hover-bg:   var(--app-primary-soft);
  --app-sidebar-edge:       var(--app-border);
}
#sidebar { box-shadow: inset -1px 0 0 var(--app-sidebar-edge); }
/* light menus: softer shadow on the active pill / fly-outs */
html:not([data-bs-theme="dark"]):is([data-app-accent$="-light"], [data-app-accent$="-white"]) #sidebar .nav .nav-link.active,
html:not([data-bs-theme="dark"]):is([data-app-accent$="-light"], [data-app-accent$="-white"]) #sidebar .nav-item.active > .nav-link:not([data-bs-toggle]) { box-shadow: 0 2px 6px rgba(var(--app-primary-rgb), .3) !important; }
html:not([data-bs-theme="dark"]):is([data-app-accent$="-light"], [data-app-accent$="-white"]) .sidebar-icon-only #sidebar .nav-item.hover-open :is(.menu-title, .collapse, .collapsing) { box-shadow: 4px 6px 16px rgba(16, 32, 56, .16) !important; border: 1px solid var(--app-border); }

/* -----------------------------------------------------------------------------
 * 4. MAP PALETTE -> BOOTSTRAP + LEGACY VARIABLES (do not edit; edit 1-3)
 * -------------------------------------------------------------------------- */
:root, [data-bs-theme] {
  --bs-body-font-family:    "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --bs-body-bg:             var(--app-bg);
  --bs-body-color:          var(--app-text);
  --bs-secondary-color:     var(--app-text-muted);
  --bs-border-color:        var(--app-border);
  --bs-primary:             var(--app-primary);
  --bs-primary-rgb:         var(--app-primary-rgb);
  --bs-link-color:          var(--app-primary);
  --bs-link-color-rgb:      var(--app-primary-rgb);
  --bs-link-hover-color:    var(--app-primary-hover);
  --bs-tertiary-bg:         var(--app-surface-2);

  /* Legacy names (kept for older controllers / projects) */
  --menu-left-default-text-color:   var(--app-sidebar-text);
  --menu-left-default-bg-color:     var(--app-sidebar-bg);
  --menu-left-hover-text-color:     var(--app-sidebar-active-text);
  --menu-left-hover-bg-color:       var(--app-sidebar-hover-bg);
  --menu-left-selected-text-color:  var(--app-sidebar-active-text);
  --menu-left-selected-bg-color:    var(--app-sidebar-active-bg);
  --table-header-text-color:        var(--app-table-head-text);
  --table-header-bg-color:          var(--app-table-head-bg);
  --table-header-border-color:      var(--app-table-head-border);
  --btn-primary-text-color:         #fff;
  --btn-primary-bg-color:           var(--app-primary);
  --btn-success-text-color:         #fff;
  --btn-success-bg-color:           var(--app-success);
  --btn-danger-text-color:          #fff;
  --btn-danger-bg-color:            var(--app-danger);
  --text-primary-color:             var(--app-primary);
  --text-success-color:             var(--app-success);
  --text-danger-color:              var(--app-danger);
  --text-warning-color:             var(--app-warning);
  --bg-primary-color:               var(--app-primary);
  --bg-success-color:               var(--app-success);
  --bg-danger-color:                var(--app-danger);
  --bg-warning-color:               var(--app-warning);
  --form-select-selected-bg-color:  var(--app-primary);
  --form-select-selected-text-color:#fff;
}


/* -----------------------------------------------------------------------------
 * 5. BASE + LAYOUT SHELL (top bar, content, footer)
 * -------------------------------------------------------------------------- */
html { font-size: 15px; }                                   /* 1rem = 15px: readable on 13-15" laptops */
body {
  font-family: var(--bs-body-font-family) !important;
  background: var(--app-bg);
  color: var(--app-text);
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4, h5, h6, .h1, .h2, .h3, .h4, .h5, .h6 { line-height: 1.4; color: var(--app-text); }
.text-muted { color: var(--app-text-muted) !important; }
a { color: var(--app-primary); }
.pointer { cursor: pointer; }

.container-scroller, .page-body-wrapper, .main-panel, .content-wrapper { background: var(--app-bg); }
.content-wrapper { padding: 1rem 1.25rem !important; min-height: calc(100vh - 50px - 46px); }

/* Top bar */
.navbar .navbar-brand-wrapper,
.navbar .navbar-menu-wrapper { background: var(--app-navbar-bg); color: var(--app-navbar-text); }
.navbar { border-bottom: 1px solid var(--app-border); box-shadow: var(--app-shadow); }
.navbar .navbar-menu-wrapper { padding-left: 1rem; padding-right: 1rem; }
.navbar .navbar-brand-wrapper .navbar-brand img { height: 26px; }
.navbar .navbar-menu-wrapper .navbar-toggler { color: var(--app-navbar-text); font-size: 1.15rem; }
#liri_skydash_divid_top_nav_title { color: var(--app-navbar-text) !important; font-size: 1.1rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.app-topbar-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; border-radius: 8px; border: 1px solid var(--app-border);
  background: var(--app-surface); color: var(--app-text); margin-left: .4rem;
}
.app-topbar-btn:hover { background: var(--app-primary-soft); color: var(--app-primary); }
.app-clock { font-variant-numeric: tabular-nums; font-size: .85rem; color: var(--app-text-muted); white-space: nowrap; }
/* Dark theme: show the top-left logo in white. Delete this rule if your logo already suits dark backgrounds. */
[data-bs-theme="dark"] .navbar .navbar-brand-wrapper .navbar-brand.brand-logo img { filter: brightness(0) invert(.92); }

/* Footer */
.footer { background: var(--app-surface); color: var(--app-text-muted); border-top: 1px solid var(--app-border); padding: .6rem 1.25rem; font-size: .8rem; }


/* -----------------------------------------------------------------------------
 * 6. LEFT MENU (sidebar) - modern admin style
 *    - 8px side gutters, 38px rows, 6px rounded items, icons in a fixed 20px column
 *    - group open  : title turns white, sub items hang off a thin guide line
 *    - active page : filled pill (accent colour) - same width / radius for
 *                    single links and sub items, 8px gap on the right
 *    (#sidebar id selectors are used on purpose: they win over Skydash rules)
 * -------------------------------------------------------------------------- */
#sidebar, .sidebar { background: var(--app-sidebar-bg); }
#sidebar { position: fixed; display: flex; flex-direction: column; }
#sidebar-nav { height: calc(100vh - 50px - 56px); overflow-y: auto; overflow-x: hidden; scrollbar-width: thin; scrollbar-color: var(--app-sidebar-scroll) transparent; }
#sidebar .nav:not(.sub-menu) { margin: .6rem .5rem 0; padding: 0; }
#sidebar .nav .nav-item { padding: 0; margin: 0 0 2px; background: transparent; border-radius: 6px; }
#sidebar .nav .nav-item .nav-link {
  position: relative; display: flex; align-items: center;
  min-height: 38px; padding: .5rem .65rem; margin: 0;
  border-radius: 6px; color: var(--app-sidebar-text); background: transparent;
  transition: background .15s ease, color .15s ease;
}
#sidebar .nav .nav-item .nav-link i.menu-icon { width: 20px; flex: 0 0 20px; margin-right: .7rem; text-align: center; font-size: .95rem; color: var(--app-sidebar-icon); }
#sidebar .nav .nav-item .nav-link .menu-title { font-size: .9rem; font-weight: 500; color: inherit; letter-spacing: .01em; }
#sidebar .nav .nav-item .nav-link i.menu-arrow { margin-left: auto; color: var(--app-sidebar-icon); }
#sidebar .nav .nav-item .nav-link i.menu-arrow:before { font-family: "Font Awesome 7 Free"; font-weight: 900; content: "\f054"; font-size: .6rem; transition: transform .2s ease; }
#sidebar .nav .nav-item .nav-link[aria-expanded="true"] i.menu-arrow:before { transform: rotate(90deg); }

/* hover */
#sidebar .nav:not(.sub-menu) > .nav-item:hover > .nav-link,
#sidebar .nav.sub-menu .nav-item .nav-link:hover { background: var(--app-sidebar-hover-tint); color: var(--app-sidebar-strong); }
#sidebar .nav .nav-item:hover > .nav-link i.menu-icon { color: var(--app-sidebar-strong); }
/* open group / group of the current page: white title, no fill */
#sidebar .nav:not(.sub-menu) > .nav-item > .nav-link[aria-expanded="true"],
#sidebar .nav:not(.sub-menu) > .nav-item.active > .nav-link[data-bs-toggle] { background: transparent; color: var(--app-sidebar-strong); border-radius: 6px; }
#sidebar .nav:not(.sub-menu) > .nav-item.active > .nav-link[data-bs-toggle] i.menu-icon,
#sidebar .nav:not(.sub-menu) > .nav-item > .nav-link[aria-expanded="true"] i.menu-icon { color: var(--app-sidebar-strong); }
#sidebar .nav:not(.sub-menu) > .nav-item.active,
#sidebar .nav:not(.sub-menu) > .nav-item:hover { background: transparent; }
/* current page = filled pill (single link) */
#sidebar .nav:not(.sub-menu) > .nav-item.active > .nav-link:not([data-bs-toggle]) { background: var(--app-sidebar-active-bg); color: #fff; box-shadow: 0 2px 6px rgba(0, 0, 0, .25); }
#sidebar .nav:not(.sub-menu) > .nav-item.active > .nav-link:not([data-bs-toggle]) i.menu-icon { color: #fff; }

/* sub menu: guide line under the group icon, items full width with right gap */
#sidebar .nav.sub-menu { background: transparent; margin: 2px 0 6px 1.6rem; padding: 0 0 0 .5rem; border-left: 1px solid var(--app-sidebar-line); border-radius: 0; }
#sidebar .nav.sub-menu .nav-item { margin: 1px 0; }
#sidebar .nav.sub-menu .nav-item::before { display: none; }
#sidebar .nav.sub-menu .nav-item .nav-link { min-height: 32px; padding: .4rem .65rem; font-size: .86rem; font-weight: 400; line-height: 1.2; color: var(--app-sidebar-text); }
#sidebar .nav.sub-menu .nav-item .nav-link.active { background: var(--app-sidebar-active-bg); color: #fff; font-weight: 600; box-shadow: 0 2px 6px rgba(0, 0, 0, .25); }

/* logout - quiet row at the bottom, turns red on hover */
#sidebar .sidebar-logout-wrap { margin-top: auto; padding: .5rem; border-top: 1px solid var(--app-sidebar-line); }
#sidebar .sidebar-logout-wrap .btn { width: 100%; display: flex; align-items: center; justify-content: center; gap: .5rem; background: var(--app-sidebar-hover-tint) !important; border: 0 !important; color: var(--app-sidebar-text) !important; font-weight: 500; }
#sidebar .sidebar-logout-wrap .btn:hover { background: var(--app-danger) !important; color: #fff !important; }

/* icon-only (collapsed) menu on laptops: centred icons, fly-out on hover */
@media (min-width: 992px) {
  .sidebar-icon-only #sidebar .nav:not(.sub-menu) { margin: .6rem .4rem 0; }
  .sidebar-icon-only #sidebar .nav .nav-item .nav-link { justify-content: center; padding: .5rem 0; }
  .sidebar-icon-only #sidebar .nav .nav-item .nav-link i.menu-icon { margin-right: 0; }
  .sidebar-icon-only #sidebar .nav .nav-item .nav-link i.menu-arrow { display: none; }
  /* fly-outs are position:fixed (top/left set by liri_app.js) so the scrolling menu list can't clip them */
  .sidebar-icon-only #sidebar .nav .nav-item.hover-open .nav-link .menu-title {
    position: fixed !important; z-index: 1050; margin-left: 0 !important; bottom: auto !important; height: auto !important; background: var(--app-sidebar-bg); color: var(--app-sidebar-strong); border-radius: 0 6px 0 0; padding: .5rem .9rem; width: 190px; box-shadow: 4px 4px 14px rgba(0, 0, 0, .3);
  }
  .sidebar-icon-only #sidebar .nav .nav-item.hover-open .collapse,
  .sidebar-icon-only #sidebar .nav .nav-item.hover-open .collapsing { position: fixed !important; z-index: 1050; bottom: auto !important; height: auto !important; overflow-y: auto; width: 190px; background: var(--app-sidebar-bg); border-radius: 0 0 6px 0; box-shadow: 4px 8px 14px rgba(0, 0, 0, .3); }
  /* a menu with no sub-menu: the title alone gets both right corners rounded */
  .sidebar-icon-only #sidebar .nav .nav-item.hover-open:not(:has(.collapse)) .nav-link .menu-title { border-radius: 0 6px 6px 0; }
  .sidebar-icon-only #sidebar .nav.sub-menu { margin: 0; padding: .25rem .4rem .4rem; border-left: 0; }
  .sidebar-icon-only #sidebar .nav.sub-menu .nav-item .nav-link { justify-content: flex-start; padding: .4rem .65rem; }
  .sidebar-icon-only #sidebar .sidebar-logout-text { display: none; }
}
/* off-canvas menu on tablets / phones: slide in from the right with backdrop */
@media (max-width: 991.98px) {
  .sidebar-offcanvas { top: 50px; height: calc(100vh - 50px); box-shadow: -6px 0 24px rgba(0, 0, 0, .25); z-index: 1040; }
  body.app-menu-open::after { content: ""; position: fixed; inset: 50px 0 0 0; background: rgba(0, 0, 0, .35); z-index: 1030; }
}
.main-panel { margin-left: auto; margin-top: auto; }


/* -----------------------------------------------------------------------------
 * 7. CARDS, PANELS, KPI TILES (dashboard)
 * -------------------------------------------------------------------------- */
.card { --bs-card-bg: var(--app-surface); --bs-card-border-color: var(--app-border); --bs-card-border-radius: var(--app-radius); --bs-card-title-color: var(--app-text); box-shadow: var(--app-shadow); color: var(--app-text); }
.card .card-body { padding: 1rem 1.1rem; }
.card .card-title { font-size: .95rem; font-weight: 600; margin-bottom: .75rem; text-transform: none; color: var(--app-text); }
.app-panel { background: var(--app-surface); border: 1px solid var(--app-border); border-radius: var(--app-radius); box-shadow: var(--app-shadow); padding: .9rem 1rem; }
.app-page-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .5rem; margin-bottom: .75rem; }
.app-page-head h4 { margin: 0; font-weight: 600; font-size: 1.15rem; }

.kpi-tile { background: var(--app-surface); border: 1px solid var(--app-border); border-radius: var(--app-radius); box-shadow: var(--app-shadow); padding: .9rem 1rem; height: 100%; display: flex; gap: .85rem; align-items: center; }
.kpi-tile .kpi-icon { width: 44px; height: 44px; flex: 0 0 44px; border-radius: 10px; display: grid; place-items: center; background: var(--app-primary-soft); color: var(--app-primary); font-size: 1.15rem; }
.kpi-tile .kpi-label { font-size: .8rem; color: var(--app-text-muted); font-weight: 500; text-transform: uppercase; letter-spacing: .03em; }
.kpi-tile .kpi-value { font-size: 1.6rem; font-weight: 700; line-height: 1.15; font-variant-numeric: tabular-nums; color: var(--app-text); }
.kpi-tile .kpi-sub { font-size: .78rem; color: var(--app-text-muted); }
.kpi-tile.kpi-warning .kpi-icon { background: rgba(201, 138, 18, .14); color: var(--app-warning); }
.kpi-tile.kpi-danger  .kpi-icon { background: rgba(200, 66, 59, .14);  color: var(--app-danger); }
.kpi-tile.kpi-success .kpi-icon { background: rgba(47, 143, 91, .14);  color: var(--app-success); }
.chart-box { position: relative; height: 280px; }
@media (max-width: 575.98px) { .chart-box { height: 230px; } .kpi-tile .kpi-value { font-size: 1.35rem; } }

.status-dot { display: inline-block; width: .55rem; height: .55rem; border-radius: 50%; margin-right: .35rem; vertical-align: middle; }
.badge-status { font-weight: 600; font-size: .75rem; padding: .3em .6em; border-radius: 6px; }
.badge-status.ok   { background: rgba(47, 143, 91, .15);  color: var(--app-success); }
.badge-status.warn { background: rgba(201, 138, 18, .16); color: var(--app-warning); }
.badge-status.alarm{ background: rgba(200, 66, 59, .15);  color: var(--app-danger); }
.badge-status.info { background: rgba(var(--app-primary-rgb), .14); color: var(--app-primary); }


/* -----------------------------------------------------------------------------
 * 8. TABLES (liri_table output)
 * -------------------------------------------------------------------------- */
.table { --bs-table-bg: var(--app-surface); --bs-table-color: var(--app-text); --bs-table-border-color: var(--app-border); --bs-table-hover-bg: var(--app-table-hover); --bs-table-hover-color: var(--app-text); --bs-table-striped-bg: var(--app-surface-2); color: var(--app-text); font-variant-numeric: tabular-nums; }
.table > :not(caption) > * > * { border-color: var(--app-border); }
.table td, .table th { font-size: .88rem; vertical-align: middle; }
.table-sm td, .table-sm th { padding: .5rem .5rem !important; }
.table thead td, .table thead th { white-space: nowrap; }
.table-header-bg > th, .table-header-bg > td,
.table-dark.table-header-bg > th, .table-dark.table-header-bg > td {
  color: var(--app-table-head-text) !important;
  background-color: var(--app-table-head-bg) !important;
  border-color: var(--app-table-head-border) !important;
  font-weight: 600; font-size: .82rem; text-transform: uppercase; letter-spacing: .02em;
}
.table-header-bg { border-color: var(--app-table-head-bg) !important; }
.table-responsive { border-radius: 8px; background: var(--app-surface); -webkit-overflow-scrolling: touch; }
table.rounded-top-4 { border-top-left-radius: .7rem !important; border-top-right-radius: .7rem !important; }
/* liri_table type-3 total rows */
.table > thead:last-child > tr > td { background: var(--app-surface-2); font-weight: 700; }
/* Results area wrapper used by every search page */
.app-result-wrap { background: var(--app-surface); border: 1px solid var(--app-border); border-radius: var(--app-radius); padding: .5rem .75rem; box-shadow: var(--app-shadow); }
.table .row-action { white-space: nowrap; }
.table .row-action i { font-size: 1rem; padding: .35rem; }


/* -----------------------------------------------------------------------------
 * 9. FORMS (liri_form output) + bootstrap-select
 * -------------------------------------------------------------------------- */
.form-control, .form-select, .input-group-text {
  background-color: var(--app-surface); color: var(--app-text); border-color: var(--app-border);
}
.form-control:focus, .form-select:focus {
  background-color: var(--app-surface); color: var(--app-text);
  border-color: var(--app-primary); box-shadow: 0 0 0 .2rem rgba(var(--app-primary-rgb), .18);
}
.form-control::placeholder { color: var(--app-text-muted); opacity: .75; }
.form-control-sm, .input-group-sm > .form-control { min-height: 2.15rem; padding: .35rem .6rem; font-size: .9rem; }
.input-group-sm > .input-group-text { font-size: .85rem; color: var(--app-text-muted); background: var(--app-surface-2); font-weight: 500; }
select.form-select { border: 1px solid var(--app-border); outline: none; color: var(--app-text); }
.input-group-sm > .form-select { padding-right: 1.8rem; }
.was-validated .form-control:invalid, .form-control.is-invalid { border-color: var(--app-danger); }
/* Skydash hides native check boxes (expects an extra <i class="input-helper">) - show them */
.form-check .form-check-label input.form-check-input[type="checkbox"],
.form-check label > input.form-check-input[type="checkbox"] { position: static; opacity: 1; margin: 0 .45rem 0 0; float: none; vertical-align: -2px; }
.form-check-input:checked { background-color: var(--app-primary); border-color: var(--app-primary); }
label.required::after, .input-group-text.required::after { content: " *"; color: var(--app-danger); }

/* bootstrap-select (type-to-search dropdowns) */
.bootstrap-select { background-image: none; padding: 0 !important; }
.bootstrap-select > .dropdown-toggle { background: var(--app-surface) !important; color: var(--app-text) !important; border: 1px solid var(--app-border) !important; min-height: 2.15rem; }
.bootstrap-select > .dropdown-toggle.bs-placeholder { color: var(--app-text-muted) !important; padding-top: .45rem !important; padding-bottom: .45rem !important; }
.bootstrap-select .dropdown-menu { background: var(--app-surface); border-color: var(--app-border); box-shadow: 0 8px 24px rgba(0, 0, 0, .15); }
.bootstrap-select .dropdown-menu .dropdown-item { color: var(--app-text); }
.bootstrap-select .dropdown-menu .dropdown-item:hover { background: var(--app-primary-soft); }
.bootstrap-select .dropdown-menu .dropdown-item.active,
.bootstrap-select .dropdown-menu .dropdown-item:active { background-color: var(--app-primary) !important; color: #fff !important; }
.bootstrap-select:not([class*=col-]):not([class*=form-control]):not(.input-group-btn) { width: auto !important; }
.input-group > .bootstrap-select { flex: 1 1 auto; width: 1% !important; }
.bs-searchbox > input { padding: .5rem .8rem; }
.form-select option:checked, .form-select option:hover { background-color: var(--app-primary) !important; color: #fff !important; }

/* Type-to-search (liri-ajax-select -> jQuery UI autocomplete) */
.ui-autocomplete { max-height: 300px; overflow-y: auto; overflow-x: hidden; z-index: 2000 !important; background: var(--app-surface) !important; color: var(--app-text); border: 1px solid var(--app-border) !important; border-radius: 8px; box-shadow: 0 8px 24px rgba(0, 0, 0, .15); padding: .25rem 0; font-family: var(--bs-body-font-family); font-size: .9rem; }
.ui-autocomplete .ui-menu-item-wrapper { padding: .45rem .8rem; border: 0 !important; margin: 0 !important; }
.ui-autocomplete .ui-menu-item-wrapper.ui-state-active { background: var(--app-primary) !important; color: #fff !important; }
.ui-autocomplete .ui-menu-item-wrapper.ui-state-active small { color: rgba(255, 255, 255, .8) !important; }
.ui-autocomplete .ui-state-disabled { opacity: .7; padding: .45rem .8rem; }
@media (pointer: coarse) { .ui-autocomplete .ui-menu-item-wrapper { padding: .7rem .9rem; } }
.liri-ajax-text { background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 512 512'%3e%3cpath fill='%238a99ab' d='M416 208c0 45.9-14.9 88.3-40 122.7l126.6 126.7a32 32 0 0 1-45.3 45.3L330.7 376c-34.4 25.2-76.8 40-122.7 40C93.1 416 0 322.9 0 208S93.1 0 208 0s208 93.1 208 208zM208 352a144 144 0 1 0 0-288 144 144 0 1 0 0 288z'/%3e%3c/svg%3e"); background-repeat: no-repeat; background-position: right .6rem center; background-size: .8rem; padding-right: 1.8rem !important; }

/* Inline entry forms (Quick Entry page) */
.app-entry-form { background: var(--app-surface); border: 1px solid var(--app-border); border-radius: var(--app-radius); box-shadow: var(--app-shadow); padding: 1rem; }
.app-entry-form .form-section-title { font-size: .8rem; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--app-text-muted); margin: .25rem 0 .5rem; }
.liri-inline-msg:empty { display: none; }

/* Small screens: let long labels shrink instead of squeezing the input */
@media (max-width: 575.98px) {
  .input-group-sm > .input-group-text[class*=" w-"],
  .input-group-sm > .input-group-text[class^="w-"] { width: auto !important; min-width: 92px; max-width: 42%; white-space: normal; text-align: left; }
}

/* TOUCH DEVICES (tablets / phones): bigger tap targets, no hover-only actions */
@media (pointer: coarse) {
  .btn, .btn-sm { min-height: 40px; padding-left: .85rem; padding-right: .85rem; }
  .form-control, .form-select, .form-control-sm, .form-select-sm,
  .input-group-sm > .form-control, .input-group-sm > .form-select,
  .bootstrap-select > .dropdown-toggle { min-height: 42px; font-size: 1rem; }  /* 16px stops iOS zoom-on-focus */
  .input-group-sm > .input-group-text { min-height: 42px; }
  .table .row-action i, .table i.pointer { font-size: 1.15rem; padding: .5rem; }
  .bootstrap-select .dropdown-menu .dropdown-item { padding-top: .6rem; padding-bottom: .6rem; }
  .form-check-input { width: 1.25em; height: 1.25em; }
}


/* -----------------------------------------------------------------------------
 * 10. BUTTONS + COLOUR UTILITIES (mapped to palette)
 * -------------------------------------------------------------------------- */
.btn { border-radius: 6px; font-weight: 500; }
.btn.btn-sm { border-radius: 6px; padding: .35rem .7rem; font-size: .85rem; }
.btn-primary { --bs-btn-bg: var(--app-primary); --bs-btn-border-color: var(--app-primary); --bs-btn-hover-bg: var(--app-primary-hover); --bs-btn-hover-border-color: var(--app-primary-hover); --bs-btn-active-bg: var(--app-primary-hover); background-color: var(--app-primary) !important; border-color: var(--app-primary) !important; color: #fff !important; }
.btn-primary:hover { background-color: var(--app-primary-hover) !important; }
.btn-success { background-color: var(--app-success) !important; border-color: var(--app-success) !important; color: #fff !important; }
.btn-danger  { background-color: var(--app-danger)  !important; border-color: var(--app-danger)  !important; color: #fff !important; }
.btn-warning { background-color: var(--app-warning) !important; border-color: var(--app-warning) !important; color: #fff !important; }
.btn-secondary { background-color: var(--app-surface-2) !important; border-color: var(--app-border) !important; color: var(--app-text) !important; }
.btn-light { background-color: var(--app-surface-2) !important; border-color: var(--app-border) !important; color: var(--app-text) !important; }
.btn-outline-primary { color: var(--app-primary); border-color: var(--app-primary); }
.btn-outline-success { color: var(--app-success); border-color: var(--app-success); }
.btn-outline-danger  { color: var(--app-danger);  border-color: var(--app-danger); }
.btn-outline-dark, .btn-outline-secondary { color: var(--app-text); border-color: var(--app-border); background: var(--app-surface); }
.btn-outline-primary:hover { background-color: var(--app-primary) !important; color: #fff !important; }
.btn-outline-success:hover { background-color: var(--app-success) !important; color: #fff !important; }
.btn-outline-danger:hover  { background-color: var(--app-danger)  !important; color: #fff !important; }
.btn-outline-dark:hover, .btn-outline-secondary:hover { background: var(--app-primary-soft) !important; color: var(--app-primary) !important; border-color: var(--app-primary) !important; }

.bg-primary { background-color: var(--app-primary) !important; }
.bg-success { background-color: var(--app-success) !important; }
.bg-danger  { background-color: var(--app-danger)  !important; }
.bg-warning { background-color: var(--app-warning) !important; }
.text-primary { color: var(--app-primary) !important; }
.text-success { color: var(--app-success) !important; }
.text-danger  { color: var(--app-danger)  !important; }
.text-warning { color: var(--app-warning) !important; }
.alert-danger  { background: rgba(200, 66, 59, .12); color: var(--app-danger);  border-color: rgba(200, 66, 59, .35); }
.alert-success { background: rgba(47, 143, 91, .12); color: var(--app-success); border-color: rgba(47, 143, 91, .35); }
.alert-warning { background: rgba(201, 138, 18, .12); color: var(--app-warning); border-color: rgba(201, 138, 18, .35); }
.alert-info    { background: rgba(var(--app-primary-rgb), .10); color: var(--app-primary); border-color: rgba(var(--app-primary-rgb), .3); }


/* -----------------------------------------------------------------------------
 * 11. MODALS (liri_form modal forms)
 * -------------------------------------------------------------------------- */
.modal-content { background: var(--app-surface); color: var(--app-text); border: 1px solid var(--app-border); border-radius: var(--app-radius); }
.modal-header, .modal-footer { border-color: var(--app-border); }
.modal-dialog-medium-size { width: 80% !important; max-width: 920px !important; }
.modal-dialog-large-size  { width: 100% !important; max-width: 1400px !important; }
@media (max-width: 767.98px) {
  .modal-dialog-medium-size, .modal-dialog-large-size { width: auto !important; margin: .5rem; }
  .modal-dialog { margin: .5rem; }
}
[data-bs-theme="dark"] .btn-close { filter: invert(1) grayscale(100%) brightness(200%); }


/* -----------------------------------------------------------------------------
 * 12. LOGIN PAGE
 * -------------------------------------------------------------------------- */
.content-wrapper.auth { padding: 0 !important; min-height: 100vh; }
.auth .auth-form-transparent { max-width: 400px; width: 100%; }
.auth.auth-img-bg, .auth .auth-form-col { background: var(--app-surface); }
.auth .login-half-bg { background-size: cover; background-position: center; position: relative; }
.auth .login-half-bg::before { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(15, 39, 64, .35), rgba(15, 39, 64, .85)); }
.auth .login-half-bg > * { position: relative; }
.auth .brand-logo img { max-height: 40px; width: auto; max-width: 100%; }
.auth h4 { font-weight: 700; }
.auth .form-control-lg { min-height: 46px; font-size: 1rem; padding: .6rem .9rem; }


/* -----------------------------------------------------------------------------
 * 13. WIDTH / HEIGHT HELPERS (kept from previous template - used in forms)
 *     .w-<px>p  e.g. .w-140p = 140px     .w-p<n> e.g. .w-p50 = 50%
 *     .h-<px>p  e.g. .h-200p = 200px     .h-p<n> e.g. .h-p50 = 50%
 * -------------------------------------------------------------------------- */
.w-0p{width:0!important}.w-5p{width:5px!important}.w-10p{width:10px!important}.w-15p{width:15px!important}.w-20p{width:20px!important}.w-25p{width:25px!important}.w-30p{width:30px!important}.w-35p{width:35px!important}.w-40p{width:40px!important}.w-45p{width:45px!important}.w-50p{width:50px!important}.w-55p{width:55px!important}.w-60p{width:60px!important}.w-65p{width:65px!important}.w-70p{width:70px!important}.w-75p{width:75px!important}.w-80p{width:80px!important}.w-85p{width:85px!important}.w-90p{width:90px!important}.w-95p{width:95px!important}.w-100p{width:100px!important}.w-105p{width:105px!important}.w-110p{width:110px!important}.w-115p{width:115px!important}.w-120p{width:120px!important}.w-125p{width:125px!important}.w-130p{width:130px!important}.w-135p{width:135px!important}.w-140p{width:140px!important}.w-145p{width:145px!important}.w-150p{width:150px!important}.w-155p{width:155px!important}.w-160p{width:160px!important}.w-165p{width:165px!important}.w-170p{width:170px!important}.w-175p{width:175px!important}.w-180p{width:180px!important}.w-185p{width:185px!important}.w-190p{width:190px!important}.w-195p{width:195px!important}.w-200p{width:200px!important}.w-210p{width:210px!important}.w-220p{width:220px!important}.w-230p{width:230px!important}.w-240p{width:240px!important}.w-250p{width:250px!important}.w-260p{width:260px!important}.w-270p{width:270px!important}.w-280p{width:280px!important}.w-290p{width:290px!important}.w-300p{width:300px!important}.w-320p{width:320px!important}.w-340p{width:340px!important}.w-360p{width:360px!important}.w-380p{width:380px!important}.w-400p{width:400px!important}.w-450p{width:450px!important}.w-500p{width:500px!important}
.w-p5{width:5%!important}.w-p10{width:10%!important}.w-p15{width:15%!important}.w-p20{width:20%!important}.w-p25{width:25%!important}.w-p30{width:30%!important}.w-p33{width:33.333%!important}.w-p35{width:35%!important}.w-p40{width:40%!important}.w-p45{width:45%!important}.w-p50{width:50%!important}.w-p55{width:55%!important}.w-p60{width:60%!important}.w-p65{width:65%!important}.w-p66{width:66.666%!important}.w-p70{width:70%!important}.w-p75{width:75%!important}.w-p80{width:80%!important}.w-p85{width:85%!important}.w-p90{width:90%!important}.w-p95{width:95%!important}.w-p100{width:100%!important}
.h-0p{height:0!important}.h-20p{height:20px!important}.h-30p{height:30px!important}.h-40p{height:40px!important}.h-50p{height:50px!important}.h-60p{height:60px!important}.h-80p{height:80px!important}.h-100p{height:100px!important}.h-120p{height:120px!important}.h-150p{height:150px!important}.h-200p{height:200px!important}.h-250p{height:250px!important}.h-300p{height:300px!important}.h-350p{height:350px!important}.h-400p{height:400px!important}.h-450p{height:450px!important}.h-500p{height:500px!important}
.h-p10{height:10%!important}.h-p25{height:25%!important}.h-p50{height:50%!important}.h-p75{height:75%!important}.h-p100{height:100%!important}


/* -----------------------------------------------------------------------------
 * 14. PRINT  (always prints light, black borders, no menus)
 * -------------------------------------------------------------------------- */
@media print {
  :root, [data-bs-theme] { --app-bg:#fff; --app-surface:#fff; --app-surface-2:#fff; --app-text:#000; --app-border:#000; --app-table-head-bg:#fff; --app-table-head-text:#000; --app-table-head-border:#000; }
  .table > thead > tr > th, .table > thead > tr > td, .table > tbody > tr > th, .table > tbody > tr > td,
  .table > tr > th, .table > tr > td, .table > tr, .table > thead, .table > tbody, .table > thead > tr, .table > tbody > tr, .table {
    border-color: #000 !important; color: #000 !important; border-radius: 0 !important;
  }
  .table-responsive { margin-top: 5px !important; overflow: visible !important; }
  .main-panel, .page-body-wrapper, .container-scroller { width: 100% !important; padding: 0 !important; margin: 0 !important; }
  .app-panel, .card, .kpi-tile, .app-result-wrap { box-shadow: none !important; border-color: #999 !important; }
}

/* -----------------------------------------------------------------------------
 * 15. ICON FONT FIXES - Skydash draws carets/arrows with the Themify font, which
 *     this template no longer loads. Use Font Awesome (local) instead.
 * -------------------------------------------------------------------------- */
.dropdown .dropdown-toggle:after,
.bootstrap-select > .dropdown-toggle:after { font: normal normal 900 .65rem/1 "Font Awesome 7 Free"; content: "\f078"; border: 0; vertical-align: middle; margin-left: .4rem; }
.accordion > .card .card-header a:before { font-family: "Font Awesome 7 Free"; font-weight: 900; }

/* -----------------------------------------------------------------------------
 * 16. RESPONSIVE HELPERS + SMALL-SCREEN FIXES
 *     .app-hide-sm  hidden < 576px   .app-hide-md  hidden < 768px   .app-hide-lg hidden < 1200px
 *     (Skydash forces display:flex on navbar items, so Bootstrap d-none does not work there)
 * -------------------------------------------------------------------------- */
@media (max-width: 575.98px)  { .app-hide-sm, .navbar .navbar-menu-wrapper .navbar-nav.navbar-nav-right .nav-item.app-hide-sm { display: none !important; } }
@media (max-width: 767.98px)  { .app-hide-md, .navbar .navbar-menu-wrapper .navbar-nav.navbar-nav-right .nav-item.app-hide-md { display: none !important; } }
@media (max-width: 1199.98px) { .app-hide-lg, .navbar .navbar-menu-wrapper .navbar-nav.navbar-nav-right .nav-item.app-hide-lg { display: none !important; } }
.navbar .navbar-menu-wrapper .navbar-nav .nav-item { margin-left: .15rem; margin-right: .15rem; }
@media (max-width: 991.98px) {
  .navbar .navbar-menu-wrapper { padding-left: .5rem; padding-right: .5rem; }
  #liri_skydash_divid_top_nav_title { font-size: .95rem; }
  .content-wrapper { padding: .75rem !important; }
}
@media (max-width: 575.98px) {
  .content-wrapper { padding: .5rem !important; }
  .app-topbar-btn { width: 34px; height: 34px; margin-left: .2rem; }
  .card .card-body { padding: .8rem; }
}
.form-check.form-switch { display: flex; align-items: center; gap: .45rem; padding-left: 0; margin: 0; }
.form-check.form-switch .form-check-input { float: none; margin: 0; position: static; opacity: 1; width: 2.2em; height: 1.2em; }
.badge-status { white-space: nowrap; display: inline-block; }
.input-group > .bootstrap-select { flex: 1 1 0% !important; min-width: 0 !important; width: 1% !important; }
.bootstrap-select .filter-option-inner-inner { overflow: hidden; text-overflow: ellipsis; }


/* =============================================================================
 * 17. COMPACT DENSITY  (default - <html data-app-density="compact">)
 *     For MES / production screens: MORE CONTENT PER SCREEN by using smaller
 *     text, while KEEPING COMFORTABLE GAPS (cards, rows and fields never touch).
 *     Rule of thumb: font sizes shrink ~10%, spacing shrinks only a little.
 *     Tune: html font-size (text), --app-gap (space between cards / tiles),
 *     --app-nav-h (top bar), --app-sb-w (sidebar width).
 * ========================================================================== */
[data-app-density="compact"] {
  --app-nav-h: 46px;          /* top bar height            (comfortable: 50px)  */
  --app-sb-w: 225px;          /* sidebar width on laptops  (comfortable: 245px) */
  --app-gap: .85rem;          /* gap between cards / tiles (~12px)              */
}
html[data-app-density="compact"] { font-size: 13.5px; }      /* comfortable: 15px */

/* ---- shell ---- */
[data-app-density="compact"] .navbar .navbar-brand-wrapper,
[data-app-density="compact"] .navbar .navbar-menu-wrapper { height: var(--app-nav-h); }
[data-app-density="compact"] .page-body-wrapper { padding-top: var(--app-nav-h); min-height: calc(100vh - var(--app-nav-h)); }
[data-app-density="compact"] .main-panel, [data-app-density="compact"] .sidebar { min-height: calc(100vh - var(--app-nav-h)); }
[data-app-density="compact"] .content-wrapper { padding: .9rem 1rem !important; min-height: calc(100vh - var(--app-nav-h) - 38px); }
[data-app-density="compact"] .footer { padding: .45rem 1rem; }
[data-app-density="compact"] .navbar .navbar-brand-wrapper .navbar-brand img { height: 24px; }
[data-app-density="compact"] .app-topbar-btn { width: 32px; height: 32px; }
@media (min-width: 992px) {
  [data-app-density="compact"] body:not(.sidebar-icon-only) .sidebar,
  [data-app-density="compact"] body:not(.sidebar-icon-only) .navbar .navbar-brand-wrapper { width: var(--app-sb-w); }
  [data-app-density="compact"] body:not(.sidebar-icon-only) .main-panel,
  [data-app-density="compact"] body:not(.sidebar-icon-only) .navbar .navbar-menu-wrapper { width: calc(100% - var(--app-sb-w)); }
}
@media (max-width: 991.98px) {
  [data-app-density="compact"] .sidebar-offcanvas { top: var(--app-nav-h); height: calc(100vh - var(--app-nav-h)); max-height: calc(100vh - var(--app-nav-h)); }
  [data-app-density="compact"] body.app-menu-open::after { top: var(--app-nav-h); }
  [data-app-density="compact"] .content-wrapper { padding: .65rem !important; }
}
[data-app-density="compact"] #sidebar-nav { height: calc(100vh - var(--app-nav-h) - 56px); }

/* ---- gaps between cards / tiles stay clear ---- */
[data-app-density="compact"] #liri_skydash_divid_content .g-3,
[data-app-density="compact"] #liri_skydash_divid_content .g-4 { --bs-gutter-x: var(--app-gap); --bs-gutter-y: var(--app-gap); }
[data-app-density="compact"] #liri_skydash_divid_content .mb-3 { margin-bottom: var(--app-gap) !important; }

/* ---- cards / panels / KPI tiles: smaller text, normal breathing room ---- */
[data-app-density="compact"] .card .card-body { padding: .85rem 1rem; }
[data-app-density="compact"] .card .card-title { font-size: .9rem; margin-bottom: .6rem; }
[data-app-density="compact"] .app-panel, [data-app-density="compact"] .app-entry-form { padding: .85rem 1rem; }
[data-app-density="compact"] .app-result-wrap { padding: .5rem .7rem; }
[data-app-density="compact"] .kpi-tile { padding: .8rem .9rem; }
[data-app-density="compact"] .kpi-tile .kpi-icon { width: 40px; height: 40px; flex-basis: 40px; }
[data-app-density="compact"] .kpi-tile .kpi-value { font-size: 1.45rem; }
[data-app-density="compact"] .chart-box { height: 250px; }

/* ---- tables: smaller text, clear row padding (~30px rows) ---- */
[data-app-density="compact"] .table td, [data-app-density="compact"] .table th { font-size: .86rem; }
[data-app-density="compact"] .table-sm td, [data-app-density="compact"] .table-sm th { padding: .42rem .55rem !important; }
[data-app-density="compact"] .table-header-bg > th, [data-app-density="compact"] .table-header-bg > td { font-size: .74rem !important; }

/* ---- forms: smaller text, controls ~31px, clear gap between rows ---- */
[data-app-density="compact"] .form-control-sm,
[data-app-density="compact"] .input-group-sm > .form-control,
[data-app-density="compact"] .input-group-sm > .form-select,
[data-app-density="compact"] .form-select-sm,
[data-app-density="compact"] .bootstrap-select > .dropdown-toggle { min-height: 2.3rem; font-size: .9rem; }
[data-app-density="compact"] .input-group-sm > .input-group-text { font-size: .82rem; }
[data-app-density="compact"] .btn.btn-sm { font-size: .82rem; padding: .32rem .7rem; }

/* ---- touch devices: >= 38px tap targets, 16px input text (no iOS zoom) ---- */
@media (pointer: coarse) {
  [data-app-density="compact"] .btn, [data-app-density="compact"] .btn-sm { min-height: 38px; }
  [data-app-density="compact"] .form-control, [data-app-density="compact"] .form-select,
  [data-app-density="compact"] .form-control-sm, [data-app-density="compact"] .form-select-sm,
  [data-app-density="compact"] .input-group-sm > .form-control, [data-app-density="compact"] .input-group-sm > .form-select,
  [data-app-density="compact"] .bootstrap-select > .dropdown-toggle { min-height: 38px; font-size: 16px; }
  [data-app-density="compact"] .input-group-sm > .input-group-text { min-height: 38px; font-size: .82rem; }
}
/* phones: keep table rows on one line and scroll sideways instead of tall wrapped rows */
@media (max-width: 767.98px) {
  [data-app-density="compact"] .table td, [data-app-density="compact"] .table th { white-space: nowrap; }
}


/* =============================================================================
 * 18. LIRI_FORM CONTAINERS + PAGE MARGINS
 *     liri_form wraps the search form and results in its own boxes:
 *       .lbs5_search_form_outer / .lbs5_search_result_outer / .lbs5_search_result_item_inner
 *     (they carry "bg-white" - themed here so dark mode works)
 * ========================================================================== */
#liri_skydash_divid_content { padding-left: 1.25rem !important; padding-right: 1.25rem !important; }
@media (max-width: 991.98px) { #liri_skydash_divid_content { padding-left: .75rem !important; padding-right: .75rem !important; } }
@media (max-width: 575.98px) { #liri_skydash_divid_content { padding-left: .5rem !important; padding-right: .5rem !important; } }
/* page-level rows: no negative margins / column padding, so every page lines up with the
   content padding above (rows with g-* gutters - dashboards - keep their own spacing) */
#liri_skydash_divid_content > .row:not([class*="g-"]) { margin-left: 0; margin-right: 0; }
#liri_skydash_divid_content > .row:not([class*="g-"]) > [class*="col-"] { padding-left: 0; padding-right: 0; }
/* search page wrappers: remove the stacked px-2 + negative row margins so cards line up with the page edges */
#liri_skydash_divid_content [id^="search_form_div_"] { padding-left: 0 !important; padding-right: 0 !important; }
#liri_skydash_divid_content [id^="search_form_div_"] > .container-fluid { padding-left: 0 !important; padding-right: 0 !important; }
#liri_skydash_divid_content .row:has(> .lbs5_search_form_outer),
#liri_skydash_divid_content .row:has(> .lbs5_search_result_outer) { margin-left: 0; margin-right: 0; }
.lbs5_search_form_outer, .lbs5_search_result_outer, .lbs5_search_result_item_inner {
  background: var(--app-surface) !important; color: var(--app-text);
  border: 1px solid var(--app-border); border-radius: var(--app-radius) !important; box-shadow: var(--app-shadow);
}
.lbs5_search_form_outer { padding: 1rem 1.1rem .5rem !important; margin-bottom: var(--app-gap, .85rem) !important; }
.lbs5_search_result_outer { padding: .4rem 1.1rem .6rem !important; margin-bottom: var(--app-gap, .85rem) !important; }
.lbs5_search_result_item_outer { margin-bottom: var(--app-gap, .85rem) !important; }
/* our own result wrapper inside liri_form's result box: no second card */
.lbs5_search_result_outer .app-result-wrap { border: 0; box-shadow: none; padding: 0; background: transparent; }
/* dark theme: Bootstrap "light" utility colours used by libraries */
[data-bs-theme="dark"] .bg-white { background-color: var(--app-surface) !important; }
[data-bs-theme="dark"] .bg-light { background-color: var(--app-surface-2) !important; }
[data-bs-theme="dark"] .text-dark, [data-bs-theme="dark"] .text-black { color: var(--app-text) !important; }
[data-bs-theme="dark"] .table-light, [data-bs-theme="dark"] .table-light > * > * { --bs-table-bg: var(--app-surface-2); color: var(--app-text); }
[data-bs-theme="dark"] .list-group-item, [data-bs-theme="dark"] .dropdown-menu { background-color: var(--app-surface); color: var(--app-text); border-color: var(--app-border); }
[data-bs-theme="dark"] .dropdown-item { color: var(--app-text); }
[data-bs-theme="dark"] .dropdown-item:hover { background: var(--app-primary-soft); color: var(--app-text); }


/* =============================================================================
 * 19. TOP BAR - modern ghost icon buttons + avatar
 * ========================================================================== */
.app-topbar-btn { border: 0; background: transparent; color: var(--app-text-muted); border-radius: 8px; }
.app-topbar-btn:hover { background: var(--app-surface-2); color: var(--app-text); }
.app-topbar-btn.app-avatar { border-radius: 50%; background: var(--app-primary); color: #fff; font-weight: 700; font-size: .75rem; margin-left: .5rem; }
.app-topbar-btn.app-avatar:hover { background: var(--app-primary-hover); color: #fff; }
.app-topbar-sep { width: 1px; height: 22px; background: var(--app-border); margin: 0 .4rem; }
.navbar { box-shadow: none; }
.navbar .navbar-menu-wrapper .navbar-toggler { color: var(--app-text-muted); border-radius: 8px; padding: .3rem .5rem; }
.navbar .navbar-menu-wrapper .navbar-toggler:hover { background: var(--app-surface-2); color: var(--app-text); }
.navbar .navbar-nav .nav-item.dropdown { position: relative; }
/* Bootstrap turns off Popper inside .navbar (menus become position:static and get clipped at the top) -
   anchor them under their button instead */
.navbar .navbar-nav .nav-item.dropdown > .dropdown-menu {
  position: absolute !important; top: calc(100% + 10px) !important; right: 0 !important; left: auto !important;
  margin: 0 !important; transform: none !important; inset: calc(100% + 10px) 0 auto auto !important; z-index: 1060;
}
.navbar .dropdown-menu { border-radius: 10px; border: 1px solid var(--app-border); box-shadow: 0 10px 30px rgba(0, 0, 0, .15); padding: .35rem; min-width: 13rem; }
.navbar .dropdown-menu .dropdown-item { border-radius: 6px; padding: .45rem .7rem; font-size: .88rem; }
.navbar .dropdown-menu .dropdown-header { font-size: .7rem; text-transform: uppercase; letter-spacing: .05em; padding: .4rem .7rem .2rem; }


/* =============================================================================
 * 20. LOGIN - full height, image panel as a rounded inset card
 * ========================================================================== */
.full-page-wrapper, [data-app-density] .full-page-wrapper { padding-top: 0 !important; min-height: 100vh; }
.content-wrapper.auth { padding: 0 !important; min-height: 100vh !important; }
.auth .auth-form-col { min-height: 100vh; }
.auth .login-half-bg {
  margin: 14px; min-height: calc(100vh - 28px); border-radius: 28px; overflow: hidden;
  background-size: cover; background-position: center;
  box-shadow: 0 20px 50px rgba(15, 39, 64, .25);
  flex: 0 0 calc(50% - 28px) !important; max-width: calc(50% - 28px);
}
.auth .login-half-bg::before { background: linear-gradient(160deg, rgba(29, 95, 167, .25) 0%, rgba(15, 39, 64, .55) 45%, rgba(10, 18, 28, .92) 100%); }
.auth .login-hero { position: relative; align-self: flex-end; width: 100%; padding: 2.5rem; color: #fff; }
.auth .login-hero h3 { color: #fff; font-weight: 700; font-size: 1.6rem; margin-bottom: .4rem; }
.auth .login-hero p { color: rgba(255, 255, 255, .8); margin-bottom: 1.25rem; }
.auth .login-hero .login-hero-tags span { display: inline-block; font-size: .78rem; padding: .3rem .7rem; margin: 0 .35rem .35rem 0; border-radius: 999px; background: rgba(255, 255, 255, .12); border: 1px solid rgba(255, 255, 255, .2); }
.auth .login-hero .login-copyright { font-size: .75rem; color: rgba(255, 255, 255, .6); margin-top: 1rem; }


/* =============================================================================
 * 21. FLOATING BOTTOM DOCK - tablets and phones (below 1200px)
 *     Built by liri_skydash_create_dock() (static/js/liri_skydash_menu.js).
 *     Below 1200px the left menu + hamburgers are hidden and the dock takes over.
 *     Change the breakpoint here AND in LIRI_DOCK_MAX_WIDTH (js).
 * ========================================================================== */
.app-dock, .app-dock-pop { display: none; }
@media (max-width: 1199.98px) {
  #sidebar, .navbar [data-toggle="offcanvas"], .navbar [data-toggle="minimize"] { display: none !important; }
  body.app-menu-open::after { display: none; }
  .main-panel, body:not(.sidebar-icon-only) .main-panel, [data-app-density] body:not(.sidebar-icon-only) .main-panel { width: 100% !important; margin-left: 0 !important; }
  .main-panel { padding-bottom: calc(86px + env(safe-area-inset-bottom)); }
  .navbar .navbar-brand-wrapper, [data-app-density] body:not(.sidebar-icon-only) .navbar .navbar-brand-wrapper { width: auto !important; padding-right: .5rem; }
  .navbar .navbar-menu-wrapper, [data-app-density] body:not(.sidebar-icon-only) .navbar .navbar-menu-wrapper { width: auto !important; flex: 1 1 auto; }

  .app-dock {
    display: flex; gap: 4px; position: fixed; z-index: 1035; left: 50%; transform: translateX(-50%);
    bottom: calc(12px + env(safe-area-inset-bottom)); padding: 6px;
    background: var(--app-surface); border: 1px solid var(--app-border); border-radius: 18px;
    box-shadow: 0 10px 30px rgba(15, 39, 64, .18), 0 2px 6px rgba(15, 39, 64, .08);
    max-width: calc(100vw - 16px);
  }
  .app-dock-btn {
    width: 76px; height: 54px; border: 0; background: transparent; border-radius: 12px;
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
    color: var(--app-text-muted); font-size: .72rem; font-weight: 500; line-height: 1.1;
  }
  .app-dock-btn i { font-size: 1.15rem; }
  .app-dock-btn span { max-width: 70px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .app-dock-btn:hover, .app-dock-btn.open { background: var(--app-surface-2); color: var(--app-text); }
  .app-dock-btn.active { background: var(--app-primary-soft); color: var(--app-primary); }

  /* pop-up above the dock, with a small arrow pointing at the tapped button */
  .app-dock-pop {
    position: fixed; z-index: 1036; width: 250px;
    padding: 0; background: var(--app-surface); border: 1px solid var(--app-border); border-radius: 14px;
    box-shadow: 0 14px 40px rgba(15, 39, 64, .22);
    opacity: 0; transform: translateY(6px); pointer-events: none; transition: opacity .15s ease, transform .15s ease;
  }
  .app-dock-pop.show { display: block; opacity: 1; transform: none; pointer-events: auto; }
  .app-dock-pop:not(.show) { display: block; visibility: hidden; }
  .app-dock-pop.show { visibility: visible; }
  .app-dock-pop::after {
    content: ""; position: fixed; width: 12px; height: 12px; background: var(--app-surface);
    border-right: 1px solid var(--app-border); border-bottom: 1px solid var(--app-border);
    transform: rotate(45deg); margin-left: -6px; left: var(--arrow-x, 50%); bottom: -7px; position: absolute;
  }
  /* scroll only when the list is taller than the space above the dock */
  .app-dock-pop-inner { padding: 6px; max-height: calc(100vh - 150px); overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; }
  .app-dock-pop.app-dock-pop-wide { width: 320px; }
  .app-dock-pop-title { font-size: .7rem; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--app-text-muted); padding: .55rem .7rem .3rem; }
  .app-dock-pop-item {
    display: flex; align-items: center; justify-content: space-between; min-height: 40px; padding: .45rem .75rem;
    border-radius: 9px; color: var(--app-text); font-size: .92rem; cursor: pointer; text-decoration: none;
  }
  .app-dock-pop-item:hover { background: var(--app-surface-2); color: var(--app-text); }
  .app-dock-pop-item.active { background: var(--app-primary-soft); color: var(--app-primary); font-weight: 600; }
  .app-dock-pop-item i { font-size: .8rem; }
  .app-dock-pop-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; padding: 2px; }
  .app-dock-pop-tile { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: .6rem .25rem; border-radius: 9px; font-size: .75rem; color: var(--app-text); cursor: pointer; text-decoration: none; }
  .app-dock-pop-tile i { font-size: 1.05rem; }
  .app-dock-pop-tile:hover { background: var(--app-surface-2); }
}
@media (max-width: 575.98px) {
  .app-dock-btn { width: 64px; height: 50px; font-size: .68rem; }
  .app-dock { gap: 2px; padding: 5px; }
}
@media print { .app-dock, .app-dock-pop { display: none !important; } }

/* Accent swatches (top-bar palette menu + dock "More") */
.app-swatches { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; padding: .25rem .5rem .5rem; }
.app-swatch { width: 28px; height: 28px; border-radius: 50%; border: 2px solid var(--app-surface); box-shadow: 0 0 0 1px var(--app-border); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; color: #fff; font-size: .7rem; padding: 0; line-height: 1; justify-self: center; }
/* the navbar dropdown gives icons a right margin - cancel it so the tick sits in the centre */
.app-swatch i, .navbar .dropdown-menu .app-swatch i { margin: 0 !important; width: auto; line-height: 1; }
.app-swatch:hover { transform: scale(1.08); }
.app-swatches-title { font-size: .66rem; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--app-text-muted); padding: .35rem .6rem .1rem; }
.app-swatch-split { box-shadow: 0 0 0 1px var(--app-border), inset 0 0 0 1px rgba(0, 0, 0, .06); }
.app-swatch-split.active { box-shadow: 0 0 0 2px var(--app-text); }
.app-swatch-split i { text-shadow: 0 0 3px rgba(0, 0, 0, .55); }
.app-swatch.active { box-shadow: 0 0 0 2px var(--app-text); }
.navbar .dropdown-menu.app-look-menu { min-width: 236px; }

/* Login fields: icon + input (+ eye button) drawn as ONE rounded field with a single
   border, primary border + soft ring on focus (instead of 3 separately bordered boxes) */
.auth .input-group {
  border: 1px solid var(--app-border); border-radius: 10px; background: var(--app-surface);
  overflow: hidden; flex-wrap: nowrap; transition: border-color .15s ease, box-shadow .15s ease;
}
.auth .input-group:hover { border-color: rgba(var(--app-primary-rgb), .45); }
.auth .input-group:focus-within { border-color: var(--app-primary); box-shadow: 0 0 0 .2rem rgba(var(--app-primary-rgb), .15); }
.auth .input-group > .input-group-text,
.auth .input-group > .form-control,
.auth .input-group > .btn { border: 0 !important; border-radius: 0 !important; background: transparent !important; box-shadow: none !important; }
.auth .input-group > .input-group-text { width: 44px; justify-content: center; padding: 0; color: var(--app-text-muted); }
.auth .input-group > .form-control { min-height: 46px; padding-left: .2rem; font-size: 1rem; }
.auth .input-group > .form-control:focus { outline: 0; }
.auth .input-group > .btn { width: 46px; flex: 0 0 46px; padding: 0 !important; display: flex; align-items: center; justify-content: center; color: var(--app-text-muted) !important; }
.auth .input-group > .btn i { margin: 0; line-height: 1; }
.auth .input-group > .btn:hover { color: var(--app-primary) !important; }
.auth .form-label { font-size: .82rem; font-weight: 600; color: var(--app-text); margin-bottom: .35rem; }
/* "Keep me signed in": checkbox lined up with its text */
.auth .form-check { padding-left: 0; margin: .25rem 0 0; }
.auth .form-check .form-check-label { display: inline-flex; align-items: center; gap: .5rem; margin: 0; cursor: pointer; font-size: .88rem; }
.auth .form-check .form-check-label input.form-check-input { margin: 0 !important; position: static; float: none; width: 1.05em; height: 1.05em; }
.auth .form-check .input-helper { display: none; }
.auth .auth-form-btn { border-radius: 10px; min-height: 46px; letter-spacing: .03em; }

/* =============================================================================
 * 22. LIRI_TABLE PAGER BAR - [page + refresh]  [title / sub-title]  [prev + next]
 * ========================================================================== */
.liri-table-bar { display: flex; align-items: center; gap: .5rem; width: 100%; padding: .45rem 0; flex-wrap: wrap; }
.liri-table-bar-left, .liri-table-bar-right { display: flex; align-items: center; gap: .25rem; flex: 0 0 auto; }
.liri-table-bar-right { margin-left: auto; }
.liri-table-bar.has-title .liri-table-bar-title { flex: 1 1 200px; min-width: 0; text-align: center; order: 0; }
.liri-table-bar-title .liri-table-title { margin: 0 !important; padding: 0 !important; line-height: 1.25; font-size: 1.05rem; }
.liri-table-bar-title .liri-table-subtitle { margin: 0 !important; padding: 0 !important; font-size: .78rem; color: var(--app-text-muted); line-height: 1.3; }
/* phones: title on its own line above the controls */
@media (max-width: 575.98px) {
  .liri-table-bar.has-title .liri-table-bar-title { order: -1; flex-basis: 100%; }
}
@media print {
  .liri-table-bar { padding: 0 0 .3rem; }
  .liri-table-bar-title { flex-basis: 100% !important; }
}
/* sortable headers (liri_table click-to-sort) */
.liri-sort-th { cursor: pointer; user-select: none; white-space: nowrap; }
.liri-sort-th:hover { filter: brightness(1.15); }
.liri-sort-icon { margin-left: .35rem; font-size: .7em; opacity: .45; }
.liri-sort-icon.active { opacity: 1; }
@media print { .liri-sort-icon { display: none; } }
/* quick search box (liri_table) */
.liri-table-qs { position: relative; display: inline-flex; align-items: center; margin-right: .35rem; }
.liri-table-qs > i { position: absolute; left: .6rem; font-size: .75rem; color: var(--app-text-muted); pointer-events: none; }
.liri-table-qs .liri-qs-input { width: 190px; min-height: 2rem; padding: .25rem 3.4rem .25rem 1.8rem; font-size: .85rem; border: 1px solid var(--app-border); border-radius: 8px; background: var(--app-surface); color: var(--app-text); transition: width .15s ease, border-color .15s ease; }
.liri-table-qs .liri-qs-input:focus { outline: 0; width: 240px; border-color: var(--app-primary); box-shadow: 0 0 0 .2rem rgba(var(--app-primary-rgb), .15); }
.liri-table-qs .liri-qs-input::-webkit-search-cancel-button { cursor: pointer; }
.liri-table-qs .liri-qs-count { position: absolute; right: .6rem; font-size: .7rem; color: var(--app-text-muted); pointer-events: none; font-variant-numeric: tabular-nums; }
.liri-table-bar-qs { justify-content: flex-end; }
tr.liri-qs-hidden { display: none !important; }
@media (pointer: coarse) { .liri-table-qs .liri-qs-input { min-height: 38px; font-size: 16px; } }
@media (max-width: 575.98px) { .liri-table-bar-right { width: 100%; justify-content: flex-end; } .liri-table-qs { flex: 1 1 auto; } .liri-table-qs .liri-qs-input, .liri-table-qs .liri-qs-input:focus { width: 100%; } }

/* column chooser (liri_table "Columns" button) */
.liri-cols { position: relative; display: inline-flex; margin-right: .35rem; }
.liri-col-hidden { display: none !important; }
.liri-cols-panel {
  position: absolute; z-index: 1045; top: calc(100% + 6px); right: 0; width: 270px;
  background: var(--app-surface); border: 1px solid var(--app-border); border-radius: 12px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, .18); padding: .4rem; text-align: left;
}
.liri-cols-head { font-size: .7rem; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--app-text-muted); padding: .35rem .5rem; }
.liri-cols-list { max-height: min(55vh, 420px); overflow-y: auto; scrollbar-width: thin; }
.liri-cols-item { display: flex; align-items: center; gap: .4rem; padding: .25rem .4rem; border-radius: 8px; }
.liri-cols-item:hover { background: var(--app-surface-2); }
.liri-cols-item label { flex: 1 1 auto; display: flex; align-items: center; gap: .5rem; margin: 0; cursor: pointer; font-size: .86rem; color: var(--app-text); min-width: 0; }
.liri-cols-item label span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.liri-cols-item .form-check-input { position: static; opacity: 1; margin: 0; flex: 0 0 auto; }
.liri-cols-move { display: inline-flex; gap: 2px; }
.liri-cols-move button { width: 28px; height: 28px; border: 0; border-radius: 6px; background: transparent; color: var(--app-text-muted); display: inline-flex; align-items: center; justify-content: center; font-size: .72rem; padding: 0; }
.liri-cols-move button:hover:not([disabled]) { background: var(--app-primary-soft); color: var(--app-primary); }
.liri-cols-move button[disabled] { opacity: .3; cursor: default; }
.liri-cols-foot { display: flex; justify-content: space-between; gap: .5rem; padding: .45rem .35rem .2rem; border-top: 1px solid var(--app-border); margin-top: .3rem; }
@media (pointer: coarse) { .liri-cols-move button { width: 36px; height: 36px; } .liri-cols-item { padding: .35rem .4rem; } }
@media (max-width: 575.98px) { .liri-cols-panel { position: fixed; left: 8px; right: 8px; top: auto; bottom: 90px; width: auto; } }

/* bootstrap-select inside forms: the wrapper copies the select's "form-select" class and
   drew a second border around the button (double / overlapping border in input groups).
   Only the button keeps a border; corners follow its position in the input group. */
.bootstrap-select.form-select { border: 0 !important; padding: 0 !important; background-image: none !important; background-color: transparent !important; box-shadow: none !important; }
.bootstrap-select > .dropdown-toggle { height: 100%; }
.input-group > .bootstrap-select > .dropdown-toggle { border-radius: 0 !important; }
.input-group > .bootstrap-select:first-child > .dropdown-toggle { border-top-left-radius: var(--bs-border-radius-sm, .25rem) !important; border-bottom-left-radius: var(--bs-border-radius-sm, .25rem) !important; }
.input-group > .bootstrap-select:last-child > .dropdown-toggle { border-top-right-radius: var(--bs-border-radius-sm, .25rem) !important; border-bottom-right-radius: var(--bs-border-radius-sm, .25rem) !important; }
.input-group > .bootstrap-select > .dropdown-toggle:focus,
.input-group > .bootstrap-select.show > .dropdown-toggle { border-color: var(--app-primary) !important; box-shadow: 0 0 0 .2rem rgba(var(--app-primary-rgb), .15) !important; position: relative; z-index: 3; outline: 0 !important; }
.input-group > .input-group-text + .bootstrap-select { margin-left: -1px !important; }


/* liri_table page selector - same size / border / hover as the Refresh, Prev and Next buttons.
   It becomes a bootstrap-select (type a page number to jump); the wrapper copies the button
   classes, so the wrapper is made invisible and only the inner button is styled. */
.bootstrap-select.liri-page-select { border: 0 !important; padding: 0 !important; background: transparent !important; box-shadow: none !important; width: auto !important; height: auto !important; min-height: 0 !important; }
.bootstrap-select.liri-page-select > .dropdown-toggle {
  height: auto; min-height: 0 !important; padding: .35rem .7rem !important; font-size: .85rem !important; line-height: 1rem; font-weight: 500; box-shadow: none !important;
  color: var(--app-text) !important; border: 1px solid var(--app-border) !important; background: var(--app-surface) !important; border-radius: 6px !important;
}
.bootstrap-select.liri-page-select > .dropdown-toggle:hover, .bootstrap-select.liri-page-select.show > .dropdown-toggle, .bootstrap-select.liri-page-select > .dropdown-toggle:focus {
  color: var(--app-primary) !important; border-color: var(--app-primary) !important; background: var(--app-primary-soft) !important; outline: 0 !important;
}
.bootstrap-select.liri-page-select > .dropdown-toggle .filter-option-inner-inner { padding-right: .35rem; }
.bootstrap-select.liri-page-select > .dropdown-toggle::after { margin-left: .1rem; }
[data-app-density="compact"] .bootstrap-select.liri-page-select > .dropdown-toggle { padding: .32rem .7rem !important; font-size: .82rem !important; }
@media (pointer: coarse) { .bootstrap-select.liri-page-select > .dropdown-toggle { min-height: 40px !important; } [data-app-density="compact"] .bootstrap-select.liri-page-select > .dropdown-toggle { min-height: 38px !important; } }
.bootstrap-select.liri-page-select .dropdown-menu { text-align: left; font-size: .85rem; }
/* plain <select> fallback (bootstrap-select not loaded) */
select.liri-page-select { box-shadow: none !important; color: var(--app-text); border-color: var(--app-border) !important; background-color: var(--app-surface); }

/* bootstrap-select: centre the selected text vertically (the button is stretched to the
   field height, but bootstrap-select pins its text block to the top) */
.bootstrap-select > .dropdown-toggle { display: flex !important; align-items: center !important; justify-content: space-between; padding-top: 0 !important; padding-bottom: 0 !important; }
.bootstrap-select > .dropdown-toggle .filter-option { position: static !important; display: flex; align-items: center; flex: 1 1 auto; min-width: 0; height: auto !important; padding: 0 !important; float: none !important; }
.bootstrap-select > .dropdown-toggle .filter-option-inner { flex: 1 1 auto; min-width: 0; padding-right: .25rem; }
.bootstrap-select > .dropdown-toggle .filter-option-inner-inner { line-height: 1.25; white-space: nowrap; }
.bootstrap-select > .dropdown-toggle::after { flex: 0 0 auto; margin-top: 0 !important; }
/* the page selector in the liri_table pager keeps its button-like padding */
.bootstrap-select.liri-page-select > .dropdown-toggle { padding-top: .35rem !important; padding-bottom: .35rem !important; }
[data-app-density="compact"] .bootstrap-select.liri-page-select > .dropdown-toggle { padding-top: .32rem !important; padding-bottom: .32rem !important; }
.bootstrap-select.liri-page-select > .dropdown-toggle .filter-option-inner-inner { line-height: 1rem; }

/* liri_table "Filter rows..." box - same height / corners / font as the pager buttons
   (Page select, Refresh, Columns, Prev, Next) */
.liri-table-qs .liri-qs-input { min-height: 0; height: auto; padding-top: .35rem; padding-bottom: .35rem; line-height: 1rem; font-size: .85rem; border-radius: 6px; }
[data-app-density="compact"] .liri-table-qs .liri-qs-input { padding-top: .32rem; padding-bottom: .32rem; font-size: .82rem; }
.liri-table-qs .liri-qs-input:hover { border-color: var(--app-primary); }
@media (pointer: coarse) { .liri-table-qs .liri-qs-input { min-height: 40px; font-size: 16px; } [data-app-density="compact"] .liri-table-qs .liri-qs-input { min-height: 38px; font-size: 16px; } }

/* Rounded table edges: the 8px rounded wrapper used to clip the cell borders, so the outer
   edge vanished at the corners. The outer border is now drawn by the table itself
   ("separate" border model + radius) and the cells only draw their inner lines. */
.table-responsive { overflow: auto; }
.table-responsive > table.table-bordered {
  border-collapse: separate !important; border-spacing: 0; margin-bottom: 0;
  border: 1px solid var(--app-border) !important; border-top-color: var(--app-table-head-bg) !important;
  border-radius: 8px !important; overflow: hidden;
}
.table-responsive > table.table-bordered > :is(thead, tbody, tfoot) > tr > :is(th, td) { border-width: 0 1px 1px 0 !important; }
.table-responsive > table.table-bordered > :is(thead, tbody, tfoot) > tr > :is(th, td):last-child { border-right-width: 0 !important; }
.table-responsive > table.table-bordered > :is(thead, tbody, tfoot):last-child > tr:last-child > :is(th, td) { border-bottom-width: 0 !important; }
/* sticky floating header copy (liri-sticky): square, no outer border */
.table-responsive > table.table-bordered.tableFloatingHeader { border-radius: 0 !important; border-width: 0 !important; }
@media print {
  .table-responsive > table.table-bordered { border-collapse: collapse !important; border: 1px solid #000 !important; border-radius: 0 !important; overflow: visible; }
  .table-responsive > table.table-bordered > :is(thead, tbody, tfoot) > tr > :is(th, td) { border: 1px solid #000 !important; }
}

/* -----------------------------------------------------------------------------
 * PRINT - fit wide liri_table tables to the paper width (A4 portrait and up)
 * Cells may wrap, padding / font shrink, the table takes exactly the page width.
 * Columns whose header has "d-print-none" (Action) are left out entirely.
 * For very wide reports choose Landscape in the print dialog, or hide columns
 * with the "Columns" button first - hidden columns are not printed.
 * -------------------------------------------------------------------------- */
@page { margin: 10mm 8mm; }
@media print {
  html, body { width: auto !important; min-width: 0 !important; }
  /* the app shell has fixed heights + overflow hidden (for the scrolling layout); in print that
     clips long tables on short (landscape) pages - let everything flow over pages instead */
  html, body, .container-scroller, .page-body-wrapper, .main-panel, .content-wrapper,
  .table-responsive, .lbs5_search_result_outer, .lbs5_search_result_item_inner {
    height: auto !important; min-height: 0 !important; max-height: none !important; overflow: visible !important;
  }
  .main-panel, .page-body-wrapper { display: block !important; }
  /* flex rows are not split over pages by Chrome (the whole table jumped to page 2) */
  .content-wrapper .row, .lbs5_search_result_outer, .lbs5_search_result_item_inner { display: block !important; }
  .content-wrapper .row > * { width: 100% !important; max-width: 100% !important; }
  .liri-table-bar { display: flex !important; }
  .content-wrapper, .main-panel .content-wrapper, .container-fluid, .row { padding-left: 0 !important; padding-right: 0 !important; margin-left: 0 !important; margin-right: 0 !important; }
  .row > * { padding-left: 0 !important; padding-right: 0 !important; }
  .app-result-wrap, .card, .app-panel,
  .lbs5_search_result_outer, .lbs5_search_form_outer, .lbs5_search_result_item_inner { border: 0 !important; box-shadow: none !important; border-radius: 0 !important; padding-left: 0 !important; padding-right: 0 !important; margin-left: 0 !important; margin-right: 0 !important; }
  .table-responsive { overflow: visible !important; width: 100% !important; }
  .table-responsive > table.table, table.table { width: 100% !important; min-width: 0 !important; max-width: 100% !important; table-layout: auto !important; font-size: 7.5pt !important; }
  table.table > :is(thead, tbody, tfoot) > tr > :is(th, td) {
    white-space: normal !important; overflow-wrap: break-word; word-break: normal; hyphens: manual;
    padding: 2px 4px !important; line-height: 1.25 !important; font-size: 7.5pt !important;
    width: auto !important; min-width: 0 !important; max-width: none !important;
  }
  table.table > thead > tr > :is(th, td) { font-size: 7pt !important; letter-spacing: 0 !important; }
  table.table .badge { font-size: 7pt !important; padding: 1px 3px !important; border: 1px solid #000; background: none !important; color: #000 !important; }
  table.table .text-nowrap { white-space: normal !important; }
  /* short values (dates, numbers, codes) stay on one line; only text columns wrap */
  table.table > tbody > tr > :is(td, th).text-end, table.table > tbody > tr > :is(td, th).text-center { white-space: nowrap !important; }
  table.table tr { page-break-inside: avoid; break-inside: avoid; }
  table.table > thead { display: table-header-group; }          /* header repeats on every page */
  .liri-table-bar .liri-table-title { font-size: 11pt !important; }
  .liri-table-bar .liri-table-subtitle { font-size: 8pt !important; }
  .tableFloatingHeader { display: none !important; }            /* sticky header copy */
}
