.email-template-toolbar,
.email-template-actions,
.automation-recipient,
.automation-row,
.automation-row-actions,
.email-account-heading {
    display: flex;
    align-items: center;
}

.email-template-toolbar {
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 20px;
}

.email-template-toolbar p {
    margin: 0;
}

.email-template-actions {
    gap: 10px;
    flex-wrap: wrap;
}

.modal .lead-action-btn.automation {
    color: #fff;
    background: linear-gradient(135deg, #ec4899, #be185d);
    box-shadow: 0 2px 8px rgba(190, 24, 93, 0.3);
}

.modal .lead-action-btn.automation:hover {
    background: linear-gradient(135deg, #db2777, #9d174d);
    box-shadow: 0 4px 14px rgba(190, 24, 93, 0.45);
}

.modal .lead-action-btn.automation:focus-visible {
    outline: 3px solid rgba(236, 72, 153, 0.35);
    outline-offset: 3px;
}

.automation-layout {
    display: grid;
    grid-template-columns: minmax(280px, 0.9fr) minmax(320px, 1.1fr);
    gap: 24px;
}

.automation-editor {
    border-right: 1px solid #e5e7eb;
    padding-right: 24px;
}

.automation-recipient {
    justify-content: space-between;
    gap: 16px;
    padding: 12px 14px;
    margin-bottom: 18px;
    background: #ecfdf5;
    border-left: 4px solid #0f766e;
    border-radius: 6px;
}

.automation-recipient span,
.automation-row small {
    color: #64748b;
    font-size: 12px;
}

.automation-recipient strong {
    overflow-wrap: anywhere;
    text-align: right;
}

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

.automation-check {
    display: flex;
    align-items: center;
    gap: 9px;
    min-height: 42px;
    color: #334155;
    cursor: pointer;
}

.automation-check input {
    width: 18px;
    height: 18px;
    margin: 0;
    accent-color: #0f766e;
}

.automation-list-panel h4,
.email-server-section h4 {
    margin: 0 0 14px;
}

.automation-list-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.automation-row {
    justify-content: space-between;
    gap: 12px;
    padding: 14px 0;
    border-bottom: 1px solid #e5e7eb;
}

.automation-row-main {
    display: grid;
    min-width: 0;
    gap: 4px;
}

.automation-row-main span {
    color: #334155;
    font-size: 14px;
}

.automation-status {
    font-weight: 600;
}

.automation-status.active {
    color: #047857;
}

.automation-status.paused,
.automation-error {
    color: #64748b;
}

.automation-status.error,
.automation-error {
    overflow-wrap: anywhere;
}

.automation-status.error {
    color: #b91c1c;
}

.automation-row-actions {
    gap: 6px;
    flex: 0 0 auto;
}

.icon-action {
    display: inline-grid;
    width: 36px;
    height: 36px;
    place-items: center;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    color: #0f766e;
    background: #fff;
    cursor: pointer;
}

.icon-action.danger {
    color: #b91c1c;
}

.automation-empty {
    display: grid;
    min-height: 180px;
    place-items: center;
    align-content: center;
    gap: 10px;
    color: #64748b;
    text-align: center;
}

.automation-empty i {
    font-size: 28px;
    color: #0f766e;
}

.email-account-heading {
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
}

.email-account-heading p {
    margin: 0;
    color: #475569;
}

.email-account-heading span {
    flex: 0 0 auto;
    padding: 6px 9px;
    border-radius: 4px;
    background: #ecfdf5;
    color: #047857;
    font-size: 12px;
    font-weight: 600;
}

.btn-detect-provider {
    margin-bottom: 18px;
}

.email-server-section {
    padding: 16px;
    margin-bottom: 16px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    background: #f8fafc;
}

.email-server-grid {
    display: grid;
    grid-template-columns: minmax(220px, 1fr) 110px 100px;
    align-items: end;
    gap: 14px;
}

.email-server-grid .form-group {
    margin-bottom: 0;
}

.email-account-actions {
    padding: 16px 24px;
    border-top: 1px solid #e5e7eb;
}

.is-loading {
    cursor: wait;
    opacity: 0.65;
}

[hidden] {
    display: none !important;
}

@media (max-width: 760px) {
    .email-template-toolbar,
    .email-account-heading {
        align-items: stretch;
        flex-direction: column;
    }

    .email-template-actions,
    .email-template-actions .btn {
        width: 100%;
    }

    .automation-layout,
    .automation-form-grid,
    .email-server-grid {
        grid-template-columns: 1fr;
    }

    .automation-editor {
        border-right: 0;
        border-bottom: 1px solid #e5e7eb;
        padding: 0 0 22px;
    }

    .email-server-grid .automation-check {
        min-height: auto;
    }
}
