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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    line-height: 1.6;
    color: #1a1a2e;
    background: #f8f9fc;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.container {
    max-width: 960px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

.header {
    background: #1a1a2e;
    color: #fff;
    padding: 1rem 0;
}

.header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    color: #fff;
    text-decoration: none;
    font-weight: 700;
    font-size: 1.25rem;
}

.header nav a {
    color: #a0aec0;
    text-decoration: none;
    margin-left: 1.5rem;
}

.header nav a:hover {
    color: #fff;
}

main {
    flex: 1;
    padding: 2rem 0;
}

.footer {
    background: #e2e8f0;
    padding: 1rem 0;
    text-align: center;
    font-size: 0.875rem;
    color: #64748b;
}

.hero {
    text-align: center;
    padding: 3rem 0;
}

.hero h1 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

.hero p {
    color: #64748b;
    font-size: 1.125rem;
}

.hero-actions {
    margin-top: 2rem;
}

.btn {
    display: inline-block;
    background: #4f46e5;
    color: #fff;
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    text-decoration: none;
    font-weight: 600;
}

.btn:hover {
    background: #4338ca;
}

.info {
    background: #fff;
    border-radius: 0.75rem;
    padding: 1.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.info code {
    background: #f1f5f9;
    padding: 0.125rem 0.375rem;
    border-radius: 0.25rem;
    font-size: 0.875rem;
}

.alert {
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: 0.5rem;
    padding: 1rem;
    margin-bottom: 1.5rem;
}

.alert-error {
    background: #fef2f2;
    border-color: #fecaca;
    color: #991b1b;
}

.article-list {
    list-style: none;
}

.article-list li {
    background: #fff;
    border-radius: 0.5rem;
    margin-bottom: 0.75rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.article-list a {
    display: block;
    padding: 1rem 1.25rem;
    text-decoration: none;
    color: inherit;
}

.article-list a:hover {
    background: #f8fafc;
}

.article-list .meta {
    display: block;
    font-size: 0.8125rem;
    color: #94a3b8;
    margin-top: 0.25rem;
}

.meta-line {
    color: #64748b;
    margin-bottom: 1.25rem;
}

.materia-pending {
    background: #fff;
    border-radius: 0.75rem;
    padding: 2rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.materia-pending h1 {
    font-size: 1.75rem;
    margin-bottom: 0.75rem;
}

.status-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 999px;
    font-size: 0.8125rem;
    font-weight: 600;
    text-transform: uppercase;
    margin: 0.5rem 0 1rem;
}

.status-queued,
.status-processing {
    background: #fef3c7;
    color: #92400e;
}

.status-published {
    background: #dcfce7;
    color: #166534;
}

.status-failed {
    background: #fee2e2;
    color: #991b1b;
}

/* Conteúdo gerado pela API — um único <article class="materia"> dentro */
.materia-content {
    margin-top: 0.5rem;
}

.materia-content > .materia {
    background: #fff;
    border-radius: 0.75rem;
    padding: 2rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.materia-content .materia header h1 {
    font-size: clamp(1.5rem, 4vw, 2.25rem);
    line-height: 1.25;
    margin-bottom: 1rem;
    color: #1a1a2e;
}

.materia-content .materia-body {
    font-size: 1.0625rem;
    line-height: 1.75;
}

.materia-content .paragraph-zero {
    font-size: 1.125rem;
    color: #334155;
    margin-bottom: 1.25rem;
}

.materia-content .featured-image {
    margin: 1.5rem auto;
    display: block;
    max-width: 960px;
}

.materia-content figure.inline-image {
    margin: 1.5rem auto;
    display: block;
    max-width: 800px;
}

.materia-content .featured-image img,
.materia-content figure.inline-image img {
    width: 100%;
    height: auto;
    max-width: 100%;
    border-radius: 0.75rem;
    display: block;
    object-fit: contain;
}

.materia-content h2 {
    font-size: 1.5rem;
    margin: 2rem 0 1rem;
    padding-top: 0.5rem;
    border-top: 1px solid #e2e8f0;
}

.materia-content h2:first-of-type {
    border-top: none;
    margin-top: 1rem;
}

.materia-content h3 {
    font-size: 1.2rem;
    margin: 1.5rem 0 0.75rem;
}

.materia-content h4 {
    font-size: 1.05rem;
    margin: 1rem 0 0.5rem;
}

.materia-content p {
    margin-bottom: 1rem;
}

.materia-content ul,
.materia-content ol {
    margin: 0.75rem 0 1.25rem 1.5rem;
}

.materia-content li {
    margin-bottom: 0.35rem;
}

.materia-content img {
    max-width: 100%;
    height: auto;
}

.materia-content table,
.materia-content table.comparativa {
    width: 100%;
    border-collapse: collapse;
    margin: 1.25rem 0;
    font-size: 0.95rem;
}

.materia-content th,
.materia-content td {
    border: 1px solid #e2e8f0;
    padding: 0.625rem 0.875rem;
    text-align: left;
    vertical-align: top;
}

.materia-content th {
    background: #f8fafc;
    font-weight: 600;
}

.materia-content .toc {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 0.75rem;
    padding: 1.25rem 1.5rem;
    margin: 1.5rem 0;
}

.materia-content .toc h2 {
    font-size: 1.125rem;
    margin: 0 0 0.75rem;
    border: none;
    padding: 0;
}

.materia-content .toc ul {
    margin: 0;
    list-style: none;
}

.materia-content .toc li {
    margin-bottom: 0.35rem;
}

.materia-content .toc a {
    color: #4f46e5;
    text-decoration: none;
}

.materia-content .toc a:hover {
    text-decoration: underline;
}

.materia-content .editorial-notice,
.materia-content .callout {
    background: #f8fafc;
    border-left: 4px solid #64748b;
    padding: 1rem 1.25rem;
    border-radius: 0 0.5rem 0.5rem 0;
    margin: 1.25rem 0;
    font-size: 0.95rem;
}

.materia-content .callout.aviso-editorial,
.materia-content .callout.nota-editorial {
    background: #fffbeb;
    border-color: #f59e0b;
}

.materia-content .callout.erro-comum,
.materia-content .callout.atencao {
    background: #fef2f2;
    border-color: #ef4444;
}

.materia-content .data-reference {
    color: #64748b;
    margin-bottom: 1rem;
}

.materia-content .pros-cons {
    margin: 2rem 0;
    overflow-x: auto;
}

.materia-content .pros-cons h2 {
    border: none;
    margin-top: 0;
}

.materia-content details {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 0.5rem;
    padding: 0.75rem 1rem;
    margin: 0.5rem 0;
}

.materia-content summary {
    cursor: pointer;
    font-weight: 600;
}

.materia-content .glossary,
.materia-content .faq,
.materia-content .howto,
.materia-content .conclusion-checklist {
    margin: 2rem 0;
}

.materia-content script[type="application/ld+json"] {
    display: none;
}

.article-api-response {
    margin: 2.5rem 0 1rem;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 0.75rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
    overflow: hidden;
}

.article-api-summary {
    display: block;
    padding: 1rem 1.25rem;
    font-size: 1rem;
    font-weight: 600;
    color: #1e293b;
    cursor: pointer;
    list-style: none;
    border-bottom: 1px solid #e2e8f0;
    background: #f8fafc;
}

.article-api-summary::-webkit-details-marker {
    display: none;
}

.article-api-summary::before {
    content: '▸ ';
    color: #6366f1;
}

.article-api-response details[open] .article-api-summary::before {
    content: '▾ ';
}

.article-api-endpoint {
    margin: 0;
    padding: 0.75rem 1.25rem 0;
    font-size: 0.8125rem;
    color: #64748b;
}

.article-api-endpoint code {
    font-size: 0.8125rem;
    word-break: break-all;
}

.article-api-json {
    margin: 0.75rem 1.25rem 1.25rem;
    padding: 1rem 1.125rem;
    max-height: 32rem;
    overflow: auto;
    background: #0f172a;
    color: #e2e8f0;
    border-radius: 0.5rem;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 0.75rem;
    line-height: 1.5;
    white-space: pre;
    word-break: normal;
}

.article-api-json code {
    font-family: inherit;
    font-size: inherit;
    color: inherit;
}

.empty {
    color: #94a3b8;
    text-align: center;
    padding: 2rem;
}

.auth-gate {
    background: #fff;
    border-radius: 0.75rem;
    padding: 2.5rem 2rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    max-width: 640px;
    margin: 1rem auto;
}

.auth-gate h1 {
    margin-bottom: 1rem;
}

.auth-gate ul {
    margin: 1rem 0 1.5rem 1.25rem;
}

/* ── Documentação da API ───────────────────────────────────── */
.page-docs main {
    padding: 0;
}

.container-docs {
    max-width: 100%;
    padding: 0;
}

.docs-page {
    background: #f1f5f9;
}

.docs-hero {
    background: linear-gradient(135deg, #1a1a2e 0%, #2d2a5e 50%, #1e3a5f 100%);
    color: #fff;
    padding: 3rem 1.5rem 3.5rem;
}

.docs-hero-inner {
    max-width: 1120px;
    margin: 0 auto;
}

.docs-badge {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 0.35rem 0.75rem;
    border-radius: 999px;
    margin-bottom: 1rem;
}

.docs-hero h1 {
    font-size: clamp(1.75rem, 4vw, 2.5rem);
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: 0.75rem;
}

.docs-hero-desc {
    font-size: 1.0625rem;
    color: rgba(255, 255, 255, 0.78);
    max-width: 36rem;
    line-height: 1.65;
    margin-bottom: 1.5rem;
}

.docs-base-url {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem;
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 0.5rem;
    padding: 0.625rem 1rem;
}

.docs-base-label {
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: rgba(255, 255, 255, 0.5);
}

.docs-base-url code {
    font-family: ui-monospace, "Cascadia Code", "SF Mono", Menlo, monospace;
    font-size: 0.875rem;
    color: #a5b4fc;
}

.docs-layout {
    display: grid;
    grid-template-columns: 220px minmax(0, 1fr);
    gap: 2rem;
    max-width: 1120px;
    margin: -1.5rem auto 0;
    padding: 0 1.5rem 3rem;
    align-items: start;
}

.docs-sidebar {
    position: sticky;
    top: 1.25rem;
}

.docs-nav {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 0.75rem;
    padding: 1.25rem 0;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.06);
}

.docs-nav-title {
    font-size: 0.6875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #94a3b8;
    padding: 0 1.25rem;
    margin-bottom: 0.75rem;
}

.docs-nav ul {
    list-style: none;
}

.docs-nav a {
    display: block;
    padding: 0.4rem 1.25rem;
    font-size: 0.875rem;
    color: #475569;
    text-decoration: none;
    border-left: 2px solid transparent;
    transition: color 0.15s, border-color 0.15s, background 0.15s;
}

.docs-nav a:hover {
    color: #4f46e5;
    background: #f8fafc;
    border-left-color: #c7d2fe;
}

.docs-content {
    min-width: 0;
}

.docs-callout {
    border-radius: 0.75rem;
    padding: 1rem 1.25rem;
    margin-bottom: 2rem;
    font-size: 0.9375rem;
    line-height: 1.6;
}

.docs-callout-info {
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    color: #1e3a8a;
}

.docs-callout code {
    background: rgba(255, 255, 255, 0.6);
    padding: 0.1rem 0.35rem;
    border-radius: 0.25rem;
    font-size: 0.85em;
}

.docs-section {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 0.75rem;
    padding: 1.75rem 2rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.docs-section h2 {
    font-size: 1.375rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: #0f172a;
    margin-bottom: 0.5rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid #f1f5f9;
}

.docs-section-intro {
    color: #64748b;
    font-size: 0.9375rem;
    margin-bottom: 1.25rem;
}

.docs-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.docs-card {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 0.625rem;
    padding: 1.25rem;
}

.docs-card h3 {
    font-size: 1rem;
    font-weight: 600;
    margin: 0.5rem 0 0.35rem;
}

.docs-card p {
    font-size: 0.875rem;
    color: #64748b;
    margin-bottom: 0.75rem;
}

.docs-auth-tag {
    display: inline-block;
    font-size: 0.6875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0.2rem 0.5rem;
    border-radius: 0.25rem;
}

.docs-auth-tag.bearer {
    background: #ede9fe;
    color: #5b21b6;
}

.docs-auth-tag.master {
    background: #fef3c7;
    color: #92400e;
}

.docs-inline-code {
    font-family: ui-monospace, Menlo, monospace;
    font-size: 0.75rem;
    background: #1e293b;
    color: #e2e8f0;
    padding: 0.5rem 0.75rem;
    border-radius: 0.375rem;
    overflow-x: auto;
    white-space: pre;
    margin: 0;
}

.docs-endpoint-card {
    border: 1px solid #e2e8f0;
    border-radius: 0.625rem;
    padding: 1.25rem;
    margin-top: 1rem;
    background: #fafbfc;
}

.docs-endpoint-card:first-of-type {
    margin-top: 0.75rem;
}

.docs-endpoint-card > p {
    font-size: 0.9375rem;
    color: #475569;
    margin: 0.75rem 0 0;
}

.docs-endpoint-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.625rem;
}

.docs-path {
    font-family: ui-monospace, Menlo, monospace;
    font-size: 0.875rem;
    color: #0f172a;
    background: #fff;
    border: 1px solid #e2e8f0;
    padding: 0.35rem 0.65rem;
    border-radius: 0.375rem;
    word-break: break-all;
}

.docs-auth-pill {
    margin-left: auto;
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 0.2rem 0.55rem;
    border-radius: 999px;
}

.docs-auth-pill.public {
    background: #f1f5f9;
    color: #64748b;
}

.docs-auth-pill.bearer {
    background: #ede9fe;
    color: #6d28d9;
}

.docs-hint {
    font-size: 0.8125rem;
    color: #94a3b8;
    margin-top: 0.5rem;
}

.method {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 3.5rem;
    font-size: 0.6875rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    padding: 0.3rem 0.5rem;
    border-radius: 0.3rem;
    text-transform: uppercase;
    font-family: ui-monospace, Menlo, monospace;
}

.method.get { background: #059669; color: #fff; }
.method.post { background: #2563eb; color: #fff; }
.method.patch { background: #d97706; color: #fff; }
.method.delete { background: #dc2626; color: #fff; }

.docs-code-block {
    margin-top: 1rem;
    border-radius: 0.5rem;
    overflow: hidden;
    border: 1px solid #334155;
}

.docs-code-label {
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #94a3b8;
    background: #1e293b;
    padding: 0.5rem 1rem;
    border-bottom: 1px solid #334155;
}

.docs-code {
    background: #0f172a;
    color: #e2e8f0;
    padding: 1rem 1.25rem;
    margin: 0;
    overflow-x: auto;
    font-family: ui-monospace, "Cascadia Code", Menlo, monospace;
    font-size: 0.8125rem;
    line-height: 1.65;
    white-space: pre-wrap;
    word-break: break-word;
}

.docs-code .tok-key { color: #7dd3fc; }
.docs-code .tok-str { color: #86efac; }

.docs-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
    font-size: 0.875rem;
    border-radius: 0.5rem;
    overflow: hidden;
    border: 1px solid #e2e8f0;
}

.docs-table th,
.docs-table td {
    padding: 0.75rem 1rem;
    text-align: left;
    vertical-align: top;
    border-bottom: 1px solid #f1f5f9;
}

.docs-table th {
    background: #f8fafc;
    font-weight: 600;
    color: #475569;
    font-size: 0.8125rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.docs-table tr:last-child td {
    border-bottom: none;
}

.docs-table code {
    background: #f1f5f9;
    padding: 0.15rem 0.4rem;
    border-radius: 0.25rem;
    font-size: 0.85em;
}

.docs-status-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 0.75rem;
    margin-top: 1.25rem;
}

.docs-status-item {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 0.5rem;
    padding: 0.75rem 1rem;
    font-size: 0.8125rem;
    color: #64748b;
}

.docs-status-item code {
    font-weight: 600;
    color: #0f172a;
}

.docs-status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-bottom: 0.25rem;
}

.docs-status-dot.queued { background: #f59e0b; }
.docs-status-dot.processing { background: #3b82f6; }
.docs-status-dot.published { background: #10b981; }
.docs-status-dot.failed { background: #ef4444; }

.docs-endpoint-list {
    list-style: none;
    margin-top: 0.75rem;
}

.docs-endpoint-list li {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 0;
    border-bottom: 1px solid #f1f5f9;
    font-size: 0.875rem;
}

.docs-endpoint-list li:last-child {
    border-bottom: none;
}

.docs-endpoint-list code {
    font-family: ui-monospace, Menlo, monospace;
    font-size: 0.8125rem;
    color: #334155;
}

.docs-endpoint-list li > span:last-child {
    color: #94a3b8;
    font-size: 0.8125rem;
    white-space: nowrap;
}

.docs-bullet-list {
    margin: 0.75rem 0 0 1.25rem;
    color: #475569;
    font-size: 0.9375rem;
}

.docs-bullet-list li {
    margin-bottom: 0.35rem;
}

.docs-steps {
    list-style: none;
    margin: 1rem 0 1.5rem;
}

.docs-steps li {
    display: flex;
    gap: 1rem;
    padding: 1rem 0;
    border-bottom: 1px solid #f1f5f9;
}

.docs-steps li:last-child {
    border-bottom: none;
}

.docs-step-num {
    flex-shrink: 0;
    width: 2rem;
    height: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #4f46e5;
    color: #fff;
    font-weight: 700;
    font-size: 0.875rem;
    border-radius: 50%;
}

.docs-steps strong {
    display: block;
    font-size: 0.9375rem;
    margin-bottom: 0.2rem;
}

.docs-steps p {
    font-size: 0.875rem;
    color: #64748b;
    margin: 0;
}

@media (max-width: 860px) {
    .docs-layout {
        grid-template-columns: 1fr;
        margin-top: 0;
        padding-top: 1.5rem;
    }

    .docs-sidebar {
        position: static;
    }

    .docs-nav ul {
        display: flex;
        flex-wrap: wrap;
        gap: 0.25rem;
        padding: 0 1rem 0.5rem;
    }

    .docs-nav a {
        border: 1px solid #e2e8f0;
        border-radius: 999px;
        padding: 0.35rem 0.75rem;
        border-left: 1px solid #e2e8f0;
        font-size: 0.8125rem;
    }

    .docs-auth-pill {
        margin-left: 0;
    }

    .docs-section {
        padding: 1.25rem 1.25rem;
    }

    .docs-hero {
        padding: 2rem 1.25rem 2.5rem;
    }
}

/* ── Painel de gestão ─────────────────────────────────────── */
.page-panel main,
.page-panel-login main {
    padding: 0;
}

.container-panel,
.container-panel-login {
    max-width: 100%;
    padding: 0;
}

.page-panel-login .header nav,
.page-panel-login .footer {
    display: none;
}

.panel-login-page {
    min-height: calc(100vh - 4rem);
    display: grid;
    grid-template-columns: 1fr 1fr;
    background: #f1f5f9;
}

.panel-login-hero {
    background: linear-gradient(135deg, #1a1a2e 0%, #2d2a5e 50%, #1e3a5f 100%);
    color: #fff;
    padding: 3rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.panel-login-hero h1 {
    font-size: clamp(1.75rem, 3vw, 2.25rem);
    margin: 0.75rem 0;
}

.panel-login-hero p {
    color: rgba(255, 255, 255, 0.75);
    max-width: 22rem;
    line-height: 1.65;
}

.panel-login-card {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 3rem;
    max-width: 420px;
    margin: 0 auto;
    width: 100%;
}

.panel-login-card h2 {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    color: #0f172a;
}

.panel-login-hint {
    margin: -0.5rem 0 1.25rem;
    padding: 0.75rem 1rem;
    font-size: 0.875rem;
    line-height: 1.5;
    color: #475569;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
}

.panel-login-foot {
    margin-top: 1.5rem;
    text-align: center;
    font-size: 0.875rem;
}

.panel-login-foot a {
    color: #4f46e5;
    text-decoration: none;
}

.panel-shell {
    display: grid;
    grid-template-columns: 240px minmax(0, 1fr);
    min-height: calc(100vh - 4rem);
    background: #f1f5f9;
}

.panel-sidebar {
    background: #1a1a2e;
    color: #fff;
    display: flex;
    flex-direction: column;
    padding: 1.5rem 0;
}

.panel-brand {
    padding: 0 1.25rem 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.panel-brand a {
    color: #fff;
    text-decoration: none;
    font-weight: 700;
    font-size: 1.125rem;
}

.panel-brand-sub {
    display: block;
    font-size: 0.75rem;
    color: #94a3b8;
    margin-top: 0.25rem;
}

.panel-nav {
    flex: 1;
    padding: 1rem 0;
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.panel-nav a {
    color: #94a3b8;
    text-decoration: none;
    padding: 0.6rem 1.25rem;
    font-size: 0.9rem;
    border-left: 3px solid transparent;
    transition: color 0.15s, background 0.15s, border-color 0.15s;
}

.panel-nav a:hover,
.panel-nav a.is-active {
    color: #fff;
    background: rgba(255, 255, 255, 0.06);
    border-left-color: #6366f1;
}

.panel-sidebar-foot {
    padding: 1rem 1.25rem 0;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    font-size: 0.8125rem;
}

.panel-user {
    display: block;
    color: #e2e8f0;
    margin-bottom: 0.35rem;
}

.panel-logout {
    color: #94a3b8;
    text-decoration: none;
}

.panel-logout:hover {
    color: #fff;
}

.panel-main {
    padding: 2rem 2.5rem 3rem;
    max-width: 1100px;
}

.panel-page-head {
    margin-bottom: 1.75rem;
}

.panel-page-head h1 {
    font-size: 1.75rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: #0f172a;
    margin-bottom: 0.35rem;
}

.panel-page-head p {
    color: #64748b;
    font-size: 0.9375rem;
}

.panel-back {
    display: inline-block;
    color: #4f46e5;
    text-decoration: none;
    font-size: 0.875rem;
    margin-bottom: 0.5rem;
}

.panel-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 0.75rem;
    padding: 1.5rem 1.75rem;
    margin-bottom: 1.25rem;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.panel-card h2 {
    font-size: 1.0625rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: #0f172a;
}

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

.panel-stat {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 0.75rem;
    padding: 1.25rem;
}

.panel-stat-label {
    display: block;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #94a3b8;
    margin-bottom: 0.35rem;
}

.panel-stat-value {
    display: block;
    font-size: 1.375rem;
    color: #0f172a;
}

.panel-stat small {
    display: block;
    margin-top: 0.25rem;
    font-size: 0.8125rem;
    color: #64748b;
}

.panel-grid-2 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.25rem;
}

.panel-form label {
    display: block;
    margin-bottom: 1rem;
}

.panel-form label span {
    display: block;
    font-size: 0.8125rem;
    font-weight: 600;
    color: #475569;
    margin-bottom: 0.35rem;
}

.panel-form input,
.panel-form select,
.panel-form textarea {
    width: 100%;
    padding: 0.65rem 0.875rem;
    border: 1px solid #cbd5e1;
    border-radius: 0.5rem;
    font-size: 0.9375rem;
    background: #fff;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.panel-form textarea {
    resize: vertical;
    min-height: 6rem;
    line-height: 1.5;
    font-family: inherit;
}

.panel-instructions {
    white-space: pre-wrap;
    font-size: 0.875rem;
    color: #475569;
}

.panel-log-card {
    margin-bottom: 1.5rem;
}

.panel-log-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0.75rem;
}

.panel-log-head h2 {
    margin: 0;
}

.panel-log-indicator {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #64748b;
    padding: 0.25rem 0.625rem;
    border-radius: 999px;
    background: #f1f5f9;
}

.panel-log-indicator.is-live {
    color: #047857;
    background: #d1fae5;
    animation: panel-log-pulse 2s ease-in-out infinite;
}

@keyframes panel-log-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.65; }
}

.panel-log-viewer {
    margin: 0;
    padding: 0.75rem 0;
    min-height: 12rem;
    max-height: 28rem;
    overflow-y: auto;
    background: #0f172a;
    color: #cbd5e1;
    border: 1px solid #1e293b;
    border-radius: 0.5rem;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 0.8125rem;
    line-height: 1.45;
}

.panel-log-line {
    padding: 0.5rem 1.125rem;
    border-bottom: 1px solid #1e293b;
    word-break: break-word;
}

.panel-log-line:last-child {
    border-bottom: none;
}

.panel-log-line:nth-child(odd) {
    background: rgba(255, 255, 255, 0.02);
}

.panel-log-placeholder {
    color: #94a3b8;
    font-style: italic;
}

.panel-log-error {
    margin: 0.75rem 0 0;
    padding: 0.75rem 1rem;
    font-size: 0.875rem;
    color: #b91c1c;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 0.5rem;
}

.panel-log-error.is-hidden {
    display: none;
}

.panel-form input:focus,
.panel-form select:focus,
.panel-form textarea:focus {
    outline: none;
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

.panel-form small {
    display: block;
    margin-top: 0.35rem;
    font-size: 0.75rem;
    color: #94a3b8;
}

.panel-form-row {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 1rem;
}

.panel-form-row label {
    margin-bottom: 0;
}

.panel-grow {
    flex: 1;
    min-width: 200px;
}

.panel-form-compact label {
    margin-bottom: 0.75rem;
}

.btn-block {
    width: 100%;
    text-align: center;
    border: none;
    cursor: pointer;
    font-size: 0.9375rem;
}

.btn-secondary {
    background: #fff;
    color: #4f46e5;
    border: 1px solid #c7d2fe;
}

.btn-secondary:hover {
    background: #eef2ff;
}

.btn-small {
    padding: 0.35rem 0.75rem;
    font-size: 0.8125rem;
}

.btn-danger {
    background: #fef2f2;
    color: #b91c1c;
    border: 1px solid #fecaca;
}

.btn-danger:hover {
    background: #fee2e2;
}

.panel-alert {
    border-radius: 0.5rem;
    padding: 0.875rem 1rem;
    margin-bottom: 1.25rem;
    font-size: 0.9rem;
}

.panel-alert-success {
    background: #ecfdf5;
    border: 1px solid #a7f3d0;
    color: #065f46;
}

.panel-alert-error {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #991b1b;
}

.panel-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.panel-token-box {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: flex-start;
    background: #0f172a;
    border-radius: 0.5rem;
    padding: 1rem;
    margin-bottom: 1rem;
}

.panel-token-box code {
    flex: 1;
    font-family: ui-monospace, Menlo, monospace;
    font-size: 0.75rem;
    color: #a5b4fc;
    word-break: break-all;
    line-height: 1.5;
}

.panel-meta {
    font-size: 0.8125rem;
    color: #64748b;
    margin: 0.5rem 0;
}

.panel-empty {
    color: #94a3b8;
    font-size: 0.9375rem;
}

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

.panel-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}

.panel-table th,
.panel-table td {
    padding: 0.75rem 0.875rem;
    text-align: left;
    border-bottom: 1px solid #f1f5f9;
}

.panel-table th {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #64748b;
    font-weight: 600;
}

.panel-table a {
    color: #4f46e5;
    text-decoration: none;
    font-weight: 500;
}

.panel-table-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    align-items: center;
}

.panel-table-actions form {
    display: inline;
}

.panel-status {
    display: inline-block;
    font-size: 0.6875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 0.2rem 0.5rem;
    border-radius: 999px;
}

.panel-status-queued { background: #fef3c7; color: #92400e; }
.panel-status-processing { background: #dbeafe; color: #1e40af; }
.panel-status-published { background: #dcfce7; color: #166534; }
.panel-status-failed { background: #fee2e2; color: #991b1b; }

.panel-dl {
    display: grid;
    grid-template-columns: 120px 1fr;
    gap: 0.5rem 1rem;
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.panel-dl dt {
    color: #64748b;
    font-weight: 500;
}

.panel-dl dd {
    margin: 0;
    color: #0f172a;
}

.panel-text-error {
    color: #b91c1c;
}

.panel-cover-preview {
    width: 100%;
    max-width: 480px;
    height: auto;
    border-radius: 0.5rem;
    object-fit: contain;
}

.panel-preview {
    max-height: 480px;
    overflow-y: auto;
    border: 1px solid #e2e8f0;
    border-radius: 0.5rem;
    padding: 1rem;
}

.panel-inline-form {
    margin-top: 0.75rem;
}

@media (max-width: 900px) {
    .panel-login-page {
        grid-template-columns: 1fr;
    }

    .panel-login-hero {
        padding: 2rem 1.5rem;
        min-height: auto;
    }

    .panel-shell {
        grid-template-columns: 1fr;
    }

    .panel-sidebar {
        flex-direction: row;
        flex-wrap: wrap;
        align-items: center;
        padding: 0.75rem 1rem;
        gap: 0.5rem;
    }

    .panel-brand {
        border: none;
        padding: 0;
        flex: 1;
    }

    .panel-nav {
        flex-direction: row;
        flex-wrap: wrap;
        padding: 0;
        width: 100%;
        order: 3;
    }

    .panel-nav a {
        border-left: none;
        border-radius: 999px;
        padding: 0.35rem 0.75rem;
        font-size: 0.8125rem;
    }

    .panel-sidebar-foot {
        border: none;
        padding: 0;
    }

    .panel-main {
        padding: 1.25rem 1rem 2rem;
    }
}