/*
 * MyIcareLabs theme (2026 redesign).
 *
 * One source of truth for the portal's look: colour tokens, the app shell
 * (sidebar on desktop, top bar + drawer + bottom tabs on phones) and the
 * components of the redesigned pages (cards, page header, tabs, tables,
 * forms, buttons). Loaded after Bootstrap and the older site/my-icl sheets.
 */

/* ------------------------------------------------------------------ */
/* Tokens                                                              */
/* ------------------------------------------------------------------ */
:root {
  /* Icare palette (unchanged brand colours) */
  --icl-blue: #0f6b92;
  --icl-blue-600: #0c5a7b;
  --icl-blue-700: #0a4a66;
  --icl-blue-800: #083a50;
  --icl-red: #a42c36;
  --icl-red-600: #8c242d;
  --icl-sky: #bfdeed;      /* table/section headers */
  --icl-eye: #87c1dd;      /* "eyeball" blue */
  --icl-mist: #e1f0f7;     /* tinted backgrounds */
  --icl-mist-2: #f1f8fb;

  --icl-ink: #14232c;
  --icl-ink-2: #3d5260;
  --icl-muted: #5e7280;
  --icl-line: #d6e3ea;
  --icl-line-2: #e8f0f4;
  --icl-bg: #f4f8fa;
  --icl-surface: #ffffff;
  --icl-hover: #f7fbfd;    /* row hover, filter rows */
  --icl-field-line: #c6d6df;
  --icl-disabled-bg: #eef3f6;
  --icl-tabs-bg: #e6eef3;
  --icl-link: var(--icl-blue);
  --icl-link-hover: var(--icl-blue-700);
  --icl-accent-ink: var(--icl-blue-700);  /* blue text on a surface */
  --icl-accent-ink-strong: var(--icl-blue-800);  /* stronger blue text (hover, tinted boxes) */

  --icl-ok: #1f7a4d;
  --icl-ok-bg: #e3f4ea;
  --icl-warn: #8a5a00;
  --icl-warn-bg: #fff4d6;
  --icl-bad: var(--icl-red);
  --icl-bad-bg: #fbe9ea;

  --icl-radius: 14px;
  --icl-radius-sm: 9px;
  --icl-shadow: 0 1px 2px rgba(15, 50, 70, .06), 0 4px 16px rgba(15, 50, 70, .06);
  --icl-shadow-lg: 0 12px 40px rgba(8, 40, 60, .22);

  --icl-sidebar-w: 260px;
  --icl-topbar-h: 64px;
  --icl-bottomnav-h: 64px;
  --icl-font: Montserrat, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  /* Bootstrap 5 hooks so its components pick up the palette */
  --bs-primary: var(--icl-blue);
  --bs-primary-rgb: 15, 107, 146;
  --bs-link-color: var(--icl-blue);
  --bs-link-color-rgb: 15, 107, 146;
  --bs-link-hover-color: var(--icl-accent-ink);
  --bs-link-hover-color-rgb: 10, 74, 102;
  --bs-body-font-family: var(--icl-font);
  --bs-body-color: var(--icl-ink);
  --bs-border-color: var(--icl-line);
}

/* ------------------------------------------------------------------ */
/* Base                                                                */
/* ------------------------------------------------------------------ */
html { -webkit-text-size-adjust: 100%; }

body.icl {
  min-width: 0;            /* the old sheet forced 955px */
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0;
  background: var(--icl-bg);
  color: var(--icl-ink);
  font-family: var(--icl-font);
  font-size: 15px;
  line-height: 1.5;
}

body.icl main {           /* undo the old full-height scrolling <main> */
  display: block;
  height: auto;
  min-height: 0;
  overflow: visible;
}

.icl a { color: var(--icl-link); }
.icl a:hover { color: var(--icl-accent-ink); }
.icl a.btn, .icl a.btn:hover { color: var(--bs-btn-color); }
.icl a.btn:hover { color: var(--bs-btn-hover-color); }
.icl :focus-visible { outline: 3px solid rgba(15, 107, 146, .45); outline-offset: 2px; }

.icl h1, .icl h2, .icl h3, .icl h4 { color: var(--icl-ink); font-weight: 700; letter-spacing: -.01em; }

.visually-hidden-focusable:not(:focus):not(:focus-within) {
  position: absolute !important; width: 1px !important; height: 1px !important;
  overflow: hidden !important; clip: rect(0, 0, 0, 0) !important; white-space: nowrap !important;
}

.icl-svg { width: 20px; height: 20px; flex: 0 0 auto; stroke: currentColor; fill: none;
  stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }

/* ------------------------------------------------------------------ */
/* App shell                                                           */
/* ------------------------------------------------------------------ */
.app-skip { position: absolute; left: 1rem; top: .5rem; z-index: 2000; background: #fff;
  padding: .5rem 1rem; border-radius: 8px; }

.app-sidebar {
  position: fixed; inset: 0 auto 0 0; z-index: 1040;
  width: var(--icl-sidebar-w);
  display: flex; flex-direction: column;
  background: linear-gradient(180deg, var(--icl-blue) 0%, var(--icl-blue-700) 100%);
  color: #fff;
  overflow-y: auto; overscroll-behavior: contain;
}

.app-brand { display: flex; align-items: center; justify-content: center; padding: 22px 20px 14px; }
.app-brand img { width: 176px; height: auto; display: block; }

.app-nav { padding: 6px 12px 12px; flex: 1 1 auto; }
.app-nav-group { margin-top: 14px; }
.app-nav-label {
  padding: 0 12px 6px; font-size: 11px; font-weight: 700; letter-spacing: .12em;
  text-transform: uppercase; color: rgba(255, 255, 255, .62);
}
.app-nav ul { list-style: none; margin: 0; padding: 0; }
.app-nav-link {
  position: relative;
  display: flex; align-items: center; gap: 12px;
  min-height: 44px; padding: 9px 12px; margin: 2px 0;
  border-radius: 10px; border: 0; width: 100%; background: transparent;
  color: rgba(255, 255, 255, .9) !important; text-decoration: none; font-size: 14.5px; font-weight: 500;
  text-align: left;
}
.app-nav-link:hover { background: rgba(255, 255, 255, .1); color: #fff !important; }
.app-nav-link.active { background: #fff; color: var(--icl-accent-ink) !important; font-weight: 700;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .12); }
.app-nav-link.active::before {
  content: ''; position: absolute; left: -12px; top: 9px; bottom: 9px; width: 4px;
  border-radius: 0 4px 4px 0; background: var(--icl-red);
}
.app-nav-link .ext { margin-left: auto; width: 15px; height: 15px; opacity: .7; }

.app-sidebar-foot { padding: 12px 16px 18px; border-top: 1px solid rgba(255, 255, 255, .14); font-size: 13px; }
.app-sidebar-foot a { color: #fff !important; text-decoration: none; display: flex; align-items: center; gap: 10px; }
.app-sidebar-foot small { display: block; color: rgba(255, 255, 255, .65); }

.app-main { margin-left: var(--icl-sidebar-w); min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; min-width: 0; }

.app-topbar {
  position: sticky; top: 0; z-index: 1030;
  height: var(--icl-topbar-h);
  display: flex; align-items: center; gap: 16px;
  padding: 0 28px;
  background: rgba(255, 255, 255, .92);
  -webkit-backdrop-filter: saturate(1.4) blur(10px); backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--icl-line);
}
.app-topbar-title { min-width: 0; flex: 1 1 auto; }
.app-topbar-title .acct { font-weight: 700; font-size: 15px; color: var(--icl-ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.app-topbar-title .acct small { font-weight: 500; color: var(--icl-muted); margin-left: 6px; }
.app-topbar-logo { display: none; }
.app-topbar-logo img { height: 30px; width: auto; display: block; }

.app-icon-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-width: 44px; height: 44px; padding: 0 12px; border-radius: 12px;
  border: 1px solid var(--icl-line); background: var(--icl-surface); color: var(--icl-ink-2) !important;
  text-decoration: none; font-weight: 600; font-size: 14px; cursor: pointer;
}
.app-icon-btn:hover { background: var(--icl-mist-2); color: var(--icl-accent-ink) !important; }
.app-phone { color: var(--icl-accent-ink) !important; }

.app-menu-toggle { display: none; }

.app-user { position: relative; }
.app-user-btn { padding: 0 10px 0 12px; }
.app-user-btn .chev { width: 16px; height: 16px; }
.app-user-menu {
  position: absolute; right: 0; top: calc(100% + 8px); min-width: 250px; z-index: 1050;
  padding: 8px; border-radius: 14px; background: var(--icl-surface); border: 1px solid var(--icl-line);
  box-shadow: var(--icl-shadow-lg); color: var(--icl-ink);
}
.app-user-menu[hidden] { display: none; }
.app-user-menu .who { padding: 8px 10px 10px; border-bottom: 1px solid var(--icl-line-2); margin-bottom: 6px; }
.app-user-menu .who strong { display: block; font-size: 14px; }
.app-user-menu .who span { color: var(--icl-muted); font-size: 13px; }
.app-user-menu a, .app-user-menu button {
  display: flex; align-items: center; gap: 10px; width: 100%; min-height: 42px; padding: 8px 10px;
  border: 0; border-radius: 9px; background: none; color: var(--icl-ink) !important; text-decoration: none;
  font: inherit; font-size: 14px; text-align: left; cursor: pointer;
}
.app-user-menu a:hover, .app-user-menu button:hover { background: var(--icl-mist-2); }
.app-user-menu form { margin: 0; }

.app-content {
  flex: 1 1 auto;
  width: 100%; max-width: 1360px;
  margin: 0 auto;
  padding: 26px 28px 48px;
  min-width: 0;
}
.app-content.is-wide { max-width: none; }

.app-footer {
  padding: 18px 28px 26px; color: var(--icl-muted); font-size: 13px;
  display: flex; flex-wrap: wrap; gap: 8px 20px; justify-content: space-between;
}
.app-footer a { color: var(--icl-muted); }

/* Bottom tab bar + drawer backdrop (phones/tablets) */
.app-bottomnav { display: none; }
.app-backdrop { display: none; }

@media (max-width: 991.98px) {
  .app-sidebar {
    transform: translateX(-105%);
    transition: transform .22s ease;
    width: min(86vw, 320px);
    box-shadow: var(--icl-shadow-lg);
    padding-bottom: env(safe-area-inset-bottom);
  }
  body.nav-open .app-sidebar { transform: none; }
  body.nav-open { overflow: hidden; }
  .app-backdrop {
    display: block; position: fixed; inset: 0; z-index: 1035; background: rgba(8, 30, 45, .45);
    opacity: 0; pointer-events: none; transition: opacity .2s ease;
  }
  body.nav-open .app-backdrop { opacity: 1; pointer-events: auto; }

  .app-main { margin-left: 0; }
  .app-topbar {
    padding: 0 12px; gap: 8px;
    padding-top: env(safe-area-inset-top);
    height: calc(var(--icl-topbar-h) + env(safe-area-inset-top));
    background: var(--icl-blue); border-bottom: 0; color: #fff;
  }
  .app-topbar .app-icon-btn { background: rgba(255, 255, 255, .12); border-color: transparent; color: #fff !important; }
  .app-menu-toggle { display: inline-flex; }
  .app-topbar-logo { display: block; flex: 1 1 auto; }
  .app-topbar-title { display: none; }
  .app-phone .label, .app-user-btn .label, .app-user-btn .chev { display: none; }
  .app-user-btn { padding: 0 12px; }

  .app-content { padding: 18px 14px calc(var(--icl-bottomnav-h) + 28px + env(safe-area-inset-bottom)); }
  .app-footer { padding-bottom: calc(var(--icl-bottomnav-h) + 22px + env(safe-area-inset-bottom)); }
  .app-footer { display: none; }

  .app-bottomnav {
    display: grid; grid-template-columns: repeat(5, 1fr);
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 1030;
    height: calc(var(--icl-bottomnav-h) + env(safe-area-inset-bottom));
    padding-bottom: env(safe-area-inset-bottom);
    background: var(--icl-surface); border-top: 1px solid var(--icl-line);
    box-shadow: 0 -4px 18px rgba(15, 50, 70, .08);
  }
  .app-bottomnav a, .app-bottomnav button {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
    border: 0; background: none; color: var(--icl-muted) !important; text-decoration: none;
    font: inherit; font-size: 11px; font-weight: 600; min-height: 44px;
  }
  .app-bottomnav .icl-svg { width: 22px; height: 22px; }
  .app-bottomnav .active { color: var(--icl-blue) !important; }
  .app-bottomnav .active .icl-svg { stroke-width: 2.3; }
  .app-bottomnav .is-cta .bubble {
    display: inline-flex; align-items: center; justify-content: center;
    width: 40px; height: 30px; border-radius: 15px; background: var(--icl-red); color: #fff;
  }
  .app-bottomnav .is-cta .bubble .icl-svg { width: 20px; height: 20px; }
}

/* ------------------------------------------------------------------ */
/* Page header, cards, sections                                        */
/* ------------------------------------------------------------------ */
.page-head {
  display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px 20px;
  margin-bottom: 20px;
}
.page-head h1 { font-size: 26px; margin: 0; }
.page-head p { margin: 4px 0 0; color: var(--icl-muted); }
.page-head .actions { display: flex; flex-wrap: wrap; gap: 8px; }
.eyebrow { font-size: 12px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--icl-red); margin-bottom: 4px; }

@media (max-width: 575.98px) {
  .page-head h1 { font-size: 22px; }
  .page-head .actions { width: 100%; }
  .page-head .actions > * { flex: 1 1 auto; }
}

.icl-card {
  background: var(--icl-surface);
  border: 1px solid var(--icl-line);
  border-radius: var(--icl-radius);
  box-shadow: var(--icl-shadow);
  min-width: 0;
}
.icl-card + .icl-card { margin-top: 18px; }
.icl-card-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  padding: 16px 20px; border-bottom: 1px solid var(--icl-line-2);
}
.icl-card-head h2, .icl-card-head h3 { font-size: 16px; margin: 0; display: flex; align-items: center; gap: 10px; }
.icl-card-head .step {
  display: inline-flex; align-items: center; justify-content: center;
  width: 26px; height: 26px; border-radius: 50%; background: var(--icl-mist); color: var(--icl-accent-ink);
  font-size: 13px; font-weight: 700;
}
.icl-card-head .hint { color: var(--icl-muted); font-size: 13px; }
.icl-card-body { padding: 20px; }
.icl-card-body.flush { padding: 0; }
@media (max-width: 575.98px) {
  .icl-card-head { padding: 14px 16px; }
  .icl-card-body { padding: 16px; }
}

.icl-grid { display: grid; gap: 18px; grid-template-columns: repeat(12, minmax(0, 1fr)); align-items: start; }
.icl-grid > * { grid-column: span 12; min-width: 0; }
@media (min-width: 768px) {
  .icl-grid .span-6 { grid-column: span 6; }
  .icl-grid .span-4 { grid-column: span 4; }
  .icl-grid .span-8 { grid-column: span 8; }
}
@media (min-width: 1200px) {
  .icl-grid .xl-span-4 { grid-column: span 4; }
  .icl-grid .xl-span-8 { grid-column: span 8; }
  .icl-grid .xl-span-3 { grid-column: span 3; }
}

/* Narrow single-column pages (password, forms) */
.icl-narrow { max-width: 560px; }
.icl-medium { max-width: 920px; }
.icl-center { margin-left: auto; margin-right: auto; }


/* ------------------------------------------------------------------ */
/* Components (buttons, forms, alerts, tabs, tables) are scoped to     */
/* .icl-page, the redesigned pages, so the older pages keep their own  */
/* look inside the new shell.                                          */
/* ------------------------------------------------------------------ */
/* ------------------------------------------------------------------ */
/* Buttons                                                             */
/* ------------------------------------------------------------------ */
.icl-page .btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 42px; padding: 8px 18px; border-radius: 11px;
  font-weight: 600; font-size: 14.5px; letter-spacing: .005em;
}
.icl-page .btn-sm { min-height: 34px; padding: 5px 12px; border-radius: 9px; font-size: 13px; }
.icl-page .btn-lg { min-height: 52px; padding: 12px 26px; font-size: 16px; border-radius: 13px; }
.icl-page .btn-primary {
  --bs-btn-bg: var(--icl-blue); --bs-btn-border-color: var(--icl-blue);
  --bs-btn-hover-bg: var(--icl-blue-600); --bs-btn-hover-border-color: var(--icl-blue-600);
  --bs-btn-active-bg: var(--icl-blue-700); --bs-btn-active-border-color: var(--icl-accent-ink);
  --bs-btn-disabled-bg: var(--icl-blue); --bs-btn-disabled-border-color: var(--icl-blue);
  --bs-btn-focus-shadow-rgb: 15, 107, 146;
}
.icl-page .btn-accent {
  --bs-btn-color: #fff; --bs-btn-hover-color: #fff; --bs-btn-active-color: #fff; --bs-btn-disabled-color: #fff;
  --bs-btn-bg: var(--icl-red); --bs-btn-border-color: var(--icl-red);
  --bs-btn-hover-bg: var(--icl-red-600); --bs-btn-hover-border-color: var(--icl-red-600);
  --bs-btn-active-bg: var(--icl-red-600); --bs-btn-active-border-color: var(--icl-red-600);
  --bs-btn-disabled-bg: var(--icl-red); --bs-btn-disabled-border-color: var(--icl-red);
  --bs-btn-focus-shadow-rgb: 164, 44, 54;
  box-shadow: 0 6px 16px rgba(164, 44, 54, .25);
}
.icl-page .btn-secondary, .icl-page .btn-outline {
  --bs-btn-color: var(--icl-accent-ink); --bs-btn-bg: var(--icl-surface); --bs-btn-border-color: var(--icl-line);
  --bs-btn-hover-color: var(--icl-accent-ink-strong); --bs-btn-hover-bg: var(--icl-mist-2); --bs-btn-hover-border-color: var(--icl-eye);
  --bs-btn-active-color: var(--icl-accent-ink-strong); --bs-btn-active-bg: var(--icl-mist); --bs-btn-active-border-color: var(--icl-eye);
  --bs-btn-disabled-color: var(--icl-muted); --bs-btn-disabled-bg: var(--icl-surface); --bs-btn-disabled-border-color: var(--icl-line);
}
.icl-page .btn-light { background: var(--icl-surface); border-color: var(--icl-line); }
.icl-page .btn-link { color: var(--icl-blue); font-weight: 600; }

/* Plain <input type=submit|button> left over in older pages */
.icl-page input[type=submit]:not(.btn), .icl-page input[type=button]:not(.btn),
.icl-page button:not([class]) {
  min-height: 36px; padding: 6px 14px; border-radius: 9px;
  border: 1px solid var(--icl-line); background: var(--icl-surface); color: var(--icl-accent-ink);
  font-weight: 600; font-size: 13.5px; cursor: pointer;
}
.icl-page input[type=submit]:not(.btn):hover, .icl-page input[type=button]:not(.btn):hover,
.icl-page button:not([class]):hover { background: var(--icl-mist-2); border-color: var(--icl-eye); }

/* ------------------------------------------------------------------ */
/* Forms                                                               */
/* ------------------------------------------------------------------ */
.icl-page .form-control, .icl-page .form-select,
.icl-page input[type=text]:not(.form-control), .icl-page input[type=password]:not(.form-control),
.icl-page input[type=email]:not(.form-control), .icl-page input[type=number]:not(.form-control),
.icl-page input[type=date]:not(.form-control), .icl-page input[type=tel]:not(.form-control),
.icl-page select:not(.form-select):not(.selectpicker), .icl-page textarea:not(.form-control) {
  min-height: 42px;
  padding: 8px 12px;
  border: 1px solid var(--icl-field-line); border-radius: var(--icl-radius-sm);
  background-color: var(--icl-surface); color: var(--icl-ink);
  font: inherit; font-size: 15px;
  transition: border-color .15s, box-shadow .15s;
  max-width: 100%;
}
.icl-page select:not(.form-select):not(.selectpicker) { padding-right: 28px; }
.icl-page .form-control:focus, .icl-page .form-select:focus,
.icl-page input:focus, .icl-page select:focus, .icl-page textarea:focus {
  border-color: var(--icl-blue); box-shadow: 0 0 0 3px rgba(15, 107, 146, .18); outline: 0;
}
.icl-page input:disabled, .icl-page select:disabled, .icl-page .form-control:disabled, .icl-page .form-select:disabled {
  background-color: var(--icl-disabled-bg) !important; color: #8a9aa5; cursor: not-allowed;
}
.icl-page .form-label, .icl-label { display: block; margin-bottom: 6px; font-size: 13px; font-weight: 600; color: var(--icl-ink-2); }
.icl-page .form-text, .icl-page .hint-block { color: var(--icl-muted); font-size: 13px; }
.icl-page .invalid-feedback { font-size: 13px; }
.icl-page .form-check-input:checked { background-color: var(--icl-blue); border-color: var(--icl-blue); }

/* Phones: 16px stops iOS zooming into focused inputs */
@media (max-width: 767.98px) {
  .icl-page .form-control, .icl-page .form-select, .icl-page input, .icl-page select, .icl-page textarea { font-size: 16px; }
}

/* Field validation used by the Rx form script */
.icl-page .errored {
  background-color: var(--icl-bad-bg) !important; border-color: var(--icl-red) !important;
  box-shadow: 0 0 0 3px rgba(164, 44, 54, .15) !important;
}

/* ------------------------------------------------------------------ */
/* Alerts & notices                                                    */
/* ------------------------------------------------------------------ */
.icl-page .alert { border-radius: 12px; border: 1px solid transparent; padding: 14px 16px; }
.icl-page .alert-danger, .icl-error-box {
  background: var(--icl-bad-bg); border-color: #efc4c7; color: #6f1d24;
}
.icl-page .alert-success { background: var(--icl-ok-bg); border-color: #bfe3cd; color: #164f33; }
.icl-page .alert-info { background: var(--icl-mist); border-color: var(--icl-sky); color: var(--icl-accent-ink-strong); }
.icl-page .alert-warning { background: var(--icl-warn-bg); border-color: #f1dc9f; color: #5f3f00; }
.icl-page .error-summary { border-radius: 12px; border-left: 4px solid var(--icl-red); }

.icl-notice {
  display: flex; gap: 12px; align-items: flex-start;
  padding: 14px 16px; border-radius: 12px; background: var(--icl-mist); color: var(--icl-accent-ink-strong);
  border: 1px solid var(--icl-sky);
}
.icl-notice .icl-svg { margin-top: 2px; }

/* ------------------------------------------------------------------ */
/* Tabs (job status etc.)                                              */
/* ------------------------------------------------------------------ */
.icl-tabs {
  display: flex; gap: 4px; padding: 4px; margin: 0 0 18px;
  list-style: none; background: var(--icl-tabs-bg); border-radius: 13px;
  overflow-x: auto; overscroll-behavior-x: contain; scrollbar-width: none;
  width: fit-content; max-width: 100%;
}
.icl-tabs::-webkit-scrollbar { display: none; }
.icl-tabs a {
  display: flex; align-items: center; gap: 8px; white-space: nowrap;
  min-height: 40px; padding: 8px 16px; border-radius: 10px;
  color: var(--icl-ink-2) !important; text-decoration: none; font-weight: 600; font-size: 14px;
}
.icl-tabs a:hover { background: rgba(255, 255, 255, .6); }
.icl-tabs a.active, .icl-tabs a[aria-current=page] { background: var(--icl-surface); color: var(--icl-accent-ink) !important; box-shadow: 0 1px 4px rgba(15, 50, 70, .14); }
.icl-tabs .count {
  min-width: 22px; height: 22px; padding: 0 6px; border-radius: 11px; font-size: 12px;
  display: inline-flex; align-items: center; justify-content: center; background: var(--icl-mist); color: var(--icl-accent-ink);
}

/* Old Bootstrap pills keep the brand colour */
.icl-page .nav-pills .nav-link.active, .icl-page .nav-pills .show > .nav-link { background-color: var(--icl-blue); }

/* ------------------------------------------------------------------ */
/* Tables                                                              */
/* ------------------------------------------------------------------ */
.icl-table-wrap { width: 100%; overflow-x: auto; overscroll-behavior-x: contain; -webkit-overflow-scrolling: touch; }

.icl-page .table, .icl-page .grid-view table, .icl-table {
  width: 100%; margin: 0; border-collapse: separate; border-spacing: 0;
  font-size: 14px; background: var(--icl-surface);
}
.icl-page .table > :not(caption) > * > *, .icl-page .grid-view table td, .icl-page .grid-view table th, .icl-table td, .icl-table th {
  padding: 12px 14px; border-bottom: 1px solid var(--icl-line-2); vertical-align: middle;
  background: transparent; box-shadow: none;
}
.icl-page .table thead th, .icl-page .grid-view table thead th, .icl-table thead th {
  background: var(--icl-mist-2) !important; color: var(--icl-ink-2);
  font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  border-bottom: 1px solid var(--icl-line); white-space: nowrap;
}
.icl-page .grid-view table thead th a, .icl-table thead th a { color: var(--icl-ink-2); text-decoration: none; }
.icl-page .grid-view table thead th a:hover { color: var(--icl-blue); }
.icl-page .grid-view table tbody tr:hover td, .icl-table tbody tr:hover td { background: var(--icl-hover); }
.icl-page .grid-view table tbody tr:last-child td, .icl-table tbody tr:last-child td { border-bottom: 0; }
.icl-page .grid-view .filters td { background: var(--icl-hover); padding: 8px 10px; }
.icl-page .grid-view .filters input { width: 100%; min-height: 36px; font-size: 14px; }
.icl-page .table-striped > tbody > tr:nth-of-type(odd) > * { --bs-table-accent-bg: transparent; }
.num, .icl-table .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.icl-page .empty { padding: 28px 14px; color: var(--icl-muted); text-align: center; display: block; }
.icl-page a.asc:after { border-bottom-color: currentColor; }
.icl-page a.desc:after { border-top-color: currentColor; }

/* Row actions (Copy / Hold / Remake) */
.row-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.row-actions a {
  display: inline-flex; align-items: center; gap: 5px; min-height: 32px; padding: 4px 10px;
  border-radius: 8px; border: 1px solid var(--icl-line); background: var(--icl-surface);
  font-size: 13px; font-weight: 600; text-decoration: none; white-space: nowrap; color: var(--icl-accent-ink);
}
.row-actions a:hover { background: var(--icl-mist-2); border-color: var(--icl-eye); }
.row-actions .icl-svg { width: 15px; height: 15px; }

.job-link { font-weight: 700; text-decoration: none; font-variant-numeric: tabular-nums; }

/* Status pills */
.pill {
  display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px;
  font-size: 12.5px; font-weight: 600; white-space: nowrap; background: var(--icl-mist); color: var(--icl-accent-ink-strong);
}
.pill::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: currentColor; opacity: .75; }
.pill-ok { background: var(--icl-ok-bg); color: var(--icl-ok); }
.pill-warn { background: var(--icl-warn-bg); color: var(--icl-warn); }
.pill-bad { background: var(--icl-bad-bg); color: var(--icl-red); }
.pill-muted { background: var(--icl-tabs-bg); color: var(--icl-muted); }

/* Pagination */
.icl-page .pagination { gap: 4px; flex-wrap: wrap; margin: 0; padding: 14px 16px; }
.icl-page ul.pagination li { padding: 0; }
.icl-page .pagination .page-link, .icl-page .pagination li > a, .icl-page .pagination li > span {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 38px; height: 38px; padding: 0 10px; border-radius: 9px !important; border: 1px solid var(--icl-line);
  color: var(--icl-accent-ink); text-decoration: none; background: var(--icl-surface);
}
.icl-page .pagination .active > .page-link, .icl-page .pagination li.active > a {
  background: var(--icl-blue); border-color: var(--icl-blue); color: #fff;
}
.icl-page .pagination .disabled > .page-link, .icl-page .pagination li.disabled > span { color: #9aa9b3; background: var(--icl-hover); }

/* Phones: GridView rows become cards. Each cell gets its column name from
   data-label (set by icl-app.js from the table header). */
@media (max-width: 767.98px) {
  .icl-stack thead { display: block; }
  .icl-stack thead tr:not(.filters) { display: none; }
  .icl-stack table, .icl-stack tbody, .icl-stack tr, .icl-stack td { display: block; width: 100% !important; }
  .icl-stack tr { padding: 12px 14px; border-bottom: 1px solid var(--icl-line); }
  .icl-stack tbody tr:hover td { background: transparent; }
  .icl-stack td { border: 0 !important; padding: 3px 0 !important; display: flex; gap: 12px; align-items: baseline; text-align: left !important; }
  .icl-stack td[data-label]::before {
    content: attr(data-label); flex: 0 0 34%; max-width: 34%;
    color: var(--icl-muted); font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em;
  }
  .icl-stack td.cell-title { font-size: 16px; padding-bottom: 6px !important; }
  .icl-stack td.cell-title::before { display: none; }
  .icl-stack td.cell-actions { padding-top: 10px !important; }
  .icl-stack td.cell-actions::before { display: none; }
  .icl-stack tr.filters { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; background: var(--icl-hover); border-bottom: 1px solid var(--icl-line); }
  .icl-stack tr.filters td { display: block; }
  .icl-stack tr.filters td { padding: 0 !important; }
  .icl-stack tr.filters td:empty, .icl-stack tr.filters td.no-filter { display: none; }
  .icl-stack tr.filters td::before { display: none; }
}

.job-list .empty-row { padding: 26px 20px; color: var(--icl-muted); text-align: center; }

.balance-list { margin: 0; }
.balance-list div { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px dashed var(--icl-line); }
.balance-list div:last-child { border-bottom: 0; }
.balance-list dt { font-weight: 500; color: var(--icl-ink-2); }
.balance-list dd { margin: 0; font-weight: 700; font-variant-numeric: tabular-nums; }
.balance-list .total dt, .balance-list .total dd { color: var(--icl-ink); font-size: 16px; }


/* ------------------------------------------------------------------ */
/* Print: no chrome                                                    */
/* ------------------------------------------------------------------ */
@media print {
  .app-sidebar, .app-topbar, .app-bottomnav, .app-backdrop, .app-footer, .no-print { display: none !important; }
  .app-main { margin: 0 !important; }
  .app-content { padding: 0 !important; max-width: none !important; }
  body.icl { background: #fff; }
}

.icl-card .grid-view { border-radius: inherit; overflow: hidden; }
.icl-table tfoot td { background: var(--icl-mist-2); border-top: 1px solid var(--icl-line); }


/* Shipping labels */
/* Stock cart (stock-order/cart) */
.sticky-actions {
  position: sticky; bottom: 0; z-index: 20;
  display: flex; flex-wrap: wrap; gap: 10px; justify-content: flex-end; align-items: center;
  margin-top: 18px; padding: 12px 16px; border-radius: 16px;
  background: var(--icl-surface); background: color-mix(in srgb, var(--icl-surface) 94%, transparent);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  border: 1px solid var(--icl-line); box-shadow: 0 -6px 24px rgba(15, 50, 70, .10);
}
@media (max-width: 991.98px) { .sticky-actions { bottom: calc(var(--icl-bottomnav-h) + env(safe-area-inset-bottom) + 8px); } }
.cart-bar { display: grid; grid-template-columns: minmax(0, 1fr); justify-content: stretch; align-items: stretch; gap: 10px; }
.cart-bar-add { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 10px 16px; }
.cart-bar .barcode-row { position: relative; flex: 1 1 320px; max-width: 460px; align-items: center; }
.cart-bar .barcode-row .ico { position: absolute; left: 12px; color: var(--icl-muted); display: inline-flex; pointer-events: none; }
.icl-page .cart-bar .barcode-row .form-control { padding-left: 40px; }
.cart-bar .add-buttons { flex: 0 1 auto; }
.cart-bar .add-buttons .btn { flex: 0 0 auto; }
.cart-bar-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; align-items: center; gap: 10px; padding-top: 10px; border-top: 1px solid var(--icl-line-2); }
.cart-bar-actions .btn-back { order: -1; margin-right: auto; }
@media (max-width: 575.98px) {
  .cart-bar { gap: 8px; }
  .cart-bar .barcode-row { flex-basis: 100%; max-width: none; }
  .cart-bar .barcode-row .btn { flex: 0 0 auto; }
  .cart-bar .add-buttons { flex: 1 1 100%; gap: 8px; }
  .cart-bar .add-buttons .btn { flex: 1 1 0; padding-inline: 6px; min-height: 38px; white-space: nowrap; }
  .cart-bar-actions { gap: 8px; padding-top: 8px; }
  .cart-bar-actions .btn { flex: 1 1 0; white-space: nowrap; }
  .cart-bar-actions #clearCart { flex-basis: 100%; order: 2; margin-right: 0; min-height: 0; padding-block: 2px; border: 0; background: none; font-size: 13.5px; }
}
@media (max-width: 575.98px) {
  .sticky-actions { padding: 10px; gap: 8px; }
  .sticky-actions .btn { flex: 1 1 0; white-space: nowrap; }
  .sticky-actions #clearCart { flex-basis: 100%; order: 2; min-height: 0; padding-block: 4px; border: 0; background: none; font-size: 13.5px; }
}
.cart-table td, .cart-table th { white-space: nowrap; }
.cart-table td.desc { white-space: normal; min-width: 220px; }
.icl-page .cart-table .cart-qty { width: 72px; text-align: right; min-height: 38px; }
.cart-table td.stock { text-align: center; font-weight: 700; background-clip: content-box; padding: 10px 8px; }
.cart-table td.stock.green { background-color: var(--icl-ok-bg); color: var(--icl-ok); }
.cart-table td.stock.yellow { background-color: var(--icl-warn-bg); color: var(--icl-warn); }
.cart-table td.stock.red { background-color: var(--icl-bad-bg); color: var(--icl-red); }
.cart-table tfoot td { font-weight: 700; background: var(--icl-mist-2); border-top: 1px solid var(--icl-line); }
.cart-warning { padding: 14px 20px; border-top: 1px solid var(--icl-line-2); color: var(--icl-red); font-weight: 600; background: var(--icl-bad-bg); }
.cart-empty { padding: 36px 20px; text-align: center; color: var(--icl-muted); }
.cart-empty .icl-svg { width: 40px; height: 40px; color: var(--icl-eye); display: block; margin: 0 auto 10px; }
.barcode-row { display: flex; gap: 8px; }
.barcode-row .form-control { flex: 1 1 auto; min-width: 0; }
.add-buttons { display: flex; flex-wrap: wrap; gap: 10px; }
.add-buttons .btn { flex: 1 1 180px; }
@media (max-width: 767.98px) {
  .cart-table.icl-stack-cart thead { display: none; }
  .cart-table.icl-stack-cart, .cart-table.icl-stack-cart tbody, .cart-table.icl-stack-cart tfoot { display: block; width: 100%; }
  .cart-table.icl-stack-cart tr { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; padding: 12px 16px; border-bottom: 1px solid var(--icl-line-2); }
  .cart-table.icl-stack-cart td { display: block; border: 0; padding: 0; white-space: nowrap; font-size: 12.5px; color: var(--icl-muted); background: none; }
  .cart-table.icl-stack-cart td.desc { flex: 1 1 100%; white-space: normal; min-width: 0; font-size: 14.5px; font-weight: 600; color: var(--icl-ink); }
  .cart-table.icl-stack-cart td[data-label]::before { content: attr(data-label) " "; font-weight: 600; }
  .cart-table.icl-stack-cart td[data-label=Qty] { order: 10; flex: 1 0 70%; }  /* always starts its own line, price beside it */
  .cart-table.icl-stack-cart td[data-label=Qty]::before { display: none; }
  .cart-table.icl-stack-cart td[data-label=Price] { order: 11; margin-left: auto; font-size: 15px; font-weight: 700; color: var(--icl-ink); }
  .cart-table.icl-stack-cart td[data-label=Price]::before { display: none; }
  .cart-table.icl-stack-cart td.stock { padding: 2px 8px; border-radius: 6px; background-clip: border-box; }
  .cart-table.icl-stack-cart td:empty, .cart-table.icl-stack-cart td.stock:not(.red):not(.yellow):not(.green) { display: none; }
  .cart-table.icl-stack-cart tfoot tr { justify-content: space-between; background: var(--icl-mist-2); }
  .cart-table.icl-stack-cart tfoot td { font-size: 15px; color: var(--icl-ink); }
}

/* Frames: collections (stock-order/frame-collection), one compact row per manufacturer */
.frame-makers { overflow: hidden; }
.frame-makers-filter { position: relative; display: flex; align-items: center; gap: 12px; padding: 14px 20px; border-bottom: 1px solid var(--icl-line-2); }
.frame-makers-filter .ico { position: absolute; left: 32px; color: var(--icl-muted); display: inline-flex; pointer-events: none; }
.frame-makers-filter .ico .icl-svg { width: 18px; height: 18px; }
.icl-page .frame-makers-filter .form-control { flex: 1 1 auto; max-width: 420px; padding-left: 40px; }
.frame-makers-filter .hint { color: var(--icl-muted); font-size: 13px; white-space: nowrap; }
.frame-maker { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 6px 16px; align-items: baseline; padding: 9px 20px; border-bottom: 1px solid var(--icl-line-2); }
.frame-makers.with-logos .frame-maker { grid-template-columns: 290px minmax(0, 1fr); gap: 8px 16px; align-items: center; padding: 10px 20px; }
.frame-maker:last-child { border-bottom: 0; }
.frame-maker[hidden], .frame-chip[hidden] { display: none; }
.frame-maker-name { font-weight: 700; font-size: 14px; color: var(--icl-ink); }
.frame-makers.with-logos .frame-maker-name { display: flex; align-items: center; gap: 12px; }
/* Vendor logos (web/img/vendors/<slug>.webp) sit on a white tile in light and dark mode; no logo: initials */
.vendor-logo {
  flex: 0 0 auto; width: 120px; height: 52px; padding: 7px 10px; border-radius: 10px; background: #fff;
  border: 1px solid var(--icl-line); display: inline-flex; align-items: center; justify-content: center;
}
.vendor-logo img { max-width: 100%; max-height: 100%; width: auto; height: auto; display: block; }
.vendor-logo.no-logo { background: var(--icl-mist); border-color: transparent; }
.vendor-logo.no-logo b { font-size: 19px; font-weight: 700; letter-spacing: .06em; color: var(--icl-accent-ink); }
.vendor-name { min-width: 0; }
.frame-maker-collections { display: flex; flex-wrap: wrap; gap: 6px; }
.icl .frame-chip {
  display: inline-flex; align-items: center; padding: 3px 11px; border-radius: 999px; border: 1px solid var(--icl-line);
  background: var(--icl-surface); color: var(--icl-ink); font-size: 13.5px; font-weight: 500; text-decoration: none; line-height: 1.5;
}
.icl .frame-chip:hover, .icl .frame-chip:focus-visible { border-color: var(--icl-eye); background: var(--icl-mist-2); color: var(--icl-accent-ink); }
@media (max-width: 575.98px) {
  .frame-maker { grid-template-columns: minmax(0, 1fr); padding: 10px 16px; }
  .frame-makers.with-logos .frame-maker { grid-template-columns: minmax(0, 1fr); padding: 12px 16px; }
  .vendor-logo { width: 96px; height: 42px; padding: 5px 8px; }
  .frame-makers-filter { flex-wrap: wrap; padding: 12px 16px; }
  .frame-makers-filter .ico { left: 28px; top: 25px; }
}

/* Frames: frames in a collection (stock-order/frame-collection-detail) */
.frames-toolbar .icl-card-body { display: flex; flex-wrap: wrap; gap: 12px 24px; align-items: flex-end; }
.frames-toolbar p { margin: 0 0 10px; color: var(--icl-muted); font-size: 14px; }
.frame-group { margin-top: 18px; overflow: hidden; }
.frame-header { padding: 11px 20px; font-weight: 700; font-size: 16px; letter-spacing: .01em; background: var(--icl-blue); color: #fff; }
.frame-row { display: grid; gap: 20px; padding: 16px 20px; grid-template-columns: minmax(0, 1fr); align-items: start; }
@media (min-width: 1000px) { .frame-row { grid-template-columns: minmax(280px, 375px) minmax(0, 1fr); } }
.pictureBig img { width: 100%; height: auto; border-radius: 12px; background: #fff; display: block; border: 1px solid var(--icl-line); }
.frame-details { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.frame-inner-table {
  display: grid; gap: 12px; align-items: center; padding: 6px 10px; border-radius: 12px; border: 1px solid var(--icl-line); background: var(--icl-surface);
  grid-template-columns: minmax(0, 1.1fr) 120px minmax(0, 1fr);
}
.frame-inner-table .color { display: flex; flex-direction: column; font-size: 14.5px; color: var(--icl-ink); }
.frame-inner-table:nth-child(even) { background: var(--icl-mist-2); }
.frame-inner-table:focus-within { border-color: var(--icl-eye); box-shadow: 0 0 0 3px rgba(15, 107, 146, .12); }
.frame-inner-table .color span { color: var(--icl-ink-2); font-size: 12.5px; }
.frame-inner-table .pictured { margin-left: 6px; padding: 1px 7px; border-radius: 999px; background: var(--icl-mist); color: var(--icl-accent-ink); font-size: 11px; font-style: normal; font-weight: 600; vertical-align: 1px; }
.frame-inner-table .picture img { width: 120px; height: auto; border-radius: 8px; cursor: pointer; display: block; background: #fff; border: 1px solid var(--icl-line); }
.frame-inner-table .price, .frame-inner-table .input-only { display: flex; align-items: center; justify-content: flex-end; gap: 10px; font-weight: 700; font-size: 15px; color: var(--icl-ink); font-variant-numeric: tabular-nums; }
.icl-page .frame-inner-table .item-qty { width: 70px; text-align: right; }
@media (max-width: 575.98px) {
  .frame-row { padding: 12px; }
  .frame-inner-table { grid-template-columns: 84px minmax(0, 1fr); }
  .frame-inner-table .picture { grid-row: 1 / span 2; grid-column: 1; }
  .frame-inner-table .picture img { width: 84px; }
  .frame-inner-table .color { grid-column: 2; }
  .frame-inner-table .price, .frame-inner-table .input-only { grid-column: 2; justify-content: space-between; }
}

/* Frames: frame finder (stock-order/frame-collection): category circles, filter toolbar, results */
/* The circles share out the row (no sideways scrolling); on phones they become a swipe strip. */
.frame-circles { display: grid; grid-template-columns: repeat(auto-fit, minmax(76px, 1fr)); gap: 10px 8px; padding: 4px 2px 6px; margin-bottom: 14px; }
.icl .frame-circle {
  display: flex; flex-direction: column; align-items: center; gap: 6px; min-width: 0;
  padding: 0; border: 0; background: none; color: var(--icl-ink); cursor: pointer; font: inherit;
}
.frame-circle .ring {
  width: 100%; max-width: 84px; height: auto; aspect-ratio: 1; border-radius: 50%; overflow: hidden; display: flex; align-items: center; justify-content: center;
  background: #fff; border: 2px solid var(--icl-line); box-shadow: var(--icl-shadow); transition: border-color .15s, transform .15s, box-shadow .15s;
}
.frame-circle .ring img { width: 150%; max-width: none; height: auto; display: block; }
.frame-circle .label { display: flex; flex-direction: column; align-items: center; font-weight: 600; font-size: 13px; line-height: 1.2; text-align: center; }
.frame-circle .label small { color: var(--icl-muted); font-weight: 500; font-size: 11.5px; margin-top: 2px; }
.frame-circle:hover .ring, .frame-circle:focus-visible .ring { border-color: var(--icl-eye); transform: translateY(-2px); }
.frame-circle.active .ring { border-color: var(--icl-blue); box-shadow: 0 0 0 4px rgba(15, 107, 146, .18); }
.frame-circle.active .label { color: var(--icl-accent-ink); }
.frame-circle[hidden], .frame-finder[hidden], .frame-collections[hidden] { display: none; }
.frame-circle .ring-icon { background: var(--icl-mist); color: var(--icl-blue); }
.frame-circle .ring-icon .icl-svg { width: 40%; height: 40%; }
html[data-theme=dark] .frame-circle .ring-icon { color: var(--icl-accent-ink); }

.frame-finder { display: flex; flex-direction: column; align-items: stretch; gap: 14px; scroll-margin-top: calc(var(--icl-topbar-h) + 12px); }
.finder-results { min-width: 0; }
.finder-toolbar {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; padding: 10px 12px;
  position: sticky; top: calc(var(--icl-topbar-h) + 8px); z-index: 20;
}
.finder-search { position: relative; flex: 0 1 340px; min-width: 180px; }
.finder-toolbar .finder-sort { margin-left: auto; }
.ff-drops { flex: 1 1 100%; }
.finder-search .ico { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--icl-muted); display: inline-flex; pointer-events: none; }
.finder-search .ico .icl-svg { width: 17px; height: 17px; }
.icl-page .finder-search .form-control { padding-left: 38px; width: 100%; }
.ff-drops { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.ff-drop { position: relative; }
.ff-drop summary {
  list-style: none; display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--icl-line); background: var(--icl-surface); color: var(--icl-ink); font-size: 13.5px; font-weight: 600; white-space: nowrap; user-select: none;
}
.ff-drop summary::-webkit-details-marker { display: none; }
.ff-drop summary:hover { border-color: var(--icl-eye); background: var(--icl-mist-2); }
.ff-drop summary:focus-visible { outline: 2px solid var(--icl-eye); outline-offset: 2px; }
.ff-drop .caret { width: 12px; height: 12px; color: var(--icl-muted); transition: transform .15s; }
.ff-drop[open] .caret { transform: rotate(180deg); }
.ff-drop[open] summary { border-color: var(--icl-blue); }
.ff-drop.set summary { border-color: var(--icl-blue); background: var(--icl-mist); color: var(--icl-accent-ink); }
.ff-n { font-weight: 700; padding: 0 7px; border-radius: 999px; background: var(--icl-blue); color: #fff; font-size: 11.5px; line-height: 18px; max-width: 150px; overflow: hidden; text-overflow: ellipsis; }
.ff-n[hidden] { display: none; }
.ff-pop {
  position: absolute; left: 0; top: calc(100% + 6px); z-index: 30; width: max-content; min-width: 220px; max-width: min(340px, calc(100vw - 24px));
  padding: 12px; border-radius: 12px; border: 1px solid var(--icl-line); background: var(--icl-surface); box-shadow: 0 12px 32px rgba(15, 40, 60, .18);
}
.ff-drop.wide .ff-pop { width: 320px; }
.ff-pop.flip { left: auto; right: 0; }
.ff-drop:not([open]) .ff-pop { display: none; }
.ff-makers { max-height: 260px; overflow-y: auto; overscroll-behavior: contain; }
.ff-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.icl .ff-chip, .icl .ff-swatch, .icl .ff-active-chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 11px; border-radius: 999px; border: 1px solid var(--icl-line);
  background: var(--icl-surface); color: var(--icl-ink); font-size: 13px; font-weight: 500; line-height: 1.5; cursor: pointer; font-family: inherit;
}
.ff-chip small { color: var(--icl-muted); font-size: 11px; }
.icl .ff-chip:hover, .icl .ff-swatch:hover { border-color: var(--icl-eye); background: var(--icl-mist-2); }
.icl .ff-chip.on, .icl .ff-swatch.on { border-color: var(--icl-blue); background: var(--icl-blue); color: #fff; }
.ff-chip.on small { color: rgba(255, 255, 255, .85); }
.ff-swatches { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
.icl .ff-swatch { border-radius: 9px; padding: 4px 8px; font-size: 12.5px; min-width: 0; }
.ff-swatch span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ff-swatch i, .frame-card .dots i { flex: 0 0 auto; width: 16px; height: 16px; border-radius: 50%; display: inline-block; border: 1px solid rgba(0, 0, 0, .18); }
.ff-swatch.on i { border-color: #fff; box-shadow: 0 0 0 1px rgba(255, 255, 255, .6); }
.ff-toggle { display: inline-flex; gap: 7px; align-items: center; margin: 0 0 0 4px; padding: 6px 4px; font-size: 13.5px; font-weight: 600; cursor: pointer; white-space: nowrap; }
.ff-toggle input { width: 16px; height: 16px; accent-color: var(--icl-blue); }

/* Show all filters: every group open at once as a grid of labelled sections (not sticky, so it doesn't cover the cards) */
.icl .ff-showall {
  display: inline-flex; align-items: center; gap: 6px; margin-left: auto; padding: 6px 12px; border-radius: 999px; cursor: pointer; font-family: inherit;
  border: 1px solid transparent; background: none; color: var(--icl-accent-ink); font-size: 13.5px; font-weight: 600; white-space: nowrap;
}
.icl .ff-showall:hover { background: var(--icl-mist-2); border-color: var(--icl-line); }
.ff-showall svg { width: 15px; height: 15px; }
.finder-toolbar.show-all { position: static; }
/* Balanced columns (up to 3) so short groups stack under each other instead of leaving gaps under them */
.show-all .ff-drops { display: block; columns: 3 250px; column-gap: 32px; padding-top: 4px; }
.show-all .ff-drop { display: block; break-inside: avoid; margin-bottom: 16px; }
.show-all .ff-drop[hidden] { display: none; }
.show-all .ff-drop summary, .show-all .ff-drop[open] summary, .show-all .ff-drop.set summary {
  padding: 0 0 6px; border: 0; border-radius: 0; background: none; cursor: default; color: var(--icl-muted);
  font-size: 11.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
}
.show-all .ff-drop summary:hover { background: none; }
.show-all .ff-drop .caret, .show-all .ff-n { display: none; }
.show-all .ff-pop, .show-all .ff-drop.wide .ff-pop { position: static; width: auto; min-width: 0; max-width: none; padding: 0; border: 0; border-radius: 0; background: none; box-shadow: none; }
.show-all .ff-swatches { grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); }
.show-all .ff-makers { max-height: none; }
.ff-extras { display: contents; }
.show-all .ff-extras { display: flex; align-items: center; gap: 12px; column-span: all; padding-top: 10px; border-top: 1px solid var(--icl-line-2); }
.show-all .ff-toggle { margin: 0; }

/* Price: a two-handle slider (two range inputs on one track) */
.ff-range { padding: 2px 4px 4px; }
.ff-range-out { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; margin-bottom: 10px; font-weight: 700; font-size: 15px; font-variant-numeric: tabular-nums; color: var(--icl-ink); }
.ff-range-out span { color: var(--icl-muted); font-weight: 500; font-size: 12.5px; }
.ff-range-track { position: relative; height: 28px; }
.ff-range-track::before, .ff-range-track .fill { content: ''; position: absolute; top: 50%; height: 4px; margin-top: -2px; border-radius: 4px; }
.ff-range-track::before { left: 0; right: 0; background: var(--icl-line); }
.ff-range-track .fill { background: var(--icl-blue); left: 0; right: 0; }
.ff-range-track input[type=range] {
  position: absolute; inset: 0; width: 100%; height: 28px; margin: 0; background: none; pointer-events: none; -webkit-appearance: none; appearance: none;
}
.ff-range-track input[type=range]::-webkit-slider-runnable-track { background: none; border: 0; height: 28px; }
.ff-range-track input[type=range]::-moz-range-track { background: none; border: 0; }
.ff-range-track input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none; pointer-events: auto; width: 22px; height: 22px; margin-top: 3px; border-radius: 50%;
  background: #fff; border: 2px solid var(--icl-blue); box-shadow: 0 1px 4px rgba(0, 0, 0, .25); cursor: grab;
}
.ff-range-track input[type=range]::-moz-range-thumb {
  pointer-events: auto; width: 18px; height: 18px; border-radius: 50%; background: #fff; border: 2px solid var(--icl-blue); box-shadow: 0 1px 4px rgba(0, 0, 0, .25); cursor: grab;
}
.ff-range-track input[type=range]:focus-visible::-webkit-slider-thumb { box-shadow: 0 0 0 4px rgba(15, 107, 146, .3); }
.ff-price-points { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--icl-line-2); }


.finder-count { color: var(--icl-muted); font-size: 14px; }
.finder-count strong { color: var(--icl-ink); font-size: 16px; }
.finder-sort { display: flex; align-items: center; gap: 8px; margin: 0; font-size: 13px; color: var(--icl-muted); }
.icl-page .finder-sort .form-select { width: auto; min-width: 180px; }
.finder-active { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-bottom: 12px; }
.finder-active:empty { display: none; }
.icl .ff-active-chip { background: var(--icl-mist); border-color: transparent; color: var(--icl-accent-ink); font-weight: 600; font-size: 12.5px; }
.icl .ff-active-chip:hover { background: var(--icl-sky); }
.icl .btn-link { background: none; border: 0; padding: 0 4px; color: var(--icl-link); font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; text-decoration: underline; }
.finder-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(215px, 1fr)); gap: 14px; }
.icl .frame-card {
  display: flex; flex-direction: column; border-radius: var(--icl-radius); border: 1px solid var(--icl-line); background: var(--icl-surface);
  box-shadow: var(--icl-shadow); color: var(--icl-ink); text-decoration: none; overflow: hidden; transition: border-color .15s, transform .15s;
}
.icl .frame-card:hover, .icl .frame-card:focus-visible { border-color: var(--icl-eye); transform: translateY(-2px); color: var(--icl-ink); }
.frame-card .pic { position: relative; display: block; background: #fff; padding: 10px 8px; border-bottom: 1px solid var(--icl-line-2); }
.frame-card .pic img { width: 100%; height: auto; aspect-ratio: 600 / 296; object-fit: contain; display: block; }
.best-badge {
  display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 999px; background: var(--icl-red); color: #fff;
  font-size: 11px; font-weight: 700; letter-spacing: .01em; white-space: nowrap; vertical-align: 2px;
}
.best-badge .icl-svg { width: 12px; height: 12px; }
.frame-card .pic .best-badge { position: absolute; left: 8px; top: 8px; max-width: calc(100% - 16px); overflow: hidden; text-overflow: ellipsis; }
.frame-card .body { display: flex; flex-direction: column; gap: 3px; padding: 10px 12px 12px; flex: 1 1 auto; }
.frame-card .name { font-size: 15px; font-weight: 700; }
.frame-card .coll { font-size: 12.5px; color: var(--icl-muted); }
.frame-card .meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 12.5px; color: var(--icl-ink-2); margin-top: 2px; }
.frame-card .dots { display: inline-flex; }
.frame-card .dots i { width: 13px; height: 13px; margin-right: -3px; border: 1.5px solid var(--icl-surface); }
.frame-card .dots i:last-child { margin-right: 2px; }
.frame-card .tags { display: flex; gap: 4px; flex-wrap: wrap; }
.frame-card .tags em { font-style: normal; font-size: 11px; font-weight: 600; padding: 1px 7px; border-radius: 999px; background: var(--icl-mist); color: var(--icl-accent-ink); }
.frame-card .price { margin-top: auto; padding-top: 6px; font-weight: 700; font-size: 15px; font-variant-numeric: tabular-nums; }
.finder-more { display: flex; justify-content: center; margin-top: 16px; }
.frame-header .best-badge { margin-left: 8px; background: #fff; color: var(--icl-red); }
.frame-sort { display: flex; align-items: center; gap: 6px; margin: 0 0 8px auto; }
.frame-sort .icl-label { margin: 0 4px 0 0; }
.icl .frame-sort .seg { padding: 5px 12px; border-radius: 999px; border: 1px solid var(--icl-line); background: var(--icl-surface); color: var(--icl-ink); font-size: 13px; font-weight: 600; cursor: pointer; }
.icl .frame-sort .seg.active { background: var(--icl-blue); border-color: var(--icl-blue); color: #fff; }
.frame-group { scroll-margin-top: calc(var(--icl-topbar-h) + 12px); }
.frame-group.is-target { border-color: var(--icl-eye); box-shadow: 0 0 0 3px rgba(15, 107, 146, .25), var(--icl-shadow); }
/* Narrow desktops and tablets: the circles go two even rows of five; the toolbar's sort narrows. */
@media (min-width: 576px) and (max-width: 1199.98px) {
  .frame-circles { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .frame-circle .ring { max-width: 68px; }
  .icl-page .finder-sort .form-select { min-width: 150px; }
  .finder-search { flex-basis: 220px; }
}
@media (max-width: 991.98px) {
  .finder-toolbar { position: static; }
  .finder-search { flex: 1 1 100%; }
  .finder-toolbar .finder-sort { margin-left: auto; }
}
@media (max-width: 575.98px) {
  .frame-circles { display: flex; gap: 10px; margin-inline: -4px; overflow-x: auto; overscroll-behavior-x: contain; scrollbar-width: none; }
  .frame-circles::-webkit-scrollbar { display: none; }
  .icl .frame-circle { flex: 0 0 72px; }
  .frame-circle .ring { width: 66px; height: 66px; }
  .ff-drop { position: static; }
  .ff-drops { position: relative; }
  .ff-pop, .ff-drop.wide .ff-pop { left: 0; right: 0; width: auto; max-width: none; }
  .finder-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .frame-card .body { padding: 8px 9px 10px; }
  .frame-card .name { font-size: 14px; }
  .frame-card .pic .best-badge { font-size: 10px; padding: 1px 6px; }
  .icl-page .finder-sort .form-select { min-width: 0; }
  .finder-sort > span { display: none; }
  .ff-swatches { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .show-all .ff-swatches { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

html[data-theme=dark] .ff-swatch i, html[data-theme=dark] .frame-card .dots i { border-color: rgba(255, 255, 255, .45); }

/* Frames: one collection as cards (stock-order/frames-in-collection) */
.collection-head { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 28px; padding: 14px 20px; margin-bottom: 18px; }
.collection-head .vendor-logo { width: 150px; height: 64px; }
.collection-facts { display: flex; flex-wrap: wrap; gap: 8px 28px; margin: 0; }
.collection-facts div { display: flex; flex-direction: column; }
.collection-facts dt { font-size: 11.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--icl-muted); }
.collection-facts dd { margin: 0; font-size: 17px; font-weight: 700; color: var(--icl-ink); font-variant-numeric: tabular-nums; }
.icl .collection-list-link { margin-left: auto; gap: 6px; }
.frame-footer .btn-back { margin-right: auto; gap: 6px; }

/* Frames: one frame (stock-order/frame) */
.frame-page { display: grid; gap: 18px; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); align-items: start; }
.frame-page .frame-order { grid-column: 1 / -1; }
.frame-gallery { padding: 16px; }
.frame-photo { background: #fff; border-radius: 12px; border: 1px solid var(--icl-line); padding: 18px; }
.frame-photo img { width: 100%; height: auto; aspect-ratio: 600 / 296; object-fit: contain; display: block; }
.frame-photo { position: relative; }
.frame-zoom-btn { display: none; position: absolute; z-index: 1; right: 10px; bottom: 10px; align-items: center; gap: 4px; padding: 4px 10px; border-radius: 16px; border: 1px solid var(--icl-line); background: var(--icl-surface); color: var(--icl-ink-2); font-size: 13px; cursor: pointer; }
.frame-zoom-btn svg { width: 15px; height: 15px; }
.frame-photo.can-zoom .frame-zoom-btn { display: inline-flex; }
.frame-photo.can-zoom img { cursor: zoom-in; }
.pictureBig { position: relative; }
.pictureBig.can-zoom .frame-zoom-btn { display: inline-flex; }
.pictureBig.can-zoom img { cursor: zoom-in; }
@media print { .frame-zoom-btn { display: none !important; } }
.frame-thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 8px; margin-top: 12px; }
.icl .frame-thumb {
  display: flex; flex-direction: column; gap: 4px; padding: 6px; border-radius: 10px; border: 1px solid var(--icl-line);
  background: var(--icl-surface); color: var(--icl-ink); cursor: pointer; font: inherit; text-align: left; min-width: 0;
}
.frame-thumb img { width: 100%; height: auto; aspect-ratio: 600 / 296; object-fit: contain; background: #fff; border-radius: 6px; display: block; }
.frame-thumb span { display: flex; align-items: center; gap: 5px; font-size: 11.5px; line-height: 1.25; overflow: hidden; }
.frame-thumb span, .frame-variant-name strong { white-space: nowrap; text-overflow: ellipsis; }
.frame-thumb i, .frame-variant-name i { flex: 0 0 auto; width: 11px; height: 11px; border-radius: 50%; display: inline-block; border: 1px solid rgba(0, 0, 0, .2); }
.icl .frame-thumb:hover { border-color: var(--icl-eye); }
.icl .frame-thumb.on { border-color: var(--icl-blue); box-shadow: 0 0 0 2px rgba(15, 107, 146, .2); }
.frame-info { padding: 18px 20px; }
.frame-info-head { display: flex; align-items: center; gap: 14px; }
.frame-info-collection { font-size: 14px; color: var(--icl-muted); }
.frame-info-collection a { font-weight: 600; text-decoration: none; }
.frame-info-price { font-size: 24px; font-weight: 700; color: var(--icl-ink); font-variant-numeric: tabular-nums; margin-top: 2px; }
.frame-tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 14px 0 4px; }
.frame-tag { display: inline-flex; align-items: center; padding: 2px 10px; border-radius: 999px; background: var(--icl-mist); color: var(--icl-accent-ink); font-size: 12px; font-weight: 600; }
.frame-tags .best-badge { font-size: 12px; padding: 2px 10px; vertical-align: 0; }
.frame-section-title { font-size: 15px; font-weight: 700; margin: 18px 0 8px; color: var(--icl-ink); }
.frame-measure { width: 100%; border-collapse: collapse; font-size: 14px; font-variant-numeric: tabular-nums; }
.frame-measure th { font-size: 11.5px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--icl-muted); text-align: left; padding: 6px 10px 6px 0; border-bottom: 1px solid var(--icl-line); white-space: nowrap; }
.frame-measure td { padding: 7px 10px 7px 0; border-bottom: 1px solid var(--icl-line-2); color: var(--icl-ink); white-space: nowrap; }
.frame-measure-note { margin: 6px 0 0; font-size: 12px; color: var(--icl-muted); }
.frame-order { padding: 4px 20px 16px; }
.frame-order-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: flex-start; gap: 10px 20px; margin-bottom: 10px; }
.frame-order-head .frame-section-title { margin-bottom: 4px; }
.frame-order-note { margin: 0 0 10px; font-size: 14px; color: var(--icl-muted); }
.frame-matrix-scroll { overflow-x: auto; overscroll-behavior-x: contain; }
.frame-matrix { border-collapse: separate; border-spacing: 0; font-variant-numeric: tabular-nums; }
.frame-matrix thead th { font-size: 12px; font-weight: 700; color: var(--icl-muted); padding: 6px 8px; text-align: center; white-space: nowrap; border-bottom: 1px solid var(--icl-line); }
.frame-matrix thead th:first-child { text-align: left; padding-left: 0; }
.frame-matrix tbody th { position: sticky; left: 0; z-index: 1; background: var(--icl-surface); padding: 6px 14px 6px 0; text-align: left; font-weight: 600; white-space: nowrap; }
.frame-matrix tbody th img { width: 96px; height: auto; aspect-ratio: 600 / 296; object-fit: contain; background: #fff; border-radius: 8px; border: 1px solid var(--icl-line-2); cursor: pointer; vertical-align: middle; margin-right: 10px; }
.frame-matrix td { padding: 6px 8px; text-align: center; border-bottom: 1px solid var(--icl-line-2); vertical-align: middle; }
.frame-matrix tbody th { border-bottom: 1px solid var(--icl-line-2); }
.frame-matrix td small { display: block; font-size: 11.5px; color: var(--icl-ink-2); margin-top: 2px; }
.frame-matrix tr:focus-within th, .frame-matrix tr:focus-within td { background: var(--icl-mist-2); }
.icl-page .frame-matrix .item-qty { width: 64px; text-align: right; margin: 0 auto; }
.frame-matrix-none { color: var(--icl-muted); }
.frame-variant-name { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; color: var(--icl-ink); }
.frame-related-section { margin-top: 26px; }
.frame-related-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.frame-related-head a { white-space: nowrap; font-weight: 600; font-size: 14px; text-decoration: none; display: inline-flex; align-items: center; gap: 2px; }
.frame-related-head .icl-svg { width: 16px; height: 16px; }
@media (max-width: 991.98px) {
  .frame-page { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 575.98px) {
  .collection-head { padding: 12px 16px; gap: 12px 20px; }
  .collection-head .vendor-logo { width: 110px; height: 48px; }
  .icl .collection-list-link { margin-left: 0; }
  .frame-gallery { padding: 10px; }
  .frame-photo { padding: 10px; }
  .frame-thumbs { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .frame-info, .frame-order { padding-inline: 14px; }
  .frame-matrix tbody th img { width: 64px; margin-right: 6px; }
  .frame-matrix tbody th { padding-right: 8px; }
  .frame-variant-name { font-size: 13px; }
  .icl-page .frame-matrix .item-qty { width: 56px; }
  .frame-matrix td { padding: 6px 4px; }
}
html[data-theme=dark] .frame-thumb i, html[data-theme=dark] .frame-variant-name i { border-color: rgba(255, 255, 255, .45); }

/* Frames: Iris logins switch between the new and classic frame pages */
.icl .frames-view-switch { margin-left: auto; font-size: 13px; font-weight: 600; }
.frames-view-promo {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px;
  margin-bottom: 16px; padding: 10px 14px; border-radius: 12px; background: var(--icl-mist); color: var(--icl-accent-ink); font-size: 14px; font-weight: 500;
}
.frames-view-promo span { display: inline-flex; align-items: center; gap: 8px; }
.frames-view-promo .icl-svg { width: 18px; height: 18px; flex: 0 0 auto; }

/* Accessories (stock-order/accessories) */
.icl-page .qty-input { width: 80px; text-align: right; }
.sticky-actions .btn-back { order: -1; }

/* Stock lenses: lens picker (stock-order/material) and chart (material-view-chart) */
.icl-crumbs { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: -8px 0 16px; font-size: 13.5px; color: var(--icl-muted); }
.icl-crumbs a { font-weight: 600; text-decoration: none; }
.lens-picker { display: grid; gap: 14px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 992px) { .lens-picker { grid-template-columns: repeat(3, minmax(0, 1fr)); max-width: 900px; } }
.lens-picker label { margin: 0; }
.lens-picker select { width: 100%; }
.lens-results-title { font-size: 15px; margin: 0; }
.lens-results .view-chart { white-space: nowrap; }
.lens-chart-toolbar .icl-card-body { display: flex; flex-wrap: wrap; gap: 16px 24px; align-items: flex-end; }
.lens-tray { margin: 0; flex: 0 1 220px; }
.lens-tray .form-control { width: 100%; }
.lens-legend { display: flex; flex-wrap: wrap; gap: 14px; font-size: 13px; color: var(--icl-ink-2); padding-bottom: 10px; }
.lens-legend span { display: inline-flex; align-items: center; gap: 6px; }
.lens-legend i { width: 14px; height: 14px; border-radius: 4px; display: inline-block; border: 1px solid var(--icl-line); }
.lens-legend i.green, .lens-chart .entry span.green { background: var(--icl-ok-bg); color: var(--icl-ok); }
.lens-legend i.yellow, .lens-chart .entry span.yellow { background: var(--icl-warn-bg); color: var(--icl-warn); }
.lens-legend i.red, .lens-chart .entry span.red { background: var(--icl-bad-bg); color: var(--icl-red); }
.lens-chart-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-left: auto; }
.lens-chart-card { margin-top: 18px; }
.lens-chart-scroll { overflow: auto; overscroll-behavior: contain; max-height: 75vh; max-height: 75dvh; border-radius: 0 0 var(--icl-radius) var(--icl-radius); }
.lens-chart { border-collapse: separate; border-spacing: 0; font-size: 12.5px; font-variant-numeric: tabular-nums; margin: 0 auto; }
.lens-chart th {
  position: sticky; z-index: 2; background: var(--icl-blue-700); color: #fff; font-weight: 600;
  padding: 6px 8px; text-align: center; white-space: nowrap;
}
.lens-chart thead th { top: 0; }
.lens-chart tfoot th { bottom: 0; }
.lens-chart tbody th { left: 0; z-index: 1; background: var(--icl-blue); }
.lens-chart tbody th.end { left: auto; right: 0; }
.lens-chart th.corner { z-index: 3; left: 0; background: var(--icl-blue-800); }
.lens-chart th.corner.end { left: auto; right: 0; }
.lens-chart td { padding: 3px; border-bottom: 1px solid var(--icl-line-2); border-right: 1px solid var(--icl-line-2); }
.lens-chart td.nodetail { background: repeating-linear-gradient(45deg, #f2f5f7, #f2f5f7 4px, #e9eef1 4px, #e9eef1 8px); }
.lens-chart .entry { display: flex; align-items: stretch; border-radius: 7px; overflow: hidden; border: 1px solid var(--icl-field-line); background: var(--icl-surface); min-width: 62px; }
.icl-page .lens-chart .entry input {
  width: 34px; min-height: 28px; padding: 2px 4px; border: 0; border-radius: 0;
  text-align: right; font-size: 13px; background: var(--icl-surface); color: var(--icl-ink); box-shadow: none;
}
.icl-page .lens-chart .entry input:focus { background: var(--icl-mist); }
.lens-chart .entry span { flex: 1 1 auto; display: flex; align-items: center; justify-content: flex-end; padding: 0 5px; font-size: 11.5px; font-weight: 700; }
.lens-chart-foot { margin-top: 18px; display: flex; justify-content: flex-end; }
.lens-legend i.green { border-color: var(--icl-ok); }
.lens-legend i.yellow { border-color: var(--icl-warn); }
.lens-legend i.red { border-color: var(--icl-red); }
html[data-theme=dark] .lens-chart td.nodetail { background: repeating-linear-gradient(45deg, #111c23, #111c23 4px, #16232c 4px, #16232c 8px); }

/* Option cards: shipping label services, pricing views (same size on both) */
.label-options, .option-cards { display: grid; gap: 18px; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.label-option .icl-card-body, .option-card .icl-card-body { display: flex; flex-direction: column; gap: 6px; height: 100%; }
.label-option + .label-option, .option-card + .option-card { margin-top: 0; }
.label-option .ico, .option-card .ico { width: 44px; height: 44px; border-radius: 12px; display: inline-flex; align-items: center; justify-content: center; background: var(--icl-mist); color: var(--icl-accent-ink); margin-bottom: 6px; }
.label-option h2, .option-card h2 { font-size: 17px; margin: 0; }
.label-option p, .option-card p { margin: 0; color: var(--icl-muted); font-size: 13.5px; }
.label-option .price { font-size: 26px; font-weight: 700; margin: 8px 0 12px; }
.label-option .price small { font-size: 13px; font-weight: 500; color: var(--icl-muted); }
.label-option form { margin-top: auto; }
.label-option .btn, .option-card .btn { width: 100%; }
.option-card .btn { margin-top: auto; }
.option-card p { margin-bottom: 14px; }
.icl-grid > .icl-card + .icl-card, .collection-list > .icl-card + .icl-card { margin-top: 0; }

/* Payment */
.payment-balance, .payment-note { margin-bottom: 18px; }
.payment-card { margin-top: 0; }
.payment-card #NewCenposPlugin { padding: 8px; }
@media (min-width: 768px) { .payment-card #NewCenposPlugin { min-width: 710px; } }
.label-options > .icl-card + .icl-card { margin-top: 0; }

/* ------------------------------------------------------------------ */
/* Older pages inside the new shell                                    */
/* ------------------------------------------------------------------ */
/* Their markup was built for a ~950px wide desktop page: it sits on one
   white panel and scrolls sideways on narrow screens instead of breaking. */
.legacy-panel {
  background: var(--icl-surface); border: 1px solid var(--icl-line);
  border-radius: var(--icl-radius); box-shadow: var(--icl-shadow);
  padding: 20px; overflow-x: auto; overscroll-behavior-x: contain;
  font-size: 1rem;         /* the older pages were laid out at 16px */
}
@media (max-width: 991.98px) {
  .legacy-panel { padding: 14px; }
  .legacy-panel > .legacy-inner { min-width: 900px; }
}
/* Login box: centred in the content area rather than over the whole window */
.app-content .site-login { position: static; transform: none; margin: 8vh auto 0; min-width: 0; width: 100%;
  background: var(--icl-surface); border-color: var(--icl-line); border-radius: var(--icl-radius); box-shadow: var(--icl-shadow); }
@media print {
  .legacy-panel { border: 0; box-shadow: none; padding: 0; overflow: visible; }
}

/* ------------------------------------------------------------------ */
/* Theme switch (account menu)                                         */
/* ------------------------------------------------------------------ */
.app-theme { padding: 6px 10px 8px; border-top: 1px solid var(--icl-line-2); margin-top: 6px; }
.app-theme-label { font-size: 12px; font-weight: 600; color: var(--icl-muted); margin-bottom: 6px; }
.app-theme-options { display: flex; gap: 4px; padding: 3px; background: var(--icl-tabs-bg); border-radius: 10px; }
.app-user-menu .app-theme-options button {
  flex: 1 1 0; justify-content: center; gap: 6px; min-height: 34px; padding: 4px 6px;
  font-size: 13px; font-weight: 600; color: var(--icl-ink-2) !important;
}
.app-user-menu .app-theme-options button .icl-svg { width: 16px; height: 16px; }
.app-user-menu .app-theme-options button[aria-pressed=true] {
  background: var(--icl-surface); color: var(--icl-accent-ink) !important; box-shadow: 0 1px 3px rgba(15, 50, 70, .18);
}

/* ------------------------------------------------------------------ */
/* Dark mode                                                           */
/* ------------------------------------------------------------------ */
/* <html data-theme="dark"> is set before the page paints (layouts/main.php)
   from the account menu choice, or the system setting when it's "System".
   data-bs-theme="dark" goes on with it, so Bootstrap's own components
   (and the older pages built from them) follow. */
html[data-theme=dark] {
  color-scheme: dark;
  --icl-ink: #e2ecf1;
  --icl-ink-2: #b8c9d3;
  --icl-muted: #8ea3b0;
  --icl-line: #2b3d49;
  --icl-line-2: #223340;
  --icl-bg: #0d161c;
  --icl-surface: #152029;
  --icl-hover: #1b2934;
  --icl-field-line: #3a4f5d;
  --icl-disabled-bg: #1d2a33;
  --icl-tabs-bg: #0f1a21;
  --icl-mist: #12313f;
  --icl-mist-2: #1a2b36;
  --icl-sky: #1f4a60;
  --icl-eye: #3f87a8;
  --icl-link: #74c3e6;
  --icl-link-hover: #a6dbf2;
  --icl-accent-ink: #8fd0ee;
  --icl-accent-ink-strong: #c4e8f8;

  --icl-ok: #70d3a1;
  --icl-ok-bg: #12301f;
  --icl-warn: #f2c766;
  --icl-warn-bg: #352a0e;
  --icl-bad-bg: #3a191d;

  --icl-shadow: 0 1px 2px rgba(0, 0, 0, .35), 0 4px 16px rgba(0, 0, 0, .25);
  --icl-shadow-lg: 0 12px 40px rgba(0, 0, 0, .55);

  --bs-body-bg: var(--icl-bg);
  --bs-body-color: var(--icl-ink);
  --bs-border-color: var(--icl-line);
  --bs-link-color: var(--icl-link);
  --bs-link-color-rgb: 116, 195, 230;
  --bs-link-hover-color: var(--icl-link-hover);
  --bs-link-hover-color-rgb: 166, 219, 242;
  --bs-secondary-color: var(--icl-muted);
  --bs-tertiary-bg: var(--icl-hover);
}
html[data-theme=dark] .icl-page .pill-bad { color: #f19aa1; }
html[data-theme=dark] .icl-page .alert-danger, html[data-theme=dark] .icl-error-box { border-color: #6b2a31; color: #f5c6ca; }
html[data-theme=dark] .icl-page .alert-success { border-color: #24563b; color: #b9ecd0; }
html[data-theme=dark] .icl-page .alert-warning { border-color: #5c4a16; color: #f5e0a8; }
html[data-theme=dark] .icl-notice { color: var(--icl-ink); }

/* Shell */
html[data-theme=dark] .app-sidebar { background: linear-gradient(180deg, #0c4660 0%, #082a3a 100%); }
html[data-theme=dark] .app-nav-link.active { background: rgba(255, 255, 255, .14); color: #fff !important; box-shadow: none; }
html[data-theme=dark] .app-topbar { background: rgba(21, 32, 41, .92); }
html[data-theme=dark] .app-skip { background: var(--icl-surface); }
html[data-theme=dark] .icl-tabs a:hover { background: rgba(255, 255, 255, .06); }
@media (max-width: 991.98px) {
  html[data-theme=dark] .app-topbar { background: #0c4660; }
}

/* Older pages: hard-coded light colours from my-icl.css and the views */
html[data-theme=dark] .legacy-panel .orderform-header1 { background-color: #1f4a60; color: var(--icl-ink); border-color: var(--icl-surface); }
html[data-theme=dark] .legacy-panel .bg-white { background-color: var(--icl-surface) !important; }
html[data-theme=dark] .legacy-panel .btn-light { background-color: var(--icl-hover); border-color: var(--icl-field-line); color: var(--icl-ink); }
html[data-theme=dark] .legacy-panel input:not([type=checkbox]):not([type=radio]):not([type=submit]):not([type=button]):not(.form-control),
html[data-theme=dark] .legacy-panel select:not(.form-select), html[data-theme=dark] .legacy-panel textarea:not(.form-control) {
  background-color: var(--icl-tabs-bg); border: 1px solid var(--icl-field-line); color: var(--icl-ink);
}
html[data-theme=dark] .legacy-panel input[type="text"]:disabled { background-color: var(--icl-disabled-bg); }
html[data-theme=dark] .legacy-panel .errored { background-color: var(--icl-bad-bg); }
html[data-theme=dark] .legacy-panel #ErrorDiv { background-color: var(--icl-bad-bg); border-color: #6b2a31; color: #f5c6ca; }
html[data-theme=dark] .legacy-panel img { background-color: transparent; }
html[data-theme=dark] .ui-autocomplete, html[data-theme=dark] .ui-menu .ui-menu-item-wrapper { background: var(--icl-surface); color: var(--icl-ink); border-color: var(--icl-line); }
html[data-theme=dark] .ui-menu .ui-state-active { background: var(--icl-blue); border-color: var(--icl-blue); color: #fff; }
html[data-theme=dark] .pill:not(.pill-ok):not(.pill-warn):not(.pill-bad):not(.pill-muted) { color: var(--icl-accent-ink); }
html[data-theme=dark] .icl-page .alert-info { color: var(--icl-ink); }

/* Stock ordering (cart, lens chart, frames, order view): the views'
   own <style> blocks paint light row stripes and bright stock colours,
   which the dark theme's light text can't be read on. */
html[data-theme=dark] .legacy-panel th { background: var(--icl-blue); color: #fff; }
html[data-theme=dark] .legacy-panel tr.odd,
html[data-theme=dark] .legacy-panel tr:nth-child(odd).detail,
html[data-theme=dark] .legacy-panel #order-form table tbody tr:nth-child(odd) { background: #1a2a35; }
html[data-theme=dark] .legacy-panel tr.even,
html[data-theme=dark] .legacy-panel tr:nth-child(even).detail,
html[data-theme=dark] .legacy-panel #order-form table tbody tr:nth-child(even) { background: #22394a; }
html[data-theme=dark] .legacy-panel tr.highlight { background: #1d5034; }
html[data-theme=dark] .legacy-panel tr.odd input, html[data-theme=dark] .legacy-panel tr.even input,
html[data-theme=dark] .legacy-panel .input-allowed {
  background: var(--icl-tabs-bg) !important; color: var(--icl-ink); border-bottom-color: var(--icl-eye) !important;
}
html[data-theme=dark] .legacy-panel .entry { border-color: var(--icl-field-line); }
html[data-theme=dark] .legacy-panel td.nodetail { background: #111c23; }
html[data-theme=dark] .legacy-panel .red, html[data-theme=dark] .legacy-panel td.RED { background-color: #8a1f2a !important; color: #ffe1e4; }
html[data-theme=dark] .legacy-panel .yellow, html[data-theme=dark] .legacy-panel td.YELLOW { background-color: #806400 !important; color: #fff6d1; }
html[data-theme=dark] .legacy-panel .green, html[data-theme=dark] .legacy-panel td.GREEN { background-color: #1f6b42 !important; color: #dcfbe8; }
html[data-theme=dark] .legacy-panel [style*="color: red"], html[data-theme=dark] .legacy-panel font[color] { color: #ff8f99 !important; }
/* Frames: the product photos are shot on white, so in dark mode each frame
   group is a light card (photos sit on it naturally) under a blue header. */
html[data-theme=dark] .legacy-panel .frame-group {
  background: #fff; color: #14232c; border-radius: 12px; overflow: hidden; margin-bottom: 16px;
}
html[data-theme=dark] .legacy-panel .frame-group :is(div, span, br) { color: #14232c; }
html[data-theme=dark] .legacy-panel .frame-group .frame-header {
  background: var(--icl-blue); color: #fff; margin: 0; border-top: 0; padding: 8px 14px;
}
html[data-theme=dark] .legacy-panel .frame-group .frame-row { padding: 10px 0; }
html[data-theme=dark] .legacy-panel .frame-group input:not([type=checkbox]):not([type=radio]) {
  background-color: #fff !important; color: #14232c !important; border: 1px solid #b9cbd6 !important;
}
/* The page's script pins the Add to Cart bar to the bottom with an inline
   white background when the list is short. */
html[data-theme=dark] .legacy-panel .frame-footer { background-color: var(--icl-surface) !important; }
html[data-theme=dark] .legacy-panel [style*="background: #666666"] { background: #2b3d49 !important; }
html[data-theme=dark] .legacy-panel [style*="background: #444444"] { background: #0c2f40 !important; }

/* Pricing (link lists, PDF) */
.link-list { list-style: none; margin: 0; padding: 6px 0; }
.link-list li a { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 46px; padding: 10px 20px; text-decoration: none; font-weight: 600; color: var(--icl-ink) !important; border-bottom: 1px solid var(--icl-line-2); }
.link-list li:last-child a { border-bottom: 0; }
.link-list li a:hover { background: var(--icl-mist-2); color: var(--icl-accent-ink) !important; }
.link-list .icl-svg { width: 16px; height: 16px; color: var(--icl-muted); }
.pdf-card { overflow: hidden; }
.pdf-card iframe { display: block; width: 100%; height: 78vh; height: 78dvh; border: 0; }
.pdf-hint { display: none; margin-top: 10px; color: var(--icl-muted); font-size: 13px; }
@media (max-width: 991.98px) { .pdf-hint { display: block; } }
.statement-link { display: inline-flex; align-items: center; gap: 10px; font-weight: 600; text-decoration: none; }

/* Order view / job slip: scrolls sideways on phones, plain on paper */
.order-slip .icl-card-body { min-width: 840px; }
.order-slip .bg-black { background-color: var(--icl-blue-800) !important; }
@media print {
  .icl-card, .order-slip { border: 0 !important; box-shadow: none !important; border-radius: 0 !important; }
  .icl-table-wrap { overflow: visible !important; }
  .order-slip .icl-card-body { min-width: 0; padding: 0; }
}

html[data-theme=dark] .order-slip .bg-black { background-color: var(--icl-blue) !important; }
html[data-theme=dark] .order-slip .bg-white { background-color: transparent !important; }
/* Barcodes stay black on white so they still scan from the screen */
html[data-theme=dark] .order-slip :is(#showBarcode, #showBarcode2) { background: #fff; }
