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

body {
    font-family: Arial, sans-serif;
    background: #f5f5f5;
    color: #333;
    line-height: 1.6;
}

.container {
    max-width: 1600px;
    margin: 0 auto;
    background: white;
    box-shadow: 0 0 20px rgba(0,0,0,0.1);
}

.header {
    background: #1e3a5f;
    color: white;
    padding: 30px;
    text-align: center;
    position: relative;
}

.header-logo {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 30px;
    margin-bottom: 20px;
}

.header h1 {
    font-size: 1.8em;
    margin-bottom: 5px;
    font-weight: normal;
}

.header h2 {
    font-size: 1.4em;
    margin-bottom: 10px;
    color: #ffd700;
}

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

.reference-info {
    background: #fff3cd;
    border: 1px solid #ffc107;
    padding: 15px;
    margin: 20px;
    border-radius: 5px;
}

.reference-info h3 {
    color: #856404;
    margin-bottom: 10px;
}

.reference-info ul {
    list-style: none;
    padding-left: 20px;
}

.reference-info li {
    margin: 5px 0;
}

.controls {
    background: #f8f9fa;
    padding: 20px;
    border-bottom: 2px solid #dee2e6;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

.btn-group {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.btn-primary {
    background: #007bff;
    color: white;
}

.btn-primary:hover {
    background: #0056b3;
}

.btn-success {
    background: #28a745;
    color: white;
}

.btn-success:hover {
    background: #218838;
}

.btn-warning {
    background: #ffc107;
    color: #212529;
}

.btn-warning:hover {
    background: #e0a800;
}

.btn-danger {
    background: #dc3545;
    color: white;
}

.btn-danger:hover {
    background: #c82333;
}

.btn-info {
    background: #17a2b8;
    color: white;
}

.btn-info:hover {
    background: #138496;
}

.content {
    padding: 20px;
}

.section-title {
    background: #e9ecef;
    padding: 15px;
    margin: 20px 0;
    border-left: 5px solid #1e3a5f;
    font-size: 1.2em;
    font-weight: bold;
}

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

.stat-card {
    background: white;
    border: 1px solid #dee2e6;
    padding: 20px;
    text-align: center;
    border-radius: 5px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.stat-card h3 {
    font-size: 2em;
    color: #1e3a5f;
    margin-bottom: 5px;
}

.stat-card p {
    color: #6c757d;
    font-size: 0.9em;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
    font-size: 14px;
}

thead {
    background: #1e3a5f;
    color: white;
}

th {
    padding: 12px 8px;
    text-align: left;
    font-weight: normal;
    border: 1px solid #dee2e6;
    position: sticky;
    top: 0;
    z-index: 10;
}

td {
    padding: 10px 8px;
    border: 1px solid #dee2e6;
    vertical-align: middle;
}

tbody tr:nth-child(even) {
    background: #f8f9fa;
}

tbody tr:hover {
    background: #e9ecef;
}

.editable {
    background: #fff;
    border: 1px solid transparent;
    padding: 5px;
    border-radius: 3px;
    width: 100%;
    min-height: 30px;
    transition: all 0.3s;
}

.editable:hover {
    border-color: #007bff;
    background: #f0f8ff;
}

.editable:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 2px rgba(0,123,255,0.25);
}

.risk-level {
    padding: 3px 8px;
    border-radius: 3px;
    font-size: 12px;
    font-weight: bold;
    text-align: center;
    width: 100%;
}

.risk-alto {
    background: #dc3545;
    color: white;
}

.risk-medio {
    background: #ffc107;
    color: #212529;
}

.risk-baixo {
    background: #28a745;
    color: white;
}

.month-checkbox {
    width: 20px;
    height: 20px;
    cursor: pointer;
}

.status-badge {
    padding: 3px 8px;
    border-radius: 3px;
    font-size: 12px;
    font-weight: bold;
    text-align: center;
    width: 100%;
}

.status-planejado {
    background: #007bff;
    color: white;
}

.status-execucao {
    background: #ffc107;
    color: #212529;
}

.status-concluido {
    background: #28a745;
    color: white;
}

.status-suspenso {
    background: #6c757d;
    color: white;
}

.btn-action {
    padding: 5px 10px;
    margin: 2px;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.3s;
}

.btn-duplicate {
    background: #17a2b8;
    color: white;
}

.btn-delete {
    background: #dc3545;
    color: white;
}

.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
}

.modal-content {
    background: white;
    margin: 2% auto;
    padding: 30px;
    width: 90%;
    max-width: 800px;
    border-radius: 5px;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #dee2e6;
}

.modal-header h2 {
    color: #1e3a5f;
}

.close {
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    color: #6c757d;
}

.close:hover {
    color: #000;
}

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

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
    color: #495057;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 8px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-size: 14px;
}

.form-group textarea {
    resize: vertical;
    min-height: 80px;
}

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

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #dee2e6;
}

.legend {
    background: #f8f9fa;
    padding: 15px;
    margin: 20px 0;
    border-radius: 5px;
    border: 1px solid #dee2e6;
}

.legend h4 {
    margin-bottom: 10px;
    color: #1e3a5f;
}

.legend-items {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 5px;
}

.legend-color {
    width: 20px;
    height: 20px;
    border-radius: 3px;
    border: 1px solid #dee2e6;
}

.footer {
    background: #1e3a5f;
    color: white;
    padding: 30px;
    text-align: center;
    margin-top: 40px;
}

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

.footer-section h4 {
    margin-bottom: 10px;
    color: #ffd700;
}

.footer-section p {
    margin: 5px 0;
    font-size: 14px;
}

.toast {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: #28a745;
    color: white;
    padding: 15px 20px;
    border-radius: 4px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    display: none;
    z-index: 2000;
}

.toast.show {
    display: block;
    animation: slideIn 0.3s;
}

.toast.error {
    background: #dc3545;
}

.toast.warning {
    background: #ffc107;
    color: #212529;
}

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

.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255,255,255,.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

@media print {
    .controls,
    .btn-action,
    .modal {
        display: none !important;
    }
    
    body {
        background: white;
    }
    
    .container {
        box-shadow: none;
    }
}

@media (max-width: 768px) {
    .form-row {
        grid-template-columns: 1fr;
    }
    
    table {
        font-size: 12px;
    }
    
    th, td {
        padding: 5px;
    }
    
    .stats-grid {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    }
}