/* ═══════════════════════════════════════════════════════════════════════════════
   Portal chrome — navbar + login modernisation (23/07/2026)
   STRICTLY COSMETIC on the navbar: all vertical metrics (50px bar, 15px link
   padding, zero extra margins) match Bootstrap 3's defaults exactly, so page
   body positioning is pixel-identical. Colors/typography/hover/dropdowns only.
   ═══════════════════════════════════════════════════════════════════════════════ */

/* ── Top navigation bar (Gulmay / navbar-default only — Herrco keeps its own) ──
   A SOLID deep indigo (not a gradient) so that when the menu wraps to extra rows
   at narrower widths, every row gets exactly the same readable background.
   The inner collapse/form are transparent over the bar's own solid background: painted
   solid they covered the accent hairline across the whole container width, leaving it
   visible only in the side gutters. */
.navbar.navbar-default,
.navbar.navbar-default .navbar-collapse,
.navbar.navbar-default .navbar-form {
    background: transparent;
    border: none;
}

.navbar.navbar-default {
    box-shadow: 0 2px 16px rgba(15, 23, 42, .28);
    /* accent hairline = a bottom-anchored background LAYER, deliberately not ::after:
       Bootstrap uses the navbar's ::before/::after as its float-clearing mechanism, and
       overriding them stops the bar containing wrapped rows (they then paint over the
       page content — the "dark slab over the hero" bug). */
    background: linear-gradient(90deg, #4f46e5, #22d3ee) left bottom / 100% 3px no-repeat, #252063;
}

    /* belt-and-braces: re-assert the clearfix so the bar ALWAYS contains its rows,
       even when the menu wraps at narrow widths */
    .navbar.navbar-default:before, .navbar.navbar-default:after,
    .navbar.navbar-default .navbar-collapse:before, .navbar.navbar-default .navbar-collapse:after,
    .navbar.navbar-default .container:before, .navbar.navbar-default .container:after {
        content: " ";
        display: table;
    }

    .navbar.navbar-default:after,
    .navbar.navbar-default .navbar-collapse:after,
    .navbar.navbar-default .container:after {
        clear: both;
    }

.navbar.navbar-default .navbar-nav > li > a {
    color: rgba(255, 255, 255, .88) !important;
    font-weight: 600;
    letter-spacing: .01em;
    position: relative;
    transition: color .15s ease;
    white-space: nowrap;
}

    .navbar.navbar-default .navbar-nav > li > a:hover,
    .navbar.navbar-default .navbar-nav > li > a:focus {
        color: #fff !important;
        background: transparent !important;
    }

    /* animated accent underline on hover */
    .navbar.navbar-default .navbar-nav > li > a:after {
        content: "";
        position: absolute;
        left: 12px;
        right: 12px;
        bottom: 8px;
        height: 2px;
        border-radius: var(--gm-radius-xs);
        background: linear-gradient(90deg, #818cf8, #22d3ee);
        transform: scaleX(0);
        transform-origin: left;
        transition: transform .18s ease;
    }

    .navbar.navbar-default .navbar-nav > li > a:hover:after { transform: scaleX(1); }

.navbar.navbar-default .navbar-nav > .open > a,
.navbar.navbar-default .navbar-nav > .open > a:hover,
.navbar.navbar-default .navbar-nav > .open > a:focus,
.navbar.navbar-default .navbar-nav > .active > a,
.navbar.navbar-default .navbar-nav > .active > a:hover {
    background: rgba(255, 255, 255, .14) !important;
    color: #fff !important;
    border-radius: var(--gm-radius-sm) var(--gm-radius-sm) 0 0;
}

.navbar.navbar-default .caret { opacity: .7; }

/* the signed-in user: a proper pill, clearly readable wherever the bar wraps
   (01-Oct-2026: tidied - firmer outline, even spacing, and it stays a pill when the menu is open
   instead of turning into a tab like the other nav items) */
.navbar.navbar-default .navbar-right > li.dropdown > a {
    background: rgba(255, 255, 255, .16);
    border: 1px solid rgba(255, 255, 255, .32);
    border-radius: var(--gm-radius-pill);
    color: #fff !important;
    margin: 8px 0 8px 8px;
    transition: background .15s ease, border-color .15s ease;
}

    .navbar.navbar-default .navbar-right > li.dropdown > a.gm-user-pill {
        display: inline-flex;
        align-items: center;
        gap: .45em;
        padding: 5px 13px 5px 12px;
        line-height: 20px;
        font-weight: 600;
        letter-spacing: .01em;
    }

        .navbar.navbar-default .navbar-right > li.dropdown > a.gm-user-pill .fa-user { font-size: .95em; opacity: .9; }
        .navbar.navbar-default .navbar-right > li.dropdown > a.gm-user-pill .caret { margin: 0 0 0 2px; opacity: .85; }

    .navbar.navbar-default .navbar-right > li.dropdown > a:hover,
    .navbar.navbar-default .navbar-right > li.dropdown > a:focus {
        background: rgba(255, 255, 255, .26);
        border-color: rgba(255, 255, 255, .5);
    }

    .navbar.navbar-default .navbar-right > li.dropdown.open > a,
    .navbar.navbar-default .navbar-right > li.dropdown.open > a:hover,
    .navbar.navbar-default .navbar-right > li.dropdown.open > a:focus {
        background: rgba(255, 255, 255, .3) !important;
        border-color: rgba(255, 255, 255, .55);
        border-radius: var(--gm-radius-pill);
    }

    .navbar.navbar-default .navbar-right > li.dropdown > a:after { display: none; }

    .navbar.navbar-default .navbar-right > li.dropdown > .dropdown-menu { margin-top: 2px; }   /* the menu's corners come from .navbar .dropdown-menu below */

/* "Log in" link (signed out) */
.navbar.navbar-default .navbar-right .navbar-text a { color: #fff; font-weight: 600; }

/* fit more on one line before wrapping: compress link padding + search at laptop widths */
@media (min-width: 768px) and (max-width: 1350px) {
    .navbar.navbar-default .navbar-nav > li > a {
        padding-left: 9px;
        padding-right: 9px;
        font-size: .93em;
    }

    .navbar.navbar-default .navbar-form .prompt,
    .navbar.navbar-default .navbar-form input.prompt {
        max-width: 13em !important;   /* inline style says 20em — cap it, don't touch markup */
    }

    .navbar.navbar-default .navbar-form { padding-left: 6px; padding-right: 6px; }
}

/* modern light dropdown panels (existing inline color:black links stay readable) */
.navbar .dropdown-menu {
    border: 1px solid #e2e8f0;
    border-radius: var(--gm-radius-md);
    box-shadow: 0 12px 32px -8px rgba(15, 23, 42, .25);
    padding: 6px;
    margin-top: 4px;
}

    /* Bootstrap squares a navbar menu's top corners (.navbar-nav > li > .dropdown-menu) to join it to its tab; here
       the menu floats 4px below, so all four corners match */
    .navbar .navbar-nav > li > .dropdown-menu { border-radius: var(--gm-radius-md); }

    .navbar .dropdown-menu > li > a {
        border-radius: calc(var(--gm-radius-md) - 6px);   /* concentric with the menu: its radius less its 6px padding */
        padding: 7px 12px;
        font-weight: 500;
        transition: background .12s ease;
    }

        .navbar .dropdown-menu > li > a:hover,
        .navbar .dropdown-menu > li > a:focus {
            background: #eef2ff;
        }

        .navbar .dropdown-menu > li > a .fa {
            width: 1.4em;
            text-align: center;
            color: #4f46e5;
        }

/* brand logo: the official gulmay.com asset is white text + blue mark, designed for
   dark headers — it sits directly on the bar, no chip needed */
.navbar.navbar-default .navbar-header #brand-image {
    transition: transform .18s ease;
}

    .navbar.navbar-default .navbar-header #brand-image:hover { transform: scale(1.04); }

/* mobile burger */
.navbar.navbar-default .navbar-toggle {
    border-color: rgba(255, 255, 255, .35);
    color: #fff;
}

    .navbar.navbar-default .navbar-toggle:hover { background: rgba(255, 255, 255, .12); }

/* The navbar search ("Search Purchase Orders, etc...") is unused at Gulmay — hidden
   rather than removed, so re-enabling it is deleting this one rule. Hiding it also
   frees the bar width that was pushing the signed-in user pill onto a second row. */
.navbar.navbar-default .navbar-form { display: none; }

/* ── Environment banner (which DATABASE am I connected to?) ─────────────────
   Renders nothing in the one correct production state (live site + live DB).
   Dangerous combinations get a hazard-striped red bar; Training on a dev
   machine gets a calm amber strip. Added after the 06/08 live-run accident. */
.gm-envbar {
    padding: .55em 1em;
    text-align: center;
    font-weight: 600;
    font-size: .95em;
}

    .gm-envbar .fa { margin-right: .45em; }

.gm-envbar-danger {
    background: repeating-linear-gradient(45deg, #dc2626, #dc2626 14px, #991b1b 14px, #991b1b 28px);
    color: #fff;
    letter-spacing: .02em;
    text-shadow: 0 1px 2px rgba(0,0,0,.35);
    animation: gmEnvPulse 1.6s ease-in-out infinite;
}

.gm-envbar-training {
    background: #fffbeb;
    border-bottom: 1px solid #fde68a;
    color: #92400e;
}

@keyframes gmEnvPulse {
    0%, 100% { filter: brightness(1); }
    50% { filter: brightness(1.18); }
}

/* ── Login page ─────────────────────────────────────────────────────────────── */
.gm-login-wrap {
    max-width: 440px;
    margin: 0 auto;
    padding: 2.5em 1em 3em;
}

.gm-login-brand {
    text-align: center;
    margin-bottom: 1.6em;
}

    .gm-login-brand h1 {
        font-size: 1.9em;
        font-weight: 700;
        letter-spacing: -.02em;
        color: #0f172a;
        margin: .4em 0 .15em;
    }

    .gm-login-brand p {
        color: #64748b;
        margin: 0;
    }

    .gm-login-brand .gm-login-mark {
        width: 64px;
        height: 64px;
        margin: 0 auto;
        border-radius: var(--gm-radius-md);
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 26px;
        color: #fff;
        background: linear-gradient(135deg, #4f46e5, #0891b2);
        box-shadow: 0 12px 28px -8px rgba(79, 70, 229, .55);
    }

.gm-login-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: var(--gm-radius-md);
    box-shadow: 0 1px 2px rgba(15, 23, 42, .05), 0 18px 44px -16px rgba(15, 23, 42, .18);
    padding: 1.8em 1.9em;
    animation: gmFadeUp .35s ease both;
}

    .gm-login-card label { font-weight: 600; color: #334155; }

    .gm-login-card .input-group-addon {
        background: #f8fafc;
        border: 1px solid #cbd5e1;
        border-right: none;
        border-radius: var(--gm-radius-sm) 0 0 var(--gm-radius-sm);
        color: #4f46e5;
        min-width: 42px;
    }
    .gm-login-card .gm-pw-toggle { cursor: pointer; }
    .gm-login-card .gm-pw-toggle:hover, .gm-login-card .gm-pw-toggle:focus-visible { background: #eef2ff; }

    .gm-login-card .form-control {
        border: 1px solid #cbd5e1;
        border-radius: 0 var(--gm-radius-sm) var(--gm-radius-sm) 0;
        height: 42px;
        box-shadow: inset 0 1px 2px rgba(15, 23, 42, .04);
        transition: border-color .15s ease, box-shadow .15s ease;
    }

        .gm-login-card .form-control:focus {
            outline: none;
            border-color: #4f46e5;
            box-shadow: 0 0 0 3px rgba(79, 70, 229, .15);
        }

    .gm-login-card .btn-success {
        background: linear-gradient(135deg, #4f46e5, #0891b2);
        border: none;
        border-radius: var(--gm-radius-pill);
        font-weight: 600;
        padding: .65em;
        transition: transform .15s ease, box-shadow .15s ease;
        background-image: linear-gradient(135deg, #4f46e5, #0891b2); /* beat bootstrap gradient */
        text-shadow: none;
    }

        .gm-login-card .btn-success:hover,
        .gm-login-card .btn-success:focus {
            background: linear-gradient(135deg, #4338ca, #0e7490);
            box-shadow: 0 10px 24px -8px rgba(79, 70, 229, .55);
            transform: translateY(-1px);
        }

    /* Remember me: the checkbox sits inside its label, centred on the text line (the scaled
       Bootstrap checkbox-inline sat low and apart from its label). */
    .gm-login-card .gm-remember {
        display: inline-flex;
        align-items: center;
        gap: .55em;
        margin: 0;
        font-weight: 500;
        color: #475569;
        cursor: pointer;
        user-select: none;
    }

        .gm-login-card .gm-remember input[type="checkbox"] {
            width: 18px;
            height: 18px;
            margin: 0;
            accent-color: #4f46e5;
            cursor: pointer;
        }

    /* Sign-in failure: a soft alert instead of a red bulleted list; hidden until there is one. */
    .gm-login-card .gm-login-error.validation-summary-valid { display: none; }

    .gm-login-card .gm-login-error.validation-summary-errors {
        display: flex;
        align-items: flex-start;
        gap: .6em;
        margin-bottom: 1.1em;
        padding: .7em .9em;
        background: #fef2f2;
        border: 1px solid #fecaca;
        border-radius: var(--gm-radius-md);
        color: #991b1b;
        font-weight: 600;
    }

        .gm-login-card .gm-login-error.validation-summary-errors::before {
            content: "\f071"; /* fa-exclamation-triangle */
            font-family: FontAwesome;
            color: #dc2626;
            line-height: 1.45;
        }

        .gm-login-card .gm-login-error ul { list-style: none; margin: 0; padding: 0; }

    .gm-login-card .btn-success:active { transform: scale(.96); }

    /* ── signing-in state: button locks and comes alive ────────────────────── */
    .gm-login-card .btn-success.gm-busy,
    .gm-login-card .btn-success.gm-busy:hover {
        background: linear-gradient(270deg, #4f46e5, #0891b2, #7c3aed, #4f46e5);
        background-size: 300% 100%;
        animation: gmHueSlide 2s linear infinite;
        cursor: progress;
        transform: none;
        box-shadow: 0 10px 28px -8px rgba(79, 70, 229, .6);
        position: relative;
        overflow: hidden;
        opacity: 1;
    }

        /* light sweep across the busy button */
        .gm-login-card .btn-success.gm-busy:after {
            content: "";
            position: absolute;
            top: 0; bottom: 0;
            width: 40%;
            left: -40%;
            background: linear-gradient(90deg, transparent, rgba(255,255,255,.35), transparent);
            animation: gmSheen 1.2s ease-in-out infinite;
        }

/* everything else in the card is inert while signing in */
.gm-form-busy { pointer-events: none; }

    .gm-form-busy .form-control,
    .gm-form-busy .input-group-addon { opacity: .65; }

/* the card breathes while it waits */
.gm-login-card.gm-card-busy {
    animation: gmCardGlow 1.6s ease-in-out infinite;
}

/* the padlock pops open when the credentials go off */
.gm-unlocked {
    color: #059669 !important;
    animation: gmUnlock .5s ease;
}

@keyframes gmHueSlide {
    0% { background-position: 0% 50%; }
    100% { background-position: 300% 50%; }
}

@keyframes gmSheen {
    0% { left: -40%; }
    60%, 100% { left: 110%; }
}

@keyframes gmCardGlow {
    0%, 100% { box-shadow: 0 1px 2px rgba(15,23,42,.05), 0 18px 44px -16px rgba(15,23,42,.18); }
    50% { box-shadow: 0 1px 2px rgba(15,23,42,.05), 0 18px 54px -12px rgba(79,70,229,.45); }
}

@keyframes gmUnlock {
    0% { transform: rotate(0); }
    35% { transform: rotate(-14deg) scale(1.2); }
    70% { transform: rotate(9deg) scale(1.1); }
    100% { transform: rotate(0); }
}

/* the brand mark floats gently — a small sign of life on an otherwise static page */
.gm-login-brand .gm-login-mark { animation: gmFloat 3.2s ease-in-out infinite; }

/* THE wobble (01-Oct-2026, Oliver: one wobble for the whole app): a short burst of three wobbles then still,
   every 4 s. Amplitude per element through --wobble-x (px) and --wobble-r (deg): a tiny pill rotates a lot,
   a wide pill barely. Used by the navbar authorisations badge, the Validate Demand hint and e-BAN's danger
   notes (those run it once). Still under prefers-reduced-motion (23-Oct-2026, Oliver), by the empty keyframes below. */
@keyframes gmWobble {
    0%   { transform: translateX(0) rotate(0); }
    4%   { transform: translateX(calc(var(--wobble-x, 2.5px) * -1)) rotate(calc(var(--wobble-r, 18deg) * -1)); }
    8%   { transform: translateX(var(--wobble-x, 2.5px)) rotate(var(--wobble-r, 18deg)); }
    12%  { transform: translateX(calc(var(--wobble-x, 2.5px) * -.8)) rotate(calc(var(--wobble-r, 18deg) * -.78)); }
    16%  { transform: translateX(calc(var(--wobble-x, 2.5px) * .8)) rotate(calc(var(--wobble-r, 18deg) * .78)); }
    20%  { transform: translateX(calc(var(--wobble-x, 2.5px) * -.4)) rotate(calc(var(--wobble-r, 18deg) * -.33)); }
    23%, 100% { transform: translateX(0) rotate(0); }
}

@keyframes gmFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
}

.gm-login-links {
    text-align: center;
    margin-top: 1.1em;
}

    .gm-login-links a { color: #4f46e5; font-weight: 600; }

.gm-login-alert {
    margin-top: 1em;
    background: #fffbeb;
    border: 1px solid #fde68a;
    color: #92400e;
    border-radius: var(--gm-radius-md);
    padding: .8em 1em;
    font-weight: 600;
    text-align: center;
}

@keyframes gmFadeUp {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
    .gm-login-card, .navbar .navbar-nav > li > a:after { animation: none !important; transition: none !important; }
    @keyframes gmWobble { from, to { transform: none; } }
}


/* 27-Oct-2026 (Oliver): the top bar is the full width of the window: the logo at the far left with the build beside it, the
   menu in the middle, the user menu at the far right. Below 768px Bootstrap's collapsed menu takes over as before.
   28-Oct-2026: the menu in the middle of the window, not of the space left between the logo and the user menu. The logo's
   side and the right-hand side (.gm-navend) share the room equally; the menu's box (#menu) steps aside so its two parts sit in
   the row themselves. A side only grows past its share when its content needs it, so the build beside the logo shows only
   where that leaves the menu centred (from 1760px; narrower it is in the user menu, gm-narrow-only in portal-menu.css), and
   the long labels from 1340px. */
.gm-devinfo { display: none; color: rgba(255, 255, 255, .72); font-size: 11px; font-weight: 400; line-height: 1.35; white-space: nowrap; }
.gm-devinfo .gm-setup2fa { color: #fff; text-decoration: underline; font-weight: 600; }
@media (min-width: 768px) {
    .gm-navrow { display: flex; align-items: center; padding-left: 16px; padding-right: 16px; }
    .gm-navrow::before, .gm-navrow::after, .gm-navrow > #menu::before, .gm-navrow > #menu::after { display: none; }
    .gm-navrow > .navbar-header { float: none; display: flex; align-items: center; gap: 16px; flex: 1 1 0; }
    .gm-navrow > #menu { display: contents !important; }
    .gm-navrow > #menu > .navbar-nav:first-child { float: none; flex: 0 1 auto; margin: 0; display: flex; flex-wrap: wrap; justify-content: center; }
    .gm-navrow > #menu > .navbar-nav:first-child > li { float: none; }
    .gm-navend { flex: 1 1 0; display: flex; align-items: center; justify-content: flex-end; }
    .gm-navend > .navbar-left { float: none; }
    .gm-navend > .navbar-right { float: none; margin-right: 0; }
}
@media (min-width: 1760px) {
    .gm-devinfo { display: block; }
}
/* the long labels from 1340px, the short ones below it (the full name is the link's title) */
.gm-short { display: none; }
@media (max-width: 1339px) {
    .gm-long { display: none; }
    .gm-short { display: inline; }
}
