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

:root {
    --primary-color: #f05a28; /* Laranja HCLB */
    --primary-hover: #d94d21; /* Laranja escuro (hover) */
    --primary-strong: #c2410c; /* Laranja mais escuro: usado como fundo de botão sólido para atingir contraste AA com texto branco */
    --primary-light: #fff3f0;
    --secondary-color: #59595b; /* Cinza HCLB */
    --bg-main: #f4f6f8; /* Fundo cinza suave */
    --card-bg: rgba(255, 255, 255, 0.85);
    --card-border: rgba(255, 255, 255, 0.4);
    --text-main: #1e293b;
    --text-muted: #64748b;
    --danger-color: #ef4444;
    --danger-light: #fef2f2;
    --danger-soft-bg: #fee2e2;
    --warning-soft-bg: #ffedd5;
    --neutral-soft-bg: #f1f5f9;
    --border-dashed: #cbd5e1;
    --icon-muted: #94a3b8;
    --badge-ambito-bg: #ffedd5;
    --badge-ambito-color: #c2410c;
    --badge-pessoa-bg: #f1f5f9;
    --badge-pessoa-color: #475569;
    --success-color: #10b981;
    --success-light: #ecfdf5;
    --glass-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.05), 0 1px 3px rgba(0,0,0,0.03);
    --soft-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
    --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-full: 9999px;

    --header-bg: rgba(255, 255, 255, 0.85);
    --input-bg: #f8fafc;
    --input-focus-bg: #ffffff;
    --border-color: #e2e8f0;
    --hover-bg: #f1f5f9;

    /* Aliases: index.html e projetos_lista.js referenciavam --bg-surface/--bg-surface-hover
       sem que essas variáveis existissem em nenhum lugar, então as barras de busca e os
       cabeçalhos de tabela ficavam com fundo transparente (var() sem fallback cai no
       valor inicial). Mantidas como alias para não precisar reescrever cada uso. */
    --bg-surface: var(--card-bg);
    --bg-surface-hover: var(--hover-bg);

    /* Tokens de status (badges de andamento de projeto). Antes eram cores hex soltas
       dentro de projetos_lista.js — centralizadas aqui para consistência com o resto
       do sistema de design e para funcionar automaticamente no tema escuro. */
    --status-info-bg: #eff6ff;
    --status-info-color: #2563eb;
    --status-success-bg: #f0fdf4;
    --status-success-color: #16a34a;
    --status-danger-bg: #fef2f2;
    --status-danger-color: #dc2626;
    --status-neutral-bg: var(--neutral-soft-bg);
    --status-neutral-color: var(--text-muted);
}

[data-theme="dark"] {
    --bg-main: #0f172a;
    --card-bg: rgba(30, 41, 59, 0.85);
    --card-border: rgba(51, 65, 85, 0.6);
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --primary-light: rgba(240, 90, 40, 0.15);
    --danger-soft-bg: rgba(239, 68, 68, 0.18);
    --warning-soft-bg: rgba(194, 65, 12, 0.28);
    --neutral-soft-bg: rgba(148, 163, 184, 0.15);
    --border-dashed: #475569;
    --badge-ambito-bg: rgba(194, 65, 12, 0.28);
    --badge-ambito-color: #fdba74;
    --badge-pessoa-bg: rgba(148, 163, 184, 0.15);
    --badge-pessoa-color: #cbd5e1;
    --status-info-bg: rgba(37, 99, 235, 0.2);
    --status-info-color: #93c5fd;
    --status-success-bg: rgba(22, 163, 74, 0.2);
    --status-success-color: #86efac;
    --status-danger-bg: rgba(220, 38, 38, 0.2);
    --status-danger-color: #fca5a5;
    --status-neutral-bg: var(--neutral-soft-bg);
    --status-neutral-color: var(--text-muted);
    --header-bg: rgba(15, 23, 42, 0.85);
    --input-bg: #1e293b;
    --input-focus-bg: #0f172a;
    --border-color: #334155;
    --hover-bg: #1e293b;
    --glass-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.5), 0 1px 3px rgba(0,0,0,0.3);
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.001ms !important;
        scroll-behavior: auto !important;
    }
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
}

body {
    background-color: var(--bg-main);
    background-image:
        radial-gradient(at 0% 0%, rgba(240, 90, 40, 0.05) 0px, transparent 45%),
        radial-gradient(at 100% 0%, rgba(89, 89, 91, 0.035) 0px, transparent 45%),
        radial-gradient(at 100% 100%, rgba(240, 90, 40, 0.035) 0px, transparent 45%),
        radial-gradient(at 0% 100%, rgba(89, 89, 91, 0.05) 0px, transparent 45%);
    background-attachment: fixed;
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Oculta visualmente mas mantém acessível a leitores de tela (ex.: <h1> da home,
   que a marca já comunica visualmente no logo do header). */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Header */
header {
    background: var(--header-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--card-border);
    box-shadow: 0 1px 3px rgba(0,0,0,0.02);
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
}

/* Fio de acento na cor da marca — assina o topo da página sem depender só do
   laranja do logo, reforçando a identidade sem pesar visualmente. */
header::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: -1px;
    height: 2px;
    background: linear-gradient(90deg, var(--primary-color) 0%, rgba(240, 90, 40, 0) 60%);
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.nav-links a {
    text-decoration: none;
    color: var(--text-main);
    font-weight: 500;
    margin-left: 1.5rem;
    transition: var(--transition);
}

.nav-links a:hover {
    color: var(--primary-color);
}

/* Botão primário sólido. Antes só existia como ".nav-links a.btn-primary" (só valia para
   links dentro do menu), então qualquer <button class="btn-primary"> fora do header (ex.:
   "Cadastrar novo projeto", "+ Novo Usuário") ficava sem nenhum estilo. Também usa
   --primary-strong em vez de --primary-color para o texto branco atingir contraste AA. */
.btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    background: var(--primary-strong);
    color: white;
    border: none;
    padding: 0.6rem 1.25rem;
    border-radius: var(--radius-full);
    box-shadow: 0 4px 12px rgba(240, 90, 40, 0.25);
    font-weight: 600;
    font-size: 0.95rem;
    font-family: inherit;
    text-decoration: none;
    cursor: pointer;
    transition: var(--transition);
}

.btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(240, 90, 40, 0.35);
}

.btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* Estado de foco visível e consistente para todo elemento interativo (antes só os
   inputs de formulário tinham um anel de foco; botões, links e abas não tinham nenhum). */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
    border-radius: 2px;
}

/* Main Container */
main {
    flex: 1;
    max-width: 1600px;
    margin: 0 auto;
    padding: 2rem 5%;
    width: 100%;
}

/* Search and Filters */
.controls-section {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 2rem;
    background: var(--card-bg);
    padding: 1.5rem;
    border-radius: 16px;
    box-shadow: var(--glass-shadow);
    backdrop-filter: blur(10px);
    border: 1px solid var(--card-border);
}

.search-bar {
    flex: 1;
    min-width: 300px;
    position: relative;
}

.search-bar input {
    width: 100%;
    padding: 0.85rem 1rem 0.85rem 2.8rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 1rem;
    outline: none;
    transition: var(--transition);
    background: var(--input-bg);
    color: var(--text-main);
}

.search-bar input:focus {
    border-color: var(--primary-color);
    background: var(--input-focus-bg);
    box-shadow: 0 0 0 4px rgba(240, 90, 40, 0.15);
}

.search-icon {
    position: absolute;
    left: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
}

.filters {
    display: flex;
    gap: 1rem;
}

.filters select {
    padding: 0.85rem 1.25rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 0.95rem;
    outline: none;
    background-color: var(--input-bg);
    color: var(--text-main);
    cursor: pointer;
    transition: var(--transition);
    font-weight: 500;
}

.filters select:focus, .filters select:hover {
    border-color: var(--primary-color);
    background-color: var(--input-focus-bg);
}

.filters select:focus {
    box-shadow: 0 0 0 4px rgba(240, 90, 40, 0.15);
}

/* Grid Layout */
.certidoes-grid {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

/* Estilos de Tabela do Hub */
.certidoes-table-wrapper {
    width: 100%;
    overflow-x: auto;
    background: var(--card-bg);
    border-radius: var(--radius-md);
    border: 1px solid var(--card-border);
    box-shadow: var(--soft-shadow);
}
.certidoes-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    font-size: 0.9rem;
    min-width: 800px;
}

@media (max-width: 480px) {
    .certidoes-table {
        min-width: 640px;
    }
}
.certidoes-table th, .certidoes-table td {
    padding: 1.25rem 1rem;
    border-bottom: 1px solid var(--border-color);
}
.certidoes-table th {
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
    background: var(--input-bg);
    white-space: nowrap;
}

/* Evitar que colunas curtas quebrem linha e forçar a primeira coluna (Nome) a ter mais espaço */
.certidoes-table td.certidao-cell-center {
    white-space: nowrap;
}
.certidoes-table td:nth-child(5), /* Documentos */
.certidoes-table td:nth-child(7)  /* Observações */ {
    white-space: normal;
    min-width: 150px;
}
.certidoes-table th:first-child,
.certidoes-table td:first-child {
    min-width: 300px;
    white-space: normal;
}
.certidoes-table tr {
    transition: var(--transition);
}
.certidoes-table tr:last-child td {
    border-bottom: none;
}
.certidoes-table tr:hover {
    background: var(--primary-light);
}
.certidao-nome-principal {
    font-weight: 600;
    color: var(--text-main);
    display: block;
    margin-bottom: 0.25rem;
}
.certidao-docs {
    color: var(--text-muted);
    font-size: 0.75rem;
}
.certidao-cell-center {
    text-align: center;
}
.btn-table-action {
    background: none;
    border: none;
    color: #94a3b8;
    cursor: pointer;
    padding: 0.4rem;
    border-radius: 4px;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}
.btn-table-action:hover {
    background: var(--hover-bg);
    color: var(--primary-color);
}
.btn-table-action.delete:hover {
    background: var(--danger-soft-bg);
    color: var(--danger-color);
}

/* Card Styling */
.certidao-card {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    padding: 1.75rem;
    box-shadow: var(--soft-shadow);
    border: 1px solid var(--card-border);
    backdrop-filter: blur(12px);
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
}

.certidao-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--glass-shadow);
    border-color: rgba(240, 90, 40, 0.25);
}

.card-header {
    margin-bottom: 1rem;
}

.card-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: 0.5rem;
    line-height: 1.4;
}

.badge-container {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.badge {
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.badge-ambito {
    background-color: var(--badge-ambito-bg);
    color: var(--badge-ambito-color);
}

.badge-pessoa {
    background-color: var(--badge-pessoa-bg);
    color: var(--badge-pessoa-color);
}

/* Usada na tabela de usuários (configuracoes.html) para o papel "Operador".
   Antes a classe referenciada no JS (.badge-arquivos) não existia no CSS. */
.badge-operador {
    background-color: var(--neutral-soft-bg);
    color: var(--text-muted);
}

.card-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.info-row {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.info-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    color: var(--text-muted);
    font-weight: 600;
}

.info-value {
    font-size: 0.9rem;
    color: var(--text-main);
}

.card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid var(--border-color);
    padding-top: 1rem;
    margin-top: auto;
}

.btn-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--primary-color);
    color: white;
    padding: 0.6rem 1.2rem;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.9rem;
    transition: var(--transition);
}

.btn-link:hover {
    background: var(--primary-hover);
    transform: scale(1.05);
}

.btn-icon {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 50%;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-icon:hover {
    background: var(--neutral-soft-bg);
    color: var(--primary-color);
}

/* Loading State */
.loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem;
    color: var(--text-muted);
    grid-column: 1 / -1;
}

/* Dropdown Menu CSS */
.dropdown {
    position: relative;
    display: inline-block;
}

.dropdown-content {
    display: none;
    position: absolute;
    right: 0;
    top: 100%;
    background-color: var(--card-bg);
    min-width: 220px;
    box-shadow: var(--glass-shadow);
    border-radius: var(--radius-md);
    border: 1px solid var(--card-border);
    z-index: 1000;
    overflow: hidden;
    margin-top: 0.5rem;
}

.dropdown-content a {
    color: var(--text-main);
    padding: 0.75rem 1rem;
    text-decoration: none;
    display: block;
    font-size: 0.9rem;
    transition: background-color 0.2s;
}

.dropdown-content a:hover {
    background-color: var(--hover-bg);
    color: var(--primary-color);
}

.dropdown.show .dropdown-content {
    display: block;
    animation: fadeIn 0.2s ease-out;
}

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

.spinner {
    border: 4px solid rgba(0, 0, 0, 0.1);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border-left-color: var(--primary-color);
    animation: spin 1s linear infinite;
    margin-bottom: 1rem;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Admin Form Styling */
.admin-container {
    background: var(--card-bg);
    border-radius: 16px;
    padding: 2rem;
    box-shadow: var(--glass-shadow);
    border: 1px solid var(--card-border);
    backdrop-filter: blur(10px);
    max-width: 800px;
    margin: 0 auto;
}

.admin-header {
    margin-bottom: 2rem;
    border-bottom: 1px solid #e2e8f0;
    padding-bottom: 1rem;
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

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

.form-group label {
    font-weight: 500;
    color: var(--text-main);
    font-size: 0.9rem;
}

.form-group input, .form-group select, .form-group textarea {
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
    outline: none;
    transition: var(--transition);
    background: var(--input-bg);
    color: var(--text-main);
}

.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
    border-color: var(--primary-color);
    background: var(--input-focus-bg);
    box-shadow: 0 0 0 3px rgba(240, 90, 40, 0.2);
}

.form-actions {
    margin-top: 2rem;
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
}

.btn-secondary {
    background: var(--card-bg);
    color: var(--text-main);
    border: 1px solid var(--border-color);
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
    transition: var(--transition);
    text-decoration: none;
}

.btn-secondary:hover {
    background: var(--hover-bg);
}

.btn-submit {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
    transition: var(--transition);
    box-shadow: 0 4px 6px rgba(240, 90, 40, 0.25);
}

.btn-submit:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(240, 90, 40, 0.3);
}

/* Toast Notifications */
.toast-container {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    z-index: 1000;
}

.toast {
    background: var(--card-bg);
    color: var(--text-main);
    padding: 1rem 1.5rem;
    border-radius: 8px;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    transform: translateX(120%);
    transition: transform 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    border-left: 4px solid var(--primary-color);
}

.toast.show {
    transform: translateX(0);
}

.toast.success {
    border-left-color: var(--secondary-color);
}

.toast.error {
    border-left-color: var(--danger-color);
}

/* Empty State */
.empty-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: 4rem 2rem;
    background: var(--card-bg);
    border-radius: 16px;
    border: 1px dashed var(--border-dashed);
}

.empty-state svg {
    color: var(--icon-muted);
    margin-bottom: 1rem;
}

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

/* Título de seção de aba (Projetos, Certidões Emitidas, Equipes). Antes era um <h2>
   com estilo inline repetido em cada aba no index.html. */
.section-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-main);
    letter-spacing: -0.01em;
}

/* Badge de status de projeto — antes eram cores hex escritas na mão em projetos_lista.js */
.status-badge {
    display: inline-block;
    padding: 0.3rem 0.65rem;
    border-radius: var(--radius-sm);
    font-size: 0.78rem;
    font-weight: 600;
}
.status-badge--andamento { background: var(--status-info-bg); color: var(--status-info-color); }
.status-badge--concluido { background: var(--status-success-bg); color: var(--status-success-color); }
.status-badge--cancelado { background: var(--status-danger-bg); color: var(--status-danger-color); }
.status-badge--default   { background: var(--status-neutral-bg); color: var(--status-neutral-color); }

/* Linhas de tabela clicáveis que abrem uma "ficha" de detalhe (Projetos e Certidões
   Emitidas). O botão/link dentro da linha continua funcionando normalmente — o JS
   ignora o clique na linha quando ele já começou dentro de um <button>/<a>. */
.row-clickable {
    cursor: pointer;
    transition: var(--transition);
}
.row-clickable:hover {
    background: var(--primary-light);
}
.row-clickable:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: -2px;
    background: var(--primary-light);
}
.row-chevron-cell {
    width: 2.5rem;
    text-align: center;
}
.row-chevron {
    display: inline-flex;
    color: var(--icon-muted);
    transition: var(--transition);
}
.row-clickable:hover .row-chevron,
.row-clickable:focus-visible .row-chevron {
    color: var(--primary-color);
    transform: translateX(3px);
}

/* Tabs Navigation */
.tabs-container {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    border-bottom: 1px solid var(--border-color);
}

.tab-btn {
    background: transparent;
    border: none;
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    font-weight: 500;
    color: var(--text-muted);
    cursor: pointer;
    border-bottom: 3px solid transparent;
    transition: var(--transition);
}

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

.tab-btn.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
}

/* Project Form specific */
.project-form-container {
    background: var(--card-bg);
    border-radius: 8px;
    box-shadow: var(--glass-shadow);
    border: 1px solid var(--card-border);
    backdrop-filter: blur(10px);
    overflow: hidden;
}

.project-header-bar {
    height: 4px;
    background-color: var(--primary-color);
    width: 100%;
}

.project-form-content {
    padding: 2rem;
}

.form-row {
    display: flex;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.form-row > * {
    flex: 1;
    min-width: 0;
}

/* Escopado a .project-form-content: essa variante de .form-group (sem "gap", com
   inputs full-width) só deve valer dentro do formulário de projeto. Antes era uma
   regra global e conflitava silenciosamente com a definição de .form-group usada em
   admin.html/configuracoes.html mais acima neste arquivo. */
.project-form-content .form-group {
    display: flex;
    flex-direction: column;
    width: 100%;
}

.project-form-content .form-group input,
.project-form-content .form-group select {
    width: 100%;
    box-sizing: border-box;
    padding: 0.85rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 0.95rem;
    outline: none;
    transition: var(--transition);
    background: var(--input-bg);
    color: var(--text-main);
}

.project-form-content .form-group input:focus,
.project-form-content .form-group select:focus {
    border-color: var(--primary-color);
    background: var(--input-focus-bg);
    box-shadow: 0 0 0 4px rgba(240, 90, 40, 0.15);
}

.project-block {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.project-block-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border-color);
}

.project-block-title {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-transform: uppercase;
}

.btn-add {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

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

.btn-outline {
    background: transparent;
    border: 1px solid #cbd5e1;
    color: var(--text-main);
    padding: 0.5rem 1rem;
    border-radius: 4px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
}

.btn-outline:hover {
    background: var(--neutral-soft-bg);
}

.btn-dark {
    background: #1e293b;
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
}

.btn-dark:hover {
    background: #0f172a;
}

/* Projetos Sidebar */
.projetos-layout {
    display: flex;
    gap: 2rem;
    align-items: flex-start;
}

.projetos-sidebar {
    width: 280px;
    background: var(--card-bg);
    border-radius: 8px;
    box-shadow: var(--glass-shadow);
    border: 1px solid var(--card-border);
    padding: 1.5rem;
    flex-shrink: 0;
}

.btn-novo-projeto {
    width: 100%;
    background: #e2e8f0;
    color: var(--text-main);
    border: none;
    padding: 0.75rem;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 2rem;
    transition: var(--transition);
}

.btn-novo-projeto:hover {
    background: #cbd5e1;
}

.lista-projetos {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    max-height: 500px;
    overflow-y: auto;
}

.projeto-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    background: var(--input-bg);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    transition: var(--transition);
}

.projeto-item:hover {
    border-color: var(--primary-color);
    background: var(--hover-bg);
}

.projeto-info {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.projeto-nome {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-main);
}

.projeto-status {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.btn-delete-projeto {
    background: transparent;
    border: none;
    color: #94a3b8;
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 4px;
    transition: var(--transition);
}

.btn-delete-projeto:hover {
    color: var(--danger-color);
    background: var(--danger-soft-bg);
}

.btn-view-projeto:hover, .btn-edit-projeto:hover { color: var(--primary-color); background: var(--warning-soft-bg); }

@media (max-width: 900px) {
    .projetos-layout {
        flex-direction: column;
    }

    .projetos-sidebar {
        width: 100%;
        position: static !important;
    }
}

@media (max-width: 768px) {
    .controls-section {
        flex-direction: column;
    }

    .filters {
        width: 100%;
    }

    .filters select {
        flex: 1;
    }

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

    .form-row {
        flex-direction: column;
        gap: 1rem;
    }

    .info-grid,
    .modal-blocks {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    main {
        padding: 1.25rem 1rem;
    }

    .search-bar {
        min-width: 0;
        width: 100%;
    }

    .controls-section {
        padding: 1rem;
    }

    .modal-content {
        width: 94%;
        padding: 1.25rem;
    }
}
/* Modal Estilos */
.modal-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(15, 23, 42, 0.4); backdrop-filter: blur(6px); z-index: 1000; pointer-events: none; transition: var(--transition); }
.modal-overlay.active { pointer-events: auto; }
.modal-content { background: var(--card-bg); border-radius: var(--radius-lg); padding: 2rem; width: 90%; max-width: 650px; box-shadow: var(--glass-shadow); animation: modalFadeIn 0.3s cubic-bezier(0.16, 1, 0.3, 1); position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); max-height: 90vh; display: flex; flex-direction: column; border: 1px solid var(--card-border); }
@keyframes modalFadeIn { from { opacity: 0; transform: translate(-50%, -48%) scale(0.96); } to { opacity: 1; transform: translate(-50%, -50%) scale(1); } }
.modal-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1.5rem; border-bottom: 1px solid var(--border-color); padding-bottom: 1rem; cursor: grab; user-select: none; }
.modal-header:active { cursor: grabbing; }
.modal-header h2 { font-size: 1.25rem; color: var(--text-main); margin: 0; pointer-events: none; }
.modal-body { overflow-y: auto; flex: 1; padding-right: 0.5rem; }
.btn-close-modal { background: none; border: none; font-size: 1.5rem; color: var(--text-muted); cursor: pointer; transition: color 0.2s; padding: 0.2rem 0.5rem; }
.btn-close-modal:hover { color: var(--danger-color); }
.info-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-bottom: 1.5rem; }
.info-item { display: flex; flex-direction: column; gap: 0.25rem; margin-bottom: 0.75rem; }
.info-item.full-width { grid-column: 1 / -1; }
.modal-blocks { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-top: 1.5rem; border-top: 1px solid var(--border-color); padding-top: 1.5rem; }
.modal-block { background: var(--input-bg); padding: 1rem; border-radius: 8px; border: 1px solid var(--border-color); }
.block-title { font-size: 0.85rem; color: var(--text-muted); margin-bottom: 1rem; text-transform: uppercase; }
.value-container { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; }
.btn-copy { background: transparent; border: none; color: var(--text-muted); cursor: pointer; padding: 0.2rem; border-radius: 4px; opacity: 0.4; transition: all 0.2s; display: flex; align-items: center; justify-content: center; }
.btn-copy:hover { opacity: 1; color: var(--primary-color); background: var(--neutral-soft-bg); }
.value-container:hover .btn-copy { opacity: 0.8; }

/* Estilos de Arquivos do Projeto */
.lista-arquivos { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.5rem; margin-top: 1rem; }
.arquivo-item { display: flex; justify-content: space-between; align-items: center; padding: 0.75rem 1rem; background: var(--input-bg); border: 1px solid var(--border-color); border-radius: 6px; transition: var(--transition); }
.arquivo-item:hover { border-color: var(--primary-color); background: var(--hover-bg); }
.arquivo-info { display: flex; align-items: center; gap: 0.75rem; flex: 1; overflow: hidden; }
.arquivo-nome { font-size: 0.85rem; font-weight: 500; color: var(--text-main); text-decoration: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; transition: color 0.2s; }
.arquivo-nome:hover { color: var(--primary-color); text-decoration: underline; }
.btn-delete-arquivo { background: transparent; border: none; color: var(--text-muted); cursor: pointer; padding: 0.25rem; border-radius: 4px; transition: var(--transition); display: flex; align-items: center; justify-content: center; }
.btn-delete-arquivo:hover { color: var(--danger-color); background: var(--danger-light); }