* {
    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;
    color: #333;
    font-size: 14px;
}

.header {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    padding: 20px 0;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 24px;
    font-weight: bold;
    color: #2c3e50;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

.nav-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 30px 0 20px;
}

.nav-tab {
    padding: 10px 20px;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    border-radius: 25px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.nav-tab.active {
    background: #3498db;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(52, 152, 219, 0.3);
}

.nav-tab:hover:not(.active) {
    background: rgba(255, 255, 255, 1);
    transform: translateY(-1px);
}

.content-section {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 25px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    display: none;
}

.content-section.active {
    display: block;
}

.section-header {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #ecf0f1;
    gap: 10px;
}

.section-title {
    font-size: 22px;
    font-weight: bold;
    color: #2c3e50;
}

.btn {
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
    font-size: 14px;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
}

.btn-primary { background: #3498db; color: white; }
.btn-success { background: #2ecc71; color: white; }
.btn-warning { background: #f39c12; color: white; }
.btn-danger { background: #e74c3c; color: white; }
.btn-info { background: #5bc0de; color: white; }

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.form-group { margin-bottom: 15px; }

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    color: #34495e;
    font-size: 14px;
}

.radio-item {
    display: block;
    margin-bottom: 10px;
    padding: 10px;
    border: 1px solid #ecf0f1;
    border-radius: 6px;
    cursor: pointer;
}
.radio-item:has(input:disabled) {
    cursor: not-allowed;
    background-color: #f8f9fa;
    color: #aaa;
}
.radio-item input {
    margin-right: 8px;
}


.form-control {
    width: 100%;
    padding: 10px;
    border: 1px solid #ecf0f1;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.3s ease;
}

.form-control:focus {
    outline: none;
    border-color: #3498db;
}

.form-control:disabled {
    background-color: #f8f9fa;
    cursor: not-allowed;
}

.checkbox-container {
    max-height: 150px;
    overflow-y: auto;
    border: 1px solid #ecf0f1;
    border-radius: 6px;
    padding: 10px;
    background-color: #fdfdfd;
}

.checkbox-item {
    display: block;
    margin-bottom: 8px;
    padding: 5px;
    cursor: pointer;
    border-radius: 4px;
    transition: background-color 0.2s;
}

.checkbox-item:hover {
    background-color: #f8f9fa;
}

.checkbox-item input {
    margin-right: 8px;
}

.card {
    background: white;
    border-radius: 10px;
    padding: 16px;
    margin-bottom: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.07);
    border-left: 4px solid #3498db;
    transition: all 0.2s ease-in-out;
}
.card:hover {
    box-shadow: 0 4px 15px rgba(0,0,0,0.12);
    transform: translateY(-2px);
}

.project-card { border-left-color: #2ecc71; }
.client-card { border-left-color: #9b59b6; }
.task-card, .control-point-card { cursor: pointer; }
.control-point-card.type-cci { border-left-color: #f39c12; }
.control-point-card.type-ressalva { border-left-color: #e74c3c; }
.control-point-card.type-enfase { border-left-color: #3498db; }


.priority-low { border-left-color: #95a5a6; background: #fdfdfd; }
.priority-medium { border-left-color: #3498db; background: #f8fbff; }
.priority-high { border-left-color: #f39c12; background: #fffbf0; }
.priority-urgent { border-left-color: #e74c3c; background: #fef5f5; }

.subtask-indicator, .phase-badge {
    font-size: 11px;
    color: #7f8c8d;
    font-weight: normal;
    background: #ecf0f1;
    padding: 2px 8px;
    border-radius: 10px;
    margin-left: 8px;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.card-title {
    font-size: 16px;
    font-weight: 700;
    color: #2c3e50;
    margin: 0;
}

.card-details p {
    margin: 0 0 8px 0;
    font-size: 14px;
    line-height: 1.5;
}

.card-details strong {
    color: #34495e;
}

.card-details .detail-block, .control-card-details-full {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #f0f0f0;
}

.control-card-details-full {
    display: none;
}
.control-point-card.is-expanded .control-card-details-full {
    display: block;
}


.client-doc {
    font-size: 12px;
    color: #7f8c8d;
    background: #f8f9fa;
    padding: 2px 8px;
    border-radius: 12px;
}

#projectsList,
#clientsList,
#controlPointsList {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 16px;
}

#tasksList {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 16px;
}

.project-summary,
.client-summary {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 10px;
    gap: 20px;
}

.project-info,
.client-info {
    flex: 1;
}

.project-info p,
.client-info p {
    margin: 0 0 4px 0;
    font-size: 13px;
}

.hours-breakdown {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-top: 10px;
    padding: 10px;
    background-color: #f8f9fa;
    border-radius: 6px;
    border: 1px solid #ecf0f1;
}

.hour-item {
    font-size: 12px;
}

.hour-item strong {
    display: block;
    font-size: 15px;
    font-weight: 700;
}

.hour-item-label {
    color: #555;
    font-size: 11px;
    text-transform: uppercase;
}

.saldo-positive { color: #27ae60; }
.saldo-negative { color: #e74c3c; }


.card-actions {
    display: flex;
    gap: 8px;
    margin-top: 12px;
    padding-top: 10px;
    border-top: 1px solid #f0f0f0;
    justify-content: flex-end;
}

.task-hierarchy {
    grid-column: 1 / -1;
    margin-top: 12px;
    margin-left: 20px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 10px;
    transition: all 0.3s ease;
}

.task-hierarchy.hidden { display: none; }
.subtask-item { background: #f8f9fa !important; border-left-color: #95a5a6 !important; margin: 0; }

.progress-bar {
    width: 100%;
    height: 6px;
    background: #ecf0f1;
    border-radius: 3px;
    overflow: hidden;
    margin: 8px 0;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #2ecc71, #27ae60);
    transition: width 0.3s ease;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: white;
    padding: 20px;
    border-radius: 12px;
    text-align: center;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
}

.stat-number {
    font-size: 32px;
    font-weight: bold;
    color: #3498db;
    margin-bottom: 5px;
}

.stat-label {
    color: #7f8c8d;
    font-weight: 600;
}

.table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
}

.table th, .table td {
    padding: 10px;
    text-align: left;
    border-bottom: 1px solid #ecf0f1;
    font-size: 14px;
    vertical-align: top;
}

.table tr {
    page-break-inside: avoid;
}

.table th {
    background: #f8f9fa;
    font-weight: 600;
    color: #34495e;
}

.status-badge {
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
}

.risk-badge {
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    color: white;
    margin-left: 5px;
    vertical-align: middle;
}

.risk-badge.risk-low { background: #2ecc71; }
.risk-badge.risk-medium { background: #f39c12; }
.risk-badge.risk-high { background: #e74c3c; }

.status-planning { background: #fff3cd; color: #856404; }
.status-progress { background: #cce5ff; color: #004085; }
.status-completed { background: #d4edda; color: #155724; }
.status-overdue { background: #f8d7da; color: #721c24; }
.status-cci { background: #fff3cd; color: #856404; }
.status-ressalva { background: #f8d7da; color: #721c24; }
.status-enfase { background: #cce5ff; color: #004085; }


.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background: rgba(0, 0, 0, 0.5);
}

.modal-content {
    background: white;
    margin: 3% auto;
    padding: 20px;
    border-radius: 12px;
    width: 90%;
    max-width: 600px;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
}

.modal-body { overflow-y: auto; flex: 1; padding-right: 15px; }

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid #ecf0f1;
    flex-shrink: 0;
}

.modal-header h3 { font-size: 18px; margin: 0; }
.close { color: #aaa; font-size: 28px; font-weight: bold; cursor: pointer; }
.close:hover { color: #333; }

.text-danger { color: #e74c3c; }

.task-card-summary {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
}
.task-card-summary-info p { margin: 0; font-size: 13px; color: #555; }
.task-card-summary-info p strong { font-size: 15px; color: #2c3e50; font-weight: 700; }
.task-card-summary-hours { text-align: right; font-size: 13px; flex-shrink: 0; }

.details-grid,
.task-actions { display: none; }

.is-expanded .details-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); 
    gap: 3px 15px;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #f0f0f0;
    font-size: 13px;
}
.is-expanded .details-grid p { margin: 0; }
.is-expanded .details-grid ul { list-style-position: inside; padding-left: 5px; margin-top: 5px; }
.is-expanded .details-grid li { margin-bottom: 5px; }


.is-expanded .task-actions { 
    display: flex; 
    flex-wrap: wrap; 
    gap: 6px; 
    margin-top: 12px;
    padding-top: 10px;
    border-top: 1px solid #f0f0f0;
}
.task-actions .btn { padding: 5px 12px; font-size: 12px; }

.risk-container { margin-bottom: 10px; }
.risk-item {
    display: flex;
    gap: 10px;
    align-items: center;
    padding: 10px;
    border: 1px solid #ecf0f1;
    border-radius: 6px;
    margin-bottom: 8px;
    background-color: #fdfdfd;
}
.risk-item select { width: 120px; flex-shrink: 0; }
.risk-item input { flex-grow: 1; }
.risk-item .btn-danger { padding: 4px 8px; font-size: 14px; line-height: 1; }

.replicate-client-list .client-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px;
    border-bottom: 1px solid #ecf0f1;
}
.replicate-client-list .client-item:last-child { border-bottom: none; }
.replicate-client-list .client-item label { display: flex; align-items: center; gap: 10px; font-weight: 600; }
.replicate-client-list .client-item .hours-input { width: 100px; }

.replicate-tasks-list {
    max-height: 200px;
    overflow-y: auto;
    border: 1px solid #ecf0f1;
    padding: 10px;
    border-radius: 6px;
}
.replicate-tasks-list .task-item {
    display: block;
    padding: 8px;
    border-bottom: 1px solid #f0f0f0;
}
.replicate-tasks-list .task-item:last-child {
    border-bottom: none;
}
.risk-list-preview {
    background-color: #f8f9fa;
    padding: 10px;
    border-radius: 6px;
    margin-bottom: 15px;
}

.report-header {
    margin-bottom: 20px;
    padding: 15px;
    border: 1px solid #ddd;
    border-radius: 8px;
    background-color: #fdfdfd;
}
.report-header h3 {
    margin-top: 0;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
    font-size: 18px;
}
.report-header h4 {
    font-size: 14px;
    color: #34495e;
    margin-top: 10px;
    margin-bottom: 5px;
}
.report-header p {
    font-size: 13px;
    line-height: 1.6;
    color: #555;
    margin-bottom: 10px;
}

.risk-details-row td {
    background-color: #fcfcfc;
    border-bottom: 1px solid #ecf0f1 !important;
    padding-top: 5px !important;
    padding-bottom: 5px !important;
}
.risk-details-container {
    font-size: 12px;
    color: #555;
}
.risk-details-container strong {
    color: #34495e;
}
.risk-details-container ul {
    margin: 4px 0 0 0;
    padding-left: 18px;
    list-style-type: '– ';
}
.risk-details-container li {
    padding-bottom: 2px;
}


@media print {
    body, .container, .content-section.active, #reportContainer {
        background: white !important;
        color: black !important;
        box-shadow: none !important;
        padding: 0 !important;
        margin: 0 !important;
    }
    .header, .nav-tabs, .section-header, .form-grid, .btn, .card-actions, [data-action] {
        display: none !important;
    }
    .modal { display: none !important; }
    #reportContainer, #reportContainer *, #reportResults, #reportResults * { visibility: visible; }
    #reportContainer, #reportResults {
        position: absolute;
        left: 0;
        top: 0;
        width: 100%;
    }
    .card, .report-header {
        box-shadow: none !important;
        border: none !important;
        margin-bottom: 0 !important;
        padding: 0 0 15px 0 !important;
        page-break-inside: avoid !important;
    }
    .card:first-of-type, .report-header {
        page-break-after: avoid !important;
    }
    .table { font-size: 10pt; }
    .table th, .table td { padding: 5px; }
}


@media (max-width: 1200px) {
    #projectsList,
    #clientsList {
        grid-template-columns: 1fr;
    }
    #tasksList {
        grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    }
    .task-hierarchy {
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
        margin-left: 15px;
    }
}

@media (max-width: 768px) {
    .container { padding: 0 10px; }
    .form-grid { grid-template-columns: 1fr; }
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .modal-content { width: 95%; margin: 10% auto; padding: 15px; }
    
    #projectsList, #clientsList, #tasksList, #controlPointsList {
        grid-template-columns: 1fr;
    }
    .task-hierarchy {
        margin-left: 10px;
    }
    .project-summary, .client-summary {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
}
/* Adicionado para links de navegação no cabeçalho */
.nav-link {
    color: #3498db;
    text-decoration: none;
    font-weight: 600;
    transition: color 0.2s;
}

.nav-link:hover {
    text-decoration: underline;
    color: #2980b9;
}