:root {
    --bg-color: #0f1115;
    --panel-bg: #1a1d24;
    --primary: #007bff;
    --primary-hover: #0056b3;
    --text-light: #f8f9fa;
    --text-muted: #adb5bd;
    --border: #2c3038;
    --success: #28a745;
    --deficit: #f53333;
    --blue: #52aaf7;
}

/* Customização da Barra de Rolagem */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: var(--bg-color); }
::-webkit-scrollbar-thumb {
    background: #343a40;
    border-radius: 10px;
    border: 2px solid var(--bg-color);
}
::-webkit-scrollbar-thumb:hover { background: var(--primary); }

* {
    scrollbar-width: thin;
    scrollbar-color: #343a40 var(--bg-color);
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

body {
    background-color: var(--bg-color);
    color: var(--text-light);
    display: flex;
    min-height: 100vh;
}

/* Sidebar Navegação */
.sidebar {
    width: 250px;
    background-color: var(--panel-bg);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    padding: 20px 0;
}

.brand {
    padding: 20px;
    text-align: center;
    margin-bottom: 20px;
}

.logo-img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 0 auto;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.5));
}

.brand span { color: var(--primary); }

.nav-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    padding: 15px 25px;
    text-align: left;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    border-left: 4px solid transparent;
}

.nav-btn:hover {
    background-color: rgba(255, 255, 255, 0.05);
    color: var(--text-light);
}

.nav-btn.active {
    background-color: rgba(0, 123, 255, 0.1);
    color: var(--blue);
    border-left-color: var(--primary);
}

/* Área de Conteúdo principal */
.main-content {
    flex: 1;
    padding: 40px;
    overflow-y: auto;
}

.tab-content {
    display: none;
    animation: fadeIn 0.3s ease-in-out;
}

.tab-content.active { display: block; }

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

h2 {
    margin-bottom: 20px;
    color: #fff;
    font-weight: 600;
}

/* Formulários e Inputs */
.card {
    background-color: var(--panel-bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 25px;
    margin-bottom: 30px;
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

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

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

label {
    margin-bottom: 8px;
    font-size: 14px;
    color: var(--text-muted);
}

input, textarea, select {
    background-color: var(--bg-color);
    border: 1px solid var(--border);
    color: var(--text-light);
    padding: 12px;
    border-radius: 6px;
    font-size: 15px;
    outline: none;
    transition: border-color 0.3s ease;
}

input:focus, textarea:focus, select:focus {
    border-color: var(--blue);
}

button.btn-primary, button.btn-primary2 {
    background-color: var(--primary);
    color: #fff;
    border: none;
    padding: 12px 24px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    font-size: 15px;
    transition: background-color 0.3s ease;
    margin-top: 15px;
}

button.btn-primary:hover, button.btn-primary2:hover {
    background-color: var(--primary-hover);
}

/* Tabelas */
table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}

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

th {
    color: var(--text-muted);
    font-weight: 500;
    font-size: 14px;
    text-transform: uppercase;
}

td { font-size: 15px; }

/* Estilos para os Modais */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.8);
    align-items: center;
    justify-content: center;
}

.modal-content {
    background-color: var(--panel-bg);
    padding: 30px;
    border-radius: 8px;
    width: 90%;
    max-width: 600px;
    border: 1px solid var(--primary);
}

.edit-btn {
    background: none;
    border: none;
    color: var(--blue);
    cursor: pointer;
    margin-right: 10px;
    font-size: 14px;
}

.edit-btn:hover { text-decoration: underline; }

/* Orçamentos (Notas) */
.notes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.note-card {
    background-color: var(--panel-bg);
    border-top: 4px solid var(--blue);
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    transition: transform 0.2s ease;
    cursor: pointer;
}

.note-card:hover { transform: translateY(-3px); }

.note-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 15px;
    border-bottom: 1px solid var(--border);
    padding-bottom: 10px;
}

.note-orcamento { font-weight: bold; font-size: 13px; }
.note-client { font-weight: bold; font-size: 18px; }
.note-date { color: var(--text-muted); font-size: 12px; }

.note-body {
    margin-bottom: 15px;
    font-size: 14px;
    line-height: 1.5;
    color: #ccc;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: all 0.3s ease;
}

.note-card.expanded .note-body {
    -webkit-line-clamp: unset;
    max-height: none;
}

.note-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: bold;
}

.note-footer2 {
    display: flex;
    justify-content: space-between;
    align-items: left;
    font-weight: notmal;
}

.note-footer3 {
    display: flex;
    justify-content: space-between;
    align-items: left;
    font-weight: normal;
}

.note-price { color: var(--success); font-size: 18px; }
.note-price1 { color: var(--success); font-size: 18px; }
.note-price2 { color: var(--deficit); font-size: 18px; }
.note-price3 { color: var(--blue); font-size: 18px; }

.delete-btn2 {
    transition: all 0.3s ease;
}

.delete-btn:hover {
    background-color: rgba(220, 53, 69, 0.1); /* Um leve fundo vermelho ao passar o mouse */
    text-decoration: none !important;
}

.delete-btn {
    background: none;
    border: none;
    color: #dc3545;
    cursor: pointer;
    font-size: 14px;
}
.delete-btn:hover { text-decoration: underline; }

.documento-btn {
    background: none;
    border: none;
    color: #8fedf2;
    cursor: pointer;
    margin-right: 10px;
    font-size: 14px;
}
.documento-btn:hover { text-decoration: underline; }

/* Camada de fundo escurecida do Documento */
.overlay {
    display: none;
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background-color: rgba(0, 0, 0, 0.85);
    z-index: 2000;
    justify-content: center;
    align-items: flex-start;
    overflow-y: auto;
    padding: 40px 0;
}

.documento {
    background-color: white;
    width: 210mm;
    min-height: 297mm;
    padding: 20mm;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5); /* Corrigido */
    position: relative;
    color: #333;
    font-family: 'Times New Roman', serif;
    transform: scale(0.85);
    transform-origin: top center;
    margin-bottom: -100px; /* Corrigido */
}

@media (max-width: 220mm) {
    .documento { width: 95%; padding: 10mm; }
}

.area-botoes {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-top: 30px;
    margin-bottom: 30px;
}

.btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    font-family: Arial, sans-serif;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.btn-primario {
    background-color: #1a1a1a; /* Preto moderno, ajustável conforme sua paleta */
    color: #ffffff;
}

.btn-primario:hover {
    background-color: #333333;
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0,0,0,0.15);
}

.btn-secundario {
    background-color: #ffffff;
    color: #1a1a1a;
    border: 2px solid #1a1a1a;
}

.btn-secundario:hover {
    background-color: #f3f3f3;
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0,0,0,0.1);
}

/* NOVA CLASSE: Estilo para campos de apenas leitura */
.input-readonly {
    background-color: #2c2f33 !important;
    color: #b9bbbe !important;
    border: 1px solid #444 !important;
    cursor: not-allowed;
    outline: none;
}
textarea.input-readonly { resize: none; }
