/* site.css */

html {
    font-size: 12px;
    position: relative;
    min-height: 100%;
}

@media (min-width: 768px) {
    html {
        font-size: 16px;
    }
}

html,
body {
    background-color: #f5f5f5;
}

:root {
    --banner-height: 0px;
}

body.has-banner {
    --banner-height: 38px;
}

.banner {
    min-height: var(--banner-height);
    line-height: var(--banner-height);
    overflow: hidden;
}

body.has-banner .main-content {
    padding-top: var(--banner-height);
}

.main-content {
    background-color: #f5f5f5;
    min-height: 100vh;
}

/* Bootstrap focus styling */
.btn:focus,
.btn:active:focus,
.btn-link.nav-link:focus,
.form-control:focus,
.form-check-input:focus {
    box-shadow: 0 0 0 0.1rem #fff, 0 0 0 0.25rem #258cfb;
}

.instructions-container {
    background-color: #e7f3ff;
    border: 1px solid #b8daff;
    border-radius: 10px;
    color: #004085;
    margin: 10px;
    margin-bottom: 5px;
    padding: 8px
}

    .instructions-container h3 {
        font-size: 1.4rem;
    }

    .instructions-container p {
        font-size: 1rem;
        margin: 0;
    }

.banner {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background-color: #CEE8DD;
    color: #000;
    font-size: 1.6rem;
    padding: 0;
    text-align: center;
    z-index: 1045;
    border-bottom: 1px solid #b1ccc1;
}

.sidebar {
    z-index: 1030;
}

/* Desktop banner alignment with fixed sidebar */
@media (min-width: 769px) {
    .banner {
        left: 250px;
        width: calc(100% - 250px);
    }
}

/* =========================================================
   GLASSY INLINE BUTTONS
   ========================================================= */

/* =========================================================
   Inline Buttons
   Clean, lightly tinted buttons with subtle depth.
   ========================================================= */

.btnInline {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 8px 14px;
    margin-bottom: 0;
    border-radius: 12px;
    border: 1px solid var(--bi-border);
    font-weight: 650;
    letter-spacing: 0.18px;
    line-height: 1.4;
    text-decoration: none;
    /* Default button colour */
    --bi-color: #0d6efd;
    /* Subtle border based on the button colour */
    --bi-border: color-mix( in srgb, var(--bi-color) 28%, #d9dee5 );
    /* Very light colour tint in the normal state */
    --bi-bg-top: color-mix( in srgb, var(--bi-color) 5%, white );
    --bi-bg-bot: color-mix( in srgb, var(--bi-color) 2%, white );
    /* Slightly stronger tint on hover */
    --bi-hover-top: color-mix( in srgb, var(--bi-color) 12%, white );
    --bi-hover-bot: color-mix( in srgb, var(--bi-color) 7%, white );
    --bi-hover-border: color-mix( in srgb, var(--bi-color) 48%, white );
    --bi-on-hover: color-mix( in srgb, var(--bi-color) 82%, black );
    color: var(--bi-color);
    background: linear-gradient( to bottom, var(--bi-bg-top), var(--bi-bg-bot) );
    /*
     * Small neutral shadow rather than a coloured glow.
     * The inset highlight keeps a tiny bit of the glass/polished feel.
     */
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06), inset 0 1px 0 rgba(255, 255, 255, 0.60);
    cursor: pointer;
    transition: background .18s ease, border-color .18s ease, color .18s ease, box-shadow .18s ease, transform .06s ease-in;
}


/* Keep anchors and buttons visually identical */
a.btnInline,
button.btnInline {
    font-size: 0.9rem;
    line-height: 1.25;
    padding: 0.5rem 0.75rem;
    text-decoration: none;
    white-space: nowrap;
}


/* =========================================================
   Hover
   A little more colour and depth, without the glow.
   ========================================================= */

.btnInline:hover {
    background: linear-gradient( to bottom, var(--bi-hover-top), var(--bi-hover-bot) );
    color: var(--bi-on-hover);
    border-color: var(--bi-hover-border);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.09), inset 0 1px 0 rgba(255, 255, 255, 0.65);
    text-decoration: none;
}


/* =========================================================
   Keyboard Focus
   Keep focus visible for accessibility without using a glow.
   ========================================================= */

.btnInline:focus-visible {
    background: linear-gradient( to bottom, var(--bi-hover-top), var(--bi-hover-bot) );
    color: var(--bi-on-hover);
    border-color: var(--bi-hover-border);
    outline: 2px solid color-mix( in srgb, var(--bi-color) 45%, white );
    outline-offset: 2px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.65);
    text-decoration: none;
}


/* =========================================================
   Active / Clicked
   Tiny movement gives the button a physical pressed feel.
   ========================================================= */

.btnInline:active {
    transform: translateY(1px);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08), inset 0 1px 2px rgba(0, 0, 0, 0.04);
}


/* =========================================================
   Icons
   ========================================================= */

.btnInline i {
    font-size: 0.95em;
    opacity: 0.95;
}


/* =========================================================
   Disabled
   ========================================================= */

.btnInline:is([disabled], [aria-disabled="true"], .is-disabled, .disabled) {
    opacity: 0.55;
    pointer-events: none;
    cursor: not-allowed;
}

/* =========================================================
   GLASSY TOGGLE BUBBLE
   ========================================================= */

.btnInlinetoggle {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    user-select: none;
    padding: 8px 14px;
    border-radius: 999px;
    color: #0d6efd;
    text-decoration: none;
    font-weight: 600;
    letter-spacing: 0.2px;
    background: rgba(255, 255, 255, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.35);
    box-shadow: 0 8px 24px rgba(13, 110, 253, 0.08), inset 0 1px 0 rgba(255,255,255,0.35);
    -webkit-backdrop-filter: blur(10px) saturate(160%);
    backdrop-filter: blur(10px) saturate(160%);
    transition: background 0.2s ease, box-shadow 0.2s ease, transform 0.06s ease-in;
}

    .btnInlinetoggle:hover {
        background: rgba(255, 255, 255, 0.35);
        box-shadow: 0 10px 28px rgba(13, 110, 253, 0.12);
        text-decoration: none;
    }

    .btnInlinetoggle:active {
        transform: translateY(1px);
    }

    .btnInlinetoggle.active {
        background: rgba(13, 110, 253, 0.12);
        border-color: rgba(13, 110, 253, 0.35);
        box-shadow: 0 8px 24px rgba(13, 110, 253, 0.18);
    }

    .btnInlinetoggle i {
        font-size: 0.95em;
    }

/* =========================================================
   Form Container Header Buttons
   Keep header height consistent whether actions exist or not.
   ========================================================= */

.form-container-header .btnInline {
    /*
     * Header actions are intentionally a little more compact
     * than normal buttons used within the page content.
     */
    padding: 5px 11px;
    font-size: 0.82rem;
    line-height: 1.2;
    border-radius: 10px;
    /* Prevent the button from stretching the header vertically */
    min-height: 0;
}


/* If a header-actions wrapper is being used, keep its contents centred */
.form-container-header .header-actions {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

/* =========================================================
   GLASSY PILL BADGE
   ========================================================= */

.pillBadge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 0.3rem 0.45rem;
    border-radius: 999px;
    vertical-align: middle;
    font-weight: 700;
    letter-spacing: .2px;
    line-height: 1;
    font-size: .75rem;
    white-space: nowrap;
    --bi-color: #0d6efd;
    --bi-shadow: rgba(13,110,253,.12);
    --bi-border: rgba(13,110,253,.28);
    --bi-bg-top: rgba(255,255,255,0.68);
    --bi-bg-bot: rgba(255,255,255,0.42);
    color: var(--bi-color);
    background: linear-gradient(to bottom, var(--bi-bg-top), var(--bi-bg-bot));
    border: 1px solid var(--bi-border);
    box-shadow: 0 1px 6px var(--bi-shadow), inset 0 1px 0 rgba(255,255,255,.55);
    -webkit-backdrop-filter: blur(10px) saturate(160%);
    backdrop-filter: blur(10px) saturate(160%);
    user-select: none;
}

    .pillBadge i {
        font-size: .85em;
        line-height: 1;
    }

.pillBadge--xs {
    font-size: .62rem;
    padding: 0.05rem 0.35rem;
}

.pillBadge--count {
    font-variant-numeric: tabular-nums;
}

/* =========================================================
   INLINE BUTTON COLOUR MODIFIERS
   ========================================================= */

.btnInline--primary {
    --bi-color: #0d6efd;
    --bi-shadow: rgba(13,110,253,.16);
    --bi-border: rgba(13,110,253,.28);
}

.btnInline--success {
    --bi-color: #198754;
    --bi-shadow: rgba(25,135,84,.16);
    --bi-border: rgba(25,135,84,.28);
}

.btnInline--warning {
    --bi-color: #fd7e14;
    --bi-shadow: rgba(253,126,20,.16);
    --bi-border: rgba(253,126,20,.32);
}

.btnInline--danger {
    --bi-color: #dc3545;
    --bi-shadow: rgba(220,53,69,.16);
    --bi-border: rgba(220,53,69,.30);
}

.btnInline--purple {
    --bi-color: #6f42c1;
    --bi-shadow: rgba(111,66,193,.16);
    --bi-border: rgba(111,66,193,.30);
}

.btnInline--teal {
    --bi-color: #20c997;
    --bi-shadow: rgba(32,201,151,.16);
    --bi-border: rgba(32,201,151,.30);
}

.btnInline--neutral {
    --bi-color: #6c757d;
    --bi-shadow: rgba(108,117,125,.16);
    --bi-border: rgba(108,117,125,.28);
}

/* =========================================================
   INLINE BUTTON SIZE HELPERS
   ========================================================= */

.btnInline--sm {
    padding: 0.15rem 0.35rem;
    font-size: 0.7rem;
}

.btnInline--lg {
    padding: 0.35rem 0.7rem;
    font-size: 0.975rem;
}

.btnInline--block {
    display: flex;
    width: 100%;
    justify-content: center;
}

/* =========================================================
   GLOBAL NOTIFICATION POPUP
   =========================================================
   Solid / opaque notification toast.

   No transparency or backdrop blur is used. This keeps the
   notification easy to read regardless of the page content
   underneath it.
   ========================================================= */

.global-notification {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    /*
     * Fully opaque success background.
     */
    background-color: #e8f7ec;
    color: #155724;
    border: 1px solid #9fd6ac;
    border-radius: 12px;
    /*
     * Normal neutral shadow only.
     * No glass / blur effect.
     */
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.16);
    display: flex;
    align-items: center;
    z-index: 2000;
    opacity: 1;
    transition: opacity 0.3s ease, transform 0.3s ease;
    padding: 16px 22px;
    font-size: 1.05rem;
    font-weight: 500;
    max-width: 90vw;
    /*
     * Keep long notification messages contained cleanly.
     */
    box-sizing: border-box;
}


    /* =========================================================
   HIDE / DISMISS ANIMATION
   ========================================================= */

    .global-notification.hide {
        opacity: 0;
        pointer-events: none;
        transform: translateX(-50%) translateY(-10px);
    }


    /* =========================================================
   NOTIFICATION ICON
   ========================================================= */

    .global-notification i {
        flex-shrink: 0;
        font-size: 1.35em;
        margin-right: 12px;
        color: #198754;
    }


    /* =========================================================
   DISMISS BUTTON
   ========================================================= */

    .global-notification .notification-dismiss {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        flex-shrink: 0;
        padding: 6px 11px;
        margin-left: 18px;
        font-weight: 600;
        font-size: 0.85em;
        line-height: 1;
        /*
     * Fully opaque button.
     */
        background-color: #ffffff;
        color: #155724;
        border: 1px solid #74b783;
        border-radius: 7px;
        cursor: pointer;
        transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
    }


        .global-notification .notification-dismiss:hover,
        .global-notification .notification-dismiss:focus-visible {
            background-color: #155724;
            color: #ffffff;
            border-color: #155724;
            outline: none;
            box-shadow: 0 2px 6px rgba(21, 87, 36, 0.22);
        }


/* =========================================================
   ERROR NOTIFICATION
   ========================================================= */

.global-notification--error {
    /*
     * Fully opaque soft-red background.
     */
    background-color: #fdebec;
    color: #842029;
    border-color: #e8a4aa;
}


    .global-notification--error i {
        color: #dc3545;
    }


    .global-notification--error .notification-dismiss {
        background-color: #ffffff;
        color: #b02a37;
        border-color: #dc3545;
    }


        .global-notification--error .notification-dismiss:hover,
        .global-notification--error .notification-dismiss:focus-visible {
            background-color: #dc3545;
            color: #ffffff;
            border-color: #dc3545;
            box-shadow: 0 2px 6px rgba(220, 53, 69, 0.22);
        }


/* =========================================================
   MOBILE
   ========================================================= */

@media (max-width: 768px) {

    .global-notification {
        top: 10px;
        width: calc(100% - 20px);
        max-width: none;
        padding: 12px 14px;
        font-size: 0.95rem;
        border-radius: 10px;
    }


        .global-notification i {
            font-size: 1.2em;
            margin-right: 9px;
        }


        .global-notification .notification-dismiss {
            margin-left: auto;
            padding: 6px 9px;
        }
}
/* =========================================================
   GLASS MODAL
   ========================================================= */

.glass-modal .modal-content {
    position: relative;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    overflow: hidden;
}

    .glass-modal .modal-content::before {
        content: "";
        position: absolute;
        top: -25%;
        left: -25%;
        width: 150%;
        height: 150%;
        background: linear-gradient(135deg, rgba(255, 255, 255, 0.4) 0%, rgba(255, 255, 255, 0) 60%);
        pointer-events: none;
    }

body.modal-open {
    overflow-y: auto !important;
    position: relative !important;
    padding-right: 0 !important;
}

/* NOTE: keep this only if the base64 is complete in the real file */
.glass-modal .modal-content::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('data:image/png;base64,iVBORw0KGgoAAA...');
    opacity: 0.02;
    pointer-events: none;
}

/* =========================================================
   GLASS BUTTONS
   ========================================================= */

.glass-button {
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px) saturate(150%);
    -webkit-backdrop-filter: blur(10px) saturate(150%);
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-radius: 6px;
    padding: 0.5rem 1rem;
    font-size: 1rem;
    line-height: 1.2;
    color: #fff;
    text-shadow: 0 1px 2px rgba(0,0,0,0.4);
    cursor: pointer;
    transition: background 0.3s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

    .glass-button:hover {
        background: rgba(255, 255, 255, 0.3);
        box-shadow: 0 4px 15px rgba(0, 0, 0, 0.25);
        transform: translateY(-2px);
    }

    .glass-button:active {
        background: rgba(255, 255, 255, 0.4);
        box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.3);
        transform: translateY(0);
    }

    .glass-button:disabled,
    .glass-button.disabled {
        background: rgba(255, 255, 255, 0.1);
        opacity: 0.6;
        cursor: not-allowed;
        box-shadow: none;
        transform: none;
    }

    .glass-button.primary {
        color: #0d6efd;
        border-color: rgba(13, 110, 253, 0.6);
    }

    .glass-button.secondary {
        color: #6c757d;
        border-color: rgba(108, 117, 125, 0.6);
    }

    .glass-button.warning {
        color: #ffc107;
        border-color: rgba(255, 193, 7, 0.6);
    }

    .glass-button.danger {
        color: #dc3545;
        border-color: rgba(220, 53, 69, 0.6);
    }

    .glass-button.primary:hover {
        background: rgba(13, 110, 253, 0.15);
        color: #fff;
    }

    .glass-button.secondary:hover {
        background: rgba(108, 117, 125, 0.15);
        color: #fff;
    }

    .glass-button.warning:hover {
        background: rgba(255, 193, 7, 0.15);
        color: #fff;
    }

    .glass-button.danger:hover {
        background: rgba(220, 53, 69, 0.15);
        color: #fff;
    }

    .glass-button.warning:active {
        background: rgba(255, 193, 7, 0.2);
    }

    .glass-button.danger:active {
        background: rgba(220, 53, 69, 0.2);
    }

/* =========================================================
   ITEMS - SHARED COLOURED FORM CONTAINERS
   =========================================================
   Details, Edit and Delete all use the same container layout.

   The only difference between:
       form-info
       form-fields
       form-export
       form-internal

   should be their colour scheme.

   All sizing, padding, header height, typography and spacing
   are controlled here in one place.
   ========================================================= */

.item-title {
    color: inherit;
}

.thumbnail {
    cursor: pointer;
    width: 150px;
    height: auto;
}


/* =========================================================
   SHARED ITEM CONTAINER
   ========================================================= */

.form-container.form-info,
.form-container.form-fields,
.form-container.form-export,
.form-container.form-internal {
    padding: 12px !important;
    margin-bottom: 16px;
    border-radius: 8px;
    overflow: hidden;
}


/* Give the first Info container a little separation from
   the content/header above it. */
.form-container.form-info {
    margin-top: 16px;
}


    /* =========================================================
   SHARED ITEM CONTAINER HEADER
   =========================================================
   Compact header used on Details, Edit and Delete.
   ========================================================= */

    .form-container.form-info > .form-container-header,
    .form-container.form-fields > .form-container-header,
    .form-container.form-export > .form-container-header,
    .form-container.form-internal > .form-container-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 0.75rem;
        /* Compact header */
        min-height: 34px;
        padding: 6px 12px;
        /* Pull header through the parent padding */
        margin: -12px -12px 12px -12px;
        border-radius: 8px 8px 0 0;
    }


        /* Keep all Item section headings identical regardless of
   whether the page is Details, Edit or Delete. */
        .form-container.form-info > .form-container-header h3,
        .form-container.form-fields > .form-container-header h3,
        .form-container.form-export > .form-container-header h3,
        .form-container.form-internal > .form-container-header h3 {
            margin: 0;
            font-size: 1rem;
            font-weight: 650;
            line-height: 1.2;
        }


/* Header actions such as Copy / Guidelines */
.form-container-header .header-actions {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}


/* Header buttons should not make the compact header taller. */
.form-container-header .btnInline {
    padding: 4px 9px;
    font-size: 0.78rem;
    line-height: 1.15;
    border-radius: 8px;
    min-height: 0;
}


/* =========================================================
   COLOURS
   =========================================================
   These are intentionally the ONLY meaningful differences
   between the four Item container types.
   ========================================================= */


/* ---------- Info ---------- */

.form-container.form-info {
    background-color: #ffffff !important;
    border: 1px solid #a1a1a1;
}

    .form-container.form-info > .form-container-header {
        background-color: #f0f0f0;
        border-bottom: 1px solid #dddddd;
    }


/* ---------- Fields ---------- */

.form-container.form-fields {
    background-color: #fffcf0 !important;
    border: 1px solid #f0dd75;
}

    .form-container.form-fields > .form-container-header {
        background-color: #fff5cc;
        border-bottom: 1px solid #f0df7a;
    }


/* ---------- Export ---------- */

.form-container.form-export {
    background-color: #f3fcf2 !important;
    border: 1px solid #b8e6b3;
}

    .form-container.form-export > .form-container-header {
        background-color: #e7fce3;
        border-bottom: 1px solid #bfe8b7;
    }


/* ---------- Internal ---------- */

.form-container.form-internal {
    background-color: #fcf4f2 !important;
    border: 1px solid #ffb8b8;
}

    .form-container.form-internal > .form-container-header {
        background-color: #fce6e6;
        border-bottom: 1px solid #efb5b5;
    }

/* =========================================================
   ITEM OUTPUT CONTAINERS
   Export + Internal
   =========================================================
   These two containers display generated/read-only content,
   so use a dedicated content area rather than the generic
   form-container padding.
   ========================================================= */

.form-container.form-export,
.form-container.form-internal {
    padding: 0 !important;
}


    /* Because the parent no longer has padding, the header no
   longer needs the shared negative margins. */
    .form-container.form-export > .form-container-header,
    .form-container.form-internal > .form-container-header {
        margin: 0 !important;
    }


/* Dedicated body area for generated/read-only Item content. */
.item-output-body {
    margin: 0;
    padding: 10px 12px;
    font-family: 'Segoe UI';
    font-size: 18px;
    line-height: 1.45;
    /* Preserve intentional line breaks in Item content. */
    white-space: pre-wrap;
}


    /* Html.Raw() may contain HTML elements with their own default
   margins. Prevent those from creating a large artificial gap
   immediately below the container header. */
    .item-output-body > :first-child {
        margin-top: 0 !important;
    }


    /* Avoid extra whitespace at the very bottom of the container. */
    .item-output-body > :last-child {
        margin-bottom: 0 !important;
    }


    /* Keep paragraphs compact and predictable. */
    .item-output-body p {
        margin-top: 0;
        margin-bottom: 0.5rem;
    }


    /* Same idea for lists rendered inside generated content. */
    .item-output-body ul,
    .item-output-body ol {
        margin-top: 0;
        margin-bottom: 0.5rem;
    }

/* =========================================================
   ITEM CONTAINER CONTENT
   =========================================================
   Inner padding for container types whose outer padding has
   been removed so the header can sit flush with the border.
   ========================================================= */

.item-container-body {
    padding: 12px;
}


    /* Avoid an extra gap caused by the first/last control's margin. */
    .item-container-body > :first-child {
        margin-top: 0;
    }

    .item-container-body > :last-child {
        margin-bottom: 0;
    }

/* =========================================================
   ITEM DETAILS - COMMENTS
   =========================================================
   Comments only appear on the Item Details page.

   This intentionally has its own container styling because
   the section expands/collapses and contains interactive
   comment bubbles rather than normal Item fields.
   ========================================================= */

.form-container.form-comments {
    padding: 0 !important;
    margin-bottom: 16px;
    background-color: #ffffff;
    border: 1px solid #b9d7ee;
    border-radius: 8px;
    overflow: hidden;
}


/* =========================================================
   COMMENTS HEADER
   ========================================================= */

.form-comments-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    min-height: 34px;
    padding: 6px 12px;
    background-color: #eaf5fd;
    border-bottom: 1px solid #c9e3f6;
    font-weight: 650;
    transition: background-color 0.15s ease;
}


    /* Small hover indication because the whole header is clickable. */
    .form-comments-header:hover {
        background-color: #dff0fb;
    }


    /* Your Details view currently still uses an h3 inside this
   header, so normalise it to the same compact heading size. */
    .form-comments-header > .d-flex > span:first-child {
        margin: 0;
        font-size: 1.3rem;
        font-weight: 500;
        line-height: 1.2;
    }


    /* Keep the explanatory text visually secondary. */
    .form-comments-header .text-muted {
        font-weight: 400;
    }


    /* Keep the comment count badge on one line. */
    .form-comments-header .pillBadge {
        flex: 0 0 auto;
    }


/* =========================================================
   EXPANDED COMMENTS BODY
   =========================================================
   Padding belongs on the expandable body rather than the
   outer container so the header remains flush with the edges.
   ========================================================= */

#commentsSection {
    padding: 12px;
}


/* =========================================================
   INDIVIDUAL COMMENT
   ========================================================= */

.comment-bubble {
    background-color: #e1f1ff;
    border: 1px solid #c9e3fb;
    padding: 10px 15px;
    border-radius: 8px;
    margin-bottom: 10px;
}


    /* Don't leave unnecessary space after the final comment when
   there is no following content. */
    .comment-bubble:last-child {
        margin-bottom: 0;
    }


    .comment-bubble strong {
        font-weight: 600;
    }


/* =========================================================
   COMMENT CONTROLS
   ========================================================= */

.comment-controls {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 0.85rem;
    white-space: nowrap;
}


/* =========================================================
   NEW COMMENT
   ========================================================= */

.comment-inline {
    position: relative;
    width: 100%;
}


    .comment-inline textarea {
        flex: 1 1 auto;
        min-width: 0;
        width: auto;
        resize: vertical;
    }


/* =========================================================
   MOBILE
   ========================================================= */

@media (max-width: 576px) {

    .form-comments-header {
        align-items: flex-start;
    }

        .form-comments-header .d-flex {
            flex-wrap: wrap;
        }

    #commentsSection {
        padding: 10px;
    }

    .comment-bubble {
        padding: 9px 10px;
    }
}

/* Navigation buttons */
.navigation-buttons {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 10px;
}

.small-nav-button {
    background-color: #f0fcff;
    border: 1px solid #d9d9d9;
    color: #007bff;
    font-size: 0.85rem;
    padding: 5px 10px;
    border-radius: 5px;
    text-decoration: none;
    transition: background-color 0.3s, color 0.3s;
}

    .small-nav-button:hover {
        background-color: #d9f2ff;
        color: #0056b3;
    }

    .small-nav-button.disabled {
        background-color: #e9ecef;
        color: #6c757d;
        pointer-events: none;
    }

/* Misc */
.tooltip-inner {
    max-width: 300px;
    width: auto;
}

.info-icon {
    cursor: pointer;
    margin-left: 5px;
    color: #007bff;
}

#modalImage {
    transition: transform 0.25s ease;
}

#imageModal .modal-dialog {
    transition: max-width 0.25s ease, max-height 0.25s ease;
    min-width: 400px;
    min-height: 300px;
}

#imageModal .modal-body {
    transition: max-height 0.25s ease;
}

pre {
    font-family: 'Segoe UI';
    font-size: 18px;
    white-space: pre-wrap;
}

#copyButton {
    margin-left: auto;
}

.purpose-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

    .purpose-list li {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        /* Slightly larger than the standard badges */
        padding: 0.25rem 0.65rem;
        font-size: 0.9rem;
        font-weight: 600;
        border: 1px solid rgb(180, 180, 180);
        border-radius: 15px;
        /* Match the neutral badge */
        color: #000000;
        background: linear-gradient( to bottom, rgb(235, 251, 255), rgb(190, 190, 190) );
        white-space: nowrap;
    }

/* =========================================================
   EDIT PAGE
   ========================================================= */

.edit-layout {
    display: flex;
    align-items: flex-start;
    gap: 16px;
}

.main-col {
    flex: 1 1 auto;
    min-width: 0;
}

.guidelines-sidebar {
    display: none;
    position: sticky;
    top: 80px;
    background: #ffffff;
    border: 1px solid #ced4da;
    border-radius: 10px;
    padding: 12px;
    flex: 0 1 420px;
    max-width: 420px;
    max-height: calc(100vh - 120px);
    overflow: auto;
}

    .guidelines-sidebar.show {
        display: block;
    }

@media (max-width: 991.98px) {
    .edit-layout {
        flex-direction: column;
    }

    .guidelines-sidebar {
        position: static;
        max-height: none;
        width: 100%;
    }
}

.field-block {
    background-color: #fffcf0;
    border: 1px solid #ffed45;
    border-radius: 10px;
    padding: 12px;
    margin-bottom: 12px;
}

.field-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.field-title {
    font-weight: 600;
}

.inline-actions {
    display: flex;
    gap: .5rem;
    align-items: center;
}

.icon-btn {
    border: none;
    background: transparent;
    padding: .25rem;
    cursor: pointer;
}

    .icon-btn i {
        font-size: 1rem;
    }

#SystemOutputContainer {
    width: 100%;
    height: 200px;
    overflow-y: auto;
    overflow-x: hidden;
    white-space: pre-wrap;
}

table.table th,
table.table td {
    vertical-align: middle;
}

/* =========================================================
   EDIT PAGE - INLINE FIELD ACTIONS
   =========================================================
   Used where a form field has a small action button beside it,
   e.g. Responsible Person + "Me" and Purposes + "New".
   ========================================================= */

.edit-inline-field {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
}


    /* The form control / Select2 should take all available space,
   but must still be allowed to shrink so the button remains
   beside it rather than dropping underneath. */
    .edit-inline-field > .form-control,
    .edit-inline-field > .form-select,
    .edit-inline-field > select,
    .edit-inline-field > .select2-container {
        flex: 1 1 auto;
        min-width: 0;
        width: auto !important;
    }


    /* Buttons should keep their natural width and never shrink. */
    .edit-inline-field > .btnInline {
        flex: 0 0 auto;
        white-space: nowrap;
    }


    /* Select2 creates its own wrapper after initialisation.
   Force that wrapper to behave like the original select. */
    .edit-inline-field .select2-container {
        flex: 1 1 auto !important;
        min-width: 0 !important;
        width: auto !important;
    }

.count-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 4px 10px;
    border-radius: 999px;
    font-weight: 700;
    font-size: .9rem;
    color: #0d6efd;
    background: #eef5ff;
    border: 1px solid #b6d4fe;
    box-shadow: 0 2px 6px rgba(13, 110, 253, .08);
    white-space: nowrap;
}

/* =========================================================
   READY STATUS PILLS (LIGHT MODE)
   Fully opaque - no transparency
   ========================================================= */

.ready-pill,
.badge.bg-success,
.badge.bg-primary,
.badge.bg-warning,
.badge.bg-neutral,
.badge.bg-danger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.24rem 0.5rem;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 15px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
    text-transform: uppercase;
    letter-spacing: 0.4px;
    border: 1px solid;
    gap: 0.35rem;
}

    /* Ready / Success */
    .ready-pill.yes,
    .badge.bg-success {
        color: #ffffff !important;
        background: linear-gradient( to bottom, rgb(40, 167, 69), rgb(32, 134, 55) ) !important;
        border-color: rgb(34, 142, 59) !important;
    }

    /* Not Ready / Danger */
    .ready-pill.no,
    .badge.bg-danger {
        color: #ffffff !important;
        background: linear-gradient( to bottom, rgb(220, 53, 69), rgb(176, 42, 55) ) !important;
        border-color: rgb(187, 45, 59) !important;
    }

/* Primary */
.badge.bg-primary {
    color: #ffffff !important;
    background: linear-gradient( to bottom, rgb(0, 123, 255), rgb(0, 98, 204) ) !important;
    border-color: rgb(0, 105, 217) !important;
}

/* Warning */
.badge.bg-warning {
    color: #212529 !important;
    background: linear-gradient( to bottom, rgb(255, 193, 7), rgb(224, 168, 0) ) !important;
    border-color: rgb(214, 161, 0) !important;
}

/* Neutral */
.badge.bg-neutral {
    color: #000000 !important;
    background: linear-gradient( to bottom, rgb(242, 253, 255), rgb(210, 210, 210) ) !important;
    border-color: rgb(200, 200, 200) !important;
}

/* =========================================================
   OSOT DATA TABLES
   =========================================================
   Shared styling for list/index tables throughout OSOT.

   Goals:
   - compact table layout
   - light grey header
   - clearer row separation
   - subtle hover feedback
   - rounded table edges where possible
   ========================================================= */

.osot-table {
    width: 100%;
    margin-bottom: 0;
    border-collapse: separate;
    border-spacing: 0;
    background-color: #ffffff;
    border: 1px solid #dfe3e7;
    border-radius: 6px;
    overflow: hidden;
    font-size: 0.95rem;
}


    /* =========================================================
   TABLE HEADER
   ========================================================= */

    .osot-table thead th {
        /*
     * Slight grey background so headings are visually distinct
     * without becoming a heavy dark band.
     */
        background-color: #f1f3f5;
        color: #343a40;
        padding: 8px 10px;
        font-size: 0.82rem;
        font-weight: 700;
        letter-spacing: 0.02em;
        vertical-align: middle;
        border-top: 0;
        border-bottom: 1px solid #d9dde2;
        white-space: nowrap;
    }


        /*
 * Keep sortable header links looking like table headings rather
 * than normal blue hyperlinks.
 */
        .osot-table thead th a {
            color: inherit;
            text-decoration: none;
        }


            .osot-table thead th a:hover {
                color: #0d6efd;
                text-decoration: none;
            }


    /* =========================================================
   TABLE BODY
   ========================================================= */

    .osot-table tbody td {
        padding: 8px 10px;
        vertical-align: middle;
        border-top: 0;
        border-bottom: 1px solid #eceff2;
        background-color: #ffffff;
    }


    /*
 * Remove final divider so the bottom of the table looks clean.
 */
    .osot-table tbody tr:last-child td {
        border-bottom: 0;
    }


    /* =========================================================
   CLICKABLE ROWS
   ========================================================= */

    .osot-table tbody tr.osot-clickable-row {
        cursor: pointer;
        transition: background-color 0.14s ease, box-shadow 0.14s ease;
    }


        /*
 * Keyboard focus for accessibility.
 *
 * tabindex="0" is added to clickable rows in the Razor view.
 */
        .osot-table tbody tr.osot-clickable-row:focus {
            outline: none;
        }


            .osot-table tbody tr.osot-clickable-row:focus td {
                background-color: #eef6ff;
                box-shadow: inset 0 1px 0 rgba(13, 110, 253, 0.12), inset 0 -1px 0 rgba(13, 110, 253, 0.12);
            }

.osot-item-link {
    color: inherit;
    font-weight: 600;
    text-decoration: none;
}

    .osot-item-link:hover {
        color: #0d6efd;
        text-decoration: underline;
    }

/* ---------------------------------------------------------
   Item updated since last viewed indicator
   ---------------------------------------------------------
   Deliberately small and subtle. This is intended as a
   visual hint rather than an unread notification badge.
   --------------------------------------------------------- */
.osot-item-updated-indicator {
    display: inline-block;
    width: 7px;
    height: 7px;
    margin-left: 5px;
    vertical-align: middle;
    border-radius: 50%;
    background-color: #217bff;
}


    /* =========================================================
   FIRST / LAST COLUMNS
   ========================================================= */

    .osot-table th:first-child,
    .osot-table td:first-child {
        padding-left: 12px;
    }


    .osot-table th:last-child,
    .osot-table td:last-child {
        padding-right: 12px;
    }


/* =========================================================
   TABLE CONTAINER
   =========================================================
   This variant removes most of the standard form-container
   padding above the table so the header sits closer to the top.
   ========================================================= */

/* =========================================================
   TABLE CONTAINER
   =========================================================
   Standard container for OSOT data tables.

   Horizontal scrolling belongs to .table-responsive,
   NOT the outer form-container.
   ========================================================= */

.form-container.osot-table-container {
    padding: 5px;
    overflow: visible;
}


    /*
 * Search results/table should use the full width of the
 * container without adding extra internal spacing.
 */
    .form-container.osot-table-container > #searchResults {
        width: 100%;
    }


    /* =========================================================
   TABLE CONTAINER WITH SECTION HEADER
   =========================================================
   Use when an OSOT table also needs a form-container-header.

   Example:
 *
 * <div class="form-container
 *             osot-table-container
 *             osot-table-container--with-header">
 *
 *     <div class="form-container-header">
 *         Responsible
 *     </div>
 *
 *     <div class="table-responsive">
 *         ...
 *     </div>
 *
 * </div>
 *
 * The outer container has no padding so the section header
 * can occupy the full width.
 *
 * Padding is then applied separately to the header and table
 * area.
   ========================================================= */

    .form-container.osot-table-container.osot-table-container--with-header {
        padding: 0;
    }


/*
 * Give the section heading proper spacing without relying on
 * the normal form-container padding.
 */
.form-container.osot-table-container--with-header > .form-container-header {
    padding: 10px 12px;
    margin: 0;
}


/*
 * Keep the table itself slightly inset from the card edge,
 * matching the normal osot-table-container appearance.
 *
 * table-responsive owns horizontal scrolling.
 */
.form-container.osot-table-container--with-header > .table-responsive {
    padding: 5px;
}


    /*
 * Search results/table should use the full width of the
 * container without adding extra internal spacing.
 */
    .form-container.osot-table-container > #searchResults {
        width: 100%;
    }


/* =========================================================
   DARK MODE
   ========================================================= */

.dark-mode .osot-table {
    background-color: #24272b;
    border-color: #444a50;
}


    .dark-mode .osot-table thead th {
        background-color: #30343a;
        color: #e4e7eb;
        border-bottom-color: #484e55;
    }


    .dark-mode .osot-table tbody td {
        background-color: #24272b;
        color: #e0e0e0;
        border-bottom-color: #393e44;
    }


    .dark-mode .osot-table tbody tr.osot-clickable-row:hover td {
        background-color: #2c3540;
    }


    .dark-mode .osot-table tbody tr.osot-clickable-row:focus td {
        background-color: #303c49;
    }


/* =========================================================
   MOBILE
   ========================================================= */

@media (max-width: 768px) {

    .osot-table {
        width: max-content;
        min-width: 100%;
        font-size: 0.86rem;
    }

        .osot-table thead th,
        .osot-table tbody td {
            padding: 7px 8px;
            white-space: nowrap;
        }

    .form-container.osot-table-container {
        padding: 4px;
    }

        /*
     * Header variant controls the header and table padding
     * separately.
     */
        .form-container.osot-table-container.osot-table-container--with-header {
            padding: 0;
        }

    .form-container.osot-table-container--with-header > .form-container-header {
        padding: 9px 10px;
    }

    .form-container.osot-table-container--with-header > .table-responsive {
        padding: 4px;
    }
}

/* =========================================================
   OSOT TABLE - ITEM NAME
   ========================================================= */

.osot-item-name {
    font-weight: 600;
}


/* Following indicator */
.osot-following-icon {
    font-size: 0.75rem;
    opacity: 0.55;
}


/* =========================================================
   EMPTY TABLE STATE
   ========================================================= */

.osot-table-empty {
    padding: 18px 12px !important;
    color: #6c757d;
    text-align: center;
}


/* =========================================================
   CLICKABLE ROW HOVER
   =========================================================
   Slightly stronger than Bootstrap's default table-hover,
   but still subtle.
   ========================================================= */

.osot-table tbody tr.osot-clickable-row:hover td {
    background-color: #eef6ff;
}


/*
 * Optional little cue on the first cell.
 */
.osot-table tbody tr.osot-clickable-row:hover .osot-item-name {
    color: #0d6efd;
}

/*
 * OSOT shared record-ID display.
 *
 * Every visible database record ID uses the form "(ID: 1111)".
 * Names and barcode numbers remain the primary visual information;
 * this secondary metadata is deliberately quieter but readable.
 *
 * Load this CSS once from Views/Shared/_Layout.cshtml so it is
 * available to every Razor page (including modals).
 */

.osot-record-id {
    color: #6b7280;
    font-size: 0.85rem;
    font-weight: 500;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
    letter-spacing: 0.01em;
}

/* Match OSOT's existing dark-mode convention. */
.dark-mode .osot-record-id {
    color: #b1bbc8;
}
