* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    background: white;
    border-radius: 15px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
    overflow: hidden;
}

.header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 30px;
    text-align: center;
}

.header h1 {
    font-size: 2.5em;
    margin-bottom: 10px;
}

.header p {
    font-size: 1.1em;
    opacity: 0.9;
}

/* Navegação */
.navigation {
    background: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
    padding: 0;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
}

.nav-link {
    display: inline-block;
    padding: 15px 25px;
    color: #666;
    text-decoration: none;
    font-weight: 600;
    font-size: 16px;
    transition: all 0.3s ease;
    border-bottom: 3px solid transparent;
    position: relative;
}

.nav-link:hover {
    color: #667eea;
    background: #e9ecef;
}

.nav-link.active {
    color: #667eea;
    border-bottom-color: #667eea;
    background: white;
}

.nav-link.active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    right: 0;
    height: 3px;
    background: #667eea;
}

.content {
    padding: 30px;
}

.section {
    margin-bottom: 40px;
    padding: 25px;
    border-radius: 10px;
    background: #f8f9fa;
    border-left: 5px solid #667eea;
}

.section h2 {
    color: #333;
    margin-bottom: 20px;
    font-size: 1.5em;
}

/* Sistema de Abas */
.tabs {
    display: flex;
    border-bottom: 2px solid #ddd;
    margin-bottom: 25px;
    background: white;
    border-radius: 10px 10px 0 0;
    overflow: hidden;
}

.tab-button {
    flex: 1;
    padding: 15px 20px;
    background: #f8f9fa;
    border: none;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    color: #666;
    transition: all 0.3s ease;
    border-bottom: 3px solid transparent;
}

.tab-button:hover {
    background: #e9ecef;
    color: #333;
}

.tab-button.active {
    background: white;
    color: #667eea;
    border-bottom-color: #667eea;
}

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

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

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

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #333;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 1em;
    transition: border-color 0.3s;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #667eea;
}

.form-group small {
    display: block;
    margin-top: 5px;
    color: #666;
    font-size: 0.85em;
}

.cep-group {
    display: flex;
    gap: 10px;
    align-items: flex-end;
}

.cep-group input {
    flex: 1;
}

.cep-group button {
    white-space: nowrap;
}

.search-buttons {
    display: flex;
    gap: 10px;
    align-items: center;
}

.search-buttons .btn {
    flex: 1;
}

.search-buttons .btn-secondary {
    flex: 0 0 auto;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 12px 25px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    transition: transform 0.2s;
}

.btn:hover {
    transform: translateY(-2px);
}

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

.btn-secondary {
    background: linear-gradient(135deg, #6c757d 0%, #5a6268 100%);
    padding: 12px 15px;
    white-space: nowrap;
}

.btn-danger {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a52 100%);
}

.message {
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-weight: 500;
}

.message.success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.message.error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Indicador de busca */
.search-indicator {
    font-size: 0.8em;
    color: #667eea;
    font-weight: normal;
}

/* Informações de paginação */
.pagination-info {
    background: white;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    border: 1px solid #ddd;
    text-align: center;
}

.pagination-info p {
    margin: 0;
    color: #666;
    font-size: 0.9em;
}

/* Sistema de paginação */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    margin-top: 30px;
    padding: 20px;
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.pagination-numbers {
    display: flex;
    gap: 5px;
    align-items: center;
}

.pagination-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border: 2px solid #ddd;
    border-radius: 8px;
    text-decoration: none;
    color: #666;
    font-weight: 600;
    transition: all 0.3s ease;
}

.pagination-number:hover {
    border-color: #667eea;
    color: #667eea;
    transform: translateY(-2px);
}

.pagination-number.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-color: #667eea;
    color: white;
}

.pagination-ellipsis {
    color: #666;
    font-weight: bold;
    padding: 0 10px;
}

.students-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
    background: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.students-table th,
.students-table td {
    padding: 15px;
    text-align: left;
    border-bottom: 1px solid #eee;
}

.students-table th {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    font-weight: 600;
}

.students-table tr:hover {
    background: #f8f9fa;
}

.action-buttons {
    display: flex;
    gap: 10px;
}

.btn-small {
    padding: 8px 15px;
    font-size: 14px;
}

.stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px;
    border-radius: 10px;
    text-align: center;
}

.stat-number {
    font-size: 2em;
    font-weight: bold;
    margin-bottom: 5px;
}

.stat-label {
    font-size: 0.9em;
    opacity: 0.9;
}

/* Responsividade */
@media (max-width: 768px) {
    .container {
        margin: 10px;
        border-radius: 10px;
    }
    
    .header h1 {
        font-size: 2em;
    }
    
    .content {
        padding: 20px;
    }
    
    .section {
        padding: 20px;
    }
    
    .stats {
        grid-template-columns: 1fr;
    }
    
    .tabs {
        flex-direction: column;
    }
    
    .tab-button {
        border-radius: 0;
    }
    
    .tab-button.active {
        border-radius: 0;
    }
    
    .cep-group {
        flex-direction: column;
        gap: 10px;
    }
    
    .cep-group input {
        width: 100%;
    }
    
    .search-buttons {
        flex-direction: column;
        gap: 10px;
    }
    
    .search-buttons .btn {
        width: 100%;
    }
    
    .pagination {
        flex-direction: column;
        gap: 15px;
    }
    
    .pagination-numbers {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .students-table {
        font-size: 14px;
    }
    
    .students-table th,
    .students-table td {
        padding: 10px 8px;
    }
    
    /* Navegação responsiva */
    .nav-container {
        flex-direction: column;
    }
    
    .nav-link {
        width: 100%;
        text-align: center;
        border-radius: 0;
    }
    
    /* Responsividade da página de administração */
    .admin-actions {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .action-card {
        padding: 20px;
    }
    
    .age-analysis {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    
    .system-info {
        padding: 20px;
    }
    
    .info-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }
    
    .cep-group {
        flex-direction: column;
        gap: 10px;
    }
    
    .cep-group input {
        width: 100%;
    }
}

@media (max-width: 480px) {
    body {
        padding: 10px;
    }
    
    .header {
        padding: 20px;
    }
    
    .header h1 {
        font-size: 1.8em;
    }
    
    .btn {
        width: 100%;
        margin-bottom: 10px;
    }
    
    .pagination-number {
        width: 35px;
        height: 35px;
        font-size: 14px;
    }
}

/* Checkboxes personalizados */
.checkbox-container {
    display: inline-block;
    position: relative;
    padding-left: 25px;
    cursor: pointer;
    font-size: 14px;
    user-select: none;
}

.checkbox-container input {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 0;
    width: 0;
}

.checkmark {
    position: absolute;
    top: 0;
    left: 0;
    height: 18px;
    width: 18px;
    background-color: #fff;
    border: 2px solid #ddd;
    border-radius: 3px;
    transition: all 0.2s;
}

.checkbox-container:hover input ~ .checkmark {
    border-color: #667eea;
}

.checkbox-container input:checked ~ .checkmark {
    background-color: #667eea;
    border-color: #667eea;
}

.checkmark:after {
    content: "";
    position: absolute;
    display: none;
}

.checkbox-container input:checked ~ .checkmark:after {
    display: block;
}

.checkbox-container .checkmark:after {
    left: 5px;
    top: 2px;
    width: 4px;
    height: 8px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

/* Cabeçalho da tabela com checkbox */
.checkbox-header {
    width: 50px;
    text-align: center;
}

.checkbox-cell {
    width: 50px;
    text-align: center;
}

/* Controles de seleção múltipla */
.bulk-actions {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    border: 1px solid #e9ecef;
}

.bulk-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

.bulk-controls .checkbox-container {
    margin-right: 15px;
}

/* Modal de Edição */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
}

.modal-content {
    background-color: white;
    margin: 5% auto;
    padding: 0;
    border-radius: 15px;
    width: 90%;
    max-width: 600px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    animation: modalSlideIn 0.3s ease;
    max-height: 90vh;
    overflow-y: auto;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-50px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.modal-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px 25px;
    border-radius: 15px 15px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    margin: 0;
    font-size: 1.5em;
}

.close {
    color: white;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    transition: opacity 0.3s;
}

.close:hover {
    opacity: 0.7;
}

.modal form {
    padding: 25px;
}

.modal-footer {
    padding: 20px 25px;
    border-top: 1px solid #eee;
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

.modal-footer .btn {
    min-width: 120px;
}

/* Botão primário para editar */
.btn-primary {
    background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
}

.btn-primary:hover {
    background: linear-gradient(135deg, #5a6fd8 0%, #6a4c93 100%);
}

/* Responsividade da modal */
@media (max-width: 768px) {
    .modal-content {
        width: 95%;
        margin: 10% auto;
    }
    
    .modal-header {
        padding: 15px 20px;
    }
    
    .modal form {
        padding: 20px;
    }
    
    .modal-footer {
        padding: 15px 20px;
        flex-direction: column;
    }
    
    .modal-footer .btn {
        width: 100%;
    }
}

/* Dashboard Styles */
.dashboard {
    padding: 20px;
}

.dashboard-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 30px;
    border-radius: 15px;
    margin-bottom: 30px;
    text-align: center;
}

.dashboard-header h1 {
    font-size: 2.5em;
    margin-bottom: 10px;
}

.dashboard-header p {
    font-size: 1.2em;
    opacity: 0.9;
    margin-bottom: 20px;
}

.dashboard-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: white;
    border-radius: 15px;
    padding: 25px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    display: flex;
    align-items: center;
    gap: 20px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(0,0,0,0.15);
}

.stat-card.primary {
    border-left: 5px solid #667eea;
}

.stat-card.success {
    border-left: 5px solid #28a745;
}

.stat-card.warning {
    border-left: 5px solid #ffc107;
}

.stat-card.info {
    border-left: 5px solid #17a2b8;
}

.stat-card.danger {
    border-left: 5px solid #dc3545;
}

.stat-icon {
    font-size: 3em;
    opacity: 0.8;
}

.stat-content {
    flex: 1;
}

.stat-number {
    font-size: 2.5em;
    font-weight: bold;
    color: #333;
    line-height: 1;
}

.stat-label {
    font-size: 1em;
    color: #666;
    margin-top: 5px;
}

.charts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.chart-card {
    background: white;
    border-radius: 15px;
    padding: 25px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

.chart-card h3 {
    color: #333;
    margin-bottom: 20px;
    font-size: 1.3em;
}

.chart-container {
    position: relative;
    height: 300px;
    width: 100%;
    overflow: hidden;
}

.chart-container canvas {
    max-height: 300px !important;
    max-width: 100% !important;
}

.tables-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.table-card {
    background: white;
    border-radius: 15px;
    padding: 25px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

.table-card h3 {
    color: #333;
    margin-bottom: 20px;
    font-size: 1.3em;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
}

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

.data-table th {
    background: #f8f9fa;
    font-weight: 600;
    color: #333;
}

.data-table tr:hover {
    background: #f8f9fa;
}

.system-info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}

.info-card {
    background: white;
    border-radius: 15px;
    padding: 25px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

.info-card h3 {
    color: #333;
    margin-bottom: 20px;
    font-size: 1.3em;
}

.info-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.info-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid #eee;
}

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

.info-label {
    font-weight: 600;
    color: #666;
}

.info-value {
    font-weight: 500;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.9em;
}

.info-value.success {
    background: #d4edda;
    color: #155724;
}

.info-value.warning {
    background: #fff3cd;
    color: #856404;
}

.info-value.error {
    background: #f8d7da;
    color: #721c24;
}

.info-value.info {
    background: #d1ecf1;
    color: #0c5460;
}

/* Responsive Design */
@media (max-width: 768px) {
    .dashboard {
        padding: 10px;
    }
    
    .dashboard-header {
        padding: 20px;
    }
    
    .dashboard-header h1 {
        font-size: 2em;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .charts-grid {
        grid-template-columns: 1fr;
    }
    
    .tables-grid {
        grid-template-columns: 1fr;
    }
    
    .system-info-grid {
        grid-template-columns: 1fr;
    }
    
    .stat-card {
        padding: 20px;
    }
    
    .stat-icon {
        font-size: 2.5em;
    }
    
    .stat-number {
        font-size: 2em;
    }
    
    .chart-card,
    .table-card,
    .info-card {
        padding: 20px;
    }
    
    .data-table {
        font-size: 0.9em;
    }
    
    .data-table th,
    .data-table td {
        padding: 8px;
    }
}

@media (max-width: 480px) {
    .dashboard-header h1 {
        font-size: 1.8em;
    }
    
    .dashboard-header p {
        font-size: 1em;
    }
    
    .dashboard-actions {
        flex-direction: column;
        align-items: center;
    }
    
    .dashboard-actions .btn {
        width: 100%;
        max-width: 200px;
    }
    
    .stat-card {
        flex-direction: column;
        text-align: center;
        gap: 15px;
    }
    
    .info-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }
}

.chart-card,
.table-card,
.info-card {
    padding: 20px;
}

.chart-container {
    height: 250px;
}

.chart-container canvas {
    max-height: 250px !important;
}

.data-table {
    font-size: 0.9em;
}
