/* ==========================================================================
   InvoSys — design system
   Loaded after the Radzen Material theme so it wins on equal specificity.
   Palette: indigo (primary) + violet (accent) on light neutral surfaces,
   with a clean white app sidebar. All colors flow from the tokens below.
   ========================================================================== */

:root {
    /* Brand */
    --invo-primary: #4f46e5;
    --invo-primary-dark: #4338ca;
    --invo-primary-light: #6366f1;
    --invo-accent: #8b5cf6;
    --invo-gradient: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);

    /* Surfaces & text */
    --invo-bg: #f5f6fa;
    --invo-surface: #ffffff;
    --invo-surface-muted: #f8fafc;
    --invo-border: #e6e8ef;
    --invo-border-strong: #d5d9e4;
    --invo-text: #1e2433;
    --invo-muted: #667085;

    /* Sidebar (light rail, matches the header) */
    --invo-sidebar-bg: #ffffff;
    --invo-sidebar-text: #475467;
    --invo-sidebar-hover: #f2f4f7;

    /* Status tones */
    --tone-success-fg: #067647;
    --tone-success-bg: #ecfdf3;
    --tone-success-dot: #12b76a;
    --tone-danger-fg: #b42318;
    --tone-danger-bg: #fef3f2;
    --tone-danger-dot: #f04438;
    --tone-warning-fg: #b54708;
    --tone-warning-bg: #fffaeb;
    --tone-warning-dot: #f79009;
    --tone-info-fg: #3538cd;
    --tone-info-bg: #eef4ff;
    --tone-info-dot: #6366f1;
    --tone-neutral-fg: #475467;
    --tone-neutral-bg: #f2f4f7;
    --tone-neutral-dot: #98a2b3;

    /* Shape & depth */
    --invo-radius-sm: 8px;
    --invo-radius: 12px;
    --invo-radius-lg: 16px;
    --invo-shadow-xs: 0 1px 2px rgba(16, 24, 40, 0.05);
    --invo-shadow-sm: 0 1px 3px rgba(16, 24, 40, 0.07), 0 1px 2px rgba(16, 24, 40, 0.05);
    --invo-shadow: 0 8px 24px rgba(16, 24, 40, 0.08);
    --invo-shadow-lg: 0 16px 40px rgba(16, 24, 40, 0.12);
    --invo-transition: 0.18s cubic-bezier(0.4, 0, 0.2, 1);

    /* Re-theme the Radzen Material palette & shape system */
    --rz-primary: #4f46e5;
    --rz-primary-dark: #4338ca;
    --rz-primary-light: #6366f1;
    --rz-primary-lighter: rgba(79, 70, 229, 0.12);
    --rz-primary-darker: #3730a3;
    --rz-border-radius: 10px;
    --rz-input-border-radius: 10px;
    --rz-font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;

    /* Profile menu: Radzen paints the header trigger as a solid primary pill
       (--rz-profile-menu-top-item-background-color: var(--rz-primary)) with a
       white chevron. On the white app header we want a flat, neutral trigger. */
    --rz-profile-menu-top-item-background-color: transparent;
    --rz-profile-menu-toggle-button-color: #475467;
    --rz-profile-menu-item-hover-background-color: #f2f4f7;
}

/* ---------- Base ---------- */

html {
    scroll-behavior: smooth;
}

html, body {
    font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
    background-color: var(--invo-bg);
    color: var(--invo-text);
    font-size: 14.5px;
}

body, .rz-layout {
    font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

body {
    background-image: radial-gradient(1100px 380px at 85% -10%, rgba(99, 102, 241, 0.06), transparent 60%);
    background-attachment: fixed;
}

::selection {
    background: rgba(99, 102, 241, 0.22);
    color: #1e1b4b;
}

* {
    scrollbar-width: thin;
    scrollbar-color: #cbd5e1 transparent;
}

*::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

*::-webkit-scrollbar-thumb {
    background-color: #cbd5e1;
    border-radius: 999px;
    border: 2px solid transparent;
    background-clip: content-box;
}

*::-webkit-scrollbar-thumb:hover {
    background-color: #94a3b8;
}

a {
    color: var(--invo-primary);
    transition: color var(--invo-transition), opacity var(--invo-transition);
}

a:hover {
    color: var(--invo-primary-dark);
}

h1, h2, h3, h4, h5, h6 {
    letter-spacing: -0.015em;
    color: #101828;
}

h1 {
    font-weight: 700;
    font-size: 1.5rem;
    line-height: 1.25;
    margin: 0 0 0.35rem;
    color: #101828;
}

h1:focus {
    outline: none;
}

h5 {
    font-weight: 700;
    color: #101828;
}

hr {
    border-top: 1px solid var(--invo-border);
    opacity: 1;
    margin: 1rem 0 1.75rem;
}

/* Material Symbols helper (Radzen ships the font; .rzi is its icon class) */
.rzi {
    user-select: none;
}

/* ---------- Forms & validation ---------- */

.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

.invalid {
    outline: 1px solid #e50000;
}

.validation-message {
    color: #e50000;
}

.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyNjcuNTM5IDUzLjYyODMgMjkwLjE4NSA5Mi4xODMxIDI5MC41NDUgOTIuNzk1IDI5MC42NTYgOTIuOTk2QzI5MC44NzcgOTMuNTEzIDI5MSA5NC4wODE1IDI5MSA5NC42NzgyIDI5MSA5Ny4wNjUxIDI4OS4wMzggOTkgMjg2LjYxNyA5OUwyNDAuMzgzIDk5QzIzNy45NjMgOTkgMjM2IDk3LjA2NTEgMjM2IDk0LjY3ODIgMjM2IDk0LjM3OTkgMjM2LjAzMSA5NC4wODg2IDIzNi4wODkgOTMuODA3MkwyMzYuMzM4IDkzLjAxNjIgMjM2Ljg1OCA5Mi4xMzE0IDI1OS40NzMgNTMuNjI5NCAyNTkuOTYxIDUyLjc5ODUgMjYwLjQwNyA1Mi4yNjU4QzI2MS4yIDUxLjQ4MzcgMjYyLjI5NiA1MSAyNjMuNTA2IDUxWk0yNjMuNTg2IDY2LjAxODNUMjYwLjczNyA2Ni4wMTgzIDI1OS4zMTMgNjcuMTI0NSAyNTkuMzEzIDY5LjMzNyAyNTkuMzEzIDY5LjYxMDIgMjU5LjMzMiA2OS44NjA4IDI1OS4zNzEgNzAuMDg4N0wyNjEuNzk1IDg0LjAxNjEgMjY1LjM4IDg0LjAxNjEgMjY3LjgyMSA2OS43NDc1QzI2Ny44NiA2OS43MzA5IDI2Ny44NzkgNjkuNTg3NyAyNjcuODc5IDY5LjMxNzkgMjY3Ljg3OSA2Ny4xMTgyIDI2Ni40NDggNjYuMDE4MyAyNjMuNTg2IDY2LjAxODNaTTI2My41NzYgODYuMDU0N0MyNjEuMDQ5IDg2LjA1NDcgMjU5Ljc4NiA4Ny4zMDA1IDI1OS43ODYgODkuNzkyMSAyNTkuNzg2IDkyLjI4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

    .blazor-error-boundary::after {
        content: "An error has occurred."
    }

/* ==========================================================================
   App shell — header (white) / sidebar (white rail) / content
   ========================================================================== */

.rz-header {
    background-color: #ffffff !important;
    border-bottom: 1px solid var(--invo-border) !important;
    box-shadow: 0 1px 2px rgba(16, 24, 40, 0.04) !important;
}

.app-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    height: 64px;
    padding: 0 1.25rem 0 0.75rem;
}

.app-header-left {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-width: 0;
}

.app-header-right {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.app-header-brand {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    text-decoration: none;
    color: #101828;
    font-weight: 700;
    font-size: 1.05rem;
}

/* Header controls on a white surface */
.rz-header .rz-button {
    color: #475467;
    background-color: transparent;
    border-radius: 10px !important;
    box-shadow: none !important;
    border: none;
}

.rz-header .rz-button:hover {
    background-color: #f2f4f7;
    color: #101828;
}

.rz-header .rz-sidebar-toggle {
    background-color: transparent;
}

.rz-header .rz-sidebar-toggle:hover {
    background-color: #f2f4f7;
}

.rz-header .rz-button.rz-danger {
    color: #667085;
    font-weight: 600;
}

.rz-header .rz-button.rz-danger:hover {
    background-color: #fef3f2;
    color: #b42318;
}

/* ---------- Header profile menu ---------- */

/* Trigger sits flat on the white header instead of a solid primary pill. */
.rz-header .rz-profile-menu {
    background-color: transparent !important;
    padding: 0.25rem;
}

.rz-header .rz-profile-menu > .rz-navigation-item > .rz-navigation-item-wrapper {
    border-radius: 10px;
    transition: background-color var(--invo-transition), color var(--invo-transition);
}

/* Hover matches the other header buttons */
.rz-header .rz-profile-menu > .rz-navigation-item > .rz-navigation-item-wrapper:hover {
    background-color: #f2f4f7;
}

/* Open state: subtle neutral tint with dark text, not a filled pill */
.rz-header .rz-profile-menu > .rz-navigation-item > .rz-navigation-item-wrapper-active,
.rz-header .rz-profile-menu > .rz-navigation-item > .rz-navigation-item-wrapper-active:hover {
    background-color: #e4e7ec !important;
    color: #101828 !important;
}

.rz-header .rz-profile-menu .rz-navigation-item-icon-children {
    color: #475467 !important;
}

/* Dropdown panel */
.rz-header .rz-profile-menu .rz-navigation-menu {
    border: 1px solid var(--invo-border);
    border-radius: 12px;
    box-shadow: var(--invo-shadow-lg);
    min-width: 230px;
    padding: 0.5rem !important;
}

.rz-header .rz-profile-menu .rz-navigation-menu .rz-navigation-item-link {
    color: #344054;
    border-radius: 8px;
    padding-block: 0.55rem;
    padding-inline: 0.75rem;
    font-weight: 500;
    transition: background-color var(--invo-transition), color var(--invo-transition);
}

.rz-header .rz-profile-menu .rz-navigation-menu .rz-navigation-item:hover,
.rz-header .rz-profile-menu .rz-navigation-menu .rz-navigation-item-link:hover {
    background-color: #f2f4f7 !important;
    color: #101828;
}

.rz-header .rz-profile-menu .rz-navigation-menu .rzi {
    color: #475467;
}

/* ---------- Sidebar (light rail) ---------- */

.rz-sidebar {
    background-color: var(--invo-sidebar-bg) !important;
    border-right: 1px solid var(--invo-border);
    box-shadow: none;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
}

.rz-sidebar .rz-panel-menu {
    flex: 1 1 auto;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 0.35rem 0 1rem;
}

.sidebar-brand {
    padding: 1.35rem 1.15rem 1.05rem;
}

.sidebar-brand-link {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    text-decoration: none;
}

.brand-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border-radius: 0.6rem;
    background: var(--invo-gradient);
    font-size: 0.85rem;
    font-weight: 800;
    color: #ffffff;
    letter-spacing: 0.01em;
    flex-shrink: 0;
}

.brand-mark-lg {
    width: 2.35rem;
    height: 2.35rem;
    border-radius: 0.7rem;
    font-size: 0.95rem;
    box-shadow: 0 6px 16px rgba(99, 102, 241, 0.35);
}

.sidebar-brand-text {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
    min-width: 0;
}

.sidebar-brand-name {
    color: #101828;
    font-weight: 700;
    font-size: 1.05rem;
    letter-spacing: -0.01em;
}

.sidebar-brand-sub {
    color: var(--invo-muted);
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-top: 0.15rem;
}

.sidebar-section-label {
    padding: 0.9rem 1.35rem 0.4rem;
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: #98a2b3;
}

.sidebar-footer {
    border-top: 1px solid var(--invo-border);
    padding: 0.35rem 0.75rem 0.85rem;
}

.sidebar-footer .sidebar-section-label {
    padding: 0.6rem 0.6rem 0.35rem;
}

/* Footer links mirror the nav-item geometry so the rail reads as one system */
.sidebar-foot-link {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin: 2px 10px;
    padding: 0.6rem 0.75rem;
    border-radius: 10px;
    color: var(--invo-sidebar-text);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: background-color var(--invo-transition), color var(--invo-transition);
}

.sidebar-foot-link .rzi {
    font-size: 1.15rem;
    color: #98a2b3;
    transition: color var(--invo-transition);
}

.sidebar-foot-link:hover {
    background-color: var(--invo-sidebar-hover);
    color: #101828;
}

.sidebar-foot-link:hover .rzi {
    color: var(--invo-primary-light);
}

/* Navigation items inside the light sidebar */
.rz-sidebar .rz-navigation-item-wrapper {
    margin: 3px 10px;
    border-radius: 10px;
    transition: background-color var(--invo-transition);
}

.rz-sidebar .rz-navigation-item-link {
    border-radius: 10px;
    padding: 0.68rem 0.9rem;
    color: var(--invo-sidebar-text);
    font-weight: 500;
    transition: background-color var(--invo-transition), color var(--invo-transition);
}

.rz-sidebar .rz-navigation-item-link:hover {
    background-color: var(--invo-sidebar-hover);
    color: #101828;
}

.rz-sidebar .rz-navigation-item-icon {
    color: #98a2b3;
    transition: color var(--invo-transition);
}

.rz-sidebar .rz-navigation-item-link:hover .rz-navigation-item-icon {
    color: var(--invo-primary-light);
}

/* Active item: soft indigo tint — flat, modern, no glow */
.rz-sidebar .rz-navigation-item-link-active,
.rz-sidebar .rz-navigation-item-wrapper-active .rz-navigation-item-link {
    background-color: rgba(79, 70, 229, 0.1);
    color: var(--invo-primary-dark);
    font-weight: 600;
    box-shadow: none;
}

.rz-sidebar .rz-navigation-item-link-active .rz-navigation-item-icon,
.rz-sidebar .rz-navigation-item-wrapper-active .rz-navigation-item-icon {
    color: var(--invo-primary);
}

/* Keyboard focus on the rail */
.rz-sidebar a:focus-visible,
.rz-sidebar .rz-navigation-item-link:focus-visible {
    outline: 2px solid var(--invo-primary-light);
    outline-offset: -2px;
}

/* ---------- Main content ---------- */

.rz-body {
    background-color: transparent;
}

.app-content {
    max-width: 1360px;
    margin: 0 auto;
    padding: 1.75rem 1.75rem 3.25rem;
    box-sizing: border-box;
}

/* ---------- Page header pattern ---------- */

.page-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.page-subtitle {
    color: var(--invo-muted);
    font-size: 0.92rem;
    margin: 0.3rem 0 0;
    max-width: 60ch;
}

.page-header-title {
    display: flex;
    align-items: center;
    gap: 1rem;
    min-width: 0;
}

    .page-header-title h1 {
        margin: 0;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

.page-title-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

    .page-title-row h1 { margin: 0; }

.page-actions {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    flex-wrap: wrap;
}

/* ---------- Buttons ---------- */

.rz-button {
    border-radius: 10px !important;
    font-weight: 600;
    letter-spacing: 0.01em;
    box-shadow: none !important;
    transition: background-color var(--invo-transition), color var(--invo-transition),
                border-color var(--invo-transition), box-shadow var(--invo-transition),
                transform var(--invo-transition) !important;
}

.rz-button.rz-primary {
    background-color: var(--invo-primary);
}

.rz-button.rz-primary:hover {
    background-color: var(--invo-primary-dark);
    box-shadow: 0 6px 16px rgba(79, 70, 229, 0.32) !important;
    transform: translateY(-1px);
}

.rz-button.rz-primary:active {
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(79, 70, 229, 0.28) !important;
}

.rz-button.rz-secondary:hover,
.rz-button.rz-variant-outlined:hover {
    transform: translateY(-1px);
    box-shadow: var(--invo-shadow-sm) !important;
}

.rz-button.rz-variant-outlined {
    background-color: transparent;
}

.rz-button:focus-visible {
    outline: 2px solid var(--invo-primary);
    outline-offset: 2px;
}

/* ---------- Inputs ---------- */

.rz-textbox,
.rz-inputtext,
.rz-textarea,
.rz-password,
.rz-numeric,
.rz-datepicker,
.rz-dropdown,
.rz-multiselect,
.rz-select {
    border-radius: 10px !important;
    transition: border-color var(--invo-transition), box-shadow var(--invo-transition),
                background-color var(--invo-transition) !important;
}

.rz-textbox:hover:not(:focus),
.rz-inputtext:hover:not(:focus),
.rz-textarea:hover:not(:focus),
.rz-numeric:hover:not(:focus),
.rz-datepicker:hover:not(:focus),
.rz-dropdown:hover:not(:focus),
.rz-multiselect:hover:not(:focus) {
    border-color: #a5b4fc;
}

.rz-textbox:focus,
.rz-inputtext:focus,
.rz-textarea:focus,
.rz-password:focus,
.rz-numeric:focus,
.rz-datepicker:focus,
.rz-dropdown:focus,
.rz-multiselect:focus,
.rz-select:focus {
    border-color: var(--invo-primary) !important;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.14) !important;
}

.rz-label {
    font-weight: 600;
    color: #344054;
    font-size: 0.88rem;
}

.logo-file-input::file-selector-button {
    border: 1px solid var(--invo-border-strong);
    background-color: var(--invo-surface);
    color: var(--invo-primary);
    border-radius: 8px;
    padding: 0.45rem 0.9rem;
    font-weight: 600;
    cursor: pointer;
    margin-right: 0.75rem;
    transition: background-color var(--invo-transition), border-color var(--invo-transition);
}

.logo-file-input::file-selector-button:hover {
    background-color: #eef2ff;
    border-color: #c7d2fe;
}

/* ---------- Cards ---------- */

.rz-card {
    border-radius: 14px !important;
    border: 1px solid var(--invo-border) !important;
    background-color: var(--invo-surface);
    box-shadow: var(--invo-shadow-xs);
    transition: box-shadow var(--invo-transition), transform var(--invo-transition);
}

.rz-card:hover {
    box-shadow: var(--invo-shadow-sm);
}

/* Radzen ships its padding utilities with !important; give cards a roomier body */
.rz-card.rz-p-3,
.rz-card.rz-p-4 {
    padding: 1.35rem 1.5rem !important;
}

.card-section-title {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin: 0 0 1rem;
    font-weight: 700;
    font-size: 1.02rem;
    color: #101828;
}

.card-section-title .rzi {
    color: var(--invo-primary);
    font-size: 1.25rem;
}

/* ---------- KPI cards ---------- */

.kpi-card {
    border: 1px solid var(--invo-border);
    border-radius: 14px;
    background-color: var(--invo-surface);
    box-shadow: var(--invo-shadow-xs);
    padding: 1.15rem 1.3rem !important;
    height: 100%;
    min-height: 96px;
    display: flex;
    align-items: center;
    gap: 1rem;
    box-sizing: border-box;
    transition: box-shadow var(--invo-transition), transform var(--invo-transition),
                border-color var(--invo-transition);
}

.kpi-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--invo-shadow);
    border-color: #d8dcf5;
}

.kpi-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 46px;
    height: 46px;
    border-radius: 12px;
    font-size: 1.4rem;
    flex-shrink: 0;
}

.kpi-primary .kpi-icon { background: #eef2ff; color: #4f46e5; }
.kpi-success .kpi-icon { background: #ecfdf3; color: #067647; }
.kpi-danger .kpi-icon { background: #fef3f2; color: #b42318; }
.kpi-warning .kpi-icon { background: #fffaeb; color: #b54708; }
.kpi-neutral .kpi-icon { background: #f2f4f7; color: #475467; }
.kpi-info .kpi-icon { background: #eef4ff; color: #3538cd; }

.kpi-body {
    min-width: 0;
}

.kpi-label {
    font-size: 0.74rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--invo-muted);
    line-height: 1.4;
    margin-bottom: 0.4rem;
}

.kpi-value {
    font-size: clamp(1.35rem, 2vw, 1.65rem);
    font-weight: 700;
    color: #101828;
    line-height: 1.15;
    overflow-wrap: anywhere;
}

.kpi-hint {
    font-size: 0.78rem;
    color: var(--invo-muted);
    margin-top: 0.3rem;
}

/* ---------- AI assistant card ---------- */

.ai-card {
    border-color: #e0e4f5;
    background-image: linear-gradient(135deg, rgba(99, 102, 241, 0.05) 0%, rgba(139, 92, 246, 0.04) 100%);
    background-color: var(--invo-surface);
}

.ai-summary-result {
    border: 1px solid #e0e4f5;
    border-left: 3px solid var(--invo-primary-light);
    background-color: var(--invo-surface-muted);
    border-radius: 12px;
    padding: 0.95rem 1.15rem;
    color: #344054;
    line-height: 1.6;
    white-space: pre-line;
}

/* ---------- Data grids ---------- */

.rz-data-grid {
    border: 1px solid var(--invo-border);
    border-radius: 14px;
    overflow: hidden;
    box-shadow: var(--invo-shadow-xs);
    background-color: var(--invo-surface);
}

.rz-data-grid thead th {
    background-color: var(--invo-surface-muted);
    color: #667085;
    font-size: 0.74rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    border-bottom: 1px solid var(--invo-border);
}

.rz-data-grid tbody tr:hover {
    background-color: #f8faff;
}

.rz-data-grid a {
    font-weight: 600;
    text-decoration: none;
}

.rz-data-grid a:hover {
    text-decoration: underline;
}

/* ---------- Editable line-items table ---------- */

.line-items-table {
    width: 100%;
    border-collapse: collapse;
}

.line-items-table th {
    font-size: 0.74rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #667085;
    font-weight: 700;
    text-align: left;
    padding: 0.65rem 0.75rem;
    border-bottom: 1px solid var(--invo-border);
}

.line-items-table td {
    padding: 0.55rem 0.75rem;
    border-bottom: 1px solid var(--invo-border);
    vertical-align: middle;
}

.line-items-table tr:last-child td {
    border-bottom: none;
}

.line-items-table .col-qty { width: 110px; }
.line-items-table .col-price { width: 150px; }
.line-items-table .col-total { width: 130px; text-align: right; font-weight: 600; }
.line-items-table .col-actions { width: 56px; text-align: right; }

/* ---------- Status pills ---------- */

.status-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.42rem;
    padding: 0.24rem 0.7rem 0.24rem 0.6rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1.3;
    white-space: nowrap;
    letter-spacing: 0.01em;
}

.status-pill::before {
    content: "";
    width: 0.45rem;
    height: 0.45rem;
    border-radius: 50%;
    flex-shrink: 0;
    background: currentColor;
    opacity: 0.85;
}

.status-pill.status-success { background: var(--tone-success-bg); color: var(--tone-success-fg); }
.status-pill.status-danger { background: var(--tone-danger-bg); color: var(--tone-danger-fg); }
.status-pill.status-warning { background: var(--tone-warning-bg); color: var(--tone-warning-fg); }
.status-pill.status-info { background: var(--tone-info-bg); color: var(--tone-info-fg); }
.status-pill.status-neutral { background: var(--tone-neutral-bg); color: var(--tone-neutral-fg); }

/* ---------- Badges & alerts ---------- */

.rz-badge {
    border-radius: 999px !important;
    font-weight: 600;
    letter-spacing: 0.01em;
}

.rz-alert {
    border-radius: 12px !important;
    border: 1px solid transparent !important;
}

/* ---------- Toolbar (filters + search) ---------- */

.list-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.85rem;
    background-color: var(--invo-surface);
    border: 1px solid var(--invo-border);
    border-radius: 14px;
    padding: 0.75rem 0.9rem;
    margin-bottom: 1rem;
    box-shadow: var(--invo-shadow-xs);
}

.list-toolbar-group {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.filter-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    border: 1px solid var(--invo-border-strong);
    background-color: var(--invo-surface);
    color: #475467;
    border-radius: 999px;
    padding: 0.34rem 0.85rem;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--invo-transition);
}

.filter-chip:hover {
    border-color: #c7d2fe;
    color: var(--invo-primary-dark);
    background-color: #f8faff;
}

.filter-chip.active {
    background-color: #eef2ff;
    border-color: #a5b4fc;
    color: var(--invo-primary-dark);
}

.filter-chip .chip-count {
    background: rgba(79, 70, 229, 0.1);
    color: var(--invo-primary-dark);
    border-radius: 999px;
    padding: 0.05rem 0.45rem;
    font-size: 0.7rem;
    font-weight: 700;
}

.search-box {
    position: relative;
    display: inline-flex;
    align-items: center;
}

.search-box > .rzi {
    position: absolute;
    left: 0.85rem;
    color: #98a2b3;
    font-size: 1.15rem;
    pointer-events: none;
    transition: color var(--invo-transition);
}

/* The raw input is unstyled browser chrome by default — give it the app look:
   soft gray fill, hairline border, full pill shape, indigo focus ring. */
.search-box input,
.search-box .rz-textbox {
    width: 280px;
    max-width: 100%;
    height: 2.25rem;
    padding: 0 2.5rem !important;
    appearance: none;
    -webkit-appearance: none;
    background-color: #f9fafb;
    border: 1px solid var(--invo-border);
    border-radius: 999px;
    box-shadow: none;
    font-size: 0.875rem;
    color: #101828;
    transition: width 0.2s ease, border-color var(--invo-transition), background-color var(--invo-transition), box-shadow var(--invo-transition);
}

.search-box input::placeholder {
    color: #98a2b3;
}

/* Hide the browser-native clear affordance; the custom .search-clear button replaces it. */
.search-box input::-webkit-search-cancel-button,
.search-box input::-ms-clear {
    display: none;
}

.search-box input:hover {
    border-color: #c9d0e0;
    background-color: #ffffff;
}

.search-box input:focus {
    outline: none;
    background-color: #ffffff;
    border-color: var(--invo-primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.14);
}

.search-box:focus-within > .rzi {
    color: var(--invo-primary);
}

/* Grow slightly while searching (desktop only; the mobile rule below pins width: 100%). */
@media (min-width: 769px) {
    .search-box input:focus {
        width: 320px;
    }
}

.search-box .search-clear {
    position: absolute;
    right: 0.45rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.5rem;
    height: 1.5rem;
    padding: 0;
    border: none;
    border-radius: 50%;
    background-color: #eef0f4;
    color: #667085;
    cursor: pointer;
    transition: background-color var(--invo-transition), color var(--invo-transition);
}

.search-box .search-clear:hover {
    background-color: #e2e5ea;
    color: #101828;
}

.search-box .search-clear .rzi {
    font-size: 0.95rem;
    pointer-events: none;
}

/* ---------- QuickGrid invoice list ---------- */

.grid-card {
    background-color: var(--invo-surface);
    border: 1px solid var(--invo-border);
    border-radius: 14px;
    box-shadow: var(--invo-shadow-xs);
    overflow-x: auto;
    margin-bottom: 1rem;
}

.quickgrid[theme=invo] {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}

/* Header row */
.quickgrid[theme=invo] > thead > tr > th {
    background-color: #f9fafb;
    color: #667085;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    padding: 0.7rem 1rem;
    border-bottom: 1px solid var(--invo-border);
    white-space: nowrap;
}

.quickgrid[theme=invo] > thead > tr > th:first-child {
    padding-left: 1.25rem;
    border-top-left-radius: 14px;
}

.quickgrid[theme=invo] > thead > tr > th:last-child {
    padding-right: 1.25rem;
    border-top-right-radius: 14px;
}

.quickgrid[theme=invo] button.col-title {
    color: inherit;
    font: inherit;
    letter-spacing: inherit;
    text-transform: inherit;
    padding: 0.15rem 0.3rem;
    margin: -0.15rem -0.3rem;
    border-radius: 6px;
    transition: color var(--invo-transition), background-color var(--invo-transition);
}

.quickgrid[theme=invo] button.col-title:hover {
    color: var(--invo-primary-dark);
    background-color: #eef2ff;
}

.quickgrid[theme=invo] button.col-title:focus-visible {
    outline: 2px solid var(--invo-primary);
    outline-offset: 1px;
}

.quickgrid[theme=invo] th.col-sort-asc,
.quickgrid[theme=invo] th.col-sort-desc {
    color: var(--invo-primary-dark);
}

.quickgrid[theme=invo] .sort-indicator {
    opacity: 0.5;
}

/* Body rows */
.quickgrid[theme=invo] > tbody > tr > td {
    padding: 0.8rem 1rem;
    color: #1d2939;
    border-bottom: 1px solid #eef0f4;
    vertical-align: middle;
}

.quickgrid[theme=invo] > tbody > tr > td:first-child {
    padding-left: 1.25rem;
}

.quickgrid[theme=invo] > tbody > tr > td:last-child {
    padding-right: 1.25rem;
}

.quickgrid[theme=invo] > tbody > tr:last-child > td {
    border-bottom: none;
}

.quickgrid[theme=invo] > tbody > tr:hover > td {
    background-color: #f8faff;
}

/* .NET 9+ QuickGrid pads short pages with empty filler rows (by design, keeps
   the pager from jumping). Hide them — dotnet/aspnetcore#57199 workaround. */
.quickgrid[theme=invo] > tbody > tr:not(:has(td:not(:empty))) {
    display: none;
}

.quickgrid[theme=invo] td.col-justify-end,
.quickgrid[theme=invo] td.col-justify-right {
    text-align: right;
}

.quickgrid[theme=invo] th.col-justify-end .col-title,
.quickgrid[theme=invo] th.col-justify-right .col-title {
    justify-content: flex-end;
}

.quickgrid[theme=invo] td.col-justify-center {
    text-align: center;
}

/* Platform admin table (plain HTML table, mirrors quickgrid[theme=invo]) */
.platform-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}

.platform-table > thead > tr > th {
    background-color: #f9fafb;
    color: #667085;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    padding: 0.7rem 1rem;
    border-bottom: 1px solid var(--invo-border);
    white-space: nowrap;
    text-align: left;
}

.platform-table > thead > tr > th:first-child {
    padding-left: 1.25rem;
    border-top-left-radius: 14px;
}

.platform-table > thead > tr > th:last-child {
    padding-right: 1.25rem;
    border-top-right-radius: 14px;
}

.platform-table > tbody > tr > td {
    padding: 0.8rem 1rem;
    color: #1d2939;
    border-bottom: 1px solid #eef0f4;
    vertical-align: middle;
}

.platform-table > tbody > tr > td:first-child {
    padding-left: 1.25rem;
}

.platform-table > tbody > tr > td:last-child {
    padding-right: 1.25rem;
}

.platform-table > tbody > tr:last-child > td {
    border-bottom: none;
}

.platform-table > tbody > tr:hover > td {
    background-color: #f8faff;
}

.platform-table > tbody > tr.platform-row-suspended > td {
    background-color: #f9fafb;
    color: #667085;
}

.platform-table > tbody > tr.platform-row-suspended:hover > td {
    background-color: #f3f4f6;
}

.platform-table .col-actions {
    text-align: right;
    white-space: nowrap;
}

/* Pager bar */
.grid-pager {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.6rem 1rem;
    padding: 0.75rem 1.25rem;
    border-top: 1px solid var(--invo-border);
}

.pager-summary {
    font-size: 0.8rem;
    color: #667085;
}

.pager-controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.pager-pagesize {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.8rem;
    color: #667085;
    margin-right: 0.35rem;
}

.pager-size {
    width: 4.5rem;
}

.pager-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.9rem;
    height: 1.9rem;
    padding: 0;
    border: 1px solid var(--invo-border);
    border-radius: 8px;
    background-color: var(--invo-surface);
    color: #475467;
    cursor: pointer;
    transition: all var(--invo-transition);
}

.pager-btn:hover:not(:disabled) {
    border-color: #a5b4fc;
    color: var(--invo-primary-dark);
    background-color: #f8faff;
}

.pager-btn:disabled {
    opacity: 0.45;
    cursor: default;
}

.pager-btn .rzi {
    font-size: 1.15rem;
}

.pager-pageinfo {
    font-size: 0.8rem;
    color: #667085;
    min-width: 5.75rem;
    text-align: center;
    white-space: nowrap;
}

/* Column picker dropdown in the toolbar */
.column-picker {
    width: 11rem;
}

@media (max-width: 768px) {
    .grid-pager {
        flex-direction: column;
        align-items: flex-start;
    }

    .pager-pageinfo {
        min-width: 0;
    }
}

/* ---------- Loading & empty states ---------- */

.app-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.9rem;
    padding: 4.5rem 1rem;
    color: var(--invo-muted);
}

.app-loading .spinner {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: 3px solid #e2e5f0;
    border-top-color: var(--invo-primary);
    animation: invo-spin 0.7s linear infinite;
}

@keyframes invo-spin {
    to { transform: rotate(360deg); }
}

.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 3.5rem 1.5rem;
    color: var(--invo-muted);
}

.empty-state .empty-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    border-radius: 16px;
    background: #f2f4f7;
    color: #98a2b3;
    font-size: 1.8rem;
    margin-bottom: 1rem;
}

.empty-state h5 {
    margin: 0 0 0.35rem;
    color: #344054;
    font-size: 1rem;
}

.empty-state p {
    margin: 0 0 1.25rem;
    font-size: 0.9rem;
    max-width: 42ch;
}

/* ---------- Invoice document (detail page) ---------- */

.invoice-doc {
    background-color: var(--invo-surface);
    border: 1px solid var(--invo-border);
    border-radius: 16px;
    box-shadow: var(--invo-shadow-sm);
    padding: 2rem 2.25rem;
}

.invoice-doc-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--invo-border);
}

.invoice-doc-meta {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.4rem;
    text-align: right;
}

.invoice-parties {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.5rem;
    padding: 1.5rem 0;
}

.invoice-doc-brand {
    display: flex;
    align-items: center;
    gap: 1rem;
    min-width: 0;
    flex-wrap: wrap;
}

.invoice-party-label {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--invo-muted);
    margin-bottom: 0.5rem;
}

.invoice-party-name {
    font-weight: 700;
    color: #101828;
    margin-bottom: 0.15rem;
}

.invoice-party-detail {
    color: #475467;
    font-size: 0.9rem;
    line-height: 1.55;
}

.invoice-meta-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 1rem;
    padding: 1.25rem 0;
    border-top: 1px solid var(--invo-border);
}

.invoice-meta-item .invoice-party-label { margin-bottom: 0.3rem; }

.invoice-meta-value {
    font-weight: 600;
    color: #101828;
    font-size: 0.95rem;
}

.invoice-totals {
    max-width: 360px;
    margin-left: auto;
    border: 1px solid var(--invo-border);
    border-radius: 14px;
    background-color: var(--invo-surface-muted);
    padding: 1.1rem 1.35rem;
}

.invoice-totals > * + * {
    margin-top: 0.55rem;
}

.invoice-totals .totals-row {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    color: #475467;
    font-size: 0.92rem;
}

.invoice-totals .totals-row strong {
    color: #101828;
}

.invoice-totals .totals-grand {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    padding-top: 0.7rem;
    margin-top: 0.8rem !important;
    border-top: 1px solid var(--invo-border-strong);
    font-size: 1.05rem;
    font-weight: 700;
    color: #101828;
}

.payment-card {
    border: 1px solid var(--invo-border);
    border-radius: 14px;
    background-color: var(--invo-surface);
}

.invoice-logo {
    max-height: 52px;
    max-width: 132px;
    border: 1px solid var(--invo-border);
    border-radius: 10px;
    padding: 0.3rem 0.55rem;
    object-fit: contain;
    background: #ffffff;
}

.invoice-amount-label {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--invo-muted);
}

.invoice-amount-value {
    font-size: 1.75rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: #101828;
    font-variant-numeric: tabular-nums;
    line-height: 1.2;
}

    .invoice-amount-value.text-danger { color: var(--tone-danger-fg); }
    .invoice-amount-value.text-success { color: var(--tone-success-fg); }

.invoice-paid-row {
    color: var(--tone-success-fg) !important;
}

.back-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.2rem;
    height: 2.2rem;
    border-radius: 10px;
    border: 1px solid var(--invo-border);
    background: var(--invo-surface);
    color: #475467;
    text-decoration: none;
    flex-shrink: 0;
    transition: background var(--invo-transition), border-color var(--invo-transition), color var(--invo-transition);
}

    .back-link:hover {
        background: var(--invo-surface-muted);
        border-color: var(--invo-border-strong);
        color: var(--invo-primary);
    }

.doc-section {
    margin-top: 1.75rem;
}

.doc-section .card-section-title { margin-bottom: 0.75rem; }

/* ---------- Auth screens ---------- */

.auth-page {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding-top: 3.5rem;
    min-height: calc(100vh - 6rem);
}

.auth-card {
    width: 100%;
    max-width: 420px;
    background-color: #ffffff;
    border: 1px solid var(--invo-border);
    border-radius: 18px;
    box-shadow: var(--invo-shadow);
    padding: 2.25rem;
}

.auth-card-wide {
    max-width: 520px;
}

.auth-card h1 {
    font-size: 1.6rem;
    font-weight: 700;
}

.auth-brand {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-weight: 700;
    font-size: 1.1rem;
    color: #101828;
    margin-bottom: 1.5rem;
    text-decoration: none;
}

/* ---------- Dialogs ---------- */

.rz-dialog {
    border-radius: 16px !important;
    box-shadow: var(--invo-shadow-lg) !important;
}

.rz-dialog-titlebar {
    border-bottom: 1px solid var(--invo-border);
}

.rz-dialog-title {
    font-weight: 700 !important;
    color: #101828;
}

/* Catalog item picker (new-invoice dialog) */

.catalog-picker-search {
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--invo-border);
    border-radius: 8px;
    font-size: 0.92rem;
    color: #101828;
    background: #fff;
}

.catalog-picker-search:focus {
    outline: none;
    border-color: var(--invo-primary, #4f46e5);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.12);
}

.catalog-picker-list {
    max-height: 300px;
    overflow-y: auto;
    border: 1px solid var(--invo-border);
    border-radius: 10px;
}

.catalog-picker-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.6rem 0.75rem;
    border-bottom: 1px solid var(--invo-border);
}

.catalog-picker-row:last-child {
    border-bottom: none;
}

.catalog-picker-row:hover {
    background: #f9fafb;
}

.catalog-picker-row-main {
    flex: 1;
    min-width: 0;
}

.catalog-picker-row-price {
    font-weight: 600;
    color: #101828;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.catalog-item-name {
    font-weight: 600;
    color: #101828;
}

.catalog-item-desc {
    font-size: 0.8rem;
    color: var(--invo-muted);
}

.catalog-picker-empty {
    padding: 2rem 1rem;
    text-align: center;
    color: var(--invo-muted);
    font-size: 0.9rem;
}

.catalog-picker-hint {
    font-size: 0.78rem;
    color: var(--invo-muted);
}

/* ---------- Error / not found pages ---------- */

.nf-page {
    display: flex;
    justify-content: center;
    padding: 2.5rem 0 1rem;
}

.nf-home-link {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.55rem 1.15rem;
    border-radius: 10px;
    border: 1px solid var(--invo-border-strong);
    color: var(--invo-text);
    font-weight: 600;
    font-size: 0.92rem;
    text-decoration: none;
    transition: background var(--invo-transition), border-color var(--invo-transition), color var(--invo-transition);
}

    .nf-home-link:hover {
        background: var(--invo-surface-muted);
        border-color: var(--invo-primary-light);
        color: var(--invo-primary);
    }

    .nf-home-link .rzi { font-size: 1.05rem; }

.error-page {
    max-width: 620px;
    margin: 0 auto;
    padding: 3rem 1.5rem;
    text-align: center;
}

    .error-page h1 {
        font-size: 1.8rem;
        font-weight: 800;
        color: var(--invo-text);
        margin-bottom: 0.5rem;
    }

    .error-page .error-sub {
        color: var(--invo-muted);
        margin-bottom: 1.5rem;
    }

    .error-page .error-details {
        text-align: left;
        background-color: var(--invo-surface);
        border: 1px solid var(--invo-border);
        border-radius: 14px;
        padding: 1.25rem 1.4rem;
        font-size: 0.88rem;
        color: #475467;
        line-height: 1.6;
    }

/* ---------- Utility classes (kept for compatibility) ---------- */

.text-end { text-align: end; }
.text-muted { color: var(--invo-muted); }
.text-danger { color: #b42318; }
.text-success { color: #067647; }
.text-nowrap { white-space: nowrap; }
.small { font-size: 0.85rem; }
.fw-bold { font-weight: 700; }
.fw-semibold { font-weight: 600; }

.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 1rem; }
.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 1rem; }
.mt-4 { margin-top: 1.5rem; }

.d-flex { display: flex; }
.align-items-center { align-items: center; }
.gap-2 { gap: 0.5rem; }

.border { border: 1px solid var(--invo-border); }
.rounded { border-radius: 8px; }
.img-fluid { max-width: 100%; height: auto; }
.flex-grow-1 { flex-grow: 1; }
.justify-content-between { justify-content: space-between; }
.flex-wrap { flex-wrap: wrap; }

/* Keep headings and action buttons vertically centered in header stacks */
.rz-stack h1,
.rz-row h1 {
    margin: 0;
}

/* Section headings inside cards */
.rz-card > h5 {
    margin-top: 0;
    margin-bottom: 1rem;
    font-weight: 700;
    color: #101828;
}

/* ---------- User avatar ---------- */

.user-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    background-image: var(--invo-gradient);
    color: #ffffff;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.35);
}

.user-avatar-lg {
    width: 3.25rem;
    height: 3.25rem;
    font-size: 1.15rem;
    border-radius: 1rem;
    box-shadow: 0 8px 20px rgba(99, 102, 241, 0.35);
}

/* ---------- Account settings (Manage) page ---------- */

.profile-card-head {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding-bottom: 1.1rem;
    margin-bottom: 1.25rem;
    border-bottom: 1px solid var(--invo-border);
}

.profile-card-identity {
    min-width: 0;
}

.profile-card-name {
    font-size: 1.15rem;
    font-weight: 700;
    color: #101828;
    letter-spacing: -0.01em;
    overflow-wrap: anywhere;
}

.profile-card-sub {
    color: var(--invo-muted);
    font-size: 0.9rem;
    margin-top: 0.15rem;
    overflow-wrap: anywhere;
}

.profile-field-hint {
    display: flex;
    align-items: flex-start;
    gap: 0.4rem;
    color: var(--invo-muted);
    font-size: 0.8rem;
    margin-top: 0.4rem;
    line-height: 1.45;
}

.profile-field-hint .rzi {
    font-size: 0.95rem;
    line-height: 1.3;
}

.avatar-sm {
    width: 1.6rem;
    height: 1.6rem;
    font-size: 0.6rem;
    box-shadow: none;
}

.customer-cell {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    min-width: 0;
}

.customer-cell .fw-semibold {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.product-cell {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    min-width: 0;
}

.product-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.6rem;
    height: 1.6rem;
    border-radius: 0.45rem;
    background: var(--tone-neutral-bg);
    color: var(--tone-neutral-fg);
    font-size: 0.85rem;
    flex-shrink: 0;
}

.product-cell .product-name {
    font-weight: 600;
    color: var(--invo-text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.product-desc {
    color: var(--invo-text-muted);
    font-size: 0.85rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 420px;
}

.price-cell {
    font-weight: 600;
    color: var(--invo-text);
    font-variant-numeric: tabular-nums;
}

/* ---------- Error UI ---------- */

#blazor-error-ui {
    color-scheme: light only;
    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;
    }

/* ---------- Responsive ---------- */

@media (max-width: 768px) {
    .app-content {
        padding: 1.25rem 1rem 2.5rem;
    }

    .invoice-doc {
        padding: 1.5rem 1.25rem;
    }

    .invoice-doc-meta {
        align-items: flex-start;
        text-align: left;
    }

    .search-box input,
    .search-box .rz-textbox {
        width: 100%;
    }

    .list-toolbar {
        align-items: stretch;
    }

    .list-toolbar-group {
        width: 100%;
    }
}

/* ---------- Reduced motion ---------- */

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* ---------- Docs page ---------- */

.docs-layout {
    display: grid;
    grid-template-columns: 230px minmax(0, 1fr);
    gap: 1.5rem;
    align-items: start;
}

/* Sticky table of contents */
.docs-toc {
    position: sticky;
    top: 1rem;
    background: var(--invo-surface);
    border: 1px solid var(--invo-border);
    border-radius: var(--invo-radius);
    box-shadow: var(--invo-shadow-xs);
    padding: 0.95rem 0.85rem;
    display: flex;
    flex-direction: column;
}

.docs-toc-title {
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    color: var(--invo-muted);
    padding: 0 0.6rem;
    margin-bottom: 0.4rem;
}

.docs-toc a {
    display: block;
    padding: 0.36rem 0.6rem;
    border-radius: var(--invo-radius-sm);
    color: var(--invo-sidebar-text);
    text-decoration: none;
    font-size: 0.9rem;
    line-height: 1.35;
    transition: background-color var(--invo-transition), color var(--invo-transition);
}

.docs-toc a:hover {
    background: var(--invo-sidebar-hover);
    color: var(--invo-primary);
}

.docs-content {
    min-width: 0;
}

/* Each docs topic is a white card */
.docs-section {
    background: var(--invo-surface);
    border: 1px solid var(--invo-border);
    border-radius: var(--invo-radius);
    box-shadow: var(--invo-shadow-xs);
    padding: 1.6rem 1.8rem;
    margin-bottom: 1.25rem;
    scroll-margin-top: 5.5rem;
}

.docs-section:last-child {
    margin-bottom: 0;
}

.docs-section h2 {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-size: 1.2rem;
    font-weight: 700;
    margin: 0 0 0.9rem;
    color: var(--invo-text);
}

.docs-section h2 .rzi {
    color: var(--invo-primary);
    font-size: 1.4rem;
}

.docs-section p {
    margin: 0 0 0.85rem;
    color: var(--invo-text);
    line-height: 1.65;
}

.docs-section > :last-child {
    margin-bottom: 0;
}

.docs-section a {
    color: var(--invo-primary);
}

.docs-section code {
    background: var(--invo-surface-muted);
    border: 1px solid var(--invo-border);
    border-radius: 6px;
    padding: 0.1rem 0.35rem;
    font-size: 0.86em;
    color: var(--invo-primary-dark);
}

/* Numbered step lists */
.docs-steps {
    margin: 0 0 0.85rem;
    padding-left: 1.35rem;
}

.docs-steps > li {
    margin-bottom: 0.55rem;
    padding-left: 0.25rem;
    line-height: 1.6;
}

.docs-steps > li::marker {
    color: var(--invo-primary);
    font-weight: 700;
}

.docs-steps ul {
    margin: 0.45rem 0 0.2rem;
    padding-left: 1.2rem;
}

.docs-steps ul li {
    margin-bottom: 0.4rem;
    line-height: 1.6;
}

/* Plain bullet lists */
.docs-list {
    margin: 0 0 0.85rem;
    padding-left: 1.3rem;
}

.docs-list li {
    margin-bottom: 0.5rem;
    line-height: 1.6;
}

.docs-list li::marker {
    color: var(--invo-primary);
}

/* Callout notes (info / tips) */
.docs-note {
    display: flex;
    align-items: flex-start;
    gap: 0.65rem;
    background: var(--tone-info-bg);
    border: 1px solid rgba(53, 56, 205, 0.14);
    border-left: 3px solid var(--invo-primary);
    border-radius: var(--invo-radius-sm);
    padding: 0.8rem 1rem;
    margin: 0 0 0.85rem;
    font-size: 0.92rem;
    line-height: 1.6;
    color: var(--invo-text);
}

.docs-note .rzi {
    color: var(--invo-primary);
    margin-top: 0.1rem;
}

/* Status reference table */
.docs-table {
    width: 100%;
    border-collapse: collapse;
    margin: 0 0 0.85rem;
    font-size: 0.93rem;
}

.docs-table th {
    text-align: left;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--invo-muted);
    padding: 0.5rem 0.75rem;
    border-bottom: 1px solid var(--invo-border-strong);
}

.docs-table td {
    padding: 0.65rem 0.75rem;
    border-bottom: 1px solid var(--invo-border);
    vertical-align: top;
    line-height: 1.55;
}

.docs-table tbody tr:last-child td {
    border-bottom: none;
}

/* FAQ accordions */
.docs-faq details {
    border-bottom: 1px solid var(--invo-border);
    padding: 0.15rem 0;
}

.docs-faq details:last-child {
    border-bottom: none;
}

.docs-faq summary {
    cursor: pointer;
    list-style: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.55rem 0.15rem;
    border-radius: var(--invo-radius-sm);
    font-weight: 600;
    color: var(--invo-text);
    transition: color var(--invo-transition);
}

.docs-faq summary::-webkit-details-marker {
    display: none;
}

.docs-faq summary::before {
    content: "chevron_right";
    font-family: "Material Symbols";
    font-size: 1.2rem;
    line-height: 1;
    color: var(--invo-muted);
    transition: transform var(--invo-transition), color var(--invo-transition);
    flex-shrink: 0;
}

.docs-faq summary:hover {
    color: var(--invo-primary);
}

.docs-faq details[open] summary::before {
    transform: rotate(90deg);
    color: var(--invo-primary);
}

.docs-faq details p {
    margin: 0;
    padding: 0 0.85rem 0.9rem 2.15rem;
    color: var(--invo-muted);
}

/* Docs: single column on smaller screens */
@media (max-width: 992px) {
    .docs-layout {
        grid-template-columns: minmax(0, 1fr);
    }

    .docs-toc {
        position: static;
        flex-direction: row;
        flex-wrap: wrap;
        gap: 0.25rem;
        align-items: center;
    }

    .docs-toc-title {
        width: 100%;
        margin-bottom: 0.5rem;
    }

    .docs-toc a {
        padding: 0.3rem 0.6rem;
        border: 1px solid var(--invo-border);
        border-radius: 999px;
        font-size: 0.84rem;
    }

    .docs-section {
        padding: 1.25rem 1.15rem;
    }
}
