@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;600;700&display=swap');

:root {
    --bg: #f4f7f6;
    --panel: #ffffff;
    --dark: #171724;
    --dark-2: #222235;
    --text: #20232a;
    --muted: #6b7280;
    --line: #e5e7eb;
    --accent: #0073b1;
    --success: #10b981;
    --danger: #dc2626;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    min-height: 100vh;
    background: var(--bg);
    color: var(--text);
    font-family: 'Inter', sans-serif;
}

.sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: 270px;
    background: var(--dark);
    color: #fff;
    padding: 24px 18px;
    display: flex;
    flex-direction: column;
    gap: 24px;
    z-index: 20;
}

.brand h1 {
    margin: 0 0 6px;
    font-size: 1.25rem;
}

.brand p {
    margin: 0;
    color: #a7a9be;
    font-size: 0.85rem;
}

.tabs { display: grid; gap: 8px; }

.tab-link,
.logout-btn {
    width: 100%;
    border: 0;
    border-radius: 8px;
    padding: 13px 14px;
    text-align: left;
    color: #b8bad0;
    background: transparent;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
}

.tab-link:hover,
.tab-link.active,
.logout-btn:hover {
    background: var(--dark-2);
    color: #fff;
}

.logout-btn {
    display: none;
    margin-top: auto;
}

.logout-btn.is-visible { display: block; }

.main-content {
    margin-left: 270px;
    padding: 32px;
}

.login-card,
.secao-admin,
.topbar {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.06);
}

.login-card {
    max-width: 430px;
    margin: 8vh auto 0;
    padding: 28px;
}

.login-card p,
.muted {
    color: var(--muted);
    line-height: 1.55;
}

.admin-shell.is-hidden,
.login-card.is-hidden,
.is-hidden { display: none !important; }

.topbar {
    padding: 22px 24px;
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.eyebrow {
    margin: 0 0 4px;
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

h2, h3, h4 { margin-top: 0; }

.tab-content { display: none; }
.tab-content.active { display: block; animation: fadeIn 0.25s ease; }

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

.grid-two {
    display: grid;
    grid-template-columns: minmax(0, 0.9fr) minmax(320px, 1.1fr);
    gap: 24px;
    align-items: start;
}

.secao-admin { padding: 24px; }

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

.form-group,
form label {
    display: block;
    margin-bottom: 16px;
}

label {
    font-weight: 700;
    color: #444;
    font-size: 0.9rem;
}

input,
textarea,
select {
    width: 100%;
    padding: 12px;
    margin-top: 8px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    box-sizing: border-box;
    font-size: 1rem;
    background: #f9fafb;
    font-family: inherit;
}

input:focus,
textarea:focus,
select:focus {
    outline: 2px solid rgba(0, 115, 177, 0.18);
    border-color: var(--accent);
    background: #fff;
}

textarea {
    min-height: 120px;
    line-height: 1.5;
    resize: vertical;
}

button {
    background: var(--accent);
    color: white;
    border: none;
    padding: 12px 18px;
    border-radius: 8px;
    font-weight: 700;
    cursor: pointer;
    font-family: inherit;
}

button:disabled { opacity: 0.55; cursor: not-allowed; }

.btn-post {
    background: var(--success);
    width: 100%;
    font-size: 1.05rem;
    padding: 15px;
    margin-top: 10px;
}

.ghost-btn {
    width: auto;
    color: var(--accent);
    background: #eaf6fd;
}

.danger-btn {
    width: auto;
    color: var(--danger);
    background: #fee2e2;
}

.status-msg {
    display: none;
    color: var(--muted);
    font-weight: 700;
}

.status-msg.is-visible { display: inline-flex; }
.status-msg[data-type="error"] { color: var(--danger); }

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

.cover-picker {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
    gap: 10px;
    margin-top: 12px;
}

.cover-option {
    position: relative;
    overflow: hidden;
    aspect-ratio: 1;
    padding: 0;
    border: 2px solid transparent;
    background: #eef2f5;
}

.cover-option.is-cover { border-color: var(--success); }

.cover-option img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
}

.cover-option span:last-child {
    position: absolute;
    left: 6px;
    right: 6px;
    bottom: 6px;
    border-radius: 999px;
    background: rgba(17, 24, 39, 0.82);
    color: #fff;
    padding: 4px 6px;
    font-size: 0.72rem;
}

.file-icon {
    display: grid;
    place-items: center;
    width: 100%;
    height: 100%;
    color: var(--muted);
}

.album-editor {
    border-top: 1px solid var(--line);
    margin-top: 18px;
    padding-top: 18px;
}

.album-image-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 12px;
    margin: 12px 0 18px;
}

.album-image-card {
    border: 2px solid transparent;
    border-radius: 8px;
    overflow: hidden;
    background: #f8fafc;
}

.album-image-card.is-cover {
    border-color: var(--success);
}

.album-image-card img {
    display: block;
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
}

.album-image-actions {
    display: grid;
    gap: 6px;
    padding: 8px;
}

.album-image-actions button {
    width: 100%;
    padding: 8px;
    font-size: 0.78rem;
}

.project-list {
    display: grid;
    gap: 12px;
    margin-top: 16px;
}

.admin-project {
    display: grid;
    grid-template-columns: 64px minmax(0, 1fr) auto;
    gap: 14px;
    align-items: center;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fbfbfc;
}

.admin-project img {
    width: 64px;
    height: 64px;
    object-fit: cover;
    border-radius: 6px;
    background: #e5e7eb;
}

.admin-project h4 {
    margin: 0 0 4px;
    font-size: 0.95rem;
}

.admin-project p {
    margin: 0;
    color: var(--muted);
    font-size: 0.82rem;
}

.row-actions {
    display: flex;
    gap: 8px;
}

.admin-menu {
    display: none;
    position: fixed;
    top: 14px;
    left: 14px;
    z-index: 30;
    width: 42px;
    height: 42px;
    padding: 9px;
    background: var(--dark);
}

.admin-menu span {
    display: block;
    height: 2px;
    margin: 5px 0;
    background: #fff;
}

@media (max-width: 980px) {
    .grid-two { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
    .admin-menu { display: block; }

    .sidebar {
        transform: translateX(-105%);
        transition: transform 0.25s ease;
        width: min(82vw, 290px);
    }

    .sidebar.is-open { transform: translateX(0); }

    .main-content {
        margin-left: 0;
        padding: 72px 16px 24px;
    }

    .topbar {
        align-items: flex-start;
        flex-direction: column;
    }

    .settings-grid { grid-template-columns: 1fr; }

    .admin-project {
        grid-template-columns: 56px minmax(0, 1fr);
    }

    .row-actions {
        grid-column: 1 / -1;
        width: 100%;
    }

    .row-actions button { flex: 1; }
}
