* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #f5f5f0 0%, #faf8f3 100%);
    color: #333;
    padding: 20px;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    background: #ffffff;
    border-radius: 15px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.1);
    overflow: hidden;
}

.header {
    background: linear-gradient(135deg, #1e3a5f 0%, #2d5a8c 100%);
    padding: 30px;
    text-align: center;
    color: white;
}

.header h1 {
    font-size: 2.5em;
    margin-bottom: 10px;
}

.stats-bar {
    background: #f0f4f8;
    padding: 20px 40px;
    border-bottom: 2px solid #e1e8ed;
    display: flex;
    justify-content: space-around;
    flex-wrap: wrap;
    gap: 20px;
}

.stat-item {
    text-align: center;
}

.stat-number {
    font-size: 2em;
    font-weight: bold;
    color: #1e3a5f;
}

.stat-label {
    color: #666;
    font-size: 14px;
    margin-top: 5px;
}

.content {
    padding: 40px;
}

.actions-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    flex-wrap: wrap;
    gap: 15px;
}

.search-box {
    flex: 1;
    min-width: 250px;
}

.search-box input {
    width: 100%;
    padding: 12px 20px;
    border: 2px solid #e1e8ed;
    border-radius: 8px;
    font-size: 14px;
}

.search-box input:focus {
    outline: none;
    border-color: #1e3a5f;
}

.form-section {
    margin-bottom: 30px;
    padding: 25px;
    background: #f0f4f8;
    border-radius: 10px;
    border-left: 4px solid #ff9933;
}

.form-section h3 {
    color: #1e3a5f;
    margin-bottom: 20px;
    font-size: 1.4em;
    border-bottom: 2px solid #e1e8ed;
    padding-bottom: 10px;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
}

label {
    font-weight: 600;
    color: #1e3a5f;
    margin-bottom: 8px;
    font-size: 14px;
}

input, textarea, select {
    padding: 12px;
    border: 2px solid #e1e8ed;
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.3s;
    background: #ffffff;
}

input:focus, textarea:focus, select:focus {
    outline: none;
    border-color: #1e3a5f;
    box-shadow: 0 0 0 3px rgba(30, 58, 95, 0.1);
}

textarea {
    resize: vertical;
    min-height: 100px;
}

.photo-upload {
    display: flex;
    align-items: center;
    gap: 20px;
}

.photo-preview {
    width: 150px;
    height: 150px;
    border: 3px dashed #e1e8ed;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: #fafafa;
}

.photo-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.photo-preview-placeholder {
    text-align: center;
    color: #999;
    font-size: 12px;
}

.btn {
    padding: 12px 30px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    margin: 5px;
}

.btn-primary {
    background: linear-gradient(135deg, #1e3a5f 0%, #2d5a8c 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(30, 58, 95, 0.3);
}

.btn-secondary {
    background: #f0f4f8;
    color: #1e3a5f;
    border: 2px solid #e1e8ed;
}

.btn-secondary:hover {
    background: #e1e8ed;
}

.btn-success {
    background: #28a745;
    color: white;
}

.btn-danger {
    background: #dc3545;
    color: white;
}

.btn-warning {
    background: #ff9933;
    color: white;
}

.btn-small {
    padding: 8px 16px;
    font-size: 14px;
}

.dynamic-list {
    margin-top: 15px;
}

.dynamic-item {
    background: white;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 15px;
    border: 2px solid #e1e8ed;
    border-left: 4px solid #ff9933;
}

.dynamic-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.cv-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 25px;
}

.cv-card {
    background: #f0f4f8;
    padding: 25px;
    border-radius: 12px;
    border: 2px solid #e1e8ed;
    border-left: 4px solid #ff9933;
    transition: all 0.3s;
}

.cv-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
}

.cv-card-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #e1e8ed;
}

.cv-photo {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid #1e3a5f;
}

.cv-photo-placeholder {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: #e1e8ed;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 30px;
}

.cv-info h4 {
    color: #1e3a5f;
    margin-bottom: 5px;
    font-size: 1.2em;
}

.cv-info p {
    color: #666;
    font-size: 14px;
}

.cv-details {
    margin-bottom: 15px;
}

.cv-detail-item {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    color: #666;
    font-size: 14px;
}

.cv-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #999;
}

.empty-state-icon {
    font-size: 4em;
    margin-bottom: 20px;
}

.preview-container {
    background: white;
    padding: 40px;
    max-width: 800px;
    margin: 0 auto;
    border-radius: 10px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
}

/* NOVO LAYOUT DO CV - Modelo com barra lateral */
.preview-cv-layout {
    display: grid;
    grid-template-columns: 280px 1fr;
    min-height: 100vh;
    background: white;
}

.preview-sidebar {
    background: linear-gradient(180deg, #1e3a5f 0%, #163049 100%);
    color: white;
    padding: 30px 20px;
}

.preview-sidebar-photo {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    margin: 0 auto 20px;
    overflow: hidden;
    border: 4px solid rgba(255,255,255,0.3);
}

.preview-sidebar-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.preview-sidebar h2 {
    text-align: center;
    font-size: 1.3em;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 2px solid rgba(255,255,255,0.3);
}

.preview-sidebar-section {
    margin-bottom: 25px;
}

.preview-sidebar-section h4 {
    color: #ff9933;
    font-size: 1em;
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.preview-sidebar-section p {
    font-size: 0.9em;
    line-height: 1.6;
    color: rgba(255,255,255,0.9);
    margin-bottom: 8px;
}

.preview-main {
    padding: 40px;
    background: white;
}

.preview-main-header {
    border-left: 4px solid #ff9933;
    padding-left: 20px;
    margin-bottom: 30px;
}

.preview-main-header h1 {
    color: #1e3a5f;
    font-size: 2em;
    margin-bottom: 5px;
}

.preview-main-header p {
    color: #666;
    font-size: 1.1em;
}

.preview-section {
    margin-bottom: 30px;
    page-break-inside: avoid;
    break-inside: avoid;
}

.preview-section h3 {
    background: linear-gradient(90deg, #1e3a5f 0%, #2d5a8c 100%);
    color: white;
    padding: 12px 20px;
    border-radius: 5px;
    margin-bottom: 15px;
    font-size: 1.1em;
    position: relative;
    page-break-after: avoid;
    break-after: avoid;
}

.preview-section h3::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: #ff9933;
}

.preview-table {
    width: 100%;
    border-collapse: collapse;
    page-break-inside: auto;
}

.preview-table tr {
    page-break-inside: avoid;
    break-inside: avoid;
}

.preview-table td {
    padding: 10px;
    border-bottom: 1px solid #e1e8ed;
    line-height: 1.6;
}

.preview-table td:first-child {
    font-weight: 600;
    color: #1e3a5f;
    width: 35%;
}

.signature-line {
    margin-top: 60px;
    padding-top: 10px;
    border-top: 2px solid #1e3a5f;
    text-align: center;
    color: #666;
    font-size: 14px;
    max-width: 200px;
    margin-left: auto;
    margin-right: auto;
}

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.8);
    z-index: 1000;
    overflow: auto;
}

.modal-content {
    padding: 40px;
}

.modal-header {
    text-align: right;
    margin-bottom: 20px;
}

.loading {
    display: none;
    text-align: center;
    padding: 40px;
    color: #666;
}

.loading-spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #1e3a5f;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
    margin: 0 auto 15px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@media print {
    body {
        background: white;
    }
    .btn, .modal-header {
        display: none;
    }
}

@media (max-width: 768px) {
    .header h1 {
        font-size: 1.8em;
    }
    
    .content {
        padding: 20px;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .cv-grid {
        grid-template-columns: 1fr;
    }
    
    .preview-cv-layout {
        grid-template-columns: 1fr;
    }
    
    .preview-sidebar {
        padding: 20px;
    }
    
    .preview-main {
        padding: 20px;
    }
}