/* ── Data Import Tool ── */
.drop-zone {
    border: 2px dashed #dee2e6;
    border-radius: 8px;
    padding: 15px;
    text-align: center;
    transition: all 0.3s ease;
    background: #f8f9fa;
    cursor: pointer;
}

    .drop-zone:hover {
        border-color: var(--rz-primary);
        background: #f0f7ff;
    }

    .drop-zone.dragging {
        border-color: var(--rz-primary);
        background: #e3f2fd;
        border-width: 3px;
        transform: scale(1.01);
    }

.drop-zone-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.drop-zone-content-selected {
    padding: 12px;
}

/* Data Import mapping table */
.di-header-container {
    overflow-x: auto;
    overflow-y: hidden;
    padding-right: 17px;
}

    .di-header-container::-webkit-scrollbar {
        height: 0;
    }

.di-header-container {
    scrollbar-width: none;
}

.di-table-wrapper {
    border: 1px solid #dee2e6;
    margin-top: 0.5rem;
}

.di-view-manage-tab {
    display: flex;
    flex-direction: column;
}

.di-view-manage-toolbar {
    margin-bottom: 0.75rem;
}

.di-list-scroll {
    max-height: calc(100vh - 260px);
    overflow: auto;
    border: 1px solid #e9ecef;
    border-radius: 4px;
}

    .di-list-scroll .di-list-grid,
    .di-list-scroll .di-list-grid > *,
    .di-list-scroll .di-list-grid .rz-data-grid-data,
    .di-list-scroll .di-list-grid .rz-datatable-data,
    .di-list-scroll .di-list-grid .rz-grid-table-container,
    .di-list-scroll .di-list-grid .rz-datatable-scrollable-wrapper,
    .di-list-scroll .di-list-grid .rz-datatable-scrollable-body,
    .di-list-scroll .di-list-grid .rz-datatable-scrollable-header {
        overflow: visible !important;
    }

    .di-list-scroll table {
        border-collapse: separate !important;
        border-spacing: 0 !important;
    }

    .di-list-scroll thead tr th,
    .di-list-scroll .rz-datatable-thead tr th {
        position: sticky !important;
        top: 0 !important;
        z-index: 5 !important;
        background-color: #f8f9fa !important;
        box-shadow: inset 0 -1px 0 #dee2e6;
    }

.di-table {
    table-layout: fixed;
    margin: 0;
    border-collapse: collapse;
    border-spacing: 0;
}

    .di-table col {
        width: 180px;
    }

    .di-table th {
        width: 180px;
        padding: 6px;
        border: 1px solid #dee2e6;
        border-bottom: none;
        background-color: #f8f9fa;
        vertical-align: top;
        font-size: 12px;
    }

    .di-table td {
        width: 180px;
        padding: 4px 6px;
        border: 1px solid #dee2e6;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        font-size: 12px;
    }

        .di-table td.di-empty-cell {
            padding: 0;
            height: 1px;
        }

        .di-table td.di-placeholder-cell {
            padding: 30px 20px;
            text-align: center;
            color: #6c757d;
            border-top: none;
        }

        .di-table td.di-no-data-cell {
            padding: 20px;
            text-align: center;
            color: #999;
        }

.di-body-container {
    max-height: 175px;
    overflow-y: auto;
    overflow-x: auto;
    margin: 0;
    padding: 0;
    margin-top: -1px;
}

.di-field-label {
    margin-top: 4px;
    text-align: center;
    font-size: 11px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
}

.di-field-label-only {
    text-align: center;
    font-size: 11px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
}

.di-required-marker {
    color: var(--rz-danger);
}

.di-placeholder-text {
    color: #999;
}

.di-preview-note {
    color: #666;
    font-style: italic;
}

.di-placeholder-icon {
    font-size: 32px;
    color: #adb5bd;
}

.di-placeholder-message {
    margin-top: 8px;
    font-size: 13px;
}

/* Data Import Logs */
.di-card-spacing {
    margin-bottom: 1rem;
}

.di-user-email {
    font-size: 0.85em;
    color: #666;
}

/* Tooltip content */
.di-tooltip-content {
    min-width: 300px;
    padding: 10px;
    word-wrap: break-word;
    white-space: normal;
}

    .di-tooltip-content p {
        margin: 0;
        color: black;
        line-height: 1.5;
        font-size: 14px;
    }

/* ===== Redesign: pill tabs, toolbar, grid cells ===== */
.di-tabsrow {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 14px 16px;
    border-bottom: 1px solid #EDEFF2;
    flex-wrap: wrap;
}

.di-pilltabs {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: #F3F4F6;
    border: 1px solid #E7E8EA;
    border-radius: 8px;
    padding: 3px;
}

.di-pilltab {
    appearance: none;
    border: none;
    background: transparent;
    color: #5E6470;
    font-size: 13px;
    font-weight: 600;
    padding: 7px 16px;
    border-radius: 6px;
    cursor: pointer;
    white-space: nowrap;
    transition: background .15s, color .15s;
}

    .di-pilltab:hover {
        color: #111827;
    }

    .di-pilltab.is-active {
        background: #008D9E;
        color: #fff;
        box-shadow: 0 1px 2px rgba(0,0,0,.08);
    }

.di-search {
    width: 320px;
    max-width: 100%;
}

/* Serial number pill */
.di-serial {
    display: inline-block;
    background: #EEF2F6;
    color: #334155;
    border-radius: 6px;
    padding: 3px 10px;
    font-size: 12.5px;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

/* Status badge */
.di-status {
    display: inline-block;
    padding: 3px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}

    .di-status.is-active {
        background: #EDFDF3;
        color: #097732;
    }

    .di-status.is-expired {
        background: #FEECEC;
        color: #DC2626;
    }

    .di-status.is-revoked {
        background: #FEECEC;
        color: #B42318;
    }

    .di-status.is-info {
        background: #EFF6FF;
        color: #1D4ED8;
    }

    .di-status.is-warning {
        background: #FEF6E7;
        color: #B54708;
    }

/* Match progress bar */
.di-match {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 90px;
}

.di-match-val {
    font-size: 12px;
    font-weight: 600;
    color: #111827;
}

.di-match-track {
    height: 6px;
    border-radius: 999px;
    background: #EDEFF2;
    overflow: hidden;
}

.di-match-fill {
    height: 100%;
    border-radius: 999px;
}

    .di-match-fill.is-high {
        background: #099E32;
    }

    .di-match-fill.is-mid {
        background: #008D9E;
    }

    .di-match-fill.is-low {
        background: #DC2626;
    }

    .di-match-fill.is-none {
        background: #D1D5DB;
    }

/* Detail chevron */
.di-detail-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border: none;
    background: transparent;
    color: #9AA3AF;
    cursor: pointer;
    border-radius: 6px;
}

    .di-detail-btn:hover {
        background: #F3F4F6;
        color: #008D9E;
    }

/* Detail dialog */
.di-detail-dialog {
    display: flex;
    flex-direction: column;
}

.di-detail-row {
    display: flex;
    gap: 12px;
    padding: 9px 2px;
    border-bottom: 1px solid #F1F3F5;
    font-size: 13px;
}

.di-detail-key {
    flex: 0 0 140px;
    color: #6B7280;
    font-weight: 500;
}

.di-detail-val {
    flex: 1 1 auto;
    color: #111827;
    word-break: break-all;
}

.di-detail-actions {
    display: flex;
    justify-content: flex-end;
    padding-top: 14px;
}

.di-import-tab {
    padding: 0;
}

/* Import tab: header row (title + records text + Import button) — aligned like the toolbar */
.di-import-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 14px 16px;
    border-bottom: 1px solid var(--cp-list-section-border, #E5E7EB);
    flex-wrap: wrap;
}

.di-import-head-title {
    font-size: 15px;
    font-weight: 700;
    color: #111827;
}

.di-import-head-actions {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
}

.di-import-records {
    font-size: 13px;
    color: #6B7280;
}

/* Import button (teal): recolor the grey upload SVG to white */
.di-import-btn.rz-button img {
    filter: brightness(0) invert(1);
}

/* Import tab body — same 16px inset as the header/toolbar so everything left/right aligns */
.di-import-body {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 16px;
}

/* Import tab: horizontal drop zone */
.di-dropzone {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 18px 20px;
    border: 1.5px dashed #D8DCE3;
    border-radius: 8px;
    background: #FCFCFD;
    flex-wrap: wrap;
}

    .di-dropzone.dragging {
        border-color: #008D9E;
        background: #F0FAFB;
    }

.di-dropzone-left {
    display: flex;
    align-items: center;
    gap: 12px;
    color: #6B7280;
    font-size: 13.5px;
}

.di-dropzone-icon {
    color: #9AA3AF;
    flex-shrink: 0;
}

.di-fileupload-btn {
    appearance: none;
    border: none;
    background: #FDECEC;
    color: #F04438;
    font-size: 13px;
    font-weight: 600;
    padding: 8px 18px;
    border-radius: 6px;
    cursor: pointer;
    white-space: nowrap;
}

    .di-fileupload-btn:hover:not(:disabled) {
        background: #FBDCDC;
    }

    .di-fileupload-btn:disabled {
        opacity: .6;
        cursor: default;
    }

/* Import tab: uploaded-file status row */
.di-filestatus {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 10px 14px;
    border: 1px solid #EDEFF2;
    border-radius: 8px;
    background: #FFFFFF;
    flex-wrap: wrap;
}

.di-filestatus-left {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    flex-wrap: wrap;
}

.di-filestatus-icon {
    color: #F04438;
    flex-shrink: 0;
}

.di-filestatus-name {
    font-size: 13px;
    font-weight: 500;
    color: #1F2937;
}

.di-filestatus-detail {
    font-size: 12.5px;
    color: #9AA3AF;
}

.di-filestatus-ok {
    font-size: 12.5px;
    color: #099E32;
    font-weight: 500;
}

.di-filestatus-remove {
    font-size: 13px;
    color: #F04438;
    font-weight: 500;
    text-decoration: none;
    white-space: nowrap;
}

    .di-filestatus-remove:hover {
        text-decoration: underline;
    }

/* File-status actions (Save / Clear Mapping / Remove) */
.di-filestatus-actions {
    display: flex;
    align-items: center;
    gap: 18px;
    flex-wrap: wrap;
}

.di-filestatus-action {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
    white-space: nowrap;
    cursor: pointer;
}

    .di-filestatus-action.is-save {
        color: #008D9E;
    }

    .di-filestatus-action.is-clear {
        color: #C43517;
    }

    .di-filestatus-action.is-remove {
        color: #C43517;
    }

    .di-filestatus-action:hover {
        text-decoration: underline;
    }

/* ===== Certificate Preview section ===== */
/* Certificate Preview is part 3: a bold title on the grey canvas + its own white
   card below it (the title lives OUTSIDE the card, like the mock-up). */
.di-preview-section {
    margin-top: 14px;
}

.cp-di-preview-panel {
    margin-top: 0;
}

.di-preview {
    padding: 16px;
}

.di-preview-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    /* On the canvas, above the card — indent 16px so the title lines up with the
       other card titles ("Data Import Tool", "Import Certificate Data"). */
    padding: 0 16px;
    margin-bottom: 12px;
}

.di-preview-title {
    font-size: 15px;
    font-weight: 700;
    color: #111827;
}

.di-preview-count {
    font-size: 12.5px;
    color: #9AA3AF;
}

.di-preview-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 20px;
    padding: 72px 16px;
}

.di-preview-empty-text {
    font-size: 20px;
    font-weight: 400;
    color: #7B87C4;
}

.di-preview-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 12px;
    font-size: 13px;
    color: #6B7280;
}

/* Preview grid — mapping dropdown + field label per column header */
.di-col-head {
    display: flex;
    flex-direction: column;
    gap: 0; /* spacing handled by the row paddings + the label band below */
    padding: 8px 0 0; /* space above the dropdown; the label band fills the rest to the bottom */
    width: 100%;
}

.di-col-select {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 0 4px 10px; /* inset the dropdown (cell padding is now 0); space before the band */
}

.di-col-dropdown {
    flex: 1 1 auto;
    min-width: 0;
}

/* Borderless "Select Columns" dropdown — reads like a label, not a boxed input */
.di-col-dropdown,
.di-col-dropdown.rz-dropdown {
    border: none !important;
    background: transparent !important;
    box-shadow: none !important;
    min-height: auto !important;
}

    .di-col-dropdown .rz-dropdown-label,
    .di-col-dropdown .rz-placeholder,
    .di-col-dropdown .rz-inputtext {
        color: #2B3674 !important;
        font-weight: 600 !important;
        font-size: 14px !important;
        /* reserve room on the right so the text truncates instead of running under the chevron */
        padding: 0 22px 0 0 !important;
        opacity: 1 !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        white-space: nowrap !important;
    }

    /* Chevron: same grey + size as the custom × */
    .di-col-dropdown .rz-dropdown-trigger {
        color: #8A94A6 !important;
        background: transparent !important;
        width: 18px !important;
        padding: 0 !important;
    }

        .di-col-dropdown .rz-dropdown-trigger .rzi,
        .di-col-dropdown .rz-dropdown-trigger i,
        .di-col-dropdown .rz-dropdown-trigger .notranslate {
            color: #8A94A6 !important;
            font-size: 16px !important;
        }

.di-col-x {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border: none;
    background: transparent;
    color: #8A94A6;
    cursor: pointer;
    padding: 0;
    flex-shrink: 0;
}

    .di-col-x svg {
        width: 15px;
        height: 15px;
    }

    .di-col-x:hover {
        color: #F04438;
    }

/* Open popup for the "Select Columns" mapping dropdown */
.di-col-dropdown .rz-dropdown-panel {
    border-radius: 8px !important;
    border: 1px solid #EDEFF2 !important;
    box-shadow: 0 8px 20px rgba(16, 24, 40, 0.12) !important;
    overflow: hidden;
    padding: 4px !important;
}

.di-col-dropdown .rz-dropdown-items {
    padding: 0 !important;
}

.di-col-dropdown .rz-dropdown-item {
    padding: 9px 14px !important;
    font-size: 14px !important;
    color: #2B3674 !important;
    border-radius: 6px !important;
    text-transform: none !important;
    letter-spacing: normal !important;
}

    .di-col-dropdown .rz-dropdown-item:hover,
    .di-col-dropdown .rz-dropdown-item.rz-state-hover {
        background: #F1F5F9 !important;
        color: #2B3674 !important;
    }

    .di-col-dropdown .rz-dropdown-item.rz-state-highlight {
        background: #E6F6F8 !important;
        color: #008D9E !important;
        font-weight: 600 !important;
    }

/* Field-label row: a full-width grey band under the mapping dropdown
   (Figma: table/th/text — #FAFAFB band, 50px tall, hairline top + inset bottom). */
.di-col-label {
    box-sizing: border-box;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 4px;
    align-self: stretch; /* fills the full header-cell width */
    margin: 0 -1px; /* 1px bleed each side, clipped by the cell — covers sub-pixel rounding gaps */
    padding: 16px;
    min-height: 50px;
    background: #FAFAFB;
    border-top: 1px solid #E7E8EA;
    box-shadow: inset 0 -1px 0 #EDF2F7;
    font-size: 13px;
    font-weight: 500;
    color: #A3AED0;
}

/* Let the two-line header (dropdown + label) size to its content */
.di-preview-grid .rz-column-title,
.di-preview-grid .rz-column-title-content {
    width: 100%;
    padding: 0 !important; /* no wrapper padding, so the band reaches the cell edges */
    margin: 0 !important;
    white-space: normal;
    overflow: visible;
}

.di-preview-grid .di-status {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    width: fit-content;
    max-width: 100%;
    padding: 2px 8px;
    border-radius: 4px;
    mix-blend-mode: multiply;
    font-family: 'Open Sans', sans-serif;
    font-style: normal;
    font-weight: 400;
    font-size: 10px;
    line-height: 14px;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

    .di-preview-grid .di-status.is-expired { background: #FCDDD6; color: #B82F2F; }
    .di-preview-grid .di-status.is-revoked { background: #FCDDD6; color: #B82F2F; }
    .di-preview-grid .di-status.is-active { background: #D6F5E0; color: #09753A; }
    .di-preview-grid .di-status.is-neutral { background: #EFF1F4; color: #5E6470; }

/* Neutral status pill for raw CSV status values in the preview */
.di-status.is-neutral {
    background: #F1F3F5;
    color: #4B5563;
}

/* ===== Delete confirmation modal ===== */
.di-modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 3000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    background: rgba(16, 24, 40, 0.35);
}

.di-modal {
    position: relative;
    display: flex;
    flex-direction: column;
    width: 400px;
    max-width: 100%;
    padding: 24px;
    background: #FFFFFF;
    border-radius: 12px;
    box-shadow: 0 20px 24px -4px rgba(16, 24, 40, 0.08), 0 8px 8px -4px rgba(16, 24, 40, 0.03);
}

.di-modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: none;
    background: transparent;
    border-radius: 8px;
    cursor: pointer;
}

    .di-modal-close:hover {
        background: #F3F4F6;
    }

.di-modal-content {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 20px;
}

.di-modal-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    box-sizing: border-box;
    background: #FAC4B8;
    border: 8px solid #FCDDD6;
    border-radius: 28px;
}

.di-modal-texts {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
}

.di-modal-title {
    font-size: 18px;
    font-weight: 500;
    line-height: 26px;
    color: #242A41;
}

.di-modal-sub {
    font-size: 14px;
    font-weight: 400;
    line-height: 20px;
    color: #91949D;
}

.di-modal-actions {
    display: flex;
    flex-direction: row;
    gap: 12px;
    width: 100%;
}

.di-modal-btn {
    flex: 1 1 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 36px;
    border-radius: 4px;
    cursor: pointer;
    white-space: nowrap;
}

.di-modal-cancel {
    background: #FFFFFF;
    border: 1px solid #B5B7BD;
    color: #0F172A;
    font-size: 12px;
    font-weight: 700;
    padding: 8px 24px;
}

    .di-modal-cancel:hover {
        background: #F9FAFB;
    }

.di-modal-delete {
    background: #EE4723;
    border: none;
    color: #FFFFFF;
    font-size: 14px;
    /*font-weight: 600;*/
    padding: 8px 32px;
}

    .di-modal-delete:hover {
        background: #D63C1C;
    }

/* Preview grid: undo Radzen's uppercase/letter-spacing on column titles so the header
   reads exactly as authored ("Select Columns", "Serial Number"), not "SERIAL NUMBER". */
.di-preview-grid .rz-column-title,
.di-preview-grid .rz-column-title-content,
.di-preview-grid .rz-column-title * {
    text-transform: none !important;
    letter-spacing: normal !important;
    font-weight: inherit;
}

/* Selected column name in the dropdown truncates rather than pushing out the × */
.di-preview-grid .di-col-dropdown .rz-dropdown-label {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Subtle grey scrollbars inside the preview grid — the theme was rendering a bold teal bar */
.di-preview-grid ::-webkit-scrollbar {
    height: 8px;
    width: 8px;
}

.di-preview-grid ::-webkit-scrollbar-thumb {
    background: #D1D5DB !important;
    border-radius: 4px;
}

.di-preview-grid ::-webkit-scrollbar-track {
    background: transparent !important;
}

/* Preview grid rules: the app-wide theme paints grid header cells with a solid
   BLACK top+bottom border. In this card we want soft light-grey lines instead —
   one between the column header and the data, one below the grid, and none on top. */
.di-preview-grid .rz-grid-table thead th,
.di-preview-grid .rz-datatable-thead th {
    border-top: none !important;
    border-bottom: none !important;
    /* Remove ALL cell padding so each column's grey band meets its neighbour
       edge-to-edge (no white gap between headers). The row paddings below handle
       the text inset, and the band's top-border + inset shadow are the divider lines. */
    padding: 0 !important;
    vertical-align: top;
    overflow: hidden; /* clip the band flush to the cell edge (insurance against sub-pixel gaps) */
}

/* Header cells must sit flush (no cell spacing) AND the Radzen title wrappers must be
   full-width blocks — otherwise the grey band stops short of the cell edge and a white
   sliver shows between columns. This is what removes the gap between headers. */
.di-preview-grid .rz-grid-table,
.di-preview-grid .rz-datatable-data table,
.di-preview-grid table {
    border-collapse: separate !important;
    border-spacing: 0 !important;
}

.di-preview-grid thead th .rz-column-title,
.di-preview-grid thead th .rz-column-title-content {
    display: block !important;
    width: 100% !important;
    padding: 0 !important;
    margin: 0 !important;
}

/* THE fix: Radzen wraps the HeaderTemplate in a plain `th > div` and puts the header
   cell padding (var(--rz-grid-header-cell-padding) = 2px 4px) on THAT div. Its 4px side
   padding is what holds the grey band off the cell edges and leaves the white gap.
   Zero it so di-col-head — and therefore the band — reaches the full cell width. */
.di-preview-grid .rz-grid-table thead th > div:not(.rz-cell-filter),
.di-preview-grid .rz-datatable-thead th > div:not(.rz-cell-filter) {
    padding: 0 !important;
    width: 100% !important;
}

.di-preview-grid .rz-data-row td,
.di-preview-grid .rz-datatable-data td,
.di-preview-grid .rz-grid-table td {
    border-color: #EDEFF2 !important;
}

.di-preview-grid .rz-datatable-data tr:last-child > td,
.di-preview-grid .rz-grid-table tr:last-child > td {
    border-bottom: 1px solid #EDEFF2 !important;
}

/* Inline detail (accordion) row */
.di-detailrow {
    display: flex;
    flex-wrap: wrap;
    gap: 40px;
    padding: 14px 20px 16px;
    background: #F7F8FA;
}

.di-detailrow-item {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 120px;
}

.di-detailrow-key {
    font-size: 12px;
    color: #8A94A6;
}

.di-detailrow-val {
    font-size: 13px;
    color: #1F2937;
    font-weight: 500;
    word-break: break-word;
}

/* Delete button turns red once at least one row is selected */
.di-delete-active.rz-button {
    background: #FF5252 !important;
    border: 1px solid #FF5252 !important;
    color: #FFFFFF !important;
    border-radius: 4px !important;
}

    .di-delete-active.rz-button:hover {
        background: #F53E3E !important;
        border-color: #F53E3E !important;
    }

    .di-delete-active.rz-button .rz-button-text,
    .di-delete-active.rz-button span {
        color: #FFFFFF !important;
    }

    /* Recolor the grey trash SVG to white on the red button */
    .di-delete-active.rz-button img {
        filter: brightness(0) invert(1);
    }

/* Detail chevron rotates down when its row is open */
.di-detail-btn svg {
    transition: transform .15s ease;
}

.di-detail-btn.is-open {
    color: #008D9E;
}

    .di-detail-btn.is-open svg {
        transform: rotate(90deg);
    }

/* Detail column: eye (opens the side drawer) + chevron (expands the inline accordion) */
.di-detail-actions {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.di-eye-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    padding: 0;
    border: none;
    background: transparent;
    color: #8A94A6;
    border-radius: 6px;
    cursor: pointer;
}

    .di-eye-btn:hover {
        color: #008D9E;
        background: #F0FDFA;
    }

/* ===== Certificate Details side drawer ===== */
.di-drawer-overlay {
    position: fixed;
    top: 56px;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.35);
    z-index: 20000;
    animation: di-drawer-fade 0.15s ease-out;
}

.di-drawer {
    position: fixed;
    top: 56px;
    right: 0;
    bottom: 0;
    width: min(440px, 100vw);
    background: #FFFFFF;
    z-index: 20001;
    display: flex;
    flex-direction: column;
    box-shadow: -8px 0 24px rgba(15, 23, 42, 0.12);
    animation: di-drawer-slide 0.2s ease-out;
}

@keyframes di-drawer-slide {
    from { transform: translateX(100%); }
    to { transform: translateX(0); }
}

@keyframes di-drawer-fade {
    from { opacity: 0; }
    to { opacity: 1; }
}

.di-drawer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 16px 20px;
    border-bottom: 1px solid #E5E7EB;
    flex-shrink: 0;
}

.di-drawer-title {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.di-drawer-title-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: #F0FDFA;
    flex-shrink: 0;
}

.di-drawer-title-text {
    min-width: 0;
}

.di-drawer-title-main {
    font-size: 15px;
    font-weight: 700;
    color: #111827;
}

.di-drawer-title-sub {
    font-size: 12px;
    color: #8A94A6;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.di-drawer-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    border-radius: 8px;
    cursor: pointer;
    flex-shrink: 0;
}

    .di-drawer-close:hover {
        background: #F3F4F6;
    }

.di-drawer-body {
    flex: 1 1 auto;
    overflow-y: auto;
    padding: 16px 20px 20px;
}

.di-drawer-overview {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding-bottom: 8px;
    margin-bottom: 4px;
}

.di-drawer-overview-title {
    font-size: 15px;
    font-weight: 700;
    color: #111827;
}

.di-drawer-list {
    display: flex;
    flex-direction: column;
}

.di-drawer-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 12px 0;
    border-bottom: 1px solid #F0F2F5;
}

    .di-drawer-row:last-child {
        border-bottom: none;
    }

.di-drawer-key {
    font-size: 13px;
    color: #8A94A6;
    flex-shrink: 0;
}

.di-drawer-val {
    font-size: 13px;
    font-weight: 500;
    color: #1F2937;
    text-align: right;
    word-break: break-word;
    min-width: 0;
}

.di-drawer-footer {
    flex-shrink: 0;
    display: flex;
    justify-content: center;
    padding: 14px 20px;
    border-top: 1px solid #E5E7EB;
}

.di-drawer-cancel {
    min-width: 96px;
    height: 36px;
    padding: 0 20px;
    border: 1px solid #D0D5DD;
    background: #FFFFFF;
    color: #344054;
    font-size: 13px;
    font-weight: 600;
    border-radius: 6px;
    cursor: pointer;
}

    .di-drawer-cancel:hover {
        background: #F9FAFB;
    }

/* ===== "New Matches" popup (opened from Find Match) ===== */
.di-matches-overlay {
    position: fixed;
    inset: 0;
    z-index: 15000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(16, 24, 40, 0.35);
}

.di-matches-modal {
    position: relative;
    display: flex;
    flex-direction: column;
    width: min(1240px, 95vw);
    max-height: 90vh;
    background: #FFFFFF;
    border-radius: 12px;
    box-shadow: 0px 20px 24px -4px rgba(16, 24, 40, 0.08), 0px 8px 8px -4px rgba(16, 24, 40, 0.03);
    overflow: hidden;
}

.di-matches-close {
    position: absolute;
    top: 20px;
    right: 20px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border: none;
    background: transparent;
    border-radius: 6px;
    cursor: pointer;
}

    .di-matches-close:hover {
        background: #F3F4F6;
    }

/* Header: featured icon stacked above the title + subtitle (Figma layout) */
.di-matches-head {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
    padding: 24px 24px 4px;
    flex-shrink: 0;
}

.di-matches-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    width: 48px;
    height: 48px;
    background: #DEF3FD;
    border: 8px solid #ECF8FE;
    border-radius: 28px;
    flex-shrink: 0;
}

.di-matches-title {
    font-size: 18px;
    font-weight: 600;
    line-height: 26px;
    color: #242A41;
}

.di-matches-sub {
    font-size: 14px;
    font-weight: 400;
    line-height: 20px;
    color: #91949D;
    margin-top: 4px;
}

.di-matches-body {
    flex: 1 1 auto;
    overflow: auto;
    padding: 8px 24px;
    min-height: 0;
}

/* Empty state ("No new matches found.") — narrower modal + grey illustration panel (Figma) */
.di-matches-modal--empty {
    width: min(598px, 95vw);
}

.di-matches-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 24px;
    min-height: 300px;
    padding: 48px 16px;
    background: #FAFAFB;
    border-top: 1px solid #E7E8EA;
    box-shadow: inset 0 -1px 0 #EDF2F7;
    border-radius: 4px;
}

.di-matches-empty-text {
    font-family: 'Inter', 'Open Sans', sans-serif;
    font-size: 16px;
    font-weight: 500;
    line-height: 24px;
    color: #7A8699;
    text-align: center;
}

/* Table styling per Figma: light grey header band (no black borders), soft row rules */
.di-matches-grid .rz-grid-table thead th,
.di-matches-grid .rz-datatable-thead th {
    background: #FAFAFB !important;
    border-top: 1px solid #E7E8EA !important;
    border-bottom: none !important;
    box-shadow: inset 0 -1px 0 #EDF2F7;
    padding: 8px 16px !important;
    height: 50px;
}

.di-matches-grid .rz-grid-table thead th .rz-column-title,
.di-matches-grid .rz-grid-table thead th .rz-column-title-content,
.di-matches-grid .rz-column-title * {
    font-family: 'Inter', 'Open Sans', sans-serif;
    font-weight: 500;
    font-size: 12px;
    line-height: 18px;
    color: #8492A6;
    text-transform: none !important;
    letter-spacing: normal !important;
}

.di-matches-grid .rz-data-row td,
.di-matches-grid .rz-datatable-data td {
    height: 50px;
    padding: 8px 16px !important;
    border: none !important;
    box-shadow: inset 0 -1px 0 #EDF2F7;
    color: #5E6470;
    font-size: 12px;
    line-height: 18px;
}

    .di-matches-grid .rz-data-row td .rz-cell-data {
        color: #5E6470;
        font-size: 12px;
    }

.di-matches-foot {
    display: flex;
    justify-content: flex-end;
    padding: 14px 24px 20px;
    flex-shrink: 0;
}

.di-matches-cancel {
    min-width: 110px;
    height: 40px;
    padding: 0 24px;
    border: 1px solid #D0D5DD;
    background: #FFFFFF;
    color: #344054;
    font-size: 14px;
    font-weight: 600;
    border-radius: 6px;
    cursor: pointer;
}

    .di-matches-cancel:hover {
        background: #F9FAFB;
    }

/* Lineage level selector — which level of the estate the uploaded rows describe. */
.di-levelrow { display: flex; align-items: center; gap: 10px; margin-top: 12px; flex-wrap: wrap; }
.di-levellabel { font-size: 12.5px; color: #374151; font-weight: 600; }
.di-levelselect { padding: 6px 8px; font-size: 12.5px; border: 1px solid #D1D5DB; border-radius: 6px; min-width: 160px; }
.di-levelhint { font-size: 11.5px; color: #6B7280; }
