/* ==================================================================
   SDPL Data Management (DMM) - shared "Pro app" look
   Same design language as Quality Control (SDPLQCApp/qc-pro.css),
   Production Control (SDPLProApp) 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.dmm-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.dmm-pro,
body.dmm-pro input,
body.dmm-pro select,
body.dmm-pro textarea,
body.dmm-pro button {
    font-family: "Inter", sans-serif;
}

body.dmm-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.dmm-pro #particles-js,
body.dmm-pro #particleCanvas,
body.dmm-pro .particles-js-canvas-el,
body.dmm-pro .grid-overlay,
body.dmm-pro .glow-blob,
body.dmm-pro .glow1,
body.dmm-pro .glow2,
body.dmm-pro .bg-glow,
body.dmm-pro::after,
body.dmm-pro .container::before {
    display: none !important;
}

body.dmm-pro ::-webkit-scrollbar { width: 8px; height: 8px; }
body.dmm-pro ::-webkit-scrollbar-thumb { background: rgba(var(--theme-rgb), 0.3); border-radius: 10px; }
body.dmm-pro ::-webkit-scrollbar-thumb:hover { background: rgba(var(--theme-rgb), 0.6); }
body.dmm-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 DMM 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; }

/* ==================================================================
   Loaders - same as the QC / Production Control dashboards
   (page loader: transparent + blur over the themed canvas,
    dual counter-rotating rings, theme-coloured status text)
   ================================================================== */
body.dmm-pro .loading-overlay {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    background: transparent !important;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 999999;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0;
    color: #fff;
    text-align: center;
    padding: 20px;
}

/* module pages: solid canvas behind the loader so the half-built page never shows through */
body.dmm-module .loading-overlay {
    background-color: var(--rd-canvas) !important;
    background-image: var(--rd-wash) !important;
    background-size: var(--rd-wash-size) !important;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    transition: opacity 0.45s ease, visibility 0.45s ease;
}

body.dmm-pro .loading-overlay.hidden { opacity: 0; visibility: hidden; pointer-events: none; }
body.dmm-dashboard .loading-overlay.hidden { display: none; }
body.dmm-pro .loading-overlay.dissolve { animation: dmmFadeOutOverlay 0.5s ease-out forwards; }

@keyframes dmmFadeOutOverlay {
    0% { opacity: 1; transform: scale(1); }
    100% { opacity: 0; transform: scale(1.1); filter: blur(5px); }
}

body.dmm-pro .logo-loader-container {
    position: relative;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* dual counter-rotating rings (the base .spinner itself draws nothing) */
body.dmm-pro .spinner {
    position: relative;
    width: 52px;
    height: 52px;
    margin: 0 0 10px 0;
    border: 0 !important;
    animation: none !important;
    background: none !important;
}

body.dmm-pro .spinner::before,
body.dmm-pro .spinner::after {
    content: '';
    position: absolute;
    border-radius: 50%;
    border: 4px solid transparent;
}

body.dmm-pro .spinner::before {
    inset: 0;
    border-color: #e2e8f0;
    border-right-color: transparent;
    animation: dmm-spin-cw 1s linear infinite;
}

body.dmm-pro .spinner::after {
    inset: 25%;
    border-color: var(--theme-color);
    border-left-color: transparent;
    animation: dmm-spin-ccw 0.8s linear infinite;
}

@keyframes dmm-spin-cw { to { transform: rotate(360deg); } }
@keyframes dmm-spin-ccw { to { transform: rotate(-360deg); } }

body.dmm-pro .loading-text {
    margin: 0;
    color: var(--theme-color);
    font-size: 20px;
    font-weight: 700;
    letter-spacing: -0.01em;
}

body.dmm-pro .loading-subtext {
    font-size: 13px;
    color: #94a3b8;
    margin-top: 10px;
    letter-spacing: 0.3px;
}

/* redirect overlay - shown the instant a module card is launched */
body.dmm-pro .overlay-loading {
    position: fixed;
    inset: 0;
    background-color: rgba(2, 4, 8, 0.4);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    z-index: 999999;
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    color: #e2e8f0;
}

body.dmm-pro .overlay-loading.visible { display: flex; }
body.dmm-pro .overlay-loading .spinner { margin: 0; }
body.dmm-pro #redirect-text { font-size: 13px; color: #94a3b8; letter-spacing: 0.3px; }

/* ==================================================================
   Dashboard (index.html) - module cards = Production Control cards
   ================================================================== */
body.dmm-dashboard * { scrollbar-width: thin; scrollbar-color: rgba(var(--theme-rgb), 0.35) transparent; }

.hub-container {
    width: 100%;
    padding: 20px 40px 40px 40px;
    position: relative;
    z-index: 1;
}

.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 18px;
}

@keyframes rdFadeUp {
    from { opacity: 0; transform: translateY(14px); }
    to { opacity: 1; transform: translateY(0); }
}

.portal-card {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 188px;
    padding: 22px 22px 18px 22px;
    border-radius: 20px;
    cursor: pointer;
    border: 1px solid rgba(var(--theme-rgb), 0.18);
    background:
        radial-gradient(110% 70% at 50% 0%, rgba(var(--theme-rgb), 0.10) 0%, rgba(var(--theme-rgb), 0) 60%),
        linear-gradient(180deg, rgba(255, 255, 255, 0.035) 0%, rgba(255, 255, 255, 0.012) 100%);
    box-shadow: 0 30px 70px -44px rgba(0, 0, 0, 0.95), 0 1px 0 rgba(255, 255, 255, 0.08) inset;
    overflow: hidden;
    transition: transform 0.28s cubic-bezier(0.22, 1, 0.28, 1), border-color 0.25s ease, box-shadow 0.25s ease, background 0.25s ease;
    animation: rdFadeUp 0.55s cubic-bezier(0.22, 1, 0.28, 1) both;
}

.portal-card:hover {
    transform: translateY(-4px);
    border-color: rgba(var(--theme-rgb), 0.55);
    background:
        radial-gradient(110% 80% at 50% 0%, rgba(var(--theme-rgb), 0.20) 0%, rgba(var(--theme-rgb), 0) 62%),
        linear-gradient(180deg, rgba(255, 255, 255, 0.045) 0%, rgba(255, 255, 255, 0.015) 100%);
    box-shadow: 0 22px 48px -26px rgba(var(--theme-rgb), 0.85), 0 1px 0 rgba(255, 255, 255, 0.12) inset;
}

.portal-card:active { transform: translateY(-1px) scale(0.99); }
.portal-card:focus-visible { outline: 2px solid rgba(var(--theme-rgb), 0.8); outline-offset: 3px; }

.card-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 16px;
}

.card-icon-box {
    width: 46px;
    height: 46px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 14px;
    color: var(--theme-color);
    background: linear-gradient(150deg, rgba(var(--theme-rgb), 0.24), rgba(var(--theme-rgb), 0.05));
    border: 1px solid rgba(var(--theme-rgb), 0.32);
    box-shadow: 0 12px 28px -14px rgba(var(--theme-rgb), 0.75), 0 1px 0 rgba(255, 255, 255, 0.16) inset;
}

.card-icon-box .material-icons { font-size: 22px; }

.portal-card .status-badge {
    font-family: var(--rd-mono);
    font-size: 9.5px;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 99px;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    background: rgba(16, 185, 129, 0.12);
    border: 1px solid rgba(16, 185, 129, 0.28);
    color: #34d399;
}

.card-body h3 {
    font-size: 16px;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 7px;
    letter-spacing: -0.02em;
}

.card-body p {
    font-size: 12.5px;
    line-height: 1.6;
    color: #8b9ab1;
}

.card-action {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    margin-top: 16px;
    padding-top: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    font-size: 12px;
    font-weight: 600;
    color: var(--theme-color);
}

.card-action::after {
    content: '\2192';
    font-size: 16px;
    margin-left: 6px;
    transition: transform 0.28s cubic-bezier(0.22, 1, 0.28, 1);
}

.portal-card:hover .card-action::after { transform: translateX(5px); }

.no-modules {
    grid-column: 1 / -1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    text-align: center;
    padding: 40px 20px;
    color: #8b9ab1;
    font-size: 13px;
    border: 1px dashed rgba(255, 255, 255, 0.10);
    border-radius: 20px;
}

body.dmm-pro .no-modules .material-icons { font-size: 34px; color: rgba(var(--theme-rgb), 0.8); }

@media (prefers-reduced-motion: reduce) {
    .portal-card { animation: none; }
}

/* ==================================================================
   Module pages (SKU, Machine, Operator, Formulation, Maintenance)
   ================================================================== */
html body.dmm-module {
    display: block !important;
    padding: 20px 40px 48px 40px !important;
}

/* the page dialogs live inside the panel, so the header must sit below it */
body.dmm-module .rd-header.dmm-header { z-index: 1; }

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

/* the page panel */
html body.dmm-module > .container {
    position: relative;
    z-index: 5;
    margin-top: 0 !important;
    padding: 22px 22px 24px !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;
    overflow: visible !important;
}

body.dmm-pro .material-icons { color: inherit; }

/* toolbar at the top of the panel: section title + page action (Add ...) */
.dmm-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    margin: 0 0 16px 0;
}

.dmm-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);
}

.dmm-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);
}

.dmm-toolbar-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

/* page action ("Add SKU", "Add Machine" ...) = theme filled pill */
body.dmm-module .dmm-toolbar .addBtn,
body.dmm-module .dmm-toolbar .btn-top-action {
    display: inline-flex !important;
    align-items: center;
    gap: 8px;
    width: auto !important;
    height: auto !important;
    padding: 11px 18px !important;
    border-radius: 99px !important;
    font-family: "Inter", sans-serif;
    font-size: 12.5px !important;
    font-weight: 600 !important;
    color: #fff !important;
    cursor: pointer;
    white-space: nowrap;
    border: 1px solid rgba(var(--theme-rgb), 0.45) !important;
    background: linear-gradient(180deg, rgba(var(--theme-rgb), 0.30) 0%, rgba(var(--theme-rgb), 0.10) 100%) !important;
    box-shadow: 0 6px 16px -10px rgba(0, 0, 0, 0.9) !important;
    transform: none !important;
    transition: all 0.25s ease;
}

body.dmm-module .dmm-toolbar .addBtn:hover,
body.dmm-module .dmm-toolbar .btn-top-action:hover {
    border-color: rgba(var(--theme-rgb), 0.7) !important;
    background: linear-gradient(180deg, rgba(var(--theme-rgb), 0.42) 0%, rgba(var(--theme-rgb), 0.16) 100%) !important;
    box-shadow: 0 10px 24px -12px rgba(var(--theme-rgb), 0.8) !important;
}

body.dmm-module .dmm-toolbar .addBtn .material-icons,
body.dmm-module .dmm-toolbar .btn-top-action .material-icons {
    position: static !important;
    transform: none !important;
    margin: 0 !important;
    font-size: 17px;
    color: #fff !important;
}

body.dmm-module .dmm-toolbar .btn-text { display: inline !important; }

/* status message strip */
body.dmm-module .message {
    border-radius: 12px !important;
    font-size: 13px !important;
    font-weight: 600 !important;
}

/* layout: location tabs + content */
body.dmm-module .layout {
    gap: 14px !important;
    height: auto !important;
    min-height: calc(100vh - 290px);
}

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

body.dmm-module .tab-btn {
    padding: 9px 15px !important;
    border-radius: 10px !important;
    border: 1px solid transparent !important;
    font-family: var(--rd-mono);
    font-size: 11px !important;
    font-weight: 600 !important;
    letter-spacing: 0.10em;
    color: var(--rd-muted) !important;
    background: transparent !important;
    gap: 8px !important;
}

body.dmm-module .tab-btn .material-icons { font-size: 16px; color: var(--rd-faint) !important; transition: color 0.2s ease; }
body.dmm-module .tab-btn span:not(.material-icons) { font-family: inherit; }
body.dmm-module .tab-btn:hover { color: #fff !important; background: rgba(255, 255, 255, 0.05) !important; }
body.dmm-module .tab-btn:hover .material-icons { color: var(--theme-color) !important; }

body.dmm-module .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.dmm-module .tab-btn.active .material-icons { color: var(--theme-color) !important; }

body.dmm-module .main-content {
    padding: 16px !important;
    border-radius: 16px !important;
    border: 1px solid var(--rd-line) !important;
    background: rgba(0, 0, 0, 0.10) !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    box-shadow: none;
    overflow: visible !important;
}

/* search bar row */
body.dmm-module .search-bar { gap: 10px !important; flex-wrap: wrap; margin-bottom: 14px !important; }

body.dmm-module .search-bar input[type="text"],
body.dmm-module #locationSelectMobile {
    height: 42px;
    min-width: 220px;
    padding: 0 14px 0 40px !important;
    border-radius: 99px !important;
    font-size: 13px !important;
    font-weight: 500;
    color: #e2e8f0 !important;
    background: rgba(255, 255, 255, 0.045) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%238b9ab1' stroke-width='2.2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='M20 20l-3.5-3.5'/%3E%3C/svg%3E") no-repeat 15px 50% !important;
    border: 1px solid rgba(255, 255, 255, 0.09) !important;
    outline: none;
    transition: border-color 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease;
}

body.dmm-module #locationSelectMobile {
    padding-left: 14px !important;
    background-image: none !important;
    color-scheme: dark;
}

body.dmm-module .search-bar input[type="text"]:focus {
    border-color: rgba(var(--theme-rgb), 0.6) !important;
    box-shadow: 0 0 0 3px rgba(var(--theme-rgb), 0.14);
    background-color: rgba(255, 255, 255, 0.06) !important;
}

body.dmm-module .search-bar input::placeholder { color: rgba(255, 255, 255, 0.38); }

/* table actions (Edit / Delete / Save / Cancel selected) = neutral pills, colour only in the icon */
body.dmm-module .search-bar .btn-top-action,
body.dmm-module .search-bar .addBtn,
body.dmm-module .main-content .addBtn {
    height: 42px !important;
    padding: 0 16px !important;
    border-radius: 99px !important;
    gap: 7px !important;
    font-size: 12.5px !important;
    font-weight: 600 !important;
    color: #e2e8f0 !important;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.09) 0%, rgba(255, 255, 255, 0.025) 100%) !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) !important;
    transform: none !important;
    transition: all 0.2s ease;
}

body.dmm-module .search-bar .btn-top-action .material-icons,
body.dmm-module .main-content .addBtn .material-icons { font-size: 17px; color: var(--theme-color) !important; }

body.dmm-module .search-bar .btn-top-action:hover,
body.dmm-module .main-content .addBtn:hover {
    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.dmm-module .btn-delete-selected .material-icons,
body.dmm-module .addBtn[onclick*="elete"] .material-icons { color: #f87171 !important; }
body.dmm-module .btn-delete-selected:hover,
body.dmm-module .main-content .addBtn[onclick*="elete"]:hover { 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.dmm-module .btn-save-edited .material-icons,
body.dmm-module .addBtn[onclick*="save"] .material-icons { color: #34d399 !important; }
body.dmm-module .btn-cancel-edit .material-icons,
body.dmm-module .addBtn[onclick*="ancel"] .material-icons { color: #94a3b8 !important; }

/* pagination (built by the page as inline-styled buttons) */
body.dmm-module #paginationContainer button {
    width: 36px;
    height: 36px;
    padding: 0 !important;
    border-radius: 50% !important;
    color: #e2e8f0 !important;
    background: rgba(255, 255, 255, 0.045) !important;
    border: 1px solid rgba(255, 255, 255, 0.10) !important;
}

body.dmm-module #paginationContainer button:hover:not(:disabled) { border-color: rgba(var(--theme-rgb), 0.55) !important; background: rgba(var(--theme-rgb), 0.16) !important; }
body.dmm-module #paginationContainer button:disabled { color: #4b5568 !important; }
body.dmm-module #paginationContainer button .material-icons { color: inherit !important; }

body.dmm-module #paginationContainer div > div {
    height: 36px;
    padding: 0 12px !important;
    border-radius: 99px !important;
    font-family: var(--rd-mono);
    font-size: 11.5px !important;
    font-weight: 600 !important;
    letter-spacing: 0.04em;
    color: #cbd5e1 !important;
    background: rgba(255, 255, 255, 0.035) !important;
    border: 1px solid rgba(255, 255, 255, 0.07);
}

/* data table */
body.dmm-module .table-container {
    border-radius: 12px !important;
    border: 1px solid rgba(255, 255, 255, 0.06) !important;
    background: rgba(0, 0, 0, 0.16) !important;
}

body.dmm-module .table-container table { font-size: 13px; }

body.dmm-module .table-container thead tr {
    background: #0f1626 !important;
    border-bottom: 1px solid rgba(var(--theme-rgb), 0.25) !important;
}

body.dmm-module .table-container th {
    padding: 12px 14px !important;
    font-size: 10.5px !important;
    font-weight: 700 !important;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    white-space: nowrap;
    color: rgba(var(--theme-rgb), 0.92) !important;
    background: #0f1626 !important;
}

body.dmm-module .table-container td {
    padding: 11px 14px !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    color: #e2e8f0;
}

body.dmm-module .table-container tbody tr:nth-child(even) td { background: rgba(255, 255, 255, 0.015); }
body.dmm-module .table-container tbody tr:hover td { background: rgba(var(--theme-rgb), 0.07); }
body.dmm-module .table-container tbody tr:last-child td { border-bottom: 0; }

body.dmm-pro input[type="checkbox"] { accent-color: var(--theme-color); }

body.dmm-module .table-container input.inline-edit-input,
body.dmm-module .table-container select.inline-edit-input,
body.dmm-module .table-container td input[type="text"],
body.dmm-module .table-container td input[type="number"],
body.dmm-module .table-container td select {
    height: 34px;
    min-width: 70px;
    padding: 0 10px !important;
    font-size: 12.5px !important;
    text-align: left;
    color-scheme: dark;
}

body.dmm-module .inline-edit-input {
    border-radius: 8px !important;
    background: rgba(255, 255, 255, 0.06) !important;
    border: 1px solid rgba(var(--theme-rgb), 0.35) !important;
    color: #fff !important;
}

body.dmm-module .actionBtn { border-radius: 99px !important; font-size: 11.5px !important; }

/* ---------- popups / form dialogs ---------- */
body.dmm-module .modal-overlay {
    background: rgba(2, 4, 8, 0.55) !important;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

/* the form dialogs (Add / Edit) and the confirm dialog */
body.dmm-module .modal-overlay > div,
body.dmm-module #migrationProgressModal > div,
body.dmm-module #qrViewModal > div {
    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;
    backdrop-filter: none !important;
    animation: rdPopIn 0.22s cubic-bezier(0.2, 0.9, 0.3, 1.2);
    scrollbar-width: thin;
    scrollbar-color: rgba(var(--theme-rgb), 0.35) transparent;
}

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

body.dmm-module #migrationProgressModal { background: rgba(2, 4, 8, 0.55) !important; backdrop-filter: blur(8px) !important; }

/* dialog title row ("Enter New SKU Details" + close) */
body.dmm-module .modal-overlay > div > div:first-child[style*="justify-content: space-between"] {
    padding-bottom: 14px;
    margin-bottom: 18px !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
    font-size: 17px !important;
    font-weight: 700 !important;
    letter-spacing: -0.01em;
    color: #fff !important;
}

body.dmm-module .modal-overlay > div > div:first-child[style*="justify-content: space-between"] button {
    width: 34px;
    height: 34px;
    border-radius: 10px !important;
    justify-content: center;
    color: #94a3b8 !important;
    background: rgba(255, 255, 255, 0.04) !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
}

body.dmm-module .modal-overlay > div > div:first-child[style*="justify-content: space-between"] button:hover { color: #fff !important; background: rgba(239, 68, 68, 0.85) !important; border-color: #ef4444 !important; }
body.dmm-module .modal-overlay > div > div:first-child[style*="justify-content: space-between"] button .material-icons { font-size: 19px; color: inherit !important; }

body.dmm-module .modal-content h3 { color: #fff; font-weight: 700; letter-spacing: -0.01em; }
body.dmm-module .modal-content p { font-size: 13.5px; line-height: 1.6; }

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

body.dmm-module .field { margin-bottom: 16px; }

/* inputs with a leading icon */
body.dmm-module .inputBox { position: relative; }

body.dmm-module .inputBox > .material-icons {
    position: absolute;
    top: 50%;
    left: 15px;
    transform: translateY(-50%);
    font-size: 19px;
    color: var(--rd-muted) !important;
    pointer-events: none;
    z-index: 2;
    transition: color 0.2s ease;
}

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

body.dmm-module .modal-overlay input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]):not([type="file"]),
body.dmm-module .modal-overlay textarea,
body.dmm-module .inputBox input,
body.dmm-module .inputBox textarea {
    height: 48px;
    padding: 0 14px 0 14px !important;
    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 !important;
    font-weight: 500;
    box-shadow: none;
    outline: none;
    transition: border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}

body.dmm-module .inputBox input,
body.dmm-module .modal-overlay .inputBox input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]):not([type="file"]) { padding-left: 46px !important; }
body.dmm-module .modal-overlay textarea { height: auto; padding: 12px 14px !important; }

body.dmm-module .modal-overlay input:not([type="checkbox"]):not([type="radio"]):hover,
body.dmm-module .inputBox input:hover {
    background: rgba(255, 255, 255, 0.07) !important;
    border-color: rgba(255, 255, 255, 0.15) !important;
}

body.dmm-module .modal-overlay input:not([type="checkbox"]):not([type="radio"]):focus,
body.dmm-module .modal-overlay textarea:focus,
body.dmm-module .inputBox input:focus {
    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.dmm-module input::placeholder,
body.dmm-module textarea::placeholder { color: rgba(255, 255, 255, 0.38); }

body.dmm-module input:disabled,
body.dmm-module input[readonly] { color: #8b96a8 !important; border-style: dashed !important; }

/* location checkboxes */
body.dmm-module .checkbox-group {
    gap: 10px 14px !important;
    padding: 14px !important;
    border-radius: 12px !important;
    background: rgba(255, 255, 255, 0.03) !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
}

body.dmm-module .custom-checkbox { font-size: 12.5px !important; font-weight: 500; color: #cbd5e1 !important; }
body.dmm-module .custom-checkbox:hover { color: #fff !important; }
body.dmm-module .checkmark { border-radius: 6px !important; background-color: rgba(255, 255, 255, 0.06) !important; border-color: rgba(255, 255, 255, 0.2) !important; }
body.dmm-module .custom-checkbox input:checked ~ .checkmark { background-color: var(--theme-color) !important; border-color: var(--theme-color) !important; box-shadow: 0 0 10px rgba(var(--theme-rgb), 0.5) !important; }

body.dmm-module .error-text { font-size: 12px !important; color: #fca5a5 !important; }

/* primary button (Save / Submit) = Generate button of the Report Desk */
body.dmm-module .btn {
    height: 50px;
    padding: 0 20px !important;
    border-radius: 12px !important;
    font-size: 14.5px !important;
    font-weight: 700 !important;
    letter-spacing: 0.01em;
    color: #fff !important;
    border: 1px solid rgba(255, 255, 255, 0.14) !important;
    transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease;
}

body.dmm-module .btn:not([style*="background"]) {
    background: linear-gradient(135deg, var(--theme-gradient-start), var(--theme-gradient-end)) !important;
    box-shadow: 0 12px 28px -14px rgba(var(--theme-rgb), 0.95) !important;
}

body.dmm-module .btn:not([style*="background"]):hover { transform: translateY(-1px); box-shadow: 0 16px 32px -14px rgba(var(--theme-rgb), 1) !important; }
body.dmm-module .btn[style*="background"]:hover { filter: brightness(1.12); transform: none; box-shadow: none; }
body.dmm-module .btn:disabled { opacity: 0.65; cursor: wait; transform: none; }

/* the confirm dialog buttons: "No" = neutral pill, "Yes" keeps its red */
body.dmm-module .modal-content .btn { height: 44px; border-radius: 99px !important; font-size: 13px !important; }
body.dmm-module .modal-content .btn[style*="255,255,255"] { background: linear-gradient(180deg, rgba(255, 255, 255, 0.10) 0%, rgba(255, 255, 255, 0.03) 100%) !important; }

/* ==================================================================
   Efficiency Management page
   ================================================================== */
html body.dmm-eff { padding: 20px 40px 48px 40px !important; }
body.dmm-eff .rd-header { max-width: 1560px; margin-left: auto; margin-right: auto; }

body.dmm-eff #view-menu {
    max-width: 1560px;
    margin: 0 auto;
    padding: 0 !important;
}

body.dmm-eff #view-menu > div:first-child {
    margin-top: 0 !important;
    padding: 22px !important;
    border-radius: 18px !important;
    border: 1px solid var(--rd-line);
    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;
}

/* Packing / Production switch */
body.dmm-eff #tab-packing,
body.dmm-eff #tab-production {
    padding: 10px 18px !important;
    border-radius: 99px !important;
    font-size: 12.5px !important;
    font-weight: 600 !important;
    color: var(--rd-muted) !important;
    background: rgba(255, 255, 255, 0.035) !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
    transition: all 0.2s ease;
}

body.dmm-eff #tab-packing:hover,
body.dmm-eff #tab-production:hover { color: #fff !important; border-color: rgba(var(--theme-rgb), 0.35) !important; }

/* the page marks the active tab with background #38bdf8 */
body.dmm-eff #tab-packing[style*="#38bdf8"],
body.dmm-eff #tab-packing[style*="56, 189, 248"],
body.dmm-eff #tab-production[style*="#38bdf8"],
body.dmm-eff #tab-production[style*="56, 189, 248"] {
    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);
}

/* toolbar buttons = neutral pills; their own colour only as a soft hint */
body.dmm-eff #action-buttons-packing > button,
body.dmm-eff #action-buttons-packing > label,
body.dmm-eff #action-buttons-production > button,
body.dmm-eff #action-buttons-production > label {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 9px 16px !important;
    border-radius: 99px !important;
    font-size: 12.5px !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;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.09) 0%, rgba(255, 255, 255, 0.025) 100%) !important;
    box-shadow: 0 6px 16px -10px rgba(0, 0, 0, 0.9);
    transition: all 0.2s ease;
}

body.dmm-eff #action-buttons-packing > button[onclick*="addEntry"],
body.dmm-eff #action-buttons-production > button[onclick*="addProdEntry"] {
    color: #fff !important;
    border-color: rgba(var(--theme-rgb), 0.45) !important;
    background: linear-gradient(180deg, rgba(var(--theme-rgb), 0.30) 0%, rgba(var(--theme-rgb), 0.10) 100%) !important;
}

body.dmm-eff [id^="btnBulkDelete"] { color: #fca5a5 !important; border-color: rgba(239, 68, 68, 0.4) !important; }
body.dmm-eff [id^="btnBulkSave"] { color: #6ee7b7 !important; border-color: rgba(16, 185, 129, 0.4) !important; }
body.dmm-eff [id^="btnBulkEdit"] { color: #fcd34d !important; border-color: rgba(245, 158, 11, 0.4) !important; }

body.dmm-eff #action-buttons-packing > *:hover,
body.dmm-eff #action-buttons-production > *:hover {
    color: #fff !important;
    border-color: rgba(var(--theme-rgb), 0.6) !important;
    background: linear-gradient(180deg, rgba(var(--theme-rgb), 0.24) 0%, rgba(var(--theme-rgb), 0.06) 100%) !important;
}

/* filter labels + chips */
body.dmm-eff .filter-group-container label,
body.dmm-eff .filter-label {
    font-family: var(--rd-mono);
    font-size: 10px !important;
    font-weight: 600 !important;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--rd-faint) !important;
}

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

body.dmm-eff .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.dmm-eff .modal-header { border-bottom: 1px solid rgba(255, 255, 255, 0.07) !important; }
body.dmm-eff .modal-header h3 { color: #fff !important; font-weight: 700; letter-spacing: -0.01em; }

body.dmm-eff .modal-close {
    width: 34px;
    height: 34px;
    border-radius: 10px !important;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #94a3b8 !important;
    background: rgba(255, 255, 255, 0.04) !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
}

body.dmm-eff .modal-close:hover { color: #fff !important; background: rgba(239, 68, 68, 0.85) !important; border-color: #ef4444 !important; }

body.dmm-eff .form-group input,
body.dmm-eff .modal-body input:not([type="checkbox"]):not([type="file"]) {
    height: 44px;
    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;
    outline: none;
}

body.dmm-eff .form-group input:focus,
body.dmm-eff .modal-body input:focus {
    border-color: rgba(var(--theme-rgb), 0.6) !important;
    box-shadow: 0 0 0 3px rgba(var(--theme-rgb), 0.14);
}

body.dmm-eff .btn-save,
body.dmm-eff .btn-cancel {
    min-height: 42px;
    padding: 0 20px !important;
    border-radius: 99px !important;
    font-size: 13px !important;
    font-weight: 600 !important;
    cursor: pointer;
}

body.dmm-eff .btn-save:not([style*="background"]) {
    color: #fff !important;
    border: 1px solid rgba(255, 255, 255, 0.14) !important;
    background: linear-gradient(135deg, var(--theme-gradient-start), var(--theme-gradient-end)) !important;
    box-shadow: 0 10px 24px -12px rgba(var(--theme-rgb), 0.9);
}

body.dmm-eff .btn-cancel {
    color: #e2e8f0 !important;
    border: 1px solid rgba(255, 255, 255, 0.10) !important;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.10) 0%, rgba(255, 255, 255, 0.03) 100%) !important;
}

/* filter rows (Location / Machine chips) */
body.dmm-eff .filter-group-container > div:not(.filter-row) {
    font-family: var(--rd-mono);
    font-size: 10px !important;
    font-weight: 600 !important;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--rd-faint) !important;
    margin-bottom: 8px !important;
}

body.dmm-eff .filter-btn {
    padding: 7px 14px;
    border-radius: 99px;
    font-family: var(--rd-mono);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.08em;
    color: var(--rd-muted);
    background: rgba(255, 255, 255, 0.035);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

body.dmm-eff .filter-btn:hover { color: #fff; background: rgba(var(--theme-rgb), 0.12); border-color: rgba(var(--theme-rgb), 0.35); }

body.dmm-eff .filter-btn.active {
    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%);
    box-shadow: 0 8px 20px -12px rgba(var(--theme-rgb), 0.9);
}

/* data tables */
body.dmm-eff .data-table-container {
    border-radius: 12px !important;
    border: 1px solid rgba(255, 255, 255, 0.06) !important;
    background: rgba(0, 0, 0, 0.16) !important;
    overflow: auto;
}

body.dmm-eff .data-table { font-size: 13px; }

body.dmm-eff .data-table thead tr { background: #0f1626 !important; }

body.dmm-eff .data-table thead th {
    background: #0f1626 !important;
    padding: 12px 14px !important;
    font-size: 10.5px !important;
    font-weight: 700 !important;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    white-space: nowrap;
    color: rgba(var(--theme-rgb), 0.92) !important;
}

body.dmm-eff .data-table thead th::after { height: 1px !important; background: rgba(var(--theme-rgb), 0.35) !important; }

body.dmm-eff .data-table td { padding: 11px 14px !important; border-bottom: 1px solid rgba(255, 255, 255, 0.05); color: #e2e8f0; }
body.dmm-eff .data-table tbody tr:nth-child(even) td { background: rgba(255, 255, 255, 0.015); }
body.dmm-eff .data-table tbody tr:hover td { background: rgba(var(--theme-rgb), 0.07); }

body.dmm-eff input[type="checkbox"].round-checkbox { border-color: rgba(203, 213, 225, 0.6); }
body.dmm-eff input[type="checkbox"].round-checkbox:checked { background: var(--theme-color); border-color: var(--theme-color); }

body.dmm-eff .toast {
    background: rgba(16, 22, 36, 0.96) !important;
    border: 1px solid rgba(var(--theme-rgb), 0.35);
    border-left: 3px solid var(--theme-color);
    border-radius: 14px !important;
    box-shadow: 0 24px 50px -20px rgba(0, 0, 0, 0.95) !important;
}

body.dmm-eff .sku-row { border-radius: 12px; background: rgba(255, 255, 255, 0.03); border-color: rgba(255, 255, 255, 0.07); }

/* ==================================================================
   Themed dropdowns (dmm-pro.js upgrades the native form selects)
   ================================================================== */
.dmxs { position: relative; display: inline-block; min-width: 140px; vertical-align: middle; }
.dmxs.dmxs-block { display: block; width: 100%; }

.dmxs-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;
}

.dmxs-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    height: 48px;
    padding: 0 12px 0 14px;
    border-radius: 12px;
    font-family: "Inter", sans-serif;
    font-size: 13.5px;
    font-weight: 500;
    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;
}

.dmxs.dmxs-icon .dmxs-btn { padding-left: 46px; }
body.dmm-eff .dmxs-btn { height: 44px; border-radius: 10px; }

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

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

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

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

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

.dmxs-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;
}

.dmxs.is-open { z-index: 400; }
.dmxs.is-open .dmxs-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; }
.dmxs-pop.is-up { top: auto; bottom: calc(100% + 6px); transform-origin: bottom center; }
.dmxs-pop.is-right { left: auto; right: 0; }

.dmxs-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;
}

.dmxs-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;
}

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

body.dmm-pro select option { background: #131a28; color: #e2e8f0; }

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

@media (max-width: 768px) {
    html body.dmm-module,
    html body.dmm-eff { padding: 15px 14px 28px 14px !important; }
    .hub-container { padding: 15px 20px 28px 20px; }
    .cards-grid { grid-template-columns: 1fr; gap: 14px; }
    .portal-card { min-height: auto; padding: 20px 20px 16px 20px; }
    .card-body h3 { font-size: 17px; }
    .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.dmm-module > .container { padding: 14px 12px 18px !important; border-radius: 16px !important; min-height: 0 !important; }
    body.dmm-eff #view-menu > div:first-child { padding: 14px 12px !important; border-radius: 16px !important; }
}

@media (max-width: 700px) {
    /* the page swaps the location tabs for a dropdown and the table for cards */
    body.dmm-module .search-bar {
        position: static !important;
        margin: 0 0 14px 0 !important;
        padding: 0 !important;
        background: transparent !important;
        border-bottom: 0 !important;
    }

    body.dmm-module .search-bar input[type="text"] { min-width: 100% !important; }
    body.dmm-module .search-bar .btn-top-action,
    body.dmm-module .search-bar .addBtn { flex: 1; justify-content: center; }
    body.dmm-module .main-content { padding: 0 !important; border: 0 !important; background: transparent !important; }

    /* card rows: keep the page's own label column / checkbox corner */
    body.dmm-module .table-container td { padding: 8px 10px 8px 45% !important; }
    body.dmm-module .table-container td:nth-of-type(2) { padding-right: 50px !important; }
    body.dmm-module .table-container td:nth-of-type(1) { padding: 10px !important; }

    body.dmm-module .table-container { background: transparent !important; border: 0 !important; }

    body.dmm-module .table-container tr {
        border-radius: 14px !important;
        border: 1px solid rgba(var(--theme-rgb), 0.18) !important;
        background:
            radial-gradient(110% 70% at 50% 0%, rgba(var(--theme-rgb), 0.08) 0%, rgba(var(--theme-rgb), 0) 60%),
            linear-gradient(180deg, rgba(255, 255, 255, 0.035) 0%, rgba(255, 255, 255, 0.012) 100%) !important;
        box-shadow: 0 20px 40px -30px rgba(0, 0, 0, 0.95) !important;
    }

    body.dmm-module .table-container tbody tr:nth-child(even) td,
    body.dmm-module .table-container tbody tr:hover td { background: transparent; }

    body.dmm-module .table-container td::before {
        font-family: var(--rd-mono);
        font-size: 9.5px !important;
        letter-spacing: 0.1em;
        text-transform: uppercase;
        color: rgba(var(--theme-rgb), 0.9) !important;
    }

    body.dmm-module .dmm-toolbar .addBtn,
    body.dmm-module .dmm-toolbar .btn-top-action { padding: 10px 14px !important; }
}

@media (max-width: 560px) {
    .rd-eyebrow-org, .rd-eyebrow-sep { display: none; }
    .rd-hub-btn .btn-label { display: none; }
}

@media (prefers-reduced-motion: reduce) {
    body.dmm-module .modal-overlay > div, body.dmm-eff .modal-content { animation: none; }
}
