:root {
    --bg: #f4f6fb;
    --surface: #ffffff;
    --text: #172033;
    --muted: #667085;
    --line: #d9e0ea;
    --primary: #173f75;
    --primary-dark: #0b2545;
    --accent: #8b1f3d;
    --accent-dark: #5d1028;
    --brand-gradient: linear-gradient(135deg, #0b2545 0%, #173f75 48%, #8b1f3d 100%);
    --danger-bg: #fff1f0;
    --danger-text: #9f2420;
    --warning-bg: #fff8e6;
    --warning-text: #7a5a00;
    --shadow: 0 16px 42px rgba(11, 37, 69, 0.11);
}

* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
}

body {
    min-height: 100vh;
    margin: 0;
    background:
        linear-gradient(180deg, rgba(11, 37, 69, 0.08) 0, rgba(244, 246, 251, 0) 260px),
        var(--bg);
    color: var(--text);
    font-family: Arial, Helvetica, sans-serif;
    line-height: 1.42;
}

a {
    color: var(--primary);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

.auth-page {
    display: grid;
    place-items: center;
    padding: 24px 16px;
}

.auth-shell {
    width: min(100%, 420px);
}

.auth-panel,
.panel,
.stats-grid article {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: var(--shadow);
}

.auth-panel {
    padding: 26px;
}

.brand-mark {
    display: inline-flex;
    align-items: center;
    min-height: 32px;
    margin-bottom: 18px;
    color: var(--accent);
    font-size: 22px;
    font-weight: 700;
}

.brand-mark.small {
    min-height: 0;
    margin: 0 12px 0 0;
    font-size: 18px;
}

h1,
h2,
p {
    margin-top: 0;
}

h1 {
    margin-bottom: 6px;
    font-size: 25px;
    line-height: 1.2;
}

h2 {
    margin-bottom: 16px;
    font-size: 18px;
}

.auth-subtitle,
.page-heading p,
.list-row span,
.stats-grid span {
    color: var(--muted);
}

.form-stack {
    display: grid;
    gap: 14px;
    margin-top: 20px;
}

label {
    display: grid;
    gap: 6px;
    color: var(--text);
    font-weight: 700;
}

input,
select,
textarea {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 6px;
    padding: 10px 12px;
    color: var(--text);
    font: inherit;
    font-weight: 400;
    background: #ffffff;
}

input,
select {
    min-height: 44px;
}

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

input:focus,
select:focus,
textarea:focus {
    border-color: var(--primary);
    outline: 3px solid rgba(36, 92, 158, 0.16);
}

input[readonly] {
    background: #f9fafb;
    color: var(--muted);
}

input[type="checkbox"] {
    width: auto;
    min-height: 0;
}

button {
    min-height: 44px;
    border: 0;
    border-radius: 6px;
    background: var(--primary);
    color: #ffffff;
    cursor: pointer;
    font: inherit;
    font-weight: 700;
}

button:hover {
    background: var(--primary-dark);
}

button:disabled {
    background: #a9b5c1;
    cursor: not-allowed;
}

.danger-button {
    background: var(--danger-text);
}

.danger-button:hover {
    background: #7f1d1a;
}

.secondary-button {
    background: #eef4fb;
    color: var(--primary);
}

.secondary-button:hover {
    background: #ddeaf8;
    color: var(--primary-dark);
}

.field-error {
    color: var(--danger-text);
    font-size: 13px;
    font-weight: 400;
}

.alert {
    border-radius: 6px;
    margin: 16px 0;
    padding: 12px 14px;
}

.alert-error {
    background: var(--danger-bg);
    color: var(--danger-text);
}

.alert-warning {
    background: var(--warning-bg);
    color: var(--warning-text);
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    min-height: 58px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.16);
    background: var(--brand-gradient);
    color: #ffffff;
    padding: 6px 24px;
}

.topbar > div,
.topbar nav {
    display: flex;
    align-items: center;
    gap: 10px;
}

.topbar strong {
    font-size: 15px;
    line-height: 1.2;
}

.topbar nav span {
    color: rgba(255, 255, 255, 0.78);
}

.topbar a {
    color: #ffffff;
}

.brand-lockup {
    min-width: 0;
}

.brand-logo {
    display: block;
    width: 78px;
    max-width: 78px;
    height: 34px;
    max-height: 34px;
    object-fit: contain;
}

.login-logo {
    display: block;
    width: 120px;
    max-width: 100%;
    max-height: 70px;
    height: auto;
    object-fit: contain;
}

.admin-nav {
    display: flex;
    gap: 16px;
    overflow-x: auto;
    border-bottom: 1px solid rgba(11, 37, 69, 0.12);
    background: #ffffff;
    padding: 8px 24px;
}

.admin-nav-group {
    display: grid;
    gap: 4px;
    flex: 0 0 auto;
}

.admin-nav-group > span {
    color: var(--muted);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0;
    text-transform: uppercase;
}

.admin-nav-group > div {
    display: flex;
    gap: 8px;
}

.admin-nav a {
    border-radius: 6px;
    color: var(--muted);
    padding: 6px 8px;
    font-size: 13px;
    white-space: nowrap;
}

.admin-nav a:hover,
.admin-nav a.active {
    background: linear-gradient(135deg, rgba(23, 63, 117, 0.1), rgba(139, 31, 61, 0.1));
    color: var(--primary-dark);
    text-decoration: none;
}

.dashboard {
    width: min(1120px, calc(100% - 32px));
    margin: 32px auto;
}

.page-heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 24px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
    margin-bottom: 16px;
}

.stats-grid article {
    display: grid;
    gap: 6px;
    min-height: 110px;
    padding: 18px;
}

.stats-grid strong {
    font-size: 34px;
    line-height: 1;
}

.stats-grid .stat-text {
    font-size: 24px;
}

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

.panel {
    padding: 22px;
}

.list-stack {
    display: grid;
    gap: 10px;
}

.list-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    border: 1px solid var(--line);
    border-radius: 6px;
    padding: 12px;
}

.list-row div {
    display: grid;
    gap: 2px;
}

.list-row em {
    color: var(--accent);
    font-style: normal;
    font-weight: 700;
    white-space: nowrap;
}

.list-row.muted {
    background: #f9fafb;
}

.text-result {
    align-items: stretch;
}

.text-result > div {
    width: 100%;
}

.image-grid {
    display: grid;
    gap: 16px;
}

.image-result {
    display: grid;
    grid-template-columns: minmax(220px, 320px) minmax(0, 1fr);
    gap: 16px;
    border: 1px solid var(--line);
    border-radius: 6px;
    padding: 12px;
}

.image-result img {
    display: block;
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: #f9fafb;
}

.image-result-body {
    display: grid;
    align-content: start;
    gap: 12px;
}

.status-stack {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: 14px;
}

.status-stack > div {
    display: grid;
    gap: 8px;
    border: 1px solid var(--line);
    border-radius: 6px;
    padding: 12px;
}

.review-actions {
    display: flex;
    align-items: flex-end;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 14px;
}

.review-actions form {
    display: flex;
    align-items: flex-end;
    flex-wrap: wrap;
    gap: 10px;
    margin: 0;
}

.review-reject-form {
    align-items: flex-end;
}

.small-textarea {
    min-height: 64px;
    width: min(100%, 360px);
}

.review-comment-list {
    display: grid;
    gap: 10px;
}

.review-comment-list.compact {
    max-height: 360px;
    overflow: auto;
}

.review-comment {
    display: grid;
    gap: 4px;
    border: 1px solid var(--line);
    border-radius: 6px;
    padding: 10px;
}

.review-comment span {
    color: var(--muted);
    font-size: 13px;
}

.review-comment p {
    margin: 0;
}

.campaign-item-row {
    align-items: flex-start;
}

.position-input {
    width: 92px;
}

.landing-preview,
.landing-admin-image {
    max-width: 520px;
}

.landing-preview {
    display: grid;
    gap: 10px;
}

.landing-preview img,
.landing-admin-image {
    display: block;
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: #f9fafb;
}

.landing-public-page {
    background: #f6f7f9;
}

.landing-public-shell {
    width: min(1120px, calc(100% - 32px));
    margin: 0 auto;
    padding: 32px 0;
}

.landing-public-hero {
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(320px, 0.95fr);
    gap: 28px;
    align-items: center;
    min-height: 520px;
}

.landing-public-hero img {
    display: block;
    width: 100%;
    border-radius: 8px;
    border: 1px solid var(--line);
    background: #ffffff;
}

.landing-public-content h1 {
    font-size: 44px;
    letter-spacing: 0;
}

.landing-public-content p {
    color: var(--muted);
    font-size: 18px;
}

.landing-public-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(320px, 420px);
    gap: 22px;
    align-items: start;
}

.landing-form-panel {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #ffffff;
    box-shadow: var(--shadow);
    padding: 22px;
}

.checkbox-row {
    display: flex;
    grid-template-columns: none;
    align-items: flex-start;
    gap: 10px;
    font-weight: 400;
}

.thank-you-shell {
    display: grid;
    min-height: 100vh;
    align-items: center;
}

a.list-row {
    color: var(--text);
}

a.list-row:hover {
    border-color: var(--primary);
    text-decoration: none;
}

.section-gap {
    margin-top: 16px;
}

.table-wrap {
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.data-table th,
.data-table td {
    border-bottom: 1px solid var(--line);
    padding: 12px;
    text-align: left;
    vertical-align: top;
}

.data-table th {
    background: #f9fafb;
    color: var(--muted);
    font-size: 12px;
    text-transform: uppercase;
}

.data-table tr:last-child td {
    border-bottom: 0;
}

.btn-link {
    display: inline-flex;
    align-items: center;
    min-height: 34px;
    border-radius: 6px;
    background: var(--primary);
    color: #ffffff;
    font-weight: 700;
    padding: 7px 12px;
}

.btn-link:hover {
    background: var(--primary-dark);
    color: #ffffff;
    text-decoration: none;
}

.btn-link.secondary {
    background: #eef4fb;
    color: var(--primary);
}

.btn-link.secondary:hover {
    background: #ddeaf8;
    color: var(--primary-dark);
}

.badge-soft {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    background: #eef4fb;
    color: var(--primary);
    font-size: 12px;
    font-weight: 700;
    padding: 4px 9px;
}

.muted-text {
    color: var(--muted);
}

.empty-state {
    border: 1px dashed var(--line);
    border-radius: 8px;
    background: #ffffff;
    color: var(--muted);
    padding: 22px;
}

.detail-list {
    display: grid;
    gap: 12px;
    margin: 0;
}

.detail-list div {
    display: grid;
    gap: 2px;
}

.detail-list dt {
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
}

.detail-list dd {
    margin: 0;
}

.filter-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr)) auto;
    gap: 14px;
    align-items: end;
}

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

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

.button-row,
.action-bar,
.actions-cell {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.action-bar {
    justify-content: flex-start;
    margin-bottom: 18px;
}

.action-bar form {
    margin: 0;
}

.inline-form {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin: 0;
}

.checkbox-row {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.92rem;
    color: var(--muted);
}

.compact-checkbox {
    margin-left: 8px;
}

.plain-list {
    display: grid;
    gap: 8px;
    margin: 0;
    padding-left: 20px;
}

.plain-list.columns {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    padding-left: 18px;
}

.detail-list.compact {
    gap: 8px;
}

@media (max-width: 820px) {
    .topbar,
    .page-heading {
        align-items: flex-start;
        flex-direction: column;
    }

    .topbar {
        padding: 10px 16px;
    }

    .admin-nav {
        padding: 10px 16px;
    }

    .content-grid,
    .filter-grid,
    .form-grid,
    .image-result,
    .landing-public-hero,
    .landing-public-grid {
        grid-template-columns: 1fr;
    }

    .landing-public-hero {
        min-height: auto;
    }

    .landing-public-content h1 {
        font-size: 32px;
    }

    .filter-actions {
        align-items: stretch;
        flex-direction: column;
    }
}

@media (max-width: 480px) {
    .auth-panel,
    .panel {
        padding: 20px;
    }

    h1 {
        font-size: 24px;
    }
}

.eyebrow {
    margin-bottom: 6px;
    color: var(--accent);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0;
    text-transform: uppercase;
}

.dashboard-hero {
    align-items: stretch;
    border-radius: 8px;
    background: var(--brand-gradient);
    color: #ffffff;
    padding: 20px;
    box-shadow: var(--shadow);
}

.dashboard-hero p,
.dashboard-hero .eyebrow {
    color: rgba(255, 255, 255, 0.82);
}

.dashboard-hero .btn-link {
    align-self: center;
    background: #ffffff;
    color: var(--primary-dark);
}

.dashboard-action-grid,
.studio-summary-grid,
.admin-dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: 12px;
    margin: 18px 0;
}

.dashboard-action-card,
.admin-dashboard-card,
.studio-summary-grid article,
.studio-card,
.primary-action-panel {
    border: 1px solid rgba(11, 37, 69, 0.1);
    border-radius: 8px;
    background: #ffffff;
    box-shadow: var(--shadow);
}

.dashboard-action-card,
.admin-dashboard-card {
    display: grid;
    gap: 8px;
    min-height: 138px;
    padding: 16px;
    color: var(--text);
}

.dashboard-action-card:hover,
.admin-dashboard-card:hover {
    text-decoration: none;
    border-color: rgba(139, 31, 61, 0.28);
    transform: translateY(-1px);
}

.dashboard-action-card span,
.admin-dashboard-card span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: fit-content;
    min-width: 34px;
    height: 28px;
    border-radius: 999px;
    background: rgba(23, 63, 117, 0.1);
    color: var(--primary);
    font-weight: 700;
}

.dashboard-action-card.primary {
    background: var(--brand-gradient);
    color: #ffffff;
}

.dashboard-action-card.primary span {
    background: rgba(255, 255, 255, 0.16);
    color: #ffffff;
}

.dashboard-action-card.primary p {
    color: rgba(255, 255, 255, 0.82);
}

.compact-stats {
    margin-top: 18px;
}

.studio-heading {
    gap: 14px;
}

.studio-top-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 10px;
}

.studio-summary-grid article {
    display: grid;
    gap: 6px;
    min-height: 92px;
    padding: 14px;
}

.studio-summary-grid span,
.primary-action-panel > div > span,
.muted-text {
    color: var(--muted);
}

.studio-summary-grid strong {
    color: var(--primary-dark);
    font-size: 16px;
}

.studio-steps {
    display: grid;
    grid-template-columns: repeat(6, minmax(110px, 1fr));
    gap: 6px;
    margin: 14px 0 18px;
}

.studio-step {
    border: 1px solid var(--line);
    border-radius: 999px;
    background: #ffffff;
    color: var(--muted);
    padding: 7px 8px;
    text-align: center;
    font-size: 12px;
    font-weight: 700;
}

.studio-step.done {
    border-color: rgba(23, 63, 117, 0.22);
    background: rgba(23, 63, 117, 0.08);
    color: var(--primary);
}

.studio-step.active {
    border-color: transparent;
    background: var(--brand-gradient);
    color: #ffffff;
}

.studio-workspace {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(260px, 0.9fr);
    gap: 14px;
    margin: 16px 0;
}

.studio-card {
    padding: 18px;
}

.studio-card h2,
.primary-action-panel h2 {
    margin-bottom: 12px;
}

.generated-text {
    display: grid;
    gap: 12px;
}

.generated-text h3 {
    margin: 0;
    color: var(--primary-dark);
    font-size: 20px;
    line-height: 1.25;
}

.studio-image-preview {
    display: block;
    width: 100%;
    max-height: 420px;
    border-radius: 8px;
    object-fit: contain;
    background: #f1f4f8;
}

.primary-action-panel {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin: 18px 0;
    padding: 18px;
}

.primary-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    border: 0;
    border-radius: 8px;
    background: var(--brand-gradient);
    color: #ffffff;
    padding: 10px 18px;
    cursor: pointer;
    font: inherit;
    font-weight: 700;
    text-align: center;
}

.primary-button:hover {
    color: #ffffff;
    text-decoration: none;
    filter: brightness(0.96);
}

.studio-secondary-action {
    width: min(100%, 520px);
    margin-top: 12px;
}

.studio-secondary-action summary {
    width: fit-content;
    color: var(--accent);
    cursor: pointer;
    font-weight: 700;
}

.compact-form {
    gap: 10px;
    margin-top: 12px;
}

.final-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.technical-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 18px;
    margin: 22px 0;
}

.tech-section {
    margin: 22px 0;
}

.detail-list {
    display: grid;
    grid-template-columns: minmax(120px, 0.36fr) minmax(0, 1fr);
    gap: 10px 16px;
    margin: 0;
}

.detail-list dt {
    color: var(--muted);
    font-weight: 700;
}

.detail-list dd {
    margin: 0;
    min-width: 0;
}

.technical-details {
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 12px;
    background: #ffffff;
}

.technical-details summary {
    cursor: pointer;
    font-weight: 700;
}

.technical-details pre,
.data-table pre {
    max-width: 760px;
    max-height: 360px;
    overflow: auto;
    white-space: pre-wrap;
    word-break: break-word;
}

.stack-list {
    display: grid;
    gap: 10px;
}

.list-row.compact {
    align-items: flex-start;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 12px;
}

@media (max-width: 900px) {
    .brand-logo {
        width: 72px;
        max-width: 72px;
        height: 32px;
        max-height: 32px;
    }

    .studio-steps,
    .studio-workspace {
        grid-template-columns: 1fr;
    }

    .primary-action-panel {
        align-items: stretch;
        flex-direction: column;
    }

    .detail-list {
        grid-template-columns: 1fr;
    }
}

/* ============================================================
   ACCESS PIECE STUDIO UX - referência visual do Gerador
   Sidebar fixa + cards claros + stepper horizontal
   ============================================================ */
:root {
    --azul: #1A56DB;
    --azul-escuro: #1342A8;
    --azul-claro: #E8EEFB;
    --grena: #8B1A4A;
    --grena-escuro: #6B1038;
    --grena-claro: #FBE8F0;
    --gradient: linear-gradient(135deg, #1A56DB, #8B1A4A);
    --bg-primary: #F8F9FC;
    --bg-secondary: #FFFFFF;
    --bg-tertiary: #F0F2F8;
    --text-primary: #1A1D2E;
    --text-secondary: #5A6178;
    --text-muted: #8A91A8;
    --border: #E2E6F0;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.06);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
    --shadow-lg: 0 8px 24px rgba(0,0,0,0.1);
    --radius: 12px;
    --radius-sm: 8px;
}

body.app-page {
    margin: 0 0 0 210px;
    padding-bottom: 34px;
    background: var(--bg-primary) !important;
    color: var(--text-primary) !important;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif !important;
    line-height: 1.6;
    overflow-x: hidden;
}

.app-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 34px;
    width: 210px;
    z-index: 1000;
    overflow-y: auto;
    background: linear-gradient(180deg, #0B2265 0%, #6B0F1F 100%);
    box-shadow: 3px 0 18px rgba(0,0,0,0.28);
}

.sidebar-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 100%;
    padding: 20px 12px 16px;
}

.sidebar-brand {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    gap: 10px;
    padding-bottom: 16px;
    border-bottom: 1px solid rgba(255,255,255,0.22);
    color: rgba(255,255,255,0.95);
    text-align: center;
    text-decoration: none;
}

.sidebar-brand:hover {
    color: #fff;
    text-decoration: none;
}

.sidebar-brand strong {
    font-size: 0.82rem;
    font-weight: 700;
    line-height: 1.35;
}

.sidebar-logo-wrap {
    width: 176px;
    height: 176px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sidebar-logo {
    width: 176px;
    height: 176px;
    object-fit: contain;
}

.sidebar-menu {
    display: flex;
    flex-direction: column;
    gap: 3px;
    width: 100%;
    padding-top: 14px;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 9px;
    min-height: 38px;
    padding: 9px 12px;
    border-radius: 8px;
    color: rgba(255,255,255,0.75);
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
    white-space: nowrap;
    transition: all 0.2s;
}

.sidebar-link:hover {
    background: rgba(255,255,255,0.13);
    color: #fff;
    text-decoration: none;
}

.sidebar-link.active {
    background: rgba(255,255,255,0.2);
    border-left: 3px solid #fff;
    color: #fff;
    font-weight: 600;
    padding-left: 9px;
}

.sidebar-footer-actions {
    margin-top: auto;
    width: 100%;
    display: grid;
    justify-items: center;
    gap: 7px;
    padding-top: 12px;
    color: rgba(255,255,255,0.72);
    font-size: 12px;
}

.sidebar-footer-actions a {
    color: rgba(255,255,255,0.82);
    text-decoration: none;
}

.sidebar-footer-actions a:hover {
    color: #fff;
}

.sidebar-config {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(255,255,255,0.25);
    transition: all .2s;
}

.sidebar-config:hover,
.sidebar-config.active {
    background: rgba(255,255,255,0.16);
}

.dashboard {
    width: min(1400px, calc(100% - 40px));
    height: calc(100vh - 34px);
    overflow-y: auto;
    margin: 0 auto;
    padding: 24px 20px 90px;
}

.dashboard::-webkit-scrollbar,
.app-sidebar::-webkit-scrollbar {
    width: 0;
    height: 0;
}

.site-footer {
    position: fixed;
    bottom: 0;
    left: 210px;
    right: 0;
    z-index: 999;
    width: calc(100% - 210px);
    margin: 0;
    padding: 7px 20px;
    border-top: 1px solid var(--border);
    background: var(--bg-secondary);
    box-shadow: 0 -2px 8px rgba(0,0,0,0.05);
    color: var(--text-muted);
    text-align: center;
    font-size: 12px;
}

.site-footer span {
    color: var(--grena);
    font-weight: 600;
}

/* Título central como a tela do Gerador */
.etapa1-titulo-fora {
    min-height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 0 14px 0;
    color: var(--grena);
    font-size: 2rem;
    font-weight: 700;
    line-height: 1.2;
    text-align: center;
}

.studio-utility-bar {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-bottom: 8px;
}

.kanban-topo {
    min-height: 74px;
    margin: 0 0 16px 0;
    padding: 12px 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg-secondary);
    box-shadow: var(--shadow-sm);
}

.etapas-progress {
    display: flex;
    justify-content: space-between;
    position: relative;
}

.etapas-progress::before {
    content: '';
    position: absolute;
    top: 20px;
    left: 8%;
    right: 8%;
    height: 3px;
    background: var(--border);
    z-index: 0;
}

.etapa-step {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    z-index: 1;
    transition: all 0.2s;
}

.etapa-numero {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--border);
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    font-size: 11px;
    font-weight: 700;
    transition: all 0.2s;
}

.etapa-step.active .etapa-numero {
    background: var(--gradient);
    color: #fff;
    border-color: var(--azul);
    box-shadow: 0 0 12px rgba(26, 86, 219, 0.25);
}

.etapa-step.completed .etapa-numero {
    background: #059669;
    border-color: #059669;
    color: #fff;
}

.etapa-nome {
    max-width: 110px;
    margin-top: 8px;
    color: var(--text-secondary);
    font-size: 11px;
    font-weight: 500;
    text-align: center;
}

.etapa-step.active .etapa-nome {
    color: var(--azul);
    font-weight: 700;
}

.etapa-principal,
.panel,
.auth-panel,
.stats-grid article,
.dashboard-action-card,
.admin-dashboard-card,
.studio-card,
.primary-action-panel {
    border-radius: var(--radius);
}

.etapa-principal {
    margin-bottom: 24px;
    padding: 28px;
    border: 1px solid var(--border);
    background: var(--bg-secondary);
    box-shadow: var(--shadow-sm);
}

.form-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-bottom: 16px;
}

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

.form-group {
    margin-bottom: 16px;
}

.form-label,
label.form-label {
    display: block;
    margin-bottom: 6px;
    color: var(--azul) !important;
    font-size: 13px;
    font-weight: 600;
}

.form-input,
.form-textarea,
.form-select,
input,
select,
textarea {
    border: 1.5px solid rgba(26, 86, 219, 0.26);
    border-radius: var(--radius-sm);
    background: var(--bg-tertiary);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 14px;
    transition: all 0.2s;
}

.form-input,
.form-select {
    min-height: 47px;
    padding: 12px 16px;
}

textarea,
.form-textarea {
    min-height: 110px;
    padding: 12px 16px;
}

input:focus,
select:focus,
textarea:focus,
.form-input:focus,
.form-textarea:focus,
.form-select:focus {
    border-color: var(--azul);
    outline: none;
    box-shadow: 0 0 0 3px rgba(26, 86, 219, 0.12);
    background: #fff;
}

input[readonly],
.form-input[readonly] {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.btn-link,
.primary-button,
button {
    border-radius: var(--radius-sm);
    font-family: inherit;
}

.btn-link {
    min-height: 38px;
    padding: 9px 14px;
}

.btn-link.secondary {
    background: var(--bg-tertiary);
    border: 1.5px solid var(--border);
    color: var(--text-primary);
}

.btn-link.secondary:hover {
    background: var(--border);
    color: var(--text-primary);
}

.primary-button,
button.primary-button {
    min-height: 46px;
    border-radius: var(--radius-sm);
    background: var(--gradient);
    color: #fff;
    padding: 11px 22px;
    font-size: 14px;
    font-weight: 700;
    box-shadow: var(--shadow-sm);
}

.primary-button:hover,
button.primary-button:hover {
    opacity: 0.93;
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
    text-decoration: none;
}

.studio-shell-card {
    padding-top: 28px;
}

.studio-info-grid {
    align-items: end;
}

.studio-workspace {
    display: grid;
    grid-template-columns: minmax(0, 1.08fr) minmax(320px, 0.92fr);
    gap: 16px;
    margin: 6px 0 18px;
}

.studio-card.clean-card,
.studio-card {
    padding: 20px;
    border: 1px solid var(--border);
    background: var(--bg-tertiary);
    box-shadow: none;
}

.studio-card h2,
.primary-action-panel h2 {
    margin: 0 0 12px 0;
    color: var(--azul);
    font-size: 14px;
    font-weight: 700;
}

.generated-text {
    display: grid;
    gap: 12px;
    color: var(--text-primary);
    font-size: 14px;
}

.generated-text h3 {
    margin: 0;
    color: var(--grena);
    font-size: 18px;
    line-height: 1.25;
}

.empty-copy {
    min-height: 120px;
    display: grid;
    place-items: center;
    border: 1px dashed var(--border);
    border-radius: var(--radius-sm);
    background: #fff;
}

.studio-image-preview {
    display: block;
    width: 100%;
    max-height: 420px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: #fff;
    object-fit: contain;
}

.primary-action-panel {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin: 20px 0 0;
    padding: 18px 20px;
    border: 1px solid var(--border);
    background: #fff;
    box-shadow: var(--shadow-sm);
}

.primary-action-panel > div > span,
.muted-text {
    color: var(--text-muted);
}

.studio-secondary-action {
    width: min(100%, 520px);
    margin-top: 12px;
}

.studio-secondary-action summary {
    width: fit-content;
    color: var(--grena);
    cursor: pointer;
    font-weight: 700;
}

.final-actions,
.studio-top-actions,
.action-bar,
.actions-cell,
.button-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.dashboard-hero {
    border-radius: var(--radius);
    background: var(--gradient);
}

.alert {
    border-radius: var(--radius-sm);
}

.data-table th {
    color: var(--azul);
    text-transform: none;
}

@media (max-width: 980px) {
    body.app-page {
        margin-left: 0;
        padding-top: 60px;
    }

    .app-sidebar {
        top: 0;
        left: 0;
        right: 0;
        bottom: auto;
        width: 100%;
        height: 60px;
        overflow: hidden;
    }

    .sidebar-inner {
        flex-direction: row;
        height: 100%;
        min-height: 0;
        padding: 8px 16px;
        align-items: center;
    }

    .sidebar-brand {
        flex-direction: row;
        width: auto;
        border-bottom: none;
        padding-bottom: 0;
    }

    .sidebar-logo-wrap,
    .sidebar-logo {
        width: 58px;
        height: 58px;
    }

    .sidebar-brand strong {
        font-size: 0.78rem;
        text-align: left;
    }

    .sidebar-menu,
    .sidebar-footer-actions {
        display: none;
    }

    .dashboard {
        width: min(100%, calc(100% - 32px));
        height: calc(100vh - 60px - 34px);
        padding: 18px 0 80px;
    }

    .site-footer {
        left: 0;
        width: 100%;
    }

    .form-row,
    .form-row.two-cols,
    .studio-info-grid.two-cols,
    .studio-workspace {
        grid-template-columns: 1fr;
    }

    .etapas-progress {
        gap: 12px;
    }

    .primary-action-panel {
        align-items: stretch;
        flex-direction: column;
    }
}


/* ============================================================
   AJUSTES V6 - UX solicitada em 02/06/2026
   Login proporcional, página inicial em Nova Peça e histórico em abas.
   ============================================================ */
.auth-page {
    min-height: 100vh;
    background: linear-gradient(135deg, #0B2265 0%, #3b2459 48%, #6B0F1F 100%) !important;
    padding: 42px 16px !important;
}

.auth-shell {
    width: min(100%, 520px) !important;
}

.auth-panel {
    width: 100%;
    border: 1px solid rgba(255,255,255,0.22) !important;
    border-radius: 18px !important;
    background: rgba(255,255,255,0.14) !important;
    box-shadow: 0 28px 80px rgba(0,0,0,0.28) !important;
    padding: 42px 42px 46px !important;
    color: #fff;
    backdrop-filter: blur(8px);
}

.auth-panel .brand-mark {
    display: flex;
    justify-content: center;
    margin: 0 0 28px;
}

.login-logo {
    width: min(260px, 72%);
    height: auto;
    display: block;
    filter: drop-shadow(0 8px 10px rgba(0,0,0,0.35));
}

.auth-panel h1 {
    color: #fff;
    font-size: clamp(28px, 4vw, 38px);
    line-height: 1.1;
    text-align: center;
    margin: 0 0 24px;
    font-weight: 800;
}

.auth-panel label {
    color: #fff;
    font-size: 16px;
}

.auth-panel input {
    min-height: 50px;
    border: 1.5px solid rgba(255,255,255,0.55);
    border-radius: 10px;
    background: rgba(255,255,255,0.94);
    color: #1A1D2E;
    font-size: 16px;
}

.auth-panel button[type="submit"] {
    width: 100%;
    min-height: 52px;
    border-radius: 9px;
    background: linear-gradient(135deg, #1A56DB, #8B1A4A);
    color: #fff;
    font-size: 20px;
    font-weight: 800;
}

.auth-panel .alert {
    color: #7a1b1b;
    background: rgba(255,255,255,0.92);
}

.page-heading-centered {
    align-items: center;
    margin-bottom: 24px;
}

.page-heading-centered h1 {
    color: var(--grena);
    font-size: clamp(30px, 3vw, 42px);
    font-weight: 800;
    line-height: 1.15;
    margin: 0;
}

.marketing-form-panel {
    border-radius: var(--radius);
    padding: 26px 28px 30px;
}

.form-section-title {
    color: var(--azul);
    font-size: 18px;
    margin: 0 0 20px;
}

.history-panel {
    padding: 22px 24px 26px;
}

.history-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 18px;
    border-bottom: 1px solid var(--border);
    padding-bottom: 12px;
}

.history-tab {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 38px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    padding: 8px 14px;
    font-weight: 700;
    cursor: pointer;
}

.history-tab span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    height: 22px;
    border-radius: 999px;
    background: #fff;
    color: var(--azul);
    font-size: 12px;
}

.history-tab.active {
    border-color: var(--grena);
    background: var(--gradient);
    color: #fff;
}

.history-tab.active span {
    color: var(--grena);
}

.history-tab-panel {
    display: none;
}

.history-tab-panel.active {
    display: block;
}

.history-table th:last-child,
.history-table td:last-child {
    width: 210px;
}

@media (max-width: 768px) {
    .auth-panel { padding: 30px 22px 34px !important; }
    .login-logo { width: min(220px, 82%); }
    .history-table th:last-child,
    .history-table td:last-child { width: auto; }
}


/* ============================================================
   AJUSTES V7 - Fluxo operacional correto
   Ordem: Gerar Peças -> Landing Page -> Campanhas.
   ============================================================ */
.workflow-subtitle {
    margin: 8px 0 0;
    color: #5A6178;
    font-size: 15px;
    font-weight: 500;
    text-align: center;
}


/* ============================================================
   AJUSTES V8 - Logo oficial + Analytics
   ============================================================ */
.sidebar-logo-wrap {
    width: 182px !important;
    height: 118px !important;
    margin: 14px auto 8px !important;
}

.sidebar-logo {
    width: 182px !important;
    height: auto !important;
    max-height: 118px !important;
    object-fit: contain !important;
    filter: drop-shadow(0 8px 8px rgba(0,0,0,0.42));
}

.login-logo {
    width: min(340px, 82%) !important;
    max-height: 210px !important;
    object-fit: contain !important;
}

.analytics-heading {
    margin-bottom: 20px;
}

.analytics-stats article {
    border-radius: var(--radius);
    background: #fff;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
}

.analytics-stats article span {
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 700;
}

.analytics-stats article strong {
    color: var(--grena);
    font-size: 32px;
    font-weight: 800;
}

.analytics-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
    margin-top: 18px;
}

.analytics-grid-wide {
    align-items: start;
}

.analytics-card {
    border-radius: var(--radius);
    padding: 22px 24px;
}

.analytics-card h2 {
    margin: 0 0 16px;
    color: var(--azul);
    font-size: 17px;
}

.analytics-bars {
    display: grid;
    gap: 13px;
}

.analytics-bar-row {
    display: grid;
    grid-template-columns: minmax(110px, 160px) minmax(120px, 1fr) 42px;
    align-items: center;
    gap: 10px;
    color: var(--text-secondary);
    font-size: 13px;
}

.analytics-bar-row span {
    font-weight: 700;
    color: var(--text-primary);
}

.analytics-bar-row div {
    height: 11px;
    overflow: hidden;
    border-radius: 999px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
}

.analytics-bar-row b {
    display: block;
    height: 100%;
    border-radius: 999px;
    background: var(--gradient);
}

.analytics-bar-row em {
    color: var(--grena);
    font-style: normal;
    font-weight: 800;
    text-align: right;
}

@media (max-width: 980px) {
    .analytics-grid {
        grid-template-columns: 1fr;
    }
    .sidebar-logo-wrap,
    .sidebar-logo {
        width: 120px !important;
        max-height: 58px !important;
        height: auto !important;
        margin: 0 !important;
    }
}

/* Destaque automático após gerar texto ou imagem */
.clean-card:target {
    border-color: rgba(139, 31, 61, 0.42);
    box-shadow: 0 0 0 4px rgba(139, 31, 61, 0.10), var(--shadow);
    scroll-margin-top: 24px;
}
.visual-reference-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
    margin: 1rem 0;
}

.visual-reference-item {
    margin: 0;
    padding: 0.75rem;
    border: 1px solid #dce2e8;
    border-radius: 12px;
    background: #fff;
}

.visual-reference-item img {
    display: block;
    width: 100%;
    aspect-ratio: 1;
    object-fit: contain;
    border-radius: 8px;
    background: #f5f7fa;
}

.visual-reference-item figcaption {
    margin: 0.5rem 0;
    font-size: 0.8rem;
    color: #52606d;
}

.storage-path {
    display: block;
    margin-bottom: 0.75rem;
    overflow-wrap: anywhere;
    color: #52606d;
}

.file-location-box {
    display: grid;
    gap: 0.5rem;
    margin-top: 1rem;
    padding: 1rem;
    border: 1px solid #dce2e8;
    border-radius: 10px;
    background: #f7f9fb;
}

.file-location-box code,
.file-storage-guide code {
    overflow-wrap: anywhere;
    color: #173b68;
}

.file-storage-guide {
    margin-top: 1.25rem;
}

/* Configurações de IA */
.ai-settings-form .panel-subcard {
    background: #f4f7fb;
    border: 1px solid #dfe7f3;
    border-radius: 16px;
    padding: 22px;
    margin-top: 20px;
}
.ai-settings-form .panel-subcard h2 {
    margin: 0 0 6px 0;
    color: #0f4fbd;
    font-size: 1.05rem;
}
.ai-settings-form .panel-subcard p {
    margin: 0 0 18px 0;
    color: #63708a;
}
.ai-settings-form .action-row {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 14px;
}
.ai-settings-form .final-actions {
    justify-content: flex-end;
    border-top: 1px solid #dfe7f3;
    padding-top: 20px;
    margin-top: 22px;
}
.ai-settings-form small {
    color: #6b7890;
    display: block;
    margin-top: 6px;
}
