/* Reset e base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: "Roboto", sans-serif;
}

html, body {
    height: 100%;
    background-color: #f5f5f5;
    color: #212121;
    line-height: 1.6;
    font-size: 16px;
}

/* Layout principal */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem;
}

/* Barra de Navegação Superior */
.top-navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 60px;
    background-color: #ffffff;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.5rem;
    z-index: 100;
}

.navbar-header {
    display: flex;
    align-items: center;
}

.navbar-header h2 {
    font-size: 1.25rem;
    margin-right: 1rem;
}

.navbar-header p {
    color: #757575;
    font-size: 0.875rem;
}

.navbar-menu {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    height: 100%;
}

.navbar-menu li a {
    display: flex;
    align-items: center;
    padding: 0 1.5rem;
    color: #424242;
    height: 100%;
    transition: all 0.2s ease;
    text-decoration: none;
}

.navbar-menu li a:hover {
    background-color: #f5f5f5;
    color: #2962ff;
}

.navbar-menu li a.active {
    background-color: #e3f2fd;
    color: #2962ff;
    border-bottom: 3px solid #2962ff;
}

.navbar-menu li a i {
    margin-right: 0.5rem;
}

.navbar-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.25rem;
    color: #424242;
    cursor: pointer;
}

/* Conteúdo Principal */
.main-content {
    margin-top: 60px;
    width: 100%;
    padding: 1rem;
    background-color: #f5f5f5;
}

/* Cards */
.card {
    background-color: #ffffff;
    border-radius: 12px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.12);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

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

.card-title {
    font-size: 1.25rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
}

/* Tabelas */
.table-responsive {
    overflow-x: auto;
    margin-bottom: 1.5rem;
}

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

.data-table th {
    background-color: #f5f5f5;
    font-weight: 500;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.5px;
    text-align: left;
    padding: 1rem;
    border-bottom: 1px solid #eee;
}

.data-table td {
    padding: 1rem;
    border-bottom: 1px solid #eee;
    text-align: left;
}

.data-table tr:last-child td {
    border-bottom: none;
}

.data-table tr:hover td {
    background-color: #f9f9f9;
}

/* Botões */
.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 6px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.btn-primary {
    background-color: #2962ff;
    color: white;
}

.btn-primary:hover {
    background-color: #0039cb;
}

.btn-outline {
    background: transparent;
    border: 2px solid #2962ff;
    color: #2962ff;
}

.btn-outline:hover {
    background-color: #e3f2fd;
}

.btn-text {
    background: none;
    color: #2962ff;
    border: none;
    padding: 0.5rem;
    cursor: pointer;
}

.btn-text:hover {
    background-color: rgba(41,98,255,0.1);
    border-radius: 4px;
}

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

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #424242;
}

input, textarea, select {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    margin-bottom: 1rem;
    background-color: #fafafa;
}

input:focus, textarea:focus, select:focus {
    border-color: #2962ff;
    outline: none;
}

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

/* Modais */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.modal.show {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background-color: white;
    border-radius: 8px;
    width: 100%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    transform: translateY(20px);
    transition: transform 0.3s ease;
}

.modal.show .modal-content {
    transform: translateY(0);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid #eee;
}

.modal-body {
    padding: 1.5rem;
}

.modal.small .modal-content {
    max-width: 400px;
}

.modal.large .modal-content {
    max-width: 800px;
}

/* Paginação */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 1.5rem;
}

.page-numbers {
    display: flex;
    gap: 0.25rem;
}

.page-number {
    min-width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 500;
}

.page-number:hover {
    background-color: #f1f1f1;
}

.page-number.active {
    background-color: #2962ff;
    color: white;
}

/* Loading overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(255,255,255,0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1001;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.loading-overlay.active {
    opacity: 1;
    visibility: visible;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #2962ff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

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

.toast {
    padding: 1rem;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    animation: slideIn 0.3s ease-out;
    transition: all 0.3s ease;
    transform: translateX(0);
    opacity: 1;
}

.toast.hide {
    transform: translateX(100%);
    opacity: 0;
}

.toast-success {
    background-color: #4caf50;
    color: white;
}

.toast-error {
    background-color: #f44336;
    color: white;
}

.toast-info {
    background-color: #2196f3;
    color: white;
}

.toast-icon {
    font-size: 1.25rem;
}

.toast-close {
    margin-left: auto;
    cursor: pointer;
    opacity: 0.8;
    transition: opacity 0.2s ease;
}

.toast-close:hover {
    opacity: 1;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Header */
.app-header {
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #eee;
}

.app-header h5 {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
}

/* Responsividade */
@media (max-width: 992px) {
    .navbar-menu {
        position: fixed;
        top: 60px;
        left: 0;
        right: 0;
        background-color: #ffffff;
        flex-direction: column;
        height: auto;
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.3s ease;
        box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    }
    
    .navbar-menu.open {
        max-height: 500px;
    }
    
    .navbar-menu li a {
        padding: 1rem 1.5rem;
        border-bottom: 1px solid #eee;
        height: auto;
    }
    
    .navbar-menu li a.active {
        border-bottom: none;
        border-left: 4px solid #2962ff;
    }
    
    .navbar-toggle {
        display: block;
    }
}

@media (max-width: 768px) {
    body {
        font-size: 15px;
    }
    
    .card-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .form-actions {
        flex-direction: column;
    }
    
    .form-actions button {
        width: 100%;
    }
    
    .modal-content {
        width: 95%;
    }
    
    .modal.large .modal-content {
        width: 95%;
    }
}