.sme-app {
    --sme-primary: #4f46e5;
    --sme-primary-dark: #4338ca;
    --sme-border: #e5e7eb;
    --sme-muted: #6b7280;
    --sme-text: #111827;
    --sme-bg: #f9fafb;
    font-family: inherit;
    color: var(--sme-text);
    max-width: 1100px;
    margin: 0 auto;
    padding: 24px 0;
}

.sme-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 20px;
    border-bottom: 1px solid var(--sme-border);
    padding-bottom: 18px;
    margin-bottom: 20px;
}

.sme-header h2 {
    margin: 4px 0 6px;
    font-size: clamp(1.6rem, 3vw, 2.25rem);
    line-height: 1.1;
}

.sme-header p {
    margin: 0;
    color: var(--sme-muted);
}

.sme-kicker {
    display: inline-block;
    color: var(--sme-primary);
    font-weight: 700;
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.sme-btn {
    border: 0;
    border-radius: 10px;
    padding: 10px 16px;
    font-weight: 700;
    cursor: pointer;
    transition: 0.2s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.sme-btn:disabled {
    cursor: not-allowed;
    opacity: 0.6;
}

.sme-btn-primary {
    background: var(--sme-primary);
    color: #fff;
}

.sme-btn-primary:hover {
    background: var(--sme-primary-dark);
    color: #fff;
}

.sme-form-card {
    background: #fff;
    border: 1px solid var(--sme-border);
    border-radius: 18px;
    padding: 22px;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.06);
    margin-bottom: 22px;
}

.sme-content-form label {
    display: block;
    font-weight: 700;
    margin-bottom: 14px;
}

.sme-content-form input,
.sme-content-form select,
.sme-content-form textarea {
    width: 100%;
    margin-top: 6px;
    border: 1px solid #d1d5db;
    border-radius: 10px;
    padding: 10px 12px;
    font: inherit;
    background: #fff;
    box-sizing: border-box;
}

.sme-content-form textarea {
    resize: vertical;
}

.sme-field-hint {
    display: block;
    margin-top: 6px;
    color: var(--sme-muted);
    font-size: 0.78rem;
    line-height: 1.35;
    font-weight: 500;
}

.sme-form-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
}

.sme-error,
.sme-alert {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #991b1b;
    padding: 12px 14px;
    border-radius: 10px;
    margin-bottom: 14px;
}

.sme-empty {
    text-align: center;
    padding: 48px 18px;
    border: 1px dashed #d1d5db;
    border-radius: 18px;
    color: var(--sme-muted);
    background: var(--sme-bg);
}

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

.sme-card {
    background: #fff;
    border: 1px solid var(--sme-border);
    border-radius: 18px;
    overflow: hidden;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
}

.sme-media {
    background: #f3f4f6;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 16px;
    min-height: 200px;
    box-sizing: border-box;
    overflow: visible;
}

.sme-media img {
    display: block;
    width: 100%;
    max-width: 100%;
    height: auto;
    max-height: none;
    margin: 0 auto;
    object-fit: contain !important;
    object-position: center center;
}

.sme-video-shell {
    width: 100%;
    min-height: 220px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    border-radius: 12px;
    background: #111827;
    color: #fff;
    padding: 18px;
    box-sizing: border-box;
}

.sme-media video,
.sme-video-player {
    display: block;
    width: 100%;
    max-width: 100%;
    height: auto;
    max-height: none;
    margin: 0 auto;
    object-fit: contain !important;
    object-position: center center;
    background: #000;
    border-radius: 12px;
}

.sme-play-video-btn {
    border: 0;
    border-radius: 999px;
    padding: 12px 20px;
    background: #4f46e5;
    color: #fff;
    font-weight: 800;
    cursor: pointer;
    box-shadow: 0 8px 18px rgba(79, 70, 229, 0.32);
}

.sme-play-video-btn:hover {
    background: #4338ca;
}

.sme-video-hint {
    color: #d1d5db;
    font-size: 0.78rem;
    text-align: center;
    line-height: 1.35;
}

.sme-media-placeholder {
    font-size: 0.95rem;
    text-align: center;
    padding: 40px 20px;
}

.sme-card-body {
    padding: 16px;
}

.sme-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.sme-type-wrap {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.sme-type {
    background: #f0f0f0;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: #374151;
}

.sme-date-badge {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 6px 12px;
    border-radius: 20px;
    color: white;
    text-align: center;
    min-width: 100px;
}

.sme-date-day {
    font-weight: bold;
    font-size: 1rem;
    display: block;
}

.sme-date-pretty {
    font-size: 0.7rem;
    opacity: 0.9;
    display: block;
}

/* ========================================================
   NOVO: ESTILOS PARA EDIÇÃO INLINE DA LEGENDA
======================================================== */
.sme-caption-box {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 14px;
    margin-bottom: 16px;
}

.sme-caption-toolbar {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 1px solid #e2e8f0;
}

.sme-icon-btn {
    border: 1px solid #d1d5db;
    background: #ffffff;
    color: #374151;
    border-radius: 6px;
    cursor: pointer;
    padding: 6px 10px;
    font-size: 0.8rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    transition: background 0.2s;
}

.sme-icon-btn:hover {
    background: #f3f4f6;
}

.sme-caption-content {
    margin: 0;
    color: #374151;
    line-height: 1.5;
    white-space: pre-wrap;
    outline: none;
    min-height: 24px;
}

/* Quando você clica em Editar, o texto fica com essa borda avisando que está editável */
.sme-caption-content[contenteditable="true"] {
    background: #ffffff;
    border: 2px dashed #4f46e5;
    padding: 10px;
    border-radius: 8px;
    cursor: text;
}
/* ======================================================== */

.sme-edit-area {
    margin-bottom: 12px;
}

.sme-edit-area textarea {
    width: 100%;
    min-height: 78px;
    border: 1px solid #c7d2fe;
    border-radius: 10px;
    padding: 10px;
    box-sizing: border-box;
}

.sme-edit-actions,
.sme-actions {
    display: flex;
    gap: 8px;
}

.sme-small-btn {
    border: 0;
    border-radius: 8px;
    padding: 8px 10px;
    font-weight: 700;
    cursor: pointer;
}

.sme-save { background: #4f46e5; color: #fff; }
.sme-cancel { background: #e5e7eb; color: #374151; }
.sme-approve { background: #10b981; color: #fff; flex: 1; }
.sme-reject { background: #ef4444; color: #fff; flex: 1; }
.sme-delete { background: #ef4444; color: white; }
.sme-delete:hover { background: #dc2626; }

.sme-status {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: 4px 10px;
    font-size: 0.78rem;
    font-weight: 800;
    border: 1px solid transparent;
    margin-bottom: 12px;
}

.sme-status-pendente { background: #fef3c7; color: #92400e; border-color: #fde68a; }
.sme-status-aprovado { background: #d1fae5; color: #065f46; border-color: #a7f3d0; }
.sme-status-reprovado { background: #fee2e2; color: #991b1b; border-color: #fecaca; }

.sme-change-bubble {
    min-width: 38px;
    height: 32px;
    padding: 0 9px;
    border: 1px solid #d1d5db;
    border-radius: 999px;
    background: #fff;
    color: #374151;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    line-height: 1;
    font-weight: 800;
    transition: all 0.18s ease;
}

.sme-change-bubble:hover,
.sme-change-bubble.has-request {
    background: #2563eb;
    border-color: #2563eb;
    color: #fff;
    transform: translateY(-1px);
}

.sme-change-request {
    margin: 12px 0;
    padding: 12px 14px;
    border-radius: 12px;
    background: #f8fafc;
    border: 1px solid #e5e7eb;
}

.sme-change-request strong {
    display: block;
    margin-bottom: 5px;
    color: #111827;
    font-size: 0.82rem;
}

.sme-change-request p {
    margin: 0;
    color: #4b5563;
    white-space: pre-wrap;
}

.sme-change-edit-area {
    margin: 12px 0;
}

.sme-card-footer-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}

.sme-change-media-btn {
    margin-top: 0;
    background: #4f46e5;
    color: white;
    border: none;
    border-radius: 8px;
    padding: 5px 12px;
    cursor: pointer;
    font-size: 0.75rem;
}

.sme-change-media-btn:hover {
    background: #4338ca;
}

.sme-password-card {
    max-width: 460px;
    margin: 32px auto;
    background: #fff;
    border: 1px solid var(--sme-border);
    border-radius: 18px;
    padding: 26px;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
}

.sme-password-card h3 {
    margin: 0 0 8px;
    font-size: 1.5rem;
}

.sme-password-card p {
    color: var(--sme-muted);
    margin: 0 0 18px;
}

.sme-password-card label {
    display: block;
    font-weight: 700;
    margin-bottom: 14px;
}

.sme-password-card input {
    width: 100%;
    margin-top: 6px;
    border: 1px solid #d1d5db;
    border-radius: 10px;
    padding: 11px 12px;
    font: inherit;
    box-sizing: border-box;
}

.sme-download {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    margin: 0 0 12px;
    border-radius: 9px;
    padding: 9px 12px;
    background: #f3f4f6;
    color: #374151;
    text-decoration: none;
    font-weight: 800;
}

.sme-download:hover {
    background: #e5e7eb;
    color: #111827;
}

@media (max-width: 780px) {
    .sme-header,
    .sme-meta {
        flex-direction: column;
    }

    .sme-form-grid,
    .sme-grid {
        grid-template-columns: 1fr;
    }

    .sme-header .sme-btn {
        width: 100%;
    }
}