/* ==================================================================
   SDPL Quality Control - shared "Pro app" look
   Same design language as SDPLProApp (Production Control) and the
   Enterprise Hub: dark canvas with a theme-coloured wash and grid,
   round brand mark, mono eyebrow, Inter type, pill buttons, flat red
   power button, panel cards. Loaded AFTER each page's own <style>, so
   it only restyles - page logic and ids are untouched.
   ================================================================== */

:root {
    --rd-canvas: #0b1020;
    --rd-wash:
        radial-gradient(1100px circle at 8% -8%, rgba(var(--theme-rgb), 0.22) 0%, rgba(var(--theme-rgb), 0) 62%),
        radial-gradient(800px circle at 98% 4%, rgba(var(--theme-rgb), 0.12) 0%, rgba(var(--theme-rgb), 0) 58%),
        radial-gradient(900px circle at 50% 108%, rgba(var(--theme-rgb), 0.08) 0%, rgba(var(--theme-rgb), 0) 60%),
        repeating-radial-gradient(circle at 78% 18%, transparent 0 46px, rgba(var(--theme-rgb), 0.12) 46px 47px),
        repeating-radial-gradient(circle at 12% 95%, transparent 0 60px, rgba(var(--theme-rgb), 0.08) 60px 61px),
        radial-gradient(circle at 20% 25%, rgba(var(--theme-rgb), 0.13) 0%, rgba(var(--theme-rgb), 0.045) 100%);
    --rd-wash-size: auto, auto, auto, auto, auto, auto;
    --rd-panel: linear-gradient(180deg, rgba(255, 255, 255, 0.032) 0%, rgba(255, 255, 255, 0.012) 100%);
    --rd-line: rgba(255, 255, 255, 0.08);
    --rd-muted: #8b9ab1;
    --rd-faint: #6b7890;
    --rd-mono: "IBM Plex Mono", ui-monospace, monospace;
}

/* ---------- base ---------- */
html body.qc-pro {
    background-color: var(--rd-canvas) !important;
    background-image: var(--rd-wash) !important;
    background-size: var(--rd-wash-size) !important;
    background-attachment: fixed !important;
    background-repeat: repeat !important;
    color: #e2e8f0;
    font-family: "Inter", sans-serif;
    min-height: 100vh;
    overflow-x: hidden;
}

body.qc-pro,
body.qc-pro input,
body.qc-pro select,
body.qc-pro textarea,
body.qc-pro button {
    font-family: "Inter", sans-serif;
}

body.qc-pro .material-icons {
    font-family: 'Material Icons' !important;
    font-weight: normal;
    font-style: normal;
    text-transform: none;
    letter-spacing: normal;
    word-wrap: normal;
    white-space: nowrap;
    direction: ltr;
}

/* the old animated backgrounds are not part of the Pro look */
body.qc-pro #particles-js,
body.qc-pro #particleCanvas,
body.qc-pro .particles-js-canvas-el,
body.qc-pro .grid-overlay,
body.qc-pro .glow-blob,
body.qc-pro .glow1,
body.qc-pro .glow2,
body.qc-pro::after {
    display: none !important;
}

body.qc-pro ::-webkit-scrollbar { width: 8px; height: 8px; }
body.qc-pro ::-webkit-scrollbar-thumb { background: rgba(var(--theme-rgb), 0.3); border-radius: 10px; }
body.qc-pro ::-webkit-scrollbar-thumb:hover { background: rgba(var(--theme-rgb), 0.6); }
body.qc-pro ::-webkit-scrollbar-track { background: rgba(255, 255, 255, 0.02); border-radius: 10px; }

/* ==================================================================
   Header (1:1 with the Production Control header)
   ================================================================== */
.rd-header {
    position: relative;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 24px;
    flex-wrap: wrap;
    padding: 0 0 20px 0;
    margin-bottom: 28px;
    z-index: 20;
}

.rd-header::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 1px;
    background: linear-gradient(90deg,
            rgba(var(--theme-rgb), 0.55) 0%,
            rgba(255, 255, 255, 0.10) 30%,
            rgba(255, 255, 255, 0.04) 70%,
            rgba(255, 255, 255, 0) 100%);
}

.rd-head-left { display: flex; align-items: center; gap: 15px; min-width: 0; flex: 1 1 420px; }
.rd-head-text { display: flex; flex-direction: column; gap: 5px; min-width: 0; }

.rd-brandmark {
    position: relative;
    width: 52px;
    height: 52px;
    flex-shrink: 0;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(150deg, rgba(var(--theme-rgb), 0.26), rgba(var(--theme-rgb), 0.04));
    border: 1px solid rgba(var(--theme-rgb), 0.34);
    box-shadow: 0 10px 26px -12px rgba(var(--theme-rgb), 0.85), 0 1px 0 rgba(255, 255, 255, 0.18) inset;
}

.rd-brandmark::before {
    content: "";
    position: absolute;
    inset: -4px;
    border-radius: 50%;
    border: 1px solid rgba(var(--theme-rgb), 0.16);
    pointer-events: none;
}

.rd-brandmark img { width: 42px; height: 42px; border-radius: 50%; object-fit: contain; }

.rd-eyebrow {
    display: flex;
    align-items: center;
    gap: 7px;
    min-width: 0;
    padding-left: 3px;
    font-family: var(--rd-mono);
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: rgba(var(--theme-rgb), 0.92);
    white-space: nowrap;
}

.rd-eyebrow > span:not(.rd-eyebrow-dot),
.rd-eyebrow > a {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    font-family: inherit;
}

.rd-eyebrow-dot {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    flex-shrink: 0;
    background: var(--theme-color);
    box-shadow: 0 0 8px 1px rgba(var(--theme-rgb), 0.8);
}

.rd-eyebrow-sep { color: rgba(255, 255, 255, 0.25); margin: 0 1px; }

/* the module word in the eyebrow leads back to the QC menu */
.rd-eyebrow-link { color: inherit; text-decoration: none; cursor: pointer; }
.rd-eyebrow-link:hover { text-decoration: underline; text-underline-offset: 3px; }

.rd-title {
    margin: 0;
    font-size: 30px;
    font-weight: 700;
    line-height: 1.12;
    letter-spacing: -0.03em;
    background: linear-gradient(180deg, #ffffff 0%, #c7d3e3 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    -webkit-text-fill-color: transparent;
}

.rd-title span {
    font-family: inherit;
    -webkit-text-fill-color: var(--theme-color);
    color: var(--theme-color);
}

.rd-desc { margin: 0; font-size: 13px; line-height: 1.55; color: var(--rd-muted); max-width: 620px; }

.rd-head-right {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
    margin-top: 4px;
}

.rd-chip {
    display: inline-flex;
    align-items: center;
    padding: 9px 14px;
    border-radius: 99px;
    font-family: var(--rd-mono);
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0.04em;
    color: #94a3b8;
    white-space: nowrap;
    background: rgba(255, 255, 255, 0.035);
    border: 1px solid rgba(255, 255, 255, 0.07);
}

.rd-chip:empty { display: none; }

.rd-user {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
    padding: 0 6px 0 10px;
    min-width: 0;
}

.rd-user .user-name {
    font-size: 13.5px;
    font-weight: 600;
    color: #ffffff;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 240px;
}

.user-role-badge {
    display: inline-block;
    font-family: var(--rd-mono);
    font-size: 9.5px;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: rgba(var(--theme-rgb), 0.95);
    background: rgba(var(--theme-rgb), 0.12);
    border: 1px solid rgba(var(--theme-rgb), 0.25);
    padding: 3px 9px;
    border-radius: 99px;
    white-space: nowrap;
}

.rd-hub-btn {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    padding: 11px 18px;
    border-radius: 99px;
    font-family: "Inter", sans-serif;
    font-size: 12.5px;
    font-weight: 600;
    color: #e2e8f0;
    cursor: pointer;
    white-space: nowrap;
    text-decoration: none;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.11) 0%, rgba(255, 255, 255, 0.03) 100%);
    border: 1px solid rgba(255, 255, 255, 0.10);
    border-top-color: rgba(255, 255, 255, 0.24);
    box-shadow: 0 6px 16px -10px rgba(0, 0, 0, 0.9);
    transition: all 0.25s ease;
}

.rd-hub-btn .material-icons { font-size: 16px; vertical-align: middle; }
.rd-hub-btn:active { transform: scale(0.97); }

.rd-hub-btn.rd-back:hover,
.rd-hub-btn.rd-accent:hover {
    color: #fff;
    border-color: rgba(var(--theme-rgb), 0.55);
    background: linear-gradient(180deg, rgba(var(--theme-rgb), 0.22) 0%, rgba(var(--theme-rgb), 0.06) 100%);
    box-shadow: 0 10px 24px -12px rgba(var(--theme-rgb), 0.8);
}

/* page action in the header (e.g. "Add New Form") - theme filled */
.rd-hub-btn.rd-accent {
    color: #fff;
    border-color: rgba(var(--theme-rgb), 0.45);
    background: linear-gradient(180deg, rgba(var(--theme-rgb), 0.30) 0%, rgba(var(--theme-rgb), 0.10) 100%);
}

/* Logout = round red power button, flat (same as Production Control) */
.rd-power {
    position: relative;
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    padding: 0;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #f87171;
    background: rgba(239, 68, 68, 0.12);
    border: 1px solid rgba(239, 68, 68, 0.42);
    box-shadow: none;
    transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease, transform 0.15s ease;
}

.rd-power svg { width: 19px; height: 19px; display: block; }
.rd-power:hover { color: #fff; background: #ef4444; border-color: #ef4444; box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.18); }
.rd-power:active { transform: scale(0.94); }
.rd-power:focus-visible { outline: 2px solid #f87171; outline-offset: 2px; }

/* ==================================================================
   Side menu toggle + drawer (QC only - kept, restyled)
   ================================================================== */
.rd-header .nav-toggle-btn,
.nav-toggle-btn.rd-menu-btn {
    position: static !important;
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    margin: 0 !important;
    padding: 0 !important;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #e2e8f0;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.10) 0%, rgba(255, 255, 255, 0.03) 100%);
    border: 1px solid rgba(255, 255, 255, 0.10);
    border-top-color: rgba(255, 255, 255, 0.22);
    box-shadow: 0 6px 16px -10px rgba(0, 0, 0, 0.9);
    transition: all 0.22s ease;
}

.rd-header .nav-toggle-btn .material-icons { font-size: 21px !important; }

.rd-header .nav-toggle-btn:hover {
    color: #fff;
    border-color: rgba(var(--theme-rgb), 0.55);
    background: linear-gradient(180deg, rgba(var(--theme-rgb), 0.22) 0%, rgba(var(--theme-rgb), 0.06) 100%);
    box-shadow: 0 10px 24px -12px rgba(var(--theme-rgb), 0.8);
}

body.qc-pro .nav-drawer-overlay {
    background: rgba(2, 4, 8, 0.55);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}

body.qc-pro .nav-drawer {
    width: 304px;
    left: -330px;
    background-color: #0d1322;
    background-image:
        radial-gradient(420px circle at 0% 0%, rgba(var(--theme-rgb), 0.20) 0%, rgba(var(--theme-rgb), 0) 65%),
        linear-gradient(rgba(var(--theme-rgb), 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(var(--theme-rgb), 0.03) 1px, transparent 1px);
    background-size: auto, 44px 44px, 44px 44px;
    border-right: 1px solid rgba(var(--theme-rgb), 0.22);
    box-shadow: 24px 0 60px -30px rgba(0, 0, 0, 0.95);
    backdrop-filter: none;
}

body.qc-pro .nav-drawer.active { left: 0; }

body.qc-pro .nav-drawer-header {
    padding: 20px 18px 16px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

body.qc-pro .nav-drawer-brand { display: flex; flex-direction: column; gap: 4px; }

body.qc-pro .nav-drawer-eyebrow {
    display: flex;
    align-items: center;
    gap: 7px;
    font-family: var(--rd-mono);
    font-size: 9.5px;
    font-weight: 600;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: rgba(var(--theme-rgb), 0.92);
}

body.qc-pro .nav-drawer-title {
    font-size: 19px;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: #fff;
}

body.qc-pro .nav-drawer-close {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 19px !important;
    color: #94a3b8;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

body.qc-pro .nav-drawer-close:hover { color: #fff; background: rgba(239, 68, 68, 0.85); border-color: #ef4444; }

body.qc-pro .nav-drawer-menu { padding: 12px 12px 20px; display: flex; flex-direction: column; gap: 4px; }

body.qc-pro .nav-drawer-item {
    padding: 10px 12px;
    gap: 12px;
    border-radius: 12px;
    border: 1px solid transparent;
    border-left: 1px solid transparent;
    color: #cbd5e1;
    transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}

body.qc-pro .nav-drawer-item:hover {
    color: #fff;
    border: 1px solid rgba(var(--theme-rgb), 0.30);
    border-left: 1px solid rgba(var(--theme-rgb), 0.30);
    background: linear-gradient(100deg, rgba(var(--theme-rgb), 0.16) 0%, rgba(var(--theme-rgb), 0.04) 100%);
}

body.qc-pro .nav-drawer-item .material-icons {
    width: 34px;
    height: 34px;
    flex-shrink: 0;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 18px !important;
    color: var(--theme-color);
    background: linear-gradient(150deg, rgba(var(--theme-rgb), 0.22), rgba(var(--theme-rgb), 0.04));
    border: 1px solid rgba(var(--theme-rgb), 0.28);
}

body.qc-pro .nav-drawer-item-title { font-size: 13px; font-weight: 600; }

body.qc-pro .nav-drawer-section {
    padding: 6px 12px 4px;
    font-family: var(--rd-mono);
    font-size: 9px;
    font-weight: 600;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--rd-faint);
}

/* ==================================================================
   Form pages (Packaging checklists, Random QC, Drop Test, ...)
   ================================================================== */
html body.qc-form {
    display: block !important;
    padding: 20px 40px 48px 40px !important;
}

body.qc-form .rd-header.qc-header,
body.qc-form .container {
    width: 100%;
    max-width: 1560px;
    margin-left: auto !important;
    margin-right: auto !important;
}

/* the form panel */
html body.qc-form .container {
    position: relative;
    z-index: 5;
    margin-top: 0 !important;
    padding: 26px 26px 30px !important;
    border-radius: 18px !important;
    border: 1px solid var(--rd-line) !important;
    background:
        radial-gradient(120% 60% at 50% 0%, rgba(var(--theme-rgb), 0.06) 0%, rgba(var(--theme-rgb), 0) 60%),
        var(--rd-panel) !important;
    box-shadow: 0 30px 70px -44px rgba(0, 0, 0, 0.95), 0 1px 0 rgba(255, 255, 255, 0.06) inset !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
}

/* field labels = mono caps (Report Desk filter labels) */
body.qc-form .field label,
body.qc-form label.main-label,
body.qc-form .form-group > label {
    font-family: var(--rd-mono);
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--rd-faint);
    margin-bottom: 7px;
}

/* inputs */
body.qc-form input:not([type="checkbox"]):not([type="radio"]):not([type="button"]):not([type="submit"]),
body.qc-form select,
body.qc-form textarea {
    color: #e2e8f0 !important;
    background: rgba(255, 255, 255, 0.045) !important;
    border: 1px solid rgba(255, 255, 255, 0.09) !important;
    border-radius: 12px !important;
    font-size: 13.5px;
    font-weight: 500;
    box-shadow: none;
    transition: border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}

body.qc-form input:not([type="checkbox"]):not([type="radio"]):hover,
body.qc-form textarea:hover {
    background: rgba(255, 255, 255, 0.07) !important;
    border-color: rgba(255, 255, 255, 0.15) !important;
}

body.qc-form input:not([type="checkbox"]):not([type="radio"]):focus,
body.qc-form select:focus,
body.qc-form textarea:focus {
    outline: none;
    background: rgba(255, 255, 255, 0.06) !important;
    border-color: rgba(var(--theme-rgb), 0.6) !important;
    box-shadow: 0 0 0 3px rgba(var(--theme-rgb), 0.14) !important;
}

body.qc-form input::placeholder,
body.qc-form textarea::placeholder { color: rgba(255, 255, 255, 0.38); }

body.qc-form input:disabled,
body.qc-form select:disabled,
body.qc-form textarea:disabled {
    color: #5b6880 !important;
    border-style: dashed !important;
    background: rgba(255, 255, 255, 0.022) !important;
    cursor: not-allowed;
}

body.qc-form input[type="date"],
body.qc-form input[type="time"] { color-scheme: dark; }

body.qc-form .inputBox > .material-icons {
    color: var(--rd-muted) !important;
    opacity: 1 !important;
    transition: color 0.2s ease;
}

body.qc-form .inputBox:focus-within > .material-icons { color: var(--theme-color) !important; }

/* validation colours keep their meaning */
/* Same :not() chain as the base input rule above, so these win on specificity (the shorter
   selectors used before lost to it and the weight boxes never turned red/green/orange). */
body.qc-form input.input-red:not([type="checkbox"]):not([type="radio"]):not([type="button"]):not([type="submit"]), body.qc-form select.input-red, body.qc-form textarea.input-red { background: rgba(239, 68, 68, 0.15) !important; border-color: #ef4444 !important; color: #fca5a5 !important; }
body.qc-form input.input-green:not([type="checkbox"]):not([type="radio"]):not([type="button"]):not([type="submit"]), body.qc-form select.input-green, body.qc-form textarea.input-green { background: rgba(34, 197, 94, 0.15) !important; border-color: #22c55e !important; color: #86efac !important; }
body.qc-form input.input-orange:not([type="checkbox"]):not([type="radio"]):not([type="button"]):not([type="submit"]), body.qc-form select.input-orange, body.qc-form textarea.input-orange { background: rgba(249, 115, 22, 0.15) !important; border-color: #f97316 !important; color: #fdba74 !important; }

/* themed dropdown (CustomSelect) = Report Desk dropdown */
body.qc-pro .custom-select-trigger {
    background: rgba(255, 255, 255, 0.045) !important;
    border: 1px solid rgba(255, 255, 255, 0.09) !important;
    border-radius: 12px !important;
    color: #e2e8f0 !important;
    font-size: 13.5px;
    font-weight: 500;
    transition: border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}

body.qc-pro .custom-select-trigger:hover {
    background: rgba(255, 255, 255, 0.07) !important;
    border-color: rgba(255, 255, 255, 0.15) !important;
}

body.qc-pro .custom-select-trigger .material-icons {
    color: var(--rd-muted) !important;
    transition: transform 0.28s cubic-bezier(0.22, 1, 0.28, 1), color 0.2s ease;
}

body.qc-pro .custom-select.open .custom-select-trigger {
    background: rgba(255, 255, 255, 0.06) !important;
    border-color: rgba(var(--theme-rgb), 0.6) !important;
    box-shadow: 0 0 0 3px rgba(var(--theme-rgb), 0.14) !important;
}

body.qc-pro .custom-select.open .custom-select-trigger .material-icons { transform: rotate(180deg); color: var(--theme-color) !important; }

body.qc-pro .custom-select.disabled .custom-select-trigger {
    opacity: 1 !important;
    color: #5b6880 !important;
    border-style: dashed !important;
    background: rgba(255, 255, 255, 0.022) !important;
}

body.qc-pro .custom-options {
    top: calc(100% + 6px) !important;
    padding: 6px;
    border-radius: 12px !important;
    border: 1px solid rgba(var(--theme-rgb), 0.24) !important;
    background:
        linear-gradient(180deg, rgba(var(--theme-rgb), 0.11) 0%, rgba(var(--theme-rgb), 0.05) 100%),
        linear-gradient(180deg, #131a28 0%, #0d121d 100%) !important;
    box-shadow: 0 24px 50px -22px rgba(0, 0, 0, 0.95), 0 0 40px -26px rgba(var(--theme-rgb), 0.8), 0 1px 0 rgba(255, 255, 255, 0.07) inset !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    z-index: 200 !important;
}

body.qc-pro .custom-option {
    padding: 9px 11px !important;
    border-radius: 9px;
    border-bottom: 0 !important;
    font-size: 13px !important;
    font-weight: 500;
    color: #c2c8d2 !important;
    color: color-mix(in srgb, var(--theme-soft, #cfd6e2) 30%, #c2c8d2) !important;
}

body.qc-pro .custom-option:hover {
    background: rgba(var(--theme-rgb), 0.13) !important;
    color: #fff !important;
}

/* section headings inside the form */
body.qc-form .section-title {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 30px 0 16px !important;
    padding-left: 0 !important;
    border-left: 0 !important;
    font-family: var(--rd-mono);
    font-size: 11px !important;
    font-weight: 600 !important;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: rgba(var(--theme-rgb), 0.95) !important;
}

body.qc-form .section-title::before {
    content: "";
    width: 6px;
    height: 6px;
    border-radius: 50%;
    flex-shrink: 0;
    background: var(--theme-color);
    box-shadow: 0 0 8px 1px rgba(var(--theme-rgb), 0.7);
}

body.qc-form .section-title::after {
    content: "";
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0));
}

/* primary submit = Generate button of the Report Desk */
body.qc-form .submitBtn {
    height: 50px !important;
    border-radius: 12px !important;
    font-size: 14.5px !important;
    font-weight: 700 !important;
    letter-spacing: 0.01em;
    color: #fff !important;
    background: linear-gradient(135deg, var(--theme-gradient-start), var(--theme-gradient-end)) !important;
    border: 1px solid rgba(255, 255, 255, 0.14) !important;
    box-shadow: 0 12px 28px -14px rgba(var(--theme-rgb), 0.95) !important;
    animation: none !important;
}

body.qc-form .submitBtn:hover:not(:disabled) { transform: translateY(-1px); box-shadow: 0 16px 32px -14px rgba(var(--theme-rgb), 1) !important; }
body.qc-form .submitBtn:disabled { opacity: 0.65; cursor: wait; transform: none; }

/* toolbar at the top of the form panel (page actions such as "Add New Form") */
body.qc-form .qc-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    margin: 0 0 18px 0;
}

body.qc-form .qc-toolbar-title {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-family: var(--rd-mono);
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--rd-faint);
}

body.qc-form .qc-toolbar-title::before {
    content: "";
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--theme-color);
    box-shadow: 0 0 8px 1px rgba(var(--theme-rgb), 0.7);
}

/* in-form secondary cards (e.g. Hourly Outer form cards) */
body.qc-form .hourly-form-card {
    border-radius: 16px !important;
    border: 1px solid var(--rd-line) !important;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.035) 0%, rgba(255, 255, 255, 0.012) 100%) !important;
}

/* ---------- popups (success / warning) = themed popup ---------- */
body.qc-pro .popup-overlay {
    background: rgba(2, 4, 8, 0.55) !important;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 100000 !important;
}

body.qc-pro .popup-box {
    max-width: 420px;
    padding: 30px 28px 24px !important;
    border-radius: 22px !important;
    color: #e2e8f0;
    background:
        radial-gradient(120% 80% at 50% 0%, rgba(var(--theme-rgb), 0.18) 0%, rgba(var(--theme-rgb), 0) 62%),
        linear-gradient(180deg, rgba(20, 26, 38, 0.97) 0%, rgba(10, 14, 22, 0.98) 100%) !important;
    border: 1px solid rgba(var(--theme-rgb), 0.35) !important;
    box-shadow: 0 30px 70px -20px rgba(0, 0, 0, 0.9), 0 0 60px -24px rgba(var(--theme-rgb), 0.7), 0 1px 0 rgba(255, 255, 255, 0.12) inset !important;
    animation: rdPopIn 0.22s cubic-bezier(0.2, 0.9, 0.3, 1.2);
}

body.qc-pro .popup-box h2 { font-size: 18px; font-weight: 700; color: #fff !important; margin: 8px 0 8px !important; }
body.qc-pro .popup-box p { font-size: 13.5px; line-height: 1.6; color: #94a3b8 !important; margin-bottom: 22px !important; }

body.qc-pro .popup-box button {
    min-width: 120px;
    padding: 11px 20px !important;
    border-radius: 99px !important;
    font-size: 13px !important;
    font-weight: 600 !important;
    color: #fff !important;
    cursor: pointer;
}

/* theme pill, unless the page colours the button itself (e.g. red "Delete") */
body.qc-pro .popup-box button:not([style*="background"]) {
    border: 1px solid rgba(var(--theme-rgb), 0.55) !important;
    background: linear-gradient(180deg, rgba(var(--theme-rgb), 0.32) 0%, rgba(var(--theme-rgb), 0.10) 100%) !important;
    box-shadow: 0 10px 24px -12px rgba(var(--theme-rgb), 0.8);
}

body.qc-pro .popup-box button:not([style*="background"]):hover { background: linear-gradient(180deg, rgba(var(--theme-rgb), 0.45) 0%, rgba(var(--theme-rgb), 0.16) 100%) !important; }
body.qc-pro .popup-box button[style*="background"] { border: 1px solid rgba(255, 255, 255, 0.16) !important; }
body.qc-pro .popup-box button[style*="background"]:hover { filter: brightness(1.12); }

@keyframes rdPopIn { from { opacity: 0; transform: translateY(10px) scale(0.94); } to { opacity: 1; transform: none; } }
@keyframes rdPopFade { from { opacity: 0; } to { opacity: 1; } }

/* ---------- toast ---------- */
body.qc-pro .toast {
    background: rgba(16, 22, 36, 0.96) !important;
    border: 1px solid rgba(239, 68, 68, 0.45);
    border-left: 3px solid #ef4444;
    border-radius: 14px !important;
    color: #f1f5f9 !important;
    font-size: 13.5px;
    font-weight: 600;
    box-shadow: 0 24px 50px -20px rgba(0, 0, 0, 0.95) !important;
    backdrop-filter: blur(12px);
}

body.qc-pro .toast .toast-icon { color: #f87171; }
body.qc-pro .toast.success { background: rgba(16, 22, 36, 0.96) !important; border-color: rgba(34, 197, 94, 0.45); border-left-color: #22c55e; box-shadow: 0 24px 50px -20px rgba(0, 0, 0, 0.95) !important; }
body.qc-pro .toast.success .toast-icon { color: #4ade80; }

/* ---------- shared loaders: theme text instead of fixed sky blue ---------- */
body.qc-pro .spinner::after { border-color: var(--theme-color); border-left-color: transparent; }

/* ==================================================================
   Approvals page
   ================================================================== */
html body.qc-approvals { padding: 20px 40px 28px 40px !important; }

body.qc-approvals .rd-header { margin-bottom: 22px; }

body.qc-approvals .layout { gap: 16px !important; height: auto !important; min-height: calc(100vh - 210px); }

body.qc-approvals .sidebar,
body.qc-approvals .users-sidebar {
    padding: 6px !important;
    gap: 6px !important;
    border-radius: 14px !important;
    border: 1px solid var(--rd-line) !important;
    background: var(--rd-panel) !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.05) inset;
}

body.qc-approvals .users-sidebar { padding: 8px !important; }

body.qc-approvals .tab-btn {
    padding: 10px 15px !important;
    border-radius: 10px !important;
    border: 1px solid transparent !important;
    font-size: 13px !important;
    font-weight: 600 !important;
    color: var(--rd-muted) !important;
}

body.qc-approvals .tab-btn .material-icons { font-size: 18px; color: var(--rd-faint); transition: color 0.2s ease; }
body.qc-approvals .tab-btn:hover { color: #fff !important; background: rgba(255, 255, 255, 0.05) !important; }
body.qc-approvals .tab-btn:hover .material-icons { color: var(--theme-color); }

body.qc-approvals .tab-btn.active {
    color: #fff !important;
    border-color: rgba(var(--theme-rgb), 0.45) !important;
    background: linear-gradient(180deg, rgba(var(--theme-rgb), 0.26) 0%, rgba(var(--theme-rgb), 0.08) 100%) !important;
    box-shadow: 0 10px 24px -14px rgba(var(--theme-rgb), 0.9);
}

body.qc-approvals .tab-btn.active .material-icons { color: var(--theme-color); }

body.qc-approvals .user-tab-btn {
    padding: 7px 14px !important;
    border-radius: 99px !important;
    font-size: 12px !important;
    font-weight: 600 !important;
    color: #94a3b8 !important;
    background: rgba(255, 255, 255, 0.03) !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
}

body.qc-approvals .user-tab-btn:hover { color: #fff !important; border-color: rgba(var(--theme-rgb), 0.35) !important; }

body.qc-approvals .user-tab-btn.active {
    color: #fff !important;
    border-color: transparent !important;
    background: linear-gradient(135deg, var(--theme-gradient-start), var(--theme-gradient-end)) !important;
    box-shadow: 0 8px 20px -10px rgba(var(--theme-rgb), 0.95);
}

body.qc-approvals .main-content {
    padding: 18px !important;
    border-radius: 16px !important;
    border: 1px solid var(--rd-line) !important;
    background: var(--rd-panel) !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    box-shadow: 0 24px 60px -34px rgba(0, 0, 0, 0.9);
}

body.qc-approvals #currentFormTitle {
    font-size: 17px;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: #fff !important;
}

body.qc-approvals #statusFilterContainer label {
    font-family: var(--rd-mono);
    font-size: 9.5px !important;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--rd-faint) !important;
}

body.qc-approvals #statusFilter {
    height: 36px;
    padding: 0 12px !important;
    border-radius: 10px !important;
    font-size: 12.5px;
    font-weight: 600;
    color: #e2e8f0 !important;
    background: rgba(255, 255, 255, 0.045) !important;
    border: 1px solid rgba(255, 255, 255, 0.09) !important;
    color-scheme: dark;
}

body.qc-approvals .table-wrapper {
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.06);
    background: rgba(0, 0, 0, 0.16);
}

body.qc-approvals .table-wrapper table { font-size: 12.5px; }

body.qc-approvals .table-wrapper th {
    font-size: 10.5px !important;
    font-weight: 700 !important;
    letter-spacing: 0.06em;
    line-height: 1.35;
    padding: 12px 14px !important;
    color: rgba(var(--theme-rgb), 0.92) !important;
    background: #0f1626 !important;
    border-bottom: 1px solid rgba(var(--theme-rgb), 0.25) !important;
    box-shadow: none !important;
}

body.qc-approvals .table-wrapper td {
    padding: 12px 14px !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05) !important;
    color: #e2e8f0;
}

body.qc-approvals .table-wrapper tbody tr:nth-child(even) td { background: rgba(255, 255, 255, 0.015); }
body.qc-approvals .table-wrapper tbody tr:hover td { background: rgba(var(--theme-rgb), 0.07); }

body.qc-approvals .row-checkbox,
body.qc-approvals #selectAll { accent-color: var(--theme-color); }

body.qc-approvals .status-badge {
    display: inline-block;
    padding: 4px 10px !important;
    border-radius: 99px !important;
    font-family: var(--rd-mono);
    font-size: 9.5px !important;
    font-weight: 600 !important;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

body.qc-approvals .status-pending { color: #fbbf24 !important; background: rgba(251, 191, 36, 0.12) !important; border: 1px solid rgba(251, 191, 36, 0.3) !important; }
body.qc-approvals .status-approved { color: #34d399 !important; background: rgba(16, 185, 129, 0.12) !important; border: 1px solid rgba(16, 185, 129, 0.3) !important; }
body.qc-approvals .status-rejected { color: #f87171 !important; background: rgba(239, 68, 68, 0.12) !important; border: 1px solid rgba(239, 68, 68, 0.3) !important; }

/* toolbar buttons = neutral pills, colour only shows the meaning */
body.qc-approvals .bulk-actions { gap: 8px !important; }

body.qc-approvals .bulk-btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 8px 14px !important;
    border-radius: 99px !important;
    font-size: 12px !important;
    font-weight: 600 !important;
    color: #e2e8f0 !important;
    border: 1px solid rgba(255, 255, 255, 0.10) !important;
    border-top-color: rgba(255, 255, 255, 0.2) !important;
    box-shadow: 0 6px 16px -10px rgba(0, 0, 0, 0.9);
    transition: all 0.2s ease;
}

/* neutral pill, unless the page gives the button its own colour (confirm "Yes", "Save Changes") */
body.qc-approvals .bulk-btn:not([style*="background"]) {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.09) 0%, rgba(255, 255, 255, 0.025) 100%) !important;
}

body.qc-approvals .modal-content .bulk-btn[style*="background"] {
    color: #fff !important;
    border-color: rgba(255, 255, 255, 0.16) !important;
    box-shadow: 0 10px 24px -12px rgba(0, 0, 0, 0.8);
}

body.qc-approvals .modal-content .bulk-btn[style*="background"]:hover:not(:disabled) { filter: brightness(1.1); }

body.qc-approvals .bulk-btn:not([style*="background"]):hover:not(:disabled) { color: #fff !important; border-color: rgba(var(--theme-rgb), 0.5) !important; background: linear-gradient(180deg, rgba(var(--theme-rgb), 0.2) 0%, rgba(var(--theme-rgb), 0.05) 100%) !important; }
body.qc-approvals .btn-approve-bulk .material-icons { color: #34d399; }
body.qc-approvals .btn-approve-bulk:hover:not(:disabled) { border-color: rgba(16, 185, 129, 0.55) !important; background: linear-gradient(180deg, rgba(16, 185, 129, 0.22) 0%, rgba(16, 185, 129, 0.06) 100%) !important; }
body.qc-approvals .btn-reject-bulk .material-icons { color: #f87171; }
body.qc-approvals .btn-reject-bulk:hover:not(:disabled) { border-color: rgba(239, 68, 68, 0.55) !important; background: linear-gradient(180deg, rgba(239, 68, 68, 0.22) 0%, rgba(239, 68, 68, 0.06) 100%) !important; }
body.qc-approvals .btn-edit-bulk .material-icons { color: var(--theme-color); }
body.qc-approvals .btn-delete-bulk .material-icons { color: #94a3b8; }
body.qc-approvals .btn-delete-bulk:hover:not(:disabled) { border-color: rgba(239, 68, 68, 0.55) !important; background: linear-gradient(180deg, rgba(239, 68, 68, 0.22) 0%, rgba(239, 68, 68, 0.06) 100%) !important; }
body.qc-approvals .bulk-btn:disabled { cursor: wait; }
body.qc-approvals .table-wrapper .bulk-btn { padding: 5px 12px !important; font-size: 11.5px !important; box-shadow: none; }

body.qc-approvals #pageInfo { font-family: var(--rd-mono); font-size: 11px !important; letter-spacing: 0.04em; color: #94a3b8 !important; }

/* modals = themed popup */
body.qc-approvals .modal-overlay {
    background: rgba(2, 4, 8, 0.55) !important;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

body.qc-approvals .modal-content {
    border-radius: 20px !important;
    color: #e2e8f0;
    background:
        radial-gradient(120% 60% at 50% 0%, rgba(var(--theme-rgb), 0.14) 0%, rgba(var(--theme-rgb), 0) 60%),
        linear-gradient(180deg, rgba(20, 26, 38, 0.98) 0%, rgba(10, 14, 22, 0.99) 100%) !important;
    border: 1px solid rgba(var(--theme-rgb), 0.32) !important;
    box-shadow: 0 30px 70px -20px rgba(0, 0, 0, 0.9), 0 0 60px -26px rgba(var(--theme-rgb), 0.7), 0 1px 0 rgba(255, 255, 255, 0.10) inset !important;
    animation: rdPopIn 0.22s cubic-bezier(0.2, 0.9, 0.3, 1.2);
}

body.qc-approvals #editModal .modal-content > div:first-child {
    background: rgba(255, 255, 255, 0.025) !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.07) !important;
    box-shadow: none !important;
}

body.qc-approvals .modal-content h3 { color: #fff; font-weight: 700; letter-spacing: -0.01em; }

body.qc-approvals .form-group label {
    font-family: var(--rd-mono);
    font-size: 9.5px !important;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--rd-faint) !important;
}

body.qc-approvals .form-group input,
body.qc-approvals .form-group select {
    border-radius: 10px !important;
    color: #e2e8f0 !important;
    background: rgba(255, 255, 255, 0.045) !important;
    border: 1px solid rgba(255, 255, 255, 0.09) !important;
}

body.qc-approvals .form-group input:focus,
body.qc-approvals .form-group select:focus {
    outline: none;
    border-color: rgba(var(--theme-rgb), 0.6) !important;
    box-shadow: 0 0 0 3px rgba(var(--theme-rgb), 0.14);
}

body.qc-approvals #toastContainer {
    background: rgba(16, 22, 36, 0.96) !important;
    border: 1px solid rgba(255, 255, 255, 0.10) !important;
    border-radius: 14px !important;
    box-shadow: 0 24px 50px -20px rgba(0, 0, 0, 0.95) !important;
}

/* ==================================================================
   Dropdowns (Report Desk look) - form pages (CustomSelect) and the
   native selects on Approvals (upgraded by qc-select.js)
   ================================================================== */
body.qc-pro .custom-select-trigger { gap: 10px; padding-right: 12px !important; }

/* long values (SKU names...) stay on one line inside the box, full text on hover */
body.qc-pro .custom-select-text {
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    line-height: 1.3;
}

body.qc-pro .custom-select-trigger .material-icons { flex-shrink: 0; }

/* a long value must not stretch its grid column - it is cut with "..." instead */
body.qc-form .grid-row > *,
body.qc-form .field,
body.qc-form .inputBox,
body.qc-pro .custom-select { min-width: 0; }

/* the open list always sits above the fields below it */
body.qc-pro .custom-select.open { z-index: 400; }
body.qc-pro .inputBox:has(.custom-select.open),
body.qc-pro .field:has(.custom-select.open) { position: relative; z-index: 400; }
/* while a list is open the form panel sits above the page header,
   so the header text never shows through the list */
html body.qc-form .container:has(.custom-select.open),
html body.qc-form .container:has(.qcxs.is-open) { z-index: 30; }

body.qc-pro .custom-options {
    max-height: 280px !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    scrollbar-width: thin;
    scrollbar-color: rgba(var(--theme-rgb), 0.35) transparent;
}

body.qc-pro .custom-options::-webkit-scrollbar { width: 7px; }
body.qc-pro .custom-options::-webkit-scrollbar-track { background: transparent !important; }
body.qc-pro .custom-options::-webkit-scrollbar-thumb { background: rgba(var(--theme-rgb), 0.3) !important; border-radius: 10px; }
body.qc-pro .custom-options::-webkit-scrollbar-thumb:hover { background: rgba(var(--theme-rgb), 0.55) !important; }

body.qc-pro .custom-select.open .custom-options { animation: qcDdIn 0.2s cubic-bezier(0.22, 1, 0.28, 1); }
body.qc-pro .custom-options.is-up { top: auto !important; bottom: calc(100% + 6px) !important; transform-origin: bottom center; }

body.qc-pro .custom-option {
    display: flex;
    align-items: center;
    gap: 9px;
    white-space: normal;
    line-height: 1.35;
    overflow-wrap: anywhere;
    transition: background 0.16s ease, color 0.16s ease;
}

/* tick in front of the chosen value */
body.qc-pro .custom-option::before,
.qcxs-opt::before {
    content: "";
    width: 14px;
    height: 14px;
    flex-shrink: 0;
    background: var(--theme-color);
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5'/%3E%3C/svg%3E") center / contain no-repeat;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5'/%3E%3C/svg%3E") center / contain no-repeat;
    opacity: 0;
    transition: opacity 0.16s ease;
}

body.qc-pro .custom-option.is-selected {
    color: #fff !important;
    background: linear-gradient(100deg, rgba(var(--theme-rgb), 0.26) 0%, rgba(var(--theme-rgb), 0.08) 100%) !important;
}

body.qc-pro .custom-option.is-selected::before { opacity: 1; }

/* "Select ..." placeholder is shown on the box, not repeated in the list */
body.qc-pro .custom-option.is-ph { display: none; }

@keyframes qcDdIn {
    from { opacity: 0; transform: translateY(-6px) scale(0.985); }
    to { opacity: 1; transform: none; }
}

/* any native list the browser still draws itself */
body.qc-pro select option { background: #131a28; color: #e2e8f0; }

/* ---------- upgraded native selects (Approvals) ---------- */
.qcxs { position: relative; display: inline-block; min-width: 140px; vertical-align: middle; }
.qcxs.qcxs-block { display: block; width: 100%; }

.qcxs-native {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    border: 0 !important;
    clip: rect(0 0 0 0);
    clip-path: inset(50%);
    overflow: hidden;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
}

.qcxs-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    height: 38px;
    padding: 0 11px 0 13px;
    border-radius: 10px;
    font-family: "Inter", sans-serif;
    font-size: 12.5px;
    font-weight: 600;
    color: #e2e8f0;
    text-align: left;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.045);
    border: 1px solid rgba(255, 255, 255, 0.09);
    transition: border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}

.qcxs-btn:hover { background: rgba(255, 255, 255, 0.07); border-color: rgba(255, 255, 255, 0.15); }

.qcxs-btn:focus-visible,
.qcxs.is-open .qcxs-btn {
    outline: none;
    border-color: rgba(var(--theme-rgb), 0.6);
    box-shadow: 0 0 0 3px rgba(var(--theme-rgb), 0.14);
}

.qcxs-text { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.qcxs-text.is-ph { color: rgba(255, 255, 255, 0.45); }

.qcxs-icon { flex-shrink: 0; display: flex; color: #8b9ab1; transition: transform 0.28s cubic-bezier(0.22, 1, 0.28, 1), color 0.2s ease; }
.qcxs-btn:hover .qcxs-icon { color: var(--theme-color); }
.qcxs.is-open .qcxs-icon { transform: rotate(180deg); color: var(--theme-color); }

.qcxs.is-disabled .qcxs-btn { color: #5b6880; cursor: not-allowed; border-style: dashed; background: rgba(255, 255, 255, 0.022); }

.qcxs-pop {
    position: absolute;
    z-index: 2000;
    top: calc(100% + 6px);
    left: 0;
    min-width: 100%;
    max-width: min(420px, 90vw);
    max-height: 264px;
    overflow-y: auto;
    padding: 6px;
    border-radius: 12px;
    border: 1px solid rgba(var(--theme-rgb), 0.24);
    background:
        linear-gradient(180deg, rgba(var(--theme-rgb), 0.11) 0%, rgba(var(--theme-rgb), 0.05) 100%),
        linear-gradient(180deg, #131a28 0%, #0d121d 100%);
    box-shadow: 0 24px 50px -22px rgba(0, 0, 0, 0.95), 0 0 40px -26px rgba(var(--theme-rgb), 0.8), 0 1px 0 rgba(255, 255, 255, 0.07) inset;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-6px) scale(0.985);
    transform-origin: top center;
    transition: opacity 0.18s ease, transform 0.22s cubic-bezier(0.22, 1, 0.28, 1), visibility 0s linear 0.22s;
    scrollbar-width: thin;
    scrollbar-color: rgba(var(--theme-rgb), 0.35) transparent;
}

.qcxs.is-open .qcxs-pop { opacity: 1; visibility: visible; transform: none; transition: opacity 0.18s ease, transform 0.22s cubic-bezier(0.22, 1, 0.28, 1), visibility 0s; }
.qcxs-pop.is-up { top: auto; bottom: calc(100% + 6px); transform-origin: bottom center; }
.qcxs-pop.is-right { left: auto; right: 0; }

.qcxs-opt {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 9px 11px;
    border-radius: 9px;
    font-family: "Inter", sans-serif;
    font-size: 13px;
    font-weight: 500;
    line-height: 1.35;
    color: #c2c8d2;
    color: color-mix(in srgb, var(--theme-soft, #cfd6e2) 30%, #c2c8d2);
    cursor: pointer;
    white-space: normal;
    overflow-wrap: anywhere;
    transition: background 0.16s ease, color 0.16s ease;
}

.qcxs-opt:hover, .qcxs-opt.is-cursor { background: rgba(var(--theme-rgb), 0.13); color: #fff; }
.qcxs-opt.is-selected { color: #fff; background: linear-gradient(100deg, rgba(var(--theme-rgb), 0.26) 0%, rgba(var(--theme-rgb), 0.08) 100%); }
.qcxs-opt.is-selected::before { opacity: 1; }
.qcxs-opt.is-disabled { opacity: 0.45; cursor: not-allowed; }
.qcxs-opt.is-ph { display: none; }

/* ==================================================================
   Phones (same breakpoints as Production Control)
   ================================================================== */
@media (max-width: 900px) {
    .rd-chip { display: none; }
}

@media (max-width: 768px) {
    html body.qc-form { padding: 15px 16px 28px 16px !important; }
    html body.qc-approvals { padding: 15px 14px 22px 14px !important; }
    .rd-header { gap: 16px; padding-bottom: 16px; margin-bottom: 20px; }
    .rd-head-left { gap: 12px; }
    .rd-brandmark { width: 44px; height: 44px; }
    .rd-brandmark img { width: 36px; height: 36px; }
    .rd-title { font-size: 22px; }
    .rd-desc { font-size: 12px; }
    .rd-eyebrow { font-size: 9px; letter-spacing: 0.10em; }
    .rd-head-right { width: 100%; margin-top: 0; gap: 8px; flex-wrap: wrap; }
    .rd-user { flex: 1; align-items: flex-start; padding-left: 4px; }
    .rd-hub-btn { padding: 10px 14px; }
    html body.qc-form .container { padding: 18px 14px 22px !important; border-radius: 16px !important; }
    body.qc-form .container .topBar { margin-top: 0 !important; }
}

@media (max-width: 560px) {
    .rd-eyebrow-org, .rd-eyebrow-sep { display: none; }
    .rd-hub-btn .btn-label { display: none; }
    body.qc-pro .nav-drawer { width: 84vw; left: -90vw; }
    body.qc-pro .nav-drawer.active { left: 0; }
}

@media (prefers-reduced-motion: reduce) {
    body.qc-pro .popup-box, body.qc-approvals .modal-content { animation: none; }
}

/* ==================================================================
   Shanti assistant button: parked as a small tab on the right edge,
   halfway down the screen, so it never covers page buttons
   (Approve / Reject / Submit / pagination sit at the bottom-right).
   Hover or tap the tab to slide it out; click opens Shanti as before.
   It is hidden while a QC side panel / dialog is open.
   ================================================================== */
html body .shanti-fab {
    top: 50% !important;
    bottom: auto !important;
    right: 0 !important;
    left: auto !important;
    transform: translate(calc(100% - 46px), -50%) !important;
    border-radius: 999px 0 0 999px !important;
    border-right: 0 !important;
    padding: 6px 16px 6px 6px !important;
    opacity: .8;
    transition: transform .25s cubic-bezier(.2, .9, .3, 1), opacity .2s ease !important;
    animation: none !important;
}
html body .shanti-fab:hover,
html body .shanti-fab:focus-visible {
    transform: translate(0, -50%) !important;
    opacity: 1;
}
html body .shanti-fab .shanti-fab-av { width: 30px !important; height: 30px !important; }
html body .shanti-fab .shanti-fab-txt { display: flex !important; }

/* out of the way while a QC panel or dialog is open */
body:has(.modal-overlay[style*="flex"]) .shanti-fab,
body:has(.popup-overlay[style*="flex"]) .shanti-fab { opacity: 0 !important; pointer-events: none !important; }

@media (max-width: 520px) {
    html body .shanti-fab { transform: translate(calc(100% - 40px), -50%) !important; padding: 5px 14px 5px 5px !important; }
}

/* Shanti assistant hidden for now (remove this rule to bring it back) */
html body .shanti-fab, html body .shanti-fab * , .shanti-panel, .shanti-widget { display: none !important; }
