:root {
    --dark-bg: #4a4a4a; /* Dark gray base */
    --red-bg: #600000; /* Deep red */
    --blue-bg: #0A2A66;
    --text-color: #d3d3d3; /* Light gray/white text */
    --red-shadow: 0 4px 8px rgba(128, 0, 0, 0.2); /* Faded red shadow */
    --red-accent: rgba(255, 0, 0, 0.4); /* Lighter red for accents */
    --red-hover: #cc0000; /* Darker red for hover */
    --dark-secondary: #4a4a4a; /* Lighter gray for secondary elements */
    --dark-tertiary: #666666; /* Even lighter gray */
    --hover-bg: #555555; /* Light gray for hover */
    --shadow: var(--red-shadow); /* Alias for red shadow */
}

html {
    height: 100%;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    color: var(--text-color);
    height: 100%;
    padding: 0;
}

.nav-container {
    position: relative;
}

.page {
    width: 100%; /* Full width */
    display: block;
    color: var(--text-color);
    min-height: 100vh;
    background: linear-gradient(160deg, var(--dark-bg) 55%, var(--blue-bg) 100%) !important;
    background-size: cover !important;
    position: relative; /* Ensure content layers over background */
    background: transparent; /* Remove inherited background */
}

.sidebar {
    position: fixed;
    top: 60px;
    left: 0;
    width: 220px;
    height: calc(100vh - 60px);
    background: #2f2f2f;
    overflow-y: auto;
    z-index: 1000;
}

.nav-toggle-label {
    appearance: none;
    cursor: pointer;
    width: 3.5rem;
    height: 2.5rem;
    color: white;
    position: fixed;
    top: 1rem;
    right: 1rem;
    border: 1px solid darkred;
    background: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba(255, 255, 255, 0.55)' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e") no-repeat center/1.75rem rgba(255, 255, 255, 0.1);
    display: none; /* Hidden by default, shown on small screens or when minimized */
    z-index: 11;
}

.nav-toggle {
    display: none; /* Hidden checkbox */
}

    .nav-toggle:checked ~ .sidebar {
        transform: translateX(-100%); /* Minimize sidebar */
        width: 0; /* Collapse width on toggle */
    }

.nav-menu {
    padding: 10px;
    width: 100%;
    overflow-y: auto;
    height: calc(100vh - 3.5rem);
}

.nav-section-header {
    color: var(--text-color);
    text-transform: uppercase;
    text-shadow: 1px 1px 2px rgba(128, 0, 0, 0.3);
    font-size: 1.1em;
    font-weight: bold;
}

.nav-item {
    font-size: 0.9rem;
}

    .nav-item:last-of-type {
        padding-bottom: 0.5rem;
    }

    .nav-item ::deep .nav-link {
        border-radius: 3px;
        display: flex;
        align-items: center;
        line-height: 2rem;
        width: 100%;
        color: var(--text-color);
        text-decoration: none;
    }

    .nav-item ::deep a.active {
        background-color: rgba(255, 255, 255, 0.37);
        color: var(--red-accent);
    }

    .nav-item ::deep .nav-link:hover {
        background-color: var(--hover-bg);
        color: var(--text-color);
    }


.nav-link {
    color: var(--text-color);
    padding: 0.5rem 1rem;
    display: flex;
    align-items: center;
    margin-left: 10px;
    transition: background-color 0.3s, color 0.3s, transform 0.2s;
}

    .nav-link:hover {
        transform: translateX(5px);
        box-shadow: var(--red-shadow);
    }


.top-row {
    position: fixed;
    top: 0;
    right: 0;
    height: 60px;
    display: flex;
    align-items: center;
    background-color: var(--dark-secondary);
    z-index: 1100;
    margin-bottom: 10px;
}

.navbar-brand {
    padding: 0;
    font-size: 1.5rem;
    text-align: center;
    color: var(--text-color);
    flex-grow: 1;
}

.bi {
    display: inline-block;
    position: relative;
    width: 1.25rem;
    height: 1.25rem;
    margin-right: 0.75rem;
    top: -1px;
    background-size: cover;
    color: var(--red-accent);
}

.bi-house-door-fill-nav-menu {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='var(--text-color, #d3d3d3)' class='bi bi-house-door-fill' viewBox='0 0 16 16'%3E%3Cpath d='M6.5 14.5v-3.505c0-.245.25-.495.5-.495h2c.25 0 .5.25.5.5v3.5a.5.5 0 0 0 .5.5h4a.5.5 0 0 0 .5-.5v-7a.5.5 0 0 0-.146-.354L13 5.793V2.5a.5.5 0 0 0-.5-.5h-1a.5.5 0 0 0-.5.5v1.293L8.354 1.146a.5.5 0 0 0-.708 0l-6 6A.5.5 0 0 0 1.5 7.5v7a.5.5 0 0 0 .5.5h4a.5.5 0 0 0 .5-.5Z'/%3E%3C/svg%3E");
}

.bi-plus-square-fill-nav-menu {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='var(--text-color, #d3d3d3)' class='bi bi-plus-square-fill' viewBox='0 0 16 16'%3E%3Cpath d='M2 0a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V2a2 2 0 0 0-2-2H2zm6.5 4.5v3h3a.5.5 0 0 1 0 1h-3v3a.5.5 0 0 1-1 0v-3h-3a.5.5 0 0 1 0-1h3v-3a.5.5 0 0 1 1 0z'/%3E%3C/svg%3E");
}

.bi-list-nested-nav-menu {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='var(--text-color, #d3d3d3)' class='bi bi-list-nested' viewBox='0 0 16 16'%3E%3Cpath fill-rule='evenodd' d='M4.5 11.5A.5.5 0 0 1 5 11h10a.5.5 0 0 1 0 1H5a.5.5 0 0 1-.5-.5zm-2-4A.5.5 0 0 1 3 7h10a.5.5 0 0 1 0 1H3a.5.5 0 0 1-.5-.5zm-2-4A.5.5 0 0 1 1 3h10a.5.5 0 0 1 0 1H1a.5.5 0 0 1-.5-.5z'/%3E%3C/svg%3E");
}

@media print {
    body * {
        visibility: hidden;
    }

    .receipt-details, .receipt-details * {
        visibility: visible;
    }

    .receipt-details {
        position: absolute;
        left: 0;
        top: 0;
        width: 100%;
    }
}

/* ANIMATION */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(15px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}
@media (max-width: 640.98px) {
    .nav-toggle-label {
        display: block;
    }

    .sidebar {
        transform: translateX(-100%);
        width: 0; /* Minimized by default */
    }

    .nav-toggle:checked ~ .sidebar {
        transform: translateX(0);
        width: 250px; /* Expand on toggle */
    }

    #navbarNav {
        display: none;
    }

    .nav-toggle:checked ~ .sidebar .nav-menu {
        display: block;
    }
}
@keyframes float {
    0%, 100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-20px);
    }
}

@media (min-width: 641px) {
    .sidebar {
        height: 100vh;
        top: 0;
        transform: translateX(0);
    }

    .top-row {
        top: 0;
        z-index: 1;
    }

        .top-row.auth ::deep a:first-child {
            flex: 1;
            text-align: right;
            width: 0;
        }

    .top-row, article {
        padding-right: 1.5rem !important;
    }


    .nav-toggle-label {
        display: block; /* Show hamburger on large screens */
    }

    .nav-toggle:checked ~ .sidebar {
        transform: translateX(-100%);
        width: 0; /* Minimize on toggle */
    }

    #navbarNav {
        display: block !important;
    }
}
@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(139,0,0,0.5);
    }

    70% {
        box-shadow: 0 0 0 18px rgba(139,0,0,0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(139,0,0,0);
    }
}

@keyframes blink {
    0%,100% {
        opacity: 0.3;
    }

    50% {
        opacity: 1;
    }
}

.dots {
    animation: blink 1.2s infinite;
}
#blazor-error-ui {
    background: lightyellow;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    box-sizing: border-box;
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}

    #blazor-error-ui .dismiss {
        cursor: pointer;
        position: absolute;
        right: 0.75rem;
        top: 0.5rem;
    }


/* Inspection Tabs*/
.scrollable-tabs-container {
    overflow-x: auto; /* Enables horizontal scrolling */
    white-space: nowrap; /* Prevents wrapping of tabs */
    width: 100%; /* Full width of the parent container */
    -webkit-overflow-scrolling: touch; /* Smooth scrolling on mobile */
}

.scrollable-content-container {
    overflow-x: auto; /* Enables horizontal scrolling for content */
    white-space: nowrap; /* Prevents wrapping of tabs */
    width: 100%; /* Full width of the parent container */
    -webkit-overflow-scrolling: touch; /* Smooth scrolling on mobile */
}

.tab-content {
    table-layout: fixed; /* Prevents table from shrinking */
    overflow-x: auto; /* Enables horizontal scrolling */
    white-space: nowrap; /* Prevents wrapping of tabs */
    width: 90%; /* Full width of the parent container */
    -webkit-overflow-scrolling: touch; /* Smooth scrolling on mobile */
}

.tab-pane {
    width: 100%;
    table-layout: fixed; /* Prevents from shrinking */
    overflow-x: auto; /* Enables horizontal scrolling */
}

.nav-tabs {
    display: flex; /* Keeps tabs in a single row */
    flex-wrap: nowrap; /* Prevents wrapping */
    color: green;
}

.content {
    padding-top: 1.1rem;
}

h1:focus {
    outline: none;
}

.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

.invalid {
    outline: 1px solid var(--red-hover);
}

.validation-message {
    color: var(--red-hover);
}

.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyNjcuNTM5IDUzLjYyODMgMjkwLjE4NSA5Mi4xODMxIDI5MC41NDUgOTIuNzk1IDI5MC42NTYgOTIuOTk2QzI5MC44NzcgOTMuNTEzIDI5MSA9NC4wODE1IDI5MSA5NC42NzgyIDI5MSA5Ny4wNjUxIDI4OS4wMzggOTkgMjg2LjYxNyA5OUwyNDAuMzgzIDk5QzIzNy45NjMgOTkgMjM2IDk3LjA2NTEgMjM2IDk0LjY3ODIgMjM2IDk0LjM3OTkgMjM2LjAzMSA5NC4wODg2IDIzNi4wODkgOTMuODA3MkwyMzYuMzM4IDkzLjAxNjIgMjM2Ljg1OCA5Mi4xMzE0IDI1OS40NzMgNTMuNjI5NCAyNTkuOTYxIDUyLjc5ODUgMjYwLjQwNyA1Mi4yNjU4QzI2MS4yIDUxLjQ4MzcgMjYyLjI5NiA1MSAyNjMuNTA2IDUxWk0yNjMuNTg2IDY2LjAxODNDMjYwLjczNyA2Ni4wMTgzIDI1OS4zMTMgNjcuMTI0NSAyNTkuMzEzIDY5LjMzNyAyNTkuMzEzIDY5LjYxMDIgMjU5LjMzMiA2OS44NjA4IDI1OS4zNzEgNzAuMDg4N0wyNjEuNzk1IDg0LjAxNjEgMjY1LjM4IDg0LjAxNjEgMjY3LjgyMSA2OS43NDc1QzI2Ny44NiA2OS43MzA5IDI2Ny44NzkgNjkuNTg3NyAyNjcuODc5IDY5LjMxNzkgMjY3Ljg3OSA2Ny4xMTgyIDI2Ni40NDggNjYuMDE4MyAyNjMuNTg2IDY2LjAxODNaTTI2My41NzYgODYuMDU0N0MyNjEuMDQ5IDg2LjA1NDcgMjU5LjcyODYgODcuMzAwNSAyNTkuNzg2IDg5Ljc5MjEgMjU5Ljc4NiA5Mi4yODM3IDI2MS4wNDkgOTMuNTI5NSAyNjMuNTc2IDkzLjUyOTUgMjY2LjExNiA5My41Mjk1IDI2Ny4zODcgOTIuMjgzNyAyNjcuMzg3IDg5Ljc5MjEgMjY3LjM4NyA4Ny4zMDA1IDI2Ni4xMTYgODYuMDU0NyAyNjMuNTc2IDg2LjA1NDdaIiBmaWxsPSIjRkZFNTAwIiBmaWxsLXJ1bGU9ImV2ZW5vZGQiLz48L2c+PC9zdmc+) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

    .blazor-error-boundary::after {
        content: "An error has occurred.";
    }

.requirements-form-container {
    color: var(--text-color, #d3d3d3);
    padding: 1.5rem;
    box-shadow: var(--red-shadow, 0 4px 8px rgba(128, 0, 0, 0.2));
    transition: transform 0.3s, box-shadow 0.3s;
    display: flex;
    flex-direction: column;
    min-width: 80vw; /* Ensure full viewport width */
    margin: 0; /* Remove margins */
}

    .requirements-form-container:hover {
        transform: translateY(-2px);
        box-shadow: 0 6px 12px rgba(0, 0, 0, 0.4);
    }

    .requirements-form-container h3,
    .requirements-form-container h4,
    .requirements-form-container h5 {
        color: var(--text-color, #d3d3d3);
        margin-bottom: 1rem;
        text-shadow: 1px 1px 2px rgba(204, 0, 0, 0.3);
    }

.form-row {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin-bottom: 20px;
}

/* Royal dark blue redesign */
:root {
    --royal-blue-950: #07152e;
    --royal-blue-900: #0d2348;
    --royal-blue-800: #17356a;
    --royal-blue-700: #244b8f;
    --royal-red-700: #9f2035;
    --royal-red-600: #ba2d43;
    --surface-strong: rgba(8, 21, 46, 0.92);
    --surface-soft: rgba(18, 39, 77, 0.82);
    --surface-border: rgba(255, 255, 255, 0.1);
    --text-primary: #f5f7ff;
    --text-secondary: rgba(245, 247, 255, 0.76);
    --shadow-soft: 0 18px 40px rgba(0, 0, 0, 0.28);
}

html,
body {
    min-height: 100%;
    background:
        radial-gradient(circle at top left, rgba(186, 45, 67, 0.22), transparent 28%),
        radial-gradient(circle at bottom right, rgba(36, 75, 143, 0.34), transparent 34%),
        linear-gradient(180deg, var(--royal-blue-950) 0%, var(--royal-blue-900) 52%, #091225 100%);
    color: var(--text-primary);
}

body {
    font-family: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
    overflow-x: hidden;
}

.app-shell {
    min-height: 100vh;
    overflow-x: clip;
}

.app-main {
    min-height: 100vh;
    transition: padding-left 0.25s ease;
}

.app-main--authed {
    padding-left: 280px;
}

.app-main--public {
    padding-left: 0;
}

.app-topbar {
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    min-height: 74px;
    padding: 0.85rem 1.35rem;
    background: rgba(6, 16, 35, 0.86);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(14px);
}

.app-topbar--public {
    justify-content: space-between;
}

.public-nav-toggle {
    display: none;
    border: 1px solid rgba(255, 255, 255, 0.14);
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-primary);
    border-radius: 999px;
    padding: 0.7rem 1rem;
    font-weight: 700;
}

.public-nav-toggle:hover,
.public-nav-toggle:focus-visible {
    background: rgba(255, 255, 255, 0.14);
}

.brand-block {
    display: inline-flex;
    align-items: center;
    gap: 0.9rem;
    border: 0;
    background: transparent;
    color: var(--text-primary);
    text-align: left;
}

.brand-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.8rem;
    height: 2.8rem;
    border-radius: 0.95rem;
    background: linear-gradient(135deg, var(--royal-red-600), var(--royal-blue-700));
    box-shadow: var(--shadow-soft);
    font-weight: 700;
}

.brand-mark--logo {
    background: rgba(255, 255, 255, 0.08);
    overflow: hidden;
}

.brand-mark__image {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 0.4rem;
}

.brand-copy {
    display: flex;
    flex-direction: column;
}

.brand-copy small,
.table-secondary-text,
.page-subtitle,
.sidebar-user small,
.summary-card__label {
    color: var(--text-secondary);
}

.top-links,
.top-actions,
.button-row,
.scan-row,
.action-cluster {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.app-topbar--public .top-links {
    flex: 1 1 auto;
}

.top-link {
    border: 0;
    background: transparent;
    color: var(--text-secondary);
    font-weight: 600;
    padding: 0.65rem 0.9rem;
    border-radius: 999px;
}

.app-topbar--public .top-actions {
    justify-content: flex-end;
}

.top-link:hover,
.top-link:focus-visible,
.nav-link:hover,
.nav-link.active {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.08);
}

.content-shell {
    padding: 1.85rem 1.5rem 1.5rem;
}

.sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: 280px;
    padding: 1.25rem 1rem;
    background: linear-gradient(180deg, rgba(5, 14, 31, 0.98), rgba(14, 31, 61, 0.96));
    border-right: 1px solid rgba(255, 255, 255, 0.08);
    z-index: 25;
    overflow: hidden;
    box-sizing: border-box;
}

.nav-menu {
    display: flex;
    flex-direction: column;
    gap: 1.1rem;
    height: 100%;
    padding: 0 0.2rem 0 0;
    overflow-y: auto;
}

.sidebar-user,
.workspace-card,
.summary-card,
.metric-card,
.card,
.auth-card {
    border: 1px solid var(--surface-border) !important;
    box-shadow: var(--shadow-soft) !important;
}

.sidebar-user {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 1rem;
    border-radius: 1rem;
    background: rgba(255, 255, 255, 0.05);
}

.sidebar-avatar {
    display: inline-flex;
    width: 2.6rem;
    height: 2.6rem;
    align-items: center;
    justify-content: center;
    border-radius: 0.85rem;
    background: linear-gradient(135deg, var(--royal-red-700), var(--royal-blue-700));
    font-weight: 700;
}

.nav-section {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.nav-section-header {
    color: rgba(255, 255, 255, 0.52);
    letter-spacing: 0.08em;
    font-size: 0.76rem;
    margin: 0 0 0.25rem;
}

.nav-link {
    display: flex;
    align-items: center;
    min-height: 46px;
    padding: 0.75rem 0.95rem;
    border-radius: 0.95rem;
    color: var(--text-secondary);
    text-decoration: none;
    margin-left: 0;
    transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.nav-link:hover {
    transform: translateX(3px);
}

.workspace-page {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    width: 100%;
    margin: 0 auto;
}

.workspace-page--narrow {
    max-width: 1280px;
}

.workspace-page--wide {
    max-width: 1500px;
}

.page-hero {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 1rem;
    padding: 1.4rem 1.5rem;
    border-radius: 1.4rem;
    margin-top: 0.1rem;
    background: linear-gradient(135deg, rgba(159, 32, 53, 0.22), rgba(36, 75, 143, 0.18));
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.page-kicker {
    margin: 0 0 0.4rem;
    color: #ffb6c1;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    font-size: 0.78rem;
    font-weight: 700;
}

.workspace-grid {
    display: grid;
    gap: 1rem;
}

.workspace-grid--two {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.workspace-card,
.card,
.auth-card {
    background: linear-gradient(180deg, var(--surface-strong), var(--surface-soft)) !important;
    border-radius: 1.3rem !important;
    color: var(--text-primary) !important;
}

.workspace-card {
    padding: 1.35rem;
}

.workspace-card--danger {
    border-color: rgba(186, 45, 67, 0.48) !important;
}

.card-header-block h2,
.card-header-block p,
.workspace-card h2,
.workspace-card h3,
.workspace-card h4,
.workspace-card h5,
.workspace-card label,
.workspace-card th,
.workspace-card td,
.workspace-card li,
.workspace-card span,
.workspace-card strong,
.workspace-card small,
.workspace-card p,
.card-header,
.card-title {
    color: var(--text-primary);
}

.card-header-block {
    margin-bottom: 1rem;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}

.form-field {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
}

.form-field--wide {
    grid-column: 1 / -1;
}

.form-field--full {
    grid-column: 1 / -1;
}

.form-field--actions {
    justify-content: end;
}

.form-field--actions .btn,
.form-field--actions .details-actions {
    width: 100%;
}

.form-control,
.form-select,
textarea.form-control {
    min-height: 48px;
    background: rgba(255, 255, 255, 0.08) !important;
    border: 1px solid rgba(255, 255, 255, 0.12) !important;
    color: var(--text-primary) !important;
    border-radius: 0.95rem !important;
}

.form-control::placeholder,
textarea.form-control::placeholder {
    color: rgba(255, 255, 255, 0.46);
}

.form-control:focus,
.form-select:focus,
textarea.form-control:focus {
    box-shadow: 0 0 0 0.24rem rgba(186, 45, 67, 0.2) !important;
    border-color: rgba(186, 45, 67, 0.5) !important;
}

.form-select option,
select option,
datalist option {
    color: #0f172a;
    background: #ffffff;
}

.btn-brand {
    background: linear-gradient(135deg, var(--royal-red-600), var(--royal-blue-700));
    color: white;
    border: 0;
}

.btn-brand:hover,
.btn-brand:focus-visible {
    color: white;
    box-shadow: 0 0 0 0.2rem rgba(186, 45, 67, 0.22);
}

.public-feedback {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    margin-top: 0.8rem;
    padding: 0.55rem 0.8rem;
    border-radius: 999px;
    font-size: 0.88rem;
    font-weight: 600;
}

.public-feedback--busy {
    background: rgba(59, 130, 246, 0.18);
    color: #dbeafe;
}

.public-feedback--idle {
    background: rgba(255, 255, 255, 0.08);
    color: rgba(241, 245, 249, 0.82);
}

.public-feedback__spinner {
    width: 0.95rem;
    height: 0.95rem;
    border: 2px solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    animation: public-feedback-spin 0.8s linear infinite;
}

.public-feedback--idle .public-feedback__spinner {
    animation-play-state: paused;
    opacity: 0.45;
}

@keyframes public-feedback-spin {
    to {
        transform: rotate(360deg);
    }
}

.table-shell {
    overflow-x: auto;
    border-radius: 1rem;
}

.inventory-table {
    color: var(--text-primary);
    --bs-table-bg: transparent;
    --bs-table-striped-bg: rgba(255, 255, 255, 0.04);
    --bs-table-border-color: rgba(255, 255, 255, 0.08);
}

.inventory-table thead th {
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-primary);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.role-pill,
.difference-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 96px;
    padding: 0.35rem 0.7rem;
    border-radius: 999px;
    font-size: 0.82rem;
    font-weight: 700;
}

.role-pill--admin,
.difference-pill--overage {
    background: rgba(186, 45, 67, 0.18);
    color: #ffc7d0;
}

.role-pill--manager,
.difference-pill--shortage {
    background: rgba(255, 193, 7, 0.18);
    color: #ffe08a;
}

.role-pill--user,
.difference-pill--match {
    background: rgba(36, 75, 143, 0.22);
    color: #cfe0ff;
}

.row-overage {
    background: rgba(186, 45, 67, 0.08);
}

.row-shortage {
    background: rgba(255, 193, 7, 0.08);
}

.summary-cards {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.9rem;
}

.summary-cards--four {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.summary-card {
    padding: 1rem;
    border-radius: 1rem;
    background: rgba(255, 255, 255, 0.05);
}

.summary-card--warning {
    border-color: rgba(255, 193, 7, 0.28) !important;
}

.summary-card--accent {
    border-color: rgba(186, 45, 67, 0.28) !important;
}

.scan-pill-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
}

.scan-pill-list li {
    padding: 0.45rem 0.7rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.06);
}

.panel-toolbar {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

.stacked-metric {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.stacked-metric strong {
    font-size: 1rem;
}

.stacked-metric small,
.muted-copy {
    color: var(--text-secondary);
}

.status-chip {
    display: inline-flex;
    align-items: center;
    padding: 0.38rem 0.75rem;
    border-radius: 999px;
    font-size: 0.82rem;
    font-weight: 700;
}

.status-chip--draft {
    background: rgba(148, 163, 184, 0.18);
    color: #dbe7ff;
}

.status-chip--pending {
    background: rgba(255, 193, 7, 0.18);
    color: #ffe08a;
}

.status-chip--paid {
    background: rgba(34, 197, 94, 0.18);
    color: #b8ffd0;
}

.status-chip--shipped {
    background: rgba(59, 130, 246, 0.18);
    color: #cfe0ff;
}

.details-panel {
    margin-top: 0.75rem;
    padding: 1rem;
    border-radius: 1rem;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.inline-form-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1rem;
    align-items: end;
}

.details-actions {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.metadata-editor {
    display: grid;
    gap: 0.45rem;
    min-width: 210px;
}

.auth-shell {
    min-height: calc(100vh - 3rem);
    display: grid;
    grid-template-columns: 1.2fr 0.9fr;
    gap: 1.5rem;
    align-items: stretch;
    padding: 1.5rem;
}

.auth-panel {
    display: flex;
    align-items: center;
}

.auth-panel--intro {
    padding: 2rem;
}

.auth-hero {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    max-width: 760px;
}

.auth-platform-pill {
    display: inline-flex;
    align-self: flex-start;
    padding: 0.45rem 0.8rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.08);
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.auth-signal-grid,
.payment-steps {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.85rem;
}

.payment-steps {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.auth-signal,
.payment-step-card {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    padding: 1rem;
    border-radius: 1rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.auth-signal span,
.payment-step-card p,
.auth-form-note {
    color: var(--text-secondary);
}

.auth-process-strip {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.85rem;
}

.auth-step-chip {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 0.75rem;
    align-items: start;
    padding: 0.95rem 1rem;
    border-radius: 1rem;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.auth-step-chip span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--royal-red-600), var(--royal-blue-700));
    font-weight: 700;
}

.auth-step-chip p {
    margin: 0;
}

.auth-card {
    width: 100%;
    max-width: 520px;
    margin-left: auto;
}

.auth-form-note {
    margin: 1rem 0 0;
    font-size: 0.92rem;
}

.empty-state {
    padding: 1.5rem;
    border-radius: 1rem;
    background: rgba(255, 255, 255, 0.04);
    text-align: center;
}

.compact-empty-state {
    padding: 1rem 1.2rem;
}

.nav-toggle-label {
    display: none;
    position: fixed;
    top: 1.2rem;
    left: 1rem;
    z-index: 40;
    width: 3rem;
    height: 3rem;
    border-radius: 0.9rem;
    background: rgba(7, 21, 46, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.hamburger-icon,
.hamburger-icon::before,
.hamburger-icon::after {
    display: block;
    position: absolute;
    width: 1.3rem;
    height: 2px;
    background: white;
    content: "";
    left: 0.85rem;
    top: 1.45rem;
}

.hamburger-icon::before {
    top: -0.4rem;
    left: 0;
}

.hamburger-icon::after {
    top: 0.4rem;
    left: 0;
}

@media (max-width: 1200px) {
    .workspace-grid--two,
    .auth-shell {
        grid-template-columns: 1fr;
    }

    .auth-signal-grid,
    .auth-process-strip,
    .summary-cards--four,
    .inline-form-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 960px) {
    .nav-toggle-label {
        display: block;
    }

    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.25s ease;
    }

    .nav-toggle:checked ~ .sidebar {
        transform: translateX(0);
    }

    .app-main--authed {
        padding-left: 0;
    }

    .app-topbar {
        padding-left: 4.5rem;
    }
}

@media (max-width: 900px) {
    .app-topbar--public {
        align-items: center;
        flex-wrap: wrap;
        padding: 0.9rem 1rem;
    }

    .public-nav-toggle {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        margin-left: auto;
    }

    .app-topbar--public .top-links,
    .app-topbar--public .top-actions {
        display: none;
        width: 100%;
        gap: 0.5rem;
    }

    .app-topbar--public.nav-open .top-links,
    .app-topbar--public.nav-open .top-actions {
        display: flex;
    }

    .app-topbar--public.nav-open .top-links,
    .app-topbar--public.nav-open .top-actions {
        flex-direction: column;
        align-items: stretch;
        padding-top: 0.6rem;
    }

    .app-topbar--public .top-link,
    .app-topbar--public .top-actions .btn {
        display: flex;
        align-items: center;
        width: 100%;
        justify-content: center;
        text-align: center;
        min-height: 2.75rem;
    }
}

@media (max-width: 720px) {
    .content-shell,
    .auth-shell {
        padding: 1rem;
    }

    .summary-cards,
    .form-grid {
        grid-template-columns: 1fr;
    }

    .auth-signal-grid,
    .auth-process-strip,
    .payment-steps,
    .summary-cards--four,
    .inline-form-grid {
        grid-template-columns: 1fr;
    }

    .app-topbar:not(.app-topbar--public) .top-links {
        display: none;
    }

    .page-hero {
        padding: 1rem;
    }
}

@media (max-width: 480px) {
    .content-shell {
        padding: 0.85rem;
    }
}

.form-group {
    flex: 1;
    min-width: 200px;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.client-form-container,
.dashboard-container {
    color: var(--text-color, #d3d3d3); /* White text */
    padding: 20px;
    font-family: Arial, sans-serif;
    width: 100%;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s, box-shadow 0.3s;
    box-shadow: var(--red-shadow, 0 4px 8px rgba(128, 0, 0, 0.2)); /* Red shadow */
}

    .client-form-container:hover,
    .dashboard-container:hover {
        transform: translateY(-2px);
        box-shadow: 0 8px 16px rgba(128, 0, 0, 0.5) !important; /* Stronger red shadow on hover */
    }

.table-section {
    overflow-x: auto;
    border: 2px solid var(--red-accent, #ff4d4d); /* Red border */
    box-shadow: var(--red-shadow, 0 4px 8px rgba(128, 0, 0, 0.2)); /* Red shadow */
    color: var(--text-color, #d3d3d3); /* White text */
}

.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch; /* Smooth scrolling on mobile */
}

.form-control.bg-dark.text-white.border-secondary {
    background-color: white !important;
    color: black !important;
}

.inspectiontable {
    width: 100%; /* Ensure table takes full available width */
    background-color: rgba(85, 85, 85, 0.5) !important; /* Match your dark theme */
    table-layout: fixed;
    color: var(--text-color, #d3d3d3); /* Use your text color */
    border: 1px solid #555; /* Match your inline border */
    border-collapse: collapse; /* Ensure borders merge */
}

.table1 {
    width: 100%; /* Ensure table takes full available width */
    background-color: rgba(85, 85, 85, 0.5) !important; /* Match your dark theme */
    color: var(--text-color, #d3d3d3); /* Use your text color */
    border: 1px solid #555; /* Match your inline border */
    border-collapse: collapse; /* Ensure borders merge */
    min-width: 600px; /* Fixed minimum width to trigger scrolling */
    table-layout: fixed; /* Forces fixed column widths */
    width: 100%;
    overflow-x: auto;
}

.table {
    width: 100%; /* Ensure table takes full available width */
    background-color: rgba(85, 85, 85, 0.5) !important; /* Match your dark theme */
    color: var(--text-color, #d3d3d3); /* Use your text color */
    border: 1px solid #555; /* Match your inline border */
    border-collapse: collapse; /* Ensure borders merge */
    overflow-x: auto;
    table-layout: fixed; /* Forces fixed column widths */
}

    .table th,
    .table td {
        overflow: hidden; /* Prevents content overflow within cells */
        text-overflow: ellipsis; /* Truncates text with ellipsis if it exceeds width */
        white-space: nowrap;
        background-color: #4a4a4a !important; /* Apply to all cells */
        color: var(--text-color, white); /* Consistent text color */
        table-layout: fixed; /* Prevents table from shrinking */
        border-bottom: 1px solid rgba(85, 85, 85, 0.5); /* Subtle border for rows */
        padding: 10px; /* Consistent padding */
        white-space: nowrap; /* Prevent text wrapping */
    }

    .table th {
        background-color: var(--dark-bg);
        cursor: pointer;
    }

.table-striped tbody tr:nth-child(odd) {
    background-color: rgba(85, 85, 85, 0.5); /* Darker odd rows */
    color: var(--text-color, #d3d3d3);
}

.table-hover tbody tr:hover {
    background-color: rgba(96, 0, 0, 0.3); /* Red hover effect */
}

.content {
    padding-top: 1.1rem;
}

h1:focus {
    outline: none;
}

.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

.invalid {
    outline: 1px solid var(--red-hover);
}

.validation-message {
    color: var(--red-hover);
}

.btn-warning {
    padding: 8px 20px;
    font-size: 13px;
    background-color: rgba(128, 0, 0, 0.2) !important;
    color: rgba(0, 0, 0, 0.4);
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.2s ease, box-shadow 0.3s;
}

.btn-primary {
    padding: 8px 20px;
    font-size: 12px;
    background-color: var(--red-accent) !important;
    color: var(--text-color);
    border: 2px solid var(--red-hover);
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.2s ease, box-shadow 0.3s;
}

    .btn-primary:hover {
        background-color: var(--red-hover);
        transform: translateY(-2px);
        box-shadow: var(--red-shadow);
    }

.btn-secondary {
    padding: 8px 20px;
    font-size: 12px;
    background-color: rgba(128, 0, 0, 0.3);
    color: var(--text-color);
    border: none;
    border-bottom: 2px solid rgba(204, 0, 0, 0.3);
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.2s ease, box-shadow 0.3s;
}

    .btn-secondary:hover {
        background-color: var(--red-hover);
        transform: translateY(-2px);
        box-shadow: var(--red-shadow);
    }

.btn-primary1 {
    padding: 8px 20px;
    font-size: 12px;
    background-color: var(--red-accent);
    color: rgba(255, 0, 0, 0.4);
    border: 1px solid rgba(255, 0, 0, 0.2);
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.2s ease, box-shadow 0.3s;
}

    .btn-primary1:hover {
        background-color: rgba(255, 0, 0, 0.2);
        transform: translateY(-2px);
        box-shadow: var(--red-shadow);
    }

.btn-address-toggle {
    padding: 10px 15px;
    font-size: 12px;
    background-color: var(--dark-tertiary);
    color: var(--text-color);
    border: 2px solid var(--red-accent);
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    margin-bottom: 15px;
    transition: background-color 0.3s ease, transform 0.2s ease, box-shadow 0.3s;
}

    .btn-address-toggle:hover {
        background-color: var(--hover-bg);
        transform: translateY(-2px);
        box-shadow: var(--red-shadow);
    }

.btn-icon {
    font-size: 14px;
    color: var(--red-accent);
}

@keyframes slideDown {
    from {
        transform: translateY(-10px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}


@keyframes scroll-carousel {
    from {
        transform: translateX(0);
    }

    to {
        transform: translateX(-50%);
    }
}

@keyframes pulseGlow {
    0% {
        box-shadow: 0 0 0 0 rgba(139,0,0,0.45);
    }

    70% {
        box-shadow: 0 0 0 12px rgba(139,0,0,0.0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(139,0,0,0.0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-4px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}
/* Home page specific styling */
.dashboard-container {
    display: flex;
    flex-direction: column;
    padding: 1rem;
    box-shadow: var(--red-shadow);
    color: var(--text-color);
    width: 100%;
    min-width: 80vw;
    margin: 0;
}

.dashboard-container1 {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap; /* Allow wrapping on smaller screens */
    padding: 1rem;
    box-shadow: var(--red-shadow);
    color: var(--text-color);
    width: 100%;
    max-width: 100%; /* Prevent overflow */
}

.hero-section {
    background-color: var(--dark-secondary);
    padding: 2rem;
    border: 2px solid var(--red-accent);
    border-radius: 10px;
    box-shadow: var(--red-shadow);
    text-align: center;
    color: var(--text-color);
}

.hero-title {
    color: var(--red-accent);
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    text-shadow: 1px 1px 2px rgba(128, 0, 0, 0.3);
}

.hero-subtitle {
    color: var(--text-color);
    font-size: 1.1rem;
    margin-bottom: 0;
}

.metrics-title {
    color: var(--red-accent);
    font-size: 1.5rem;
    margin-bottom: 1rem;
    text-shadow: 1px 1px 2px rgba(128, 0, 0, 0.3);
}

.metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.metric-card {
    background-color: var(--dark-tertiary);
    padding: 1rem;
    border: 2px solid var(--red-accent);
    border-radius: 5px;
    text-align: center;
    transition: transform 0.3s, box-shadow 0.3s;
    color: var(--text-color);
}

    .metric-card:hover {
        transform: translateY(-5px);
        box-shadow: 0 8px 16px rgba(128, 0, 0, 0.5) !important;
    }

    .metric-card h3 {
        color: var(--red-accent);
        font-size: 1.1rem;
        margin-bottom: 0.5rem;
    }

.metric-value {
    color: var(--text-color);
    font-size: 1.5rem;
    font-weight: bold;
}

.updates-sidebar {
    flex: 1;
    background-color: var(--dark-tertiary);
    padding: 1.5rem;
    border: 2px solid var(--red-accent);
    border-radius: 15px;
    box-shadow: var(--red-shadow);
    margin-left: 1rem;
    color: var(--text-color);
}

.updates-title {
    color: var(--red-accent);
    font-size: 1.3rem;
    margin-bottom: 1rem;
    text-shadow: 1px 1px 2px rgba(128, 0, 0, 0.3);
}

.updates-list {
    list-style: none;
    padding: 0;
}

.update-item {
    background-color: var(--dark-secondary);
    padding: 0.75rem;
    margin-bottom: 0.5rem;
    border: 1px solid var(--red-accent);
    border-radius: 5px;
    transition: background-color 0.3s;
    color: var(--text-color);
}

    .update-item:hover {
        background-color: var(--hover-bg);
        box-shadow: var(--red-shadow);
    }

    .update-item .update-time {
        color: var(--text-color);
        font-size: 0.9rem;
        float: right;
    }


.bi {
    margin-right: 0.5rem;
    color: var(--red-accent);
}

.nav-item {
    margin-right: 0.5rem;
}

.badge {
    padding: 5px 10px;
    border-radius: 4px;
}

.bg-success {
    background-color: #28a745;
}

.bg-warning {
    background-color: #ffc107;
}

.bg-danger {
    background-color: #dc3545;
}

.text-muted {
    color: #a0aec0;
}

.tab-pane {
    display: none;
}

    .tab-pane.active {
        display: block;
        overflow: auto;
    }

.validation-message {
    background: rgba(245, 101, 101, 0.1);
    box-shadow: 0 2px 4px rgba(255, 0, 0, 0.2);
    padding: 1rem;
    border-radius: 4px;
    margin-bottom: 1rem;
}


.nav-container {
    max-width: 2000px;
    margin: 0 auto;
    padding: 0 1rem;
    width: 100%;
}


.top-link {
    color: white;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    opacity: 0.9;
}

    .top-link:hover {
        opacity: 1;
        text-decoration: underline;
    }

.admin-access {
    position: fixed;
    bottom: 8px;
    right: 8px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    opacity: 0.15;
    border: none;
    background-color: transparent;
    cursor: pointer;
}

.login-btn {
    color: white !important;
    border-color: white !important;
}

    .login-btn:hover {
        background-color: rgba(255,255,255,0.2);
    }

.admin-access {
    position: fixed;
    bottom: 12px;
    right: 12px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    opacity: 0.2;
    background: rgba(255,255,255,0.2);
    border: none;
    cursor: pointer;
    z-index: 9999;
}

    .admin-access:hover {
        opacity: 1;
        background: #28a745; /* green */
    }

.print-hidden {
    display: none !important;
}

@media print {
    /* Fallback: Hide interactive elements if using direct window.print */
    button, input, label, .d-flex, h3 {
        display: none !important;
    }

    .printable-section {
        position: static !important;
        width: 100% !important;
    }

    /* Table and card styles for clean print (used in new window too) */
    table {
        width: 100%;
        border-collapse: collapse;
        page-break-inside: auto;
    }

    th, td {
        border: 1px solid #000;
        padding: 8px;
        page-break-inside: avoid;
    }

    thead {
        display: table-header-group;
    }

    tbody tr {
        page-break-inside: avoid;
    }

    .card {
        box-shadow: none;
        border: 1px solid #ddd;
        background-color: white !important;
    }

    .receipt-details {
        background-color: white !important;
        color: black !important;
        border: 1px solid #ddd;
    }

    /* Neutralize colors for print */
    .text-success, .text-danger, .text-primary {
        color: #000 !important;
    }

    .fw-bold {
        font-weight: bold;
    }

    /* Page setup */
    @page {
        margin: 1in;
        size: A4;
    }
}
