/* ==========================================================
   HOME PORTAL - GLOBAL SITE STYLES + LOGIN (SCOPED)
   ----------------------------------------------------------
   IMPORTANT:
   - This file is loaded site-wide by Pages/Shared/_Layout.cshtml.
   - Login page uses Layout = null and also loads this file.
   - Therefore, ALL login-only CSS MUST be scoped to body.login-page.
   ========================================================== */

/* ---------- Base ---------- */
*, *::before, *::after {
    box-sizing: border-box;
}

html, body {
    height: 100%;
}

:root {
    --bg-a: #102a55;
    --bg-b: #07172f;
    --bg-c: #030812;
    --panel-a: rgba(12, 24, 48, 0.92);
    --panel-b: rgba(7, 14, 28, 0.92);
    --text: rgba(255,255,255,0.92);
    --muted: rgba(255,255,255,0.70);
    --border: rgba(255,255,255,0.10);
    --border-strong: rgba(255,255,255,0.16);
    --shadow-md: 0 10px 28px rgba(0,0,0,0.55);
    --shadow-lg: 0 18px 50px rgba(0,0,0,0.70);
    --primary-a: rgba(77, 144, 254, 0.92);
    --primary-b: rgba(42, 102, 214, 0.92);
    --danger-a: rgba(214, 44, 68, 0.92);
    --danger-b: rgba(176, 0, 32, 0.92);
    --header-brand-height: 98px;
    --header-nav-height: 54px;
    --header-total-height: 170px;
}

body {
    margin: 0;
    font-family: "Segoe UI", Tahoma, Arial, sans-serif;
    color: var(--text);
    background: radial-gradient(circle at top left, var(--bg-a) 0%, var(--bg-b) 45%, var(--bg-c) 100%);
}

img {
    max-width: 100%;
    height: auto;
}

a {
    color: inherit;
}

/* ---------- Top Bar ---------- */
.topbar {
    position: sticky;
    top: 0;
    z-index: 1000;
    backdrop-filter: blur(8px);
    background: linear-gradient(180deg, rgba(10, 20, 40, 0.92), rgba(6, 12, 24, 0.80));
    border-bottom: 1px solid var(--border);
}

.topbar-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 12px 16px;
}

.topbar-left,
.topbar-right {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.badge-user,
.badge {
    display: inline-flex;
    align-items: center;
    padding: 6px 10px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.10);
    color: rgba(255, 255, 255, 0.86);
    font-size: 0.9rem;
}

/* ---------- Main Container ---------- */
.main {
    max-width: 1400px;
    margin: 0 auto;
    padding: 22px 24px 34px;
}

@media (max-width: 700px) {
    .main {
        padding: 16px 14px 28px;
    }
}

/* ---------- Titles ---------- */
.page-title {
    margin: 0 0 16px;
    font-size: 2rem;
    letter-spacing: 0.2px;
    line-height: 1.15;
}

.page-title-pill {
    display: inline-block;
    padding: 10px 14px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.10);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.subtle {
    color: var(--muted);
    margin: 6px 0 0;
}

/* ---------- Cards ---------- */
.card {
    background: linear-gradient(180deg, var(--panel-a), var(--panel-b));
    border: 1px solid var(--border);
    border-radius: 16px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), var(--shadow-md);
    padding: 16px;
}

.card-header {
    margin-bottom: 10px;
}

.card-title {
    margin: 0;
    font-size: 1.15rem;
}

.actions {
    margin-top: 14px;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
}

/* ---------- Buttons (site-wide) ---------- */
.button,
button.button,
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 36px;
    padding: 0 14px;
    border-radius: 10px;
    min-width: 78px;
    text-decoration: none;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.14);
    color: rgba(255, 255, 255, 0.92);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 10px 24px rgba(0, 0, 0, 0.45);
    transition: transform 0.08s ease, background 0.12s ease, border-color 0.12s ease;
}

    .button:hover,
    button.button:hover,
    .btn:hover {
        background: rgba(255, 255, 255, 0.10);
        border-color: rgba(255, 255, 255, 0.20);
        transform: translateY(-1px);
    }

    .button:active,
    button.button:active,
    .btn:active {
        transform: translateY(0);
    }

    .button.primary,
    button.button.primary,
    .btn-primary {
        background: linear-gradient(180deg, var(--primary-a), var(--primary-b));
        border-color: rgba(77, 144, 254, 0.35);
    }

        .button.primary:hover,
        button.button.primary:hover,
        .btn-primary:hover {
            border-color: rgba(77, 144, 254, 0.55);
        }

    .button.danger,
    button.button.danger {
        background: linear-gradient(180deg, var(--danger-a), var(--danger-b));
        border-color: rgba(214, 44, 68, 0.45);
    }

        .button.danger:hover,
        button.button.danger:hover {
            border-color: rgba(214, 44, 68, 0.65);
        }

    .button[disabled],
    button.button[disabled],
    button.button:disabled,
    .btn[disabled] {
        opacity: 0.55;
        cursor: not-allowed;
        transform: none;
    }

    .button.active {
        background: rgba(255, 255, 255, 0.12);
        border-color: rgba(255, 255, 255, 0.22);
    }

/* ---------- Utility ---------- */
.mobile-only {
    display: none !important;
}

@media (max-width: 900px) {
    .mobile-only {
        display: inline-flex !important;
    }
}

/* ---------- File upload ---------- */
input[type="file"] {
    color: rgba(255, 255, 255, 0.92);
}

    input[type="file"]::file-selector-button {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        height: 36px;
        padding: 0 14px;
        border-radius: 10px;
        min-width: 78px;
        background: rgba(255, 255, 255, 0.06);
        border: 1px solid rgba(255, 255, 255, 0.14);
        color: rgba(255, 255, 255, 0.92);
        box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 10px 24px rgba(0, 0, 0, 0.45);
        cursor: pointer;
        margin-right: 10px;
    }

        input[type="file"]::file-selector-button:hover {
            background: rgba(255, 255, 255, 0.10);
            border-color: rgba(255, 255, 255, 0.20);
        }

/* ---------- Search Inputs ---------- */
.search-input,
input[type="text"].search-input,
input[type="number"].search-input,
select.search-input,
textarea.search-input {
    padding: 10px 12px;
    border-radius: 8px;
    border: 1px solid rgba(255,255,255,0.15);
    background-color: #0d2244;
    color: #ffffff;
    min-height: 36px;
}

    .search-input:focus {
        outline: none;
        background-color: #2b2b2b;
        border-color: #4d90fe;
    }

/* ---------- Form Inputs ---------- */
input[type="text"],
input[type="password"],
input[type="number"],
input[type="email"],
input[type="tel"],
input[type="search"],
input[type="date"],
input[type="datetime-local"],
select,
textarea,
.input,
.form-control {
    padding: 10px 12px;
    border-radius: 8px;
    border: 1px solid rgba(255,255,255,0.15);
    background-color: #0d2244;
    color: #ffffff;
    min-height: 36px;
}

    input[type="text"]:focus,
    input[type="password"]:focus,
    input[type="number"]:focus,
    input[type="email"]:focus,
    input[type="tel"]:focus,
    input[type="search"]:focus,
    input[type="date"]:focus,
    input[type="datetime-local"]:focus,
    select:focus,
    textarea:focus,
    .input:focus,
    .form-control:focus {
        outline: none;
        background-color: #2b2b2b;
        border-color: #4d90fe;
    }

/* ---------- File Upload button duplicates for compatibility ---------- */
input[type="file"]::-webkit-file-upload-button {
    height: 36px;
    padding: 0 14px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    background: rgba(255, 255, 255, 0.06);
    color: rgba(255, 255, 255, 0.92);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 10px 24px rgba(0, 0, 0, 0.45);
    cursor: pointer;
    margin-right: 10px;
}

    input[type="file"]::-webkit-file-upload-button:hover {
        background: rgba(255, 255, 255, 0.10);
        border-color: rgba(255, 255, 255, 0.20);
    }

/* ---------- Consistent Edit Forms ---------- */
.form-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
    max-width: 520px;
}

    .form-grid .form-group {
        display: flex;
        align-items: center;
        gap: 12px;
    }

        .form-grid .form-group label {
            flex: 0 0 150px;
            margin: 0;
            color: rgba(255,255,255,0.92);
        }

        .form-grid .form-group input,
        .form-grid .form-group select,
        .form-grid .form-group textarea {
            flex: 0 0 320px;
            width: 320px;
        }

        .form-grid .form-group.full-width {
            align-items: flex-start;
        }

            .form-grid .form-group.full-width textarea {
                flex: 1 1 auto;
                width: 100%;
                max-width: 520px;
                min-height: 110px;
            }

@media (max-width: 980px) {
    .form-grid {
        max-width: 100%;
    }

        .form-grid .form-group {
            flex-wrap: wrap;
        }

            .form-grid .form-group label {
                flex: 0 0 100%;
            }

            .form-grid .form-group input,
            .form-grid .form-group select,
            .form-grid .form-group textarea {
                width: 100%;
                flex-basis: 100%;
            }
}

/* ---------- Tables ---------- */
.table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 0.95rem;
}

    .table thead th {
        text-align: left;
        padding: 8px 12px;
        border-bottom: 1px solid rgba(255,255,255,0.12);
        color: rgba(255,255,255,0.92);
    }

    .table tbody td {
        padding: 8px 12px;
        border-bottom: 1px solid rgba(255,255,255,0.08);
        vertical-align: middle;
    }

    .table tbody tr:hover {
        background: rgba(255,255,255,0.03);
    }

.actions-col {
    width: 300px;
    text-align: right;
    white-space: nowrap;
}

.actions-col-wide {
    width: 340px;
}

.row-actions {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 8px;
    flex-wrap: nowrap;
}

    .row-actions form {
        margin: 0;
        display: inline-flex;
        align-items: center;
    }

.inline-form {
    margin: 0;
    display: inline-flex;
    align-items: center;
}

.table-actions-cell-wide {
    min-width: 340px;
}

.firearms-actions-cell {
    min-width: 340px;
}

.row-actions .button,
.row-actions button.button {
    margin: 0;
}

.col-center {
    text-align: center;
}

/* ---------- Form layout helpers ---------- */
.label {
    display: block;
    margin-bottom: 6px;
    color: rgba(255,255,255,0.88);
    font-weight: 600;
}

.input,
select.input,
textarea.input {
    width: 100%;
    padding: 10px 12px;
    border-radius: 8px;
    border: 1px solid rgba(255,255,255,0.15);
    background-color: #0d2244;
    color: #ffffff;
}

    .input:focus,
    select.input:focus,
    textarea.input:focus {
        outline: none;
        background-color: #2b2b2b;
        border-color: #4d90fe;
    }

.form-row {
    display: grid;
    grid-template-columns: 180px 1fr;
    gap: 12px;
    align-items: center;
    margin: 10px 0;
}

    .form-row > .label {
        margin: 0;
        padding-top: 2px;
    }

.checkbox-label {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
    color: rgba(255,255,255,0.88);
}

.filter-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 14px;
    align-items: end;
    margin: 0;
}

    .filter-grid > div {
        min-width: 0;
    }

/* ---------- Alerts ---------- */
.alert {
    padding: 12px 14px;
    border-radius: 12px;
    border: 1px solid rgba(255,255,255,0.10);
    margin: 0 0 12px;
}

    .alert.success {
        background: rgba(46,125,50,0.12);
        border-color: rgba(46,125,50,0.35);
    }

    .alert.danger {
        background: rgba(176,0,32,0.12);
        border-color: rgba(176,0,32,0.35);
    }

/* ---------- Portal Home ---------- */
.portal-hero {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding-top: 8px;
}

.portal-logo-home {
    position: fixed;
    top: 96px;
    left: 24px;
    width: 220px;
    height: auto;
    filter: drop-shadow(0 18px 40px rgba(0, 0, 0, 0.55));
    z-index: 5;
}

.portal-hero-right {
    width: min(980px, 100%);
    min-width: 320px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

    .portal-hero-right .page-title {
        text-align: center;
    }

    .portal-hero-right .portal {
        width: 100%;
    }

.portal {
    margin-top: 12px;
}

.portal-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 16px;
}

.portal-card {
    flex: 0 0 360px;
}

    .portal-card h3 {
        margin: 0 0 8px;
    }

.portal-card-disabled {
    opacity: 0.75;
}

@media (max-width: 1200px) {
    .portal-card {
        flex-basis: 340px;
    }
}

@media (max-width: 980px) {
    .portal-card {
        flex-basis: 100%;
    }

    .portal-hero {
        padding-top: 90px;
    }

    .portal-logo-home {
        width: min(220px, 42vw);
    }
}

/* ---------- Reports Index ---------- */
.reports-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 16px;
    margin-top: 14px;
}

.report-card {
    width: 360px;
    background: linear-gradient(180deg, var(--panel-a), var(--panel-b));
    border: 1px solid var(--border);
    border-radius: 16px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), var(--shadow-md);
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.report-card-title {
    font-weight: 800;
    font-size: 1.05rem;
}

.report-card-desc {
    color: var(--muted);
}

/* ---------- Login page ---------- */
body.login-page {
    min-height: 100vh;
    background: radial-gradient(circle at top left, var(--bg-a) 0%, var(--bg-b) 45%, var(--bg-c) 100%);
    position: relative;
    margin: 0;
    color: var(--text);
}

    body.login-page .login-logo {
        position: absolute;
        top: 24px;
        left: 24px;
    }

        body.login-page .login-logo img {
            width: 220px;
            height: auto;
        }

    body.login-page .login-container {
        display: flex;
        justify-content: center;
        align-items: center;
        min-height: 100vh;
    }

    body.login-page .login-box {
        width: 520px;
        padding: 20px 34px;
        border-radius: 16px;
        background: linear-gradient(180deg, rgba(12, 24, 48, 0.965), rgba(7, 14, 28, 0.965));
        border: 1px solid rgba(255, 255, 255, 0.10);
        box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.10), inset 0 -10px 18px rgba(0, 0, 0, 0.28), 0 18px 50px rgba(0, 0, 0, 0.70), 0 2px 0 rgba(255, 255, 255, 0.04);
        backdrop-filter: blur(7px);
    }

@media (max-width: 600px) {
    body.login-page .login-logo {
        top: 18px;
        left: 18px;
    }

        body.login-page .login-logo img {
            width: 220px;
            max-width: 55vw;
            height: auto;
        }

    body.login-page .login-box {
        width: min(520px, 92vw);
        padding: 18px 22px;
    }

    body.login-page .login-group {
        max-width: 420px;
    }
}

body.login-page .login-instruction {
    text-align: center;
    font-size: 0.95rem;
    color: rgba(255,255,255,0.85);
    margin-top: -4px;
    margin-bottom: 14px;
}

body.login-page .login-fields {
    display: flex;
    flex-direction: column;
    align-items: center;
}

body.login-page .login-group {
    width: 100%;
    max-width: 380px;
    margin-bottom: 12px;
}

    body.login-page .login-group label {
        margin-bottom: 6px;
        display: block;
        color: rgba(255,255,255,0.9);
    }

body.login-page .login-input {
    width: 100%;
    padding: 10px 12px;
    border-radius: 8px;
    border: 1px solid rgba(255,255,255,0.15);
    background-color: #0d2244;
    color: #ffffff;
}

    body.login-page .login-input:focus {
        outline: none;
        background-color: #2b2b2b;
        border-color: #4d90fe;
    }

body.login-page .login-button {
    margin-top: 10px;
    padding: 0 28px;
    height: 38px;
}

/* ---------- Music UI ---------- */
.music-container {
    max-width: 1320px;
    margin: 0 auto;
}

.music-search {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

    .music-search .input {
        min-width: 260px;
    }

.music-album-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 14px;
    align-items: start;
}

.music-album-card {
    display: block;
    text-decoration: none;
    color: inherit;
    border-radius: 14px;
    overflow: hidden;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.08);
    transition: transform 120ms ease, background 120ms ease, border-color 120ms ease;
}

    .music-album-card:hover {
        transform: translateY(-1px);
        background: rgba(255,255,255,0.075);
        border-color: rgba(255,255,255,0.14);
    }

.music-album-art {
    width: 100%;
    aspect-ratio: 1 / 1;
    background: rgba(255,255,255,0.05);
    overflow: hidden;
}

    .music-album-art img {
        width: 100%;
        height: 100%;
        display: block;
        object-fit: cover;
    }

.music-album-art-fallback {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    opacity: 0.7;
}

.music-album-meta {
    padding: 10px 12px 12px 12px;
}

.music-album-title {
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.music-album-artist {
    opacity: 0.86;
    font-size: 0.95rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.music-album-sub {
    margin-top: 6px;
    opacity: 0.72;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 6px;
}

.music-dot {
    opacity: 0.5;
}

.playlist-status {
    margin-bottom: 10px;
    min-height: 18px;
}

    .playlist-status.ok {
        opacity: 0.9;
    }

    .playlist-status.warn {
        opacity: 0.95;
    }

.playlist-table thead th {
    padding: 8px 10px;
}

.playlist-table tbody td {
    padding: 7px 10px;
    vertical-align: middle;
}

.playlist-row {
    user-select: none;
}

    .playlist-row:hover {
        background: rgba(255,255,255,0.035);
    }

.playlist-col-order {
    width: 88px;
    white-space: nowrap;
}

.playlist-order {
    display: flex;
    align-items: center;
    gap: 10px;
}

.playlist-grip {
    display: inline-block;
    width: 18px;
    text-align: center;
    opacity: 0.55;
    cursor: grab;
    letter-spacing: -1px;
}

.playlist-order-num {
    opacity: 0.8;
    font-variant-numeric: tabular-nums;
}

.playlist-col-actions {
    width: 190px;
    text-align: right;
    white-space: nowrap;
}

.playlist-actions {
    gap: 6px;
}

.playlist-track-title {
    font-weight: 750;
    line-height: 1.2;
    margin-bottom: 2px;
}

.playlist-track-sub {
    opacity: 0.78;
    font-size: 0.92rem;
    line-height: 1.2;
}

.sortable-ghost {
    opacity: 0.35;
}

.sortable-chosen {
    background: rgba(255,255,255,0.06);
}

.sortable-drag {
    background: rgba(0,0,0,0.25);
}

/* ---------- Music Play All / Inline Player ---------- */
.hp-music-player {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

    .hp-music-player .hp-now {
        min-width: 220px;
    }

    .hp-music-player .hp-now-title {
        font-weight: 700;
    }

    .hp-music-player .hp-now-sub {
        opacity: .8;
        font-size: .92rem;
    }

    .hp-music-player audio {
        width: min(640px,100%);
    }

    .hp-music-player .hp-status {
        opacity: .8;
        font-size: .9rem;
    }

.music-album-card {
    position: relative;
}

.music-album-play {
    position: absolute;
    left: 10px;
    top: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 999px;
    background: rgba(0,0,0,.45);
    backdrop-filter: blur(6px);
    text-decoration: none;
}

    .music-album-play:hover {
        background: rgba(0,0,0,.6);
    }

    .music-album-play span {
        font-size: 18px;
        line-height: 1;
    }

.music-bulkbar {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
    margin: 10px 0;
}

.music-selectbox {
    position: absolute;
    right: 10px;
    top: 10px;
    background: rgba(0,0,0,.45);
    backdrop-filter: blur(6px);
    padding: 6px;
    border-radius: 10px;
}

    .music-selectbox input {
        transform: scale(1.15);
    }

.music-bulkpanel {
    margin-top: 10px;
    padding: 12px;
    border: 1px solid rgba(255,255,255,.08);
    border-radius: 12px;
}

/* ==========================================================
   2026-03-18 UI cleanup overrides
   ========================================================== */
.portal-header-shell {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1100;
    backdrop-filter: blur(10px);
    background: linear-gradient(180deg, rgba(6, 14, 30, 0.96), rgba(4, 10, 22, 0.90));
    border-bottom: 1px solid rgba(255,255,255,0.10);
    box-shadow: 0 10px 26px rgba(0,0,0,0.28);
}

.portal-header-brand-row {
    min-height: var(--header-brand-height);
    display: grid;
    grid-template-columns: 140px 1fr 140px;
    align-items: center;
    gap: 18px;
    max-width: 1400px;
    margin: 0 auto;
    padding: 10px 22px 8px;
}

.portal-brand-left,
.portal-brand-right {
    display: flex;
    align-items: center;
}

.portal-brand-left {
    justify-content: flex-start;
}

.portal-brand-right {
    justify-content: flex-end;
}

.portal-logo-link {
    display: inline-flex;
    align-items: center;
    text-decoration: none;
}

.portal-logo {
    display: block;
    object-fit: contain;
    filter: drop-shadow(0 6px 16px rgba(0,0,0,0.45));
}

.portal-logo-left {
    width: 88px;
    max-height: 74px;
}

.portal-logo-right {
    width: 72px;
    max-height: 66px;
}

.portal-brand-center {
    text-align: center;
}

.portal-brand-title-wrap {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.portal-brand-title {
    color: #ffffff;
    text-decoration: none;
    font-size: 2.05rem;
    font-weight: 800;
    letter-spacing: 0.2px;
    line-height: 1.1;
}

    .portal-brand-title:hover {
        color: #ffffff;
    }

.portal-brand-subtitle {
    color: rgba(255,255,255,0.78);
    font-size: 0.78rem;
    line-height: 1.2;
}

.portal-header-nav-row {
    min-height: var(--header-nav-height);
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    max-width: 1400px;
    margin: 0 auto;
    padding: 6px 22px 8px;
    border-top: 1px solid rgba(255,255,255,0.08);
}

.portal-nav-left,
.portal-nav-right {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

    .portal-nav-left .button,
    .portal-nav-right .button,
    .portal-nav-left .badge-user,
    .portal-nav-right .badge-user {
        margin: 0;
    }

.badge-user {
    height: 36px;
    padding: 0 14px;
    white-space: nowrap;
}

.main-app {
    max-width: 1400px;
    margin: 0 auto;
    padding: calc(var(--header-total-height) + 28px) 24px 32px;
}

.main-auth {
    max-width: none;
    padding: 0;
}

.portal-grid-home {
    margin-top: 2px;
}

.portal-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 16px;
}

.portal-card {
    min-height: 148px;
}

    .portal-card h3 {
        margin: 0 0 8px;
    }

.reports-grid-uniform {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 16px;
}

.report-menu-card {
    min-height: 152px;
    display: flex;
    flex-direction: column;
}

.report-card-title {
    font-size: 1.15rem;
    font-weight: 700;
    margin-bottom: 10px;
}

.report-card-desc {
    color: rgba(255,255,255,0.78);
    line-height: 1.45;
    flex: 1 1 auto;
}

.inventory-header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.inventory-filter-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 14px;
    align-items: end;
    margin-bottom: 16px;
}

.filter-field {
    min-width: 0;
}

.inventory-select,
.inventory-input,
.inventory-filter-grid .input,
.inventory-filter-grid select,
.inventory-filter-grid input[type="text"] {
    width: 100%;
    min-width: 0;
    height: 42px;
}

.filter-actions {
    display: flex;
    align-items: flex-end;
    justify-content: flex-start;
    min-height: 42px;
}

.table-actions-cell {
    text-align: right;
    white-space: nowrap;
}

.row-actions {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex-wrap: nowrap;
}

.row-actions-nowrap {
    flex-wrap: nowrap;
}

.row-actions-right {
    justify-content: flex-end;
}

.inline-form {
    display: inline-flex;
    margin: 0;
}

.col-center {
    text-align: center;
}

.presence-wrap {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
}

.presence-dot {
    width: 12px;
    height: 12px;
    border-radius: 999px;
    box-shadow: 0 0 0 2px rgba(255,255,255,0.08), 0 0 8px rgba(255,255,255,0.12);
    flex: 0 0 12px;
}

.presence-green {
    background: #2fd06d;
    box-shadow: 0 0 0 2px rgba(255,255,255,0.08), 0 0 10px rgba(47,208,109,0.7);
}

.presence-yellow {
    background: #ffd24d;
    box-shadow: 0 0 0 2px rgba(255,255,255,0.08), 0 0 10px rgba(255,210,77,0.7);
}

.presence-red {
    background: #ff5c6c;
    box-shadow: 0 0 0 2px rgba(255,255,255,0.08), 0 0 10px rgba(255,92,108,0.7);
}

.presence-gray {
    background: #9ca7ba;
}

/* Login page */
.login-shell {
    min-height: 100vh;
    padding: 26px 24px 40px;
}

.login-brand-row {
    display: grid;
    grid-template-columns: 160px 1fr 160px;
    align-items: center;
    gap: 18px;
    max-width: 1180px;
    margin: 0 auto 24px;
}

.login-brand-left,
.login-brand-right {
    display: flex;
    align-items: center;
}

.login-brand-left {
    justify-content: flex-start;
}

.login-brand-right {
    justify-content: flex-end;
}

.login-logo-left {
    width: 112px;
    max-height: 96px;
    object-fit: contain;
    filter: drop-shadow(0 8px 18px rgba(0,0,0,0.45));
}

.login-logo-right {
    width: 92px;
    max-height: 86px;
    object-fit: contain;
    filter: drop-shadow(0 8px 18px rgba(0,0,0,0.45));
}

.login-brand-center {
    text-align: center;
}

.login-brand-title {
    font-size: 2.45rem;
    font-weight: 800;
    color: #fff;
    line-height: 1.1;
}

.login-brand-subtitle {
    margin-top: 6px;
    color: rgba(255,255,255,0.78);
    font-size: 0.98rem;
}

.login-card-wrap {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding-top: 10px;
}

.login-card {
    width: 100%;
    max-width: 460px;
    padding: 28px;
    border-radius: 18px;
    background: linear-gradient(180deg, rgba(11,22,43,0.92), rgba(7,14,28,0.95));
    border: 1px solid rgba(255,255,255,0.10);
    box-shadow: 0 16px 42px rgba(0,0,0,0.45);
}

.login-instruction {
    margin-bottom: 18px;
    text-align: center;
    color: rgba(255,255,255,0.86);
}

.login-form {
    display: grid;
    gap: 14px;
}

.login-group label {
    display: block;
    margin-bottom: 6px;
    color: rgba(255,255,255,0.90);
}

.login-input {
    width: 100%;
    height: 44px;
    padding: 0 12px;
    border-radius: 10px;
    border: 1px solid rgba(255,255,255,0.16);
    background: rgba(13,34,68,0.88);
    color: #fff;
}

.login-buttons-row {
    display: flex;
    align-items: stretch;
    justify-content: center;
    gap: 12px;
    margin-top: 4px;
}

.login-action-button {
    min-width: 160px;
    height: 42px;
}

@media (max-width: 980px) {
    :root {
        --header-brand-height: 88px;
        --header-nav-height: 84px;
        --header-total-height: 188px;
    }

    .portal-header-brand-row {
        grid-template-columns: 92px 1fr 92px;
        gap: 12px;
        padding: 10px 14px 8px;
    }

    .portal-logo-left {
        width: 72px;
        max-height: 62px;
    }

    .portal-logo-right {
        width: 58px;
        max-height: 54px;
    }

    .portal-brand-title {
        font-size: 1.7rem;
    }

    .portal-brand-subtitle {
        font-size: 0.72rem;
    }

    .portal-header-nav-row {
        padding: 8px 14px 10px;
        align-items: flex-start;
    }

    .main-app {
        padding-top: calc(var(--header-total-height) + 20px);
    }

    .inventory-filter-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .login-brand-row {
        grid-template-columns: 92px 1fr 92px;
        gap: 10px;
    }

    .login-logo-left {
        width: 72px;
        max-height: 64px;
    }

    .login-logo-right {
        width: 60px;
        max-height: 56px;
    }

    .login-brand-title {
        font-size: 2rem;
    }
}

@media (max-width: 640px) {
    :root {
        --header-brand-height: 80px;
        --header-nav-height: 110px;
        --header-total-height: 210px;
    }

    .portal-header-brand-row {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .portal-brand-left,
    .portal-brand-right {
        justify-content: center;
    }

    .portal-header-nav-row {
        flex-direction: column;
        align-items: stretch;
    }

    .portal-nav-left,
    .portal-nav-right {
        justify-content: center;
    }

    .main-app {
        padding: calc(var(--header-total-height) + 18px) 14px 24px;
    }

    .portal-grid,
    .reports-grid-uniform,
    .inventory-filter-grid {
        grid-template-columns: 1fr;
    }

    .login-brand-row {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .login-brand-left,
    .login-brand-right {
        justify-content: center;
    }

    .login-buttons-row {
        flex-direction: column;
    }

    .login-action-button {
        width: 100%;
    }
}


/* ---------- Global Site Seal ---------- */
.hp-site-seal {
    position: fixed;
    right: 16px;
    bottom: 14px;
    z-index: 1200;
    opacity: 0.82;
    transform: scale(0.82);
    transform-origin: bottom right;
    transition: opacity 0.15s ease, transform 0.15s ease;
    pointer-events: auto;
}

    .hp-site-seal:hover {
        opacity: 1;
        transform: scale(0.86);
    }

    .hp-site-seal a {
        display: block;
        text-decoration: none;
        filter: drop-shadow(0 10px 24px rgba(0, 0, 0, 0.40));
    }

body.login-page .hp-site-seal {
    right: 14px;
    bottom: 12px;
    opacity: 0.78;
}

@media (max-width: 980px) {
    .hp-site-seal {
        right: 10px;
        bottom: 10px;
        transform: scale(0.72);
    }

        .hp-site-seal:hover {
            transform: scale(0.75);
        }
}

@media (max-width: 640px) {
    .hp-site-seal {
        transform: scale(0.64);
        right: 6px;
        bottom: 6px;
        opacity: 0.72;
    }

        .hp-site-seal:hover {
            transform: scale(0.66);
        }
}
