.adminEmailsContent {
    display: flex;
    flex-direction: column;
    gap: 22px;
    padding: 0 28px 34px;
}

.emailStatGrid {
    display: grid;
    gap: 14px;
    grid-template-columns: repeat(4, minmax(160px, 1fr));
}

.emailStat {
    align-items: center;
    background: #fff;
    border: 1px solid var(--cx-border);
    border-radius: 16px;
    box-shadow: var(--cx-shadow);
    display: flex;
    justify-content: space-between;
    min-height: 98px;
    padding: 17px;
}

.emailStat strong {
    display: block;
    font-size: 26px;
    letter-spacing: -0.04em;
    line-height: 1;
}

.emailStat span,
.emailStat small {
    color: var(--cx-muted);
    display: block;
    font-size: 12px;
    margin-top: 6px;
}

.emailStat small { margin-top: 2px; }

.emailStat i {
    align-items: center;
    background: #f2eee8;
    border-radius: 11px;
    color: var(--cx-brand-dark);
    display: inline-flex;
    height: 36px;
    justify-content: center;
    width: 36px;
}

.emailMainGrid,
.emailOperationsGrid {
    display: grid;
    gap: 22px;
    grid-template-columns: minmax(0, 1.2fr) minmax(340px, 0.8fr);
}

.emailPanel {
    background: #fff;
    border: 1px solid var(--cx-border);
    border-radius: 16px;
    box-shadow: var(--cx-shadow);
    min-width: 0;
    overflow: hidden;
}

.emailPanelHeader {
    align-items: center;
    border-bottom: 1px solid var(--cx-border);
    display: flex;
    gap: 16px;
    justify-content: space-between;
    min-height: 64px;
    padding: 14px 16px;
}

.emailPanelHeader h4 {
    font-size: 16px;
    font-weight: 700;
    margin: 0 0 4px;
}

.emailPanelHeader p {
    color: var(--cx-muted);
    font-size: 12px;
    margin: 0;
}

.emailComposer {
    display: grid;
    gap: 14px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    padding: 16px;
}

.emailField {
    color: var(--cx-muted);
    display: flex;
    flex-direction: column;
    font-size: 12px;
    font-weight: 700;
    gap: 6px;
    margin: 0;
    min-width: 0;
}

.emailFieldFull { grid-column: 1 / -1; }
.emailTextarea { min-height: 150px; resize: vertical; }

.emailTargetPicker {
    position: relative;
}

.emailTargetResults {
    background: #fff;
    border: 1px solid var(--cx-border);
    border-radius: 8px;
    box-shadow: 0 14px 30px rgba(44, 37, 29, 0.16);
    display: none;
    left: 0;
    max-height: 240px;
    overflow: auto;
    position: absolute;
    right: 0;
    top: calc(100% + 4px);
    z-index: 1100;
}

.emailTargetResult {
    background: #fff;
    border: 0;
    border-bottom: 1px solid #eee8e0;
    color: var(--cx-ink);
    display: block;
    padding: 10px 12px;
    text-align: left;
    width: 100%;
}

.emailTargetResult:last-child { border-bottom: 0; }
.emailTargetResult:hover { background: var(--cx-panel-soft); }
.emailTargetResult strong,
.emailTargetResult small { display: block; }
.emailTargetResult small { color: var(--cx-muted); font-size: 11px; margin-top: 3px; }

.emailAudiencePreview {
    background: var(--cx-panel-soft);
    border: 1px solid var(--cx-border);
    border-radius: 12px;
    grid-column: 1 / -1;
    min-height: 62px;
    padding: 12px;
}

.emailAudiencePreview strong,
.emailAudiencePreview span {
    display: block;
}

.emailAudiencePreview span {
    color: var(--cx-muted);
    font-size: 12px;
    margin-top: 4px;
}

.emailComposerActions {
    align-items: center;
    border-top: 1px solid var(--cx-border);
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    grid-column: 1 / -1;
    justify-content: flex-end;
    margin: 2px -16px -16px;
    padding: 12px 16px;
}

.emailConfirmLabel {
    align-items: center;
    color: var(--cx-muted);
    display: flex;
    font-size: 12px;
    font-weight: 400;
    gap: 7px;
    margin: 0 auto 0 0;
}

.emailConfirmLabel input { height: 17px; width: 17px; }

.emailPreviewCard {
    background: #f3f0eb;
    padding: 18px;
}

.emailPreviewMessage {
    background: #fff;
    border: 1px solid #ddd6cd;
    border-radius: 11px;
    margin: 0 auto;
    max-width: 520px;
    overflow: hidden;
}

.emailPreviewBrand {
    align-items: center;
    background: #302e2c;
    color: #fff;
    display: flex;
    font-size: 17px;
    font-weight: 700;
    gap: 9px;
    padding: 15px 18px;
}

.emailPreviewMark {
    align-items: center;
    background: #b29a79;
    border-radius: 7px;
    display: inline-flex;
    font-size: 11px;
    height: 28px;
    justify-content: center;
    width: 28px;
}

.emailPreviewBody { padding: 22px; }
.emailPreviewBody small { color: var(--cx-brand-dark); font-weight: 700; text-transform: uppercase; }
.emailPreviewBody h5 { font-size: 21px; margin: 8px 0 14px; }
.emailPreviewCopy { color: #443f39; font-size: 14px; line-height: 1.5; white-space: pre-line; }
.emailPreviewAction { margin-top: 16px; }

.emailHistoryList,
.emailTesterList {
    display: flex;
    flex-direction: column;
}

.emailHistoryRow,
.emailTesterRow {
    align-items: center;
    border-bottom: 1px solid #e9e2d8;
    display: flex;
    gap: 14px;
    justify-content: space-between;
    min-height: 64px;
    padding: 11px 16px;
}

.emailHistoryRow:last-child,
.emailTesterRow:last-child { border-bottom: 0; }
.emailHistoryRow strong,
.emailTesterRow strong { display: block; font-size: 14px; }
.emailHistoryRow span,
.emailTesterRow span { color: var(--cx-muted); display: block; font-size: 12px; margin-top: 3px; }

.emailStatus {
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    padding: 5px 8px;
    text-transform: capitalize;
}

.emailStatus-sent { background: #e4f5ea; color: var(--cx-green); }
.emailStatus-simulated { background: #fff0dc; color: #9f6417; }
.emailStatus-failed,
.emailStatus-partial { background: #fde8e9; color: var(--cx-red); }
.emailStatus-queued,
.emailStatus-sending { background: #f2eee8; color: var(--cx-brand-dark); }

.emailSafetyNotice {
    background: #fff8ee;
    border: 1px solid #efd5ad;
    border-radius: 12px;
    color: #6a4a1d;
    font-size: 12px;
    line-height: 1.5;
    margin: 14px 16px;
    padding: 12px;
}

.emailToolBody { padding: 16px; }
.emailToolBody p { color: var(--cx-muted); font-size: 12px; line-height: 1.5; }
.emailToolMeta { background: var(--cx-panel-soft); border: 1px solid var(--cx-border); border-radius: 10px; margin-bottom: 12px; padding: 11px; }
.emailToolMeta strong,
.emailToolMeta span { display: block; }
.emailToolMeta span { color: var(--cx-muted); font-size: 12px; margin-top: 3px; }
.emailEmpty { color: var(--cx-muted); font-size: 13px; padding: 18px 16px; }

@media (max-width: 1150px) {
    .emailStatGrid { grid-template-columns: repeat(2, minmax(160px, 1fr)); }
    .emailMainGrid,
    .emailOperationsGrid { grid-template-columns: 1fr; }
}

@media (max-width: 700px) {
    .adminEmailsContent { padding-left: 12px; padding-right: 12px; }
    .emailStatGrid,
    .emailComposer { grid-template-columns: 1fr; }
    .emailFieldFull,
    .emailAudiencePreview,
    .emailComposerActions { grid-column: auto; }
}
