/* Dedicated Email Templates Manager Layout */
.templates-container {
    display: flex;
    gap: 20px;
    min-height: calc(100vh - 180px);
}

.templates-sidebar {
    width: 330px;
    flex-shrink: 0;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    padding: 18px;
    display: flex;
    flex-direction: column;
    box-shadow: 0 2px 10px rgba(15,23,42,0.04);
}

.templates-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
    padding-bottom: 12px;
    border-bottom: 1px solid #f1f5f9;
}

.templates-list {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 8px;
}

.template-item {
    padding: 14px 16px;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    background: #ffffff;
    cursor: pointer;
    transition: all 0.18s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    gap: 6px;
    position: relative;
    box-shadow: 0 1px 3px rgba(15,23,42,0.03);
}

.template-item:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(15,23,42,0.06);
}

.template-item.active {
    background: linear-gradient(135deg, #eff6ff, #dbeafe) !important;
    border-color: #bfdbfe !important;
    border-left: 4px solid #2563eb !important;
    box-shadow: 0 4px 14px rgba(37,99,235,0.12) !important;
}

.template-item-name {
    font-weight: 700;
    font-size: 13.5px;
    color: #0f172a;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.template-item.active .template-item-name {
    color: #1d4ed8;
}

.template-item-subject {
    font-size: 12px;
    color: #64748b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-weight: 500;
}

.templates-editor-pane {
    flex: 1;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    padding: 24px 28px;
    display: flex;
    flex-direction: column;
    box-shadow: 0 2px 10px rgba(15,23,42,0.04);
}

.editor-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 14px;
    border-bottom: 1px solid #f1f5f9;
}

#template-name-input,
#template-subject-input {
    width: 100%;
    height: 44px;
    padding: 0 16px;
    font-size: 13.5px;
    font-weight: 600;
    border-radius: 10px;
    border: 1px solid #cbd5e1;
    background: #f8fafc;
    color: #0f172a;
    outline: none;
    transition: all 0.15s ease;
}

#template-name-input:focus,
#template-subject-input:focus {
    background: #ffffff;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37,99,235,0.12);
}

.variables-bar {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 12px 16px;
    margin-bottom: 18px;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.variable-pill {
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    color: #1d4ed8;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.18s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    box-shadow: 0 1px 3px rgba(37,99,235,0.08);
}

.variable-pill:hover {
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    color: #ffffff;
    border-color: #2563eb;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(37,99,235,0.25);
}

.template-preview-card {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    padding: 18px 22px;
    margin-top: 20px;
    box-shadow: 0 2px 8px rgba(15,23,42,0.04);
}

.template-preview-title {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    color: #2563eb;
    letter-spacing: 0.6px;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 6px;
}
