:root {
    --io-navy: #001f3f;
    --io-navy-dark: #00152b;
    --io-navy-soft: #0b3156;
    --io-blue: #0759ad;
    --io-blue-hover: #064b91;
    --io-blue-light: #eaf3fd;
    --io-blue-border: #8db6e1;
    --io-page: #f2f4f6;
    --io-surface: #fff;
    --io-border: #ccd3db;
    --io-border-light: #e2e6ea;
    --io-text: #20252b;
    --io-success: #278636;
    --io-success-light: #edf8ef;
    --io-warning: #eaa51f;
    --io-warning-light: #fff9e9;
    --io-shadow: 0 6px 22px rgb(0 25 53 / 12%);
}

.io-page {
    min-height: 100vh;
    padding: 24px;
    color: var(--io-text);
    background: var(--io-page);
    font-family: Inter, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

.io-workspace {
    width: min(1460px, 100%);
    margin: 0 auto;
    overflow: hidden;
    background: var(--io-surface);
    border: 1px solid #d7dce1;
    border-radius: 3px;
    box-shadow: var(--io-shadow);
}

.io-topbar {
    min-height: 62px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding: 0 18px;
    color: #fff;
    background: linear-gradient(100deg, var(--io-navy-dark), var(--io-navy) 58%, #002b55);
}

.io-brand {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    color: #fff;
}

    .io-brand:hover {
        color: #fff;
    }

.io-logo-mark {
    position: relative;
    display: grid;
    width: 32px;
    height: 32px;
    place-items: center;
    color: #dcecff;
    font-size: 28px;
}

    .io-logo-mark::after {
        position: absolute;
        width: 10px;
        height: 10px;
        content: "";
        background: var(--io-blue);
        border: 2px solid #fff;
        border-radius: 50%;
    }

.io-brand-text {
    display: flex;
    flex-direction: column;
    line-height: .92;
    letter-spacing: .08em;
}

    .io-brand-text strong {
        font-size: .82rem;
    }

    .io-brand-text small {
        margin-top: 4px;
        font-size: .67rem;
    }

.io-page-title {
    padding-left: 20px;
    font-size: 1rem;
    font-weight: 650;
    border-left: 1px solid rgb(255 255 255 / 28%);
}

.io-header-actions {
    display: flex;
    align-items: stretch;
    align-self: stretch;
}

.io-header-link,
.io-user-button {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 0 14px;
    color: rgb(255 255 255 / 92%);
    font-size: .78rem;
    text-decoration: none;
    background: transparent;
    border: 0;
}

    .io-header-link:hover,
    .io-user-button:hover {
        color: #fff;
        background: rgb(255 255 255 / 9%);
    }

.io-stepper {
    display: grid;
    grid-template-columns: repeat(8, minmax(125px, 1fr));
    overflow-x: auto;
    background: #f7f8f9;
    border-bottom: 1px solid var(--io-border);
}

.io-step {
    min-height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 7px 15px;
    color: #6e757d;
    white-space: nowrap;
    background: transparent;
    border: 0;
    border-right: 1px solid #e0e4e8;
    font-size: .73rem;
    font-weight: 600;
}

.io-step-number {
    display: inline-grid;
    width: 23px;
    height: 23px;
    place-items: center;
    color: #fff;
    background: #b8bec5;
    border-radius: 50%;
    font-size: .72rem;
}

.io-step.active {
    color: var(--io-navy);
    background: #fff;
}

    .io-step.active .io-step-number {
        background: var(--io-navy);
    }

.io-step.complete .io-step-number {
    background: var(--io-success);
}

.io-panel {
    margin-bottom: 8px;
    overflow: hidden;
    background: #fff;
    border: 1px solid var(--io-border);
    border-radius: 3px;
}

.io-panel-heading {
    min-height: 34px;
    display: flex;
    align-items: center;
    gap: 5px;
    margin: 0;
    padding: 7px 11px;
    color: #fff;
    background: linear-gradient(90deg, var(--io-navy), var(--io-navy-soft));
    font-size: .79rem;
    font-weight: 750;
    letter-spacing: .015em;
    text-transform: uppercase;
}

.io-panel-body {
    padding: 11px;
}

.io-panel .form-label,
.io-panel legend.form-label {
    margin-bottom: 4px;
    color: #343a40;
    font-size: .7rem;
    font-weight: 650;
}

.io-panel .form-control,
.io-panel .form-select {
    color: var(--io-text);
    border-color: var(--io-border);
    border-radius: 2px;
}

.io-panel .form-control-sm,
.io-panel .form-select-sm {
    min-height: 31px;
    font-size: .76rem;
}

.io-panel .form-control:focus,
.io-panel .form-select:focus,
.io-panel .form-check-input:focus {
    border-color: var(--io-blue-border);
    box-shadow: 0 0 0 .18rem rgb(7 89 173 / 16%);
}

.io-panel .form-check-input:checked {
    background-color: var(--io-blue);
    border-color: var(--io-blue);
}

.io-panel .btn {
    border-radius: 2px;
}

.io-panel .btn-outline-primary {
    color: var(--io-blue);
    border-color: var(--io-blue-border);
}

.io-panel .btn-check:checked + .btn-outline-primary {
    color: var(--io-navy);
    background-color: var(--io-blue-light);
    border-color: var(--io-blue);
}

.io-instruction {
    display: flex;
    align-items: flex-start;
    gap: 9px;
    padding: 10px;
    color: #574718;
    background: var(--io-warning-light);
    border: 1px solid #efd991;
    border-radius: 2px;
    font-size: .72rem;
}

    .io-instruction i {
        color: var(--io-warning);
        font-size: 1rem;
    }

.io-choice-grid {
    display: grid;
    gap: 7px;
}

.io-choice-grid-6 {
    grid-template-columns: repeat(6, minmax(70px, 1fr));
}

.io-choice-grid-7 {
    grid-template-columns: repeat(7, minmax(58px, 1fr));
}

.io-visual-choice,
.io-shape-choice {
    min-height: 88px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 7px;
    padding: 8px 5px;
    color: #353a40;
    text-align: center;
    cursor: pointer;
    background: #fff;
    border: 1px solid var(--io-border);
    border-radius: 3px;
    font-size: .65rem;
    line-height: 1.2;
}

.io-shape-choice {
    min-height: 80px;
}

.btn-check:checked + .io-visual-choice,
.btn-check:checked + .io-shape-choice {
    color: var(--io-navy);
    background: var(--io-blue-light);
    border-color: var(--io-blue);
}

.io-die-icon {
    position: relative;
    width: 45px;
    height: 28px;
    display: block;
    background: linear-gradient(180deg, #e6e9ec, #aeb5bc 52%, #dce0e4);
    border: 1px solid #828a93;
    border-radius: 50% / 24%;
    box-shadow: inset 0 4px 4px rgb(255 255 255 / 50%), 0 2px 2px rgb(0 0 0 / 12%);
}

    .io-die-icon::before {
        position: absolute;
        inset: 7px 13px;
        content: "";
        background: #5e646b;
        border: 1px solid #454a50;
        border-radius: 50%;
    }

.die-split {
    background: linear-gradient(90deg, #bcc3ca 0 47%, #386fa5 47% 53%, #bcc3ca 53%);
}

.die-cap {
    height: 22px;
}

.die-base {
    height: 24px;
}

.die-ring {
    width: 48px;
    height: 23px;
}

.die-other {
    width: 22px;
    height: 38px;
    border-radius: 5px;
}

    .die-other::before {
        inset: 8px 6px;
    }

.io-shape {
    width: 27px;
    height: 27px;
    display: grid;
    place-items: center;
    background: #f4f5f6;
    border: 1.5px solid #4c555e;
}

.shape-round {
    border-radius: 50%;
}

.shape-hex {
    background: var(--io-blue);
    border-color: var(--io-blue);
    clip-path: polygon(25% 7%, 75% 7%, 100% 50%, 75% 93%, 25% 93%, 0 50%);
}

.shape-square {
    width: 24px;
    height: 24px;
}

.shape-octagon {
    clip-path: polygon(30% 0,70% 0,100% 30%,100% 70%,70% 100%,30% 100%,0 70%,0 30%);
}

.shape-radius {
    border-radius: 7px;
}

.shape-custom {
    clip-path: polygon(50% 0,66% 21%,92% 20%,88% 49%,100% 70%,72% 78%,56% 100%,35% 80%,7% 84%,13% 54%,0 31%,29% 23%);
}

.shape-question {
    color: #777;
    background: transparent;
    border: 0;
    font-size: 2rem;
    font-weight: 700;
}

.io-radio-list {
    display: grid;
    gap: 5px;
}

    .io-radio-list .form-check {
        min-height: 22px;
        margin: 0;
        font-size: .72rem;
    }

.io-field-section {
    margin-top: 10px;
    padding-top: 9px;
    border-top: 1px solid var(--io-border-light);
}

.io-recommendation {
    display: grid;
    grid-template-columns: 43% 57%;
    margin-top: 12px;
    background: #f7f9fb;
    border: 1px solid var(--io-border);
    border-radius: 2px;
}

    .io-recommendation > div {
        padding: 10px;
    }

        .io-recommendation > div:first-child {
            border-right: 1px solid var(--io-border);
        }

    .io-recommendation small {
        display: block;
        color: #4f6d8e;
        font-size: .64rem;
        font-weight: 650;
    }

    .io-recommendation strong {
        display: block;
        margin-top: 3px;
        color: var(--io-blue);
        font-size: 1.45rem;
    }

.io-recommendation-detail {
    display: flex;
    justify-content: center;
    flex-direction: column;
    gap: 2px;
    font-size: .68rem;
}

.io-question-row {
    min-height: 43px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 7px 0;
    border-bottom: 1px solid var(--io-border-light);
    font-size: .7rem;
}

.io-question-stack {
    align-items: flex-start;
    flex-direction: column;
}

.io-inline-answer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 6px;
}

    .io-inline-answer .form-check {
        margin-right: 0;
        padding-left: 1.4rem;
        white-space: nowrap;
    }

.io-code-badge {
    min-width: 27px;
    padding: 4px;
    color: #606870;
    text-align: center;
    background: #f5f6f7;
    border: 1px solid var(--io-border);
    border-radius: 2px;
    font-size: .62rem;
    font-weight: 700;
}

.io-code-wide {
    min-width: 39px;
}

.io-price-table {
    font-size: .67rem;
}

    .io-price-table th {
        padding: 9px 10px;
        color: #59616a;
        background: #fafbfc;
        font-weight: 650;
    }

    .io-price-table td {
        padding: 8px 10px;
        vertical-align: middle;
    }

.io-total {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 13px 10px;
    border-top: 1px solid var(--io-border);
    font-size: .8rem;
    font-weight: 750;
    text-transform: uppercase;
}

    .io-total strong {
        color: var(--io-success);
        font-size: 1.45rem;
    }

.io-complete-message {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 10px;
    color: var(--io-success);
    background: var(--io-success-light);
    border-top: 1px solid #cce8d2;
    font-size: .71rem;
}

.io-actionbar {
    display: flex;
    align-items: center;
    padding: 0;
    background: #fafbfc;
    border-top: 1px solid var(--io-border);
    gap: 0;
}

    .io-actionbar .btn {
        min-width: 75px;
        flex: 0 0 calc(25% - 0.5rem);
        margin: 0;
        padding: 8px 12px;
        border-radius: 0;
    }

.action-button {
    flex: 0 0 calc(25% - 0.5rem);
    min-width: auto;
    white-space: nowrap;
    padding: 8px 12px;
    margin: 0;
    border-radius: 0;
}

.cancel-button {
    background-color: var(--io-blue-light);
    border-color: var(--io-blue);
    color: var(--io-navy);
}

.cancel-button:hover {
    background-color: var(--io-blue-light);
    border-color: var(--io-blue);
    color: var(--io-navy);
}

.save-draft-button {
    background-color: #d4edda;
    border-color: #c3e6cb;
    color: #155724;
}

.save-draft-button:hover {
    background-color: #d4edda;
    border-color: #c3e6cb;
    color: #155724;
}

.io-next-button {
    min-width: 105px !important;
}

.validation-message {
    display: block;
    margin-top: 2px;
    color: #b42318;
    font-size: .65rem;
}

@media (max-width: 1199.98px) {
    .io-choice-grid-6 {
        grid-template-columns: repeat(3, 1fr);
    }

    .io-choice-grid-7 {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (max-width: 767.98px) {
    .io-page {
        padding: 0;
    }

    .io-workspace {
        border: 0;
        border-radius: 0;
        box-shadow: none;
    }

    .io-topbar {
        align-items: flex-start;
        flex-direction: column;
        padding: 12px;
    }

    .io-header-actions {
        width: 100%;
        overflow-x: auto;
    }

    .io-header-link, .io-user-button {
        min-height: 38px;
        padding: 0 10px;
    }

    .io-choice-grid-7 {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 479.98px) {
    .io-choice-grid-6, .io-choice-grid-7 {
        grid-template-columns: repeat(2, 1fr);
    }

    .io-question-row {
        align-items: flex-start;
        flex-direction: column;
    }

    .io-inline-answer {
        width: 100%;
        justify-content: flex-start;
    }

    .io-actionbar {
        align-items: stretch;
        flex-direction: column;
        gap: 8px;
    }

        .io-actionbar .ms-auto {
            width: 100%;
            margin-left: 0 !important;
        }

            .io-actionbar .ms-auto .btn {
                flex: 1;
            }
}

/* ============================================
   NAVBAR STYLING
   ============================================ */

.io-navbar {
    background: linear-gradient(100deg, var(--io-navy-dark), var(--io-navy) 58%, #002b55);
    color: #fff;
    padding: 0;
    border-bottom: 2px solid var(--io-blue);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.io-navbar-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    max-width: 1460px;
    margin: 0 auto;
    padding: 0 24px;
    min-height: 64px;
}

.io-navbar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: inherit;
    font-weight: 600;
    flex-shrink: 0;
}

.io-logo {
    width: 32px;
    height: 32px;
    stroke-width: 2;
    color: var(--io-blue-light);
}

.io-brand-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.io-brand-label {
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 1px;
    color: var(--io-blue-light);
}

.io-brand-tagline {
    font-size: 0.9rem;
    font-weight: 600;
    color: #fff;
}

.io-navbar-menu {
    display: flex;
    align-items: center;
    gap: 2px;
    list-style: none;
    margin: 0;
    padding: 0;
    flex: 1;
}

.io-nav-link {
    display: flex;
    align-items: center;
    padding: 8px 16px;
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    border-radius: 4px;
    transition: all 0.2s;
}

.io-nav-link:hover {
    color: #fff;
    background-color: rgba(7, 89, 173, 0.2);
}

.io-nav-link.active {
    color: #fff;
    background-color: var(--io-blue);
    font-weight: 600;
}

.io-navbar-end {
    display: flex;
    align-items: center;
    gap: 16px;
}

.io-user-menu {
    position: relative;
}

.io-user-button {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    background-color: rgba(255, 255, 255, 0.1);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.2s;
}

.io-user-button:hover {
    background-color: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.3);
}

.io-user-button i {
    font-size: 1.2rem;
}

.io-dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 8px;
    min-width: 200px;
    background: var(--io-surface);
    color: var(--io-text);
    border: 1px solid var(--io-border);
    border-radius: 4px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    overflow: hidden;
}

.io-dropdown-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: var(--io-text);
    text-decoration: none;
    font-size: 0.9rem;
    background: none;
    border: none;
    cursor: pointer;
    width: 100%;
    text-align: left;
    transition: background-color 0.2s;
}

.io-dropdown-item:hover {
    background-color: var(--io-blue-light);
}

.io-dropdown-item i {
    font-size: 0.95rem;
    color: var(--io-blue);
}

.io-dropdown-logout {
    color: #dc3545;
}

.io-dropdown-logout:hover {
    background-color: #fff5f5;
}

.io-dropdown-logout i {
    color: #dc3545;
}

.io-dropdown-divider {
    margin: 4px 0;
    border: none;
    border-top: 1px solid var(--io-border);
}

.io-auth-links {
    display: flex;
    align-items: center;
    gap: 12px;
}

.io-link-button {
    padding: 8px 16px;
    color: #fff;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 4px;
    transition: all 0.2s;
}

.io-link-button:hover {
    background-color: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.5);
}

.io-link-button-primary {
    background-color: var(--io-blue);
    border-color: var(--io-blue);
}

.io-link-button-primary:hover {
    background-color: var(--io-blue-hover);
    border-color: var(--io-blue-hover);
}

@media (max-width: 768px) {
    .io-navbar-container {
        flex-wrap: wrap;
        padding: 12px 16px;
    }

    .io-navbar-menu {
        flex-basis: 100%;
        gap: 0;
        order: 3;
    }

    .io-nav-link {
        padding: 8px 12px;
        font-size: 0.85rem;
    }

    .io-brand-label {
        font-size: 0.65rem;
    }

    .io-brand-tagline {
        font-size: 0.8rem;
    }

    .io-navbar-end {
        order: 2;
    }
}

/* Login Page Styling */
.io-page {
    min-height: 100vh;
    background: linear-gradient(135deg, var(--io-navy-dark) 0%, var(--io-navy) 50%, #00396b 100%);
}

.io-workspace {
    background: var(--io-surface);
    border: 1px solid #d7dce1;
    border-radius: 3px;
    box-shadow: var(--io-shadow);
}

@media (max-width: 768px) {
    .io-page {
        padding: 12px;
    }
}

/* ═══════════════════════════════════════════════════════════
   Login Page Styles
   ═══════════════════════════════════════════════════════════ */

.login-container {
    max-width: 400px;
    margin: 50px auto;
    padding: 20px;
    border: 1px solid #ddd;
    border-radius: 5px;
}

.login-container h2 {
    text-align: center;
    color: var(--io-text);
    margin-bottom: 20px;
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
    color: var(--io-text);
}

.form-group input {
    width: 100%;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 3px;
    box-sizing: border-box;
    font-size: 14px;
}

.form-group input:focus {
    outline: none;
    border-color: var(--io-blue);
    box-shadow: 0 0 0 3px rgba(7, 89, 173, 0.1);
}

.btn {
    width: 100%;
    padding: 10px;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 500;
    transition: background-color 0.2s ease;
}

.btn-primary {
    background-color: var(--io-blue);
    color: white;
}

.btn-primary:hover:not(:disabled) {
    background-color: var(--io-blue-hover);
}

.btn:disabled {
    background-color: #ccc;
    cursor: not-allowed;
    opacity: 0.6;
}

.alert {
    padding: 12px;
    margin-bottom: 15px;
    border: 1px solid transparent;
    border-radius: 4px;
    font-size: 14px;
}

.alert-success {
    color: #155724;
    background-color: #d4edda;
    border-color: #c3e6cb;
}

.alert-danger {
    color: #721c24;
    background-color: #f8d7da;
    border-color: #f5c6cb;
}

/* QuickGrid Styling - Consistent grid appearance across the application */

/* Maintain consistent cell height for grid rows */
.search-grid-consistent tbody tr {
    height: 2.5rem;
}

/* The class sits on the table itself, so the cells are targeted directly rather
   than through a nested table. */
.search-grid-consistent tbody td,
.search-grid-consistent thead th {
    padding: 0.5rem 0.75rem;
    vertical-align: middle;
}

/* Caps the results grid body and scrolls beyond that. */
.search-grid-scroll {
    max-height: 345px;
    overflow-y: auto;
}

/* Sized just wider than the icon itself and centred on its own glyph so the
   button lines up with the middle of the row. */
.grid-remove-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.5rem;
    height: 1.5rem;
    padding: 0;
    /* An inline-flex button still sits on the text baseline, which pushes it below
       the middle of the row. */
    vertical-align: middle;
}

    /* Focus adds a box-shadow and can swap the border colour, which changes the
       button's outer metrics unless the box model and border width are pinned. */
    .grid-remove-button,
    .grid-remove-button:focus,
    .grid-remove-button:focus-visible,
    .grid-remove-button:active,
    .grid-remove-button:hover {
        box-sizing: border-box;
        border-width: 1px;
        line-height: 1;
        outline: 0;
    }

    /* Bootstrap icons ship with vertical-align: -.125em on the ::before pseudo
       element, which drops the glyph below centre. */
    .grid-remove-button i {
        display: block;
        line-height: 1;
    }

        .grid-remove-button i::before {
            display: block;
            vertical-align: 0;
            line-height: 1;
        }

/* Keeps the column headers visible while the rows scroll underneath. */
    .search-grid-scroll thead th {
        position: sticky;
        top: 0;
        z-index: 1;
        background-color: #fff;
    }

/* QuickGrid pagination styling */
.pagination {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.pagination .page-item {
    display: inline-block;
}

.pagination .page-link {
    display: inline-block;
    padding: 0.375rem 0.75rem;
    margin-right: 0.25rem;
    color: #0d6efd;
    background-color: #ffffff;
    border: 1px solid #dee2e6;
    border-radius: 0.25rem;
    cursor: pointer;
    text-decoration: none;
}

.pagination .page-link:hover {
    color: #0b5ed7;
    background-color: #f8f9fa;
}

.pagination .page-item.disabled .page-link {
    color: #6c757d;
    pointer-events: none;
    background-color: #f8f9fa;
    border-color: #dee2e6;
    cursor: not-allowed;
    opacity: 0.5;
}

.pagination .page-item.active .page-link {
    color: #ffffff;
    background-color: #0d6efd;
    border-color: #0d6efd;
    cursor: default;
}

/* Paginator button styling - these are generated as <button> elements */
.pagination button {
    display: inline-block;
    padding: 0.375rem 0.75rem;
    margin-right: 0.25rem;
    color: #0d6efd;
    background-color: #ffffff;
    border: 1px solid #dee2e6;
    border-radius: 0.25rem;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
}

.pagination button:hover:not(:disabled) {
    color: #0b5ed7;
    background-color: #f8f9fa;
}

.pagination button:disabled {
    color: #6c757d;
    background-color: #f8f9fa;
    border-color: #dee2e6;
    cursor: not-allowed;
    opacity: 0.5;
}

/* For span elements representing current page or disabled states */
.pagination span {
    display: inline-block;
    padding: 0.375rem 0.75rem;
    margin-right: 0.25rem;
    color: #ffffff;
    background-color: #0d6efd;
    border: 1px solid #0d6efd;
    border-radius: 0.25rem;
    cursor: default;
}

/* ====================================
   DASHBOARD STYLES
   ==================================== */

.dashboard-container {
    padding: 2rem;
    background: var(--io-page);
}

.dashboard-header {
    margin-bottom: 2rem;
}

.dashboard-header h1 {
    font-size: 2rem;
    font-weight: 600;
    color: var(--io-text);
    margin-bottom: 0.25rem;
}

/* Metrics Section */
.metrics-section {
    margin-bottom: 2rem;
}

.metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
}

.metric-card {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    padding: 1.5rem;
    background: var(--io-surface);
    border-radius: 0.5rem;
    border-left: 4px solid;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    transition: transform 0.2s, box-shadow 0.2s;
}

.metric-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

.metric-card.open-jobs {
    border-left-color: #0759ad;
    background: linear-gradient(135deg, #f0f5fb 0%, #fff 100%);
}

.metric-card.dies-production {
    border-left-color: #278636;
    background: linear-gradient(135deg, #f0faf2 0%, #fff 100%);
}

.metric-card.ready-ship {
    border-left-color: #c945d0;
    background: linear-gradient(135deg, #faf5fc 0%, #fff 100%);
}

.metric-card.alerts {
    border-left-color: #d9482f;
    background: linear-gradient(135deg, #fcf5f4 0%, #fff 100%);
}

.metric-icon {
    font-size: 2rem;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 0.375rem;
}

.metric-card.open-jobs .metric-icon {
    color: #0759ad;
    background: rgba(7, 89, 173, 0.1);
}

.metric-card.dies-production .metric-icon {
    color: #278636;
    background: rgba(39, 134, 54, 0.1);
}

.metric-card.ready-ship .metric-icon {
    color: #c945d0;
    background: rgba(201, 69, 208, 0.1);
}

.metric-card.alerts .metric-icon {
    color: #d9482f;
    background: rgba(217, 72, 47, 0.1);
}

.metric-content {
    flex: 1;
}

.metric-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--io-text);
    line-height: 1;
    margin-bottom: 0.35rem;
}

.metric-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: #666;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    margin-bottom: 0.5rem;
}

.metric-link {
    font-size: 0.875rem;
    color: #0759ad;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
}

.metric-link:hover {
    color: #064b91;
}

/* Dashboard Content */
.dashboard-content {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

@media (max-width: 1200px) {
    .dashboard-content {
        grid-template-columns: 1fr;
    }
}

/* Content Sections */
.content-section {
    background: var(--io-surface);
    border-radius: 0.5rem;
    padding: 1.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    border-bottom: 2px solid var(--io-border-light);
    padding-bottom: 1rem;
}

.section-header h2 {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--io-text);
    margin: 0;
    letter-spacing: 0.025em;
}

.view-all-link {
    font-size: 0.875rem;
    color: #0759ad;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
}

.view-all-link:hover {
    color: #064b91;
}

/* Active Production Table */
.table-responsive {
    overflow-x: auto;
}

.active-production table {
    margin-bottom: 0;
}

.active-production table thead th {
    background: #f8f9fa;
    border-bottom: 2px solid var(--io-border-light);
    font-size: 0.875rem;
    font-weight: 600;
    color: #666;
    padding: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

.active-production table tbody tr {
    border-bottom: 1px solid var(--io-border-light);
    transition: background-color 0.2s;
}

.active-production table tbody tr:hover {
    background-color: #f8f9fa;
}

.active-production table tbody td {
    padding: 0.75rem;
    vertical-align: middle;
}

.job-link {
    color: #0759ad;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
}

.job-link:hover {
    color: #064b91;
    text-decoration: underline;
}

.badge {
    display: inline-block;
    padding: 0.35rem 0.65rem;
    border-radius: 0.25rem;
    color: white;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

.due-date {
    color: #666;
    font-weight: 500;
}

.table-footer {
    padding: 0.75rem;
    border-top: 1px solid var(--io-border-light);
    text-align: right;
}

/* Recent Activity Timeline */
.activity-timeline {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.activity-item {
    display: grid;
    grid-template-columns: 70px 40px 1fr;
    gap: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--io-border-light);
}

.activity-item:last-child {
    border-bottom: none;
}

.activity-time {
    font-size: 0.75rem;
    color: #999;
    text-align: right;
    padding-top: 0.25rem;
    font-weight: 500;
}

.activity-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: #f0f5fb;
    border-radius: 50%;
    color: #0759ad;
    font-size: 0.875rem;
}

.activity-details {
    flex: 1;
}

.activity-description {
    font-size: 0.9375rem;
    color: var(--io-text);
    margin-bottom: 0.25rem;
    font-weight: 500;
}

.activity-meta {
    font-size: 0.8125rem;
    color: #999;
    display: flex;
    gap: 0.75rem;
}

.job-ref {
    font-weight: 600;
    color: #0759ad;
}

.activity-by {
    color: #999;
}

/* ====================================
   SIDEBAR NAVIGATION STYLES
   ==================================== */

.layout-wrapper {
    display: flex;
    min-height: 100vh;
    background: var(--io-page);
}

.sidebar {
    width: 260px;
    background: var(--io-navy);
    color: white;
    display: flex;
    flex-direction: column;
    position: fixed;
    left: 0;
    top: 0;
    height: 100vh;
    box-shadow: 2px 0 8px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    overflow-y: auto;
    overflow-x: hidden;
}

/* Sidebar Brand Section */
.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    flex-shrink: 0;
}

.sidebar-logo {
    width: 48px;
    height: 48px;
    background: var(--io-blue);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 0.5rem;
    font-size: 1.5rem;
}

.sidebar-text {
    flex: 1;
    min-width: 0;
}

.sidebar-title {
    font-weight: 700;
    font-size: 0.875rem;
    letter-spacing: 0.05em;
    margin-bottom: 0.25rem;
}

.sidebar-subtitle {
    font-size: 0.6875rem;
    color: rgba(255, 255, 255, 0.7);
    line-height: 1.3;
    font-weight: 500;
}

/* Sidebar Navigation */
.sidebar-nav {
    flex: 1;
    padding: 1.5rem 0;
    overflow-y: auto;
}

.nav-menu {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.nav-item {
    margin: 0;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 0.875rem;
    padding: 0.75rem 1.25rem;
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    font-size: 0.9375rem;
    font-weight: 500;
    transition: all 0.2s ease;
    border-left: 3px solid transparent;
    white-space: nowrap;
}

.nav-link:hover {
    color: white;
    background: rgba(255, 255, 255, 0.1);
    border-left-color: var(--io-blue);
}

.nav-link.active {
    color: white;
    background: var(--io-blue-hover);
    border-left-color: #4ca3f7;
}

.nav-link i {
    font-size: 1.25rem;
    width: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.nav-label {
    flex: 1;
}

/* Sidebar Footer */
.sidebar-footer {
    padding: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    flex-shrink: 0;
}

.user-section {
    position: relative;
}

.user-button {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 0.375rem;
    color: white;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.user-button:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.3);
}

.user-button i {
    font-size: 1.5rem;
    flex-shrink: 0;
}

.user-info {
    flex: 1;
    min-width: 0;
    text-align: left;
}

.user-name {
    font-size: 0.8125rem;
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.user-status {
    font-size: 0.6875rem;
    color: rgba(255, 255, 255, 0.6);
}

.user-dropdown {
    position: absolute;
    bottom: 100%;
    left: 0;
    right: 0;
    background: var(--io-navy-soft);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 0.375rem;
    margin-bottom: 0.5rem;
    overflow: hidden;
    box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.2);
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
    padding: 0.75rem 1rem;
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.875rem;
    cursor: pointer;
    text-align: left;
    text-decoration: none;
    transition: all 0.2s ease;
}

.dropdown-item:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

.dropdown-item.logout-item:hover {
    color: #ff6b6b;
}

.dropdown-item i {
    width: 20px;
    flex-shrink: 0;
}

.dropdown-divider {
    margin: 0.5rem 0;
    border: none;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-login-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    background: var(--io-blue);
    border-radius: 0.375rem;
    color: white;
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.2s ease;
    width: 100%;
}

.sidebar-login-link:hover {
    background: var(--io-blue-hover);
}

/* Main Layout Content */
.layout-main {
    margin-left: 260px;
    flex: 1;
    min-width: 0;
}

.main-content {
    padding: 2rem;
    min-height: 100vh;
}

/* Responsive Design */
@media (max-width: 768px) {
    .sidebar {
        width: 220px;
    }

    .layout-main {
        margin-left: 220px;
    }

    .sidebar-brand {
        padding: 1rem;
    }

    .nav-link {
        padding: 0.625rem 1rem;
        font-size: 0.875rem;
    }
}

@media (max-width: 576px) {
    .sidebar {
        width: 70px;
        position: fixed;
    }

    .layout-main {
        margin-left: 70px;
    }

    .sidebar-brand {
        flex-direction: column;
        padding: 1rem 0.75rem;
        text-align: center;
        gap: 0.5rem;
    }

    .sidebar-text {
        display: none;
    }

    .nav-link {
        justify-content: center;
        padding: 0.75rem 0.5rem;
        gap: 0;
    }

    .nav-label {
        display: none;
    }

    .sidebar-footer {
        padding: 0.75rem 0.5rem;
    }

    .user-button {
        width: 50px;
        height: 50px;
        padding: 0.5rem;
    }

    .user-info {
        display: none;
    }

    .user-dropdown {
        position: fixed;
        bottom: auto;
        top: 70px;
        left: 0;
        right: auto;
        width: 200px;
        border-radius: 0;
        margin-bottom: 0;
    }
}

/* Sidebar Copyright Section */
.sidebar-copyright {
    padding: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    text-align: center;
    flex-shrink: 0;
}

.sidebar-copyright p {
    margin: 0;
    font-size: 0.6875rem;
    color: rgba(255, 255, 255, 0.5);
    line-height: 1.4;
    font-weight: 400;
}

.sidebar-copyright p:first-child {
    margin-bottom: 0.25rem;
}

@media (max-width: 576px) {
    .sidebar-copyright {
        padding: 0.75rem 0.5rem;
        font-size: 0.625rem;
    }

    .sidebar-copyright p {
        font-size: 0.625rem;
        line-height: 1.2;
    }
}

/* ====================================
   PURCHASE ORDER SEARCH SECTION
   ==================================== */

.po-search-section {
    display: flex;
    flex-direction: column;
    margin-bottom: 1.5rem;
}

.po-search-row {
    display: flex;
    gap: 1rem;
    align-items: start;
}

/* PO search field takes same width as Part Number field (50% of container) */
.po-search-field {
    flex: 0 0 calc(50% - 0.5rem);
    display: flex;
    align-items: center;
    position: relative;
}

/* Keeps the Due Date label on the same line as its input and centred against the
   input's height rather than the taller PO search field beside it. */
.due-date-field {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Button is half the width of Serial Number field (25% of container) and floats right */
.save-po-button {
    flex: 0 0 calc(25% - 0.5rem);
    white-space: nowrap;
    margin-left: auto;
}

/* ====================================
   SEARCH CONTROLS HORIZONTAL LAYOUT
   ==================================== */

.search-controls {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.search-field {
    display: flex;
    align-items: center;
    position: relative;
}

.search-input {
    flex: 1;
    padding: 0.625rem 1rem;
    padding-right: 2.75rem;
    border: 1px solid #dee2e6;
    border-radius: 0.375rem;
    font-size: 0.9375rem;
}

.search-input::placeholder {
    color: #999;
    font-weight: 500;
}

.search-input:focus {
    border-color: #0759ad;
    box-shadow: 0 0 0 0.2rem rgba(7, 89, 173, 0.1);
    outline: none;
}

.search-icon {
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.75rem;
    height: 100%;
}

.btn-search-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    padding: 0;
    border: none;
    background-color: transparent;
    color: #0759ad;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.2s ease;
}

.btn-search-icon:hover:not(:disabled) {
    color: #064b91;
    transform: scale(1.1);
}

.btn-search-icon:disabled {
    color: #ccc;
    cursor: not-allowed;
    opacity: 0.5;
}

.btn-search-icon .spinner-border {
    width: 1rem;
    height: 1rem;
}

@media (max-width: 768px) {
    .search-controls {
        flex-direction: column;
    }

    .search-field {
        width: 100%;
        min-width: unset;
    }
}

/* ====================================
   LOGIN LAYOUT STYLES
   ==================================== */

.login-layout-wrapper {
    display: flex;
    min-height: 100vh;
}

.login-layout-wrapper .sidebar-nav {
    display: none;
}

.login-layout-main {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    background: var(--io-page);
}

.login-layout-main .main-content {
    padding: 0;
    min-height: auto;
    width: 100%;
    max-width: 500px;
}

.login-layout-main .content {
    padding: 0;
}

/* ====================================
   TWO-FACTOR AUTHENTICATION STYLES
   ==================================== */

.qr-code-image {
    width: 220px;
    height: 220px;
}

.setup-key-text {
    letter-spacing: 2px;
}

.qr-code-max-width {
    max-width: 280px;
}

/* ====================================
   DASHBOARD STATUS BADGE STYLES
   ==================================== */

.status-badge-machining {
    background-color: #0d6efd; /* Blue */
}

.status-badge-edm {
    background-color: #fd7e14; /* Orange */
}

.status-badge-inspection {
    background-color: #6c757d; /* Gray */
}

.status-badge-assembly {
    background-color: #198754; /* Green */
}

.status-badge-default {
    background-color: #0d6efd; /* Blue */
}

/* ====================================
   REQUIRED FIELD STYLING
   ==================================== */

.form-control[required]:invalid:not(:placeholder-shown) {
    border: 2px solid #dc3545;
    border-radius: 0.375rem;
}

.clear-results-button {
    max-width: 12rem;
    margin-bottom: 4px;
}

/* ====================================
   SHIPPING ORDER PRINT PREVIEW
   ==================================== */

.so-overlay {
    position: fixed;
    inset: 0;
    z-index: 1080;
    overflow-y: auto;
    background-color: #52585d;
    padding: 1rem;
}

/* Sits at the foot of the sheet and scrolls with it rather than floating. */
.so-toolbar {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
    margin-top: 2rem;
    padding-top: 1.25rem;
    border-top: 1px solid #ced4da;
}

.so-sheet {
    max-width: 68rem;
    margin: 0 auto;
    padding: 2.25rem;
    background-color: #fff;
    color: #212529;
    box-shadow: 0 0.25rem 1rem rgba(0, 0, 0, 0.3);
}

.so-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    padding-bottom: 0.75rem;
    margin-bottom: 1.25rem;
    border-bottom: 2px solid #212529;
}

.so-title {
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.so-po {
    font-size: 1.05rem;
    font-weight: 600;
}

.so-due {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.so-due-label {
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #6c757d;
}

.so-due-value {
    font-size: 1.05rem;
    font-weight: 700;
}

.so-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.8rem;
}

    .so-table th,
    .so-table td {
        padding: 0.4rem 0.5rem;
        border: 1px solid #adb5bd;
        vertical-align: middle;
    }

    .so-table thead th {
        font-size: 0.72rem;
        font-weight: 700;
        line-height: 1.2;
        text-transform: uppercase;
        background-color: #e9ecef;
    }

    .so-table tbody tr:nth-child(even) {
        background-color: #f8f9fa;
    }

/* The line item holds a short number, so the column shrinks to the width of its
   own header and the space saved is handed to the remaining columns. */
.so-col-line {
    width: 1%;
    white-space: nowrap;
}

.so-col-cost {
    width: 5.5rem;
    white-space: nowrap;
}

/* The header wraps between the two phrases, and the column is sized to the longer
   of them so "New Die, New Insert," sets the width and the rest wraps beneath. */
.so-col-work {
    width: 1%;
}

    .so-col-work span {
        display: inline-block;
        white-space: nowrap;
    }

/* Part and serial numbers are kept on one line so they read as a single value. */
.so-col-part {
    white-space: nowrap;
    width: 1%;
}

.so-next-serial {
    white-space: nowrap;
}

.so-next-serial-label {
    font-weight: 600;
    text-transform: uppercase;
}

.so-next-serial-value {
    margin-left: 0.5rem;
    font-weight: 700;
}

.so-total-label {
    font-weight: 600;
    text-transform: uppercase;
}

.so-total-value {
    font-weight: 700;
}

.so-legend {
    margin-top: 1.5rem;
    padding-top: 0.75rem;
    border-top: 2px solid #212529;
}

.so-legend-title {
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.so-legend-items {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.25rem 1.5rem;
    font-size: 0.78rem;
}

.so-legend-code {
    display: inline-block;
    min-width: 2rem;
    font-weight: 700;
}

.so-legend-name {
    color: #495057;
}

/* Only the sheet itself is printed, so the page behind the overlay and the
   toolbar are dropped and the sheet is flattened onto the paper. */
@media print {
    body * {
        visibility: hidden;
    }

    .so-sheet,
    .so-sheet * {
        visibility: visible;
    }

    .so-overlay {
        position: static;
        padding: 0;
        overflow: visible;
        background-color: transparent;
    }

    .so-sheet {
        max-width: none;
        margin: 0;
        padding: 0;
        box-shadow: none;
    }

    .so-table {
        font-size: 0.7rem;
    }

        .so-table thead {
            display: table-header-group;
        }

        .so-table tr {
            break-inside: avoid;
        }

    .so-legend {
        break-inside: avoid;
    }
}

