body {
    background-color: #f8f9fa;
}

.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background-color: #f5f5f5;
    margin: 0;
    padding: 0;
}

.login-box {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    width: 100%;
    max-width: 400px;
}

.login-header {
    text-align: center;
    margin-bottom: 2rem;
}

.login-header h2 {
    color: #333;
    margin: 0;
}

.login-form .form-group {
    margin-bottom: 1rem;
}

.login-form label {
    display: block;
    margin-bottom: 0.5rem;
    color: #666;
}

.login-form .form-control {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.login-form .btn-block {
    width: 100%;
    padding: 0.75rem;
    margin-top: 1rem;
}

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

.alert-danger {
    background-color: #f8d7da;
    border-color: #f5c6cb;
    color: #721c24;
}

/* Estilos gerais */
body {
    background-color: #f8f9fa;
}

/* Sidebar */
.wrapper {
    display: flex;
    width: 100%;
    min-height: 100vh;
    margin: 0;
    padding: 0;
    overflow-x: hidden;
}

.sidebar {
    width: 220px;
    min-width: 220px;
    height: 100vh;
    background: #0a2740;
    color: #fff;
    position: fixed;
    left: 0;
    top: 0;
    z-index: 1000;
    box-shadow: 2px 0 8px rgba(0,0,0,0.05);
    overflow-y: auto;
}

#sidebar {
    min-width: 250px;
    max-width: 250px;
    min-height: 100vh;
    transition: all 0.3s;
}

#sidebar.active {
    margin-left: -250px;
}

#sidebar .sidebar-header {
    padding: 20px;
    background: #343a40;
}

#sidebar ul.components {
    padding: 20px 0;
}

#sidebar ul li a {
    padding: 10px 20px;
    font-size: 1.1em;
    display: block;
    color: white;
    text-decoration: none;
}

#sidebar ul li a:hover {
    background: #495057;
}

#sidebar ul li.active > a {
    background: #495057;
}

/* Conteúdo */
#content {
    width: 100%;
    min-height: 100vh;
    transition: all 0.3s;
}

/* Cards do Dashboard */
.dashboard-container {
    width: 100%;
    padding: 0;
    margin: 0;
    height: 100%;
}

.dashboard-cards {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 20px;
    width: 100%;
}

.dashboard-card {
    background: #fff;
    border-radius: 8px;
    padding: 5px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    text-align: center;
}

.card-value {
    font-size: 2rem;
    font-weight: bold;
    margin: 5px;
}

.card-description {
    color: #666;
    font-size: 0.9rem;
}

.dashboard-section {
    background: #fff;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    width: 100%;
}

.section-description {
    color: #666;
    margin-bottom: 10px;
}

.document-table {
    width: 100%;
    margin-top: 20px;
}

.document-table th, .document-table td {
    padding: 5px 10px;
    text-align: left;
    border-bottom: 1px solid #ddd;
}

.document-table th {
    background-color: #f5f5f5;
    font-weight: 600;
}

.table-footer {
    margin-top: 10px;
    font-size: 0.9rem;
    color: #666;
}

.movement-list {
    margin-top: 15px;
}

.movement-item {
    padding: 10px 0;
    border-bottom: 1px solid #eee;
}

.movement-item:last-child {
    border-bottom: none;
}

/* Ajuste para o conteúdo principal quando não há sidebar */
.main-content.full-width {
    margin-left: 0;
    width: 100%;
}

/* Responsividade */
@media (max-width: 1200px) {
    .dashboard-cards {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .main-content {
        width: calc(100% - 220px);
    }
}

@media (max-width: 768px) {
    .sidebar {
        margin-left: -220px;
    }
    
    .main-content {
        margin-left: 0;
        width: 100%;
    }
    
    .dashboard-cards {
        grid-template-columns: 1fr;
    }
}

.sidebar-header {
    padding: 24px;
}

.sidebar-header h3 {
    color: #fff;
    font-size: 1.7rem;
    font-weight: bold;
    text-align: center;
}

.sidebar-menu {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sidebar-menu li {
    margin-bottom: 8px;
}

.sidebar-menu li a {
    color: #fff;
    font-size: 1.08rem;
    padding: 12px 24px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    transition: background 0.2s, color 0.2s;
    font-weight: 500;
}

.sidebar-menu li a.active,
.sidebar-menu li a:hover {
    background: #1d5aa5;
    color: #fff;
}

.sidebar-menu li a i {
    font-size: 1.2rem;
    margin-right: 8px;
    min-width: 22px;
    text-align: center;
}

/* Categorias da sidebar */
.sidebar-category {
    margin: 20px 0 10px 0;
    padding: 0;
}

.sidebar-category .category-title {
    color: #b8c5d1;
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 8px 24px;
    display: flex;
    align-items: center;
    gap: 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    margin-bottom: 8px;
}

.sidebar-category .category-title i {
    font-size: 0.9rem;
    opacity: 0.8;
}

.logout-link {
    margin-top: 30px;
    color: #fff;
    padding: 10px 24px;
    display: block;
    border-radius: 6px;
    text-decoration: none;
    transition: background 0.2s;
}

.logout-link:hover {
    background: #c0392b;
    color: #fff;
}

/* Conteúdo principal */
.main-content {
    flex: 1;
    margin-left: 220px;
    min-height: 100vh;
    padding: 20px;
    background-color: #f8f9fa;
    width: calc(100% - 220px);
    overflow-x: hidden;
}

.titulo-container {
    margin-bottom: 20px;
    width: 100%;
}

.page-header {
    background: #0a2740; /* Azul escuro para destacar */
    padding: 30px 30px 20px 30px;
    border-radius: 12px 12px 0 0;
    display: flex;
    align-items: center;
}

.header-title {
    display: flex;
    align-items: center;
    gap: 16px;
}

.header-title h1 {
    color: #fff;
    font-size: 2.5rem;
    font-weight: bold;
    margin: 0;
    letter-spacing: 1px;
}

.document-icon {
    font-size: 2.2rem;
    color: #fff;
    margin-right: 10px;
    opacity: 0.95;
}

/* Badges de status */
.badge.bg-success {
    background-color: #27ae60 !important;
    color: #fff;
    font-weight: 600;
    padding: 6px 14px;
    border-radius: 12px;
    font-size: 0.95rem;
}

.badge.bg-danger {
    background-color: #c0392b !important;
    color: #fff;
    font-weight: 600;
    padding: 6px 14px;
    border-border-radius: 12px;
    font-size: 0.95rem;
}

/* Botões de ação */
.d-flex.gap-2 .btn {
    min-width: 36px;
    min-height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    border-radius: 8px;
    margin-right: 4px;
    transition: background 0.2s, color 0.2s;
}

.d-flex.gap-2 .btn:last-child {
    margin-right: 0;
}

.d-flex.gap-2 .btn-primary {
    background: #1d5aa5;
    border: none;
}

.d-flex.gap-2 .btn-primary:hover {
    background: #003366;
    color: #fff;
}

.table-frame {
    border: 2px solid #e0e6ed;
    border-radius: 16px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.07);
    padding: 0;
    margin-bottom: 32px;
    background: #fff;
    overflow: hidden;
    transition: box-shadow 0.2s;
}

.table-frame:hover {
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
    border-color: #b3c6e0;
}

.titulo-container .page-header {
    background: #0a2740;
    padding: 32px 32px 24px 32px;
    border-radius: 16px 16px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.titulo-container .page-header h1 {
    color: #fff;
    font-size: 2.5rem;
    font-weight: bold;
    margin: 0;
    letter-spacing: 1px;
}

.search-container {
    min-width: 260px;
}

.search-box {
    display: flex;
    align-items: center;
    background: #f1f4f8;
    border-radius: 8px;
    padding: 4px 10px;
}

.search-icon {
    margin-right: 6px;
    font-size: 1.1rem;
    color: #1d5aa5;
}

.search-input {
    border: none;
    background: transparent;
    outline: none;
    font-size: 1rem;
    width: 180px;
    color: #003366;
}

.relatorio-container {
    margin-top: 30px;
}
.relatorio-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
}
.relatorio-header h1 {
    margin: 0;
    font-size: 2rem;
    font-weight: 600;
}
.relatorio-header .document-icon {
    font-size: 2.2rem;
    margin-right: 12px;
}
.relatorio-card {
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
    padding: 32px 24px;
    margin-bottom: 32px;
}
.relatorio-form-label {
    font-weight: 500;
}
.relatorio-preview {
    margin-top: 32px;
}

/* Telas médias (tablets, ~900px) */
@media (max-width: 1100px) and (min-width: 701px) {
    .sidebar {
        width: 160px;
        min-width: 160px;
    }
    .main-content {
        margin-left: 160px;
    }
    .sidebar-menu li a {
        font-size: 0.9rem;
        padding: 12px 8px;
    }
    .sidebar-menu li a span {
        font-size: 0.8rem;
    }
}

/* Telas pequenas (celular) */
@media (max-width: 700px) {
    .wrapper {
        width: 100vw;
        overflow-x: hidden;
    }
    
    .sidebar {
        position: fixed;
        width: 100vw;
        height: 60px;
        min-width: 100vw;
        max-width: 100vw;
        top: 0;
        left: 0;
        right: 0;
        padding: 0;
        margin: 0;
        display: flex;
        flex-direction: row;
        align-items: center;
        overflow-x: auto;
        overflow-y: hidden;
        box-shadow: 0 2px 8px rgba(0,0,0,0.08);
        z-index: 1000;
    }
    
    .sidebar-header {
        display: none;
    }
    
    .sidebar-menu {
        display: flex;
        flex-direction: row;
        width: 100%;
        justify-content: space-around;
        align-items: center;
        margin: 0;
        padding: 0 8px;
        list-style: none;
        flex-wrap: nowrap;
    }
    
    .sidebar-menu li {
        margin: 0;
        padding: 0;
        flex: 1;
        text-align: center;
    }
    
    .sidebar-menu li a {
        padding: 8px 2px;
        font-size: 0.75rem;
        border-radius: 6px;
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 3px;
        text-decoration: none;
        color: #fff;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        transition: background-color 0.2s ease;
    }
    
    .sidebar-menu li a i {
        font-size: 18px;
        margin-bottom: 1px;
    }
    
    .sidebar-menu li a span {
        font-size: 0.65rem;
        line-height: 1.1;
        font-weight: 500;
    }
    
    .sidebar-menu li a:hover,
    .sidebar-menu li a.active {
        background-color: rgba(255, 255, 255, 0.2);
        color: #fff;
    }
    
    .main-content {
        margin-left: 0;
        margin-top: 60px;
        padding: 12px 8px;
        width: 100%;
        box-sizing: border-box;
    }
    
    body {
        overflow-x: hidden;
    }
}
