/* ═══════════════════════════════════════════════════════════════════════
   E-SIGNATURES MODULE — page styles
   ─────────────────────────────────────────────────────────────────────
   Scoped with .esm- prefix to avoid collision with .esign-* classes
   used by the existing ESign modals/overlays/cards (which this page
   reuses verbatim for row details via ESign.openDetail()).
   Uses EFF brand tokens: --eff-primary #1E6332, --eff-beige #F4F0E9,
   --eff-caramel #C19A6B.
   ═══════════════════════════════════════════════════════════════════════ */

.esignatures-page {
    padding: 20px 24px 62px;
    min-height: 100vh;
}

/* ────────────────────── FILTER BAR ────────────────────── */
.esm-filter-bar {
    background: #fff;
    border: 1px solid #e8e4df;
    border-radius: 14px;
    padding: 14px 16px;
    margin-bottom: 14px;
}
.esm-filter-top {
    display: flex;
    gap: 12px;
    align-items: center;
    margin-bottom: 12px;
}
.esm-search-box {
    flex: 1;
    position: relative;
    display: flex;
    align-items: center;
}
.esm-search-box > i.fa-search {
    position: absolute;
    left: 12px;
    color: #9ca3af;
    pointer-events: none;
}
.esm-search-box input {
    width: 100%;
    padding: 10px 40px 10px 36px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    transition: border-color 140ms, box-shadow 140ms;
}
.esm-search-box input:focus {
    outline: none;
    border-color: #1E6332;
    box-shadow: 0 0 0 3px rgba(30, 99, 50, 0.1);
}
.esm-search-clear {
    position: absolute;
    right: 8px;
    width: 24px;
    height: 24px;
    border: none;
    background: #e5e7eb;
    border-radius: 50%;
    cursor: pointer;
    color: #6b7280;
    font-size: 11px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.esm-search-clear:hover { background: #cbd5e1; color: #1f2937; }

.esm-filter-actions { display: flex; gap: 10px; align-items: center; }

.esm-view-toggle {
    display: flex;
    background: #f3f4f6;
    border-radius: 8px;
    padding: 2px;
    gap: 2px;
}
.esm-view-btn {
    width: 34px;
    height: 34px;
    border: none;
    background: transparent;
    border-radius: 6px;
    cursor: pointer;
    color: #6b7280;
    font-size: 13px;
    transition: all 140ms;
}
.esm-view-btn:hover { color: #1E6332; }
.esm-view-btn.active {
    background: linear-gradient(135deg, #1E6332, #2F8542);
    color: #fff;
}

.esm-refresh-btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 8px 14px;
    background: #fff;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    color: #374151;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    transition: all 140ms;
}
.esm-refresh-btn:hover { border-color: #1E6332; color: #1E6332; background: #F4F0E9; }
.esm-refresh-btn.loading i { animation: esmSpin 1s linear infinite; }
@keyframes esmSpin { to { transform: rotate(360deg); } }

/* Status chips */
.esm-chip-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 10px;
}
.esm-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    background: #fff;
    border: 1px solid #d1d5db;
    border-radius: 20px;
    font-size: 12.5px;
    font-weight: 500;
    color: #4b5563;
    cursor: pointer;
    transition: all 140ms;
}
.esm-chip:hover { border-color: #1E6332; color: #1E6332; }
.esm-chip i { font-size: 11px; }
.esm-chip.active {
    background: linear-gradient(135deg, #1E6332, #2F8542);
    color: #fff;
    border-color: #1E6332;
    box-shadow: 0 2px 6px rgba(30, 99, 50, 0.25);
}

/* Count badge on each filter chip — populated from stats RPC result */
.esm-chip-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    height: 20px;
    padding: 0 6px;
    margin-left: 2px;
    background: #e5e7eb;
    color: #4b5563;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 700;
    line-height: 1;
    transition: background 140ms, color 140ms;
}
.esm-chip:hover .esm-chip-count {
    background: #d1d5db;
}
.esm-chip.active .esm-chip-count {
    background: rgba(255, 255, 255, 0.25);
    color: #fff;
}
/* Zero-count chips get a faded badge so the ones with activity pop visually */
.esm-chip-count--zero {
    opacity: 0.4;
}
.esm-chip.active .esm-chip-count--zero {
    opacity: 0.65;
}
/* Status-tinted chip hover — kept subtle to not compete with the "active" green */
.esm-chip-sent:hover     { border-color: #2563eb; color: #2563eb; }
.esm-chip-viewed:hover   { border-color: #7c3aed; color: #7c3aed; }
.esm-chip-signed:hover   { border-color: #f59e0b; color: #a16207; }
.esm-chip-completed:hover{ border-color: #16a34a; color: #16a34a; }
.esm-chip-declined:hover { border-color: #dc2626; color: #dc2626; }
.esm-chip-expired:hover  { border-color: #6b7280; color: #4b5563; }
.esm-chip-recalled:hover { border-color: #b45309; color: #92400e; }

/* Secondary row */
.esm-filter-secondary {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}
.esm-filter-spacer { flex: 1; }
.esm-filter-trigger {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 7px 12px;
    background: #fff;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    cursor: pointer;
    font-size: 13px;
    color: #374151;
    transition: border-color 140ms;
}
.esm-filter-trigger:hover { border-color: #1E6332; }
.esm-filter-trigger.has-value { border-color: #1E6332; background: #F4F0E9; color: #1E6332; font-weight: 500; }
.esm-filter-chev { font-size: 10px; color: #9ca3af; }

.esm-location-filter { position: relative; }
.esm-location-panel {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    min-width: 280px;
    max-width: 380px;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12);
    z-index: 100;
}
.esm-location-panel-header {
    display: flex;
    gap: 8px;
    padding: 10px 12px;
    border-bottom: 1px solid #f3f4f6;
}
.esm-link-btn {
    background: transparent;
    border: none;
    color: #1E6332;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    padding: 2px 4px;
}
.esm-link-btn:hover { text-decoration: underline; }
.esm-location-list {
    max-height: 280px;
    overflow-y: auto;
    padding: 6px 0;
}
.esm-loc-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 14px;
    font-size: 13px;
    cursor: pointer;
    transition: background 100ms;
}
.esm-loc-item:hover { background: #F4F0E9; }
.esm-loc-item input { cursor: pointer; }

.esm-date-select {
    padding: 7px 10px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    background: #fff;
    font-size: 13px;
    color: #374151;
    cursor: pointer;
}
.esm-date-select:focus { outline: none; border-color: #1E6332; }

.esm-clear-filters-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: #fee2e2;
    border: 1px solid #fecaca;
    border-radius: 8px;
    color: #991b1b;
    font-size: 12.5px;
    font-weight: 500;
    cursor: pointer;
    transition: all 140ms;
}
.esm-clear-filters-btn:hover { background: #fecaca; }

/* ────────────────────── BULK ACTION BAR ────────────────────── */
.esm-bulk-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 12px 18px;
    background: linear-gradient(135deg, #1E6332, #2F8542);
    border-radius: 12px;
    color: #fff;
    margin-bottom: 14px;
    box-shadow: 0 3px 10px rgba(30, 99, 50, 0.25);
    animation: esmBulkIn 180ms ease-out;
}
@keyframes esmBulkIn {
    from { opacity: 0; transform: translateY(-6px); }
    to   { opacity: 1; transform: translateY(0); }
}
.esm-bulk-count {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
    font-size: 14px;
}
.esm-bulk-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}
.esm-bulk-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 14px;
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 8px;
    color: #fff;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: background 140ms, transform 120ms;
}
.esm-bulk-btn:hover { background: rgba(255, 255, 255, 0.28); transform: translateY(-1px); }
.esm-bulk-btn-danger { background: rgba(220, 38, 38, 0.45); border-color: rgba(254, 202, 202, 0.6); }
.esm-bulk-btn-danger:hover { background: rgba(220, 38, 38, 0.7); }
.esm-bulk-btn-ghost { background: transparent; border-color: rgba(255, 255, 255, 0.4); }
.esm-bulk-btn:disabled { opacity: 0.55; cursor: not-allowed; }

/* ────────────────────── TABLE VIEW ────────────────────── */
.esm-table-container {
    background: #fff;
    border: 1px solid #e5e1da;
    border-radius: 14px;
    overflow: hidden;
}
.esm-table-header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    background: linear-gradient(135deg, #F4F0E9, #fff);
    border-bottom: 1px solid #e5e1da;
}
.esm-table-title {
    font-size: 16px;
    font-weight: 600;
    color: #214A3E;
    margin: 0;
    display: inline-flex;
    align-items: center;
    gap: 10px;
}
.esm-count-badge {
    background: #1E6332;
    color: #fff;
    padding: 2px 10px;
    border-radius: 11px;
    font-size: 12px;
    font-weight: 600;
}
.esm-table-header-meta { font-size: 12px; color: #6b7280; }

.esm-table-wrap {
    overflow-x: auto;
    max-width: 100%;
}
.esm-table {
    width: 100%;
    min-width: 1100px;
    border-collapse: collapse;
    font-size: 13.5px;
}
.esm-table thead th {
    background: #faf8f4;
    padding: 10px 12px;
    text-align: left;
    font-weight: 600;
    color: #4b5563;
    border-bottom: 1px solid #e5e1da;
    white-space: nowrap;
    font-size: 12.5px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    position: sticky;
    top: 0;
    z-index: 2;
}
.esm-sortable { cursor: pointer; user-select: none; transition: background 120ms; }
.esm-sortable:hover { background: #F4F0E9; color: #1E6332; }
.esm-sort-ind {
    display: inline-block;
    width: 10px;
    margin-left: 4px;
    opacity: 0.4;
    font-size: 10px;
}
.esm-sort-ind.asc::after  { content: "▲"; opacity: 1; color: #1E6332; }
.esm-sort-ind.desc::after { content: "▼"; opacity: 1; color: #1E6332; }

.esm-col-check { width: 36px; }
.esm-col-actions { width: 120px; }

.esm-table tbody tr {
    border-bottom: 1px solid #f3f4f6;
    cursor: pointer;
    transition: background 120ms;
}
.esm-table tbody tr:hover { background: #f9fafb; }
.esm-table tbody tr.selected { background: #F4F0E9; }
.esm-table td {
    padding: 11px 12px;
    vertical-align: middle;
    color: #1f2937;
}
.esm-col-check input { cursor: pointer; }

.esm-row-bene-name { font-weight: 600; color: #214A3E; }
.esm-row-bene-email { font-size: 12px; color: #6b7280; margin-top: 2px; }
.esm-row-claim-link {
    color: #1E6332;
    text-decoration: none;
    font-weight: 500;
}
.esm-row-claim-link:hover { text-decoration: underline; }
.esm-row-fh { color: #4b5563; }

.esm-row-status-wrap {
    display: inline-flex;
    flex-direction: column;
    gap: 3px;
    min-width: 110px;
}
.esm-row-status-pct-bar {
    width: 100%;
    height: 4px;
    background: #e5e7eb;
    border-radius: 2px;
    overflow: hidden;
}
.esm-row-status-pct-fill {
    height: 100%;
    background: linear-gradient(90deg, #1E6332, #2F8542);
    border-radius: 2px;
    transition: width 200ms;
}

/* Recalled row — hover popover shows who/when/why only when the user hovers the
   status cell. Keeps the list compact; full detail is one pointer-over away. */
.esm-row-recalled-wrap {
    position: relative;
    display: inline-block;
    cursor: help;
}
/* Subtle visual cue that there's more to see on hover — dashed underline on the badge */
.esm-row-recalled-wrap .esign-status-badge {
    border-bottom: 2px dashed #fca5a5;
    padding-bottom: 1px;
}
.esm-row-recalled-pop {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    z-index: 100;
    min-width: 280px;
    max-width: 360px;
    background: #fff;
    border: 1px solid #fecaca;
    border-left: 4px solid #dc2626;
    border-radius: 10px;
    padding: 12px 14px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    font-size: 12px;
    color: #1f2937;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-4px);
    transition: opacity 140ms ease, transform 140ms ease, visibility 140ms;
    pointer-events: none;
    white-space: normal;
}
.esm-row-recalled-wrap:hover .esm-row-recalled-pop,
.esm-row-recalled-wrap:focus-within .esm-row-recalled-pop {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    pointer-events: auto;
}
.esm-row-recalled-pop::before {
    content: '';
    position: absolute;
    top: -6px;
    left: 16px;
    width: 10px;
    height: 10px;
    background: #fff;
    border-top: 1px solid #fecaca;
    border-left: 1px solid #fecaca;
    transform: rotate(45deg);
}
.esm-pop-head {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-weight: 700;
    color: #991b1b;
    font-size: 11.5px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 1px solid #fef2f2;
}
.esm-pop-head i { color: #dc2626; }
.esm-pop-row {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 4px 0;
    line-height: 1.45;
}
.esm-pop-row > i {
    color: #9ca3af;
    font-size: 11px;
    margin-top: 3px;
    width: 12px;
    text-align: center;
    flex-shrink: 0;
}
.esm-pop-row b { color: #214A3E; font-weight: 600; }
.esm-pop-dim { color: #9ca3af; font-weight: 400; }
.esm-pop-reason {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px dashed #fecaca;
}
.esm-pop-reason-label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 10.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #991b1b;
    margin-bottom: 4px;
}
.esm-pop-reason-label i { color: #dc2626; font-size: 10px; }
.esm-pop-reason-text {
    color: #4b5563;
    font-style: italic;
    line-height: 1.5;
    white-space: pre-wrap;
    word-wrap: break-word;
}
.esm-pop-reason-empty {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px dashed #fecaca;
    font-size: 11px;
    color: #9ca3af;
    font-style: italic;
}
.esm-row-sender { font-size: 12.5px; color: #6b7280; }
.esm-row-sender-name { color: #1f2937; }

/* Actions cell — dropdown */
.esm-row-actions {
    display: flex;
    gap: 4px;
    justify-content: flex-end;
}
.esm-row-action-btn {
    width: 30px;
    height: 30px;
    border: none;
    background: transparent;
    border-radius: 6px;
    cursor: pointer;
    color: #6b7280;
    font-size: 13px;
    transition: all 120ms;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.esm-row-action-btn:hover { background: #F4F0E9; color: #1E6332; }
.esm-row-action-btn.esm-btn-danger:hover { background: #fee2e2; color: #dc2626; }

/* Cancel/delete row action — always-red so it's visually distinct from refresh
   (which uses a similar rotating icon) and clearly communicates destructive intent */
.esm-row-action-btn.esm-btn-cancel {
    color: #dc2626;
    background: #fef2f2;
    border: 1px solid #fecaca;
}
.esm-row-action-btn.esm-btn-cancel:hover {
    background: #dc2626;
    color: #fff;
    border-color: #dc2626;
    transform: scale(1.05);
}

/* ────────────────────── CARD VIEW ────────────────────── */
.esm-cards-container { padding: 0; }
.esm-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
    gap: 16px;
}

.esm-card {
    background: #fff;
    border: 1px solid #e5e1da;
    border-radius: 12px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: box-shadow 160ms, border-color 160ms, transform 160ms;
    position: relative;
}
/* Status-colored left accent bar — instant visual status without reading badges */
.esm-card::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: #d1d5db;
    border-top-left-radius: 12px;
    border-bottom-left-radius: 12px;
}
.esm-card--sent::before      { background: linear-gradient(180deg, #3b82f6, #2563eb); }
.esm-card--viewed::before    { background: linear-gradient(180deg, #8b5cf6, #7c3aed); }
.esm-card--signed::before    { background: linear-gradient(180deg, #f59e0b, #d97706); }
.esm-card--completed::before { background: linear-gradient(180deg, #2F8542, #1E6332); }
.esm-card--declined::before  { background: linear-gradient(180deg, #ef4444, #dc2626); }
.esm-card--expired::before   { background: linear-gradient(180deg, #9ca3af, #6b7280); }
.esm-card--recalled::before  { background: linear-gradient(180deg, #ef4444, #dc2626); }

.esm-card:hover {
    box-shadow: 0 6px 18px rgba(30, 99, 50, 0.1);
    border-color: #c8c3bb;
}
.esm-card--selected {
    border-color: #1E6332;
    box-shadow: 0 0 0 1px #1E6332 inset, 0 4px 14px rgba(30, 99, 50, 0.15);
}

/* Head: checkbox + status badge + sent date */
.esm-card-head {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    border-bottom: 1px solid #f3f4f6;
    background: #faf8f4;
}
.esm-card-check { cursor: pointer; display: flex; align-items: center; }
.esm-card-check input { cursor: pointer; width: 16px; height: 16px; }
.esm-card-status { flex: 1; min-width: 0; }
.esm-card-sent {
    font-size: 11.5px;
    color: #6b7280;
    font-weight: 500;
    white-space: nowrap;
    flex-shrink: 0;
}

/* Body — click target for detail overlay */
.esm-card-body {
    padding: 14px 16px 6px;
    cursor: pointer;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Beneficiary block — primary identifying info */
.esm-card-bene {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.esm-card-bene-label {
    font-size: 10.5px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #9ca3af;
}
.esm-card-bene-name {
    font-size: 16px;
    font-weight: 700;
    color: #214A3E;
    line-height: 1.25;
}
.esm-card-bene-email {
    font-size: 12.5px;
    color: #6b7280;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    margin-top: 2px;
    word-break: break-all;
}
.esm-card-bene-email i { color: #9ca3af; font-size: 10.5px; }

/* Context block — claim / FH / IC */
.esm-card-ctx {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding-top: 10px;
    border-top: 1px solid #f3f4f6;
}
.esm-card-ctx-row {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12.5px;
    color: #4b5563;
    line-height: 1.35;
    min-width: 0;
}
.esm-card-ctx-row[onclick] { cursor: pointer; transition: color 120ms; }
.esm-card-ctx-row[onclick]:hover { color: #1E6332; }
.esm-card-ctx-row > i {
    width: 14px;
    color: #9ca3af;
    font-size: 12px;
    text-align: center;
    flex-shrink: 0;
}
.esm-card-ctx-row > span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
    flex: 1;
}
.esm-card-ctx-link { color: #1E6332; font-weight: 500; }
.esm-card-ctx-row[onclick]:hover .esm-card-ctx-link { text-decoration: underline; }

/* Progress tracker — 4 compact dots with connecting lines */
.esm-card-progress {
    padding-top: 2px;
    padding-bottom: 2px;
}
.esm-pbar {
    display: flex;
    align-items: flex-start;
    gap: 2px;
}
.esm-pstep {
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    min-width: 40px;
}
.esm-pstep-dot {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #fff;
    border: 2px solid #e5e7eb;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #9ca3af;
    font-size: 9px;
    transition: all 160ms;
}
.esm-pstep-label {
    font-size: 9.5px;
    font-weight: 600;
    color: #9ca3af;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}
.esm-pline {
    flex: 1;
    height: 2px;
    background: #e5e7eb;
    margin-top: 8px;
    border-radius: 1px;
    min-width: 4px;
}
.esm-pline--done { background: #2F8542; }
.esm-pstep--done .esm-pstep-dot {
    background: #2F8542;
    border-color: #2F8542;
    color: #fff;
}
.esm-pstep--done .esm-pstep-dot::after {
    content: '✓';
    font-size: 10px;
    font-weight: 700;
    line-height: 1;
}
.esm-pstep--done .esm-pstep-label { color: #1E6332; }
.esm-pstep--current .esm-pstep-dot {
    background: #fff;
    border-color: #2F8542;
    box-shadow: 0 0 0 3px rgba(47, 133, 66, 0.15);
}
.esm-pstep--current .esm-pstep-label { color: #1E6332; }
/* Terminal variants — replaces the final step with a status-colored indicator */
.esm-pstep--terminal-recalled .esm-pstep-dot,
.esm-pstep--terminal-declined .esm-pstep-dot {
    background: #fef2f2;
    border-color: #dc2626;
    color: #dc2626;
}
.esm-pstep--terminal-recalled .esm-pstep-label,
.esm-pstep--terminal-declined .esm-pstep-label {
    color: #dc2626;
}
.esm-pstep--terminal-expired .esm-pstep-dot {
    background: #f3f4f6;
    border-color: #6b7280;
    color: #6b7280;
}
.esm-pstep--terminal-expired .esm-pstep-label {
    color: #6b7280;
}
/* Hide the ::after checkmark on terminal steps since they render their own icon */
.esm-pstep[class*="--terminal"] .esm-pstep-dot::after { display: none; }

/* Recalled callout */
.esm-card-recalled {
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 8px;
    padding: 8px 10px;
    font-size: 12px;
    color: #991b1b;
}
.esm-card-recalled-head {
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.esm-card-recalled-head i { color: #dc2626; }
.esm-card-recalled-head b { color: #1f2937; font-weight: 600; }
.esm-card-recalled-reason {
    margin-top: 4px;
    color: #4b5563;
    font-size: 11.5px;
    font-style: italic;
    line-height: 1.4;
}

/* Footer: expires + sender on left, action icons on right */
.esm-card-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 14px;
    border-top: 1px solid #f3f4f6;
    background: #fafafa;
    min-height: 44px;
}
.esm-card-foot-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    font-size: 11.5px;
    color: #6b7280;
    min-width: 0;
    flex: 1;
}
.esm-card-sender {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: #6b7280;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 100%;
}
.esm-card-sender i { color: #9ca3af; font-size: 10px; }
.esm-card-sender-label { color: #9ca3af; font-weight: 500; }

.esm-card-actions {
    display: flex;
    gap: 5px;
    flex-shrink: 0;
}
.esm-card-act {
    width: 32px;
    height: 32px;
    border: 1px solid #e5e7eb;
    background: #fff;
    border-radius: 7px;
    cursor: pointer;
    color: #4b5563;
    font-size: 13px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 140ms;
}
.esm-card-act:hover {
    background: #F4F0E9;
    color: #1E6332;
    border-color: #1E6332;
}
.esm-card-act--cancel {
    color: #dc2626;
    background: #fef2f2;
    border-color: #fecaca;
}
.esm-card-act--cancel:hover {
    background: #dc2626;
    color: #fff;
    border-color: #dc2626;
    transform: scale(1.05);
}

/* ────────────────────── PAGINATION ────────────────────── */
.esm-pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 12px 18px;
    border-top: 1px solid #e5e1da;
    background: #faf8f4;
    font-size: 13px;
    color: #4b5563;
    flex-wrap: wrap;
}
.esm-cards-container .esm-pagination {
    margin-top: 14px;
    border: 1px solid #e5e1da;
    border-radius: 10px;
}
.esm-page-size { display: flex; align-items: center; gap: 6px; }
.esm-page-size select {
    padding: 5px 8px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 13px;
    background: #fff;
    cursor: pointer;
}
.esm-page-info { color: #6b7280; }
.esm-page-nav { display: flex; gap: 6px; }
.esm-page-btn {
    padding: 6px 12px;
    border: 1px solid #d1d5db;
    background: #fff;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12.5px;
    color: #374151;
    transition: all 140ms;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}
.esm-page-btn:hover:not(:disabled) { border-color: #1E6332; color: #1E6332; background: #F4F0E9; }
.esm-page-btn:disabled { opacity: 0.45; cursor: not-allowed; }

/* ────────────────────── LOADING / EMPTY STATES ────────────────────── */
.esm-loading {
    text-align: center;
    padding: 80px 24px;
}
.esm-loading-text { color: #6b7280; margin-top: 14px; font-size: 14px; }

.esm-empty {
    text-align: center;
    padding: 80px 24px;
    background: #fff;
    border: 1px dashed #e5e1da;
    border-radius: 14px;
}
.esm-empty-icon {
    width: 72px;
    height: 72px;
    margin: 0 auto 16px;
    background: linear-gradient(135deg, #F4F0E9, #e8dfd0);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    color: #C19A6B;
}
.esm-empty-title { font-size: 18px; color: #214A3E; margin: 0 0 6px; font-weight: 600; }
.esm-empty-text { color: #6b7280; font-size: 13.5px; max-width: 380px; margin: 0 auto; line-height: 1.5; }

/* ────────────────────── RECALL CONFIRMATION MODAL ────────────────────── */
.esm-recall-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 30, 22, 0.55);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 10200;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: esmFadeIn 160ms ease-out;
}
@keyframes esmFadeIn { from { opacity: 0; } to { opacity: 1; } }
.esm-recall-modal {
    background: #fff;
    border-radius: 14px;
    width: 100%;
    max-width: 560px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: esmModalIn 200ms cubic-bezier(0.2, 0.9, 0.3, 1.1);
}
@keyframes esmModalIn {
    from { opacity: 0; transform: translateY(10px) scale(0.97); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}
.esm-recall-header {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px 20px;
    background: linear-gradient(135deg, #dc2626, #991b1b);
    color: #fff;
}
.esm-recall-header-icon {
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.18);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
}
.esm-recall-title { font-size: 16px; font-weight: 700; line-height: 1.2; }
.esm-recall-sub { font-size: 12.5px; opacity: 0.9; margin-top: 2px; }
.esm-recall-close {
    margin-left: auto;
    background: rgba(255, 255, 255, 0.15);
    border: none;
    color: #fff;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    font-size: 20px;
    cursor: pointer;
}
.esm-recall-body {
    padding: 20px;
    overflow-y: auto;
    color: #1f2937;
    font-size: 14px;
    line-height: 1.55;
}
.esm-recall-intro { margin: 0 0 14px; color: #374151; }
.esm-recall-list {
    max-height: 180px;
    overflow-y: auto;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 10px 14px;
    margin-bottom: 16px;
}
.esm-recall-list-item {
    padding: 6px 0;
    font-size: 13px;
    color: #374151;
    border-bottom: 1px dashed #e5e7eb;
}
.esm-recall-list-item:last-child { border-bottom: none; }
.esm-recall-list-item b { color: #214A3E; }
.esm-recall-reason-label {
    font-size: 13px;
    font-weight: 600;
    color: #374151;
    margin-bottom: 6px;
    display: block;
}
.esm-recall-reason-label .required { color: #dc2626; }
.esm-recall-reason {
    width: 100%;
    min-height: 80px;
    padding: 10px 12px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-family: inherit;
    font-size: 13.5px;
    resize: vertical;
    transition: border-color 140ms, box-shadow 140ms;
}
.esm-recall-reason:focus {
    outline: none;
    border-color: #1E6332;
    box-shadow: 0 0 0 3px rgba(30, 99, 50, 0.1);
}
.esm-recall-reason.error {
    border-color: #dc2626;
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.08);
}
.esm-recall-reason-hint { font-size: 11.5px; color: #6b7280; margin-top: 4px; }
.esm-recall-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 14px 20px;
    background: #faf8f4;
    border-top: 1px solid #e5e7eb;
}
.esm-recall-btn {
    padding: 9px 18px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    font-family: inherit;
    transition: transform 120ms, box-shadow 120ms, background 120ms;
}
.esm-recall-btn-cancel {
    background: #fff;
    color: #374151;
    border: 1px solid #d1d5db;
}
.esm-recall-btn-cancel:hover { background: #f3f4f6; }
.esm-recall-btn-confirm {
    background: linear-gradient(135deg, #dc2626, #991b1b);
    color: #fff;
    box-shadow: 0 2px 6px rgba(220, 38, 38, 0.3);
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.esm-recall-btn-confirm:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(220, 38, 38, 0.4);
}
.esm-recall-btn-confirm:disabled { opacity: 0.6; cursor: not-allowed; }

/* Bulk-recall progress bar (shown while sequentially recalling N items) */
.esm-recall-progress {
    margin: 12px 0 4px;
    padding: 12px 14px;
    background: #F4F0E9;
    border: 1px solid #e5e1da;
    border-radius: 8px;
    font-size: 13px;
    color: #214A3E;
}
.esm-recall-progress-bar {
    height: 6px;
    background: #e5e7eb;
    border-radius: 3px;
    overflow: hidden;
    margin-top: 8px;
}
.esm-recall-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #1E6332, #2F8542);
    transition: width 200ms;
}

/* ────────────────────── RESPONSIVE ────────────────────── */
@media (max-width: 900px) {
    .esm-filter-top { flex-wrap: wrap; }
    .esm-search-box { flex: 1 1 100%; }
    .esm-filter-actions { flex: 1 1 100%; justify-content: flex-end; }
}
/* Mobile handled separately — module is primarily desktop-focused */
