.app-nav-icon--internal-mail {
    position: relative;
    overflow: visible;
}

.app-nav-unread-badge {
    position: absolute;
    inset-block-start: -7px;
    inset-inline-start: -8px;
    z-index: 1;
    min-width: 18px;
    height: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    color: #ffffff;
    background: #dc2626;
    border: 2px solid var(--app-surface-solid, #ffffff);
    border-radius: 999px;
    box-shadow: 0 3px 8px rgba(185, 28, 28, .32);
    direction: ltr;
    font-size: .58rem;
    font-weight: 950;
    line-height: 1;
    pointer-events: none;
    unicode-bidi: isolate;
}

.internal-mail-dashboard-notification {
    --imdn-surface: var(--app-surface-solid, #ffffff);
    --imdn-surface-soft: var(--app-bg, #f8fafc);
    --imdn-text: var(--app-text, #172033);
    --imdn-heading: var(--app-heading, #111827);
    --imdn-muted: var(--app-muted, #64748b);
    --imdn-border: var(--app-border, #e5eaf1);
    --imdn-border-soft: var(--app-border-soft, #eef2f7);
    --imdn-primary: var(--app-primary, #2563eb);
    --imdn-primary-soft: var(--app-primary-soft, #eff6ff);
    --imdn-primary-border: var(--app-primary-border, #bfdbfe);
    --imdn-shadow: var(--app-shadow-soft, 0 12px 30px rgba(15, 23, 42, .07));
    --imdn-loading-overlay: rgba(255, 255, 255, .9);
    position: relative;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    min-height: 350px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    color: var(--imdn-text);
    background:
        radial-gradient(circle at top right, rgba(37, 99, 235, .065), transparent 32%),
        var(--imdn-surface);
    border: 1px solid var(--imdn-border);
    border-radius: 22px;
    box-shadow: var(--imdn-shadow);
}

.internal-mail-dashboard-notification[aria-busy="true"] {
    cursor: progress;
}

.internal-mail-dashboard-notification[aria-busy="true"]::after {
    content: "در حال بارگذاری…";
    position: absolute;
    inset: 0;
    z-index: 3;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--imdn-muted);
    background: var(--imdn-loading-overlay);
    font-size: .86rem;
    font-weight: 800;
}

.internal-mail-dashboard-notification__header {
    min-height: 76px;
    min-width: 0;
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 14px 18px;
    border-bottom: 1px solid var(--imdn-border-soft);
    background: rgba(248, 250, 252, .78);
}

.internal-mail-dashboard-notification__heading-wrap {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 11px;
}

.internal-mail-dashboard-notification__icon {
    width: 42px;
    height: 42px;
    flex: 0 0 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    background: linear-gradient(135deg, var(--imdn-primary), #0ea5e9);
    border-radius: 15px;
    box-shadow: 0 9px 20px rgba(37, 99, 235, .18);
    font-size: 1.05rem;
    font-weight: 900;
}

.internal-mail-dashboard-notification__heading-text {
    min-width: 0;
}

.internal-mail-dashboard-notification__kicker {
    display: block;
    margin-bottom: 2px;
    color: var(--imdn-muted);
    font-size: .72rem;
    font-weight: 800;
}

.internal-mail-dashboard-notification__heading-text h2 {
    margin: 0;
    overflow: hidden;
    color: var(--imdn-heading);
    font-size: 1rem;
    font-weight: 900;
    line-height: 1.55;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.internal-mail-dashboard-notification__owner {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 3px;
    overflow: hidden;
    color: var(--imdn-muted);
    font-size: .7rem;
    font-weight: 700;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.internal-mail-dashboard-notification__owner > span:last-child {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.internal-mail-dashboard-notification__readonly-badge {
    flex: 0 0 auto;
    padding: 2px 7px;
    color: #075985;
    background: #e0f2fe;
    border: 1px solid #bae6fd;
    border-radius: 999px;
    font-size: .66rem;
    font-weight: 900;
}

.internal-mail-dashboard-notification__counts {
    min-width: 62px;
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 7px 10px;
    color: var(--imdn-primary);
    background: var(--imdn-primary-soft);
    border: 1px solid var(--imdn-primary-border);
    border-radius: 15px;
}

.internal-mail-dashboard-notification__counts strong {
    color: inherit;
    font-size: 1.22rem;
    font-weight: 950;
    line-height: 1;
}

.internal-mail-dashboard-notification__counts span {
    margin-top: 4px;
    color: inherit;
    font-size: .66rem;
    font-weight: 800;
    white-space: nowrap;
}

.internal-mail-dashboard-notification__list {
    width: 100%;
    max-width: 100%;
    min-height: 0;
    flex: 1 1 auto;
    margin: 0;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 9px 11px;
    scrollbar-gutter: stable;
    scrollbar-width: thin;
    list-style: none;
}

.internal-mail-dashboard-notification__list::-webkit-scrollbar {
    width: 7px;
}

.internal-mail-dashboard-notification__list::-webkit-scrollbar-track {
    background: var(--imdn-surface-soft);
    border-radius: 999px;
}

.internal-mail-dashboard-notification__list::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border: 2px solid var(--imdn-surface-soft);
    border-radius: 999px;
}

html[data-theme="dark"] .internal-mail-dashboard-notification__list::-webkit-scrollbar-thumb {
    background: rgba(148, 163, 184, .58);
}

.internal-mail-dashboard-notification__item-container {
    width: 100%;
    max-width: 100%;
    min-width: 0;
}

.internal-mail-dashboard-notification__item {
    position: relative;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    display: block;
    overflow: hidden;
    padding: 9px 11px;
    color: var(--imdn-text);
    background: var(--imdn-surface);
    border: 1px solid transparent;
    border-bottom-color: var(--imdn-border-soft);
    border-radius: 12px;
    text-decoration: none;
    transition: transform .15s ease, border-color .15s ease, background-color .15s ease, box-shadow .15s ease;
}

.internal-mail-dashboard-notification__item-container:last-child .internal-mail-dashboard-notification__item {
    border-bottom-color: transparent;
}

.internal-mail-dashboard-notification__item::before {
    content: "";
    position: absolute;
    top: 13px;
    right: 0;
    bottom: 13px;
    width: 3px;
    background: var(--imdn-primary);
    border-radius: 999px 0 0 999px;
}

.internal-mail-dashboard-notification__item:hover,
.internal-mail-dashboard-notification__item:focus {
    color: var(--imdn-text);
    background: var(--imdn-primary-soft);
    border-color: var(--imdn-primary-border);
    box-shadow: 0 8px 18px rgba(15, 23, 42, .06);
    text-decoration: none;
    transform: translateY(-1px);
}

.internal-mail-dashboard-notification__item:focus {
    outline: 2px solid var(--imdn-primary);
    outline-offset: 2px;
}

.internal-mail-dashboard-notification__item-topline {
    min-width: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 2px;
}

.internal-mail-dashboard-notification__sender {
    min-width: 0;
    overflow: hidden;
    color: var(--imdn-muted);
    font-size: .74rem;
    font-weight: 800;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.internal-mail-dashboard-notification__item time {
    flex: 0 0 auto;
    color: var(--imdn-muted);
    font-size: .66rem;
    font-weight: 700;
    white-space: nowrap;
}

.internal-mail-dashboard-notification__subject {
    display: block;
    overflow: hidden;
    color: var(--imdn-heading);
    font-size: .88rem;
    font-weight: 900;
    line-height: 1.55;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.internal-mail-dashboard-notification__preview {
    display: -webkit-box;
    margin: 1px 0 0;
    overflow: hidden;
    color: var(--imdn-muted);
    font-size: .75rem;
    line-height: 1.55;
    overflow-wrap: anywhere;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 1;
}

.internal-mail-dashboard-notification__meta {
    min-height: 20px;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 5px;
}

.internal-mail-dashboard-notification__meta:empty {
    display: none;
}

.internal-mail-dashboard-notification__meta-badge {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 2px 7px;
    color: #475569;
    background: #f8fafc;
    border: 1px solid var(--imdn-border-soft);
    border-radius: 999px;
    font-size: .64rem;
    font-weight: 800;
    white-space: nowrap;
}

.internal-mail-dashboard-notification__meta-badge--important {
    color: #92400e;
    background: #fffbeb;
    border-color: #fde68a;
}

.internal-mail-dashboard-notification__meta-badge--aged {
    color: #9a3412;
    background: #fff7ed;
    border-color: #fed7aa;
}

.internal-mail-dashboard-notification__state {
    min-height: 175px;
    flex: 1 1 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin: 12px;
    padding: 18px;
    color: var(--imdn-muted);
    background: var(--imdn-surface-soft);
    border: 1px dashed var(--imdn-border);
    border-radius: 17px;
}

.internal-mail-dashboard-notification__state strong {
    display: block;
    margin-bottom: 4px;
    color: var(--imdn-heading);
    font-size: .9rem;
    font-weight: 900;
}

.internal-mail-dashboard-notification__state p {
    margin: 0;
    font-size: .76rem;
    line-height: 1.75;
}

.internal-mail-dashboard-notification__state-icon {
    width: 38px;
    height: 38px;
    flex: 0 0 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #047857;
    background: #ecfdf5;
    border-radius: 50%;
    font-weight: 950;
}

.internal-mail-dashboard-notification__state--error .internal-mail-dashboard-notification__state-icon {
    color: #b91c1c;
    background: #fef2f2;
}

.internal-mail-dashboard-notification__footer {
    min-height: 49px;
    min-width: 0;
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    margin-top: auto;
    padding: 10px 16px;
    border-top: 1px solid var(--imdn-border-soft);
    background: rgba(248, 250, 252, .72);
}

.internal-mail-dashboard-notification__inbox-link,
.internal-mail-dashboard-notification__retry {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--imdn-primary);
    font-size: .76rem;
    font-weight: 900;
    text-decoration: none;
}

.internal-mail-dashboard-notification__retry {
    margin-left: auto;
    color: var(--imdn-muted);
}

.internal-mail-dashboard-notification__inbox-link:hover,
.internal-mail-dashboard-notification__retry:hover {
    color: var(--imdn-heading);
    text-decoration: none;
}

.internal-mail-dashboard-notification__inbox-link:focus,
.internal-mail-dashboard-notification__retry:focus {
    outline: 2px solid var(--imdn-primary);
    outline-offset: 3px;
    border-radius: 4px;
}

.internal-mail-dashboard-notification--employee {
    height: 400px;
    min-height: 400px;
    max-height: 400px;
    border-radius: 22px;
}

.internal-mail-dashboard-notification--manager {
    min-height: 250px;
    border-radius: var(--app-radius, 22px);
}

.internal-mail-dashboard-notification--administrative {
    min-height: 335px;
    margin-bottom: 1rem;
    border-radius: 16px;
}

.internal-mail-dashboard-notification--issuance {
    height: 300px;
    min-height: 300px;
    max-height: 300px;
    border-radius: 21px;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, .94),
        0 14px 34px rgba(15, 23, 42, .06);
}

.internal-mail-dashboard-notification--supervisor {
    width: 100%;
    max-width: 760px;
    min-height: 335px;
    margin-top: 1rem;
}

html[data-theme="dark"] .internal-mail-dashboard-notification {
    --imdn-surface: #111827;
    --imdn-surface-soft: #0f172a;
    --imdn-text: #e5e7eb;
    --imdn-heading: #f8fafc;
    --imdn-muted: #a6b0c1;
    --imdn-border: rgba(255, 255, 255, .12);
    --imdn-border-soft: rgba(255, 255, 255, .08);
    --imdn-primary: #60a5fa;
    --imdn-primary-soft: rgba(37, 99, 235, .18);
    --imdn-primary-border: rgba(96, 165, 250, .32);
    --imdn-shadow: 0 16px 38px rgba(0, 0, 0, .25);
    --imdn-loading-overlay: rgba(17, 24, 39, .92);
    background:
        radial-gradient(circle at top right, rgba(96, 165, 250, .10), transparent 34%),
        var(--imdn-surface);
}

html[data-theme="dark"] .internal-mail-dashboard-notification__header,
html[data-theme="dark"] .internal-mail-dashboard-notification__footer {
    background: rgba(15, 23, 42, .72);
}

html[data-theme="dark"] .internal-mail-dashboard-notification__meta-badge {
    color: #cbd5e1;
    background: rgba(255, 255, 255, .055);
}

html[data-theme="dark"] .internal-mail-dashboard-notification__meta-badge--important {
    color: #fde68a;
    background: rgba(245, 158, 11, .13);
    border-color: rgba(245, 158, 11, .30);
}

html[data-theme="dark"] .internal-mail-dashboard-notification__meta-badge--aged {
    color: #fdba74;
    background: rgba(234, 88, 12, .13);
    border-color: rgba(251, 146, 60, .28);
}

html[data-theme="dark"] .internal-mail-dashboard-notification__readonly-badge {
    color: #bae6fd;
    background: rgba(14, 165, 233, .13);
    border-color: rgba(56, 189, 248, .28);
}

@media (min-width: 1200px) {
    .internal-mail-dashboard-notification--manager .internal-mail-dashboard-notification__list {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 10px;
        padding: 12px 14px;
    }

    .internal-mail-dashboard-notification--manager .internal-mail-dashboard-notification__item {
        height: 100%;
        border: 1px solid var(--imdn-border-soft);
        border-radius: 14px;
    }
}

@media (max-width: 991.98px) {
    .internal-mail-dashboard-notification,
    .internal-mail-dashboard-notification--employee,
    .internal-mail-dashboard-notification--administrative,
    .internal-mail-dashboard-notification--issuance,
    .internal-mail-dashboard-notification--supervisor {
        width: 100%;
        height: auto;
        min-height: 340px;
        max-width: none;
    }

    .internal-mail-dashboard-notification--employee {
        height: 380px;
        min-height: 380px;
        max-height: 380px;
    }

    .internal-mail-dashboard-notification--issuance {
        height: 340px;
        min-height: 340px;
        max-height: 340px;
    }
}

@media (max-width: 575.98px) {
    .internal-mail-dashboard-notification {
        min-height: 0;
        border-radius: 18px;
    }

    .internal-mail-dashboard-notification--employee {
        height: 360px;
        min-height: 360px;
        max-height: 360px;
    }

    .internal-mail-dashboard-notification--issuance {
        height: 340px;
        min-height: 340px;
        max-height: 340px;
    }

    .internal-mail-dashboard-notification__header {
        min-height: 72px;
        padding: 12px 13px;
    }

    .internal-mail-dashboard-notification__icon {
        width: 38px;
        height: 38px;
        flex-basis: 38px;
        border-radius: 13px;
    }

    .internal-mail-dashboard-notification__heading-text h2 {
        font-size: .92rem;
    }

    .internal-mail-dashboard-notification__counts {
        min-width: 54px;
        padding: 6px 8px;
    }

    .internal-mail-dashboard-notification__counts strong {
        font-size: 1.1rem;
    }

    .internal-mail-dashboard-notification__list {
        padding: 8px;
    }

    .internal-mail-dashboard-notification__item {
        min-height: 44px;
        padding: 10px;
    }

    .internal-mail-dashboard-notification__preview {
        -webkit-line-clamp: 2;
    }

    .internal-mail-dashboard-notification__footer {
        min-height: 52px;
        align-items: stretch;
        flex-direction: column-reverse;
        justify-content: center;
        gap: 8px;
    }

    .internal-mail-dashboard-notification__inbox-link,
    .internal-mail-dashboard-notification__retry {
        min-height: 32px;
        justify-content: center;
        margin: 0;
    }

    .internal-mail-dashboard-notification__state {
        min-height: 160px;
        margin: 10px;
        padding: 16px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .internal-mail-dashboard-notification__item {
        transition: none;
    }
}
