/* Reset básico e fontes */
body, html {
    margin: 0;
    padding: 0;
    font-family: 'Helvetica Neue', Arial, sans-serif;
    background-color: #f4f7f6;
    color: #333;
    line-height: 1.6;
    height: 100%;
}

:root {
    --header-bg-color: #34495e; /* Cor padrão do cabeçalho/sidebar */
    --button-primary-color: #007bff; /* Cor padrão do botão primário */
    --text-color-light: #ecf0f1;
    --sidebar-width: 260px;
    --sidebar-width-collapsed: 70px; /* Largura do menu compacto */
    --top-bar-height: 60px;
    --card-bg: #ffffff;
    --card-border-radius: 8px;
    --card-box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    --input-border-color: #ccc;
    --input-focus-border-color: var(--button-primary-color);
    --item-bg-color: #fdfdfd;
    --item-header-bg-color: #f8f9fa;
    --item-border-color: #e0e0e0;
    --item-content-padding: 20px 25px;
}

/* Layout Principal */
.sidebar {
    width: var(--sidebar-width-collapsed);
    background: linear-gradient(180deg, var(--header-bg-color) 0%, #2c3e50 100%);
    color: var(--text-color-light);
    position: fixed;
    top: 0;
    left: 0;
    height: 100%;
    padding-top: 0;
    box-shadow: 3px 0 15px rgba(0,0,0,0.2);
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.3s ease;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.sidebar:hover {
    width: var(--sidebar-width);
    box-shadow: 3px 0 25px rgba(0,0,0,0.3);
}

.sidebar-header {
    text-align: center;
    padding: 15px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    min-height: 80px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: rgba(0,0,0,0.1);
}

.sidebar .logo {
    max-width: 40px;
    height: auto;
    margin-bottom: 0;
    border-radius: 4px;
    transition: max-width 0.3s ease, margin-bottom 0.3s ease;
}

.sidebar:hover .logo {
    max-width: 80%;
    margin-bottom: 15px;
}

.sidebar .user-info {
    margin-top: 10px;
    opacity: 0;
    max-height: 0;
    overflow: hidden;
    transition: opacity 0.3s ease 0.1s, max-height 0.3s ease;
    text-align: center;
}

.sidebar:hover .user-info {
    opacity: 1;
    max-height: 80px;
}

.sidebar .user-info p {
    margin: 3px 0;
    font-size: 0.8em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    padding: 0 10px;
    line-height: 1.3;
}
.sidebar .user-info p strong {
    font-size: 0.95em;
    display: block;
    color: #fff;
}
.sidebar .user-info p:not(:has(strong)) {
    font-size: 0.75em;
    color: rgba(255,255,255,0.8);
}


.sidebar nav {
    flex-grow: 1;
    overflow-y: auto;
}

.sidebar nav ul {
    list-style: none;
    padding: 0;
    margin: 20px 0 0 0;
}

.sidebar nav ul li a {
    display: flex;
    align-items: center;
    padding: 15px 20px;
    color: var(--text-color-light);
    text-decoration: none;
    transition: all 0.3s ease;
    font-size: 0.95em;
    border-left: 3px solid transparent;
    position: relative;
    white-space: nowrap;
}

.sidebar nav ul li a i {
    min-width: 24px;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2em;
    transition: transform 0.3s ease;
}

.sidebar nav ul li a span {
    opacity: 0;
    margin-left: 0;
    transition: opacity 0.3s ease, margin-left 0.3s ease;
}

.sidebar:hover nav ul li a span {
    opacity: 1;
    margin-left: 15px;
}

.sidebar nav ul li a:hover {
    background-color: rgba(255,255,255,0.1);
    border-left-color: var(--button-primary-color);
    padding-left: 25px;
}

.sidebar nav ul li a:hover i {
    transform: scale(1.1);
}

.sidebar nav ul li a.active {
    background-color: rgba(255,255,255,0.15);
    border-left-color: var(--button-primary-color);
    font-weight: 600;
}

.sidebar nav ul li a.active::before {
    content: '';
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 70%;
    background-color: var(--button-primary-color);
    border-radius: 2px 0 0 2px;
}

.main-content {
    margin-left: var(--sidebar-width-collapsed);
    padding-top: var(--top-bar-height);
    transition: margin-left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.top-bar {
    background-color: var(--header-bg-color);
    color: var(--text-color-light);
    padding: 0 30px;
    height: var(--top-bar-height);
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: fixed;
    top: 0;
    left: var(--sidebar-width-collapsed);
    right: 0;
    z-index: 999;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.top-bar h1 {
    margin: 0;
    font-size: 1.5em;
    flex-grow: 1;
    text-align: left;
    color: var(--text-color-light);
    font-weight: 600;
}

.menu-toggle {
    display: none; /* Oculto em telas maiores */
    background: none;
    border: none;
    color: var(--text-color-light);
    font-size: 1.8em;
    cursor: pointer;
    padding: 0 15px;
}

.content-wrapper {
    padding: 25px;
    flex-grow: 1; /* Faz o conteúdo principal crescer */
    background-color: #f4f7f6;
}

.footer {
    background-color: #e9ecef;
    color: #6c757d;
    text-align: center;
    padding: 15px;
    font-size: 0.9em;
    border-top: 1px solid #dee2e6;
}


/* Componentes Comuns */
.container {
    background-color: var(--card-bg);
    padding: 25px;
    border-radius: var(--card-border-radius);
    box-shadow: var(--card-box-shadow);
    margin-bottom: 25px;
}

h1, h2, h3 {
    color: #333;
}
h1.page-title-main-content {
    margin-top: 0;
    margin-bottom: 20px;
    font-size: 1.8em;
    color: var(--header-bg-color);
    border-bottom: 2px solid var(--button-primary-color);
    padding-bottom: 10px;
}


table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
    background-color: var(--card-bg);
    box-shadow: var(--card-box-shadow);
    border-radius: var(--card-border-radius);
    overflow: hidden;
}

table th, table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #e0e0e0;
}

table th {
    background-color: #f8f9fa;
    color: #333;
    font-weight: 600;
}

table tr:last-child td {
    border-bottom: none;
}

table tr:hover {
    background-color: #f1f1f1;
}

.btn {
    display: inline-flex; /* Para alinhar ícone e texto */
    align-items: center;
    justify-content: center;
    padding: 10px 18px;
    font-size: 1em;
    font-weight: 500;
    text-align: center;
    text-decoration: none;
    border-radius: var(--card-border-radius);
    border: 1px solid transparent;
    cursor: pointer;
    transition: background-color 0.2s ease, border-color 0.2s ease, opacity 0.2s ease, box-shadow 0.2s ease;
    margin-bottom: 10px;
}
.btn i {
    margin-right: 8px;
}
.btn.btn-icon { /* Botão apenas com ícone */
    padding: 0.5rem 0.7rem; /* Padding menor para botões de ícone */
}
.btn.btn-icon i {
    margin-right: 0; /* Sem margem se for só ícone */
}


.btn-primary {
    background-color: var(--button-primary-color);
    color: white;
    border-color: var(--button-primary-color);
}

.btn-primary:hover {
    opacity: 0.9;
    box-shadow: 0 2px 5px rgba(0,123,255,0.3);
}

.btn-secondary {
    background-color: #6c757d;
    color: white;
    border-color: #6c757d;
}
.btn-secondary:hover {
    background-color: #5a6268;
    border-color: #545b62;
    box-shadow: 0 2px 5px rgba(108,117,125,0.3);
}

.btn-success {
    background-color: #28a745;
    color: white;
    border-color: #28a745;
}
.btn-success:hover {
    background-color: #218838;
    border-color: #1e7e34;
    box-shadow: 0 2px 5px rgba(40,167,69,0.3);
}

.btn-danger {
    background-color: #dc3545;
    color: white;
    border-color: #dc3545;
}
.btn-danger:hover {
    background-color: #c82333;
    border-color: #bd2130;
    box-shadow: 0 2px 5px rgba(220,53,69,0.3);
}

.btn-info {
    background-color: #17a2b8;
    color: white;
    border-color: #17a2b8;
}
.btn-info:hover {
    background-color: #138496;
    border-color: #117a8b;
    box-shadow: 0 2px 5px rgba(23,162,184,0.3);
}

.btn-warning {
    background-color: #ffc107;
    color: #212529;
    border-color: #ffc107;
}
.btn-warning:hover {
    background-color: #e0a800;
    border-color: #d39e00;
    box-shadow: 0 2px 5px rgba(255,193,7,0.3);
}

.btn-sm {
    padding: 0.35rem 0.7rem;
    font-size: 0.875rem;
    border-radius: 0.2rem;
}
.btn-outline-secondary {
    color: #6c757d;
    border-color: #6c757d;
    background-color: transparent;
}
.btn-outline-secondary:hover {
    color: #fff;
    background-color: #6c757d;
    border-color: #6c757d;
}


/* Formulários */
form {
    margin-bottom: 20px;
}

form label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #495057;
    font-size: 0.95em;
}

form input[type="text"],
form input[type="email"],
form input[type="password"],
form input[type="number"],
form input[type="date"],
form input[type="url"],
form select,
form textarea {
    width: 100%;
    padding: 12px;
    margin-bottom: 15px;
    border: 1px solid var(--input-border-color);
    border-radius: var(--card-border-radius);
    box-sizing: border-box;
    font-size: 1em;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    background-color: #fff;
}
form input:read-only {
    background-color: #e9ecef;
    cursor: not-allowed;
}


form input[type="text"]:focus,
form input[type="email"]:focus,
form input[type="password"]:focus,
form input[type="number"]:focus,
form input[type="date"]:focus,
form input[type="url"]:focus,
form select:focus,
form textarea:focus {
    border-color: var(--input-focus-border-color);
    outline: none;
    box-shadow: 0 0 0 0.2rem rgba(0,123,255,.25);
}

form textarea {
    min-height: 100px;
    resize: vertical;
}

form input[type="color"] {
    padding: 5px;
    height: 45px;
}

form .form-group {
    margin-bottom: 20px;
}

form .form-row {
    display: flex;
    flex-wrap: wrap;
    margin-right: -7.5px;
    margin-left: -7.5px;
}

form .form-group.col-md-6,
form .form-group.col-md-4,
form .form-group.col-md-3 {
    position: relative;
    width: 100%;
    padding-right: 7.5px;
    padding-left: 7.5px;
    box-sizing: border-box;
}

form small {
    font-size: 0.85em;
    color: #6c757d;
    display: block;
    margin-top: -8px;
    margin-bottom: 10px;
}


.form-actions {
    margin-top: 20px;
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.form-actions-top {
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 1px solid #dee2e6;
}

.form-actions-bottom {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #dee2e6;
}


h3.section-title {
    margin-top: 30px;
    margin-bottom: 20px;
    font-size: 1.4em;
    color: var(--header-bg-color);
    padding-bottom: 8px;
    border-bottom: 2px solid var(--button-primary-color);
}


/* Alertas e Mensagens */
.alert {
    padding: 15px;
    margin-bottom: 20px;
    border: 1px solid transparent;
    border-radius: var(--card-border-radius);
    font-size: 0.95em;
}
.alert-success {
    color: #0f5132;
    background-color: #d1e7dd;
    border-color: #badbcc;
}
.alert-danger {
    color: #842029;
    background-color: #f8d7da;
    border-color: #f5c2c7;
}
.alert-info {
    color: #055160;
    background-color: #cff4fc;
    border-color: #b6effb;
}

/* Cards para Dashboard */
.dashboard-cards {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 25px;
}

.dashboard-cards.financial-cards {
    grid-template-columns: repeat(3, 1fr);
}

.card {
    background-color: var(--card-bg);
    border-radius: var(--card-border-radius);
    box-shadow: var(--card-box-shadow);
    padding: 20px;
    display: flex;
    align-items: center;
    transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
    position: relative;
    overflow: hidden;
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: linear-gradient(180deg, var(--button-primary-color), transparent);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.card:hover::before {
    opacity: 1;
}

.card.card-hover:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

.card .icon {
    font-size: 2.5em;
    margin-right: 20px;
    padding: 15px;
    border-radius: 50%;
    color: white;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.card .icon.clients { 
    background: linear-gradient(135deg, #17a2b8, #138496);
    box-shadow: 0 4px 10px rgba(23,162,184,0.3);
}
.card .icon.products { 
    background: linear-gradient(135deg, #ffc107, #e0a800);
    box-shadow: 0 4px 10px rgba(255,193,7,0.3);
}
.card .icon.budgets { 
    background: linear-gradient(135deg, #28a745, #218838);
    box-shadow: 0 4px 10px rgba(40,167,69,0.3);
}
.card .icon.contracts { 
    background: linear-gradient(135deg, #6f42c1, #5a32a3);
    box-shadow: 0 4px 10px rgba(111,66,193,0.3);
}


.card .info h3 {
    margin-top: 0;
    margin-bottom: 8px;
    font-size: 0.95em;
    color: #6c757d;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.card .info p.card-number {
    margin: 0;
    font-size: 2.2em;
    font-weight: 700;
    color: #333;
    line-height: 1.2;
}

.card .info .card-subtitle {
    display: block;
    margin-top: 8px;
    font-size: 0.85em;
    color: #6c757d;
    font-weight: 500;
}

.card .info .card-subtitle i {
    color: var(--button-primary-color);
    margin-right: 4px;
}


/* Estilos para Itens do Orçamento (Formulário) */
#budget-items-container {
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.budget-item {
    border: 1px solid var(--item-border-color);
    border-radius: var(--card-border-radius);
    background-color: var(--item-bg-color);
    box-shadow: 0 1px 4px rgba(0,0,0,0.07);
    transition: box-shadow 0.2s ease-in-out;
    /* padding é removido daqui e aplicado ao .item-content e .item-header */
}
.budget-item:hover {
    box-shadow: 0 3px 8px rgba(0,0,0,0.1);
}

.budget-item .item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: var(--item-header-bg-color);
    padding: 12px 20px; /* Padding ajustado */
    border-bottom: 1px solid var(--item-border-color);
    border-top-left-radius: var(--card-border-radius);
    border-top-right-radius: var(--card-border-radius);
    cursor: pointer; /* Indica que o header é clicável para expandir/recolher */
}
.budget-item.item-collapsed .item-header {
    border-bottom-left-radius: var(--card-border-radius); /* Arredonda tudo quando colapsado */
    border-bottom-right-radius: var(--card-border-radius);
    border-bottom-color: transparent; /* Remove borda inferior quando colapsado se o conteúdo estiver oculto */
}


.budget-item .item-header h4 {
    margin: 0;
    font-size: 1.15em; /* Ajustado */
    color: var(--header-bg-color);
    font-weight: 600;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: calc(100% - 150px); /* Evita que o título empurre os botões */
}
.budget-item .item-header .item-title-preview {
    font-weight: normal;
    color: #555;
}

.budget-item .item-header .item-number {
    color: var(--button-primary-color);
    font-weight: 700;
    margin-right: 5px;
}

.budget-item .item-header-actions { /* Novo container para os botões no header */
    display: flex;
    align-items: center;
    gap: 8px;
}
.budget-item .item-header-actions .btn {
    margin-bottom: 0;
}
.budget-item .item-toggle-btn i {
    transition: transform 0.2s ease-in-out;
}
.budget-item.item-collapsed .item-toggle-btn i {
    transform: rotate(-90deg);
}


.budget-item .item-content {
    padding: var(--item-content-padding);
    border-top: none; /* A borda superior é a inferior do header */
    display: block; /* Padrão é visível */
    transition: max-height 0.3s ease-out, padding 0.3s ease-out, opacity 0.2s ease-out; /* Para animação suave */
    max-height: 2000px; /* Um valor alto para permitir conteúdo de qualquer tamanho */
    overflow: hidden;
}
.budget-item.item-collapsed .item-content {
    display: none; /* Oculta o conteúdo quando colapsado */
    /* Para animação com max-height:
    max-height: 0;
    padding-top: 0;
    padding-bottom: 0;
    opacity: 0;
    */
}


.budget-item .form-group {
    margin-bottom: 18px;
}
.budget-item .form-group label {
    font-size: 0.9em;
    color: #333;
    font-weight: 500;
}
.budget-item .product-search-input {
    margin-bottom: 10px; /* Espaço entre a pesquisa e o select */
}


.budget-item .form-row .form-group {
    margin-bottom: 0;
}
.budget-item .form-row .form-group.col-md-6:not(:last-child) {
     margin-bottom: 18px;
}


.total-budget-section {
    margin-top: 30px;
    padding: 20px;
    border-top: 2px solid var(--button-primary-color);
    background-color: #f8f9fa;
    text-align: right;
    font-size: 1.4em;
    border-radius: var(--card-border-radius); /* Arredonda todos os cantos */
}
.total-budget-section h3 {
    color: var(--header-bg-color);
    margin: 0;
    font-weight: 600;
}
.total-budget-section #total-budget-amount {
    font-weight: 700;
}


/* Estilos para Detalhes do Orçamento (Visualização) */
.budget-details-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 15px 20px;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
}
.budget-details-grid div {
    padding: 8px 0;
    font-size: 0.95em;
}
.budget-details-grid div strong {
    color: #333;
}
.budget-details-grid .full-width {
    grid-column: 1 / -1;
}
.budget-details-grid hr.full-width {
    border: 0;
    border-top: 1px solid #eee;
    margin: 10px 0;
}

.view-item-list {
    margin-top: 15px;
    margin-bottom: 20px;
}
.view-item {
    background-color: #f9f9f9;
    border: 1px solid #e9e9e9;
    border-radius: var(--card-border-radius);
    padding: 15px;
    margin-bottom: 15px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.04);
}
.view-item-header {
    font-size: 1.1em;
    color: #333;
    margin-bottom: 8px;
    font-weight: bold;
}
.view-item-description {
    display: block;
    font-size: 0.9em;
    color: #555;
    margin-bottom: 8px;
    padding-left: 15px;
    border-left: 2px solid #eee;
}
.view-item-details {
    font-size: 0.95em;
    color: #444;
    text-align: right;
    margin-top: 10px;
}
.view-item-details span {
    margin: 0 5px;
}
.view-item-details strong {
    color: #000;
    font-size: 1.05em;
}

/* Cards Financeiros */
.card-financial {
    min-width: 300px;
    border-left: 4px solid transparent;
}

.card-financial.card-success {
    border-left-color: #28a745;
    background: linear-gradient(135deg, #ffffff 0%, #f0f9f4 100%);
}

.card-financial.card-warning {
    border-left-color: #ffc107;
    background: linear-gradient(135deg, #ffffff 0%, #fffbf0 100%);
}

.card-financial.card-info {
    border-left-color: #17a2b8;
    background: linear-gradient(135deg, #ffffff 0%, #f0f9fb 100%);
}

.card-financial .icon-financial {
    font-size: 2.5em;
    margin-right: 20px;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
}

.card-success .icon-financial {
    color: #28a745;
    background-color: rgba(40,167,69,0.1);
}

.card-warning .icon-financial {
    color: #ffc107;
    background-color: rgba(255,193,7,0.1);
}

.card-info .icon-financial {
    color: #17a2b8;
    background-color: rgba(23,162,184,0.1);
}

.card-financial .info h3 {
    font-size: 0.9em;
    margin-bottom: 10px;
}

.card-financial .info .card-value {
    margin: 5px 0 0 0;
    font-size: 1.3em;
    font-weight: 600;
    color: #28a745;
}

.card-warning .info .card-value {
    color: #e0a800;
}

/* Ações Rápidas */
.quick-actions-container {
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
    border-left: 4px solid var(--button-primary-color);
}

.quick-actions-container h2 {
    color: var(--header-bg-color);
    font-size: 1.3em;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.quick-actions-container h2 i {
    color: var(--button-primary-color);
}

.quick-actions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

.quick-action-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 25px 20px;
    border-radius: var(--card-border-radius);
    text-decoration: none;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    border: 2px solid transparent;
}

.quick-action-btn i {
    font-size: 2em;
    margin-bottom: 10px;
}

.quick-action-btn span {
    font-size: 0.95em;
    font-weight: 600;
}

.quick-action-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.15);
    border-color: currentColor;
}

/* Badges de Status */
.status-badge {
    padding: 0.4em 0.9em;
    font-size: 0.8em;
    font-weight: 600;
    border-radius: 20px;
    color: #fff !important;
    text-transform: capitalize;
    display: inline-block;
    line-height: 1.2;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}
.status-pendente { 
    background: #f5f5f5 !important;
    color: #666 !important;
    border: 1px solid #ddd !important;
}
.status-aprovado { 
    background: #f5f5f5 !important;
    color: #666 !important;
    border: 1px solid #ddd !important;
}
.status-rejeitado { 
    background: #f5f5f5 !important;
    color: #666 !important;
    border: 1px solid #ddd !important;
}
.status-cancelado { 
    background: #f5f5f5 !important;
    color: #666 !important;
    border: 1px solid #ddd !important;
}
.status-contrato-gerado { 
    background: #f5f5f5 !important;
    color: #666 !important;
    border: 1px solid #ddd !important;
}


/* Ações da Tabela */
.table-responsive {
    overflow-x: auto;
}
.actions .btn-action {
    margin-right: 5px;
    padding: 6px 10px;
    font-size: 0.9em;
    border: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    border-radius: var(--card-border-radius);
    transition: opacity 0.2s ease;
    line-height: 1;
}
.actions .btn-action:last-child {
    margin-right: 0;
}
.actions .btn-action:hover {
    opacity: 0.8;
}
.actions .btn-view { background-color: #17a2b8; color: white; }
.actions .btn-edit { background-color: #ffc107; color: #212529; }
.actions .btn-info { background-color: #0dcaf0; color: #212529; }
.actions .btn-delete { background-color: #dc3545; color: white; }

table td.actions a, table td.actions button {
    margin-right: 5px;
    padding: 6px 10px;
}
table td.actions a i, table td.actions button i {
    text-decoration: none;
    pointer-events: none;
}


/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1001;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.4);
}
.modal-content {
    background-color: #fefefe;
    margin: 15% auto;
    padding: 20px;
    border: 1px solid #888;
    width: 80%;
    max-width: 500px;
    border-radius: var(--card-border-radius);
    box-shadow: 0 4px 8px 0 rgba(0,0,0,0.2),0 6px 20px 0 rgba(0,0,0,0.19);
}
.close-button {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
}
.close-button:hover,
.close-button:focus {
    color: black;
    text-decoration: none;
    cursor: pointer;
}

/* Campos de seleção de cor */
.color-input-group {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
}
.color-input-group label {
    margin-bottom: 0;
    flex-shrink: 0;
}
.color-input-group input[type="color"] {
    width: 60px;
    height: 40px;
    padding: 2px;
    margin-bottom: 0;
    border-radius: 4px;
}
.color-input-group input[type="text"] {
    flex-grow: 1;
    margin-bottom: 0;
}


/* Responsividade */
@media (min-width: 768px) {
    form .form-group.col-md-6 {
        flex: 0 0 50%;
        max-width: 50%;
    }
    form .form-group.col-md-4 {
        flex: 0 0 33.333333%;
        max-width: 33.333333%;
    }
    form .form-group.col-md-3 {
        flex: 0 0 25%;
        max-width: 25%;
    }
    .budget-item .form-row .form-group.col-md-6:not(:last-child) {
         margin-bottom: 0;
    }
}


@media (max-width: 1200px) {
    .dashboard-cards {
        grid-template-columns: repeat(2, 1fr);
    }
    .dashboard-cards.financial-cards {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .dashboard-cards,
    .dashboard-cards.financial-cards {
        grid-template-columns: 1fr;
    }
}


@media (max-width: 767px) {
    .sidebar {
        width: 0;
        transform: translateX(-100%);
    }
    .sidebar.open {
        width: var(--sidebar-width);
        transform: translateX(0);
    }
    .sidebar.open .logo {
        max-width: 80%;
        margin-bottom: 15px;
    }
    .sidebar.open .user-info {
        opacity: 1;
        max-height: 100px;
    }
    .sidebar.open nav ul li a span {
        opacity: 1;
        margin-left: 15px;
    }

    .main-content {
        margin-left: 0;
    }

    .top-bar {
        left: 0;
    }
    .menu-toggle {
        display: block;
    }
    .top-bar h1 {
        font-size: 1.3em;
        margin-left: 10px;
    }

    .dashboard-cards .card {
        min-width: 100%;
    }

    table, thead, tbody, th, td, tr {
        display: block;
    }
    table thead tr {
        position: absolute;
        top: -9999px;
        left: -9999px;
    }
    table tr {
        border: 1px solid #ccc;
        margin-bottom: 10px;
        border-radius: var(--card-border-radius);
        background-color: var(--card-bg);
    }
    table td {
        border: none;
        border-bottom: 1px solid #eee;
        position: relative;
        padding-left: 50% !important;
        text-align: right;
        height: auto;
        line-height: 1.5;
    }
    table td:last-child {
        border-bottom: none;
    }
    table td:before {
        position: absolute;
        left: 15px;
        width: calc(50% - 30px);
        padding-right: 10px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        content: attr(data-label);
        font-weight: bold;
        text-align: left;
        color: #555;
    }
    table td.actions {
        padding-left: 15px !important;
        text-align: center;
    }
    table td.actions:before {
        content: "";
    }
    .actions .btn-action {
        display: inline-block;
        margin: 5px;
    }

    form .form-group.col-md-6,
    form .form-group.col-md-4,
    form .form-group.col-md-3 {
        flex: 0 0 100%;
        max-width: 100%;
        padding-right: 0;
        padding-left: 0;
    }
    .budget-item .form-row .form-group.col-md-6 {
         margin-bottom: 18px;
    }
    .budget-item .form-row .form-group.col-md-6:last-child {
         margin-bottom: 0;
    }

    .form-actions-top, .form-actions {
        flex-direction: column;
        align-items: stretch;
    }
    .form-actions-top .btn, .form-actions .btn {
        width: 100%;
        margin-bottom: 10px;
    }
    .form-actions-top .btn:last-child, .form-actions .btn:last-child {
        margin-bottom: 0;
    }
     .budget-details-grid {
        grid-template-columns: 1fr;
    }
    .budget-item .item-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
         /* Ajuste para não estender o fundo no mobile, mantendo padding interno */
        margin: 0; 
        padding: 15px;
        border-radius: var(--card-border-radius) var(--card-border-radius) 0 0;
    }
    .budget-item.item-collapsed .item-header {
        border-bottom-left-radius: var(--card-border-radius);
        border-bottom-right-radius: var(--card-border-radius);
    }
    .budget-item .item-header h4 {
        max-width: 100%; /* Permite que o título ocupe mais espaço no mobile */
    }
    .budget-item .item-header-actions {
        width: 100%;
        justify-content: flex-end;
    }
    .budget-item .item-content {
        padding: 15px; /* Padding menor para mobile */
    }
}

/* Estilos para Banner de Doação */
.donation-banner {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.3);
    margin-bottom: 30px;
    overflow: hidden;
    position: relative;
}

.donation-banner::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -10%;
    width: 300px;
    height: 300px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    animation: pulse 3s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); opacity: 0.5; }
    50% { transform: scale(1.1); opacity: 0.3; }
}

.donation-banner-content {
    display: flex;
    align-items: center;
    gap: 25px;
    position: relative;
    z-index: 1;
}

.donation-banner-icon {
    font-size: 3em;
    color: white;
    animation: heartbeat 1.5s ease-in-out infinite;
    flex-shrink: 0;
}

.donation-banner-text {
    flex: 1;
    color: white;
}

.donation-banner-text h3 {
    margin: 0 0 8px 0;
    font-size: 1.4em;
    color: white;
    font-weight: 600;
}

.donation-banner-text p {
    margin: 0;
    font-size: 1em;
    opacity: 0.95;
    line-height: 1.5;
}

.donation-banner-action {
    flex-shrink: 0;
}

.btn-donation {
    background: white;
    color: #667eea;
    font-weight: 600;
    padding: 12px 25px;
    border: none;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
}

.btn-donation:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
    background: #f8f9fa;
}

.btn-donation i {
    margin-right: 8px;
}

@media (max-width: 768px) {
    .donation-banner-content {
        flex-direction: column;
        text-align: center;
        gap: 20px;
    }
    
    .donation-banner-icon {
        font-size: 2.5em;
    }
    
    .donation-banner-text h3 {
        font-size: 1.2em;
    }
    
    .donation-banner-text p {
        font-size: 0.95em;
    }
    
    .donation-banner-action {
        width: 100%;
    }
    
    .btn-donation {
        width: 100%;
        justify-content: center;
    }
}

/* Estilos para Notificação de Doação no Header */
.header-actions {
    display: flex;
    align-items: center;
    gap: 15px;
}

.notification-btn {
    position: relative;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: var(--text-color-light);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2em;
}

.notification-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.05);
}

.notification-badge {
    position: absolute;
    top: 5px;
    right: 5px;
    width: 10px;
    height: 10px;
    background: #ff6b6b;
    border-radius: 50%;
    border: 2px solid var(--header-bg-color);
    animation: pulse-badge 2s ease-in-out infinite;
}

@keyframes pulse-badge {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.2); opacity: 0.8; }
}

.donation-notification-popup {
    position: fixed;
    top: calc(var(--top-bar-height) + 10px);
    right: 20px;
    width: 380px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
}

.donation-notification-popup.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.notification-popup-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px;
    border-radius: 12px 12px 0 0;
    display: flex;
    align-items: center;
    gap: 12px;
    position: relative;
}

.notification-popup-header i.fa-heart {
    font-size: 1.8em;
    animation: pulse 2s ease-in-out infinite;
}

.notification-popup-header h3 {
    margin: 0;
    flex: 1;
    font-size: 1.2em;
    color: white;
}

.close-popup {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1em;
}

.close-popup:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg);
}

.notification-popup-body {
    padding: 20px;
}

.notification-popup-body p {
    margin: 0 0 12px 0;
    color: #555;
    font-size: 0.95em;
    line-height: 1.6;
}

.notification-popup-body p:last-of-type {
    margin-bottom: 20px;
}

.btn-popup-donate {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 12px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.btn-popup-donate:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

@media (max-width: 768px) {
    .donation-notification-popup {
        right: 10px;
        left: 10px;
        width: auto;
        max-width: 380px;
        margin: 0 auto;
    }
    
    .notification-btn {
        width: 36px;
        height: 36px;
        font-size: 1.1em;
    }
}
