@import url(https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@500;600;700&display=swap);
.ai-chat-modal {
    /* colour — cool anchor ≈ hue 230, OKLCH throughout */
    --ai-paper: oklch(98.6% 0.004 230);
    --ai-paper-2: oklch(96.8% 0.007 230);
    --ai-paper-3: oklch(94% 0.011 230);
    --ai-ink: oklch(22% 0.025 250);
    --ai-ink-2: oklch(34% 0.022 248);
    --ai-neutral: oklch(46% 0.018 242);
    --ai-muted: oklch(52% 0.02 238);
    --ai-rule: oklch(90.5% 0.009 235);
    --ai-rule-2: oklch(80% 0.014 233);
    --ai-ink-surface: oklch(28% 0.035 250);
    --ai-accent: oklch(55% 0.105 215);
    --ai-accent-deep: oklch(46% 0.095 218);
    --ai-accent-ink: oklch(99% 0.002 220);
    --ai-accent-soft: oklch(94.5% 0.028 210);
    --ai-focus: oklch(55% 0.105 215);
    --ai-error: oklch(50% 0.185 27);
    --ai-error-soft: oklch(96.5% 0.018 25);
    --ai-error-rule: oklch(86% 0.06 25);
    --ai-warning-ink: oklch(48% 0.105 70);
    --ai-warning-soft: oklch(97% 0.022 85);
    --ai-warning-rule: oklch(86% 0.07 85);
    --ai-info-soft: oklch(96.8% 0.014 235);
    --ai-info-rule: oklch(86% 0.045 235);
    --ai-xlsx-ink: oklch(45% 0.12 152);
    --ai-xlsx-soft: oklch(95% 0.035 152);
    --ai-ppt-ink: oklch(50% 0.13 50);
    --ai-ppt-soft: oklch(95.5% 0.03 60);

    /* type — system-native on purpose: intranet users, CJK coverage, app parity */
    --ai-font-ui: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
        "Helvetica Neue", "PingFang SC", "Microsoft YaHei", "Noto Sans SC",
        Arial, sans-serif;
    --ai-font-mono: ui-monospace, SFMono-Regular, "Cascadia Mono", Consolas,
        "Liberation Mono", monospace;
    --ai-text-xs: 12px;
    --ai-text-sm: 13px;
    --ai-text-md: 14px;
    --ai-text-base: 16px;
    --ai-text-display: 24px;

    /* space — 4pt scale */
    --ai-space-2xs: 4px;
    --ai-space-xs: 8px;
    --ai-space-sm: 12px;
    --ai-space-md: 16px;
    --ai-space-lg: 24px;
    --ai-space-xl: 32px;

    /* shape */
    --ai-radius-tile: 12px;
    --ai-radius-btn: 12px;
    --ai-radius-chip: 12px;
    --ai-radius-card: 16px;
    --ai-radius-field: 16px;
    --ai-radius-bubble: 18px;
    --ai-radius-tail: 6px;
    --ai-radius-full: 999px;

    /* motion */
    --ai-ease-out: cubic-bezier(0.16, 1, 0.3, 1);
    --ai-ease-in: cubic-bezier(0.7, 0, 0.84, 0);
    --ai-dur-micro: 120ms;
    --ai-dur-short: 200ms;
    --ai-dur-med: 240ms;

    /* elevation */
    --ai-shadow-card: 0 1px 2px oklch(20% 0.02 240 / 0.05);
    --ai-shadow-modal: 0 24px 70px oklch(18% 0.03 245 / 0.24);
    --ai-ring: 0 0 0 2px var(--ai-paper), 0 0 0 4px var(--ai-focus);
}

.ai-chat-entry {
    position: fixed;
    top: var(--ai-chat-entry-y);
    left: var(--ai-chat-entry-x);
    width: 88px;
    z-index: 1100;
    touch-action: none;
    --ai-chat-tooltip-surface: #111827;
    --ai-chat-tooltip-ink: #f8fafc;
    --ai-chat-tooltip-muted: #cbd5e1;
    --ai-chat-tooltip-accent: #67e8f9;
    --ai-chat-tooltip-accent-strong: #22d3ee;
    --ai-chat-tooltip-cyan-soft: rgba(34, 211, 238, 0.34);
    --ai-chat-tooltip-violet-soft: rgba(139, 92, 246, 0.42);
    --ai-chat-tooltip-border: rgba(129, 140, 248, 0.34);
    --ai-chat-tooltip-control: rgba(255, 255, 255, 0.08);
    --ai-chat-tooltip-control-hover: rgba(255, 255, 255, 0.16);
    --ai-chat-tooltip-rule: rgba(255, 255, 255, 0.1);
    --ai-chat-tooltip-shadow: rgba(15, 23, 42, 0.32);
    --ai-chat-tooltip-focus: rgba(103, 232, 249, 0.72);
}

.ai-chat-tooltip {
    position: absolute;
    right: 0;
    bottom: calc(100% + 13px);
    isolation: isolate;
    width: min(300px, calc(100vw - 48px));
    color: var(--ai-chat-tooltip-ink);
    background:
        radial-gradient(
            circle at 16% -22%,
            var(--ai-chat-tooltip-cyan-soft),
            transparent 43%
        ),
        radial-gradient(
            circle at 92% 118%,
            var(--ai-chat-tooltip-violet-soft),
            transparent 48%
        ),
        var(--ai-chat-tooltip-surface);
    border: 1px solid var(--ai-chat-tooltip-border);
    border-radius: 20px 20px 7px 20px;
    box-shadow: 0 20px 46px var(--ai-chat-tooltip-shadow);
    transform-origin: calc(100% - 28px) 100%;
    animation: ai-chat-tooltip-enter 420ms cubic-bezier(0.2, 0.8, 0.2, 1);
    transition: transform 180ms ease, box-shadow 180ms ease;
}

.ai-chat-tooltip::before {
    content: '';
    position: absolute;
    top: -1px;
    left: 20px;
    z-index: 0;
    width: 82px;
    height: 1px;
    background: linear-gradient(
        90deg,
        transparent,
        var(--ai-chat-tooltip-accent),
        transparent
    );
    opacity: 0.8;
}

.ai-chat-tooltip::after {
    content: '';
    position: absolute;
    right: 22px;
    bottom: -9px;
    z-index: 0;
    width: 18px;
    height: 18px;
    border-right: 1px solid var(--ai-chat-tooltip-border);
    border-bottom: 1px solid var(--ai-chat-tooltip-border);
    background: var(--ai-chat-tooltip-surface);
    transform: rotate(45deg);
}

.ai-chat-tooltip:hover {
    transform: translateY(-2px);
}

.ai-chat-tooltip-content,
.ai-chat-tooltip-close {
    position: relative;
    z-index: 1;
    border: 0;
    color: inherit;
    font: inherit;
}

.ai-chat-tooltip-content {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    padding: 18px 44px 16px 19px;
    border-radius: inherit;
    background: transparent;
    text-align: left;
    cursor: pointer;
}

.ai-chat-tooltip-close {
    position: absolute;
    top: 11px;
    right: 11px;
    width: 27px;
    height: 27px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border-radius: 50%;
    color: var(--ai-chat-tooltip-muted);
    background: var(--ai-chat-tooltip-control);
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    z-index: 2;
    transition: color 150ms ease, background 150ms ease, transform 150ms ease;
}

.ai-chat-tooltip-close:hover {
    color: var(--ai-chat-tooltip-ink);
    background: var(--ai-chat-tooltip-control-hover);
}

.ai-chat-tooltip-close:active {
    transform: scale(0.92);
}

.ai-chat-tooltip-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    margin-bottom: 8px;
    color: var(--ai-chat-tooltip-accent);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.13em;
    text-transform: uppercase;
}

.ai-chat-tooltip-status {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--ai-chat-tooltip-accent-strong);
    box-shadow: 0 0 13px var(--ai-chat-tooltip-accent-strong);
    animation: ai-chat-tooltip-pulse 2.4s ease-in-out infinite;
}

.ai-chat-tooltip-headline {
    max-width: 225px;
    color: var(--ai-chat-tooltip-ink);
    font-size: 16px;
    font-weight: 750;
    line-height: 1.22;
    letter-spacing: -0.02em;
    overflow-wrap: anywhere;
}

.ai-chat-tooltip-copy {
    margin-top: 7px;
    color: var(--ai-chat-tooltip-muted);
    font-size: 12px;
    line-height: 1.5;
}

.ai-chat-tooltip-action {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 13px;
    padding-top: 11px;
    border-top: 1px solid var(--ai-chat-tooltip-rule);
    color: var(--ai-chat-tooltip-accent);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.02em;
    white-space: nowrap;
}

.ai-chat-tooltip-action > span {
    font-size: 14px;
    transition: transform 160ms ease;
}

.ai-chat-tooltip-content:hover .ai-chat-tooltip-action > span {
    transform: translate(2px, -2px);
}

.ai-chat-tooltip-content:active {
    transform: translateY(1px);
}

.ai-chat-tooltip-content:disabled,
.ai-chat-tooltip-close:disabled {
    cursor: not-allowed;
    opacity: 0.55;
}

.ai-chat-tooltip-content:focus-visible,
.ai-chat-tooltip-close:focus-visible {
    outline: 2px solid var(--ai-chat-tooltip-focus);
    outline-offset: 3px;
}

.ai-chat-launcher {
    width: 88px;
    height: 88px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    padding: 6px;
    border: 0;
    border-radius: 50%;
    background: transparent;
    cursor: grab;
    touch-action: none;
    transition: transform 160ms ease, box-shadow 160ms ease;
}

.ai-chat-launcher:active {
    cursor: grabbing;
}

.ai-chat-launcher:hover,
.ai-chat-launcher:focus-visible {
    transform: translateY(-2px) scale(1.04);
}

.ai-chat-launcher:focus-visible {
    outline: 3px solid rgba(37, 99, 235, 0.28);
    outline-offset: 2px;
}

.ai-chat-launcher-wrap {
    position: relative;
    width: 88px;
    height: 88px;
}

.ai-chat-launcher-dismiss {
    position: absolute;
    top: -5px;
    right: -5px;
    z-index: 1;
    width: 19px;
    height: 19px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 1px solid rgba(15, 23, 42, 0.16);
    border-radius: 50%;
    color: #334155;
    background: #ffffff;
    box-shadow: 0 1px 4px rgba(15, 23, 42, 0.2);
    font-size: 14px;
    line-height: 1;
    cursor: pointer;
    transition: transform 120ms ease, background 120ms ease;
}

.ai-chat-launcher-dismiss:hover {
    background: #f1f5f9;
    transform: scale(1.08);
}

.ai-chat-launcher-dismiss:focus-visible {
    outline: 2px solid rgba(37, 99, 235, 0.65);
    outline-offset: 2px;
}

/* ------------------------------------------------------------ modal shell */

.ai-chat-modal.modal {
    pointer-events: none;
}

.ai-chat-modal .modal-dialog {
    position: fixed;
    top: var(--ai-chat-y, 0px);
    left: var(--ai-chat-x, 0px);
    width: var(--ai-chat-width, 640px);
    height: var(--ai-chat-height, 760px);
    max-width: none;
    max-height: none;
    margin: 0;
    pointer-events: auto;
}

.ai-chat-modal.is-maximized .modal-dialog {
    top: 0;
    left: 0;
    width: 100vw;
    /* dvh keeps the composer inside the visible screen where the browser UI
       makes vh taller than what is on show (mobile / TV Chrome). */
    height: 100vh;
    height: 100dvh;
}

.ai-chat-modal .modal-content {
    height: 100%;
    min-height: 0;
    overflow: hidden;
    border: 0;
    border-radius: 20px;
    color: var(--ai-chat-ink, var(--ai-ink));
    background: var(--ai-paper);
    box-shadow: var(--ai-shadow-modal);
    font-family: var(--ai-font-ui);
}

/* ---------------------------------------------------------------- header */

.ai-chat-modal .modal-header {
    align-items: center;
    gap: var(--ai-space-sm);
    padding: var(--ai-space-sm) var(--ai-space-md);
    border-bottom: 1px solid var(--ai-rule);
    background: var(--ai-paper);
    cursor: move;
    touch-action: none;
    user-select: none;
}

.ai-chat-title {
    display: flex;
    align-items: center;
    gap: var(--ai-space-sm);
    margin: 0;
}

.ai-chat-title-icon,
.ai-chat-empty-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.ai-chat-title-icon {
    flex: 0 0 auto;
    width: 40px;
    height: 40px;
    padding: 4px;
    border-radius: var(--ai-radius-tile);
}

.ai-chat-title-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.ai-chat-title-name {
    min-width: 0;
    color: var(--ai-ink);
    font-size: var(--ai-text-base);
    font-weight: 700;
    letter-spacing: -0.01em;
    line-height: 1.25;
    overflow-wrap: anywhere;
}

.ai-chat-title-sub {
    color: var(--ai-muted);
    font-size: var(--ai-text-xs);
    font-weight: 500;
    line-height: 1.3;
}

.ai-chat-header-actions {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: var(--ai-space-2xs);
    cursor: default;
}

.ai-chat-window-control,
.ai-chat-clear,
.ai-chat-close {
    position: relative;
    width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 0;
    border-radius: 10px;
    color: var(--ai-neutral);
    background: transparent;
    font-size: 18px;
    cursor: pointer;
    transition: color var(--ai-dur-micro) var(--ai-ease-out),
        background-color var(--ai-dur-micro) var(--ai-ease-out);
}

/* expand the touch target to 44px without growing the visual */
.ai-chat-window-control::before,
.ai-chat-clear::before,
.ai-chat-close::before {
    content: '';
    position: absolute;
    inset: -4px;
}

.ai-chat-close:hover,
.ai-chat-close.is-hover,
.ai-chat-window-control:hover,
.ai-chat-window-control.is-hover {
    color: var(--ai-ink);
    background: var(--ai-paper-3);
}

.ai-chat-clear:hover:not(:disabled),
.ai-chat-clear.is-hover {
    color: var(--ai-error);
    background: var(--ai-error-soft);
}

.ai-chat-clear:active:not(:disabled),
.ai-chat-close:active,
.ai-chat-window-control:active {
    transform: translateY(1px);
}

.ai-chat-clear:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.ai-chat-clear:focus-visible,
.ai-chat-close:focus-visible,
.ai-chat-window-control:focus-visible {
    outline: 2px solid var(--ai-focus);
    outline-offset: 2px;
}

.ai-chat-resize-handle {
    position: absolute;
    z-index: 2;
    pointer-events: auto;
}

.ai-chat-resize-handle--n,
.ai-chat-resize-handle--s {
    right: 10px;
    left: 10px;
    height: 10px;
}

.ai-chat-resize-handle--n {
    top: 0;
    cursor: ns-resize;
}

.ai-chat-resize-handle--s {
    bottom: 0;
    cursor: ns-resize;
}

.ai-chat-resize-handle--e,
.ai-chat-resize-handle--w {
    top: 10px;
    bottom: 10px;
    width: 10px;
}

.ai-chat-resize-handle--e {
    right: 0;
    cursor: ew-resize;
}

.ai-chat-resize-handle--w {
    left: 0;
    cursor: ew-resize;
}

.ai-chat-resize-handle--ne,
.ai-chat-resize-handle--se,
.ai-chat-resize-handle--sw,
.ai-chat-resize-handle--nw {
    width: 14px;
    height: 14px;
}

.ai-chat-resize-handle--ne {
    top: 0;
    right: 0;
    cursor: nesw-resize;
}

.ai-chat-resize-handle--se {
    right: 0;
    bottom: 0;
    cursor: nwse-resize;
}

.ai-chat-resize-handle--sw {
    bottom: 0;
    left: 0;
    cursor: nesw-resize;
}

.ai-chat-resize-handle--nw {
    top: 0;
    left: 0;
    cursor: nwse-resize;
}

/* ------------------------------------------------------------------ body */

.ai-chat-body {
    padding: 20px var(--ai-space-lg);
    background: var(--ai-paper-2);
    scrollbar-width: thin;
    scrollbar-color: var(--ai-rule-2) transparent;
}

.ai-chat-body::-webkit-scrollbar {
    width: 10px;
}

.ai-chat-body::-webkit-scrollbar-thumb {
    border: 3px solid transparent;
    border-radius: var(--ai-radius-full);
    background-color: var(--ai-rule-2);
    background-clip: content-box;
}

.ai-chat-body::-webkit-scrollbar-track {
    background: transparent;
}

/* ----------------------------------------------------------- empty state */

.ai-chat-empty {
    max-width: 620px;
    margin: var(--ai-space-xl) auto var(--ai-space-lg);
    text-align: center;
}

.ai-chat-empty-icon {
    position: relative;
    overflow: visible;
    width: 128px;
    height: 152px;
    margin: 0 auto var(--ai-space-md);
}

/* soft ground shadow so the mascot stands on the surface */
.ai-chat-empty-icon::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 50%;
    width: 84px;
    height: 12px;
    border-radius: var(--ai-radius-full);
    background: var(--ai-ink);
    opacity: 0.1;
    filter: blur(5px);
    transform: translateX(-50%);
}

.ai-chat-mascot {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
    pointer-events: none;
    user-select: none;
}

.ai-chat-mascot--launcher {
    transform: translateY(2px) scale(1.26);
}

.ai-chat-mascot--title {
    transform: translateY(1px) scale(1.15);
}

.ai-chat-mascot--empty {
    position: relative;
    z-index: 1;
    transform: none;
}

.ai-chat-empty h5 {
    min-width: 0;
    margin: 0 0 var(--ai-space-xs);
    color: var(--ai-ink);
    font-size: var(--ai-text-display);
    font-weight: 700;
    letter-spacing: -0.015em;
    line-height: 1.2;
    overflow-wrap: anywhere;
}

.ai-chat-empty p {
    max-width: 46ch;
    margin: 0 auto;
    color: var(--ai-muted);
    font-size: var(--ai-text-md);
    line-height: 1.55;
}

.ai-chat-suggest-head {
    max-width: 560px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--ai-space-sm);
    margin: var(--ai-space-lg) auto 0;
}

.ai-chat-suggest-label {
    color: var(--ai-neutral);
    font-size: var(--ai-text-xs);
    font-weight: 600;
    letter-spacing: 0.07em;
    text-transform: uppercase;
}

.ai-chat-lang-toggle {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    padding: 2px;
    border: 1px solid var(--ai-rule-2);
    border-radius: var(--ai-radius-full);
    background: var(--ai-paper);
}

.ai-chat-lang-toggle button {
    position: relative;
    min-width: 44px;
    min-height: 26px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 2px var(--ai-space-sm);
    border: 0;
    border-radius: var(--ai-radius-full);
    color: var(--ai-neutral);
    background: transparent;
    font-family: var(--ai-font-ui);
    font-size: var(--ai-text-xs);
    font-weight: 600;
    line-height: 1;
    white-space: nowrap;
    cursor: pointer;
    transition: color var(--ai-dur-micro) var(--ai-ease-out),
        background-color var(--ai-dur-micro) var(--ai-ease-out);
}

/* expand the touch target vertically to ~44px without growing the pill */
.ai-chat-lang-toggle button::before {
    content: '';
    position: absolute;
    inset: -9px 0;
}

.ai-chat-lang-toggle button:hover:not([aria-pressed='true']),
.ai-chat-lang-toggle button.is-hover {
    color: var(--ai-ink-2);
    background: var(--ai-paper-3);
}

.ai-chat-lang-toggle button:active {
    transform: translateY(1px);
}

.ai-chat-lang-toggle button:focus-visible,
.ai-chat-lang-toggle button.is-focus {
    outline: 2px solid var(--ai-focus);
    outline-offset: 2px;
}

.ai-chat-lang-toggle button[aria-pressed='true'] {
    color: var(--ai-accent-ink);
    background: var(--ai-ink-surface);
}

.ai-chat-suggestions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--ai-space-sm);
    max-width: 560px;
    margin: var(--ai-space-sm) auto 0;
}

.ai-chat-suggestions button {
    min-height: 44px;
    display: flex;
    align-items: center;
    padding: var(--ai-space-sm) var(--ai-space-md);
    border: 1px solid var(--ai-rule-2);
    border-radius: var(--ai-radius-chip);
    color: var(--ai-ink-2);
    background: var(--ai-paper);
    font-family: var(--ai-font-ui);
    font-size: var(--ai-text-sm);
    font-weight: 500;
    line-height: 1.45;
    text-align: left;
    cursor: pointer;
    transition: border-color var(--ai-dur-micro) var(--ai-ease-out),
        background-color var(--ai-dur-micro) var(--ai-ease-out),
        color var(--ai-dur-micro) var(--ai-ease-out),
        transform var(--ai-dur-micro) var(--ai-ease-out);
}

.ai-chat-suggestions button:hover:not(:disabled),
.ai-chat-suggestions button.is-hover {
    border-color: var(--ai-accent);
    color: var(--ai-accent-deep);
    background: var(--ai-accent-soft);
    transform: translateY(-1px);
}

.ai-chat-suggestions button:active:not(:disabled),
.ai-chat-suggestions button.is-active {
    transform: translateY(0);
}

.ai-chat-suggestions button:focus-visible,
.ai-chat-suggestions button.is-focus {
    outline: 2px solid var(--ai-focus);
    outline-offset: 2px;
}

.ai-chat-suggestions button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.ai-chat-suggestions--compact {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-start;
    max-width: none;
    margin-top: var(--ai-space-xs);
}

.ai-chat-suggestions--compact button {
    min-height: 36px;
    padding: var(--ai-space-xs) var(--ai-space-sm);
    font-size: var(--ai-text-xs);
}

/* -------------------------------------------------------------- messages */

.ai-chat-messages {
    display: flex;
    flex-direction: column;
    gap: var(--ai-space-md);
}

.ai-chat-message {
    display: flex;
    align-items: flex-start;
    gap: var(--ai-space-xs);
    width: 100%;
    animation: ai-chat-message-in var(--ai-dur-med) var(--ai-ease-out) both;
}

.ai-chat-message--user {
    justify-content: flex-end;
}

.ai-chat-avatar {
    flex: 0 0 auto;
    width: 28px;
    height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    margin-top: 2px;
    padding: 2px;
    border: 1px solid var(--ai-rule);
    border-radius: 50%;
    background: var(--ai-paper);
}

.ai-chat-avatar img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transform: translateY(1px) scale(1.2);
}

.ai-chat-user-bubble {
    max-width: min(78%, 600px);
    padding: 12px 16px;
    border-radius: var(--ai-radius-bubble) var(--ai-radius-bubble)
        var(--ai-radius-tail) var(--ai-radius-bubble);
    color: var(--ai-paper);
    background: var(--ai-ink-surface);
    font-size: var(--ai-text-base);
    line-height: 1.55;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.ai-chat-message--assistant {
    justify-content: flex-start;
}

.ai-chat-response-card,
.ai-chat-typing {
    width: min(94%, 720px);
    border: 1px solid var(--ai-rule);
    border-radius: var(--ai-radius-tail) var(--ai-radius-card)
        var(--ai-radius-card) var(--ai-radius-card);
    background: var(--ai-paper);
    box-shadow: var(--ai-shadow-card);
}

.ai-chat-message .ai-chat-response-card,
.ai-chat-message .ai-chat-typing {
    width: auto;
    min-width: 0;
    max-width: min(94%, 720px);
    flex: 0 1 auto;
}

.ai-chat-response-card {
    position: relative;
    padding: var(--ai-space-md);
}

.ai-chat-response-card--info {
    border-color: var(--ai-info-rule);
    background: var(--ai-info-soft);
}

.ai-chat-response-card--warning {
    border-color: var(--ai-warning-rule);
    background: var(--ai-warning-soft);
}

.ai-chat-response-card--error {
    border-color: var(--ai-error-rule);
    background: var(--ai-error-soft);
}

.ai-chat-response-card > :last-child {
    margin-bottom: 0;
}

.ai-chat-module-badge {
    width: fit-content;
    display: inline-flex;
    align-items: center;
    gap: var(--ai-space-xs);
    margin-bottom: var(--ai-space-xs);
    padding: var(--ai-space-2xs) var(--ai-space-xs);
    border: 1px solid color-mix(in srgb, var(--ai-chat-module-color) 24%, var(--ai-paper));
    border-radius: var(--ai-radius-full);
    color: color-mix(in srgb, var(--ai-chat-module-color) 72%, black);
    background: color-mix(in srgb, var(--ai-chat-module-color) 7%, var(--ai-paper));
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.ai-chat-module-badge::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--ai-chat-module-color);
}

.ai-chat-response-text {
    max-width: 70ch;
    margin: 0;
    color: var(--ai-ink);
    font-size: var(--ai-text-base);
    line-height: 1.6;
    overflow-wrap: anywhere;
}

.ai-chat-response-text > :first-child {
    margin-top: 0;
}

.ai-chat-response-text > :last-child {
    margin-bottom: 0;
}

.ai-chat-response-text p,
.ai-chat-response-text ul,
.ai-chat-response-text ol,
.ai-chat-response-text blockquote,
.ai-chat-response-text pre {
    margin: 0 0 var(--ai-space-xs);
}

.ai-chat-response-text ul,
.ai-chat-response-text ol {
    padding-left: var(--ai-space-lg);
}

.ai-chat-response-text strong {
    color: var(--ai-ink);
    font-weight: 700;
}

.ai-chat-response-text h1,
.ai-chat-response-text h2,
.ai-chat-response-text h3,
.ai-chat-response-text h4 {
    margin: var(--ai-space-md) 0 var(--ai-space-xs);
    color: var(--ai-ink);
    font-weight: 700;
    letter-spacing: -0.01em;
    line-height: 1.3;
}

.ai-chat-response-text h1 {
    font-size: 20px;
}

.ai-chat-response-text h2 {
    font-size: 18px;
}

.ai-chat-response-text h3,
.ai-chat-response-text h4 {
    font-size: var(--ai-text-base);
}

.ai-chat-response-text blockquote {
    padding: var(--ai-space-xs) var(--ai-space-sm);
    border-left: 2px solid var(--ai-rule-2);
    color: var(--ai-neutral);
    background: var(--ai-paper-2);
}

.ai-chat-response-text code {
    padding: 2px var(--ai-space-2xs);
    border-radius: 6px;
    color: var(--ai-ink-2);
    background: var(--ai-paper-3);
    font-family: var(--ai-font-mono);
    font-size: 0.88em;
}

.ai-chat-response-text pre {
    overflow: auto;
    padding: var(--ai-space-sm);
    border-radius: var(--ai-radius-tile);
    background: var(--ai-ink-surface);
}

.ai-chat-response-text pre code {
    padding: 0;
    color: var(--ai-paper-2);
    background: transparent;
}

.ai-chat-response-text a {
    color: var(--ai-accent-deep);
    text-decoration: underline;
    text-underline-offset: 2px;
}

.ai-chat-state-detail {
    display: flex;
    align-items: flex-start;
    gap: var(--ai-space-xs);
    margin-top: var(--ai-space-sm);
    color: var(--ai-neutral);
    font-size: var(--ai-text-sm);
}

.ai-chat-state-detail > svg {
    flex: 0 0 auto;
    margin-top: 2px;
}

.ai-chat-state-detail p {
    margin: 2px 0 0;
}

/* ------------------------------------------------- secondary button voice */

.ai-chat-retry,
.ai-chat-table-footer button,
.ai-chat-report button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--ai-space-xs);
    min-height: 36px;
    padding: var(--ai-space-xs) var(--ai-space-sm);
    border: 1px solid var(--ai-rule-2);
    border-radius: 10px;
    color: var(--ai-ink-2);
    background: var(--ai-paper);
    font-family: var(--ai-font-ui);
    font-size: var(--ai-text-sm);
    font-weight: 600;
    white-space: nowrap;
    cursor: pointer;
    transition: border-color var(--ai-dur-micro) var(--ai-ease-out),
        background-color var(--ai-dur-micro) var(--ai-ease-out),
        color var(--ai-dur-micro) var(--ai-ease-out);
}

.ai-chat-table-footer button:hover:not(:disabled),
.ai-chat-table-footer button.is-hover,
.ai-chat-report button:hover:not(:disabled),
.ai-chat-report button.is-hover {
    border-color: var(--ai-accent);
    color: var(--ai-accent-deep);
    background: var(--ai-accent-soft);
}

.ai-chat-retry:active:not(:disabled),
.ai-chat-table-footer button:active:not(:disabled),
.ai-chat-report button:active:not(:disabled) {
    transform: translateY(1px);
}

.ai-chat-retry:focus-visible,
.ai-chat-table-footer button:focus-visible,
.ai-chat-report button:focus-visible {
    outline: 2px solid var(--ai-focus);
    outline-offset: 2px;
}

.ai-chat-retry:disabled,
.ai-chat-table-footer button:disabled,
.ai-chat-report button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.ai-chat-retry {
    margin-top: var(--ai-space-sm);
    border-color: color-mix(in srgb, var(--ai-error) 30%, var(--ai-paper));
    color: var(--ai-error);
    background: var(--ai-paper);
}

.ai-chat-retry:hover:not(:disabled),
.ai-chat-retry.is-hover {
    border-color: var(--ai-error);
    color: var(--ai-error);
    background: var(--ai-error-soft);
}

/* ---------------------------------------------------- sections and table */

.ai-chat-section {
    margin-top: var(--ai-space-md);
    padding-top: var(--ai-space-sm);
    border-top: 1px solid var(--ai-rule);
}

.ai-chat-table-wrap {
    max-height: 320px;
    overflow: auto;
    border: 1px solid var(--ai-rule);
    border-radius: var(--ai-radius-tile);
    background: var(--ai-paper);
}

.ai-chat-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: var(--ai-text-xs);
    font-variant-numeric: tabular-nums;
}

.ai-chat-table th,
.ai-chat-table td {
    min-width: 110px;
    padding: var(--ai-space-xs) var(--ai-space-sm);
    border-right: 1px solid var(--ai-paper-3);
    border-bottom: 1px solid var(--ai-paper-3);
    color: var(--ai-ink-2);
    text-align: left;
    white-space: nowrap;
}

.ai-chat-table th {
    position: sticky;
    top: 0;
    z-index: 1;
    color: var(--ai-ink);
    background: var(--ai-paper-2);
    font-weight: 700;
}

.ai-chat-table tbody tr:hover td {
    background: var(--ai-paper-2);
}

.ai-chat-table tr:last-child td {
    border-bottom: 0;
}

.ai-chat-table th:last-child,
.ai-chat-table td:last-child {
    border-right: 0;
}

.ai-chat-table-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--ai-space-sm);
    margin-top: var(--ai-space-xs);
    color: var(--ai-muted);
    font-size: var(--ai-text-xs);
}

/* ----------------------------------------------------------------- chart */

.ai-chat-chart {
    position: relative;
    min-height: 340px;
}

.ai-chat-chart-canvas {
    width: 100%;
    height: 340px;
}

.ai-chat-chart-loading {
    position: absolute;
    inset: var(--ai-space-md) 0 0;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--ai-space-xs);
    color: var(--ai-muted);
    background: color-mix(in srgb, var(--ai-paper) 88%, transparent);
}

.ai-chat-chart-fallback {
    color: var(--ai-muted);
    font-size: var(--ai-text-sm);
}

.ai-chat-chart-fallback details {
    margin-top: var(--ai-space-xs);
}

.ai-chat-chart-fallback pre {
    max-height: 160px;
    margin-top: var(--ai-space-xs);
    overflow: auto;
    font-family: var(--ai-font-mono);
    white-space: pre-wrap;
}

/* -------------------------------------------------------------- insights */

.ai-chat-insights h6 {
    display: flex;
    align-items: center;
    gap: var(--ai-space-xs);
    margin: 0 0 var(--ai-space-xs);
    color: var(--ai-ink);
    font-size: var(--ai-text-md);
    font-weight: 700;
}

.ai-chat-insight-list {
    display: grid;
    gap: var(--ai-space-xs);
}

.ai-chat-insight {
    padding: var(--ai-space-sm);
    border-radius: 10px;
    background: var(--ai-paper-2);
}

.ai-chat-insight-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
}

.ai-chat-insight-heading strong {
    display: inline-flex;
    align-items: baseline;
    gap: 8px;
    color: var(--ai-ink);
    font-size: var(--ai-text-sm);
    font-weight: 650;
}

.ai-chat-insight-heading strong::before {
    content: '';
    flex: 0 0 auto;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--ai-chat-insight-color);
}

.ai-chat-insight-heading span {
    flex: 0 0 auto;
    padding: 2px 8px;
    border-radius: var(--ai-radius-full);
    color: color-mix(in srgb, var(--ai-chat-insight-color) 72%, black);
    background: color-mix(in srgb, var(--ai-chat-insight-color) 9%, var(--ai-paper));
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.ai-chat-insight p {
    margin: var(--ai-space-2xs) 0 0 var(--ai-space-md);
    color: var(--ai-neutral);
    font-size: var(--ai-text-xs);
    line-height: 1.55;
    white-space: pre-wrap;
}

/* ---------------------------------------------------------------- report */

.ai-chat-report {
    display: flex;
    align-items: center;
    gap: var(--ai-space-sm);
}

.ai-chat-report-icon {
    flex: 0 0 auto;
    width: 40px;
    height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    font-size: 22px;
}

.ai-chat-report-icon.is-xlsx {
    color: var(--ai-xlsx-ink);
    background: var(--ai-xlsx-soft);
}

.ai-chat-report-icon.is-ppt {
    color: var(--ai-ppt-ink);
    background: var(--ai-ppt-soft);
}

.ai-chat-report-name {
    min-width: 0;
    flex: 1;
    display: flex;
    flex-direction: column;
    font-size: var(--ai-text-xs);
}

.ai-chat-report-name strong {
    color: var(--ai-ink);
    font-size: var(--ai-text-sm);
}

.ai-chat-report-name span {
    overflow: hidden;
    color: var(--ai-muted);
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ai-chat-report-name small {
    color: var(--ai-error);
}

/* ---------------------------------------------------------------- typing */

.ai-chat-typing {
    display: flex;
    align-items: center;
    gap: var(--ai-space-xs);
    padding: var(--ai-space-sm) var(--ai-space-md);
    color: var(--ai-muted);
    font-size: var(--ai-text-sm);
}

.ai-chat-typing-dots {
    display: inline-flex;
    gap: 3px;
}

.ai-chat-typing-dots i {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--ai-accent);
    animation: ai-chat-dot 1.1s infinite ease-in-out;
}

.ai-chat-typing-dots i:nth-child(2) {
    animation-delay: 120ms;
}

.ai-chat-typing-dots i:nth-child(3) {
    animation-delay: 240ms;
}

/* ------------------------------------------------------ footer / composer */

.ai-chat-footer {
    display: flex;
    align-items: flex-end;
    flex-wrap: nowrap;
    gap: var(--ai-space-xs);
    padding: var(--ai-space-sm) var(--ai-space-md)
        calc(var(--ai-space-sm) + env(safe-area-inset-bottom));
    border-top: 1px solid var(--ai-rule);
    background: var(--ai-paper);
}

.ai-chat-footer > * {
    margin: 0;
}

.ai-chat-composer {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    align-items: flex-end;
    gap: var(--ai-space-xs);
    padding: var(--ai-space-2xs) var(--ai-space-2xs) var(--ai-space-2xs)
        var(--ai-space-sm);
    border: 1px solid var(--ai-rule-2);
    border-radius: var(--ai-radius-field);
    background: var(--ai-paper);
}

/* focus ring appears instantly — no transition on the composer border */
.ai-chat-composer:focus-within,
.ai-chat-composer.is-focus {
    border-color: var(--ai-accent);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--ai-accent) 16%, transparent);
}

.ai-chat-composer:has(.ai-chat-input:disabled) {
    background: var(--ai-paper-2);
}

.ai-chat-input {
    flex: 1 1 auto;
    min-width: 0;
    width: auto;
    min-height: 40px;
    max-height: 128px;
    padding: var(--ai-space-xs) 0;
    border: 0;
    color: var(--ai-ink);
    background: transparent;
    font-family: var(--ai-font-ui);
    font-size: var(--ai-text-base);
    line-height: 1.4;
    resize: none;
}

.ai-chat-input:focus {
    outline: none;
}

.ai-chat-input::placeholder {
    color: var(--ai-muted);
}

.ai-chat-input:disabled {
    color: var(--ai-neutral);
    cursor: not-allowed;
}

.ai-chat-send {
    flex: 0 0 auto;
    position: relative;
    width: 40px;
    height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 0;
    border-radius: var(--ai-radius-btn);
    color: var(--ai-accent-ink);
    background: var(--ai-ink-surface);
    font-size: 18px;
    cursor: pointer;
    transition: background-color var(--ai-dur-micro) var(--ai-ease-out),
        transform 100ms var(--ai-ease-out);
}

.ai-chat-send::before {
    content: '';
    position: absolute;
    inset: -2px;
}

.ai-chat-send:hover:not(:disabled),
.ai-chat-send.is-hover {
    background: var(--ai-ink);
}

.ai-chat-send:active:not(:disabled),
.ai-chat-send.is-active {
    transform: translateY(1px);
}

.ai-chat-send:focus-visible,
.ai-chat-send.is-focus {
    outline: none;
    box-shadow: var(--ai-ring);
}

.ai-chat-send:disabled {
    color: var(--ai-muted);
    background: var(--ai-paper-3);
    cursor: not-allowed;
}

/* -------------------------------------------------------------- keyframes */

@keyframes ai-chat-message-in {
    from {
        opacity: 0;
        transform: translateY(4px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes ai-chat-tooltip-enter {
    from {
        opacity: 0;
        transform: translateY(12px) scale(0.96);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes ai-chat-tooltip-pulse {
    0%,
    100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.58;
        transform: scale(0.78);
    }
}

@keyframes ai-chat-dot {
    0%,
    60%,
    100% {
        transform: translateY(0);
        opacity: 0.45;
    }
    30% {
        transform: translateY(-4px);
        opacity: 1;
    }
}

/* ---------------------------------------------------------------- mobile */

@media (max-width: 575.98px) {
    .ai-chat-modal.modal {
        pointer-events: auto;
    }

    .ai-chat-modal .modal-dialog {
        position: relative;
        top: auto;
        left: auto;
        width: auto;
        height: 100%;
        margin: 0;
    }

    .ai-chat-modal .modal-header {
        cursor: default;
        touch-action: auto;
        user-select: auto;
    }

    .ai-chat-window-control,
    .ai-chat-resize-handle {
        display: none;
    }

    .ai-chat-tooltip {
        width: min(288px, calc(100vw - 32px));
    }

    .ai-chat-modal .modal-content {
        min-height: 100%;
        border-radius: 0;
    }

    .ai-chat-modal .modal-header {
        padding: var(--ai-space-xs) var(--ai-space-sm);
    }

    .ai-chat-body {
        padding: var(--ai-space-sm);
    }

    .ai-chat-avatar {
        display: none;
    }

    .ai-chat-suggestions {
        grid-template-columns: minmax(0, 1fr);
    }

    .ai-chat-user-bubble {
        max-width: 88%;
    }

    .ai-chat-message .ai-chat-response-card,
    .ai-chat-message .ai-chat-typing {
        max-width: 100%;
    }

    .ai-chat-footer {
        padding: var(--ai-space-xs) var(--ai-space-sm)
            calc(var(--ai-space-xs) + env(safe-area-inset-bottom));
    }

    .ai-chat-report {
        align-items: flex-start;
        flex-wrap: wrap;
    }

    .ai-chat-report-name {
        width: calc(100% - 52px);
    }

    .ai-chat-report button {
        width: 100%;
    }
}

/* ---------------------------------------------------------- reduced motion */

@media (prefers-reduced-motion: reduce) {
    .ai-chat-launcher,
    .ai-chat-tooltip,
    .ai-chat-tooltip-status,
    .ai-chat-tooltip-action > span,
    .ai-chat-tooltip-close,
    .ai-chat-launcher-dismiss {
        animation: none;
        transition: none;
    }

    .ai-chat-launcher:hover,
    .ai-chat-tooltip:hover,
    .ai-chat-tooltip-close:hover,
    .ai-chat-launcher-dismiss:hover,
    .ai-chat-tooltip-content:active,
    .ai-chat-tooltip-content:hover .ai-chat-tooltip-action > span {
        transform: none;
    }

    .ai-chat-message {
        animation-name: ai-chat-message-in-reduced;
        animation-duration: 120ms;
    }

    .ai-chat-suggestions button,
    .ai-chat-lang-toggle button,
    .ai-chat-send,
    .ai-chat-window-control,
    .ai-chat-clear,
    .ai-chat-close,
    .ai-chat-retry,
    .ai-chat-table-footer button,
    .ai-chat-report button {
        transition: none;
    }

    .ai-chat-suggestions button:hover:not(:disabled),
    .ai-chat-lang-toggle button:active,
    .ai-chat-send:active:not(:disabled),
    .ai-chat-window-control:active,
    .ai-chat-clear:active:not(:disabled),
    .ai-chat-close:active {
        transform: none;
    }

    /* functional loader: keeps running, slower */
    .ai-chat-typing-dots i {
        animation-duration: 2.2s;
    }
}

@keyframes ai-chat-message-in-reduced {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.dataco-loading-indicator {
    align-items: center;
    color: #5f6470;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 9rem;
    padding: 1.5rem;
    width: 100%;
}

.dataco-loading-indicator--inline {
    position: relative;
}

.dataco-loading-indicator--overlay {
    backdrop-filter: blur(2px);
    background: rgba(255, 255, 255, 0.9);
    inset: 0;
    min-height: 100%;
    position: absolute;
    z-index: 1000;
}

.dataco-loading-indicator__logo-wrap {
    border-radius: 1rem;
    filter: drop-shadow(0 0.6rem 1.2rem rgba(178, 24, 75, 0.18));
    height: 5.5rem;
    overflow: hidden;
    position: relative;
    width: 5.5rem;
}

.dataco-loading-indicator__logo {
    height: 100%;
    inset: 0;
    object-fit: contain;
    position: absolute;
    transform: scale(1.7);
    transition: clip-path 180ms ease-out;
    width: 100%;
}

.dataco-loading-indicator__logo--grayscale {
    filter: grayscale(1);
    opacity: 0.42;
}

.dataco-loading-indicator__logo--color {
    filter: none;
}

.dataco-loading-indicator__percentage {
    background: linear-gradient(90deg, #707783, #b2184b, #707783);
    background-clip: text;
    font-size: 0.9rem;
    font-variant-numeric: tabular-nums;
    font-weight: 700;
    margin-top: 0.65rem;
    min-width: 3rem;
    text-align: center;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.dataco-loading-indicator--compact {
    min-height: 7rem;
    padding: 1rem;
}

.dataco-loading-indicator--compact .dataco-loading-indicator__logo-wrap {
    height: 3.75rem;
    width: 3.75rem;
}

.dataco-loading-indicator--compact .dataco-loading-indicator__percentage {
    font-size: 0.8rem;
}

@media (prefers-reduced-motion: reduce) {
    .dataco-loading-indicator__logo {
        transition: none;
    }
}

/* "1b Aurora trends" — glowing gradient trend cards for the yearly PE&P dashboard */
.aurora-trends {
    font-family: 'Space Grotesk', -apple-system, BlinkMacSystemFont, 'Helvetica Neue', Helvetica, Arial, sans-serif;
    color: #16223a;
}

.aurora-panel {
    background: #f6f8fc;
    border: 1px solid #e4eaf3;
    border-radius: 24px;
    padding: 24px;
}

.aurora-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

@media (max-width: 767px) {
    .aurora-grid {
        grid-template-columns: minmax(0, 1fr);
    }
}

.aurora-card {
    background: #ffffff;
    border: 1px solid #e6ebf2;
    border-radius: 20px;
    padding: 20px 22px;
    box-shadow: 0 10px 26px rgba(20, 40, 80, 0.06);
    display: flex;
    flex-direction: column;
    gap: 6px;
    animation: auroraFadeUp 0.5s ease both;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.aurora-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 14px 32px rgba(20, 40, 80, 0.11);
}

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

.aurora-card-title {
    font-size: 13.5px;
    font-weight: 600;
    color: #3c4a63;
}

.aurora-total {
    font-family: 'Space Grotesk', -apple-system, BlinkMacSystemFont, 'Helvetica Neue', Helvetica, Arial, sans-serif;
    font-weight: 700;
    font-size: 34px;
    line-height: 1;
}

.aurora-ytd {
    font-size: 10px;
    letter-spacing: 1.3px;
    color: #8794ab;
    font-weight: 600;
}

.aurora-empty {
    font-size: 12.5px;
    color: #8794ab;
    padding: 28px 0;
    text-align: center;
}

/* --- Initial-load animations --- */
.aurora-area {
    opacity: 0;
    animation: auroraFade 0.9s ease-out 0.25s forwards;
}

.aurora-line {
    stroke-dasharray: 100;
    stroke-dashoffset: 100;
    animation: auroraDraw 1.1s ease-out forwards;
}

.aurora-dot {
    opacity: 0;
    transform-box: fill-box;
    transform-origin: center;
    animation: auroraDotIn 0.4s ease-out forwards;
}

.aurora-vlabel,
.aurora-mlabel {
    opacity: 0;
    animation: auroraFade 0.5s ease-out forwards;
    transition: color 0.15s ease;
}

@keyframes auroraDraw {
    to { stroke-dashoffset: 0; }
}

@keyframes auroraFade {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes auroraDotIn {
    from { opacity: 0; transform: scale(0); }
    to { opacity: 1; transform: scale(1); }
}

/* --- Hover / tap interaction --- */
.aurora-hit {
    cursor: pointer;
}

.aurora-dot {
    transition: r 0.15s ease;
}

.aurora-guide {
    pointer-events: none;
}

@media (prefers-reduced-motion: reduce) {
    .aurora-card,
    .aurora-area,
    .aurora-line,
    .aurora-dot,
    .aurora-vlabel,
    .aurora-mlabel {
        animation: none !important;
        opacity: 1 !important;
        stroke-dashoffset: 0 !important;
    }
}

/* Hallmark · genre: modern-minimal · macrostructure: Control-room Workbench · theme: studied-DNA (source: Floor Deck Wireframes.dc.html #4a) · tone: night-shift glass cockpit · anchor hue: deep indigo + signal green · visual fingerprint: frosted cards floating over an aurora gradient, glow-dot liveness, translucent hairlines */
/* Hallmark · pre-emit critique: P5 H5 E5 S5 R4 V5 */
:root {
    --floor-font-body: 'IBM Plex Sans', 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
    --floor-canvas: linear-gradient(135deg, #f8fbff 0%, #edf4fb 52%, #e7f0f9 100%);
    --floor-orb-blue: radial-gradient(circle, rgb(163 206 255 / 0.28), transparent 68%);
    --floor-orb-magenta: radial-gradient(circle, rgb(213 196 255 / 0.18), transparent 68%);
    --floor-glass-header: rgb(255 255 255 / 0.94);
    --floor-glass-card: #ffffff;
    --floor-glass-panel: #ffffff;
    --floor-glass-tile: #f8fbff;
    --floor-glass-chip: #f3f7fb;
    --floor-glass-chip-hover: #e8f2ff;
    --floor-glass-control: #f5f8fc;
    --floor-glass-row-hover: #edf5ff;
    --floor-glass-dark: #eef5fb;
    --floor-edge-header: #d8e3ef;
    --floor-edge-card: #dce7f1;
    --floor-edge-panel: #d7e3ee;
    --floor-edge-tile: #dce7f1;
    --floor-edge-chip: #d8e4ef;
    --floor-edge-control: #c9d8e7;
    --floor-edge-dark: #bfd5e8;
    --floor-edge-baseline: #c9d9e7;
    --floor-hairline: #e0e9f1;
    --floor-hairline-strong: #cbd9e6;
    --floor-track: #c3d2e0;
    --floor-track-edge: rgba(21, 37, 58, 0.1);
    --floor-ink: #15253a;
    --floor-ink-soft: #455b72;
    --floor-muted: #64758a;
    --floor-title-ink: #1d3650;
    --floor-on-dark: #15253a;
    --floor-on-dark-soft: #30465d;
    --floor-on-dark-muted: #64758a;
    --floor-dark-ink: #1d3650;
    --floor-dark-muted: #64758a;
    --floor-blue: #2a6fd6;
    --floor-blue-ink: #1e56ab;
    --floor-blue-edge: rgba(42, 111, 214, 0.5);
    --floor-blue-edge-strong: rgba(42, 111, 214, 0.6);
    --floor-green: #157a43;
    --floor-green-fill: #1d8a4e;
    --floor-live: #16824b;
    --floor-live-bright: #12683d;
    --floor-live-bg: #e6f6ec;
    --floor-live-edge: #a9ddbd;
    --floor-amber: #a4700f;
    --floor-red: #b32b3d;
    --floor-magenta: #a63bb5;
    --floor-target-line: #6ea8ff;
    --floor-bar-on: #57d08a;
    --floor-bar-below: #e2687a;
    --floor-focus: #6ea8ff;
    --floor-blur-card: none;
    --floor-blur-header: none;
    --floor-blur-tile: none;
    --floor-shadow-card: 0 6px 20px rgb(41 72 102 / 0.08);
    --floor-shadow-dark: 0 6px 20px rgb(41 72 102 / 0.1);
    --floor-radius-lg: 16px;
    --floor-radius-md: 12px;
    --floor-radius-sm: 10px;
    --floor-radius-xs: 8px;
    --floor-radius-pill: 999px;
    --floor-space-3xs: 4px;
    --floor-space-2xs: 8px;
    --floor-space-xs: 12px;
    --floor-space-sm: 16px;
    --floor-space-md: 24px;
    --floor-space-lg: 32px;
    --floor-pad-x: clamp(16px, 3.2vw, 32px);
    /* Breathing room between the deck's major bands (KPIs / operations /
       analysis). Tightened on short screens, where height is scarce. */
    --floor-section-gap: 20px;
    /* First-paint estimate of the chrome the app shell puts around the deck.
       syncDeckHeight() replaces it with a measured value on the same frame, so
       this only has to be in the right ballpark — deliberately generous, since
       overshooting here is what puts a scrollbar on screen. */
    --floor-shell-offset: 160px;
    --floor-ease: cubic-bezier(0.2, 0.8, 0.2, 1);
    --floor-motion-fast: 150ms;
    --floor-motion-base: 220ms;
}

html,
body {
    overflow-x: clip;
}

.floor-deck {
    position: relative;
    /* dvh, not vh: on mobile/TV Chrome `vh` is the toolbar-hidden viewport, so
       a 100vh floor outruns the visible screen and the page scrolls even when
       nothing overflows. */
    min-height: 100vh;
    min-height: 100dvh;
    padding-bottom: var(--floor-space-lg);
    overflow: clip;
    color: var(--floor-ink);
    font-family: var(--floor-font-body);
}

.floor-deck *,
.floor-deck *::before,
.floor-deck *::after {
    box-sizing: border-box;
}

.floor-deck>* {
    position: relative;
    z-index: 1;
    min-width: 0;
}

.floor-deck h1,
.floor-deck h2,
.floor-deck p {
    margin-top: 0;
}

/* ---- header ---- */

.floor-deck__header {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    gap: var(--floor-space-xs) var(--floor-space-sm);
    align-items: center;
    padding: var(--floor-space-2xs) var(--floor-pad-x);
    background: var(--floor-glass-header);
    backdrop-filter: var(--floor-blur-header);
    -webkit-backdrop-filter: var(--floor-blur-header);
}

.floor-deck__header--tabs-only {
    grid-template-columns: minmax(0, 1fr);
}

.floor-deck__view-tabs {
    display: inline-flex;
    position: relative;
    gap: 0;
    align-items: center;
    width: max-content;
    max-width: 100%;
    padding: 0;
    overflow-x: auto;
    border: 0;
    border-radius: 0;
    background: transparent;
}

.floor-deck__view-tab {
    display: inline-flex;
    position: relative;
    flex: none;
    gap: 6px;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    padding: 0 14px;
    border: 0;
    border-radius: 0;
    background: transparent;
    color: var(--floor-on-dark-soft);
    font: inherit;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    z-index: 1;
    transition: background var(--floor-motion-fast) var(--floor-ease), color var(--floor-motion-fast) var(--floor-ease), box-shadow var(--floor-motion-fast) var(--floor-ease);
}

.floor-deck__view-tab svg {
    width: 16px;
    height: 16px;
}

.floor-deck__view-tab:hover {
    background: var(--floor-glass-chip-hover);
    color: var(--floor-on-dark);
}

.floor-deck__view-tab.is-active {
    background: transparent;
    box-shadow: none;
    color: var(--floor-blue);
}

.floor-deck__view-tab-indicator {
    position: absolute;
    bottom: 0;
    height: 2px;
    pointer-events: none;
    border-radius: var(--floor-radius-pill) var(--floor-radius-pill) 0 0;
    background: var(--floor-blue);
}

.floor-deck__view-tab-indicator.is-ready {
    transition: transform 220ms var(--floor-ease), width 220ms var(--floor-ease);
}

.floor-deck__view-tab.is-active:hover {
    color: var(--floor-blue);
}

@media (prefers-reduced-motion: reduce) {
    .floor-deck__view-tab-indicator {
        transition: none;
    }
}

.home-page-workspace__content {
    padding: var(--floor-space-2xs) 0 var(--floor-space-sm);
}

.floor-deck h1 {
    min-width: 0;
    margin: 0;
    color: var(--floor-on-dark);
    font-size: clamp(22px, 2vw, 28px);
    font-weight: 700;
    letter-spacing: -0.02em;
    text-align: center;
    overflow-wrap: anywhere;
}

.floor-deck__date-control {
    display: flex;
    gap: var(--floor-space-2xs);
    align-items: center;
    min-width: 0;
    justify-self: start;
    width: max-content;
    padding: var(--floor-space-2xs) var(--floor-space-xs);
    border: 1px solid var(--floor-edge-control);
    border-radius: var(--floor-radius-sm);
    background: var(--floor-glass-control);
    color: var(--floor-on-dark-soft);
    font-size: 14px;
    cursor: pointer;
    transition: border-color var(--floor-motion-fast) var(--floor-ease),
        background var(--floor-motion-fast) var(--floor-ease),
        box-shadow var(--floor-motion-base) var(--floor-ease),
        transform var(--floor-motion-fast) var(--floor-ease);
}

.floor-deck__date-control:hover {
    border-color: var(--floor-blue-edge);
    background: var(--floor-glass-chip-hover);
    box-shadow: var(--floor-shadow-card);
    transform: translateY(-1px);
}

.floor-deck__date-control:active {
    box-shadow: none;
    transform: translateY(1px);
}

.floor-deck__date-icon {
    flex: none;
    width: 18px;
    height: 18px;
    transition: color var(--floor-motion-fast) var(--floor-ease),
        transform var(--floor-motion-base) var(--floor-ease);
}

.floor-deck__date-control:hover .floor-deck__date-icon {
    color: var(--floor-blue);
}

.floor-deck__date-control input {
    min-width: 0;
    border: 0;
    outline: 0;
    background: transparent;
    color: var(--floor-on-dark);
    color-scheme: light;
    font: inherit;
    font-weight: 600;
}

.floor-deck__date-control input::-webkit-calendar-picker-indicator {
    display: none;
}

.floor-deck__date-control input:disabled {
    cursor: not-allowed;
    opacity: 0.55;
}

.floor-deck__date-control small {
    color: var(--floor-on-dark-muted);
    font-size: 12px;
    white-space: nowrap;
}

.floor-deck__date-control:focus-within {
    border-color: var(--floor-focus);
}

.floor-deck input:focus-visible,
.floor-deck a:focus-visible,
.floor-deck button:focus-visible {
    outline: 3px solid var(--floor-focus);
    outline-offset: 2px;
}

.floor-deck__live {
    display: inline-flex;
    gap: var(--floor-space-2xs);
    align-items: center;
    justify-self: start;
    padding: 7px 16px;
    border-radius: var(--floor-radius-pill);
    background: var(--floor-live-bg);
    color: var(--floor-live-bright);
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    white-space: nowrap;
}

.floor-deck__live span {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--floor-live);
    box-shadow: 0 0 8px var(--floor-live);
}

.floor-deck__live--historic {
    border-color: var(--floor-edge-control);
    background: var(--floor-glass-control);
    color: var(--floor-on-dark-muted);
}

.floor-deck__live--historic span {
    background: var(--floor-on-dark-muted);
    box-shadow: none;
}

/* ---- frosted surfaces ---- */

.floor-deck__metric,
.floor-deck__panel,
.floor-deck__analysis-card {
    min-width: 0;
    border-radius: var(--floor-radius-lg);
    background: var(--floor-glass-card);
    backdrop-filter: var(--floor-blur-card);
    -webkit-backdrop-filter: var(--floor-blur-card);
    box-shadow: var(--floor-shadow-card);
}

.floor-deck__metric,
.floor-deck__panel,
.floor-deck__machine-card,
.floor-deck__job-item,
.floor-deck__analysis-card {
    transition:
        transform var(--floor-motion-fast) var(--floor-ease),
        border-color var(--floor-motion-fast) var(--floor-ease),
        box-shadow var(--floor-motion-fast) var(--floor-ease);
}

@media (hover: hover) {

    .floor-deck__metric:hover,
    .floor-deck__panel:hover,
    .floor-deck__machine-card:hover,
    .floor-deck__job-item:hover,
    .floor-deck__analysis-card:hover {
        transform: translateY(-2px);
        /* border-color: var(--floor-blue-edge-strong); */
        /* box-shadow: 0 0 0 1px var(--floor-blue-edge), var(--floor-shadow-card); */
    }
}

/* ---- staggered card entrance ---- */

@keyframes floor-deck-card-in {
    from {
        opacity: 0;
        transform: translateY(14px) scale(0.98);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Each card group remounts (via a changing React key) on data load, date
   change, poll refresh, and sort change, replaying this entrance. `backwards`
   fill hides the card during its stagger delay, then releases the transform so
   the hover lift keeps working once the animation settles. */
.floor-deck__metric,
.floor-deck__machine-card,
.floor-deck__job-item,
.floor-deck__analysis-card {
    animation: floor-deck-card-in var(--floor-motion-base) var(--floor-ease) backwards;
    animation-delay: calc(min(var(--stagger-index, 0), 10) * 45ms);
}

/* ---- KPI strip ---- */

.floor-deck__metric-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: var(--floor-space-sm);
    padding: var(--floor-section-gap) var(--floor-pad-x) 0;
}

.floor-deck__metric {
    display: flex;
    flex-direction: column;
    gap: var(--floor-space-3xs);
    min-height: 112px;
    padding: var(--floor-space-xs);
}

.floor-deck__metric--oee {
    --floor-track: #98bce8;
    border-color: #b8d5fb;
    background: #e6f0ff;
}

.floor-deck__metric--output {
    --floor-track: #93c9bf;
    border-color: #b7e1dc;
    background: #e4f6f3;
}

.floor-deck__metric--good-output {
    --floor-track: #97cba5;
    border-color: #bce5c8;
    background: #e8f7ec;
}

.floor-deck__metric--downtime {
    --floor-track: #efb2bc;
    border-color: #f3bcc5;
    background: #fdecef;
}

.floor-deck__metric--machines {
    --floor-track: #c0aae8;
    border-color: #d6c2f4;
    background: #f1ebfd;
}

.floor-deck__metric--button {
    width: 100%;
    border: 1px solid var(--floor-edge-tile);
    color: inherit;
    font: inherit;
    text-align: left;
    cursor: pointer;
}

.floor-deck__metric--button:focus-visible {
    outline: 3px solid var(--floor-blue-edge-strong);
    outline-offset: 2px;
}

.floor-deck__metric-label {
    margin: 0;
    overflow: hidden;
    color: var(--floor-ink-soft);
    font-size: 12.5px;
    font-weight: 500;
    line-height: 1.3;
}

.floor-deck__metric-label-row {
    display: flex;
    gap: var(--floor-space-3xs);
    align-items: center;
    justify-content: space-between;
}

.floor-deck__machine-expand-icon {
    flex: none;
    color: var(--floor-ink-soft);
    font-size: 20px;
    transition: transform var(--floor-motion-fast) var(--floor-ease);
}

.floor-deck__machine-expand-icon.is-open {
    transform: rotate(180deg);
}

.floor-deck__metric-main {
    display: flex;
    gap: var(--floor-space-2xs);
    align-items: flex-end;
    justify-content: space-between;
    margin-top: auto;
    min-width: 0;
}

.floor-deck__metric-value {
    color: var(--floor-ink);
    font-size: clamp(22px, 1.9vw, 32px);
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.floor-deck__metric-value small {
    color: var(--floor-ink-soft);
    font-size: 0.45em;
    font-weight: 500;
}

.floor-deck__metric-value--down {
    color: var(--floor-red);
}

.floor-deck__metric-detail {
    min-height: 16px;
    margin: 0;
    color: var(--floor-ink-soft);
    font-size: 12px;
    font-weight: 500;
}

.floor-deck__metric-detail--good {
    color: var(--floor-green);
    font-weight: 600;
}

.floor-deck__metric-detail--delta {
    display: flex;
    gap: 4px;
    align-items: center;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

.floor-deck__metric-detail--up {
    color: var(--floor-green);
}

.floor-deck__metric-detail--down {
    color: var(--floor-red);
}

/* ---- semicircle gauges ---- */

.floor-deck__semi {
    display: block;
    flex: none;
    overflow: hidden;
}

.floor-deck__semi::before {
    display: block;
    width: 100%;
    aspect-ratio: 1;
    border-radius: 50%;
    background: conic-gradient(from 270deg, var(--semi-color) var(--semi-fill, 0deg), var(--floor-track) var(--semi-fill, 0deg) 180deg, transparent 180deg);
    content: '';
    -webkit-mask: radial-gradient(circle, transparent 56%, #000 57%);
    mask: radial-gradient(circle, transparent 56%, #000 57%);
}

.floor-deck__semi--sm {
    width: 52px;
    height: 26px;
}

.floor-deck__semi--md {
    width: 72px;
    height: 36px;
}

.floor-deck__semi--lg {
    width: 92px;
    height: 46px;
}

.floor-deck__semi--blue {
    --semi-color: var(--floor-blue);
}

.floor-deck__semi--green {
    --semi-color: var(--floor-green-fill);
}

.floor-deck__semi--amber {
    --semi-color: var(--floor-amber);
}

/* ---- progress bars ---- */

.floor-deck__progress-row {
    display: flex;
    gap: var(--floor-space-2xs);
    align-items: center;
}

.floor-deck__progress-row b {
    font-size: 13px;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

.floor-deck__progress-row .floor-deck__progress {
    flex: 1;
}

.floor-deck__progress {
    display: block;
    overflow: hidden;
    height: 10px;
    border-radius: var(--floor-radius-pill);
    background: var(--floor-track);
    box-shadow: inset 0 0 0 1px var(--floor-track-edge);
}

.floor-deck__progress span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: var(--floor-blue);
}

/* ---- operations zone ---- */

.floor-deck__operations-grid {
    display: grid;
    grid-template-columns: minmax(320px, 1fr) minmax(0, 1.45fr);
    gap: var(--floor-space-sm);
    padding: var(--floor-section-gap) var(--floor-pad-x);
}

.floor-deck__panel {
    display: flex;
    flex-direction: column;
    min-height: 0;
    padding: var(--floor-space-xs) var(--floor-space-sm) var(--floor-space-sm);
    border-color: var(--floor-edge-panel);
    background: var(--floor-glass-panel);
}

.floor-deck__panel-heading {
    display: flex;
    flex: none;
    gap: var(--floor-space-xs);
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--floor-space-2xs);
    min-width: 0;
}

.floor-deck__panel-heading>div {
    min-width: 0;
}

.floor-deck__panel-title {
    display: flex;
    gap: var(--floor-space-3xs);
    align-items: center;
    min-width: 0;
}

/* ---- info popover ---- */

.floor-deck__info {
    display: flex;
    position: relative;
    flex: none;
    align-items: center;
}

.floor-deck__info-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 3px;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: var(--floor-muted);
    cursor: pointer;
    transition: color var(--floor-motion-fast) var(--floor-ease),
        background var(--floor-motion-fast) var(--floor-ease);
}

.floor-deck__info-button svg {
    width: 17px;
    height: 17px;
}

.floor-deck__info-button:hover,
.floor-deck__info-button[aria-expanded="true"] {
    background: var(--floor-glass-chip-hover);
    color: var(--floor-blue);
}

.floor-deck__info-popover {
    position: absolute;
    top: calc(100% + 8px);
    left: -8px;
    z-index: 5;
    width: max-content;
    max-width: min(320px, 72vw);
    padding: var(--floor-space-xs);
    border: 1px solid var(--floor-edge-panel);
    border-radius: var(--floor-radius-md);
    background: var(--floor-glass-panel);
    box-shadow: var(--floor-shadow-dark);
    animation: floor-deck-info-in var(--floor-motion-base) var(--floor-ease);
}

.floor-deck__info-title {
    margin: 0 0 var(--floor-space-2xs);
    color: var(--floor-muted);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.floor-deck__info-popover ul {
    display: grid;
    gap: var(--floor-space-2xs);
    margin: 0;
    padding: 0;
    list-style: none;
}

.floor-deck__info-entry {
    display: flex;
    gap: var(--floor-space-2xs);
    align-items: flex-start;
    color: var(--floor-ink-soft);
    font-size: 12.5px;
    line-height: 1.45;
}

.floor-deck__info-entry strong {
    color: var(--floor-job-ink);
}

.floor-deck__info-swatch {
    flex: none;
    width: 16px;
    height: 8px;
    margin-top: 5px;
    border-radius: var(--floor-radius-pill);
    background: var(--floor-job-accent);
}

@keyframes floor-deck-info-in {
    from {
        opacity: 0;
        transform: translateY(-4px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.floor-deck h2 {
    margin-bottom: 0;
    color: var(--floor-ink);
    font-size: clamp(16px, 1.3vw, 19px);
    font-weight: 700;
    letter-spacing: -0.01em;
}

.floor-deck__legend {
    display: flex;
    flex-wrap: wrap;
    gap: var(--floor-space-xs);
    margin: var(--floor-space-3xs) 0 0;
    font-size: 13px;
    font-weight: 600;
}

.floor-deck__legend-item {
    display: inline-flex;
    gap: 6px;
    align-items: center;
}

.floor-deck__legend-item::before {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: currentColor;
    content: '';
}

.floor-deck__legend-item--running {
    color: var(--floor-green);
}

.floor-deck__legend-item--idle {
    color: #94a3b8;
}

.floor-deck__panel-heading a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 30px;
    padding: 0 var(--floor-space-xs);
    border: 1px solid var(--floor-blue-edge-strong);
    border-radius: var(--floor-radius-sm);
    background: var(--floor-glass-chip);
    color: var(--floor-blue-ink);
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    transition: background var(--floor-motion-fast) var(--floor-ease), transform var(--floor-motion-fast) var(--floor-ease);
    white-space: nowrap;
}

.floor-deck__panel-heading a:hover {
    background: var(--floor-glass-chip-hover);
    transform: translateY(-1px);
}

.floor-deck__panel-heading a:active {
    transform: translateY(1px);
}

/* ---- machine cards ---- */

.floor-deck__machine-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    flex: 1 1 auto;
    gap: var(--floor-space-2xs);
    align-content: start;
    min-height: 0;
}

.floor-deck__machine-card {
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
    padding: var(--floor-space-2xs) var(--floor-space-xs);
    border: 1px solid var(--floor-edge-tile);
    border-radius: var(--floor-radius-sm);
    background: var(--floor-glass-tile);
    backdrop-filter: var(--floor-blur-tile);
    -webkit-backdrop-filter: var(--floor-blur-tile);
}

.floor-deck__machine-heading {
    display: flex;
    gap: 6px;
    align-items: center;
    min-width: 0;
}

.floor-deck__machine-heading strong {
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    font-size: 13.5px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.floor-deck__machine-oee {
    flex: none;
    font-size: 15px;
    font-weight: 700;
    letter-spacing: -0.02em;
    font-variant-numeric: tabular-nums;
}

.floor-deck__machine-oee small {
    margin-left: 1px;
    font-size: 9.5px;
    font-weight: 600;
}

.floor-deck__machine-oee--on {
    color: var(--floor-green);
}

.floor-deck__machine-oee--below {
    color: var(--floor-red);
}

.floor-deck__machine-job {
    margin: 0;
    overflow: hidden;
    color: var(--floor-muted);
    font-size: 11px;
    font-weight: 600;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.floor-deck__machine-progress {
    display: flex;
    gap: var(--floor-space-2xs);
    align-items: center;
}

.floor-deck__machine-progress small {
    flex: none;
    min-width: 28px;
    color: var(--floor-ink-soft);
    font-size: 10.5px;
    font-weight: 700;
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.floor-deck__status-dot {
    flex: none;
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.floor-deck__status-dot--running {
    background: var(--floor-green-fill);
}

.floor-deck__status-dot--idle {
    background: #94a3b8;
}

.floor-deck__status-dot--stopped {
    background: var(--floor-red);
}

.floor-deck__machine-card .floor-deck__progress {
    flex: 1 1 auto;
    height: 6px;
}

/* ---- machine categories modal ---- */

.floor-deck__machine-modal-backdrop {
    position: fixed;
    z-index: 200;
    inset: 0;
    display: grid;
    place-items: center;
    padding: 24px;
    background: rgba(15, 23, 42, 0.48);
}

.floor-deck__machine-modal {
    display: flex;
    flex-direction: column;
    width: min(960px, 100%);
    max-height: min(760px, calc(100dvh - 48px));
    overflow: hidden;
    border: 1px solid var(--floor-edge-tile);
    border-radius: var(--floor-radius-lg);
    background: var(--floor-glass-card);
    box-shadow: 0 24px 56px rgba(15, 23, 42, 0.3);
}

.floor-deck__machine-modal-header {
    display: flex;
    gap: var(--floor-space-sm);
    align-items: flex-start;
    justify-content: space-between;
    padding: var(--floor-space-sm) var(--floor-space-md);
    border-bottom: 1px solid var(--floor-edge-tile);
    background: #f1ebfd;
}

.floor-deck__machine-modal-header h2,
.floor-deck__machine-category h3 {
    margin: 0;
    color: var(--floor-ink);
}

.floor-deck__machine-modal-header h2 {
    font-size: 19px;
}

.floor-deck__machine-modal-header p {
    margin: 3px 0 0;
    color: var(--floor-ink-soft);
    font-size: 13px;
}

.floor-deck__machine-modal-close {
    display: grid;
    flex: none;
    width: 32px;
    height: 32px;
    padding: 0;
    border: 1px solid rgba(255,255,255,0);
    border-radius: 50%;
    place-items: center;
    background: var(--floor-glass-chip);
    color: var(--floor-ink);
    line-height: 0;
    cursor: pointer;
}

.floor-deck__machine-modal-close svg {
    display: block;
    width: 18px;
    height: 18px;
}

.floor-deck__machine-modal-close:hover {
    background: var(--floor-glass-chip-hover);
}

.floor-deck__machine-modal-content {
    display: grid;
    gap: var(--floor-space-sm);
    overflow: auto;
    padding: var(--floor-space-md);
}

.floor-deck__machine-category {
    padding: var(--floor-space-sm);
    border: 1px solid var(--floor-edge-tile);
    border-radius: var(--floor-radius-md);
    background: var(--floor-glass-tile);
    cursor: pointer;
}

.floor-deck__machine-category:focus-visible {
    outline: 3px solid var(--floor-blue-edge-strong);
    outline-offset: 2px;
}

.floor-deck__machine-category > header {
    display: flex;
    gap: var(--floor-space-xs);
    align-items: baseline;
    justify-content: space-between;
    margin-bottom: var(--floor-space-xs);
}

.floor-deck__machine-category h3 {
    font-size: 15px;
}

.floor-deck__machine-category > header span {
    color: var(--floor-ink-soft);
    font-size: 12px;
    font-weight: 600;
}

.floor-deck__machine-category-metrics {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: var(--floor-space-xs);
    margin: 0;
}

.floor-deck__machine-category-metrics div {
    min-width: 0;
}

.floor-deck__machine-category-metrics dt {
    color: var(--floor-ink-soft);
    font-size: 11px;
    font-weight: 600;
}

.floor-deck__machine-category-metrics dd {
    margin: 1px 0 0;
    color: var(--floor-ink);
    font-size: 13px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.floor-deck__machine-category-progress {
    margin-top: var(--floor-space-xs);
}

.floor-deck__machine-category-progress .floor-deck__progress {
    height: 7px;
}

/* ---- job order progress list ---- */

.floor-deck__jobs-actions {
    display: flex;
    flex-wrap: wrap;
    gap: var(--floor-space-2xs);
    justify-content: flex-end;
}

.floor-deck__job-sort {
    position: relative;
    display: inline-flex;
}

.floor-deck__job-sort select {
    min-height: 30px;
    padding: 0 30px 0 var(--floor-space-2xs);
    border: 1px solid var(--floor-edge-control);
    border-radius: var(--floor-radius-sm);
    outline: 2px solid transparent;
    outline-offset: 2px;
    background: var(--floor-glass-control);
    color: var(--floor-ink);
    font: inherit;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
}

@media (hover: hover) {
    .floor-deck__job-sort select:hover {
        background: var(--floor-glass-chip-hover);
    }
}

.floor-deck__job-sort select:focus-visible {
    outline-color: var(--floor-focus);
}

.floor-deck__job-sort select:active {
    background: var(--floor-glass-chip);
}

.floor-deck__job-sort select:disabled {
    cursor: not-allowed;
    opacity: 0.55;
}

/* ---- quiet scroll regions ---- */

/* The operations lists keep their scrollbar invisible until hovered or
   focused. `scroll` rather than `auto` plus a stable gutter so the track is
   reserved up front and the rows never shift when the thumb appears. */
.floor-deck__job-list,
.floor-deck__machine-grid {
    overflow-y: scroll;
    scrollbar-color: transparent transparent;
    scrollbar-gutter: stable;
    scrollbar-width: thin;
}

.floor-deck__job-list:focus,
.floor-deck__machine-grid:focus {
    scrollbar-color: var(--floor-hairline-strong) transparent;
}

.floor-deck__job-list::-webkit-scrollbar,
.floor-deck__machine-grid::-webkit-scrollbar {
    width: 8px;
}

.floor-deck__job-list::-webkit-scrollbar-track,
.floor-deck__machine-grid::-webkit-scrollbar-track {
    background: transparent;
}

.floor-deck__job-list::-webkit-scrollbar-thumb,
.floor-deck__machine-grid::-webkit-scrollbar-thumb {
    border: 2px solid transparent;
    border-radius: var(--floor-radius-pill);
    background: transparent;
    background-clip: padding-box;
}

.floor-deck__job-list:hover::-webkit-scrollbar-thumb,
.floor-deck__job-list:focus::-webkit-scrollbar-thumb,
.floor-deck__machine-grid:hover::-webkit-scrollbar-thumb,
.floor-deck__machine-grid:focus::-webkit-scrollbar-thumb {
    background: var(--floor-hairline-strong);
    background-clip: padding-box;
}

@media (hover: hover) {

    .floor-deck__job-list:hover,
    .floor-deck__machine-grid:hover {
        scrollbar-color: var(--floor-hairline-strong) transparent;
    }
}

.floor-deck__job-list {
    display: grid;
    flex: 1 1 auto;
    align-content: start;
    gap: 0;
    min-height: 0;
    height: 0;
}

.floor-deck__job-item {
    --floor-job-accent: var(--floor-blue);
    --floor-job-ink: var(--floor-blue-ink);
    display: grid;
    grid-template-columns: minmax(0, 1.25fr) minmax(110px, 1.5fr) 56px minmax(0, auto);
    gap: 0 var(--floor-space-xs);
    align-items: center;
    padding: var(--floor-space-2xs) 0;
    border-bottom: 1px solid var(--floor-hairline);
}

.floor-deck__job-item:last-child {
    border-bottom: 0;
}

.floor-deck__job-item--on-track {
    --floor-job-accent: var(--floor-blue);
    --floor-job-ink: var(--floor-blue-ink);
}

.floor-deck__job-item--behind {
    --floor-job-accent: var(--floor-red);
    --floor-job-ink: var(--floor-red);
}

.floor-deck__job-item--over-target {
    --floor-job-accent: var(--floor-amber);
    --floor-job-ink: var(--floor-amber);
}

.floor-deck__job-item--complete {
    --floor-job-accent: var(--floor-green-fill);
    --floor-job-ink: var(--floor-green);
}

.floor-deck__job-id,
.floor-deck__job-track {
    min-width: 0;
}

.floor-deck__job-id strong,
.floor-deck__job-id span {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.floor-deck__job-id strong {
    color: var(--floor-ink);
    font-size: 13.5px;
    font-weight: 700;
}

.floor-deck__job-id span {
    color: var(--floor-muted);
    font-size: 11px;
    font-weight: 600;
}

.floor-deck__job-qty {
    display: block;
    margin-top: 3px;
    overflow: hidden;
    color: var(--floor-ink-soft);
    font-size: 11px;
    font-weight: 500;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.floor-deck__job-qty b {
    color: var(--floor-ink);
    font-weight: 700;
}

.floor-deck__job-percent {
    color: var(--floor-job-ink);
    font-size: 16px;
    font-weight: 700;
    letter-spacing: -0.02em;
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.floor-deck__job-percent small {
    font-size: 11px;
    font-weight: 600;
}

.floor-deck__job-due {
    color: var(--floor-job-ink);
    font-size: 11.5px;
    font-style: normal;
    font-weight: 700;
    text-align: right;
    white-space: nowrap;
}

.floor-deck__job-bar {
    display: block;
    overflow: hidden;
    height: 8px;
    border-radius: var(--floor-radius-pill);
    background: var(--floor-track);
    box-shadow: inset 0 0 0 1px var(--floor-track-edge);
}

.floor-deck__job-bar span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: var(--floor-job-accent);
}

.floor-deck__job-qty .floor-deck__job-variance {
    color: var(--floor-job-ink);
}

/* ---- tactical analysis ---- */

.floor-deck__analysis {
    padding: 0 var(--floor-pad-x) var(--floor-section-gap);
}

.floor-deck__analysis-heading {
    display: flex;
    flex-wrap: wrap;
    gap: var(--floor-space-3xs) var(--floor-space-xs);
    align-items: baseline;
    margin-bottom: var(--floor-space-2xs);
}

.floor-deck__analysis-heading h2 {
    color: var(--floor-on-dark);
    font-size: clamp(17px, 1.4vw, 20px);
}

.floor-deck__analysis-heading p {
    margin: 0;
    color: var(--floor-on-dark-muted);
    font-size: 13px;
}

.floor-deck__analysis-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.6fr) minmax(0, 2.4fr);
    gap: var(--floor-space-sm);
}

.floor-deck__loss-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-rows: repeat(2, minmax(0, 1fr));
    gap: var(--floor-space-sm);
}

.floor-deck__analysis-card {
    min-height: 0;
    padding: var(--floor-space-xs);
}

.floor-deck__oee-trend {
    display: flex;
    flex-direction: column;
}

.floor-deck__analysis-card--link {
    color: inherit;
    cursor: pointer;
    text-decoration: none;
}

.floor-deck__analysis-card--link:focus-visible {
    outline: 3px solid var(--floor-focus);
    outline-offset: 2px;
}

.floor-deck__card-title {
    margin: 0;
    color: var(--floor-title-ink);
    font-size: 15px;
    font-weight: 600;
}

.floor-deck__card-title span {
    color: var(--floor-muted);
    font-size: 13px;
    font-weight: 400;
}

.floor-deck__analysis-card--dark {
    border-color: #344457;
    background: #202833;
    box-shadow: 0 8px 22px rgb(22 30 41 / 0.24);
    color: #f8fbff;
}

.floor-deck__analysis-card--dark .floor-deck__card-title {
    color: #f8fbff;
}

.floor-deck__analysis-card--dark .floor-deck__card-title span,
.floor-deck__analysis-card--dark .floor-deck__chart-labels {
    color: #afbecf;
}

.floor-deck__analysis-card--loss {
    border-color: #e2c9ef;
    background: #f7edfc;
}

.floor-deck__analysis-card--loss-quality {
    border-color: #f3c4ce;
    background: #fcecef;
}

.floor-deck__analysis-card--loss-technical {
    border-color: #cbdcff;
    background: #eaf1ff;
}

.floor-deck__analysis-card--loss-organization {
    border-color: #f1d39b;
    background: #fff4e1;
}

.floor-deck__analysis-card--loss-availability {
    border-color: #b8e6c7;
    background: #e9f8ee;
}

.floor-deck__analysis-card--loss-quality .floor-deck__loss-value {
    color: #c53c5d;
}

.floor-deck__analysis-card--loss-quality .floor-deck__sparkline polyline {
    stroke: #c53c5d;
}

.floor-deck__analysis-card--loss-technical .floor-deck__loss-value {
    color: #3676da;
}

.floor-deck__analysis-card--loss-technical .floor-deck__sparkline polyline {
    stroke: #3676da;
}

.floor-deck__analysis-card--loss-organization .floor-deck__loss-value {
    color: #b7791f;
}

.floor-deck__analysis-card--loss-organization .floor-deck__sparkline polyline {
    stroke: #b7791f;
}

.floor-deck__analysis-card--loss-availability .floor-deck__loss-value {
    color: #16834b;
}

.floor-deck__analysis-card--loss-availability .floor-deck__sparkline polyline {
    stroke: #16834b;
}

.floor-deck__oee-bars {
    position: relative;
    display: flex;
    flex: 1 1 0;
    gap: 3px;
    align-items: end;
    min-height: 0;
    margin-top: var(--floor-space-2xs);
    border-bottom: 1px solid var(--floor-edge-baseline);
}

.floor-deck__oee-bars::before {
    position: absolute;
    top: var(--target-line, 20%);
    right: 0;
    left: 0;
    border-top: 1.5px dashed var(--floor-target-line);
    content: '';
}

.floor-deck__oee-bars span {
    flex: 1;
    min-width: 2px;
    height: var(--bar-height, 2%);
    border-radius: 2px 2px 0 0;
    background: var(--floor-bar-on);
}

.floor-deck__oee-bars .is-below-target {
    background: var(--floor-bar-below);
}

.floor-deck__chart-labels {
    display: flex;
    justify-content: space-between;
    margin-top: var(--floor-space-3xs);
    color: var(--floor-muted);
    font-size: 11px;
}

.floor-deck__loss-value {
    display: block;
    margin-top: var(--floor-space-3xs);
    font-size: clamp(22px, 1.7vw, 30px);
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1;
    font-variant-numeric: tabular-nums;
}

.floor-deck__loss-value small {
    margin-left: var(--floor-space-3xs);
    color: var(--floor-muted);
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 0;
}

.floor-deck__sparkline {
    width: 100%;
    height: 42px;
    margin-top: var(--floor-space-2xs);
    overflow: visible;
}

.floor-deck__sparkline polyline {
    fill: none;
    stroke: var(--floor-magenta);
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 5.5;
    vector-effect: non-scaling-stroke;
}

/* ---- shared states ---- */

.floor-deck__empty {
    grid-column: 1 / -1;
    margin: var(--floor-space-2xs) 0;
    color: var(--floor-muted);
    font-size: 13px;
    font-weight: 500;
}

.floor-deck__retry {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 34px;
    margin: var(--floor-space-xs) var(--floor-pad-x) 0;
    padding: 0 var(--floor-space-xs);
    border: 1px solid var(--floor-edge-control);
    border-radius: var(--floor-radius-sm);
    background: var(--floor-glass-control);
    color: var(--floor-on-dark-soft);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background var(--floor-motion-fast) var(--floor-ease), transform var(--floor-motion-fast) var(--floor-ease);
}

.floor-deck__analysis .floor-deck__retry {
    margin: 0 0 var(--floor-space-xs);
}

.floor-deck__retry:hover {
    background: var(--floor-edge-header);
    transform: translateY(-1px);
}

.floor-deck__retry:active {
    transform: translateY(1px);
}

.floor-deck__retry:disabled {
    cursor: not-allowed;
    opacity: 0.55;
}

.floor-deck__sr {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0 0 0 0);
    border: 0;
    white-space: nowrap;
}

.is-loading>* {
    opacity: 0.5;
}

/* ---- no-blur fallback ---- */

@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
    :root {
        --floor-glass-header: #ffffff;
        --floor-glass-card: #ffffff;
        --floor-glass-panel: #ffffff;
        --floor-glass-tile: #f8fbff;
        --floor-glass-control: #f5f8fc;
        --floor-glass-dark: #eef5fb;
    }
}

/* ---- responsive ---- */

/* Sizes the deck to exactly one screen so every card is visible without page
   scrolling; the two operations lists absorb the slack and scroll internally.
   The 1100px floor matters: below it the KPI and analysis grids wrap to two
   rows each, which no longer fits one screen — those widths (and viewports
   under 560px tall) get ordinary page scrolling instead. */
@media (min-width: 1100px) and (min-height: 600px) {
    .floor-deck--deck {
        display: flex;
        flex-direction: column;
        /* syncDeckHeight() in FloorDeck.jsx measures the space the shell
           actually leaves and sets --floor-deck-height; the calc() is only a
           first-paint fallback for the frame before that runs. */
        height: var(--floor-deck-height, calc(100svh - var(--floor-shell-offset)));
        min-height: 0;
        padding-bottom: 0;
        /* Never scrollable. The deck is nearly window-tall, so a scrollbar here
           is indistinguishable from the page's — and the card entrance
           animation (translateY) alone is enough to summon one. The two
           operations lists are the only things that scroll. */
        overflow: clip;
    }

    /* No min-height here: the operations band is the deck's only flexible row,
       so anything it refuses to give up gets pushed off the bottom instead. */
    .floor-deck--deck .floor-deck__operations-grid {
        flex: 1 1 auto;
        min-height: 0;
    }

}

/* On short screens the fixed rows have to give way, or the operations lists
   are left with almost no room. */
@media (min-width: 1100px) and (min-height: 720px) and (max-height: 880px) {
    .floor-deck--deck {
        --floor-section-gap: 14px;
    }

    .floor-deck--deck .floor-deck__metric {
        min-height: 96px;
    }

    .floor-deck--deck .floor-deck__analysis-heading p {
        display: none;
    }

    .floor-deck--deck .floor-deck__sparkline {
        height: 32px;
    }

    .floor-deck--deck .floor-deck__loss-value {
        font-size: clamp(20px, 1.5vw, 24px);
    }
}

/* Very short viewports — a 1080p screen at 150% zoom lands here. Everything
   outside the operations band is squeezed to its floor so the two lists keep
   a usable amount of room. */
@media (min-width: 1100px) and (min-height: 600px) and (max-height: 719px) {
    .floor-deck--deck {
        --floor-section-gap: 10px;
    }

    /* Cards keep every figure; only the chrome around them gives way. */
    .floor-deck--deck .floor-deck__header {
        padding-top: var(--floor-space-3xs);
        padding-bottom: var(--floor-space-3xs);
    }

    .floor-deck--deck .floor-deck__metric {
        min-height: 0;
        gap: 2px;
        padding: var(--floor-space-2xs);
    }

    .floor-deck--deck .floor-deck__metric-value {
        font-size: clamp(20px, 1.5vw, 26px);
    }

    .floor-deck--deck .floor-deck__metric-detail {
        min-height: 0;
    }

    .floor-deck--deck .floor-deck__semi--md {
        width: 58px;
        height: 29px;
    }

    .floor-deck--deck .floor-deck__analysis-heading {
        margin-bottom: var(--floor-space-3xs);
    }

    .floor-deck--deck .floor-deck__analysis-heading p {
        display: none;
    }

    .floor-deck--deck .floor-deck__analysis-card {
        padding: var(--floor-space-2xs);
    }

    .floor-deck--deck .floor-deck__oee-bars {
        margin-top: var(--floor-space-3xs);
    }

    .floor-deck--deck .floor-deck__sparkline {
        height: 18px;
        margin-top: var(--floor-space-3xs);
    }

    .floor-deck--deck .floor-deck__loss-value {
        margin-top: 0;
        font-size: clamp(18px, 1.3vw, 22px);
    }

    /* Axis captions are the first thing that can go — the bars and the
       headline number still carry the reading. */
    .floor-deck--deck .floor-deck__chart-labels {
        display: none;
    }
}

/* Both bands hold one row down to 1100px — that is what lets the deck fit a
   single screen at 150% browser zoom. Below it they wrap and the deck goes
   back to page scrolling. */
@media (max-width: 1099px) {
    .floor-deck__metric-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .floor-deck__analysis-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .floor-deck__oee-trend {
        grid-column: span 2;
        display: block;
    }

    .floor-deck__oee-bars {
        flex: none;
        min-height: auto;
        height: 84px;
    }
}

/* Outside the viewport lock nothing caps the panels, so a large fleet would
   push the page metres long before the user reaches the bottom. Bound them so
   both lists scroll in place instead. */
@media (max-width: 1099px),
(max-height: 599px) {

    .floor-deck__status-panel,
    .floor-deck__jobs-panel {
        height: min(58svh, 520px);
    }
}

@media (max-width: 1024px) {
    .floor-deck__operations-grid {
        grid-template-columns: minmax(0, 1fr);
    }
}

@media (max-width: 768px) {
    .floor-deck__metric-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .floor-deck__date-control small {
        display: none;
    }

    .floor-deck__metric {
        min-height: 112px;
    }

    /* Stack the job row: id + percent, then the bar, then the due label. */
    .floor-deck__job-item {
        grid-template-columns: minmax(0, 1fr) 56px;
        row-gap: var(--floor-space-3xs);
    }

    .floor-deck__job-id {
        grid-area: 1 / 1;
    }

    .floor-deck__job-percent {
        grid-area: 1 / 2;
    }

    .floor-deck__job-track {
        grid-area: 2 / 1 / auto / -1;
    }

    .floor-deck__job-due {
        grid-area: 3 / 1 / auto / -1;
        text-align: left;
    }
}

@media (max-width: 414px) {
    .floor-deck__header {
        grid-template-columns: minmax(0, 1fr) auto;
        gap: var(--floor-space-2xs) var(--floor-space-xs);
    }

    .floor-deck__date-control {
        grid-column: 1;
        grid-row: 2;
        justify-self: end;
    }

    .floor-deck__live {
        grid-column: 2;
        grid-row: 2;
        justify-self: start;
    }

    .floor-deck__view-tabs {
        grid-column: 1 / -1;
    }

    .floor-deck__metric-grid,
    .floor-deck__analysis-grid,
    .floor-deck__machine-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .floor-deck__loss-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .floor-deck__oee-trend {
        grid-column: auto;
    }

    .floor-deck__jobs-actions {
        justify-content: flex-start;
    }
}

@media (max-width: 640px) {
    .floor-deck__machine-modal-backdrop {
        padding: 12px;
    }

    .floor-deck__machine-modal {
        max-height: calc(100dvh - 24px);
    }

    .floor-deck__machine-modal-header,
    .floor-deck__machine-modal-content {
        padding: var(--floor-space-sm);
    }

    .floor-deck__machine-category-metrics {
        grid-template-columns: minmax(0, 1fr);
    }
}

@media (max-width: 320px) {
    .floor-deck__metric-value {
        font-size: 24px;
    }
}

@media (prefers-reduced-motion: reduce) {

    .floor-deck *,
    .floor-deck *::before,
    .floor-deck *::after {
        scroll-behavior: auto;
        transition-duration: 1ms;
    }

    .floor-deck__metric,
    .floor-deck__machine-card,
    .floor-deck__job-item,
    .floor-deck__analysis-card,
    .floor-deck__date-control:hover .floor-deck__date-icon,
    .floor-deck__info-popover {
        animation: none;
    }

    .floor-deck__date-control:hover {
        transform: none;
    }
}

#incomingTable .react-bs-table {
  width: 1500px;
}

.planning {
  display: 'block';
  padding: 0;
  margin: 0;
  background: 'transparent';
  height: '30px';
  border: 'none';
  border-radius: 0;
  border-Bottom: '1px solid #ccc';
  outline: 'none';
  box-shadow: 'none';
}

.modal-90w {
  width: 90%;
  max-width: 1120px;
  margin-left: auto;
  margin-right: auto;
}

.modal-90w .modal-content {
  border-radius: 6px;
}

.modal-90w .modal-body {
  padding: 14px 18px;
}

.modal-90w .modal-title {
  width: 100%;
  font-size: 18px;
  max-width: 1120px;
  margin-left: auto;
  margin-right: auto;
}

.modal-90w .modal-content {
  border-radius: 6px;
}

.modal-90w .modal-body {
  padding: 14px 18px;
}

.modal-90w .modal-title {
  width: 100%;
  font-size: 18px;
}

.planning-job-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
  font-size: 13px;
}

.planning-form-section {
  border: 1px solid #d9dee3;
  border-radius: 6px;
  padding: 10px 12px 2px;
  background: #fff;
  break-inside: avoid;
  page-break-inside: avoid;
}

.planning-form-section-title {
  margin-bottom: 8px;
  color: #2f353a;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.2;
}

.planning-form-field {
  margin-bottom: 8px;
}

.planning-form-field .form-label {
  display: block;
  margin-bottom: 3px;
  color: #3f454b;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.2;
}

.planning-time-picker-wrapper,
.planning-time-picker-wrapper .react-datepicker__input-container,
.planning-time-picker-wrapper .form-control {
  display: block;
  width: 100%;
}

.planning-job-form .form-control,
.planning-job-form .form-select,
.planning-job-form select {
  min-height: 26px;
  font-size: 12px;
  line-height: 1.2;
}

.planning-job-form .MuiInputBase-root {
  min-height: 30px;
  font-size: 12px;
}

.planning-job-form .MuiInputBase-input {
  padding-top: 4px;
  padding-bottom: 4px;
}

.planning-job-form .MuiAutocomplete-option,
.MuiAutocomplete-popper .MuiAutocomplete-option {
  font-size: 12px;
  line-height: 1.2;
}

.planning-job-form .form-check {
  min-height: 20px;
}

.planning-job-form .form-check-label {
  font-size: 12px;
}

.planning-checkbox-field {
  display: flex;
  align-items: flex-end;
  padding-bottom: 7px;
}

.planning-color-control {
  position: relative;
  display: inline-flex;
  align-items: center;
  min-height: 26px;
}

.planning-remark-field {
  min-height: 46px;
  resize: vertical;
}

@media print {
  @page {
    size: A4 landscape;
    margin: 8mm;
  }

  body {
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  .planning-job-form {
    width: 281mm;
    max-width: 281mm;
    gap: 4px;
    color: #111;
    font-size: 9px;
  }

  .planning-job-form .row {
    display: flex;
    flex-wrap: wrap;
    margin-left: -3px;
    margin-right: -3px;
  }

  .planning-job-form [class*="col-"] {
    padding-left: 3px;
    padding-right: 3px;
  }

  .planning-job-form .col-md-2,
  .planning-job-form .col-sm-2 {
    flex: 0 0 16.666667%;
    max-width: 16.666667%;
  }

  .planning-job-form .col-md-3,
  .planning-job-form .col-sm-3 {
    flex: 0 0 25%;
    max-width: 25%;
  }

  .planning-job-form .col-md-4,
  .planning-job-form .col-sm-4 {
    flex: 0 0 33.333333%;
    max-width: 33.333333%;
  }

  .planning-job-form .col-md-6,
  .planning-job-form .col-sm-6 {
    flex: 0 0 50%;
    max-width: 50%;
  }

  .planning-job-form .col-md-12,
  .planning-job-form .col-sm-12 {
    flex: 0 0 100%;
    max-width: 100%;
  }

  .planning-form-section {
    border-color: #b9c0c7;
    border-radius: 3px;
    padding: 4px 6px 0;
  }

  .planning-form-section-title {
    margin-bottom: 3px;
    font-size: 9px;
  }

  .planning-form-field {
    margin-bottom: 3px;
  }

  .planning-form-field .form-label {
    margin-bottom: 1px;
    font-size: 8px;
    line-height: 1.1;
    white-space: nowrap;
  }

  .planning-job-form .form-control,
  .planning-job-form .form-select,
  .planning-job-form select,
  .planning-job-form input,
  .planning-job-form textarea {
    min-height: 16px !important;
    height: 16px !important;
    padding: 1px 3px !important;
    border-width: 1px !important;
    border-radius: 2px !important;
    font-size: 8px !important;
    line-height: 1.1 !important;
  }

  .planning-job-form input[type="date"] {
    min-width: 0;
  }

  .planning-job-form .MuiAutocomplete-root,
  .planning-job-form .MuiFormControl-root,
  .planning-job-form .MuiInputBase-root {
    min-height: 16px !important;
    height: 16px !important;
    font-size: 8px !important;
  }

  .planning-job-form .MuiInputBase-input {
    height: 14px !important;
    padding: 1px 16px 1px 3px !important;
    font-size: 8px !important;
    line-height: 1.1 !important;
    box-sizing: border-box !important;
  }

  .planning-job-form .MuiOutlinedInput-notchedOutline {
    border-width: 1px !important;
  }

  .planning-job-form .MuiAutocomplete-endAdornment {
    display: none !important;
  }

  .planning-job-form .MuiAutocomplete-option,
  .MuiAutocomplete-popper .MuiAutocomplete-option {
    min-height: 16px !important;
    padding: 2px 6px !important;
    font-size: 8px !important;
    line-height: 1.1 !important;
  }

  .planning-job-form .form-check {
    display: none;
  }

  .planning-color-control {
    min-height: 16px;
  }

  .planning-remark-field {
    min-height: 24px !important;
    height: 24px !important;
  }
}

body {
  font-family: Helvetica, sans-serif;
}

.toRight {
  width: 100%;
  text-align: right;
}

.react-autosuggest__container {
  position: relative;
}

.react-autosuggest__input {
  width: 240px;
  height: 30px;
  padding: 10px 20px;
  font-family: Helvetica, sans-serif;
  font-weight: 300;
  font-size: 16px;
  border: 1px solid #aaa;
  border-radius: 4px;
}

.react-autosuggest__input--focused {
  outline: none;
}

.react-autosuggest__input--open {
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
}

.react-autosuggest__suggestions-container {
  display: none;
}

.react-autosuggest__suggestions-container--open {
  display: block;
  position: absolute;
  top: 31px;
  width: 280px;
  border: 1px solid #aaa;
  background-color: #fff;
  font-family: Helvetica, sans-serif;
  font-weight: 300;
  font-size: 16px;
  border-bottom-left-radius: 4px;
  border-bottom-right-radius: 4px;
  z-index: 2;
}

.react-autosuggest__suggestions-list {
  margin: 0;
  padding: 0;
  list-style-type: none;
}

.react-autosuggest__suggestion {
  cursor: pointer;
  padding: 10px 20px;
}

.react-autosuggest__suggestion--highlighted {
  background-color: #ddd;
}

.multi-select {
  position: relative;
  background-color: #fff;
  border-radius: 4px;
  width: 70%;
  outline: none;
  display: inline-block;
  -webkit-user-select: none;
  -moz-user-select: none;
  -khtml-user-select: none;
  -ms-user-select: none;
  user-select: none;
  /* height: 28px; */
}

.multi-select .selected-options {
  vertical-align: middle;
  height: inherit;
  border: 1px solid #ccc;
  border-radius: 4px;
  display: inline-block;
  /* padding: 5px 0px 5px 10px; */
  width: 100%;
  padding: 0 0 0 10px;
}

.file-list {
  list-style: none;
  padding: 0;
}

.file-list li {
  padding-left: 1.3em;
}

.file-list li:before {
  font-family: "Material Icons";
  content: "\e9fc";
  font-weight: 900;
  display: inline-block;
  margin-left: -1.3em;
  /* same as padding-left set on li */
  width: 1.3em;
  /* same as padding-left set on li */
}

.file-list li .glyphicon {
  float: right;
  margin-top: 5px;
  cursor: pointer;
}

.bom-input-border {
  border: 1px solid #ccc !important;
  border-width: 1px !important;
  border-style: solid !important;
  border-color: #ccc !important;
}

.bom-input-border:focus {
  border: 1px solid #66afe9 !important;
  border-width: 1px !important;
  border-style: solid !important;
  border-color: #66afe9 !important;
  outline: 0;
  box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075), 0 0 8px rgba(102, 175, 233, .6);
}

.form-control.bom-input-border {
  border: 1px solid #ccc !important;
}

select.bom-input-border {
  border: 1px solid #ccc !important;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
}

input.bom-input-border {
  border: 1px solid #ccc !important;
}

/* Override form-control-plaintext for modal inputs */
.modal .form-control:not(.form-control-plaintext) {
  border: 2px solid #999 !important;
  border-width: 2px !important;
  border-style: solid !important;
  border-color: #999 !important;
}

.modal select.form-control:not(.form-control-plaintext) {
  border: 2px solid #999 !important;
  border-width: 2px !important;
  border-style: solid !important;
  border-color: #999 !important;
}

.modal input.form-control:not(.form-control-plaintext) {
  border: 2px solid #999 !important;
  border-width: 2px !important;
  border-style: solid !important;
  border-color: #999 !important;
}

.select__menu,
.select__menu-list {
  z-index: 1000 !important;
}

/* Ensure react-select dropdown container has proper positioning */
.select__menu {
  position: absolute !important;
}

/* Fix MaterialReactTable toolbar z-index to be lower than dropdowns */
.MuiToolbar-root {
  z-index: 1 !important;
  position: relative;
}

/* Ensure MaterialReactTable edit modals appear above react-select dropdowns */
.MuiDialog-root,
.MuiModal-root {
  z-index: 1300 !important;
}

.MuiDialog-container {
  z-index: 1300 !important;
}

/* Ensure MaterialReactTable doesn't create overflow issues */
.MuiPaper-root {
  overflow: visible !important;
}

#RBS-Scheduler-root {
  .ant-row {
    pointer-events: none !important;
  }
}

/* Table Hover Highlighting */
.highlight-table {
  overflow: hidden;
  clip-path: inset(0);
}

.highlight-table tr:hover {
  background-color: rgba(0, 0, 0, 0.05) !important;
}

.highlight-table td,
.highlight-table th {
  position: relative;
  z-index: 1;
}

.highlight-table td:hover::after,
.highlight-table th:hover::after {
  content: '';
  position: absolute;
  background-color: rgba(0, 0, 0, 0.07);
  left: 0;
  right: 0;
  height: 10000px;
  top: -5000px;
  z-index: -1;
  pointer-events: none;
}

.highlight-table td > *, 
.highlight-table th > * {
  position: relative;
  z-index: 2;
}

/* --- Multi-level dropdown helpers --- */
.dropdown-submenu {
  position: relative;
}

.dropdown-submenu>.dropdown-menu {
  position: absolute;
  top: 0;
  left: 100%;
  margin-top: -0.25rem;
  margin-left: 0.1rem;
  z-index: 2000;
  display: none;
  min-width: 220px;
}

.dropdown-submenu:hover>.dropdown-menu,
.dropdown-submenu.show>.dropdown-menu {
  display: block;
}

.caret-right {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  opacity: 0.8;
  transition: transform 0.2s ease-in-out;
}

.dropdown-submenu:hover .caret-right,
.dropdown-submenu.show .caret-right {
  transform: rotate(90deg);
}

/* Responsive: collapse submenu inline on small/mobile screens */
@media (max-width: 991.98px) {
  .dropdown-submenu>.dropdown-menu {
    position: static;
    float: none;
    width: auto;
    margin: 0;
    border: none;
    box-shadow: none;
    padding-left: 1rem;
    background-color: transparent;
  }
}

/* Fix text overlap issue in react-data-table-component caused by overflow: visible override */
#datatable .data-table-ellipsis-text,
.rdt_TableCell .data-table-ellipsis-text,
.data-table-ellipsis-text {
  overflow: hidden !important;
}
.daily-report-month-picker {
  position: relative;
  padding-left: 36px;
}

.daily-report-month-picker::-webkit-calendar-picker-indicator {
  position: absolute;
  left: 10px;
  right: auto;
}

.bom-action-trigger {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    line-height: 1;
    font-weight: 700;
    cursor: pointer;
    border: 1px solid #ced4da;
    border-radius: 6px;
    background-color: #fff;
    color: #495057;
    letter-spacing: 1px;
    padding-bottom: 4px;
    transition: background-color 0.15s, box-shadow 0.15s;
}

.bom-action-trigger:hover {
    background-color: #f1f3f5 !important;
    border-color: #adb5bd !important;
}

.bom-action-menu {
    z-index: 9999;
    min-width: 160px;
    padding: 4px 0;
    background-color: #fff;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12);
}

.table-row-action-menu {
    position: fixed;
    max-height: calc(100vh - 16px);
    overflow-y: auto;
}

.bom-menu-item {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 8px 14px;
    text-align: left;
    border: none;
    background: transparent;
    cursor: pointer;
    font-size: 13px;
    color: #333;
    white-space: nowrap;
    transition: background-color 0.12s;
}

.bom-menu-item:hover {
    background-color: #f8f9fa;
}

.bom-menu-item--danger {
    color: #dc3545;
}

.bom-menu-item--danger:hover {
    background-color: #fff5f5;
    color: #b02a37;
}

.bom-menu-item--copy {
    color: #6f42c1;
}

.bom-menu-item--copy:hover {
    background-color: #f3eeff;
}

.bom-menu-item--paste {
    color: #198754;
}

.bom-menu-item--paste:hover {
    background-color: #eafaf1;
}

.tpm-checklist-sticky-header {
    position: sticky;
    top: 0;
    z-index: 1020;
    padding: 0.75rem 0 0;
    margin-bottom: 1.5rem;
    background-color: #fff;
}

.tpm-checklist-tabs .nav-link {
    min-width: 7rem;
}

.tpm-checklist-tabs .nav-link:focus-visible {
    outline: 2px solid #0d6efd;
    outline-offset: -2px;
}

@media (max-width: 575.98px) {
    .tpm-checklist-tabs .nav-link {
        min-width: 0;
        width: 100%;
    }

    .tpm-checklist-tabs .nav-item {
        flex: 1 1 0;
        text-align: center;
    }
}

:root {
  --sidebar-width: 260px;
  --sidebar-collapsed-width: 80px;
  --sidebar-bg: #000028;
  --sidebar-hover-bg: #2b2b40;
  --sidebar-active-bg: #3699ff;
  --sidebar-text: #a2a3b7;
  --sidebar-active-text: #ffffff;
  --sidebar-header-height: 70px;
  --transition-speed: 0.3s;
  --sidebar-submenu-rail: rgba(135, 158, 207, 0.34);
  --sidebar-submenu-rail-active: rgba(54, 153, 255, 0.72);
}

.main-content.full-width {
  margin-left: 0 !important;
  width: 100% !important;
}

/* `vh` is the viewport with any retractable browser UI *hidden*, so on mobile
   and TV Chrome 100vh stands taller than the screen actually shows and the
   bottom of a full-height element (here: the logout row) sits under the
   address bar, out of reach at any zoom level. `dvh` tracks what is really
   visible; the plain `vh` line stays first as the fallback for browsers
   without it. */
.app-container {
  display: flex;
  min-height: 100vh;
  min-height: 100dvh;
}

.sidebar {
  width: var(--sidebar-width);
  height: 100vh;
  height: 100dvh;
  background-color: var(--sidebar-bg);
  color: var(--sidebar-text);
  position: fixed;
  left: 0;
  top: 0;
  z-index: 1000;
  transition: width var(--transition-speed) ease;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.1);
}

.sidebar.collapsed {
  width: var(--sidebar-collapsed-width);
  overflow: visible;
}

.sidebar.collapsed .sidebar-header {
  padding: 0;
  justify-content: center;
  position: relative;
}

.sidebar.collapsed .sidebar-logo {
  margin: 0;
  justify-content: center;
  width: 100%;
}

.sidebar.collapsed .sidebar-logo img {
  height: 50px;
}

.sidebar.collapsed .sidebar-toggle {
  position: absolute;
  right: -12px;
  top: 50%;
  transform: translateY(-50%);
  background: var(--sidebar-bg);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  width: 24px;
  height: 24px;
  display: flex !important;
  align-items: center;
  justify-content: center;
  z-index: 1001;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.sidebar.collapsed .sidebar-toggle:hover {
  background: var(--sidebar-active-bg);
  color: #fff;
}

.sidebar.collapsed .sidebar-content {
  overflow: visible;
}

.sidebar-header {
  height: var(--sidebar-header-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 13px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: #fff;
  font-weight: 700;
  font-size: 1.2rem;
  overflow: hidden;
  white-space: nowrap;
}

.sidebar-logo img {
  height: 50px;
  width: auto;
}

.sidebar-logo .sidebar-logo-text {
  height: 24px;
  max-width: 130px;
  object-fit: contain;
}

.sidebar-toggle {
  background: none;
  border: none;
  color: var(--sidebar-text);
  cursor: pointer;
  padding: 5px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: background 0.2s;
}

.sidebar-toggle:hover {
  background: var(--sidebar-hover-bg);
  color: #fff;
}

.sidebar-content {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 20px 0;
}

/* Premium Minimalist Scrollbar - Global & Component Specific */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
  background: #ccc;
  border-radius: 10px;
  border: 2px solid #f1f1f1;
}

::-webkit-scrollbar-thumb:hover {
  background: #aaa;
}

/* Sidebar Specific Scrollbar */
.sidebar-content::-webkit-scrollbar,
.floating-submenu::-webkit-scrollbar {
  width: 5px;
}

.sidebar-content::-webkit-scrollbar-track,
.floating-submenu::-webkit-scrollbar-track {
  background: transparent;
}

.sidebar-content::-webkit-scrollbar-thumb,
.floating-submenu::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  border: none;
  transition: all 0.3s ease;
}

.sidebar-content:hover::-webkit-scrollbar-thumb,
.floating-submenu:hover::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
}

.sidebar-content::-webkit-scrollbar-thumb:hover,
.floating-submenu::-webkit-scrollbar-thumb:hover {
  background: var(--sidebar-active-bg);
}

/* Firefox support */
* {
  scrollbar-width: thin;
  scrollbar-color: #ccc #f1f1f1;
}

.sidebar-content,
.floating-submenu {
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.1) transparent;
}

.nav-item {
  display: flex;
  flex-direction: column;
  position: relative;
}

.nav-link-custom {
  display: flex;
  align-items: center;
  padding: 12px 20px;
  color: var(--sidebar-text);
  text-decoration: none;
  transition: all 0.2s;
  cursor: pointer;
  border-left: 3px solid transparent;
  white-space: nowrap;
  position: relative;
}

.nav-link-custom:hover {
  background-color: var(--sidebar-hover-bg);
  color: #fff;
}

.nav-link-custom.active {
  background-color: rgba(54, 153, 255, 0.1);
  color: var(--sidebar-active-text);
  border-left-color: var(--sidebar-active-bg);
}

.nav-icon {
  min-width: 40px;
  display: flex;
  align-items: center;
  font-size: 1.2rem;
}

.nav-text {
  flex: 1;
  font-size: 0.95rem;
  font-weight: 500;
  opacity: 1;
  transition: opacity var(--transition-speed);
}

.sidebar.collapsed .nav-text {
  opacity: 0;
  pointer-events: none;
}

.nav-arrow {
  font-size: 0.8rem;
  transition: transform 0.3s;
}

.nav-arrow.open {
  transform: rotate(180deg);
}

.submenu {
  background-color: rgba(0, 0, 0, 0.1);
  overflow: hidden;
  max-height: 0;
  transition: max-height 0.3s ease-out;
  position: relative;
}

.submenu.open {
  max-height: 1000px;
  transition: max-height 0.5s ease-in;
}

.sidebar:not(.collapsed) .submenu.open::before,
.sidebar:not(.collapsed) .nested-submenu.open::before {
  content: '';
  position: absolute;
  left: var(--submenu-rail-left, 34px);
  top: 10px;
  bottom: 12px;
  width: 2px;
  background: linear-gradient(
    180deg,
    transparent 0,
    var(--sidebar-submenu-rail) 12px,
    var(--sidebar-submenu-rail) calc(100% - 12px),
    transparent 100%
  );
  pointer-events: none;
}

.submenu-link {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px 10px var(--submenu-link-padding, 60px);
  color: var(--sidebar-text);
  text-decoration: none;
  font-size: 0.9rem;
  transition: all 0.2s;
  position: relative;
}

.sidebar:not(.collapsed) .submenu .submenu-link::before {
  content: '';
  position: absolute;
  left: calc(var(--submenu-link-padding, 60px) - 26px);
  top: 50%;
  width: 14px;
  height: 2px;
  background-color: var(--sidebar-submenu-rail);
  transform: translateY(-50%);
  pointer-events: none;
}

.sidebar:not(.collapsed) .submenu .submenu-link.active::before {
  background-color: var(--sidebar-submenu-rail-active);
}

.submenu-label {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.submenu-link:hover {
  color: #fff;
}

.submenu-link.active {
  color: var(--sidebar-active-bg);
  font-weight: 600;
}

.sidebar-footer {
  /* Never yields to the nav list above it — on a short viewport the list
     scrolls and the user block plus logout stay pinned to the bottom. */
  flex-shrink: 0;
  padding: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.user-info {
  display: flex;
  align-items: center;
  gap: 12px;
  overflow: hidden;
}

.user-avatar {
  width: 35px;
  height: 35px;
  background-color: var(--sidebar-active-bg);
  color: #fff;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  flex-shrink: 0;
}

.user-details {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.user-name {
  color: #fff;
  font-size: 0.9rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-role {
  font-size: 0.75rem;
  color: var(--sidebar-text);
}

.badge-custom {
  background-color: #f64e60;
  color: #fff;
  font-size: 0.7rem;
  padding: 2px 6px;
  border-radius: 10px;
  margin-left: 8px;
  font-weight: 700;
}

.sidebar.collapsed .nav-link-custom .badge-custom {
  display: none;
}

.main-content {
  flex: 1;
  margin-left: var(--sidebar-width);
  transition: margin-left var(--transition-speed) ease;
  width: calc(100% - var(--sidebar-width));
}

.sidebar.collapsed + .main-content {
  margin-left: var(--sidebar-collapsed-width);
  width: calc(100% - var(--sidebar-collapsed-width));
}

/* Mobile Responsiveness */
@media (max-width: 991px) {
  .sidebar {
    transform: translateX(-100%);
    width: var(--sidebar-width) !important;
  }
  
  .sidebar.mobile-open {
    transform: translateX(0);
  }
  
  .main-content {
    margin-left: 0 !important;
    width: 100% !important;
  }
  
  .sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
  }
  
  .sidebar.mobile-open + .sidebar-overlay {
    display: block;
  }
}

.mobile-toggle {
  position: fixed;
  top: 15px;
  right: 15px;
  z-index: 998;
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 8px;
  width: 45px;
  height: 45px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  color: var(--sidebar-bg);
  cursor: pointer;
}

/* Nested Submenu Styling */
.nested-submenu-container {
  position: relative;
}

.nested-trigger {
  display: flex;
  justify-content: space-between !important;
  align-items: center;
  padding-left: var(--submenu-link-padding, 60px) !important;
  padding-right: 20px !important;
}

.nested-arrow {
  font-size: 0.7rem;
  transform: rotate(-90deg);
  transition: transform 0.3s;
}

.nested-arrow.open {
  transform: rotate(0deg);
}

.nested-submenu {
  background-color: rgba(0, 0, 0, 0.15);
  overflow: hidden;
  max-height: 0;
  transition: max-height 0.3s ease-out;
  position: relative;
}

.nested-submenu.open {
  max-height: 1000px;
  transition: max-height 0.5s ease-in;
}

.nested-link {
  padding-left: var(--submenu-link-padding, 80px) !important;
}

.submenu-link.disabled,
.nested-link.disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

.submenu-divider {
  height: 1px;
  background-color: rgba(255, 255, 255, 0.05);
  margin: 8px 20px;
}

/* Tooltip and Floating Submenu Styles */
.tooltip-text {
  display: none;
  position: absolute;
  left: 100%;
  top: 50%;
  transform: translateY(-50%);
  background-color: #1e1e2d;
  color: #fff;
  padding: 8px 15px;
  border-radius: 6px;
  font-size: 0.85rem;
  font-weight: 500;
  white-space: nowrap;
  pointer-events: none;
  margin-left: 15px;
  z-index: 1005;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.tooltip-text::before {
  content: '';
  position: absolute;
  right: 100%;
  top: 50%;
  transform: translateY(-50%);
  border: 6px solid transparent;
  border-right-color: #1e1e2d;
}

.sidebar.collapsed .nav-link-custom:hover .tooltip-text {
  display: block;
}

/* Floating Submenu */
.floating-submenu {
  display: none;
  position: absolute;
  left: 100%;
  top: 0;
  width: 240px;
  background-color: var(--sidebar-bg);
  box-shadow: 10px 0 30px rgba(0, 0, 0, 0.4);
  border-radius: 0 10px 10px 0;
  z-index: 1004;
  margin-left: 1px;
  max-height: 90vh;
  overflow-y: auto;
}

.nav-item:hover .floating-submenu {
  display: block;
}

/* Hide tooltip if floating menu is present */
.nav-item:hover .nav-link-custom .tooltip-text {
  display: none !important;
}

.floating-header {
  padding: 15px 20px;
  font-weight: 700;
  color: #fff;
  background-color: rgba(255, 255, 255, 0.03);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  font-size: 0.95rem;
}

.floating-content {
  padding: 10px 0;
}

.floating-content .submenu-link {
  padding: 10px 25px;
}

.floating-nested-section {
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
  margin-bottom: 5px;
  padding-bottom: 5px;
  position: relative;
}

.floating-nested-section .floating-nested-section {
  margin-left: 14px;
  padding-left: 10px;
}

.floating-nested-section .floating-nested-section::before {
  content: '';
  position: absolute;
  left: 0;
  top: 6px;
  bottom: 8px;
  width: 2px;
  background: var(--sidebar-submenu-rail);
}

.floating-nested-title {
  padding: 10px 20px;
  color: var(--sidebar-active-bg);
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.floating-nested-content {
  position: relative;
}

.floating-content .submenu-link.active {
  background-color: rgba(54, 153, 255, 0.1);
  color: var(--sidebar-active-bg);
}

/* Ensure tooltips show for items without floating menus (navLinks) */
.sidebar.collapsed .nav-link-custom:not(.active):hover {
  background-color: var(--sidebar-hover-bg);
}

/* ══════════════════════════════════════════════
   Search bar
══════════════════════════════════════════════ */
.cl-search-bar {
    display: flex;
    align-items: center;
    background: #fff;
    border: 1.5px solid #cbd5e1;
    border-radius: 8px;
    height: 40px;
    box-sizing: border-box;
    transition: border-color 0.15s ease;
    position: relative;
}

.cl-search-bar:focus-within {
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.10);
}

.cl-search-input {
    border: none;
    outline: none;
    background: transparent;
    padding: 0 8px;
    font-size: 14px;
    color: #334155;
    flex: 1;
    min-width: 0;
}

.cl-search-divider {
    width: 1px;
    height: 20px;
    background: #cbd5e1;
    margin: 0 8px;
    flex-shrink: 0;
}

/* Search type picker */
.cl-search-type-wrap {
    position: relative;
    display: flex;
    align-items: center;
    padding-right: 12px;
    flex-shrink: 0;
}

.cl-search-type-btn {
    border: none;
    background: transparent;
    font-size: 14px;
    font-weight: 500;
    color: #475569;
    padding: 0 4px;
    cursor: pointer;
    white-space: nowrap;
}

.cl-search-chevron {
    color: #94a3b8;
    transition: transform 0.2s;
    flex-shrink: 0;
}

.cl-search-chevron.open {
    transform: rotate(180deg);
}

/* ── Portal dropdown (rendered on document.body — escapes overflow:hidden) ── */
.cl-type-dropdown-portal {
    position: absolute;
    /* fixed so it sits above everything */
    z-index: 99999;
    background: #fff;
    border: 1px solid #e8edf3;
    border-radius: 8px;
    box-shadow: 0 8px 24px -4px rgba(0, 0, 0, 0.14);
    min-width: 160px;
    max-height: 400px;
    overflow-y: auto;
}

.cl-type-dropdown-option {
    display: block;
    width: 100%;
    border: 0;
    background: transparent;
    text-align: left;
    font-family: inherit;
    padding: 9px 14px;
    font-size: 13px;
    color: #475569;
    cursor: pointer;
    user-select: none;
}

.cl-type-dropdown-option:hover {
    background: #f8fafc;
    color: #0f172a;
}

.cl-type-dropdown-option.selected {
    background: #eff6ff;
    color: #2563eb;
    font-weight: 600;
}

/* ══════════════════════════════════════════════
   Toolbar buttons
══════════════════════════════════════════════ */
.cl-btn-reset,
.cl-btn-add {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    height: 40px;
    padding: 0 16px;
    box-sizing: border-box;
    font-size: 14px;
    font-weight: 500;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.15s ease;
    white-space: nowrap;
}

.cl-btn-reset {
    background: #fff;
    border: 1px solid #e8edf3;
    color: #64748b;
}

.cl-btn-reset:hover {
    background: #f8fafc;
    color: #334155;
    border-color: #cbd5e1;
}

.cl-btn-add {
    background: #2563eb;
    border: 1px solid #2563eb;
    color: #fff;
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.20);
}

.cl-btn-add:hover {
    background: #1d4ed8;
}

/* ══════════════════════════════════════════════
   Table
══════════════════════════════════════════════ */
.cl-table {
    width: 100%;
    min-width: 900px;
    border-collapse: separate;
    border-spacing: 0;
}

.cl-table-box {
    border: 1px solid #e8edf3;
    border-radius: 12px;
    background: #fff;
    overflow: hidden;
}

.cl-table th {
    background: #f7f9fc;
    padding: 11px 14px;
    text-align: left;
    font-size: 12px;
    font-weight: 700;
    color: #475569;
    border-bottom: 1px solid #cbd5e1;
    white-space: nowrap;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

.cl-table-container {
    flex: 1;
    min-width: 0;
}

.cl-table-scroll {
    overflow-x: auto;
    overflow-y: hidden;
    padding-bottom: 12px;
}

.cl-th-sortable {
    cursor: pointer;
    transition: color 0.15s;
    user-select: none;
}

.cl-th-sortable:hover {
    color: #0f172a;
}

.cl-sort-icon {
    display: inline-flex;
    margin-left: 4px;
    opacity: 0.3;
}

.cl-sort-icon.active {
    opacity: 1;
    color: #2563eb;
}

.cl-table td {
    padding: 14px 14px;
    font-size: 14px;
    color: #334155;
    border-bottom: 1px solid #cbd5e1;
}

.cl-table tbody tr:last-child td {
    border-bottom: none;
}

.cl-table-row {
    cursor: pointer;
    transition: background 0.12s;
}

.cl-table-row:hover td {
    background: #f0f7ff;
}

.cl-table-row.selected td {
    background: #eff6ff;
    border-color: #bfdbfe;
}

.cl-table-row.selected td:first-child {
    border-left: 3px solid #2563eb;
}

.cl-td-strong {
    font-weight: 600;
    color: #0f172a;
}

.cl-td-muted {
    color: #94a3b8;
    font-size: 12px;
}

.cl-empty {
    text-align: center;
    padding: 48px;
    color: #94a3b8;
    font-size: 13px;
}

/* ══════════════════════════════════════════════
   Pagination
══════════════════════════════════════════════ */
.cl-pagination {
    padding: 12px 14px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    background: #f7f9fc;
    border-top: 1px solid #e8edf3;
    flex-wrap: wrap;
}

.cl-rows-label {
    font-size: 12px;
    color: #64748b;
    display: flex;
    align-items: center;
    gap: 8px;
}

.cl-rows-select {
    border: 1px solid #e8edf3;
    border-radius: 6px;
    padding: 3px 6px;
    font-size: 12px;
    color: #334155;
    background: #fff;
    outline: none;
    cursor: pointer;
}

.cl-page-info {
    font-size: 12px;
    color: #64748b;
    min-width: 90px;
    text-align: center;
}

.cl-page-btn {
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #e8edf3;
    background: #fff;
    color: #64748b;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s;
}

.cl-page-btn:hover:not(:disabled) {
    background: #f1f5f9;
    border-color: #cbd5e1;
    color: #0f172a;
}

.cl-page-btn:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

/* ══════════════════════════════════════════════
   Preview panel (right side)
══════════════════════════════════════════════ */
.cl-preview-panel {
    width: 300px;
    flex-shrink: 0;
    background: #fff;
    border: 1px solid #e8edf3;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06), 0 4px 16px rgba(0, 0, 0, 0.04);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 16px;
    max-height: calc(100vh - 140px);
    transition: width 0.3s ease, margin 0.3s ease;
    z-index: auto;
}

.cl-preview-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 14px 12px;
    border-bottom: 1px solid #e8edf3;
    background: linear-gradient(135deg, #f0f7ff 0%, #fafbff 100%);
}

.cl-preview-body {
    flex: 1;
    overflow-y: auto;
    padding: 8px 14px 12px;
}

.cl-preview-footer {
    display: flex;
    gap: 8px;
    padding: 12px 14px;
    border-top: 1px solid #e8edf3;
    background: #f7f9fc;
}

.cl-preview-btn-primary,
.cl-preview-btn-secondary {
    flex: 1;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    border-radius: 7px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
}

.cl-preview-btn-primary {
    background: #2563eb;
    border: none;
    color: #fff;
    box-shadow: 0 2px 6px rgba(37, 99, 235, 0.22);
}

.cl-preview-btn-primary:hover {
    background: #1d4ed8;
}

.cl-preview-btn-secondary {
    background: #fff;
    border: 1.5px solid #fecaca;
    color: #dc2626;
}

.cl-preview-btn-secondary:hover {
    background: #fef2f2;
}

/* ══════════════════════════════════════════════
   Delete modal
══════════════════════════════════════════════ */
.cl-modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.40);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.cl-modal {
    background: #fff;
    padding: 32px;
    border-radius: 16px;
    width: 100%;
    max-width: 400px;
    text-align: center;
    position: relative;
    box-shadow: 0 20px 40px -8px rgba(0, 0, 0, 0.15);
}

.cl-modal-close {
    position: absolute;
    top: 14px;
    right: 14px;
    border: none;
    background: transparent;
    color: #94a3b8;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
}

.cl-modal-close:hover {
    color: #475569;
    background: #f1f5f9;
}

.cl-modal-icon {
    color: #ef4444;
    background: #fef2f2;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    margin: 0 auto 18px;
}

.cl-modal-msg {
    font-size: 15px;
    color: #334155;
    margin-bottom: 16px;
    line-height: 1.5;
}

.cl-modal-warning {
    background: #fff8eb;
    border: 1px solid #ffd8a8;
    border-radius: 8px;
    padding: 10px 12px;
    text-align: left;
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 24px;
}

.cl-modal-warning-title {
    font-size: 12px;
    font-weight: 600;
    color: #d97706;
    display: flex;
    align-items: center;
    gap: 5px;
}

.cl-modal-warning-text {
    font-size: 12px;
    color: #92400e;
}

.cl-modal-actions {
    display: flex;
    gap: 10px;
}

.cl-modal-btn-cancel,
.cl-modal-btn-confirm {
    flex: 1;
    height: 40px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
}

.cl-modal-btn-cancel {
    background: #fff;
    border: 1.5px solid #e8edf3;
    color: #64748b;
}

.cl-modal-btn-cancel:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
}

.cl-modal-btn-confirm {
    background: #ef4444;
    border: 1.5px solid #ef4444;
    color: #fff;
}

.cl-modal-btn-confirm:hover {
    background: #dc2626;
}

.cl-modal-btn-confirm.cl-modal-btn-confirm-success {
    background: #16a34a;
    border: 1.5px solid #16a34a;
}

.cl-modal-btn-confirm.cl-modal-btn-confirm-success:hover {
    background: #15803d;
}

/* ══════════════════════════════════════════════
   Responsive
══════════════════════════════════════════════ */
@media (max-width: 1024px) {
    .cl-content-wrapper {
        flex-direction: column !important;
        padding-bottom: 100px;
    }

    .cl-preview-panel {
        width: 100% !important;
        position: static !important;
        max-height: none !important;
        margin-top: 16px;
    }
}

@media (max-width: 768px) {
    .cl-pagination {
        justify-content: center;
        gap: 6px;
    }
}

/* ══════════════════════════════════════════════
   Layout & Sticky Positioning
   ══════════════════════════════════════════════ */

/* Content Wrapper */
.cl-content-wrapper {
    display: flex;
    gap: 16px;
    align-items: flex-start;
}

/* Toolbar */
.cl-toolbar-sticky {
    background: #ffffff !important;
    border-bottom: 2px solid #cbd5e1 !important;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    flex-wrap: nowrap;
    box-shadow: 0 4px 6px -4px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 10;
}

/* Table Headers */
.cl-table thead th {
    background: #f8fafc !important;
    border-bottom: 2px solid #cbd5e1 !important;
}

/* Ensure data rows don't overlap */
.cl-table tbody tr {
    position: relative;
    z-index: 1;
}

/* Prevent container overflow issues */
.cl-table-container {
    max-width: 100%;
}

.cl-rows-select:focus-visible,
.cl-page-btn:focus-visible,
.cl-preview-btn-primary:focus-visible,
.cl-preview-btn-secondary:focus-visible,
.cl-modal-close:focus-visible {
    outline: 3px solid #2563eb;
    outline-offset: 2px;
}

.cl-th-sortable button:focus-visible,
.cl-table-row:focus-visible,
.cl-page-btn:focus-visible,
.cl-modal button:focus-visible,
.cl-modal textarea:focus-visible,
.cl-modal input:focus-visible {
  outline: 3px solid rgba(37, 99, 235, 0.35);
  outline-offset: 2px;
}


/*# sourceMappingURL=main-9a8b795a.c64d1ab6.css.map*/