.er-view-header {
    background: #ffffff;
    border-bottom: 1px solid #e2e8f0;
    padding: 10px 16px;
    margin-top: -1rem;
    margin-left: -1.75rem;
    margin-right: -1.75rem;
}

@media (min-width: 1024px) {
    .er-view-header {
        padding: 12px 24px;
        margin-top: -2rem;
        margin-left: -2.75rem;
        margin-right: -2.75rem;
    }
}

.er-view-header .er-view-breadcrumb {
    color: #64748b;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.er-view-header .er-view-breadcrumb:hover {
    color: #3a7fb3;
}

.er-view-header .er-view-avatar {
    background-color: #3a7fb3 !important;
    width: 45px !important;
    height: 45px !important;
    font-size: 0.875rem !important;
}

.er-view-header .er-view-avatar .e-avatar {
    width: 100% !important;
    height: 100% !important;
    background-color: transparent !important;
    font-size: inherit !important;
}

.er-view-header .er-view-name {
    font-size: 20px !important;
    font-weight: 500 !important;
    color: #0f172a !important;
    margin: 0 !important;
}

.er-view-header .er-view-action-btn.e-btn {
    background: #ffffff !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: 7px !important;
    color: #0f172a !important;
    font-size: 11px !important;
    padding: 4px 10px !important;
    font-weight: 500 !important;
    box-shadow: none !important;
}

.er-view-header .er-view-action-btn.e-btn:hover {
    background: #f8fafc !important;
    border-color: #cbd5e1 !important;
}

.er-view-header .er-view-icon-btn.e-dropdown-btn {
    width: 32px;
    height: 32px;
    min-width: 32px;
    padding: 0 !important;
    background: #ffffff !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: 8px !important;
    color: #64748b !important;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: none !important;
    line-height: 1;
}

.er-view-header .er-view-icon-btn.e-dropdown-btn:hover,
.er-view-header .er-view-icon-btn.e-dropdown-btn:focus,
.er-view-header .er-view-icon-btn.e-dropdown-btn:active {
    background: #f8fafc !important;
    border-color: #cbd5e1 !important;
    color: #0f172a !important;
    box-shadow: none !important;
}

.er-view-header .er-view-icon-btn.e-dropdown-btn .e-btn-icon {
    margin: 0 !important;
    font-size: 13px;
    color: inherit;
}

.er-view-header .er-view-icon-btn.e-dropdown-btn .e-caret,
.er-view-header .er-view-icon-btn.e-dropdown-btn .e-icon-down,
.er-view-header .er-view-icon-btn.e-dropdown-btn::before,
.er-view-header .er-view-icon-btn.e-dropdown-btn::after {
    display: none !important;
    content: none !important;
}

.er-view-tabs {
    background: #ffffff;
    margin-left: -1.75rem;
    margin-right: -1.75rem;
}

@media (min-width: 1024px) {
    .er-view-tabs {
        margin-left: -2.75rem;
        margin-right: -2.75rem;
    }
}

.er-view-tabs .e-tab .e-tab-header {
    background: #ffffff !important;
    border-bottom: 1px solid #e2e8f0 !important;
    padding: 0 16px;
}

@media (min-width: 1024px) {
    .er-view-tabs .e-tab .e-tab-header {
        padding: 0 24px;
    }
}

.er-view-tabs .e-tab .e-tab-header .e-toolbar-item .e-tab-text,
.er-view-tabs .e-tab .e-tab-header .e-toolbar-item .e-tab-icon {
    color: #64748b !important;
    font-size: 13px !important;
}

.er-view-tabs .e-tab .e-tab-header .e-toolbar-item.e-active .e-tab-text,
.er-view-tabs .e-tab .e-tab-header .e-toolbar-item.e-active .e-tab-icon {
    color: #3a7fb3 !important;
    font-weight: 500;
}

.er-view-tabs .e-tab .e-tab-header .e-toolbar-item:hover .e-tab-text,
.er-view-tabs .e-tab .e-tab-header .e-toolbar-item:hover .e-tab-icon {
    color: #3a7fb3 !important;
}

.er-view-tabs .e-tab .e-tab-header .e-indicator {
    background: #3a7fb3 !important;
    height: 2px !important;
}

.er-view-card,
.er-view-cards-stack .card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    box-shadow: none;
}

.er-view-card .card-body,
.er-view-cards-stack .card .card-body {
    padding: 18px 20px;
}

.er-view-card .card-title,
.er-view-cards-stack .card .card-title {
    color: #0f172a;
    font-weight: 700 !important;
    font-size: 14px !important;
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
}

.er-view-card .card-title i,
.er-view-cards-stack .card .card-title i {
    color: #64748b;
    margin-right: 0 !important;
    font-size: 13px;
}

.er-view-card hr,
.er-view-cards-stack .card hr {
    display: none;
}

.er-view-cards-stack > * + * {
    margin-top: 16px;
}

.er-view-cards-stack .er-primary-action.e-btn {
    background: #0f172a !important;
    border-color: #0f172a !important;
    color: #ffffff !important;
}

.er-view-cards-stack .er-primary-action.e-btn:hover,
.er-view-cards-stack .er-primary-action.e-btn:focus {
    background: #1e293b !important;
    border-color: #1e293b !important;
    color: #ffffff !important;
}

.er-view-header .er-btn-link.e-btn {
    border: 1px solid #cbd5e1 !important;
    color: #64748b !important;
    background: transparent !important;
    padding: 2px 10px !important;
    border-radius: 9999px !important;
    font-weight: 400 !important;
}

.er-view-header .er-btn-link.e-btn:hover,
.er-view-header .er-btn-link.e-btn:focus {
    border-color: #3a7fb3 !important;
    color: #3a7fb3 !important;
    background: #f8fafc !important;
}

.er-view-header .er-btn-link.e-btn .e-btn-icon {
    color: inherit !important;
    margin-right: 4px;
}

.er-view-card .row.small .text-body.fw-semibold,
.er-view-cards-stack .card .row.small .text-body.fw-semibold {
    font-size: 11px !important;
    color: #334155 !important;
    font-weight: 600 !important;
}

.er-view-card .row.small,
.er-view-cards-stack .card .row.small {
    --bs-gutter-y: 0.5rem !important;
}

.er-view-card .row.small > [class*="col-"],
.er-view-cards-stack .card .row.small > [class*="col-"] {
    margin-top: 0.5rem !important;
}

.er-view-card .row.small.mt-3,
.er-view-cards-stack .card .row.small.mt-3 {
    margin-top: 0 !important;
}

.er-view-card .row > [class*="col-"].text-body.fw-semibold,
.er-view-cards-stack .card .row > [class*="col-"].text-body.fw-semibold {
    flex: 0 0 110px !important;
    width: 110px !important;
    max-width: 110px !important;
}

.er-view-card .row > [class*="col-"].text-body.fw-semibold + [class*="col-"],
.er-view-cards-stack .card .row > [class*="col-"].text-body.fw-semibold + [class*="col-"] {
    flex: 0 0 calc(100% - 110px) !important;
    width: calc(100% - 110px) !important;
    max-width: calc(100% - 110px) !important;
    min-width: 0 !important;
}

@media (min-width: 768px) {
    .er-view-card .row > [class*="col-"].text-body.fw-semibold,
    .er-view-cards-stack .card .row > [class*="col-"].text-body.fw-semibold {
        flex: 0 0 130px !important;
        width: 130px !important;
        max-width: 130px !important;
    }

    .er-view-card .row > [class*="col-"].text-body.fw-semibold + [class*="col-"],
    .er-view-cards-stack .card .row > [class*="col-"].text-body.fw-semibold + [class*="col-"] {
        flex: 0 0 calc(100% - 130px) !important;
        width: calc(100% - 130px) !important;
        max-width: calc(100% - 130px) !important;
    }
}

@media (min-width: 1280px) {
    .er-view-card .row > [class*="col-"].text-body.fw-semibold,
    .er-view-cards-stack .card .row > [class*="col-"].text-body.fw-semibold {
        flex: 0 0 150px !important;
        width: 150px !important;
        max-width: 150px !important;
    }

    .er-view-card .row > [class*="col-"].text-body.fw-semibold + [class*="col-"],
    .er-view-cards-stack .card .row > [class*="col-"].text-body.fw-semibold + [class*="col-"] {
        flex: 0 0 calc(100% - 150px) !important;
        width: calc(100% - 150px) !important;
        max-width: calc(100% - 150px) !important;
    }
}

.er-view-card .e-inplaceeditor .e-editable-value-wrapper,
.er-view-card .e-inplaceeditor .e-editable-value,
.er-view-cards-stack .e-inplaceeditor .e-editable-value-wrapper,
.er-view-cards-stack .e-inplaceeditor .e-editable-value {
    font-size: 12px !important;
    color: #0f172a !important;
    font-weight: 400 !important;
    line-height: 1.4;
}

.er-view-card .e-inplaceeditor.er-empty-value .e-editable-value,
.er-view-cards-stack .e-inplaceeditor.er-empty-value .e-editable-value {
    color: #94a3b8 !important;
    font-style: italic;
    font-weight: 400 !important;
}

.er-view-card .e-switch-wrapper input:checked + .e-switch-inner,
.er-view-card .e-switch-wrapper input:checked + .e-switch-inner .e-switch-on,
.er-view-card .e-switch-wrapper.e-switch-active .e-switch-inner,
.er-view-card .e-switch-wrapper .e-switch-on,
.er-view-cards-stack .e-switch-wrapper input:checked + .e-switch-inner,
.er-view-cards-stack .e-switch-wrapper input:checked + .e-switch-inner .e-switch-on,
.er-view-cards-stack .e-switch-wrapper.e-switch-active .e-switch-inner,
.er-view-cards-stack .e-switch-wrapper .e-switch-on {
    background-color: #3a7fb3 !important;
    border-color: #3a7fb3 !important;
}

.er-view-card .recurring-settings-editor,
.er-view-cards-stack .recurring-settings-editor {
    --bs-gutter-y: 0.5rem !important;
    --bs-gutter-x: 0 !important;
    margin-top: 0.5rem !important;
    padding-bottom: 0 !important;
}

.er-view-card .recurring-settings-editor .editable-text,
.er-view-card .recurring-settings-editor button.btn-link,
.er-view-cards-stack .recurring-settings-editor .editable-text,
.er-view-cards-stack .recurring-settings-editor button.btn-link {
    font-size: 12px !important;
    color: #0f172a !important;
    font-weight: 400 !important;
    line-height: 1.4;
}

.er-view-card .e-inplaceeditor,
.er-view-cards-stack .e-inplaceeditor {
    padding: 0 !important;
    margin: 0 !important;
    line-height: 1.4 !important;
}

.er-view-card .e-inplaceeditor .e-editable-value-wrapper,
.er-view-card .e-inplaceeditor .e-editable-value,
.er-view-cards-stack .e-inplaceeditor .e-editable-value-wrapper,
.er-view-cards-stack .e-inplaceeditor .e-editable-value {
    padding: 0 !important;
    margin: 0 !important;
}

.er-view-card .card-body .e-btn:not(.er-primary-action),
.er-view-cards-stack .card .card-body .e-btn:not(.er-primary-action) {
    font-size: 11px !important;
    padding: 4px 10px !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: 7px !important;
    background: #ffffff !important;
    color: #0f172a !important;
    font-weight: 500 !important;
    box-shadow: none !important;
}

.er-view-card .card-body .e-btn:not(.er-primary-action):hover,
.er-view-cards-stack .card .card-body .e-btn:not(.er-primary-action):hover {
    background: #f8fafc !important;
    border-color: #cbd5e1 !important;
}

.er-view-card .card-body .er-primary-action.e-btn,
.er-view-cards-stack .card .card-body .er-primary-action.e-btn {
    font-size: 11px !important;
    padding: 4px 10px !important;
    border-radius: 7px !important;
    font-weight: 500 !important;
    box-shadow: none !important;
}

/* --- Modernized expiration item card (mockup-driven) --- */
.er-view-cards-stack .er-exp-item-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 11px 12px;
    min-height: 110px;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    cursor: pointer;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.er-view-cards-stack .er-exp-item-card:hover {
    border-color: #cbd5e1;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.er-view-cards-stack .er-exp-item-card-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 8px;
}

.er-view-cards-stack .er-exp-item-card-title {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    flex: 1;
}

.er-view-cards-stack .er-exp-item-icon {
    width: 24px;
    height: 24px;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: #ffffff;
    font-size: 11px;
}

.er-view-cards-stack .er-exp-icon-active,
.er-view-cards-stack .er-exp-icon-no-expiration { background: #48bb78; }
.er-view-cards-stack .er-exp-icon-expired { background: #e53e3e; }
.er-view-cards-stack .er-exp-icon-notifying { background: #ed8936; }
.er-view-cards-stack .er-exp-icon-missing { background: #e2d2a3; color: #5a4720; }
.er-view-cards-stack .er-exp-icon-on-hold { background: #818cf8; }
.er-view-cards-stack .er-exp-icon-default { background: #94a3b8; }

.er-view-cards-stack .er-exp-item-name {
    font-size: 12px;
    font-weight: 500;
    color: #0f172a;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.er-view-cards-stack .er-exp-item-kebab.e-dropdown-btn {
    width: 24px !important;
    height: 24px !important;
    min-width: 24px !important;
    padding: 0 !important;
    background: transparent !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: 6px !important;
    color: #64748b !important;
    box-shadow: none !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    line-height: 1 !important;
}

.er-view-cards-stack .er-exp-item-kebab.e-dropdown-btn:hover {
    background: #f8fafc !important;
    border-color: #cbd5e1 !important;
    color: #64748b !important;
}

.er-view-cards-stack .er-exp-item-kebab.e-dropdown-btn .e-btn-icon {
    margin: 0 !important;
    font-size: 11px;
    color: inherit;
}

.er-view-cards-stack .er-exp-item-kebab.e-dropdown-btn .e-caret,
.er-view-cards-stack .er-exp-item-kebab.e-dropdown-btn .e-icon-down,
.er-view-cards-stack .er-exp-item-kebab.e-dropdown-btn::before,
.er-view-cards-stack .er-exp-item-kebab.e-dropdown-btn::after {
    display: none !important;
    content: none !important;
}

.er-view-cards-stack .er-exp-item-card-fields {
    margin-top: 8px;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.er-view-cards-stack .er-exp-item-row {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 11px;
}

.er-view-cards-stack .er-exp-item-row-label {
    color: #64748b;
    min-width: 52px;
    flex-shrink: 0;
}

.er-view-cards-stack .er-exp-item-row-value {
    color: #64748b;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.er-view-cards-stack .er-exp-item-meta {
    margin-top: 4px;
    font-size: 11px;
    color: #94a3b8;
}

.er-view-cards-stack .er-exp-item-action-btn {
    width: 24px;
    height: 24px;
    padding: 0;
    background: transparent;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    color: #64748b;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    font-size: 11px;
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.er-view-cards-stack .er-exp-item-action-btn:hover,
.er-view-cards-stack .er-exp-item-action-btn:focus {
    background: #f8fafc;
    border-color: #cbd5e1;
    color: #0f172a;
}

.er-view-card .form-box .form-label,
.er-view-cards-stack .form-box .form-label {
    font-size: 12px;
    color: #334155;
}

.er-view-card .form-box .form-label .fw-light,
.er-view-cards-stack .form-box .form-label .fw-light {
    font-size: 11px;
    color: #64748b;
    font-weight: 400;
}

.er-view-card .form-box .e-input,
.er-view-card .form-box .e-input-group,
.er-view-card .form-box .e-input-group input,
.er-view-cards-stack .form-box .e-input,
.er-view-cards-stack .form-box .e-input-group,
.er-view-cards-stack .form-box .e-input-group input {
    font-size: 12px !important;
}

.er-view-card .form-box .e-ddl input,
.er-view-cards-stack .form-box .e-ddl input,
.er-view-card .form-box .e-combobox input,
.er-view-cards-stack .form-box .e-combobox input {
    font-size: 12px !important;
}

.er-view-card .form-box .text-muted,
.er-view-cards-stack .form-box .text-muted {
    font-size: 12px;
}

.er-view-card .form-box .btn-link,
.er-view-cards-stack .form-box .btn-link {
    font-size: 12px;
}

.er-view-cards-stack .er-exp-item-body {
    margin-top: 8px;
    font-size: 11px;
    color: #475569;
    line-height: 1.5;
    max-height: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 4;
    line-clamp: 4;
    -webkit-box-orient: vertical;
}

.er-view-cards-stack .er-exp-item-body p {
    margin: 0 0 4px 0;
}

.er-view-cards-stack .er-exp-item-body p:last-child {
    margin-bottom: 0;
}

.er-view-cards-stack .er-view-all-btn {
    width: 100%;
    background: transparent;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 7px;
    font-size: 12px;
    color: #64748b;
    cursor: pointer;
    margin-top: 10px;
    transition: background 0.15s, border-color 0.15s;
}

.er-view-cards-stack .er-view-all-btn:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
}

.er-view-cards-stack .er-attachment-dropzone {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    border: 1.5px dashed #e2e8f0;
    border-radius: 10px;
    padding: 12px;
    cursor: pointer;
    transition: border-color 0.15s;
}

.er-view-cards-stack .er-attachment-dropzone:hover {
    border-color: #3a7fb3;
}

.er-view-cards-stack .er-attachment-dropzone-hint {
    font-size: 11px;
    color: #64748b;
    flex: 0 0 auto;
}

.er-view-cards-stack .er-attachment-dropzone .e-upload {
    border: none !important;
    background: transparent !important;
    width: auto !important;
    flex: 0 0 auto !important;
}

.er-view-cards-stack .er-attachment-dropzone .e-upload .e-file-select-wrap {
    padding: 0 !important;
    width: auto !important;
}

.er-view-cards-stack .er-attachment-dropzone .e-upload .e-file-select-wrap .e-css.e-btn {
    font-size: 11px !important;
    padding: 4px 12px !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: 6px !important;
    background: #ffffff !important;
    color: #0f172a !important;
}

.er-view-cards-stack .er-attachment-dropzone .e-upload .e-file-select-wrap .e-file-drop {
    display: none;
}

.er-view-cards-stack .er-attachment-dropzone .e-upload .e-upload-files {
    border: none;
}

/* ===== Index-page header (mirrors .er-view-header for list pages) ===== */
/* Lives inside MainLayout's <article class="p-4 lg:p-8">, so negative
   side margins are calibrated to bleed past that 1rem / 2rem padding. */
.er-index-header {
    background: #ffffff;
    border-bottom: 1px solid #e2e8f0;
    padding: 16px 16px;
    margin-top: -1rem;
    margin-left: -1rem;
    margin-right: -1rem;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    flex-shrink: 0;
}

@media (min-width: 1024px) {
    .er-index-header {
        padding: 18px 24px;
        margin-top: -2rem;
        margin-left: -2rem;
        margin-right: -2rem;
    }
}

.er-index-header .er-view-name {
    font-size: 24px !important;
    font-weight: 600 !important;
    color: #0f172a !important;
    margin: 0 !important;
}

.er-index-header .er-view-action-btn.e-btn {
    background: #ffffff !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: 8px !important;
    color: #0f172a !important;
    font-size: 13px !important;
    padding: 7px 14px !important;
    font-weight: 500 !important;
    box-shadow: none !important;
}

.er-index-header .er-view-action-btn.e-btn:hover,
.er-index-header .er-view-action-btn.e-btn:focus {
    background: #f8fafc !important;
    border-color: #cbd5e1 !important;
}

/* Primary CTA variant — same dimensions, brand-green fill */
.er-index-header .er-view-action-btn.er-view-action-btn--primary.e-btn {
    background: #10b981 !important;
    border-color: #10b981 !important;
    color: #ffffff !important;
}

.er-index-header .er-view-action-btn.er-view-action-btn--primary.e-btn:hover,
.er-index-header .er-view-action-btn.er-view-action-btn--primary.e-btn:focus {
    background: #059669 !important;
    border-color: #059669 !important;
    color: #ffffff !important;
}

.er-index-header .er-view-action-btn.e-btn .e-btn-icon {
    font-size: 13px;
    color: inherit;
}

/* ===== Index-page card wrapper (grid container) ===== */
.er-index-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    margin-left: -0.5rem;
}

@media (min-width: 1024px) {
    .er-index-card {
        margin-left: -1rem;
    }
}

/* Tabs styling — applies to ANY .er-tab (index pages with or without
   the .er-index-card wrapper). Mirrors .er-view-tabs in ContactView. */
.er-tab .e-tab-header {
    border-bottom: 1px solid #f1f5f9;
    padding: 0 16px;
}

@media (min-width: 1024px) {
    .er-tab .e-tab-header {
        padding: 0 20px;
    }
}

.er-tab .e-tab-header .e-toolbar-item .e-tab-text,
.er-tab .e-tab-header .e-toolbar-item .e-tab-icon {
    color: #64748b !important;
    font-size: 13px !important;
}

.er-tab .e-tab-header .e-toolbar-item.e-active .e-tab-text,
.er-tab .e-tab-header .e-toolbar-item.e-active .e-tab-icon {
    color: #3a7fb3 !important;
    font-weight: 500;
}

.er-tab .e-tab-header .e-toolbar-item:hover .e-tab-text,
.er-tab .e-tab-header .e-toolbar-item:hover .e-tab-icon {
    color: #3a7fb3 !important;
}

.er-tab .e-tab-header .e-indicator {
    background: #3a7fb3 !important;
    height: 2px !important;
}

/* ===== Index-page filter row + toolbar (Phase 2) ===== */
/* Filter row chrome — applies to ANY .er-index-filter-row (used by index
   pages with the .er-index-card wrapper AND by pages like DocumentsIndex
   that have a custom outer layout but still want the filter row look). */
.er-index-filter-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    border-bottom: 1px solid #f1f5f9;
    background: #ffffff;
}

/* FilterPanel trigger button — only override border-radius (→ pill) and
   text color (→ match the panel's Clear All button gray-500). Padding,
   bg, and border are left to FilterPanel's own Tailwind so the original
   layout/sizing is preserved.
   `:first-child` is critical: when the popup opens, FilterPanel injects a
   `<button class="fixed inset-0 z-40">` overlay as a SIBLING of the trigger.
   Without `:first-child`, this overlay also receives our pill+bg styling
   and paints a giant gray rounded blob over the page. */
.er-index-filter-row > div > div:first-child > button:first-child {
    border-radius: 9999px !important;
    color: #6b7280 !important;
}
.er-index-filter-row > div > div:first-child > button:first-child:hover {
    color: #374151 !important;
    background: #f9fafb !important;
}

/* Clear All button — Tailwind's rounded-full already pills it, but
   reassert here so any specificity collision still resolves to a pill. */
.er-index-filter-row .rounded-full {
    border-radius: 9999px !important;
}

/* Syncfusion grid toolbar — Search input + Columns picker + export buttons */
/* Search input chip */
.er-index-card .e-grid .e-toolbar .e-input-group,
.er-index-card .e-grid .e-toolbar .e-search {
    background: #f8fafc !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: 8px !important;
    box-shadow: none !important;
    padding: 0 8px !important;
}

.er-index-card .e-grid .e-toolbar .e-input-group input,
.er-index-card .e-grid .e-toolbar .e-search input {
    background: transparent !important;
    font-size: 12px !important;
    color: #1e293b !important;
    height: 26px !important;
    line-height: 26px !important;
}

.er-index-card .e-grid .e-toolbar .e-input-group .e-search-icon,
.er-index-card .e-grid .e-toolbar .e-search-icon {
    color: #94a3b8 !important;
    font-size: 13px !important;
}

/* Toolbar icon sizing (color intentionally NOT set — preserves per-button
   colors set via PrefixIcon classes like text-danger/text-success/text-primary). */
.er-index-card .e-grid .e-toolbar .e-btn-icon,
.er-index-card .e-grid .e-toolbar .e-icons {
    font-size: 12px !important;
}

/* ===== Toolbar export buttons (PDF / Excel / CSV) — text label colored,
   icons keep their per-button colors (text-danger/text-success/text-primary
   set in IndexPageBase.cs PrefixIcon). ===== */
.er-index-card .e-grid .e-toolbar .e-btn,
.er-index-card .e-grid .e-toolbar .e-btn:hover,
.er-index-card .e-grid .e-toolbar .e-btn:active,
.er-index-card .e-grid .e-toolbar .e-btn:focus {
    color: rgb(13, 110, 253) !important;
}

/* ===== Index-page grid table (Phase 3) ===== */

/* Header cells */
.er-index-card .e-grid .e-headercell,
.er-index-card .e-grid .e-detailheadercell {
    background: #ffffff !important;
    border-bottom: 1px solid #e2e8f0 !important;
    border-top: none !important;
    padding: 8px 10px !important;
}

.er-index-card .e-grid .e-headercelldiv,
.er-index-card .e-grid .e-headertext,
.er-index-card .e-grid .e-headercell .e-headercelldiv {
    font-size: 10px !important;
    font-weight: 700 !important;
    color: #334155 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px !important;
}

/* Sort/filter icons in headers stay muted */
.er-index-card .e-grid .e-headercell .e-sortfilterdiv,
.er-index-card .e-grid .e-headercell .e-icons {
    color: #94a3b8 !important;
}

/* Row cells */
.er-index-card .e-grid .e-row .e-rowcell {
    padding: 6px 10px !important;
    font-size: 12px !important;
    color: #475569 !important;
    border-bottom: 1px solid #f1f5f9 !important;
    border-top: none !important;
    vertical-align: middle;
}

/* Row hover */
.er-index-card .e-grid .e-row:hover .e-rowcell,
.er-index-card .e-grid .e-row.e-rowhover .e-rowcell {
    background: #fafbfc !important;
}

/* Name-column links — brand blue, medium weight, no underline (underline on hover).
   Applied to every grid in the app so header-only-modernized pages and any other
   page with a row-cell link picks up the same look.
   `:not(.badge)` excludes pill-shaped related-entity links (DocumentsIndex,
   etc.) so their inline `color:white` stays readable on colored backgrounds. */
.e-grid .e-rowcell a:not(.badge),
.e-grid .e-rowcell a:not(.badge):link,
.e-grid .e-rowcell a:not(.badge):visited {
    color: #3a7fb3 !important;
    font-weight: 500 !important;
    text-decoration: none !important;
}
.e-grid .e-rowcell a:not(.badge):hover {
    text-decoration: underline !important;
    color: #3a7fb3 !important;
}

/* Hover-icon refresh in Name column (contacts/attachments popover triggers) */
.er-index-card .att-popover-wrap > i {
    color: #94a3b8 !important;
    font-size: 12px !important;
}

/* Selected-row checkbox + cell background stays subtle */
.er-index-card .e-grid .e-row.e-selectionbackground .e-rowcell,
.er-index-card .e-grid .e-row.e-active .e-rowcell {
    background: #f8fafc !important;
    color: #1e293b !important;
}

/* ===== Status badges + tag pills (Phase 4) — applied to every grid ===== */
/* Override Bootstrap's blocky .badge inside any grid row cell. Background colors
   come from .bg-active / .bg-expired / etc. in app.css, or inline style for tags. */
.e-grid .e-rowcell .badge {
    display: inline-block;
    font-size: 10px;
    font-weight: 600;
    padding: 2px 7px;
    border-radius: 3px;
    line-height: 1.4;
    white-space: nowrap;
}

/* Tag row flex spacing tightened so multiple tags don't wrap awkwardly */
.e-grid .e-rowcell .d-flex.flex-wrap.gap-1 {
    gap: 4px !important;
    flex-wrap: nowrap;
    overflow: hidden;
}

/* ===== Row Actions dropdown chip — applied to every grid's Actions column ===== */
/* Wins over the global `.e-dropdown-btn { color: rgb(13,110,253); background: transparent }`
   rule via higher specificity (3 classes vs 1) and !important. */
.e-grid .e-rowcell .e-dropdown-btn,
.e-grid .e-rowcell .e-dropdown-btn:hover,
.e-grid .e-rowcell .e-dropdown-btn:active,
.e-grid .e-rowcell .e-dropdown-btn:focus {
    background: #ffffff !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: 6px !important;
    color: #475569 !important;
    font-size: 12px !important;
    font-weight: 500 !important;
    padding: 4px 10px !important;
    box-shadow: none !important;
    line-height: 1.4 !important;
    display: inline-flex !important;
    align-items: center;
    gap: 6px;
}

.e-grid .e-rowcell .e-dropdown-btn:hover,
.e-grid .e-rowcell .e-dropdown-btn:focus {
    background: #f8fafc !important;
    border-color: #cbd5e1 !important;
    color: #1e293b !important;
}

/* Caret next to "Actions" label */
.e-grid .e-rowcell .e-dropdown-btn .e-caret {
    color: #94a3b8 !important;
    font-size: 10px !important;
    margin-left: 2px;
}

/* ===== Global index-grid baseline (extracted from per-page inline <style> blocks) ===== */

/* Hide Excel filter checkbox UI in all grids — every modern index page sets this */
.e-excelfilter .e-searchbox,
.e-excelfilter .e-checkboxlist,
.e-excelfilter .e-ftrchk {
    display: none;
}

/* Syncfusion dropdown buttons in grid toolbars: blue link look.
   Scoped to .e-grid .e-toolbar so it doesn't leak to dropdown buttons
   elsewhere in the app (detail-view kebabs, sidebars, dialogs, etc.).
   Row Actions dropdowns are scoped separately by their own chip rule
   (.e-grid .e-rowcell .e-dropdown-btn, higher specificity than this). */
.e-grid .e-toolbar .e-dropdown-btn,
.e-grid .e-toolbar .e-dropdown-btn:hover,
.e-grid .e-toolbar .e-dropdown-btn:active {
    color: rgb(13, 110, 253) !important;
    background: rgba(0, 0, 0, 0) !important;
    border-color: rgba(0, 0, 0, 0) !important;
}

/* SfGrid toolbar baseline */
.e-grid .e-toolbar-items {
    background-color: white;
}
.e-grid .e-toolbar .e-btn {
    background-color: white;
    box-shadow: none;
}

/* Drag-drop file-drop highlight on grid rows */
tr.e-row.drop-highlight {
    outline: 2px dashed #3b82f6;
    outline-offset: -2px;
    background-color: rgba(59, 130, 246, 0.06);
}
