/* ============================================
   GameVault - Global Styles
   Blazor AI Starter Kit
   ============================================ */

/* ----- CSS Variables / Design Tokens ----- */
:root {
    --color-bg: #0a0a0f;
    --color-bg-elevated: #12121a;
    --color-bg-card: #1a1a26;
    --color-bg-hover: #22222e;
    --color-bg-input: #16161f;
    --color-border: #2a2a3a;
    --color-border-subtle: #1e1e2e;
    --color-text: #e8e8f0;
    --color-text-secondary: #9898a8;
    --color-text-muted: #686878;
    --color-primary: #6c5ce7;
    --color-primary-hover: #7e70f0;
    --color-primary-subtle: rgba(108, 92, 231, 0.12);
    --color-accent: #00d2ff;
    --color-help: #7cc4ff; /* help text under form fields */
    --color-accent-2: #a855f7;
    --color-success: #22c55e;
    --color-danger: #ef4444;
    --color-danger-hover: #dc2626;
    --color-warning: #f59e0b;
    --color-star: #fbbf24;
    --gradient-primary: linear-gradient(135deg, #6c5ce7, #00d2ff);
    --gradient-hero: linear-gradient(135deg, #6c5ce7 0%, #a855f7 50%, #00d2ff 100%);
    --gradient-card: linear-gradient(145deg, #1a1a26, #12121a);
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 30px rgba(108, 92, 231, 0.15);
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --sidebar-width: 260px;
    --topbar-height: 64px;
    --transition: 0.2s ease;
    /* AQUA Colours */
    --color-aqua-category: #B346FD;
    --color-aqua-item: #1B7CFF;
    --color-aqua-assembly: #00BA2C;
    --color-aqua-vendor: #F67500;
    --color-aqua-vendor-part: #DFE200;
    --color-aqua-vendor-part-pricing: #A59400;
}

/* ----- Reset & Base ----- */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-family);
    background: var(--color-bg);
    color: var(--color-text);
    line-height: 1.6;
    min-height: 100vh;
}

a {
    color: var(--color-primary);
    text-decoration: none;
    transition: color var(--transition);
}

    a:hover {
        color: var(--color-primary-hover);
    }

img {
    max-width: 100%;
    display: block;
}

input,
button,
textarea,
select {
    font-family: inherit;
    font-size: inherit;
}

/* ----- Scrollbar ----- */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--color-bg);
}

::-webkit-scrollbar-thumb {
    background: var(--color-border);
    border-radius: 4px;
}

    ::-webkit-scrollbar-thumb:hover {
        background: var(--color-text-muted);
    }

/* ============================================
   LANDING PAGE
   ============================================ */

.landing-wrapper {
    min-height: 100vh;
    background: var(--color-bg);
}

.landing-page {
    overflow-x: hidden;
}

/* Landing Nav */
.landing-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    padding: 1rem 2rem;
    background: rgba(10, 10, 15, 0.85);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--color-border-subtle);
}

.landing-nav-inner {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.landing-logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--color-text);
}

    .landing-logo:hover {
        color: var(--color-text);
    }

.logo-icon {
    font-size: 1.5rem;
}

.landing-nav-links {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.btn-ghost-landing {
    padding: 0.5rem 1.25rem;
    color: white;
    background: var(--color-success);
    border-radius: var(--radius-sm);
    transition: all var(--transition);
}

    .btn-ghost-landing:hover {
        color: var(--color-text);
        background: var(--color-bg-hover);
    }

.btn-primary-landing {
    padding: 0.5rem 1.25rem;
    background: var(--gradient-primary);
    color: white;
    border-radius: var(--radius-sm);
    font-weight: 600;
    transition: all var(--transition);
}

    .btn-primary-landing:hover {
        color: white;
        opacity: 0.9;
        transform: translateY(-1px);
    }

/* Hero Section */
.hero-section {
    min-height: 90vh;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4rem;
    max-width: 1200px;
    margin: 0 auto;
    padding: 8rem 2rem 4rem;
}

.hero-content {
    flex: 1;
    max-width: 580px;
}

.hero-badge {
    display: inline-block;
    padding: 0.375rem 1rem;
    background: var(--color-primary-subtle);
    border: 1px solid rgba(108, 92, 231, 0.25);
    color: var(--color-primary-hover);
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    margin-bottom: 1.5rem;
}

.hero-title {
    font-size: 3.5rem;
    font-weight: 800;
    line-height: 1.1;
    letter-spacing: -0.03em;
    margin-bottom: 1.5rem;
}

.gradient-text {
    background: var(--gradient-hero);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-subtitle {
    font-size: 1.15rem;
    color: var(--color-text-secondary);
    line-height: 1.7;
    margin-bottom: 2rem;
    max-width: 480px;
}

.hero-actions {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.btn-hero-primary {
    display: inline-flex;
    align-items: center;
    padding: 0.875rem 2rem;
    background: var(--gradient-primary);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all var(--transition);
    box-shadow: 0 4px 20px rgba(108, 92, 231, 0.3);
}

    .btn-hero-primary:hover {
        color: white;
        transform: translateY(-2px);
        box-shadow: 0 6px 30px rgba(108, 92, 231, 0.4);
    }

.btn-hero-secondary {
    display: inline-flex;
    align-items: center;
    padding: 0.875rem 2rem;
    background: transparent;
    color: var(--color-text-secondary);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    font-weight: 500;
    font-size: 1rem;
    cursor: pointer;
    transition: all var(--transition);
}

    .btn-hero-secondary:hover {
        color: var(--color-text);
        border-color: var(--color-text-muted);
        background: var(--color-bg-hover);
    }

/* Hero Visual */
.hero-visual {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    max-width: 380px;
}

.hero-card {
    background: var(--gradient-card);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: 1.75rem;
    box-shadow: var(--shadow-lg);
    transition: all 0.3s ease;
}

    .hero-card:hover {
        transform: translateY(-4px);
        box-shadow: var(--shadow-glow);
    }

.hero-card-offset {
    margin-left: 3rem;
}

.card-game-icon {
    font-size: 2rem;
    margin-bottom: 0.75rem;
}

.card-game-title {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.card-game-meta {
    font-size: 0.85rem;
    color: var(--color-text-muted);
    margin-bottom: 0.75rem;
}

.card-game-rating {
    font-size: 0.95rem;
    font-weight: 600;
}

    .card-game-rating .star {
        color: var(--color-star);
    }


/* Features Section */
.features-section {
    max-width: 1200px;
    margin: 0 auto;
    padding: 6rem 2rem;
}

.section-title {
    text-align: center;
    font-size: 2.25rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    margin-bottom: 0.75rem;
}

.section-midtitle {
    text-align: center;
    font-size: 1.5rem;
    font-weight: 600;
    letter-spacing: -0.02em;
    margin-bottom: 0.75rem;
    color: var(--color-accent);
}

.section-subtitle {
    text-align: center;
    color: var(--color-text-secondary);
    font-size: 1.1rem;
    margin-bottom: 8px;
    margin-top: 8px;
}

.section-subtitle-leftalign {
    text-align: left;
    color: var(--color-text-secondary);
    font-size: 1.1rem;
    margin-bottom: 8px;
    margin-top: 8px;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 1.5rem;
}

.feature-card {
    background: var(--color-bg-card);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: 2rem;
    transition: all 0.3s ease;
}

    .feature-card:hover {
        border-color: var(--color-primary);
        box-shadow: var(--shadow-glow);
        transform: translateY(-2px);
    }

.feature-icon {
    font-size: 2rem;
    margin-bottom: 1rem;
}

.feature-card h3 {
    font-size: 1.15rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.feature-card p {
    color: var(--color-text-secondary);
    font-size: 0.9rem;
    line-height: 1.6;
}

/* CTA Section */
.cta-section {
    text-align: center;
    padding: 5rem 2rem;
    background: var(--color-bg-elevated);
    border-top: 1px solid var(--color-border-subtle);
    border-bottom: 1px solid var(--color-border-subtle);
}

    .cta-section h2 {
        font-size: 2rem;
        font-weight: 800;
        margin-bottom: 0.75rem;
    }

    .cta-section p {
        color: var(--color-text-secondary);
        margin-bottom: 2rem;
        font-size: 1.05rem;
    }

/* Landing Footer */
.landing-footer {
    text-align: center;
    padding: 2rem;
    color: var(--color-text-primary);
    font-size: 0.95rem;
}

/* ============================================
   APP SHELL (Authenticated Layout)
   ============================================ */

.app-shell {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.app-sidebar {
    width: var(--sidebar-width);
    background: var(--color-bg-elevated);
    border-right: 1px solid var(--color-border-subtle);
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
    z-index: 50;
    overflow-y: auto;
}

.sidebar-brand {
    padding: 1.5rem 1.25rem;
    border-bottom: 1px solid var(--color-border-subtle);
}

.brand-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--color-text);
    font-weight: 700;
    font-size: 1.15rem;
}

    .brand-link:hover {
        color: var(--color-text);
    }

.brand-icon {
    font-size: 1.4rem;
}

.sidebar-nav {
    flex: 1;
    padding: 1rem 0;
}

.nav-section {
    margin-bottom: 1.5rem;
}

.nav-section-title {
    display: block;
    padding: 0 1.25rem;
    margin-bottom: 0.5rem;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--color-text-muted);
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.625rem 1.25rem;
    color: var(--color-text-secondary);
    font-size: 0.9rem;
    font-weight: 500;
    transition: all var(--transition);
    border-left: 3px solid transparent;
}

    .sidebar-link:hover {
        color: var(--color-text);
        background: var(--color-bg-hover);
    }

    .sidebar-link.active {
        color: var(--color-primary);
        background: var(--color-primary-subtle);
        border-left-color: var(--color-primary);
    }

.nav-icon {
    font-size: 1rem;
    width: 1.25rem;
    text-align: center;
}

/* Main Content Area */
.app-main {
    flex: 1;
    margin-left: var(--sidebar-width);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Topbar */
.app-topbar {
    height: var(--topbar-height);
    background: rgba(10, 10, 15, 0.85);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--color-border-subtle);
    position: sticky;
    top: 0;
    z-index: 40;
}

.topbar-content {
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 2rem;
}

.topbar-title {
    font-size: 1.1rem;
    font-weight: 600;
}

.topbar-user {
    display: flex;
    align-items: center;
    gap: 0rem;
}

.user-greeting {
    color: var(--color-text-secondary);
    font-size: 0.875rem;
    margin-right: 8px;
}

.user-ip {
    color: var(--color-text-primary);
    font-size: 0.775rem;
}

.btn-logout {
    padding: 0.375rem 1rem;
    background: transparent;
    color: var(--color-text-muted);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 0.8rem;
    transition: all var(--transition);
}

    .btn-logout:hover {
        color: var(--color-danger);
        border-color: var(--color-danger);
    }

/* Default administrator warning */
.default-admin-warning {
    padding: 0.75rem 2rem;
    background: var(--color-danger);
    color: #fff;
    font-weight: 600;
}

/* App Content */
.app-content {
    flex: 1;
    padding: 2rem;
    max-width: 2200px;
    max-height: 1024px;
    width: 100%;
}

/* Footer Content */
.footer-content {
    position: absolute;
    bottom: 40px;
    margin-left: 58px;
    width: 100%;
}

/* ============================================
   SHARED COMPONENTS
   ============================================ */

/* Buttons */
.btn_icon {
    background-color: transparent;
    border-width: 0px;
    cursor: pointer;
}

.btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 1.5rem;
    background: var(--gradient-primary);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all var(--transition);
    text-decoration: none;
}

    .btn-primary:hover {
        color: white;
        opacity: 0.9;
        transform: translateY(-1px);
    }

    .btn-primary:disabled {
        opacity: 0.5;
        cursor: not-allowed;
        transform: none;
    }

.btn-primary-sm {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.4rem 1rem;
    background: var(--gradient-primary);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all var(--transition);
    text-decoration: none;
}

    .btn-primary-sm:hover {
        color: white;
        opacity: 0.9;
    }

.centred-btn {
    display: grid;
    align-items: center;
    justify-items: center;
}

.btn-secondary {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 1.5rem;
    background: transparent;
    color: var(--color-text-secondary);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    font-weight: 500;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all var(--transition);
    text-decoration: none;
}

    .btn-secondary:hover {
        color: var(--color-text);
        border-color: var(--color-text-muted);
        background: var(--color-bg-hover);
    }

.btn-danger {
    display: inline-flex;
    align-items: center;
    padding: 0.625rem 1.5rem;
    background: var(--color-danger);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all var(--transition);
}

    .btn-danger:hover {
        background: var(--color-danger-hover);
    }

.btn-link {
    color: var(--color-primary);
    font-weight: 500;
    font-size: 0.875rem;
    transition: all var(--transition);
}

    .btn-link:hover {
        color: var(--color-primary-hover);
    }

.btn-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    background: transparent;
    color: var(--color-text-muted);
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition);
    font-size: 0.9rem;
    text-decoration: none;
}

    .btn-icon:hover {
        background: var(--color-bg-hover);
        color: var(--color-text);
        border-color: var(--color-border);
    }

.btn-danger-icon:hover {
    background: rgba(239, 68, 68, 0.1);
    color: var(--color-danger);
    border-color: rgba(239, 68, 68, 0.3);
}

.btn-refresh {
    display: inline-flex;
    align-items: center;
    margin-top: 1rem;
    gap: 0.375rem;
    padding: 0.4rem 1rem;
    background: var(--gradient-primary);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all var(--transition);
    text-decoration: none;
}

/* Page Headers */
.page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 2rem;
    gap: 1rem;
    flex-wrap: wrap;
}

    .page-header h1 {
        font-size: 1.75rem;
        font-weight: 800;
        letter-spacing: -0.02em;
    }

.page-subtitle {
    color: var(--color-text-secondary);
    font-size: 0.9rem;
    margin-top: 0.25rem;
}

.header-actions {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

/* ============================================
   DASHBOARD
   ============================================ */

.dasgboard-host {
    width: 100%;
}

.dashboard-header {
    margin-bottom: 2rem;
}

    .dashboard-header h1 {
        font-size: 1.75rem;
        font-weight: 800;
        letter-spacing: -0.02em;
    }

.dashboard-toolbar {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0 0 1rem 0;
}

    .dashboard-toolbar select {
        width: auto;
        min-width: 200px;
    }

.dashboard-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
}

.dashboard-panel-close {
    background: transparent;
    border: none;
    color: var(--color-text-muted);
    font-size: 1.25rem;
    line-height: 1;
    cursor: pointer;
    padding: 0 0.25rem;
}

    .dashboard-panel-close:hover {
        color: var(--color-danger);
    }

.recent-items-window {
    height: 100%;
    overflow: auto;
    padding: 0.5rem;
}

.recent-items-toolbar {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
    font-size: 0.85rem;
    color: var(--color-text-secondary);
}

    .recent-items-toolbar select {
        width: auto;
        padding: 0.2rem 0.5rem;
    }

.recent-items-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

    .recent-items-list li {
        display: flex;
        align-items: baseline;
        gap: 0.5rem;
        padding: 0.4rem 0;
        border-bottom: 1px solid var(--color-border-subtle);
        font-size: 0.85rem;
    }

.recent-items-number {
    font-weight: 600;
    white-space: nowrap;
}

.recent-items-description {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--color-text-secondary);
}

.recent-items-meta {
    white-space: nowrap;
    color: var(--color-text-muted);
    font-size: 0.8rem;
}

.dashboard-subtitle {
    color: var(--color-text-secondary);
    font-size: 0.9rem;
    margin-top: 0.25rem;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 2.5rem;
}

.stat-card {
    background: var(--color-bg-card);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    transition: all 0.3s ease;
}

    .stat-card:hover {
        border-color: var(--color-primary);
        box-shadow: var(--shadow-glow);
    }

.stat-value {
    font-size: 2rem;
    font-weight: 800;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.25rem;
}

.stat-label {
    font-size: 0.8rem;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
}

/* Dashboard Sections */
.dashboard-section {
    margin-bottom: 2.5rem;
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.25rem;
}

    .section-header h2 {
        font-size: 1.2rem;
        font-weight: 700;
    }

/* Game Cards Grid */
.game-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 1rem;
}

.game-card {
    background: var(--color-bg-card);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
}

    .game-card:hover {
        border-color: var(--color-primary);
        box-shadow: var(--shadow-glow);
        transform: translateY(-2px);
    }

.game-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.15rem;
}

.game-genre-badge {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    background: var(--color-primary-subtle);
    color: var(--color-primary-hover);
    border-radius: 999px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.game-rating {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--color-star);
}

.game-card-title {
    font-size: 1.05rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.game-card-developer {
    font-size: 0.8rem;
    color: var(--color-text-muted);
    margin-bottom: 0.75rem;
}

.game-card-desc {
    font-size: 0.85rem;
    color: var(--color-text-secondary);
    line-height: 1.5;
    flex: 1;
    margin-bottom: 1rem;
}

.btn-card-action {
    display: inline-flex;
    align-items: center;
    padding: 0.4rem 0.75rem;
    background: transparent;
    color: var(--color-primary);
    border: 1px solid var(--color-primary);
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    font-weight: 600;
    transition: all var(--transition);
    align-self: flex-start;
}

    .btn-card-action:hover {
        background: var(--color-primary-subtle);
        color: var(--color-primary-hover);
    }

/* Recent List */
.recent-list {
    background: var(--color-bg-card);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.recent-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--color-border-subtle);
    transition: background var(--transition);
}

    .recent-item:last-child {
        border-bottom: none;
    }

    .recent-item:hover {
        background: var(--color-bg-hover);
    }

.recent-info {
    display: flex;
    flex-direction: column;
}

.recent-title {
    font-weight: 600;
    font-size: 0.9rem;
}

.recent-meta {
    font-size: 0.8rem;
    color: var(--color-text-muted);
}

.recent-year {
    font-size: 0.85rem;
    color: var(--color-text-secondary);
    font-weight: 500;
}

/* ============================================
   GAME TABLE (List View)
   ============================================ */

.search-bar {
    margin-bottom: 1.5rem;
}

.search-input {
    width: 100%;
    padding: 0.75rem 1rem;
    background: var(--color-bg-input);
    color: var(--color-text);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    font-size: 0.9rem;
    transition: all var(--transition);
}

    .search-input:focus {
        outline: none;
        border-color: var(--color-primary);
        box-shadow: 0 0 0 3px var(--color-primary-subtle);
    }

    .search-input::placeholder {
        color: var(--color-text-muted);
    }

.game-table-wrapper {
    background: var(--color-bg-card);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    overflow: hidden;
    min-width: 1280px;
}

.game-table {
    width: 100%;
    border-collapse: collapse;
}

    .game-table thead {
        background: var(--color-bg-elevated);
    }

    .game-table th {
        padding: 0.875rem 1.25rem;
        text-align: left;
        font-size: 0.75rem;
        font-weight: 600;
        text-transform: uppercase;
        letter-spacing: 0.05em;
        color: var(--color-text-muted);
        border-bottom: 1px solid var(--color-border);
    }

    .game-table td {
        padding: 0.875rem 1.25rem;
        border-bottom: 1px solid var(--color-border-subtle);
        font-size: 0.9rem;
    }

    .game-table tbody tr {
        transition: background var(--transition);
    }

        .game-table tbody tr:hover {
            background: var(--color-bg-hover);
        }

        .game-table tbody tr:last-child td {
            border-bottom: none;
        }

.game-title-cell {
    font-weight: 600;
}

.genre-badge {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    background: var(--color-primary-subtle);
    color: var(--color-primary-hover);
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
}

.genre-badge-lg {
    padding: 0.3rem 0.85rem;
    font-size: 0.85rem;
}

.rating-display {
    color: var(--color-star);
    font-weight: 600;
}

.rating-lg {
    font-size: 1.1rem;
}

.actions-cell {
    display: flex;
    gap: 0.25rem;
}

/* ============================================
   REVISION TABLE
   ============================================ */

.rev-table-wrapper {
    background: var(--color-bg-card);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    overflow: hidden;
    max-width: 360px;
}

.rev-table {
    width: 100%;
    border-collapse: collapse;
    max-width: 360px;
}

    .rev-table thead {
        background: var(--color-bg-elevated);
    }

    .rev-table th {
        padding: 0.875rem 1.25rem;
        text-align: center;
        font-size: 0.75rem;
        font-weight: 600;
        text-transform: uppercase;
        letter-spacing: 0.05em;
        color: var(--color-text-muted);
        border-bottom: 1px solid var(--color-border);
    }

    .rev-table td {
        padding: 0.875rem 1.25rem;
        border-bottom: 1px solid var(--color-border-subtle);
        font-size: 0.9rem;
        text-align: center;
    }

    .rev-table tbody tr {
        transition: background var(--transition);
    }

        .rev-table tbody tr:hover {
            background: var(--color-bg-hover);
        }

        .rev-table tbody tr:last-child td {
            border-bottom: none;
        }

/* ============================================
   DETAIL VIEW
   ============================================ */

.detail-card {
    background: var(--color-bg-card);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: 2rem;
    min-width: 1280px;
}

.detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(600px, 1fr));
    gap: 0.4rem;
    margin-bottom: 0rem;
}

.detail-item {
    display: flex;
    flex-direction: column;
    gap: 0rem;
}

.detail-item-full {
    display: flex;
    flex-direction: column;
    gap: 0rem;
    width: 200%;
}

.detail-label {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--color-text-muted);
}

.detail-value {
    font-size: 1rem;
    font-weight: 500;
}

.detail-description {
    padding-top: 1.5rem;
    border-top: 1px solid var(--color-border-subtle);
}

    .detail-description p {
        color: var(--color-text-secondary);
        line-height: 1.7;
        margin-top: 0.5rem;
    }

/* ============================================
   FORMS
   ============================================ */

.form-card {
    background: var(--color-bg-card);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: 2rem;
    min-width: 1024px;
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem;
    margin-bottom: 1.5rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
}

.form-group-full {
    grid-column: 1 / -1;
}

.form-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--color-text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

/* Sits at the bottom of the (fixed) sidebar, above the version text, so page content can never overlap it. */
.currency-attribution {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 76px;
    padding: 0 1.25rem;
    font-size: 0.68rem;
    line-height: 1.35;
    color: var(--color-text-muted);
}

.currency-attribution a {
    color: var(--color-text-secondary);
}

.form-section-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0 0 16px 0;
    color: var(--color-text);
}

/* Help text under a form field, in the same small capitals as a label but light blue so it stands apart from the labels. */
.form-help {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--color-help);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.form-hint {
    font-size: 0.85rem;
    color: var(--color-help);
    margin: 4px 0 0 0;
}

.form-label-spaced-bottom {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--color-text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 12px;
}

.form-label-large {
    font-size: 1rem;
    font-weight: 700;
    color: var(--color-text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.form-label-large-success {
    font-size: 1rem;
    font-weight: 700;
    color: var(--color-success);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.form-label-value-success {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--color-success);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.form-label-value-danger {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--color-danger);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.form-label-value-danger-mid {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--color-danger);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.form-label-value-danger-small {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--color-danger);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.form-input {
    padding: 0.625rem 0.875rem;
    background: var(--color-bg-input);
    color: var(--color-text);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    transition: all var(--transition);
}

    .form-input:focus {
        outline: none;
        border-color: var(--color-primary);
        box-shadow: 0 0 0 3px var(--color-primary-subtle);
    }

    .form-input::placeholder {
        color: var(--color-text-muted);
    }

.form-textarea {
    min-height: 100px;
    resize: vertical;
}

.form-error {
    font-size: 0.8rem;
    color: var(--color-danger);
}

.form-caption {
    font-size: 0.8rem;
    color: var(--color-text-muted);
    margin: 0;
}

.form-alert {
    padding: 0.75rem 1rem;
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    margin-bottom: 1.5rem;
}

.form-alert-danger {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: var(--color-danger);
}
.form-alert-success {
    background: rgba(34, 197, 94, 0.1);
    border: 1px solid rgba(34, 197, 94, 0.3);
    color: #4ade80;
}

.form-alert-warning {
    background: rgba(245, 166, 35, 0.1);
    border: 1px solid rgba(245, 166, 35, 0.35);
    color: #f5a623;
}

.form-actions {
    display: flex;
    gap: 0.75rem;
    padding-top: 1rem;
    border-top: 1px solid var(--color-border-subtle);
}

.checkbox-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem 1.5rem;
}

.checkbox-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
}

    .checkbox-group input[type="checkbox"] {
        width: 1rem;
        height: 1rem;
        accent-color: var(--color-primary);
        cursor: pointer;
    }

.checkbox-label {
    font-size: 0.9rem;
    color: var(--color-text);
}

/* ============================================
   EMPTY & LOADING STATES
   ============================================ */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
}

.empty-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.empty-state h2 {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.empty-state p {
    color: var(--color-text-secondary);
    margin-bottom: 1.5rem;
}

.loading-spinner {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 4rem;
    gap: 1rem;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--color-border);
    border-top-color: var(--color-primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.loading-spinner p {
    color: var(--color-text-muted);
    font-size: 0.875rem;
}

/* ===== Account Manage Pages ===== */

.manage-layout {
    display: grid;
    grid-template-columns: 220px minmax(0, 1fr); /* minmax(0, ..) lets a wide grid scroll inside the page instead of stretching it past the window */
    gap: 2rem;
    align-items: start;
}

.manage-sidebar {
    position: sticky;
    top: calc(var(--topbar-height) + 1.5rem);
}

.manage-nav {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    background: var(--color-bg-card);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    padding: 0.5rem;
}

.manage-nav-link {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    padding: 0.625rem 0.875rem;
    color: var(--color-text-secondary);
    font-size: 0.875rem;
    font-weight: 500;
    border-radius: var(--radius-sm);
    transition: all var(--transition);
    text-decoration: none;
}

    .manage-nav-link:hover {
        color: var(--color-text);
        background: var(--color-bg-hover);
    }

    .manage-nav-link.active {
        color: var(--color-primary-hover);
        background: var(--color-primary-subtle);
        font-weight: 600;
    }

.manage-nav-icon {
    font-size: 1rem;
    width: 1.25rem;
    text-align: center;
}

.manage-section-title {
    font-size: 1.15rem;
    font-weight: 700;
    margin-bottom: 1.25rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--color-border-subtle);
}

.manage-info-text {
    color: var(--color-text-secondary);
    font-size: 0.9rem;
    line-height: 1.6;
    margin-bottom: 1rem;
}

.manage-alert {
    padding: 0.875rem 1rem;
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    margin-bottom: 1.25rem;
    line-height: 1.6;
}

    .manage-alert p {
        margin: 0.25rem 0;
    }

    .manage-alert a {
        color: inherit;
        text-decoration: underline;
    }

.manage-alert-success {
    background: rgba(34, 197, 94, 0.1);
    border: 1px solid rgba(34, 197, 94, 0.3);
    color: var(--color-success);
}

.manage-alert-danger {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: var(--color-danger);
}

.manage-alert-warning {
    background: rgba(245, 158, 11, 0.1);
    border: 1px solid rgba(245, 158, 11, 0.3);
    color: var(--color-warning);
}

.manage-alert-info {
    background: rgba(0, 210, 255, 0.1);
    border: 1px solid rgba(0, 210, 255, 0.3);
    color: var(--color-accent);
}

.manage-button-group {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    align-items: center;
    margin-top: 1rem;
}

.manage-subsection {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--color-border-subtle);
}

.manage-subsection-title {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
}

.manage-email-verified {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

    .manage-email-verified .form-input {
        flex: 1;
    }

.manage-verified-badge {
    color: var(--color-success);
    font-weight: 600;
    font-size: 0.85rem;
    white-space: nowrap;
}

.manage-steps {
    color: var(--color-text-secondary);
    font-size: 0.9rem;
    line-height: 1.7;
    padding-left: 1.25rem;
}

    .manage-steps li {
        margin-bottom: 1.25rem;
    }

    .manage-steps a {
        color: var(--color-primary);
    }

        .manage-steps a:hover {
            color: var(--color-primary-hover);
        }

.manage-kbd {
    display: inline-block;
    padding: 0.15rem 0.5rem;
    background: var(--color-bg-input);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    font-family: monospace;
    font-size: 0.85rem;
    color: var(--color-accent);
}

.manage-login-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.manage-login-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    background: var(--color-bg-input);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
}

.manage-login-name {
    font-weight: 500;
}

@media (max-width: 768px) {
    .manage-layout {
        grid-template-columns: minmax(0, 1fr);
    }

    .manage-sidebar {
        position: static;
    }

    .manage-nav {
        flex-direction: row;
        overflow-x: auto;
    }

    .manage-nav-link {
        white-space: nowrap;
    }
}

/* ============================================
   IDENTITY / AUTH PAGES
   ============================================ */

.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 8vh 2rem 2rem;
    background: var(--color-bg);
}

.auth-card {
    width: 100%;
    max-width: 540px;
    background: var(--color-bg-card);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: 2.5rem;
    box-shadow: var(--shadow-lg);
}

.auth-header {
    text-align: center;
    margin-bottom: 2rem;
}

.auth-logo {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--color-text);
    margin-bottom: 1.5rem;
}

    .auth-logo:hover {
        color: var(--color-text);
    }

.auth-header h1 {
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    margin-bottom: 0.375rem;
}

.auth-subtitle {
    color: var(--color-text-muted);
    font-size: 0.9rem;
}

.auth-card .form-group {
    margin-bottom: 1.25rem;
}

.auth-checkbox {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    font-size: 0.875rem;
    color: var(--color-text-secondary);
}

    .auth-checkbox input[type="checkbox"] {
        width: 1rem;
        height: 1rem;
        accent-color: var(--color-primary);
        cursor: pointer;
    }

.auth-submit {
    width: 100%;
    justify-content: center;
    padding: 0.75rem;
    font-size: 0.95rem;
    margin-bottom: 1.5rem;
}

.auth-links {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

    .auth-links a {
        font-size: 0.85rem;
        color: var(--color-text-muted);
        transition: color var(--transition);
    }

        .auth-links a:hover {
            color: var(--color-primary);
        }

h1:focus {
    outline: none;
}

.valid.modified:not([type=checkbox]) {
    outline: none;
}

.invalid {
    border-color: var(--color-danger) !important;
}

.validation-message {
    color: var(--color-danger);
    font-size: 0.8rem;
}

#blazor-error-ui {
    background: var(--color-danger);
    color: white;
    padding: 0.5rem 1rem;
    text-align: center;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 9999;
    display: none;
}

    #blazor-error-ui .dismiss {
        cursor: pointer;
        margin-left: 1rem;
    }

    #blazor-error-ui .reload {
        color: white;
        text-decoration: underline;
    }

.blazor-error-boundary {
    background: var(--color-danger);
    padding: 1rem;
    color: white;
    border-radius: var(--radius-sm);
}

    .blazor-error-boundary::after {
        content: "An error has occurred.";
    }

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 1024px) {
    .hero-section {
        flex-direction: column;
        padding: 1rem 1.5rem 3rem;
        text-align: center;
    }

    .hero-title {
        font-size: 2.5rem;
    }

    .hero-subtitle {
        margin: 0 auto 2rem;
    }

    .hero-actions {
        justify-content: center;
    }

    .hero-visual {
        max-width: 100%;
    }

    .hero-card-offset {
        margin-left: 0;
    }

    .features-grid {
        grid-template-columns: 1fr;
    }

    .app-sidebar {
        display: none;
    }

    .app-main {
        margin-left: 0;
    }

    .form-grid {
        grid-template-columns: 1fr;
    }

    .page-header {
        flex-direction: column;
    }

    .game-table-wrapper {
        overflow-x: auto;
    }
}

.darker-border-checkbox.form-check-input {
    border-color: #929292;
}

.form-floating > .form-control-plaintext::placeholder, .form-floating > .form-control::placeholder {
    color: var(--bs-secondary-color);
    text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder, .form-floating > .form-control:focus::placeholder {
    text-align: start;
}

/* ============================================
   SYNCFUSION CONTROLS
   ============================================ */

/* TextBox */
/* https://blazor.syncfusion.com/documentation/textbox/style-appearance */
.e-input:not(:valid), .e-input:valid, .e-float-input.e-control-wrapper input:not(:valid), .e-float-input.e-control-wrapper input:valid, .e-float-input input:not(:valid), .e-float-input input:valid, .e-input-group input:not(:valid), .e-input-group input:valid, .e-input-group.e-control-wrapper input:not(:valid), .e-input-group.e-control-wrapper input:valid, .e-float-input.e-control-wrapper textarea:not(:valid), .e-float-input.e-control-wrapper textarea:valid, .e-float-input textarea:not(:valid), .e-float-input textarea:valid, .e-input-group.e-control-wrapper textarea:not(:valid), .e-input-group.e-control-wrapper textarea:valid, .e-input-group textarea:not(:valid), .e-input-group textarea:valid {
    background-color: var(--color-bg-input);
    color: var(--color-text);
    height: 40px;
    width: 100%;
}

/* Need to replace grid-table-wrapper to aqua-table-wrapper to prevent filter dialogue box from being clipped. */
.aqua-table-wrapper {
    background: var(--color-bg-card);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    min-width: 1280px;
}

.aqua-table-wrapper-nowidth {
    background: var(--color-bg-card);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
}

.e-input-group.e-corner {
    border-radius: 4px;
}

.e-toast-container {
    z-index: 1000000001 !important;
}

/* ============================================
   AQUA CONTROLS
   ============================================ */

.dialog {
    background: var(--color-bg-card);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: 2rem;
}

/* Can't seem to get SyncFusion badges to work because including the bootstrap 5 themes styles breaks the base app styles ! */

.status-badge {
    background-color: darkgray;
    color: white;
    padding: 2px 12px;
    text-align: center;
    border-radius: 8px;
}

.status-success {
    background-color: green;
}

.status-failed {
    background-color: red;
}

/* Orange and yellow are light, so these badges use dark text (white on them is hard to read). */
.status-warning {
    background-color: orange;
    color: #1f2937;
    font-weight: 600;
}

.status-alert {
    background-color: #facc15;
    color: #1f2937;
    font-weight: 600;
}

.status-default {
    background-color: #4b5563;
}

.label-toggle {
    padding: 4px 4px 4px 0;
}

.label-toggle-warning {
    color: var(--color-warning);
}

.label-toggle-danger {
    color: var(--color-danger);
}

.separator-line {
    color: var( --color-border );
    width: 80%;
    text-align: left;
    margin-left: 0px;
    margin-top: 4px;
    margin-bottom: 4px;
}

hr {
    display: block;
    height: 1px;
    border: 0;
    border-top: 1px solid var( --color-border );
    margin: 1em 0;
    padding: 0;
}

.dialog-button {
    width: 100px;
}

.section-header {
    width: 1280px;
}

.footer-text {
    display: flex;
    color: var(--color-success);
    font-size: 0.8rem;
    text-align: center;
    position: fixed;
}

.error-message {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--color-danger);
    letter-spacing: 0.04em;
    align-content: center;
}

/* ============================================
   SYNC FUSION DATA GRID
   ============================================ */

.e-grid td.e-rowcell.e-focus.e-focused {
    box-shadow: none;
}

.e-grid th.e-headercell.e-focus.e-focused {
    box-shadow: none;
}

span {
}

    span .left {
        display: block;
        overflow: hidden;
        padding: 0px 4px 0px 6px;
    }

.label {
}

    .label .left {
        float: left;
        margin-right: 12px;
        margin-top: 8px
    }

.label-info {
    color: var(--color-accent);
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 8px;
}

.label-info-small {
    color: var(--color-accent);
    font-size: 1.0rem;
    font-weight: 600;
}

.button-apply {
    background: var(--color-primary-subtle);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 1.5rem;
    box-shadow: 0 4px 20px rgba(108, 92, 231, 0.3);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all var(--transition);
    text-decoration: none;
    height: 50px;
}

/* Grid rows whose record cannot be deleted (vendor with parts assigned to items, category with items).
   The Delete button stays clickable so the existing "cannot be deleted" alert still explains why. */
.aqua-delete-blocked button[title="Delete"] {
    opacity: 0.3;
    filter: grayscale(1);
    cursor: not-allowed;
}
/* FontAwesome icon in a manage side-menu link, sized to line up with the 30px image icons. */
.manage-nav-icon-fa {
    display: inline-block;
    width: 30px;
    text-align: center;
    font-size: 1.5rem;
    line-height: 30px;
    color: var(--color-primary-hover);
}
/* ============================================
   TOAST NOTIFICATIONS (plain Blazor, see Components/ToastComponent.razor)
   ============================================ */

.aqua-toast-host {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 1000000001;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    width: 22rem;
    max-width: calc(100vw - 2rem);
    pointer-events: none;
}

.aqua-toast {
    --aqua-toast-accent: var(--color-primary);
    pointer-events: auto;
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    background: var(--color-bg-card);
    color: var(--color-text);
    border: 1px solid var(--color-border);
    border-left: 4px solid var(--aqua-toast-accent);
    border-radius: var(--radius-md);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
    animation: aqua-toast-in 0.2s ease-out;
}

.aqua-toast-success { --aqua-toast-accent: var(--color-success); }
.aqua-toast-warning { --aqua-toast-accent: var(--color-warning); }
.aqua-toast-error { --aqua-toast-accent: var(--color-danger); }

.aqua-toast-body {
    flex: 1;
    min-width: 0;
}

.aqua-toast-title {
    font-weight: 600;
    font-size: 0.875rem;
    margin-bottom: 0.125rem;
}

.aqua-toast-content {
    font-size: 0.8125rem;
    color: var(--color-text-secondary);
    overflow-wrap: anywhere;
}

.aqua-toast-close {
    background: none;
    border: none;
    color: var(--color-text-muted);
    cursor: pointer;
    font-size: 1.125rem;
    line-height: 1;
    padding: 0;
}

    .aqua-toast-close:hover {
        color: var(--color-text);
    }

@keyframes aqua-toast-in {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: none; }
}

/* Country flags (Stores > Countries) */
.country-flag {
    height: 22px;
    max-width: 40px;
    object-fit: contain;
    border-radius: 2px;
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.2);
    vertical-align: middle;
}

.country-flag-preview {
    height: 48px;
    max-width: 80px;
    object-fit: contain;
    border-radius: 2px;
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.2);
    vertical-align: middle;
    margin: 0.35rem 0.5rem 0.35rem 0;
}

/* A drop-down with a reload button (and an add-new link) beside it */
.select-with-refresh {
    display: flex;
    gap: 0.5rem;
    align-items: stretch;
}

.select-with-refresh select {
    flex: 1;
}

.select-with-refresh .btn-secondary {
    padding: 0.4rem 0.8rem;
    white-space: nowrap;
}

/* Quick-add popup shown over a form (plain Blazor, not a Syncfusion dialog) */
.quick-add-backdrop {
    position: fixed;
    inset: 0;
    z-index: 2000;
    background: rgba(0, 0, 0, 0.65);
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 4vh 1rem;
    overflow-y: auto;
}

.quick-add-dialog {
    width: 100%;
    min-width: 0; /* overrides the 1024px minimum of .form-card */
    max-width: 640px;
    max-height: 92vh;
    overflow-y: auto;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6);
}

.quick-add-dialog h2 {
    margin-top: 0;
}

/* Stock take sheet */
.stocktake-table {
    width: 100%;
    border-collapse: collapse;
}

.stocktake-table th,
.stocktake-table td {
    padding: 0.4rem 0.6rem;
    border-bottom: 1px solid var(--color-border);
    text-align: left;
}

.stocktake-table .num {
    text-align: right;
}

.build-check-result {
    margin-top: 1.5rem; /* space between the check form above and the result message */
}

.stocktake-table-wrapper {
    margin-top: 1.5rem; /* space between the filter box above and the table */
}

.stocktake-count {
    width: 110px;
    text-align: right;
}

.stocktake-differs {
    color: var(--color-warning, #f5a623);
    font-weight: 600;
}

.stocktake-print {
    display: none;
}

@media print {
    body * {
        visibility: hidden;
    }

    .stocktake-print,
    .stocktake-print * {
        visibility: visible;
    }

    .stocktake-print {
        display: block;
        position: absolute;
        left: 0;
        top: 0;
        width: 100%;
        background: #fff;
        color: #000;
    }

    .stocktake-print table {
        width: 100%;
        border-collapse: collapse;
        font-size: 11px;
    }

    .stocktake-print th,
    .stocktake-print td {
        border: 1px solid #444;
        padding: 4px 6px;
        text-align: left;
    }

    .stocktake-print .count-box {
        min-width: 90px;
        height: 24px;
    }

    .stocktake-print thead {
        display: table-header-group;
    }
}


/* Messages window (dashboard) */
.messages-window {
    height: 100%;
    overflow: auto;
    padding: 0.5rem;
}

.messages-toolbar {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
    font-size: 0.85rem;
}

.messages-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.message-row {
    border-bottom: 1px solid var(--color-border-subtle);
    border-left: 3px solid transparent;
}

.message-unread {
    border-left-color: var(--color-primary);
    background: var(--color-primary-subtle);
}

.message-alert {
    border-left-color: var(--color-warning);
    background: rgba(245, 158, 11, 0.12);
}

    .message-alert .message-icon {
        color: var(--color-warning);
    }

.message-toggle {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
    width: 100%;
    padding: 0.45rem 0.5rem;
    background: transparent;
    border: none;
    color: var(--color-text);
    text-align: left;
    cursor: pointer;
    font-size: 0.85rem;
}

.message-unread .message-from,
.message-unread .message-headline {
    font-weight: 700;
}

.message-icon {
    width: 1.1rem;
    text-align: center;
    color: var(--color-text-secondary);
}

.message-from {
    white-space: nowrap;
    min-width: 8rem;
}

.message-headline {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--color-text-secondary);
}

.message-time {
    white-space: nowrap;
    color: var(--color-text-muted);
    font-size: 0.8rem;
}

.message-body {
    padding: 0.25rem 0.75rem 0.5rem 2rem;
    white-space: pre-wrap;
    font-size: 0.9rem;
}

.message-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    padding: 0 0.75rem 0.6rem 2rem;
}

.message-recipients {
    max-height: 10rem;
    overflow: auto;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    padding: 0.4rem;
    margin-top: 0.4rem;
}

.message-recipient {
    display: block;
    padding: 0.15rem 0;
    cursor: pointer;
}

.message-recipient-tools {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.4rem;
}


/* Unread messages badge in the top bar */
.message-badge {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.25rem 0.5rem;
    color: var(--color-text-muted);
    text-decoration: none;
    font-size: 1rem;
}

    .message-badge:hover {
        color: var(--color-text);
    }

.message-badge-unread {
    color: var(--color-primary);
}

.message-badge-alert {
    color: var(--color-warning);
    animation: message-badge-pulse 1.6s ease-in-out infinite;
}

.message-badge-count {
    min-width: 1.15rem;
    padding: 0 0.3rem;
    border-radius: 999px;
    background: var(--color-primary);
    color: #fff;
    font-size: 0.7rem;
    font-weight: 700;
    line-height: 1.15rem;
    text-align: center;
}

.message-badge-alert .message-badge-count {
    background: var(--color-warning);
    color: #1a1a26;
}

@keyframes message-badge-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.55; }
}


/* A dashboard window that has a dialog open comes to the front, so the dialog is not hidden behind the other windows.
   (Each window is its own layer, and a dialog cannot rise above its own window's layer.) */
.e-panel:has(.quick-add-backdrop) {
    z-index: 5000 !important;
}

/* Assembly editor: component search results and the editable components table */
.assembly-search-results {
    list-style: none;
    margin: 0.25rem 0 0;
    padding: 0;
    border: 1px solid var(--border-color, #444);
    border-radius: 6px;
    max-height: 18rem;
    overflow-y: auto;
}

.assembly-search-result {
    display: block;
    width: 100%;
    text-align: left;
    background: transparent;
    color: inherit;
    border: 0;
    border-bottom: 1px solid var(--border-color, #444);
    padding: 0.4rem 0.75rem;
    cursor: pointer;
}

.assembly-search-result:hover {
    background: rgba(255, 255, 255, 0.08);
}

.assembly-editor-table td {
    vertical-align: middle;
}

.assembly-find {
    width: 5rem;
}

.assembly-qty {
    width: 7rem;
}

.assembly-revision {
    min-width: 9rem;
}

.assembly-search-row {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.assembly-search-row .assembly-category-filter {
    flex: 0 0 20rem;
    max-width: 40%;
}

.assembly-search-row #add-search {
    flex: 1 1 auto;
}
