/* recent-items.css — "Recent Items" jump-back panel (Zoho-CRM-style) */

.ri-wrap {
    position: relative;
    display: inline-flex;
}

.ri-panel {
    position: fixed;
    width: 360px;
    max-width: calc(100vw - 16px);
    max-height: min(720px, calc(100vh - 76px));
    background: #fff;
    border: 1px solid #e6e2da;
    border-radius: 14px;
    box-shadow: 0 18px 50px rgba(0, 0, 0, 0.22);
    z-index: 10100;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.ri-panel-in {
    animation: riPanelIn 0.16s ease-out;
}
@keyframes riPanelIn {
    from { opacity: 0; transform: translateY(-6px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* Header (green branded bar) */
.ri-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 14px;
    background: linear-gradient(135deg, #1E6332, #214A3E);
    color: #fff;
    flex-shrink: 0;
}
.ri-head-title {
    font-size: 14px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}
.ri-head-actions {
    display: flex;
    align-items: center;
    gap: 2px;
}
.ri-head-btn {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.82);
    width: 28px;
    height: 28px;
    border-radius: 7px;
    cursor: pointer;
    font-size: 13px;
    transition: background 0.15s, color 0.15s;
}
.ri-head-btn:hover {
    background: rgba(255, 255, 255, 0.16);
    color: #fff;
}

/* Body (scrollable list) */
.ri-body {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 6px;
}

/* List item */
.ri-item {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 9px 10px;
    border-radius: 10px;
    cursor: pointer;
    transition: background 0.13s;
}
.ri-item:hover,
.ri-item:focus {
    background: #f4f0e9;
    outline: none;
}
.ri-icon {
    width: 34px;
    height: 34px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    color: #fff;
    flex-shrink: 0;
}
.ri-icon.ri-claim    { background: linear-gradient(135deg, #1E6332, #2F8542); }
.ri-icon.ri-deceased { background: linear-gradient(135deg, #214A3E, #2F8542); }
.ri-icon.ri-account  { background: linear-gradient(135deg, #6B4A28, #C19A6B); }
.ri-icon.ri-draft    { background: linear-gradient(135deg, #d97706, #f59e0b); }
.ri-icon.ri-message  { background: linear-gradient(135deg, #2563eb, #3b82f6); }
.ri-icon.ri-esign    { background: linear-gradient(135deg, #1E6332, #2F8542); }

/* Date group header */
.ri-group {
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    color: #b0aa9c;
    padding: 11px 12px 4px;
}
.ri-group:first-child { padding-top: 5px; }

/* Type tag (Claim / Draft / Location / Message / E-Sign / Decedent) */
.ri-type-chip {
    display: inline-block;
    font-size: 9px;
    font-weight: 700;
    line-height: 1.5;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    padding: 1px 6px;
    border-radius: 5px;
    margin-right: 6px;
    vertical-align: middle;
}

/* Claim status pill inside the sub-line */
.ri-pill {
    display: inline-block;
    font-size: 9.5px;
    font-weight: 700;
    line-height: 1.4;
    padding: 1px 7px;
    border-radius: 999px;
    margin-right: 6px;
    vertical-align: middle;
    text-transform: uppercase;
    letter-spacing: 0.2px;
}
.ri-pill-inprocess { background: #fef3c7; color: #92400e; }
.ri-pill-funded    { background: #d1f0db; color: #166534; }
.ri-pill-closed    { background: #dbeafe; color: #1e40af; }
.ri-pill-withdrawn { background: #fde2e2; color: #991b1b; }
.ri-sub-text { vertical-align: middle; }

.ri-text {
    flex: 1;
    min-width: 0;
}
.ri-name {
    font-size: 13.5px;
    font-weight: 600;
    color: #1a1a1a;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.ri-sub {
    font-size: 11.5px;
    color: #8a8576;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    margin-top: 1px;
}
.ri-time {
    font-size: 11px;
    color: #b0aa9c;
    flex-shrink: 0;
    white-space: nowrap;
}
.ri-arrow {
    font-size: 11px;
    color: #d4cfc4;
    flex-shrink: 0;
    transition: transform 0.13s, color 0.13s;
}
.ri-item:hover .ri-arrow {
    color: #1E6332;
    transform: translateX(2px);
}

/* Loading + empty states */
.ri-loading,
.ri-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 40px 20px;
    color: #9a9484;
    text-align: center;
}
.ri-loading { flex-direction: row; gap: 10px; font-size: 13px; }
.ri-empty i { font-size: 30px; color: #d4cfc4; }
.ri-empty p { margin: 0; font-size: 13px; line-height: 1.5; max-width: 240px; }
.ri-spinner {
    width: 22px;
    height: 22px;
    border: 2.5px solid #d8e6dc;
    border-top-color: #1E6332;
    border-radius: 50%;
    animation: progressSpin 0.8s linear infinite;
}

/* Footer */
.ri-foot {
    flex-shrink: 0;
    border-top: 1px solid #efece5;
    padding: 9px 14px;
    background: #faf8f4;
}
.ri-foot-link {
    font-size: 12.5px;
    font-weight: 600;
    color: #1E6332;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.ri-foot-link:hover { text-decoration: underline; }

/* Dark theme */
body.dark-theme .ri-panel { background: var(--theme-surface) !important; border-color: var(--theme-border) !important; }
body.dark-theme .ri-name { color: var(--theme-text) !important; }
body.dark-theme .ri-sub { color: var(--theme-text-secondary) !important; }
body.dark-theme .ri-item:hover,
body.dark-theme .ri-item:focus { background: var(--theme-surface-alt) !important; }
body.dark-theme .ri-foot { background: var(--theme-surface-alt) !important; border-color: var(--theme-border) !important; }
body.dark-theme .ri-empty p,
body.dark-theme .ri-loading,
body.dark-theme .ri-group { color: var(--theme-text-secondary) !important; }

/* Mobile — bottom sheet */
@media (max-width: 768px) {
    .ri-panel {
        position: fixed !important;
        top: auto !important;
        right: 0 !important;
        left: 0 !important;
        bottom: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
        max-height: 80vh;
        border-radius: 18px 18px 0 0;
    }
    .ri-panel-in { animation: riSheetIn 0.2s ease-out; }
    @keyframes riSheetIn {
        from { transform: translateY(100%); }
        to   { transform: translateY(0); }
    }
    .ri-foot { padding-bottom: calc(9px + env(safe-area-inset-bottom)); }
}
