/* Inbox notification icon (top bar) */
.inbox-icon-wrap {
    position: relative;
    display: inline-flex;
    align-items: center;
    cursor: pointer;
    margin-left: 0.75rem;
    padding: 0.25rem 0.5rem;
    border: 1px solid rgba(255, 255, 255, 0.45);
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.25);
}

.inbox-icon {
    font-size: 1.2rem;
    color: #ffffff;
    opacity: 1;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.55);
}

.inbox-icon-wrap:hover .inbox-icon {
    opacity: 1;
}

.inbox-icon-wrap:hover {
    background: rgba(0, 0, 0, 0.4);
    border-color: rgba(255, 255, 255, 0.65);
}

.inbox-badge {
    position: absolute;
    top: -2px;
    right: -2px;
    background: #dc3545;
    color: #fff;
    font-size: 0.65rem;
    font-weight: 700;
    min-width: 16px;
    height: 16px;
    line-height: 16px;
    text-align: center;
    border-radius: 8px;
    padding: 0 4px;
    pointer-events: none;
}

/* Inbox dropdown */
.inbox-dropdown-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1100;
    background: transparent;
}

.inbox-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    z-index: 1101;
    width: 340px;
    max-height: 400px;
    background: #fff;
    color: #333;
    border: 1px solid #ddd;
    border-radius: 6px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
    overflow: hidden;
}

.inbox-dropdown__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #eee;
    font-size: 0.9rem;
}

.inbox-dropdown__viewall {
    font-size: 0.8rem;
    color: #0d6efd;
    text-decoration: none;
}

.inbox-dropdown__list {
    max-height: 320px;
    overflow-y: auto;
}

.inbox-dropdown__item {
    display: flex;
    flex-direction: column;
    padding: 0.6rem 1rem;
    border-bottom: 1px solid #f5f5f5;
    text-decoration: none;
    color: #333;
    gap: 2px;
}

.inbox-dropdown__item:hover {
    background: #f8f9fa;
}

.inbox-dropdown__item--unread {
    background: #f0f5ff;
    font-weight: 600;
}

.inbox-dropdown__item--unread:hover {
    background: #e8effc;
}

.inbox-dropdown__subject {
    font-size: 0.85rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.inbox-dropdown__date {
    font-size: 0.75rem;
    color: #888;
    font-weight: 400;
}

.inbox-dropdown__loading,
.inbox-dropdown__empty {
    padding: 1.5rem 1rem;
    text-align: center;
    color: #888;
    font-size: 0.85rem;
}

/* Inbox page */
.inbox-page {
    padding: 1.5rem;
    height: 100%;
}

.inbox-page__layout {
    display: grid;
    grid-template-columns: 360px 1fr;
    gap: 1.5rem;
    height: calc(100vh - 120px);
}

.inbox-page__list-panel {
    border: 1px solid #dee2e6;
    border-radius: 6px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.inbox-page__list-header {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #dee2e6;
    background: #f8f9fa;
}

.inbox-page__list-header h2 {
    margin: 0;
    font-size: 1.1rem;
}

.inbox-page__list {
    flex: 1 1 auto;
    overflow-y: auto;
}

.inbox-page__list-item {
    display: flex;
    flex-direction: column;
    padding: 0.6rem 1rem;
    border-bottom: 1px solid #f0f0f0;
    text-decoration: none;
    color: #333;
    gap: 2px;
}

.inbox-page__list-item:hover {
    background: #f8f9fa;
}

.inbox-page__list-item--unread {
    background: #f0f5ff;
    font-weight: 600;
}

.inbox-page__list-item--selected {
    background: #e2e6ea;
    border-left: 3px solid #0d6efd;
}

.inbox-page__list-subject {
    font-size: 0.85rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.inbox-page__list-meta {
    font-size: 0.75rem;
    color: #888;
    font-weight: 400;
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.inbox-page__badge-global {
    display: inline-block;
    font-size: 0.65rem;
    background: #6c757d;
    color: #fff;
    padding: 1px 6px;
    border-radius: 3px;
    font-weight: 600;
    text-transform: uppercase;
}

.inbox-page__detail-panel {
    border: 1px solid #dee2e6;
    border-radius: 6px;
    overflow-y: auto;
    padding: 1.5rem;
}

.inbox-page__detail-subject {
    margin-top: 0;
    font-size: 1.3rem;
}

.inbox-page__detail-meta {
    display: flex;
    gap: 1rem;
    font-size: 0.85rem;
    color: #666;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid #eee;
}

.inbox-page__detail-attachment {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    margin-bottom: 1rem;
    background: #f8f9fa;
    border-radius: 4px;
    font-size: 0.85rem;
}

.inbox-page__detail-body {
    line-height: 1.6;
    font-size: 0.9rem;
}

.inbox-page__detail-actions {
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid #eee;
}

.inbox-page__loading,
.inbox-page__empty {
    padding: 2rem 1rem;
    text-align: center;
    color: #888;
}

/* Admin compose page */
.inbox-admin-page {
    padding: 1.5rem;
    max-width: 900px;
}

.inbox-admin-page__hint {
    color: #666;
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
}

.inbox-admin-page__form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 2rem;
}

.inbox-admin-page__field {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.inbox-admin-page__field label {
    font-weight: 600;
    font-size: 0.85rem;
}

.inbox-admin-page__body-editor {
    font-family: 'Consolas', 'Courier New', monospace;
    font-size: 0.85rem;
}

.inbox-admin-page__preview {
    border: 1px solid #dee2e6;
    border-radius: 4px;
    padding: 1rem;
    background: #fff;
    min-height: 80px;
    font-size: 0.9rem;
    line-height: 1.6;
}

.inbox-admin-page__audience-toggle {
    display: flex;
    gap: 1.5rem;
}

.inbox-admin-page__file-name {
    font-size: 0.8rem;
    color: #555;
}

.inbox-admin-page__actions {
    padding-top: 0.5rem;
}

.inbox-admin-page__status {
    padding: 0.5rem 0.75rem;
    border-radius: 4px;
    margin-bottom: 1rem;
    background: #d1e7dd;
    color: #0f5132;
    font-size: 0.85rem;
}

.inbox-admin-page__status--error {
    background: #f8d7da;
    color: #842029;
}

.inbox-admin-page__sent-title {
    margin-top: 2rem;
    font-size: 1.1rem;
    border-top: 1px solid #dee2e6;
    padding-top: 1rem;
}

.inbox-admin-page__sent-table {
    font-size: 0.85rem;
}
