:root {
    --roasted-cocoa: #402821;
    --caramel-clay: #926E57;
    --cloud-silk: #F2F1EE;
    --buttercream: #F1E6AD;

    --surface: #FFFFFF;
    --surface-soft: #FAF8F5;
    --border: #DED8D3;
    --text-muted: #74645E;

    --radius-sm: 10px;
    --radius-md: 16px;
    --radius-lg: 22px;

    --shadow-sm: 0 4px 16px rgba(64, 40, 33, 0.07);
    --shadow-md: 0 12px 32px rgba(64, 40, 33, 0.10);

    --container: 1180px;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    min-height: 100%;
    background: var(--cloud-silk);
    color: var(--roasted-cocoa);
    scroll-behavior: smooth;
}

body {
    min-height: 100vh;
    margin: 0;
    background:
        radial-gradient(
            circle at top right,
            rgba(241, 230, 173, 0.28),
            transparent 32rem
        ),
        var(--cloud-silk);
    color: var(--roasted-cocoa);
    font-family:
        Inter,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        Roboto,
        Helvetica,
        Arial,
        sans-serif;
    font-size: 16px;
    line-height: 1.5;
}

button,
input,
select,
textarea {
    font: inherit;
}

button {
    cursor: pointer;
}

img {
    display: block;
    max-width: 100%;
}

a {
    color: inherit;
}

.container {
    width: calc(100% - 32px);
    max-width: var(--container);
    margin: 0 auto;
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 30;
    width: 100%;
    background: rgba(242, 241, 238, 0.96);
    border-bottom: 1px solid rgba(64, 40, 33, 0.10);
    backdrop-filter: blur(12px);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 70px;
    gap: 16px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--roasted-cocoa);
    text-decoration: none;
    font-weight: 800;
    letter-spacing: -0.03em;
}

.brand-mark {
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    border-radius: 12px;
    background: var(--roasted-cocoa);
    color: var(--buttercream);
    font-size: 18px;
}

.header-user {
    display: none;
    color: var(--text-muted);
    font-size: 14px;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.page {
    padding: 24px 0 48px;
}

.page-heading {
    margin-bottom: 24px;
}

.page-heading h1 {
    margin: 0 0 6px;
    color: var(--roasted-cocoa);
    font-size: clamp(1.7rem, 5vw, 2.6rem);
    line-height: 1.1;
    letter-spacing: -0.04em;
}

.page-heading p {
    max-width: 700px;
    margin: 0;
    color: var(--text-muted);
}

.section {
    margin-top: 30px;
}

.section-heading {
    margin-bottom: 14px;
}

.section-heading h2 {
    margin: 0 0 4px;
    font-size: 1.25rem;
    letter-spacing: -0.02em;
}

.section-heading p {
    margin: 0;
    color: var(--text-muted);
    font-size: 14px;
}

.card {
    background: var(--surface);
    border: 1px solid rgba(64, 40, 33, 0.09);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
}

.card-body {
    padding: 20px;
}

.card-title {
    margin: 0 0 5px;
    font-size: 1.15rem;
}

.card-subtitle {
    margin: 0 0 20px;
    color: var(--text-muted);
    font-size: 14px;
}

.admin-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 18px;
}

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

.stat-card {
    min-width: 0;
    padding: 16px;
    background: var(--surface);
    border: 1px solid rgba(64, 40, 33, 0.08);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
}

.stat-label {
    display: block;
    margin-bottom: 7px;
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.stat-number {
    display: block;
    color: var(--roasted-cocoa);
    font-size: 1.65rem;
    font-weight: 800;
    line-height: 1;
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
}

.form-group {
    min-width: 0;
}

.form-group label {
    display: block;
    margin-bottom: 7px;
    color: var(--roasted-cocoa);
    font-size: 14px;
    font-weight: 700;
}

.form-hint {
    display: block;
    margin-top: 6px;
    color: var(--text-muted);
    font-size: 12px;
}

input,
select,
textarea {
    width: 100%;
    min-height: 48px;
    padding: 11px 13px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    outline: 0;
    background: var(--surface);
    color: var(--roasted-cocoa);
    transition:
        border-color 0.2s ease,
        box-shadow 0.2s ease,
        background-color 0.2s ease;
}

textarea {
    min-height: 130px;
    resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
    border-color: var(--caramel-clay);
    box-shadow: 0 0 0 4px rgba(146, 110, 87, 0.16);
}

input::placeholder,
textarea::placeholder {
    color: #A79A94;
}

input[type="file"] {
    height: auto;
    padding: 10px;
    background: var(--surface-soft);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 46px;
    padding: 11px 16px;
    border: 0;
    border-radius: var(--radius-sm);
    text-decoration: none;
    font-size: 14px;
    font-weight: 800;
    line-height: 1.2;
    transition:
        transform 0.15s ease,
        opacity 0.15s ease,
        box-shadow 0.15s ease;
}

.btn:hover:not(:disabled) {
    transform: translateY(-1px);
}

.btn:focus-visible {
    outline: 3px solid rgba(146, 110, 87, 0.35);
    outline-offset: 2px;
}

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

.btn-primary {
    background: var(--roasted-cocoa);
    color: var(--cloud-silk);
    box-shadow: 0 6px 16px rgba(64, 40, 33, 0.18);
}

.btn-secondary {
    background: var(--surface-soft);
    color: var(--roasted-cocoa);
    border: 1px solid var(--border);
}

.btn-approve {
    background: var(--buttercream);
    color: var(--roasted-cocoa);
    box-shadow: 0 5px 14px rgba(64, 40, 33, 0.10);
}

.btn-change {
    background: var(--caramel-clay);
    color: var(--cloud-silk);
    box-shadow: 0 5px 14px rgba(146, 110, 87, 0.20);
}

.btn-dark {
    background: var(--roasted-cocoa);
    color: var(--cloud-silk);
}

.btn-block {
    width: 100%;
}

.logout-form {
    margin: 0;
}

.flash {
    margin: 0 0 20px;
    padding: 14px 16px;
    border-radius: var(--radius-md);
    border: 1px solid transparent;
    font-size: 14px;
    font-weight: 650;
}

.flash-sucesso {
    background: rgba(241, 230, 173, 0.60);
    border-color: var(--buttercream);
    color: var(--roasted-cocoa);
}

.flash-erro {
    background: rgba(146, 110, 87, 0.13);
    border-color: rgba(146, 110, 87, 0.38);
    color: var(--roasted-cocoa);
}

.flash-info {
    background: var(--surface);
    border-color: var(--border);
    color: var(--roasted-cocoa);
}

.login-page {
    display: grid;
    place-items: center;
    min-height: 100vh;
    padding: 24px 16px;
}

.login-layout {
    width: 100%;
    max-width: 940px;
}

.login-card {
    overflow: hidden;
    background: var(--surface);
    border: 1px solid rgba(64, 40, 33, 0.08);
    border-radius: 26px;
    box-shadow: var(--shadow-md);
}

.login-brand-panel {
    padding: 30px 24px;
    background: var(--roasted-cocoa);
    color: var(--cloud-silk);
}

.login-brand-panel h1 {
    margin: 18px 0 8px;
    font-size: 2rem;
    line-height: 1.1;
    letter-spacing: -0.04em;
}

.login-brand-panel p {
    margin: 0;
    color: rgba(242, 241, 238, 0.78);
}

.login-palette {
    display: flex;
    gap: 8px;
    margin-top: 24px;
}

.palette-dot {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.18);
}

.palette-cocoa { background: var(--roasted-cocoa); }
.palette-caramel { background: var(--caramel-clay); }
.palette-cloud { background: var(--cloud-silk); }
.palette-butter { background: var(--buttercream); }

.login-form-panel {
    padding: 28px 24px;
}

.login-form-panel h2 {
    margin: 0 0 4px;
    font-size: 1.5rem;
}

.login-form-panel > p {
    margin: 0 0 24px;
    color: var(--text-muted);
}

.table-wrap {
    width: 100%;
    overflow-x: auto;
    border: 1px solid rgba(64, 40, 33, 0.08);
    border-radius: var(--radius-md);
    background: var(--surface);
}

table {
    width: 100%;
    min-width: 720px;
    border-collapse: collapse;
}

th,
td {
    padding: 14px 15px;
    border-bottom: 1px solid rgba(64, 40, 33, 0.07);
    text-align: left;
    vertical-align: middle;
}

th {
    background: var(--surface-soft);
    color: var(--text-muted);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

td {
    font-size: 14px;
}

tbody tr:last-child td {
    border-bottom: 0;
}

.status {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 28px;
    padding: 5px 10px;
    border-radius: 999px;
    white-space: nowrap;
    font-size: 12px;
    font-weight: 800;
}

.status-pendente,
.status-alteracao {
    background: var(--caramel-clay);
    color: var(--cloud-silk);
}

.status-aprovado {
    background: var(--buttercream);
    color: var(--roasted-cocoa);
}

.status-agendado {
    background: var(--roasted-cocoa);
    color: var(--cloud-silk);
}

.filter-card {
    margin-bottom: 20px;
    padding: 16px;
}

.filter-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
}

.posts-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 22px;
}

.post-card {
    overflow: hidden;
    background: var(--surface);
    border: 1px solid rgba(64, 40, 33, 0.09);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
}

.post-image-link {
    display: block;
    overflow: hidden;
    background: #E8E3DF;
}

.post-image {
    width: 100%;
    aspect-ratio: 4 / 5;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.post-image-link:hover .post-image {
    transform: scale(1.015);
}

.post-image-placeholder {
    display: grid;
    place-items: center;
    aspect-ratio: 4 / 5;
    padding: 30px;
    background: var(--surface-soft);
    color: var(--text-muted);
    text-align: center;
}

.post-content {
    padding: 18px;
}

.post-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 15px;
}

.post-month {
    margin: 0;
    font-size: 1rem;
    font-weight: 800;
}

.post-date {
    margin-top: 3px;
    color: var(--text-muted);
    font-size: 13px;
}

.post-caption {
    margin: 0 0 18px;
    color: var(--roasted-cocoa);
    font-size: 15px;
    line-height: 1.65;
    overflow-wrap: anywhere;
}

.post-actions {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
}

.post-actions form {
    margin: 0;
}

.observation-form {
    margin-top: 14px;
    padding: 15px;
    border: 1px solid rgba(146, 110, 87, 0.22);
    border-radius: var(--radius-md);
    background: rgba(146, 110, 87, 0.07);
}

.observation-form h3 {
    margin: 0 0 5px;
    font-size: 1rem;
}

.observation-form p {
    margin: 0 0 12px;
    color: var(--text-muted);
    font-size: 13px;
}

.client-note {
    margin: 0 0 15px;
    padding: 12px 13px;
    background: rgba(146, 110, 87, 0.09);
    border-left: 4px solid var(--caramel-clay);
    border-radius: 8px;
    font-size: 13px;
}

.client-note strong {
    display: block;
    margin-bottom: 4px;
}

.admin-posts {
    display: grid;
    gap: 12px;
}

.admin-post-item {
    display: grid;
    grid-template-columns: 72px minmax(0, 1fr);
    gap: 13px;
    padding: 12px;
    background: var(--surface);
    border: 1px solid rgba(64, 40, 33, 0.08);
    border-radius: var(--radius-md);
}

.admin-post-thumb {
    width: 72px;
    height: 84px;
    border-radius: 10px;
    object-fit: cover;
    background: var(--surface-soft);
}

.admin-post-main {
    min-width: 0;
}

.admin-post-main h3 {
    margin: 0 0 3px;
    font-size: 15px;
}

.admin-post-meta {
    margin: 0 0 9px;
    color: var(--text-muted);
    font-size: 12px;
}

.admin-post-caption {
    display: -webkit-box;
    margin: 8px 0;
    overflow: hidden;
    font-size: 13px;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.admin-post-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-top: 10px;
}

.lightbox {
    position: fixed;
    inset: 0;
    z-index: 999;
    display: none;
    place-items: center;
    padding: 20px;
}

.lightbox:target {
    display: grid;
}

.lightbox-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(33, 20, 16, 0.92);
}

.lightbox-dialog {
    position: relative;
    z-index: 2;
    width: min(100%, 900px);
    max-height: calc(100vh - 40px);
}

.lightbox-dialog img {
    width: auto;
    max-width: 100%;
    max-height: calc(100vh - 40px);
    margin: auto;
    border-radius: var(--radius-md);
    object-fit: contain;
    box-shadow: var(--shadow-md);
}

.lightbox-close {
    position: absolute;
    top: -14px;
    right: -8px;
    z-index: 3;
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--buttercream);
    color: var(--roasted-cocoa);
    text-decoration: none;
    font-size: 24px;
    font-weight: 800;
    box-shadow: var(--shadow-md);
}

.empty-state {
    padding: 36px 22px;
    background: var(--surface);
    border: 1px dashed rgba(64, 40, 33, 0.20);
    border-radius: var(--radius-lg);
    text-align: center;
}

.empty-state h3 {
    margin: 0 0 6px;
}

.empty-state p {
    max-width: 500px;
    margin: 0 auto;
    color: var(--text-muted);
}

.m-0 { margin: 0; }
.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }
.text-muted { color: var(--text-muted); }
.small { font-size: 13px; }

@media (min-width: 720px) {
    .header-user { display: block; }

    .stats-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    .form-grid.two-columns {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .form-group.full {
        grid-column: 1 / -1;
    }

    .posts-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .post-actions {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .filter-row {
        grid-template-columns: minmax(0, 1fr) auto;
        align-items: end;
    }
}

@media (min-width: 980px) {
    .page {
        padding-top: 36px;
    }

    .login-card {
        display: grid;
        grid-template-columns: 0.9fr 1.1fr;
        min-height: 560px;
    }

    .login-brand-panel {
        display: flex;
        flex-direction: column;
        justify-content: center;
        padding: 48px;
    }

    .login-form-panel {
        display: flex;
        flex-direction: column;
        justify-content: center;
        padding: 48px;
    }

    .admin-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .posts-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}
