/* ===============================================
   APP DESIGN SYSTEM - CSS VARIABLES
   Injected dynamically by ThemeService from CustomerTheme.
   This file uses --app-* tokens set in :root by ThemeService.
   =============================================== */

/* ===============================================
   BASE STYLES
   =============================================== */

html, body {
    overflow-x: hidden;
    background-color: var(--app-bg-page);
    color: var(--app-text-primary);
    /* Font-family is set by MudBlazor Typography from CustomerTheme */
}

/* ===============================================
   APP LAYOUT STYLES
   =============================================== */

.app-layout {
    background-color: var(--app-bg-page);
    min-height: 100vh;
}

.app-main-content {
    background-color: transparent;
    position: relative;
    z-index: 2;
}

.app-bg-decoration {
    position: fixed;
    bottom: -40px;
    right: -40px;
    width: 400px;
    height: auto;
    opacity: 0.15;
    pointer-events: none;
    z-index: 1;
}

/* ===============================================
   THEME TRANSITION — smooth light/dark switch
   Prevents visual "split" where bars change before content.
   =============================================== */

.app-layout,
.app-appbar,
.app-sidebar,
.app-main-content {
    transition: background-color 0.25s ease, color 0.25s ease, border-color 0.25s ease;
}

/* ===============================================
   APP APPBAR STYLES
   =============================================== */

.app-appbar {
    background: var(--app-bg-appbar) !important;
    border-bottom: 1px solid var(--app-border-light);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.app-appbar .mud-icon-button {
    color: var(--app-text-secondary);
    transition: var(--app-transition-fast);
}

.app-appbar .mud-icon-button:hover {
    background-color: rgba(var(--mud-palette-primary-rgb), 0.1);
    color: var(--app-primary);
}

/* App Title in AppBar */
.app-title {
    color: var(--app-text-primary);
    font-weight: 600;
    letter-spacing: -0.02em;
}

/* ===============================================
   APP SIDEBAR STYLES
   =============================================== */

.app-sidebar {
    background: var(--app-drawer-bg) !important;
}

.app-sidebar.mud-drawer--open {
    min-width: 260px;
}

/* Mini/collapsed sidebar */
.app-sidebar--mini .mud-drawer-content {
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: none; /* Firefox */
}

.app-sidebar--mini .mud-drawer-content::-webkit-scrollbar {
    display: none; /* Chrome, Safari, Edge */
}

.app-sidebar--mini .app-nav-menu {
    padding: 8px 0;
}

.app-sidebar--mini .nav-section {
    margin-bottom: 8px;
}

.app-sidebar--mini .app-nav-links .mud-nav-link {
    margin: 2px 8px;
    padding: 12px 0;
    justify-content: center;
}

.app-sidebar--mini .app-nav-links .mud-nav-link-text {
    display: none;
}

.app-sidebar--mini .app-nav-links .mud-nav-link .mud-nav-link-icon {
    margin: 0;
}

.app-sidebar--mini .app-nav-links .mud-nav-link.active {
    box-shadow: inset 3px 0 0 var(--app-primary);
}

.app-sidebar .mud-drawer-content {
    background: transparent;
}

.app-nav-menu {
    padding: 16px 0;
    height: 100%;
}

/* Brand Logo */
.nav-brand {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px 20px 16px;
}

.nav-divider {
    background-color: rgba(255, 255, 255, 0.08) !important;
    margin: 8px 16px !important;
}

.nav-section {
    margin-bottom: 16px;
}

.nav-section-title {
    display: block;
    padding: 8px 20px;
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: rgba(255, 255, 255, 0.4);
}

/* Sidebar Navigation Links */
.app-nav-links .mud-nav-link {
    color: rgba(255, 255, 255, 0.7) !important;
    margin: 2px 12px;
    padding: 12px 16px;
    border-radius: var(--app-radius-sm);
    transition: var(--app-transition);
}

.app-nav-links .mud-nav-link:hover {
    background-color: rgba(255, 255, 255, 0.08) !important;
    color: var(--app-drawer-text) !important;
}

.app-nav-links .mud-nav-link.active {
    background-color: rgba(var(--mud-palette-primary-rgb), 0.15) !important;
    color: var(--app-drawer-text) !important;
    box-shadow: inset 3px 0 0 var(--app-primary);
}

.app-nav-links .mud-nav-link .mud-nav-link-icon {
    color: inherit !important;
    transition: var(--app-transition);
}

/* Prevent nav link text wrapping and truncation */
.app-nav-links .mud-nav-link-text {
    overflow: visible;
    text-overflow: unset;
    white-space: nowrap;
}

.app-nav-links .mud-nav-link:hover .mud-nav-link-icon {
    color: var(--app-primary) !important;
}

.app-nav-links .mud-nav-link.active .mud-nav-link-icon {
    color: var(--app-primary) !important;
}

.app-nav-links .mud-nav-group-title {
    color: rgba(255, 255, 255, 0.7) !important;
    padding: 10px 20px;
}

.app-nav-links .mud-nav-group-title:hover {
    background-color: rgba(255, 255, 255, 0.05) !important;
    color: var(--app-drawer-text) !important;
}

.app-nav-links .mud-nav-group .mud-nav-link {
    padding-left: 48px;
}

.app-nav-links .mud-expand-panel {
    background-color: transparent !important;
}

.app-nav-links .mud-expand-panel-header {
    color: rgba(255, 255, 255, 0.7) !important;
}

.app-nav-links .mud-expand-panel-header:hover {
    color: var(--app-drawer-text) !important;
}

/* ===============================================
   STAT CARD STYLES
   =============================================== */

.stat-card {
    background: var(--app-bg-surface);
    border-radius: var(--app-radius-md);
    padding: 24px;
    height: 100%;
    box-shadow: var(--app-shadow-sm);
    transition: var(--app-transition);
    border: none;
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--app-shadow-lg) !important;
}

.stat-card-content {
    display: flex;
    align-items: flex-start;
    gap: 16px;
}

.stat-card-icon {
    width: 56px;
    height: 56px;
    border-radius: var(--app-radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

/* Icon color backgrounds using theme semantic colors */
.stat-card-icon.icon-primary {
    background: var(--app-primary);
}

.stat-card-icon.icon-success {
    background: var(--app-success);
}

.stat-card-icon.icon-warning {
    background: var(--app-warning);
}

.stat-card-icon.icon-error {
    background: var(--app-error);
}

.stat-card-icon.icon-info {
    background: var(--app-info);
}

.stat-card-icon.icon-secondary {
    background: var(--app-secondary);
}

.stat-card-info {
    flex: 1;
    min-width: 0;
}

.stat-card-title {
    color: var(--app-text-secondary);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
}

.stat-card-value {
    color: var(--app-text-primary);
    font-weight: 700;
    font-size: 1.75rem;
    line-height: 1.2;
    margin-bottom: 8px;
}

.stat-card-change {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.8rem;
    font-weight: 600;
}

.stat-card-change.positive {
    color: var(--app-success);
}

.stat-card-change.negative {
    color: var(--app-error);
}

/* ===============================================
   CHART CARD STYLES
   =============================================== */

.chart-card {
    background: var(--app-bg-surface);
    border-radius: var(--app-radius-md);
    height: 100%;
    box-shadow: var(--app-shadow-sm);
    transition: var(--app-transition);
}

.chart-card:hover {
    box-shadow: var(--app-shadow-md);
}

.chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.chart-legend-inline {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.8rem;
    color: var(--app-text-secondary);
}

.legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.donut-chart-container {
    display: flex;
    justify-content: center;
}

.donut-legend {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.legend-color {
    width: 12px;
    height: 12px;
    border-radius: 4px;
    flex-shrink: 0;
}

.legend-label {
    flex: 1;
    font-size: 0.85rem;
    color: var(--app-text-secondary);
}

.legend-value {
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--app-text-primary);
}

.line-chart-container {
    width: 100%;
    overflow-x: auto;
}

/* ===============================================
   TABLE CARD STYLES
   =============================================== */

.table-card {
    background: var(--app-bg-surface);
    border-radius: var(--app-radius-md);
    height: 100%;
    box-shadow: var(--app-shadow-sm);
    overflow: hidden;
    transition: var(--app-transition);
}

.table-card:hover {
    box-shadow: var(--app-shadow-md);
}

.app-table {
    background: transparent !important;
}

.app-table .mud-table-head .mud-table-row {
    background-color: var(--app-bg-page);
}

.app-table .mud-table-head .mud-table-cell {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--app-text-secondary);
    border-bottom: 1px solid var(--app-border-light);
    padding: 14px 16px;
}

.app-table .mud-table-body .mud-table-row {
    transition: var(--app-transition-fast);
}

.app-table .mud-table-body .mud-table-row:hover {
    background-color: rgba(var(--mud-palette-primary-rgb), 0.04) !important;
}

.app-table .mud-table-body .mud-table-cell {
    padding: 14px 16px;
    border-bottom: 1px solid var(--app-border-light);
    font-size: 0.875rem;
    color: var(--app-text-primary);
}

.app-table .mud-table-body .mud-table-row:last-child .mud-table-cell {
    border-bottom: none;
}

/* Dark mode: reduce striped row contrast (default is too light) */
[data-theme="dark"] .mud-table-striped .mud-table-body .mud-table-row:nth-of-type(odd) {
    background-color: rgba(255, 255, 255, 0.03) !important;
}

/* ===============================================
   BUTTON STYLES
   =============================================== */

.mud-button-filled.mud-button-primary {
    border-radius: var(--app-radius-sm);
    font-weight: 600;
    text-transform: none;
    letter-spacing: 0;
    transition: var(--app-transition);
}

.mud-button-filled.mud-button-primary:hover {
    box-shadow: var(--app-shadow-md);
    transform: translateY(-1px);
}

.mud-button-outlined {
    border-radius: var(--app-radius-sm);
    font-weight: 600;
    text-transform: none;
    letter-spacing: 0;
    transition: var(--app-transition);
}

/* ===============================================
   FORM INPUT STYLES
   =============================================== */

.mud-input-outlined .mud-input-outlined-border {
    border-radius: var(--app-radius-sm) !important;
    border-color: var(--app-border-light);
    transition: var(--app-transition-fast);
}

.mud-input-outlined:hover .mud-input-outlined-border {
    border-color: var(--app-border-default) !important;
}

.mud-input-outlined.mud-input-root-focused .mud-input-outlined-border {
    border-color: var(--app-primary) !important;
    box-shadow: 0 0 0 3px rgba(var(--mud-palette-primary-rgb), 0.15);
}

/* ===============================================
   DIALOG STYLES
   =============================================== */

.mud-dialog {
    border-radius: var(--app-radius-md) !important;
    box-shadow: var(--app-shadow-lg);
    border-top: 3px solid var(--app-secondary);
}

.mud-dialog-title {
    font-weight: 600;
    border-bottom: 1px solid var(--app-border-light);
}

.mud-dialog-actions {
    border-top: 1px solid var(--app-border-light);
}

/* ===============================================
   CHIP STYLES
   =============================================== */

.mud-chip {
    font-weight: 600;
    letter-spacing: 0.25px;
    border-radius: var(--app-radius-full);
}

.mud-chip.mud-chip-size-small {
    border-radius: var(--app-radius-full);
}

.mud-chip.mud-chip-size-medium {
    border-radius: var(--app-radius-full);
}

.mud-chip.mud-chip-size-large {
    border-radius: var(--app-radius-full);
}

/* ===============================================
   HEADER SEARCH
   =============================================== */

.header-search {
    max-width: 300px;
    width: 100%;
}

.header-search-field {
    background-color: rgba(0, 0, 0, 0.04);
    border-radius: var(--app-radius-full);
}

.header-search-field .mud-input-outlined-border {
    border-color: transparent !important;
    border-radius: var(--app-radius-full);
}

.header-search-field:hover .mud-input-outlined-border {
    border-color: var(--app-border-light) !important;
}

.header-search-field.mud-input-root-focused .mud-input-outlined-border {
    border-color: var(--app-primary) !important;
}

/* ===============================================
   NOTIFICATION STYLES
   =============================================== */

.notification-badge .mud-badge-content {
    font-size: 0.65rem;
    min-width: 16px;
    height: 16px;
}

.notification-menu {
    min-width: 300px;
    max-width: 350px;
    border-radius: var(--app-radius-md);
}

.notification-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
}

.notification-item {
    display: flex;
    align-items: flex-start;
    padding: 8px 16px;
    cursor: pointer;
}

.notification-item:hover {
    background-color: var(--mud-palette-action-default-hover);
}

.notification-content {
    flex: 1;
}

.notification-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 24px;
    gap: 8px;
}

.notification-view-all {
    text-align: center;
    padding: 8px;
    cursor: pointer;
}

.notification-view-all:hover {
    background-color: var(--mud-palette-action-default-hover);
}

.notification-unread {
    background-color: rgba(var(--mud-palette-primary-rgb), 0.04);
}

.notification-dot-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    min-width: 24px;
    padding-top: 4px;
}

.notification-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: var(--mud-palette-primary);
}

.notification-row-unread {
    background-color: rgba(var(--mud-palette-primary-rgb), 0.04) !important;
}

/* ===============================================
   NOTIFICATION TIMELINE (TP-736)
   =============================================== */

.notification-timeline .mud-timeline-item-opposite {
    min-width: 60px;
}

.notification-day-card {
    border-radius: var(--app-radius-md);
}

.notification-day-unread {
    border-left: 3px solid var(--mud-palette-primary);
}

.notification-category-group {
    padding-left: 4px;
}

.notification-timeline-item {
    display: flex;
    align-items: flex-start;
    padding: 6px 8px;
    border-radius: var(--app-radius-sm);
    cursor: pointer;
    gap: 8px;
}

.notification-timeline-item:hover {
    background-color: var(--mud-palette-action-default-hover);
}

.notification-timeline-item--unread {
    background-color: rgba(var(--mud-palette-primary-rgb), 0.04);
}

.notification-timeline-item__dot-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    min-width: 20px;
    padding-top: 4px;
}

.notification-timeline-item__content {
    flex: 1;
    min-width: 0;
}

.notification-timeline-item__content .mud-typography-caption {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Inline unread notification count badge inside MudNavLink */
.nav-unread-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background-color: var(--mud-palette-error);
    color: #fff;
    font-size: 0.65rem;
    font-weight: 700;
    min-width: 16px;
    height: 16px;
    border-radius: 8px;
    padding: 0 4px;
    margin-left: 6px;
    line-height: 1;
}

.cursor-pointer {
    cursor: pointer;
}

/* ===============================================
   CHECK TYPE VISUAL DIFFERENTIATION
   ZGK (Graph) = info/blue, ZKK (Test) = warning/orange, OSK (Real) = success/green
   =============================================== */

.check-type-border-zgk {
    border-top: 3px solid var(--app-info);
}

.check-type-border-zkk {
    border-top: 3px solid var(--app-warning);
}

.check-type-border-osk {
    border-top: 3px solid var(--app-success);
}

.check-type-stripe-zgk {
    border-left: 4px solid var(--app-info) !important;
}

.check-type-stripe-zkk {
    border-left: 4px solid var(--app-warning) !important;
}

.check-type-stripe-osk {
    border-left: 4px solid var(--app-success) !important;
}

/* ===============================================
   THEME SELECTOR STYLES
   =============================================== */

.theme-selector-menu .mud-icon-button {
    color: var(--app-text-secondary);
}

.theme-selector-menu .mud-icon-button:hover {
    background-color: rgba(var(--mud-palette-primary-rgb), 0.1);
}

/* ===============================================
   THEME PICKER (Runtime Theme Switcher)
   =============================================== */

.theme-picker-swatch {
    display: inline-block;
    width: 18px;
    height: 18px;
    border-radius: var(--app-radius-sm);
    flex-shrink: 0;
}

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

.d-none {
    display: none !important;
}

.d-block {
    display: block !important;
}

@media (min-width: 600px) {
    .d-sm-none {
        display: none !important;
    }
    .d-sm-block {
        display: block !important;
    }
}

@media (min-width: 960px) {
    .d-md-none {
        display: none !important;
    }
    .d-md-block {
        display: block !important;
    }
}

/* ===============================================
   FORM VALIDATION STYLES
   =============================================== */

.valid.modified:not([type=checkbox]) {
    outline: 1px solid var(--app-success);
}

.invalid {
    outline: 1px solid var(--app-error);
}

.validation-message {
    color: var(--app-error);
}

/* ===============================================
   BLAZOR ERROR UI
   =============================================== */

#blazor-error-ui {
    background: #FED7D7;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
    border-radius: var(--app-radius-sm) var(--app-radius-sm) 0 0;
}

#blazor-error-ui .dismiss {
    cursor: pointer;
    position: absolute;
    right: 0.75rem;
    top: 0.5rem;
}

/* ===============================================
   TRANSITIONS
   =============================================== */

.mud-drawer {
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
}


/* ===============================================
   MOBILE OPTIMIZATIONS
   =============================================== */

@media (max-width: 599px) {
    .mud-nav-link {
        min-height: 48px;
    }

    .mud-button {
        min-height: 44px;
    }

    .stat-card-content {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .stat-card-change {
        justify-content: center;
    }

    .donut-legend {
        grid-template-columns: 1fr;
    }

    .chart-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .stat-card-value {
        font-size: 1.5rem;
    }

    /* Notification bell - fullwidth dropdown on mobile */
    .notification-menu {
        min-width: 100vw;
        max-width: 100vw;
        border-radius: 0;
    }

    /* Notification list - hide category column on mobile */
    .notification-category-col {
        display: none !important;
    }

    /* Notification settings - stack switches vertically */
    .notification-settings-row {
        flex-direction: column;
        align-items: flex-start !important;
        gap: 4px;
    }
}

/* ===============================================
   HOVER ANIMATIONS
   =============================================== */

.hover-lift {
    transition: var(--app-transition);
}

.hover-lift:hover {
    transform: translateY(-4px);
    box-shadow: var(--app-shadow-lg);
}

/* ===============================================
   SKELETON LOADERS
   =============================================== */

.mud-skeleton {
    border-radius: var(--app-radius-sm);
}

/* ===============================================
   RICH TEXT EDITOR (Quill.js)
   =============================================== */

.rich-text-editor-wrapper {
    margin-bottom: 4px;
}

.rich-text-editor-label {
    color: var(--app-text-secondary);
    font-weight: 500;
}

.rich-text-editor-container {
    min-height: 300px;
}

/* Quill toolbar - match MudBlazor Outlined style */
.rich-text-editor-wrapper .ql-toolbar.ql-snow {
    border: 1px solid var(--app-border-default);
    border-radius: var(--app-radius-sm) var(--app-radius-sm) 0 0;
    background: var(--app-bg-surface);
    font-family: inherit;
}

.rich-text-editor-wrapper .ql-container.ql-snow {
    border: 1px solid var(--app-border-default);
    border-top: none;
    border-radius: 0 0 var(--app-radius-sm) var(--app-radius-sm);
    font-family: inherit;
    font-size: 0.875rem;
    min-height: 300px;
    background: var(--app-bg-surface);
}

.rich-text-editor-wrapper .ql-editor {
    min-height: 280px;
    color: var(--app-text-primary);
    line-height: 1.6;
}

.rich-text-editor-wrapper .ql-editor.ql-blank::before {
    color: var(--app-text-muted);
    font-style: normal;
}

/* Focus state */
.rich-text-editor-wrapper .ql-container.ql-snow:focus-within {
    border-color: var(--app-primary);
}

.rich-text-editor-wrapper .ql-toolbar.ql-snow:has(+ .ql-container:focus-within) {
    border-color: var(--app-primary);
}

/* Toolbar button hover */
.rich-text-editor-wrapper .ql-snow .ql-stroke {
    stroke: var(--app-text-secondary);
}

.rich-text-editor-wrapper .ql-snow .ql-fill {
    fill: var(--app-text-secondary);
}

.rich-text-editor-wrapper .ql-snow button:hover .ql-stroke,
.rich-text-editor-wrapper .ql-snow button.ql-active .ql-stroke {
    stroke: var(--app-primary);
}

.rich-text-editor-wrapper .ql-snow button:hover .ql-fill,
.rich-text-editor-wrapper .ql-snow button.ql-active .ql-fill {
    fill: var(--app-primary);
}

.rich-text-editor-wrapper .ql-snow .ql-picker-label:hover,
.rich-text-editor-wrapper .ql-snow .ql-picker-label.ql-active {
    color: var(--app-primary);
}

.rich-text-editor-wrapper .ql-snow .ql-picker-label:hover .ql-stroke,
.rich-text-editor-wrapper .ql-snow .ql-picker-label.ql-active .ql-stroke {
    stroke: var(--app-primary);
}

/* Dark mode support */
.mud-theme-dark .rich-text-editor-wrapper .ql-toolbar.ql-snow,
.mud-theme-dark .rich-text-editor-wrapper .ql-container.ql-snow {
    border-color: rgba(255, 255, 255, 0.23);
    background: var(--mud-palette-surface);
}

.mud-theme-dark .rich-text-editor-wrapper .ql-editor {
    color: var(--mud-palette-text-primary);
}

.mud-theme-dark .rich-text-editor-wrapper .ql-snow .ql-stroke {
    stroke: var(--mud-palette-text-secondary);
}

.mud-theme-dark .rich-text-editor-wrapper .ql-snow .ql-fill {
    fill: var(--mud-palette-text-secondary);
}

.mud-theme-dark .rich-text-editor-wrapper .ql-snow .ql-picker-label {
    color: var(--mud-palette-text-secondary);
}

.mud-theme-dark .rich-text-editor-wrapper .ql-snow .ql-picker-options {
    background: var(--mud-palette-surface);
    border-color: rgba(255, 255, 255, 0.23);
}

.mud-theme-dark .rich-text-editor-wrapper .ql-editor.ql-blank::before {
    color: var(--mud-palette-text-disabled);
}

/* StatCard icon color variants */
.stat-card-icon.icon-teal { background: var(--app-primary); }
.stat-card-icon.icon-green { background: var(--app-success); }
.stat-card-icon.icon-orange { background: var(--app-warning); }
.stat-card-icon.icon-red { background: var(--app-error); }
.stat-card-icon.icon-purple { background: var(--app-secondary); }
.stat-card-icon.icon-blue { background: var(--app-info); }

/* ===============================================
   DIFF STYLES (ValueDiff component)
   =============================================== */

.diff-removed { background: color-mix(in srgb, var(--app-error) 10%, transparent); }
.diff-added { background: color-mix(in srgb, var(--app-success) 10%, transparent); }

.audit-html-preview {
    font-size: 13px;
    line-height: 1.5;
    max-height: 200px;
    overflow-y: auto;
    padding: 8px;
    border: 1px solid var(--app-border-light);
    border-radius: var(--app-radius-sm);
    background: var(--app-bg-surface);
}

.audit-html-preview p { margin: 0 0 4px 0; }
.audit-html-preview p:last-child { margin-bottom: 0; }
.audit-html-preview ul, .audit-html-preview ol { padding-left: 20px; margin: 4px 0; }
.audit-html-preview strong { font-weight: 600; }

/* Audit table — mobile card separation */
@media (max-width: 959.95px) {
    .audit-table .mud-table-body td {
        border-bottom: none !important;
    }
    .audit-table .mud-table-body td:first-child {
        margin-top: 12px;
        padding-top: 12px;
    }
    .audit-table .mud-table-body tr:first-child td:first-child {
        margin-top: 0;
        padding-top: 0;
    }
}

/* ===============================================
   FILTER PANEL — consistent vertical alignment
   =============================================== */

.filter-panel .mud-input-control {
    margin-bottom: 0 !important;
}

.filter-panel .mud-input.mud-input-outlined {
    margin-top: 0 !important;
}

/* ===============================================
   DASHBOARD KPI — ApexCharts responsive
   =============================================== */

.kpi-chart-wrapper {
    width: 100%;
    min-width: 0;
    overflow: hidden;
}

.kpi-chart-wrapper .apexcharts-canvas {
    margin: 0 auto !important;
}

.kpi-chart-clickable {
    cursor: pointer;
}

/* ===============================================
   APPBAR POPOVER — CSS-positioned dropdown menus
   Replaces MudMenu (JS-positioned via MudPopoverProvider)
   with MudPopover Fixed="false" for instant CSS positioning.
   =============================================== */

.appbar-popover-anchor {
    position: relative;
    display: inline-flex;
}

/* ===============================================
   AUTH PAGE STYLES
   Shared styles for Login, Register, VerifyEmail, ResetPassword.
   =============================================== */

.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--app-bg-page);
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    padding: 2rem 1rem;
}

.login-card {
    width: 100%;
    max-width: 520px;
    border-radius: var(--app-radius-md);
    border-top: 3px solid var(--app-secondary);
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

[data-theme="dark"] .login-card,
.mud-theme-dark .login-card {
    background: rgba(30, 42, 58, 0.9);
}

.login-divider {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.login-divider .mud-divider {
    flex: 1;
}

.login-divider-text {
    color: var(--mud-palette-text-secondary);
    white-space: nowrap;
}

.login-btn {
    text-transform: none;
    font-weight: 600;
    letter-spacing: 0.02em;
}

.login-text-muted {
    color: #3c3c3c;
}

[data-theme="dark"] .login-text-muted,
.mud-theme-dark .login-text-muted {
    color: #b0b0b0;
}

.login-info-panels {
    margin-left: 0;
    margin-right: 0;
}

.login-info-panels .mud-expand-panel {
    background: transparent !important;
    box-shadow: none !important;
    margin: 0 !important;
}

.login-info-panels .mud-expand-panel::before {
    display: none;
}

.login-info-panels .mud-expand-panel-header {
    padding-left: 0 !important;
    padding-right: 0 !important;
}

.login-info-panels .mud-expand-panel-content {
    padding-left: 0 !important;
    padding-right: 0 !important;
    text-align: justify;
}

/* Dual (top) horizontal scrollbar for wide tables */
.dual-scroll-top-area {
    margin-bottom: 4px;
}

.dual-scroll-top {
    overflow-x: auto;
    overflow-y: hidden;
}

.dual-scroll-top > div {
    height: 1px;
}
