/* Import font Inter offline */
@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 100 900;
    font-display: swap;
    src: url('../../fonts/inter/InterVariable.woff2') format('woff2-variations'),
         url('../../fonts/inter/InterVariable.woff2') format('woff2');
}

@font-face {
    font-family: 'Inter';
    font-style: italic;
    font-weight: 100 900;
    font-display: swap;
    src: url('../../fonts/inter/InterVariable-Italic.woff2') format('woff2-variations'),
         url('../../fonts/inter/InterVariable-Italic.woff2') format('woff2');
}

:root {
    --font-sans-serif: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif !important;
    --body-font-family: var(--font-sans-serif) !important;
}

body {
    font-family: var(--body-font-family);
    font-size: 14px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}
b, strong {
    font-weight: 600;
}

#blazor-error-ui {
    background: lightyellow;
    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;
}

    #blazor-error-ui .dismiss {
        cursor: pointer;
        position: absolute;
        right: 0.75rem;
        top: 0.5rem;
    }

.nav-group-sub .nav-link {
    padding-left: calc(var(--nav-link-padding-x) * 1.1 + var(--icon-font-size)) !important;
}

.slogan {
    font-size: 18px;
    font-weight: 600;
    margin-left: 8px;
    color: floralwhite;
}

.card-body {
    padding: 10px !important;
}

.mobile-record-card {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 12px 14px;
/*    margin: 6px 0;*/
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.05);
    font-size: 13px;
    line-height: 1.5;
}

.mobile-record-media {
    display: flex;
    align-items: flex-start;
}

    .mobile-record-media img {
        display: block;
    }

.mobile-record-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 8px;
}

.mobile-record-title {
    color: #0f172a;
    font-size: 15px;
    font-weight: 600;
    line-height: 1.45;
    white-space: normal;
}

.mobile-record-subtitle {
    color: #475569;
    font-size: 13px;
    line-height: 1.45;
    margin-top: 2px;
}

.mobile-record-meta {
    display: flex;
    flex-direction: column;
    gap: 4px;
    color: #334155;
    font-size: 13px;
    line-height: 1.5;
}

.mobile-record-line {
    display: block;
    word-break: break-word;
}

.mobile-record-line-label {
    color: #64748b;
    font-weight: 500;
}

.mobile-record-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 6px;
    padding-top: 2px;
}

.mobile-record-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    width: fit-content;
    padding: 3px 8px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.4;
}

.mobile-record-badge-danger {
    background: #fee2e2;
    color: #991b1b;
}

.mobile-record-badge-success {
    background: #e8f5e9;
    color: #166534;
}

.mobile-record-badge-warning {
    background: #fff7ed;
    color: #c2410c;
}

.mobile-record-badge-info {
    background: #e0edff;
    color: #1d4ed8;
}

.mobile-record-badge-muted {
    background: #f1f5f9;
    color: #475569;
}

.mobile-profile-shell {
    display: flex;
    gap: 16px;
}

.mobile-profile-sidebar {
    min-width: 280px;
}

/* Shared styles for attachment file uploaders */
.attachment-file-uploader .e-upload {
    border: none;
    min-height: 38px;
    overflow: visible;
}

.attachment-file-uploader.e-upload {
    border: none;
    min-height: 38px;
    overflow: visible;
}

.attachment-file-uploader .e-upload.e-control-wrapper.e-lib.e-keyboard {
    border: none;
}

.attachment-file-uploader .e-upload .e-file-select-wrap {
    display: flex;
    align-items: center;
    min-height: 38px;
}

.attachment-file-uploader.e-upload .e-file-select-wrap {
    display: flex;
    align-items: center;
    min-height: 38px;
}

.attachment-file-uploader .e-file-drop,
.attachment-file-uploader .e-upload-files {
    display: none;
}

.attachment-file-uploader.e-upload .e-file-drop,
.attachment-file-uploader.e-upload .e-upload-files {
    display: none;
}

.attachment-file-uploader {
    margin-bottom: 8px;
}

.attachment-file-uploader .e-upload {
    min-height: 38px;
    overflow: visible;
}

.attachment-file-uploader .e-file-select-wrap {
    display: flex;
    align-items: center;
    min-height: 38px;
}

.attachment-file-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.attachment-file-item {
    display: flex;
    align-items: flex-start;
    gap: 6px;
    min-width: 0;
    padding: 4px 8px;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    background-color: #f8f9fa;
}

.attachment-file-delete {
    flex: 0 0 auto;
    color: red;
    cursor: pointer;
    line-height: 1.5;
}

.attachment-file-name {
    min-width: 0;
    overflow-wrap: anywhere;
}

@media (max-width: 800px) {
    .e-treecell{
        display:block !important;
    }
    .e-grid.e-device .e-rowcell:first-child, .e-grid.e-device .e-summarycell:first-child {
        padding: 3px;
    }
    .e-grid.e-device .e-rowcell:last-child, .e-grid.e-device .e-summarycell:last-child {
        padding: 6px;
    }
    .e-grid.e-device .e-filterbarcell:last-child {
        padding: 6px;
    }
    .e-treecell
    {
        margin-top: -20px;
    }

    .mobile-record-card {
        padding: 5px;
        border-radius: 10px;
    }

    .mobile-record-actions {
        justify-content: flex-end;
    }

    .mobile-profile-shell {
        flex-direction: column;
    }

    .mobile-profile-sidebar {
        min-width: 100%;
        margin-right: 0 !important;
    }
}


/* Fix sidebar menu scrolling when there are many items */
@media (min-width: 992px) {
    .sidebar-expand-lg.sidebar-main {
        position: -webkit-sticky;
        position: sticky;
        top: 0;
        height: 100vh;
        max-height: 100vh;
    }
    
    /* Scrollbar behavior & auto-hide (prevent layout shift) */
    .sidebar-expand-lg.sidebar-main .sidebar-content {
        height: 100%;
        overflow-y: auto;
        overflow-y: overlay; /* Draw scrollbar on top of content in Webkit */
        scrollbar-width: thin; /* Firefox: Keep thin space allocated to prevent shifting */
        scrollbar-color: transparent transparent; /* Firefox: invisible by default */
    }
    .sidebar-expand-lg.sidebar-main:hover .sidebar-content {
        scrollbar-color: rgba(255, 255, 255, 0.25) transparent; /* Firefox: show on hover */
    }

    /* Webkit scrollbar styles (Chrome, Safari, Edge) */
    .sidebar-expand-lg.sidebar-main .sidebar-content::-webkit-scrollbar {
        width: 6px;
        height: 6px;
    }
    .sidebar-expand-lg.sidebar-main .sidebar-content::-webkit-scrollbar-track {
        background: transparent;
    }
    .sidebar-expand-lg.sidebar-main .sidebar-content::-webkit-scrollbar-thumb {
        background: transparent;
        border-radius: 3px;
    }
    /* Show scrollbar thumb on sidebar hover */
    .sidebar-expand-lg.sidebar-main:hover .sidebar-content::-webkit-scrollbar-thumb {
        background: rgba(255, 255, 255, 0.25);
    }
    .sidebar-expand-lg.sidebar-main:hover .sidebar-content::-webkit-scrollbar-thumb:hover {
        background: rgba(255, 255, 255, 0.45);
    }

    @media (prefers-reduced-motion: no-preference) {
        .sidebar-expand-lg.sidebar-main .sidebar-content {
            scroll-behavior: smooth;
        }
    }
}
