/* =========================
   MCVRD-PL PROJECT HUB
   ========================= */

* {
    box-sizing: border-box;
}

:root {
    --hub-bg: #111315;
    --hub-surface: #191c1f;
    --hub-surface-soft: #202428;
    --hub-border: rgba(255, 255, 255, 0.09);

    --hub-text: #f5f5f5;
    --hub-text-soft: #a9afb5;
    --hub-text-muted: #747b82;

    --hub-orange: #ff6d00;
    --hub-blue: #5b7c99;

    /* Personalisation accent */
    --hub-accent: var(--hub-orange);
    --hub-accent-rgb: 255, 109, 0;
    --hub-accent-text: #ff6d00;
    --hub-on-accent: #111315;

    --hub-accent-glow: rgba(var(--hub-accent-rgb), 0.07);
    --hub-accent-border: rgba(var(--hub-accent-rgb), 0.42);
    --hub-accent-bg: rgba(var(--hub-accent-rgb), 0.035);
    --hub-accent-hover-bg: rgba(var(--hub-accent-rgb), 0.075);

    --hub-danger: var(--hub-orange);

    --hub-radius: 18px;

    --hub-glow: var(--hub-accent-glow);

    --hub-create-border: var(--hub-accent-border);
    --hub-create-bg: var(--hub-accent-bg);
    --hub-create-hover-bg: var(--hub-accent-hover-bg);

}

/* =========================
   HUB SUPPORT MODAL COLOURS
   ========================= */

.bug-report-modal,
.whats-new-modal {
    --surface: var(--hub-surface);
    --text: var(--hub-text);
    --border: var(--hub-border);
    --accent: var(--hub-accent);
    --on-accent: var(--hub-on-accent);
}

html,
body {
    margin: 0;
    min-height: 100%;
}

body {
    min-height: 100vh;
    background:
        radial-gradient(
            circle at top left,
            var(--hub-glow),
            transparent 32%
        ),
        var(--hub-bg);

    color: var(--hub-text);

    font-family:
        Inter,
        system-ui,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        sans-serif;
}


/* =========================
   SHELL
   ========================= */

.hub-shell {
    min-height: 100vh;
}


/* =========================
   HEADER
   ========================= */

.hub-header {
    height: 78px;

    display: flex;
    align-items: center;
    justify-content: space-between;

    padding: 0 42px;

    border-bottom: 1px solid var(--hub-border);

    background: rgba(17, 19, 21, 0.88);

    backdrop-filter: blur(14px);
}

.hub-brand {
    display: inline-flex;
    align-items: center;
    gap: 12px;

    color: inherit;
    text-decoration: none;
}

.hub-brand-mark {
    font-size: 20px;
    font-weight: 800;
    letter-spacing: 0.08em;
}

.hub-brand-divider {
    width: 1px;
    height: 22px;

    background: rgba(255, 255, 255, 0.22);
}

.hub-brand-product {
    color: var(--hub-orange);

    font-size: 19px;
    font-weight: 800;
    letter-spacing: 0.08em;
}

.hub-header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.hub-account-button {
    min-height: 40px;

    padding: 0 18px;

    border: 1px solid var(--hub-border);
    border-radius: 10px;

    background: var(--hub-surface);

    color: var(--hub-text);

    font: inherit;
    font-weight: 600;

    cursor: pointer;
}

.hub-account-button:hover {
    border-color: rgba(255, 109, 0, 0.55);
}


/* =========================
   SIDEBAR
   ========================= */

.hub-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;

    width: 220px;

    display: flex;
    flex-direction: column;

    padding: 28px 22px;

    border-right: 1px solid var(--hub-border);

    background: var(--hub-surface);

    z-index: 20;
}

.hub-sidebar .hub-brand {
    padding: 0 10px 26px;
}

.hub-sidebar-nav {
    flex: 1;

    display: flex;
    flex-direction: column;

    gap: 6px;
}

.hub-sidebar-link,
.hub-sidebar-signout {
    width: 100%;

    display: flex;
    align-items: center;

    min-height: 44px;

    padding: 0 14px;

    border: 0;
    border-radius: 10px;

    background: transparent;

    color: var(--hub-text-soft);

    font: inherit;
    font-weight: 600;

    text-align: left;
    text-decoration: none;

    cursor: pointer;
}

.hub-sidebar-link:hover,
.hub-sidebar-signout:hover {
    background: var(--hub-surface-soft);
    color: var(--hub-text);
}

/* HUB SIDEBAR — SUPPORT ICON ALIGNMENT */

.hub-support-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    width: 20px;
    flex: 0 0 20px;

    margin-right: 8px;

    font-size: 14px;
    line-height: 1;
}

/* Correct the bug emoji's visual offset */
#openBugReport .hub-support-icon {
    transform: translateX(-2px);
}

.hub-sidebar-link-active {
    background: var(--hub-surface-soft);
    color: var(--hub-text);
}

.hub-sidebar-link-active::before {
    content: "";

    width: 3px;
    height: 20px;

    margin-right: 11px;

    border-radius: 999px;

    background: var(--hub-accent);
}

.hub-sidebar-signout {
    color: var(--hub-text-muted);
}

/* HUB SIDEBAR — SECTION SPACING */

#hubAppearanceButton {
    margin-top: 22px;
    border-top: 1px solid var(--hub-border);
    border-radius: 0;
    padding-top: 14px;
}

#hubAccountButton {
    margin-top: auto;
    border-top: 1px solid var(--hub-border);
    border-radius: 0;
    padding-top: 14px;
}

#hubSignOut {
    margin-top: 2px;
}


/* =========================
   MAIN
   ========================= */

.hub-main {
    width: auto;
    max-width: none;

    margin-left: 220px;
    margin-right: auto;

    padding: 72px 48px 90px;
}

.hub-section-heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;

    margin-bottom: 34px;
}

.hub-eyebrow {
    margin: 0 0 10px;

    color: var(--hub-accent-text);

    font-size: 12px;
    font-weight: 800;

    letter-spacing: 0.16em;
}

.hub-section-heading h1 {
    margin: 0;

    font-size: clamp(34px, 4vw, 54px);
    line-height: 1;

    letter-spacing: -0.035em;
}

.hub-section-intro {
    margin: 15px 0 0;

    color: var(--hub-text-soft);

    font-size: 16px;
}


/* =========================
   PROJECT GRID
   ========================= */

.hub-project-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 22px;
}

.hub-loading {
    min-height: 250px;

    display: flex;
    align-items: center;
    justify-content: center;

    border: 1px solid var(--hub-border);
    border-radius: var(--hub-radius);

    background: var(--hub-surface);

    color: var(--hub-text-soft);
}

/* =========================
   HUB OVERVIEW
   ========================= */

.hub-overview-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;

    margin: 34px 0 26px;
}

.hub-overview-card {
    min-height: 118px;

    display: flex;
    flex-direction: column;
    justify-content: center;

    padding: 20px 22px;

    border: 1px solid var(--hub-border);
    border-radius: 14px;

    background: var(--hub-surface);
}

.hub-overview-label {
    color: var(--hub-text-muted);

    font-size: 11px;
    font-weight: 800;

    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.hub-overview-value {
    display: block;

    margin-top: 8px;

    color: var(--hub-text);

    font-size: 28px;
    font-weight: 800;
    line-height: 1;
}

.hub-overview-detail {
    display: block;

    margin-top: 9px;

    color: var(--hub-text-soft);

    font-size: 12px;
}


/* =========================
   PROJECT CARD
   Used by hub.js later
   ========================= */

.hub-project-card {
    position: relative;

    min-height: 270px;

    display: flex;
    flex-direction: column;

    overflow: hidden;

    border: 1px solid var(--hub-border);
    border-radius: var(--hub-radius);

    background: var(--hub-surface);

    transition:
        transform 160ms ease,
        border-color 160ms ease,
        background 160ms ease;
}

.hub-project-card:hover {
    transform: translateY(-3px);

    border-color: var(--hub-accent-border);

    background: var(--hub-surface-soft);
}

.hub-project-card-main {
    flex: 1;

    padding: 28px;

    cursor: pointer;
}

.hub-project-card-label {
    margin: 0 0 14px;

    color: var(--hub-text-muted);

    font-size: 11px;
    font-weight: 800;

    letter-spacing: 0.14em;
}

.hub-project-card h2 {
    margin: 0;

    max-width: 85%;

    font-size: 20px;
    line-height: 1.18;

    letter-spacing: -0.02em;
}


/* =========================
   PROJECT CARD FINANCIALS
   ========================= */

.hub-project-financials {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;

    margin-top: 28px;
    padding-top: 22px;

    border-top: 1px solid var(--hub-border);
}

.hub-project-financial:last-child {
    grid-column: 1 / -1;
}

.hub-project-financial {
    min-width: 0;
}

.hub-project-financial span {
    display: block;

    margin-bottom: 6px;

    color: var(--hub-text-muted);

    font-size: 11px;
    font-weight: 700;

    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.hub-project-financial strong {
    display: block;

    color: var(--hub-text);

    font-size: 16px;
    font-weight: 700;

    white-space: nowrap;
}


/* =========================
   PROJECT BUDGET PROGRESS
   ========================= */

.hub-project-progress {
    margin-top: 24px;
}

.hub-project-progress-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;

    margin-bottom: 9px;

    color: var(--hub-text-muted);

    font-size: 11px;
    font-weight: 700;

    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.hub-project-progress-heading strong {
    color: var(--hub-text-soft);

    font-size: 12px;
}

.hub-project-progress-track {
    width: 100%;
    height: 7px;

    overflow: hidden;

    border-radius: 999px;

    background: var(--hub-surface-soft);
}

.hub-project-progress-bar {
    height: 100%;

    border-radius: inherit;

    background: var(--hub-accent);

    transition: width 240ms ease;
}

/* =========================
   PROJECT ATTENTION
   ========================= */

.hub-project-attention {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;

    margin-top: 22px;
    padding-top: 18px;

    border-top: 1px solid var(--hub-border);
}

.hub-project-attention-item {
    display: flex;
    align-items: center;
    justify-content: space-between;

    min-width: 0;
    padding: 12px 14px;

    border: 1px solid var(--hub-border);
    border-radius: 10px;

    background: var(--hub-surface-soft);
}

.hub-project-attention-item span {
    color: var(--hub-text-soft);

    font-size: 12px;
    font-weight: 600;
}

.hub-project-attention-item strong {
    color: var(--hub-text);

    font-size: 18px;
    font-weight: 800;
}

.hub-project-meta {
    margin-top: 22px;

    color: var(--hub-text-soft);

    font-size: 14px;
}

.hub-project-menu-button {
    position: absolute;

    top: 18px;
    right: 18px;

    width: 38px;
    height: 38px;

    display: flex;
    align-items: center;
    justify-content: center;

    border: 1px solid transparent;
    border-radius: 9px;

    background: transparent;

    color: var(--hub-text-soft);

    font-size: 22px;
    line-height: 1;

    cursor: pointer;
}

.hub-project-menu-button:hover {
    border-color: var(--hub-border);

    background: rgba(255, 255, 255, 0.05);

    color: var(--hub-text);
}


/* =========================
   CREATE PROJECT CARD
   ========================= */

.hub-create-card {
    min-height: 270px;

    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;

    padding: 28px;

    border: 1px dashed var(--hub-create-border);

    border-radius: var(--hub-radius);

    background: var(--hub-create-bg);

    color: var(--hub-text);

    text-align: center;

    cursor: pointer;

    transition:
        transform 160ms ease,
        border-color 160ms ease,
        background 160ms ease;
}

.hub-create-card:hover {
    transform: translateY(-3px);

    border-color: var(--hub-accent);

    background: var(--hub-create-hover-bg);
}

.hub-create-icon {
    width: 52px;
    height: 52px;

    display: flex;
    align-items: center;
    justify-content: center;

    margin-bottom: 18px;

    border-radius: 50%;

    background: var(--hub-accent);
    color: var(--hub-on-accent);

    font-size: 31px;
    font-weight: 400;
}

.hub-create-card h2 {
    margin: 0;

    font-size: 21px;
}

.hub-create-card p {
    margin: 9px 0 0;

    color: var(--hub-text-soft);

    font-size: 14px;
}


/* =========================
   MODAL
   ========================= */

.hub-modal-overlay {
    position: fixed;
    inset: 0;

    z-index: 1000;

    display: flex;
    align-items: center;
    justify-content: center;

    padding: 24px;

    background: rgba(0, 0, 0, 0.72);

    backdrop-filter: blur(5px);
}

.hub-modal-overlay[hidden] {
    display: none;
}

.hub-modal {
    position: relative;

    width: min(500px, 100%);

    padding: 34px;

    border: 1px solid var(--hub-border);
    border-radius: 20px;

    background: #191c1f;

    box-shadow:
        0 30px 80px rgba(0, 0, 0, 0.45);
}

.hub-modal h2 {
    margin: 0;

    font-size: 28px;
}

.hub-modal-intro {
    margin: 12px 0 28px;

    color: var(--hub-text-soft);

    line-height: 1.55;
}

.hub-modal-close {
    position: absolute;

    top: 16px;
    right: 16px;

    width: 38px;
    height: 38px;

    border: 0;
    border-radius: 9px;

    background: transparent;

    color: var(--hub-text-soft);

    font-size: 28px;

    cursor: pointer;
}

.hub-modal-close:hover {
    background: rgba(255, 255, 255, 0.05);

    color: var(--hub-text);
}

.hub-modal label {
    display: block;

    margin-bottom: 9px;

    font-size: 13px;
    font-weight: 700;
}

.hub-modal input {
    width: 100%;
    height: 48px;

    padding: 0 14px;

    border: 1px solid var(--hub-border);
    border-radius: 10px;

    outline: none;

    background: #111315;

    color: var(--hub-text);

    font: inherit;
}

.hub-modal input:focus {
    border-color: var(--hub-accent);
}

.hub-modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;

    margin-top: 28px;
}

.hub-button {
    min-height: 44px;

    padding: 0 18px;

    border-radius: 10px;

    font: inherit;
    font-weight: 700;

    cursor: pointer;
}

.hub-button-secondary {
    border: 1px solid var(--hub-border);

    background: transparent;

    color: var(--hub-text);
}

.hub-button-primary {
    border: 1px solid var(--hub-accent); 
    background: var(--hub-accent);

    color: var(--hub-bg);
}

/* =========================
   NEXT SCHEDULED
   ========================= */

.hub-project-next-scheduled:has(.hub-project-next-details)
.hub-project-next-label {
    color: var(--project-accent);

}


.hub-project-next-scheduled {
    margin-top: 20px;
    padding-top: 18px;
    border-top: 1px solid var(--hub-border);
}

.hub-project-next-label {
    display: block;
    margin-bottom: 8px;
    color: var(--hub-text-muted);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.08em;
}

.hub-project-next-item {
    display: block;
    color: var(--hub-text-soft);
    font-size: 13px;
    font-weight: 600;
}

.hub-project-next-details {
    margin-top: 6px;
    color: var(--hub-text-muted);
    font-size: 12px;
    line-height: 1.5;
}


/* =========================
   HUB APPEARANCE SELECTOR
   ========================= */

.hub-sidebar-appearance {
    margin-top: 22px;
    padding: 0 12px;
}

.hub-appearance-label {
    display: block;
    margin-bottom: 10px;
    color: var(--hub-text-muted);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.1em;
}

.hub-theme-options {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 4px;
}

.hub-theme-button {
    min-width: 0;
    padding: 9px 2px;
    border: 1px solid var(--hub-border);
    border-radius: 7px;
    background: var(--hub-surface-soft);
    color: var(--hub-text-soft);
    font-family: inherit;
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
    transition:
        background 160ms ease,
        color 160ms ease,
        border-color 160ms ease;
}

.hub-theme-button:hover {
    color: var(--hub-text);
}

.hub-theme-button.active {
    background: var(--hub-accent); 
    border-color: var(--hub-accent);
    color: #111315;
}

/* =========================
   HUB LIGHT THEME
   ========================= */

:root[data-theme="light"] {
    --hub-bg: #f2f5f8;
    --hub-surface: #ffffff;
    --hub-surface-soft: #eaf0f5;
    --hub-border: rgba(38, 57, 75, 0.14);

    --hub-text: #202d38;
    --hub-text-soft: #536778;
    --hub-text-muted: #718393;

    --hub-orange: #5b7c99;
    --hub-blue: #5b7c99;

    --hub-accent: var(--hub-orange);
    --hub-accent-rgb: 91, 124, 153;
    --hub-accent-text: #5b7c99;
    --hub-on-accent: #ffffff;

    --hub-glow: rgba(91, 124, 153, 0.07);

    --hub-create-border: rgba(91, 124, 153, 0.42);
    --hub-create-bg: rgba(91, 124, 153, 0.035);
    --hub-create-hover-bg: rgba(91, 124, 153, 0.075);
}


/* =========================
   HUB SYSTEM THEME
   ========================= */

@media (prefers-color-scheme: light) {

    :root:not([data-theme]) {
        --hub-bg: #f2f5f8;
        --hub-surface: #ffffff;
        --hub-surface-soft: #eaf0f5;
        --hub-border: rgba(38, 57, 75, 0.14);

        --hub-text: #202d38;
        --hub-text-soft: #536778;
        --hub-text-muted: #718393;

        --hub-orange: #5b7c99;
        --hub-blue: #5b7c99;

        --hub-accent: var(--hub-orange);
        --hub-accent-rgb: 91, 124, 153;
        --hub-accent-text: #5b7c99;
        --hub-on-accent: #ffffff;
       

    }

}


/* =========================
   RESPONSIVE
   ========================= */

@media (max-width: 700px) {

    .hub-header {
        height: 68px;

        padding: 0 20px;
    }

    .hub-main {
        width: min(100% - 32px, 1280px);

        padding-top: 46px;
    }

    .hub-section-heading h1 {
        font-size: 38px;
    }

    .hub-project-grid {
        grid-template-columns: 1fr;
    }

}

.hub-button-danger {
    border: 1px solid var(--hub-danger);

    background: transparent;

    color: var(--hub-danger);
}

.hub-button-danger:hover {
    background: var(--hub-danger);

    color: var(--hub-bg);
}

.hub-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* =========================
   HUB APPEARANCE MODAL
   ========================= */

.hub-appearance-modal {
    width: min(500px, calc(100vw - 32px));
    max-height: calc(100dvh - 32px);
    overflow-y: auto;
}

.hub-appearance-field {
    display: flex;
    flex-direction: column;
    gap: 9px;
    margin-top: 20px;
}

.hub-appearance-field label,
.hub-appearance-field-label {
    display: block;
    color: var(--hub-text-soft);
    font-size: 12px;
    font-weight: 700;
}

#hubAppearanceTarget {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid var(--hub-border);
    border-radius: 9px;
    background: var(--hub-surface-soft);
    color: var(--hub-text);
    font: inherit;
    font-size: 13px;
    cursor: pointer;
}

#hubAppearanceTarget:focus-visible,
#hubAppearanceColour:focus-visible {
    outline: 2px solid var(--hub-accent);
    outline-offset: 3px;
}

#hubAppearanceColour {
    width: 68px;
    height: 42px;
    padding: 4px;
    border: 1px solid var(--hub-border);
    border-radius: 9px;
    background: var(--hub-surface-soft);
    cursor: pointer;
}

#hubAppearanceColour::-webkit-color-swatch-wrapper {
    padding: 0;
}

#hubAppearanceColour::-webkit-color-swatch {
    border: none;
    border-radius: 5px;
}

#hubAppearanceColour::-moz-color-swatch {
    border: none;
    border-radius: 5px;
}

.hub-appearance-modal .hub-modal-actions {
    margin-top: 28px;
}

@media (max-width: 480px) {
    .hub-appearance-modal .hub-modal-actions {
        flex-wrap: wrap;
    }
}

/* =========================
   APPEARANCE COLOUR PREVIEW
   ========================= */

.hub-appearance-preview {
    margin-top: 14px;
    padding: 15px;
    background: var(--hub-surface-soft);
    border: 1px solid var(--hub-border);
    border-radius: 12px;
}

.hub-appearance-preview-title {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: var(--hub-text-muted);
    margin-bottom: 13px;
}

.hub-appearance-preview-content {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.hub-appearance-preview-button {
    padding: 9px 13px;
    border: none;
    border-radius: 7px;
    background: var(--hub-accent);
    color: var(--hub-on-accent);
    font-size: 12px;
    font-weight: 700;
    pointer-events: none;
}

.hub-appearance-preview-nav {
    padding: 9px 13px;
    border-radius: 7px;
    background: rgba(var(--hub-accent-rgb), 0.14);
    color: var(--hub-accent-text);
    font-size: 12px;
    font-weight: 600;
}

.hub-appearance-preview-label {
    width: 100%;
    margin-top: 3px;
    color: var(--hub-accent-text);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.7px;
}

/* Independent Dark/Light appearance preview */

.hub-appearance-preview[data-preview-theme="dark"] {
    background: #191c1f;
    border-color: rgba(255, 255, 255, 0.09);
}

.hub-appearance-preview[data-preview-theme="light"] {
    background: #ffffff;
    border-color: rgba(38, 57, 75, 0.14);
}

.hub-appearance-preview[data-preview-theme="dark"]
.hub-appearance-preview-title {
    color: #a9afb5;
}

.hub-appearance-preview[data-preview-theme="light"]
.hub-appearance-preview-title {
    color: #536778;
}

@media (max-width: 700px) {
    .hub-sidebar {
        position: relative;
        width: 100%;
        padding: 12px 16px;
        border-right: none;
        border-bottom: 1px solid var(--hub-border);
    }

    .hub-sidebar-nav {
        display: flex;
        flex-direction: row;
        flex-wrap: wrap;
        gap: 8px;
    }

    .hub-sidebar-signout {
        margin-top: 12px;
    }

    .hub-main {
        width: 100%;
        max-width: none;
        margin: 0;
        padding: 28px 16px 60px;
    }

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

@media (max-width: 700px) {
    .hub-overview-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 12px;
    }

    .hub-overview-card {
        min-height: 105px;
        padding: 16px;
    }
}

/* =========================
   UNIFIED SUPPLIERS
========================= */

.hub-suppliers-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 24px;
}

/* Supplier toolbar actions */

.hub-supplier-toolbar-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    flex: 1;
    min-width: 0;
}

.hub-supplier-toolbar-actions .hub-supplier-search {
    flex: 1 1 240px;
    width: auto;
    max-width: 380px;
}

.hub-add-supplier-btn {
    min-height: 46px;
    padding: 0 20px;

    border: 1px solid var(--hub-accent);
    border-radius: 10px;

    background: var(--hub-accent);
    color: var(--hub-on-accent, #fff);

    font: inherit;
    font-size: 13px;
    font-weight: 700;

    cursor: pointer;
    white-space: nowrap;
}

.hub-add-supplier-btn:hover {
    filter: brightness(1.12);
}

.hub-add-supplier-btn:focus-visible {
    outline: 2px solid var(--hub-accent);
    outline-offset: 3px;
}

.hub-supplier-search {
    width: 100%;
    max-width: 380px;
    min-height: 46px;
    padding: 12px 16px;

    border: 1px solid var(--hub-border);
    border-radius: 10px;

    background: var(--hub-surface);
    color: var(--hub-text);

    font: inherit;
    outline: none;
}

.hub-supplier-search:focus {
    border-color: var(--hub-accent-border);
}

#hubSupplierCount {
    color: var(--hub-text-soft);
    font-size: 13px;
}

.hub-supplier-directory {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 22px;
}

.hub-supplier-directory > .hub-loading {
    grid-column: 1 / -1;
}

.hub-unified-supplier-card {
    min-width: 0;
    min-height: 250px;
    padding: 24px;

    border: 1px solid var(--hub-border);
    border-radius: var(--hub-radius);

    background: var(--hub-surface);

    display: flex;
    flex-direction: column;
    gap: 12px;

    transition:
        transform 160ms ease,
        border-color 160ms ease,
        background 160ms ease;
}

.hub-unified-supplier-card:hover {
    transform: translateY(-3px);
    border-color: var(--hub-accent-border);
    background: var(--hub-surface-soft);
}

.hub-unified-supplier-card h3 {
    margin: 0 0 8px;

    color: var(--hub-text);
    font-size: 21px;
    line-height: 1.25;
    overflow-wrap: anywhere;
}

.hub-unified-supplier-card p {
    margin: 0;

    color: var(--hub-text-soft);
    font-size: 13px;
    line-height: 1.6;
    overflow-wrap: anywhere;
}

.hub-unified-supplier-card p:last-child {
    margin-top: auto;
    padding-top: 14px;

    border-top: 1px solid var(--hub-border);
    color: var(--hub-text);
}

/* TABLETS */

@media (max-width: 1100px) {
    .hub-supplier-directory {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* MOBILES */

@media (max-width: 700px) {
    .hub-supplier-directory {
        grid-template-columns: minmax(0, 1fr);
        gap: 14px;
    }

    .hub-supplier-search {
        max-width: none;
    }

    .hub-unified-supplier-card {
        min-height: 0;
        padding: 20px;
    }
}

/* =========================
   UNIFIED SUPPLIERS ACCENTS
========================= */

.hub-unified-supplier-card {
    border-top: 3px solid var(--hub-border);
}

.hub-unified-supplier-card h3 {
    color: var(--hub-text);
}

.hub-unified-supplier-card p:last-child {
    color: #7fa6c7;
    font-weight: 600;
}

.hub-unified-supplier-card:hover {
    border-top-color: var(--hub-border);
}

/* =========================
   SUPPLIER PROJECT ASSIGNMENT
========================= */

.hub-supplier-assignment {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 12px;
}

.hub-supplier-project-select {
    flex: 1;
    min-width: 0;
    min-height: 42px;
    padding: 9px 12px;

    border: 1px solid var(--hub-border);
    border-radius: 10px;

    background: var(--hub-surface);
    color: var(--hub-text);

    font: inherit;
    font-size: 13px;
    cursor: pointer;
}

.hub-supplier-project-select:focus {
    outline: 2px solid var(--hub-accent-border);
    outline-offset: 2px;
}

.hub-supplier-project-select option {
    background: var(--hub-surface);
    color: var(--hub-text);
}

.hub-supplier-assignment .hub-button {
    min-height: 42px;
    white-space: nowrap;
}

.hub-supplier-all-projects {
    margin-top: 12px !important;
    color: var(--hub-accent-text) !important;
    font-weight: 600;
}

/* Unified Suppliers - secondary action buttons */

.hub-supplier-assignment .hub-button-primary {
    background: transparent;
    color: var(--hub-accent-text);
    border: 1px solid var(--hub-accent-border);
    box-shadow: none;
}

.hub-supplier-assignment .hub-button-primary:hover {
    background: var(--hub-accent-text);
    color: #111;
}

/* Unified Suppliers - clickable email */

.hub-supplier-email {
    color: var(--hub-accent-text);
    text-decoration: none;
    overflow-wrap: anywhere;
}

.hub-supplier-email:hover {
    color: var(--hub-accent-text);
    text-decoration: underline;
}

/* Unified Suppliers - clickable phone numbers */

.hub-supplier-phone {
    color: var(--hub-accent-text);
    text-decoration: none;
}

.hub-supplier-phone:hover {
    color: var(--hub-accent-text);
    text-decoration: underline;
}

/* =========================
   HUB PRIORITIES & QUOTES
   SPLIT OVERVIEW CARDS
   ========================= */

.hub-overview-card.hub-overview-split {
    display: grid;
    grid-template-columns: minmax(0, 35fr) minmax(0, 65fr);
    align-items: center;
    gap: 0;
}

.hub-overview-split-count {
    min-width: 0;
    padding-right: 12px;
}

.hub-overview-split-details {
    min-width: 0;
    min-height: 65px;

    display: flex;
    flex-direction: column;
    justify-content: center;

    padding-left: 15px;
    border-left: 1px solid var(--hub-border);
}

.hub-rotation-empty {
    color: var(--hub-text-soft);
    font-size: 12px;
    line-height: 1.5;
}

/* Hub Priority details */

.hub-priority-name {
    display: block;
    color: var(--hub-text);
    font-size: 13px;
    font-weight: 700;
    line-height: 1.4;
}

.hub-priority-location {
    display: block;
    color: var(--hub-text-soft);
    font-size: 11px;
    line-height: 1.5;
}

.hub-priority-date {
    display: block;
    color: #FF6D00;
    font-size: 11px;
    font-weight: 600;
    margin-top: 3px;
}

/* Hub Quotes - slightly larger details */

#hubQuoteRotation .hub-priority-name {
    font-size: 14px;
}

#hubQuoteRotation .hub-priority-location {
    font-size: 12px;
}

#hubQuoteRotation .hub-priority-date {
    font-size: 13px;
}

/* Hub Quotes - expiry warning */

#hubQuoteRotation .hub-priority-location:last-child {
    color: var(--hub-accent-text);
    font-weight: 700;
}

.hub-overview-split-details[role="button"] {
    cursor: pointer;
    border-radius: 4px;
}

.hub-overview-split-details[role="button"]:hover .hub-priority-name {
    color: #FF6D00;
}

.hub-overview-split-details[role="button"]:focus-visible {
    outline: 2px solid #FF6D00;
    outline-offset: 3px;
}

/* =========================
   UNIFIED SUPPLIER RATINGS
   ========================= */

.hub-supplier-rating {
    display: flex;
    align-items: center;
    gap: 3px;
    margin: 10px 0 12px;
    color: var(--hub-accent);
    font-size: 19px;
    font-weight: 600;
    line-height: 1;
}

.hub-supplier-rating span {
    display: inline-block;
}

/* Unified Supplier ratings */

.hub-unified-supplier-card {
    position: relative;
}

.hub-unified-supplier-card h3 {
    padding-right: 115px;
}

.hub-supplier-rating {
    position: absolute;
    top: 20px;
    right: 18px;
    display: flex;
    gap: 3px;
    color: var(--hub-accent);
    font-size: 19px;
    line-height: 1;
}

/* Filled and empty supplier stars */

.hub-star-filled {
    color: #FFCC33;
}

.hub-star-empty {
    color: var(--hub-text-soft);
    opacity: 0.45;
}

/* =========================
   HUB — ADD SUPPLIER MODAL
   ========================= */

.hub-supplier-modal-backdrop[hidden] {
    display: none !important;
}

.hub-supplier-modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    background: rgba(0, 0, 0, 0.72);
}

.hub-supplier-modal {
    width: min(500px, 100%);
    max-height: calc(100dvh - 32px);
    overflow-y: auto;
    padding: 28px;
    border: 1px solid var(--hub-border);
    border-radius: 16px;
    background: var(--hub-surface);
    color: var(--hub-text);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.hub-supplier-modal h2 {
    margin: 0 0 22px;
    font-size: 21px;
}

#hubSupplierForm {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

#hubSupplierForm label {
    margin-top: 8px;
    color: var(--hub-text-soft);
    font-size: 12px;
    font-weight: 700;
}

#hubSupplierForm input,
#hubSupplierForm textarea {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid var(--hub-border);
    border-radius: 9px;
    background: var(--hub-surface-soft);
    color: var(--hub-text);
    font: inherit;
    font-size: 13px;
}

#hubSupplierForm input:focus-visible,
#hubSupplierForm textarea:focus-visible {
    outline: 2px solid var(--hub-accent);
    outline-offset: 2px;
}

.hub-new-supplier-stars {
    display: flex;
    gap: 8px;
    margin: 4px 0 10px;
}

.hub-new-supplier-stars button {
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--hub-text-soft);
    font-size: 29px;
    line-height: 1;
    opacity: 0.45;
    cursor: pointer;
}

.hub-new-supplier-stars button.selected {
    color: var(--hub-accent);
    opacity: 1;
}

.hub-new-supplier-stars button:focus-visible {
    outline: 2px solid var(--hub-accent);
    outline-offset: 3px;
}

#hubSupplierFormMessage {
    min-height: 18px;
    margin: 4px 0;
    color: var(--hub-text-soft);
    font-size: 12px;
}

#hubSupplierForm .hub-modal-actions {
    margin-top: 12px;
}

@media (max-width: 480px) {
    .hub-supplier-modal {
        padding: 20px;
    }

    #hubSupplierForm .hub-modal-actions {
        flex-wrap: wrap;
    }
}

/* =========================
   HUB — DUPLICATE SUPPLIER
   ========================= */

#hubSupplierDuplicateActions[hidden] {
    display: none !important;
}

#hubSupplierDuplicateActions {
    margin-top: 8px;
    padding: 16px;
    border: 1px solid var(--hub-border);
    border-radius: 10px;
    background: var(--hub-surface-soft);
}

#hubSupplierDuplicateDetails {
    display: none;
}

.hub-supplier-existing-select {
    width: 100%;
    min-height: 42px;
    margin-top: 6px;
    padding: 10px 12px;
    border: 1px solid var(--hub-border);
    border-radius: 9px;
    background: var(--hub-surface);
    color: var(--hub-text);
    font: inherit;
    font-size: 13px;
}

.hub-supplier-existing-select:focus-visible {
    outline: 2px solid var(--hub-accent);
    outline-offset: 2px;
}

#hubSupplierDuplicateActions .hub-modal-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 16px;
}

#hubSupplierDuplicateActions .hub-button {
    flex: 1 1 140px;
}

#hubSupplierForm > .hub-modal-actions {
    margin-top: 18px;
}

/* =========================
   HUB — INDIVIDUAL PROJECT COLOURS
   ========================= */

.hub-project-card {
    --project-accent: var(--hub-accent);
    border-top: 4px solid var(--project-accent);
}

.hub-project-card:hover {
    border-color: var(--project-accent);
}

.hub-project-card .hub-project-progress-bar {
    background: var(--project-accent);
}

/* =========================
   HUB — PROJECT OPTIONS MENU
   ========================= */

.hub-project-options-menu[hidden] {
    display: none !important;
}

.hub-project-options-menu {
    position: absolute;
    top: 58px;
    right: 18px;
    z-index: 20;

    width: 205px;
    padding: 7px;

    border: 1px solid var(--hub-border);
    border-radius: 11px;

    background: var(--hub-surface);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.25);
}

.hub-project-option {
    display: block;
    width: 100%;
    padding: 11px 12px;

    border: 0;
    border-radius: 7px;

    background: transparent;
    color: var(--hub-text);

    font: inherit;
    font-size: 13px;
    text-align: left;
    cursor: pointer;
}

.hub-project-option:hover,
.hub-project-option:focus-visible {
    background: var(--hub-surface-soft);
}

.hub-project-option-danger {
    color: var(--hub-danger);
}

.hub-project-option-danger:hover,
.hub-project-option-danger:focus-visible {
    color: var(--hub-danger);
}

.hub-project-menu-button {
    z-index: 21;
}

/* =========================
   HUB — PROJECT COLOUR MODAL
   ========================= */

.hub-project-colour-backdrop[hidden] {
    display: none !important;
}

.hub-project-colour-backdrop {
    position: fixed;
    inset: 0;
    z-index: 2000;

    display: flex;
    align-items: center;
    justify-content: center;

    padding: 16px;
    background: rgba(0, 0, 0, 0.72);
}

.hub-project-colour-modal {
    width: min(460px, 100%);
    max-height: calc(100dvh - 32px);
    overflow-y: auto;

    padding: 28px;

    border: 1px solid var(--hub-border);
    border-radius: 16px;

    background: var(--hub-surface);
    color: var(--hub-text);

    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.hub-project-colour-modal h2 {
    margin: 0 0 10px;
    font-size: 21px;
}

.hub-project-colour-name {
    margin: 0 0 22px;
    color: var(--hub-text-soft);
    font-size: 14px;
}

#hubProjectColourInput {
    width: 68px;
    height: 42px;
    padding: 4px;

    border: 1px solid var(--hub-border);
    border-radius: 9px;

    background: var(--hub-surface-soft);
    cursor: pointer;
}

#hubProjectColourInput:focus-visible {
    outline: 2px solid var(--hub-accent);
    outline-offset: 3px;
}

.hub-project-colour-preview {
    margin-top: 22px;
    padding: 16px;

    border: 1px solid var(--hub-border);
    border-radius: 10px;

    background: var(--hub-surface-soft);
}

.hub-project-colour-preview span {
    display: block;
    margin-bottom: 12px;

    color: var(--hub-text-soft);
    font-size: 12px;
    font-weight: 700;
}

#hubProjectColourSwatch {
    height: 12px;
    border-radius: 999px;
    background: var(--hub-accent);
}

#hubProjectColourMessage {
    min-height: 18px;
    margin: 12px 0 0;

    color: var(--hub-text-soft);
    font-size: 12px;
}

.hub-project-colour-modal .hub-modal-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 22px;
}

@media (max-width: 480px) {
    .hub-project-colour-modal {
        padding: 20px;
    }
}

/* HUB — PROJECT COVER IMAGES */

.hub-project-cover-image {
    display: block;
    width: 100%;
    height: auto;
    object-position: center;
    border-radius: 10px;
    margin: 12px 0 16px;
    background: rgba(128, 128, 128, 0.08);
}

/* =========================
   BUG REPORT MODAL
   ========================= */
  

.bug-report-modal {
    position: fixed;
    inset: 0;
    z-index: 10000;

    display: none;
    align-items: center;
    justify-content: center;

    padding: 24px;
    background: rgba(0, 0, 0, 0.65);
}

.bug-report-modal.open {
    display: flex;
}

.bug-report-panel {
    width: 100%;
    max-width: 520px;

    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 14px;

    overflow: hidden;
}

.bug-report-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;

    padding: 22px 24px 18px;
    border-bottom: 1px solid var(--border);
}

.bug-report-header h2 {
    margin: 0 0 6px;
    font-size: 20px;
    color: var(--text);
}

.bug-report-header p {
    margin: 0;
    font-size: 13px;
    line-height: 1.5;
    color: var(--muted);
}

.bug-report-close {
    flex: 0 0 auto;

    border: none;
    background: transparent;
    color: var(--muted);

    font-size: 26px;
    line-height: 1;

    cursor: pointer;
}

.bug-report-close:hover {
    color: var(--text);
}

.bug-report-body {
    padding: 22px 24px;
}

.bug-report-field + .bug-report-field {
    margin-top: 18px;
}

.bug-report-field label {
    display: block;
    margin-bottom: 7px;

    font-size: 13px;
    font-weight: 600;
    color: var(--text);
}

.bug-report-field label span {
    font-weight: 400;
    color: var(--muted);
}

.bug-report-field input,
.bug-report-field textarea {
    width: 100%;
    box-sizing: border-box;

    padding: 11px 12px;

    background: var(--background);
    border: 1px solid var(--border);
    border-radius: 8px;

    color: var(--text);
    font-family: inherit;
    font-size: 14px;
}

.bug-report-field textarea {
    resize: vertical;
    min-height: 130px;
}

.bug-report-field input:focus,
.bug-report-field textarea:focus {
    outline: none;
    border-color: var(--accent);
}

.bug-report-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;

    padding: 16px 24px 22px;
}

.bug-report-cancel,
.bug-report-send {
    padding: 9px 16px;

    border-radius: 8px;

    font-family: inherit;
    font-size: 13px;
    font-weight: 600;

    cursor: pointer;
}

.bug-report-cancel {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text);
}

.bug-report-send {
    border: 1px solid var(--accent);
    background: var(--accent);
    color: var(--on-accent);
}

/* =========================
   WHAT'S NEW MODAL
   ========================= */

.whats-new-modal {
    position: fixed;
    inset: 0;
    z-index: 10000;

    display: none;
    align-items: center;
    justify-content: center;

    padding: 24px;
    background: rgba(0, 0, 0, 0.65);
}

.whats-new-modal.open {
    display: flex;
}

.whats-new-panel {
    width: 100%;
    max-width: 560px;
    max-height: 80vh;

    display: flex;
    flex-direction: column;

    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 14px;

    overflow: hidden;
}

.whats-new-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;

    padding: 22px 24px 18px;
    border-bottom: 1px solid var(--border);
}

.whats-new-header h2 {
    margin: 0 0 6px;
    font-size: 20px;
    color: var(--text);
}

.whats-new-header p {
    margin: 0;
    font-size: 13px;
    line-height: 1.5;
    color: var(--muted);
}

.whats-new-close {
    flex: 0 0 auto;

    border: none;
    background: transparent;
    color: var(--muted);

    font-size: 26px;
    line-height: 1;

    cursor: pointer;
}

.whats-new-close:hover {
    color: var(--text);
}

.whats-new-body {
    padding: 22px 24px;
    overflow-y: auto;
}

.whats-new-loading,
.whats-new-empty {
    margin: 0;
    font-size: 14px;
    color: var(--muted);
}

.whats-new-entry {
    padding: 0 0 20px;
}

.whats-new-entry + .whats-new-entry {
    padding-top: 20px;
    border-top: 1px solid var(--border);
}

.whats-new-entry:last-child {
    padding-bottom: 0;
}

.whats-new-date {
    margin-bottom: 5px;

    font-size: 12px;
    font-weight: 600;
    color: var(--muted);
}

.whats-new-title {
    margin: 0 0 8px;

    font-size: 16px;
    color: var(--text);
}

.whats-new-message {
    margin: 0;

    font-size: 14px;
    line-height: 1.6;
    color: var(--text);

    white-space: pre-wrap;
}

.whats-new-actions {
    display: flex;
    justify-content: flex-end;

    padding: 16px 24px 22px;
    border-top: 1px solid var(--border);
}

.whats-new-done {
    padding: 9px 16px;

    border: 1px solid var(--accent);
    border-radius: 8px;

    background: var(--accent);
    color: var(--on-accent);

    font-family: inherit;
    font-size: 13px;
    font-weight: 600;

    cursor: pointer;
}

/* =========================
   WHAT'S NEW ADMIN
   ========================= */

.whats-new-admin {
    padding: 18px 24px;
    border-bottom: 1px solid var(--border);
    background: var(--background);
}

.whats-new-admin[hidden] {
    display: none;
}

.whats-new-admin-field + .whats-new-admin-field {
    margin-top: 14px;
}

.whats-new-admin-field label {
    display: block;
    margin-bottom: 7px;

    font-size: 13px;
    font-weight: 600;
    color: var(--text);
}

.whats-new-admin-field input,
.whats-new-admin-field textarea {
    width: 100%;
    box-sizing: border-box;

    padding: 10px 12px;

    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;

    color: var(--text);
    font-family: inherit;
    font-size: 14px;
}

.whats-new-admin-field textarea {
    resize: vertical;
    min-height: 90px;
}

.whats-new-admin-field input:focus,
.whats-new-admin-field textarea:focus {
    outline: none;
    border-color: var(--accent);
}

.whats-new-admin-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 14px;
}

.whats-new-publish {
    padding: 9px 16px;

    border: 1px solid var(--accent);
    border-radius: 8px;

    background: var(--accent);
    color: var(--on-accent);

    font-family: inherit;
    font-size: 13px;
    font-weight: 600;

    cursor: pointer;
}

.whats-new-publish:disabled {
    opacity: 0.6;
    cursor: default;
}

/* =========================
   HUB — ACCOUNT PANEL
   ========================= */

.hub-account-section {
    padding: 22px 0;
    border-top: 1px solid var(--hub-border);
}

.hub-account-section h3 {
    margin: 0 0 10px;
    color: var(--hub-text);
    font-size: 17px;
    font-weight: 700;
}

.hub-account-section p {
    margin: 0 0 18px;
    color: var(--hub-text-soft);
    font-size: 14px;
    line-height: 1.65;
}

.hub-account-section .hub-button {
    min-height: 42px;
}

/* Hub overview - single column on mobile */

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

/* HUB RESPONSIVE CARD FIX */
@media (min-width: 701px) and (max-width: 1250px) {
    .hub-overview-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

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

/* =========================
   SANDBOX HUB COUNTDOWN
   ========================= */

.hub-sidebar .sandbox-timer {
    display: flex;
    flex-direction: column;
    gap: 5px;
    margin: 0 0 22px;
    padding: 12px 14px;
    border: 1px solid var(--hub-border);
    border-radius: 10px;
    background: var(--hub-surface);
}

.hub-sidebar .sandbox-timer-label {
    color: var(--hub-orange);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.1em;
}

.hub-sidebar .sandbox-timer-time {
    color: var(--hub-text-soft);
    font-size: 13px;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}
#hubMessageModal:not([hidden]) { z-index: 11000; }
