:root {
    --color-bg: #ffffff;
    --color-surface-dark: #000000;
    --color-surface-dark-text: #ffffff;
    --color-primary: #28a745;
    --color-primary-hover: #218838;
    --color-primary-focus: rgba(40, 167, 69, 0.3);
    --color-border: #dee2e6;
    --color-text: #212529;
    --color-text-muted: #6c757d;
    --color-error: #f8d7da;
    --color-error-text: #721c24;
    --color-success-bg: rgba(40, 167, 69, 0.2);
    --color-success-border: rgba(40, 167, 69, 0.5);
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 14px;
    color: var(--color-text);
    background: var(--color-bg);
}

/* Layout admin */
.admin-container {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.admin-header {
    background: var(--color-surface-dark);
    color: var(--color-surface-dark-text);
    padding: 0.75rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.admin-header-brand {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.admin-header-logo {
    height: 36px;
    width: auto;
}

.admin-header-title {
    font-weight: 600;
    font-size: 1.1rem;
}

.btn-logout {
    background: transparent;
    color: var(--color-surface-dark-text);
    border: 1px solid rgba(255, 255, 255, 0.5);
}

.btn-logout:hover {
    background: rgba(255, 255, 255, 0.1);
}

.admin-body {
    display: flex;
    flex: 1;
}

.admin-sidebar {
    width: 200px;
    min-width: 200px;
    background: var(--color-bg);
    border-right: 1px solid var(--color-border);
}

.admin-sidebar a {
    display: block;
    padding: 0.75rem 1rem;
    color: var(--color-text);
    text-decoration: none;
}

.admin-sidebar a:hover,
.admin-sidebar a.active {
    background: var(--color-surface-dark);
    color: var(--color-surface-dark-text);
}

.admin-content {
    flex: 1;
    padding: 1.5rem;
}

/* Botões */
.btn {
    display: inline-block;
    padding: 0.5rem 1rem;
    font-size: 14px;
    font-weight: 500;
    text-align: center;
    border-radius: 4px;
    cursor: pointer;
    border: 1px solid transparent;
    text-decoration: none;
}

.btn-primary {
    background: var(--color-primary);
    color: white;
    border-color: var(--color-primary);
}

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

.btn-secondary {
    background: white;
    color: var(--color-text);
    border: 1px solid var(--color-border);
}

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

/* Formulários */
.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.25rem;
    font-weight: 500;
}

.form-control {
    width: 100%;
    padding: 0.5rem 0.75rem;
    font-size: 14px;
    border: 1px solid var(--color-border);
    border-radius: 6px;
}

.form-control:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 2px var(--color-primary-focus);
}

/* Tabelas */
table {
    width: 100%;
    border-collapse: collapse;
}

th, td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid var(--color-border);
}

th {
    background: var(--color-surface-dark);
    color: var(--color-surface-dark-text);
    font-weight: 600;
}

/* Alerts */
.alert {
    padding: 0.75rem 1rem;
    border-radius: 4px;
    margin-bottom: 1rem;
}

.alert-error {
    background: var(--color-error);
    color: var(--color-error-text);
    border: 1px solid #f5c6cb;
}

.alert-success {
    background: var(--color-success-bg);
    border: 1px solid var(--color-success-border);
    color: var(--color-text);
}

/* Admin content */
.admin-content-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.admin-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin: 0;
}

.admin-filter {
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.admin-filter label {
    margin-right: 0.5rem;
}

.form-control-inline {
    width: auto;
    min-width: 180px;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
}

.admin-table th,
.admin-table td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid var(--color-border);
}

.admin-table th {
    background: var(--color-surface-dark);
    color: var(--color-surface-dark-text);
    font-weight: 600;
}

.btn-sm {
    padding: 0.35rem 0.6rem;
    font-size: 0.85rem;
}

.btn-danger {
    background: #dc3545;
    color: white;
    border-color: #dc3545;
}

.btn-danger:hover {
    background: #c82333;
    border-color: #bd2130;
}

.admin-pagination {
    margin-top: 1rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}

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

.admin-form {
    max-width: 500px;
}

.form-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
}

.admin-meta {
    color: var(--color-text-muted);
    margin-bottom: 1.5rem;
}

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

/* Home page header */
.page-header-home {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.lang-switch {
    display: flex;
    gap: 0.4rem;
    align-items: center;
}

.lang-switch .btn-sm.active {
    background: var(--color-surface-dark);
    color: var(--color-surface-dark-text);
    border-color: var(--color-surface-dark);
}

/* Doc content (rendered Markdown) */
.doc-content { max-width: 760px; line-height: 1.7; }
.doc-content h1 { font-size: 1.4rem; margin: 1.5rem 0 0.5rem; border-bottom: 2px solid var(--color-border); padding-bottom: 0.4rem; }
.doc-content h2 { font-size: 1.15rem; margin: 1.5rem 0 0.5rem; }
.doc-content h3 { font-size: 1rem; margin: 1.2rem 0 0.4rem; }
.doc-content p { margin: 0.5rem 0; }
.doc-content ul, .doc-content ol { padding-left: 1.5rem; margin: 0.5rem 0; }
.doc-content li { margin-bottom: 0.25rem; }
.doc-content blockquote { border-left: 3px solid var(--color-border); margin: 0.75rem 0; padding: 0.5rem 1rem; color: var(--color-text-muted); background: #f8f9fa; }
.doc-content code { background: #f1f3f5; padding: 0.15rem 0.4rem; border-radius: 3px; font-family: monospace; font-size: 0.9em; }
.doc-content pre { background: #1e1e1e; color: #d4d4d4; padding: 1rem; border-radius: 6px; overflow-x: auto; margin: 0.75rem 0; }
.doc-content pre code { background: none; padding: 0; color: inherit; font-size: 0.875rem; }
.doc-content table { width: 100%; border-collapse: collapse; margin: 0.75rem 0; }
.doc-content table th, .doc-content table td { padding: 0.5rem 0.75rem; border: 1px solid var(--color-border); text-align: left; }
.doc-content table th { background: var(--color-surface-dark); color: var(--color-surface-dark-text); font-weight: 600; }
.doc-content a { color: var(--color-primary); text-decoration: none; }
.doc-content a:hover { text-decoration: underline; }
.doc-content hr { border: none; border-top: 1px solid var(--color-border); margin: 1.5rem 0; }

/* Tabs */
.tab-nav {
    display: flex;
    border-bottom: 2px solid var(--color-border);
    margin-bottom: 1.5rem;
    gap: 0;
}

.tab-nav a {
    padding: 0.6rem 1.25rem;
    text-decoration: none;
    color: var(--color-text-muted);
    font-weight: 500;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
}

.tab-nav a:hover {
    color: var(--color-text);
}

.tab-nav a.active {
    color: var(--color-text);
    border-bottom-color: var(--color-surface-dark);
}

.tab-nav a.tab-coming-soon {
    color: var(--color-text-muted);
    opacity: 0.5;
    cursor: default;
    pointer-events: none;
}

.coming-soon-panel {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 4rem 2rem;
    color: var(--color-text-muted);
    text-align: center;
    border: 2px dashed var(--color-border);
    border-radius: 8px;
}

.coming-soon-panel h2 {
    margin: 0.5rem 0;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--color-text);
}

.coming-soon-panel p {
    margin: 0;
    font-size: 0.9rem;
}
