* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
    --primary: #1a5f7a;
    --primary-dark: #0d3b4c;
    --secondary: #57c5b6;
    --accent: #159895;
    --warning: #f39c12;
    --danger: #e74c3c;
    --success: #27ae60;
    --bg: #f8fafc;
    --card-bg: #ffffff;
    --text: #2c3e50;
    --text-light: #7f8c8d;
    --border: #e1e8ed;
    --shadow: 0 4px 20px rgba(0,0,0,0.08);
    --shadow-hover: 0 8px 30px rgba(0,0,0,0.12);
}

body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
}

.header {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    padding: 1rem 2rem;
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-content {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.logo { display: flex; align-items: center; gap: 0.75rem; }

.logo-icon {
    width: 50px;
    height: 50px;
    background: var(--secondary);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.logo-text h1 { font-size: 1.5rem; font-weight: 700; letter-spacing: -0.5px; }
.logo-text p { font-size: 0.75rem; opacity: 0.9; font-weight: 400; }

.company-selector {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(255,255,255,0.15);
    padding: 0.5rem 1rem;
    border-radius: 8px;
    backdrop-filter: blur(10px);
}

.company-selector select {
    background: transparent;
    border: none;
    color: white;
    font-size: 0.9rem;
    cursor: pointer;
    outline: none;
}

.company-selector select option { color: var(--text); }

.nav-container {
    background: var(--card-bg);
    border-bottom: 1px solid var(--border);
    padding: 0 2rem;
    overflow-x: auto;
}

.nav {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    gap: 0.5rem;
}

.nav-item {
    padding: 1rem 1.25rem;
    cursor: pointer;
    border-bottom: 3px solid transparent;
    transition: all 0.3s ease;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 500;
    font-size: 0.9rem;
    color: var(--text-light);
}

.nav-item:hover { color: var(--primary); background: rgba(26, 95, 122, 0.05); }
.nav-item.active { color: var(--primary); border-bottom-color: var(--primary); }
.nav-item i { font-size: 1rem; }

.main-container { max-width: 1400px; margin: 0 auto; padding: 2rem; }

.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); }
}

.card {
    background: var(--card-bg);
    border-radius: 16px;
    padding: 1.5rem;
    box-shadow: var(--shadow);
    margin-bottom: 1.5rem;
    transition: box-shadow 0.3s ease;
}

.card:hover { box-shadow: var(--shadow-hover); }

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.card-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.btn {
    padding: 0.625rem 1.25rem;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { background: var(--primary-dark); transform: translateY(-2px); }
.btn-success { background: var(--success); color: white; }
.btn-success:hover { background: #219a52; }
.btn-danger { background: var(--danger); color: white; }
.btn-warning { background: var(--warning); color: white; }
.btn-secondary { background: var(--text-light); color: white; }
.btn-outline { background: transparent; border: 2px solid var(--primary); color: var(--primary); }
.btn-outline:hover { background: var(--primary); color: white; }
.btn-sm { padding: 0.375rem 0.75rem; font-size: 0.8rem; }

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.25rem;
}

.form-group { display: flex; flex-direction: column; gap: 0.375rem; }
.form-group label { font-size: 0.875rem; font-weight: 500; color: var(--text); }
.form-group label .required { color: var(--danger); }

.form-control {
    padding: 0.625rem 0.875rem;
    border: 2px solid var(--border);
    border-radius: 8px;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    background: white;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(26, 95, 122, 0.1);
}

textarea.form-control { min-height: 100px; resize: vertical; }

.table-container { overflow-x: auto; }

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}

.data-table th {
    background: var(--bg);
    padding: 0.875rem 1rem;
    text-align: left;
    font-weight: 600;
    color: var(--text);
    border-bottom: 2px solid var(--border);
    white-space: nowrap;
}

.data-table td { padding: 1rem; border-bottom: 1px solid var(--border); vertical-align: middle; }
.data-table tr:hover { background: rgba(26, 95, 122, 0.02); }

.badge {
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 500;
    display: inline-block;
}

.badge-success { background: rgba(39, 174, 96, 0.15); color: var(--success); }
.badge-warning { background: rgba(243, 156, 18, 0.15); color: var(--warning); }
.badge-danger { background: rgba(231, 76, 60, 0.15); color: var(--danger); }
.badge-info { background: rgba(26, 95, 122, 0.15); color: var(--primary); }

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.25rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--card-bg);
    border-radius: 16px;
    padding: 1.5rem;
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: transform 0.3s ease;
}

.stat-card:hover { transform: translateY(-5px); }

.stat-icon {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.stat-icon.blue { background: rgba(26, 95, 122, 0.15); color: var(--primary); }
.stat-icon.green { background: rgba(39, 174, 96, 0.15); color: var(--success); }
.stat-icon.orange { background: rgba(243, 156, 18, 0.15); color: var(--warning); }
.stat-icon.red { background: rgba(231, 76, 60, 0.15); color: var(--danger); }
.stat-icon.purple { background: rgba(155, 89, 182, 0.15); color: #9b59b6; }

.stat-info h3 { font-size: 1.75rem; font-weight: 700; color: var(--text); }
.stat-info p { font-size: 0.875rem; color: var(--text-light); }

.modal-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 2000;
    justify-content: center;
    align-items: center;
    padding: 1rem;
    backdrop-filter: blur(4px);
}

.modal-overlay.active { display: flex; }

.modal {
    background: white;
    border-radius: 16px;
    max-width: 700px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    animation: modalSlide 0.3s ease;
}

@keyframes modalSlide {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

.modal-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-title { font-size: 1.25rem; font-weight: 600; }

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-light);
    transition: color 0.3s;
}

.modal-close:hover { color: var(--danger); }

.modal-body { padding: 1.5rem; }

.modal-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
}

/* Login padronizado C2 System */
.login-screen {
    background: linear-gradient(145deg, #f7faf8 0%, #edf3f0 100%);
    padding: 24px;
}

.login-modal-card {
    width: min(100%, 410px);
    max-width: 410px;
    border: 1px solid #dfe8e3;
    border-radius: 18px;
    box-shadow: 0 18px 50px rgba(23, 55, 39, 0.14);
    overflow: hidden;
}

.login-brand {
    padding: 28px 32px 0;
    text-align: center;
}

.login-brand img {
    display: block;
    width: 158px;
    height: 158px;
    object-fit: contain;
    margin: 0 auto 10px;
}

.login-brand h1 { margin: 0; font-size: 24px; color: #172026; }
.login-brand p { margin: 7px 0 0; color: #66727a; font-size: 14px; line-height: 1.4; }
.login-modal-card .modal-body { padding: 24px 32px 8px; }
.login-modal-card .form-group { margin-bottom: 16px; }
.login-modal-card .form-group label { margin-bottom: 7px; font-size: 14px; font-weight: 700; }
.login-modal-card .form-control { padding: 12px 13px; border-radius: 9px; font-size: 15px; }
.login-modal-card .form-control:focus { border-color: #008b4d; box-shadow: 0 0 0 3px rgba(0, 139, 77, 0.13); }
.login-modal-card .modal-footer { padding: 4px 32px 32px; border-top: 0; }
.login-modal-card .modal-footer .btn { width: 100%; justify-content: center; padding: 13px; border-radius: 9px; background: #008b4d; border-color: #008b4d; }
.login-modal-card .modal-footer .btn:hover { background: #006f3d; border-color: #006f3d; }

@media (max-width: 480px) {
    .login-screen { padding: 16px; }
    .login-brand { padding: 22px 21px 0; }
    .login-brand img { width: 138px; height: 138px; }
    .login-modal-card .modal-body { padding: 22px 21px 6px; }
    .login-modal-card .modal-footer { padding: 4px 21px 25px; }
}

.alert {
    padding: 1rem 1.25rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.alert-warning {
    background: rgba(243, 156, 18, 0.1);
    border-left: 4px solid var(--warning);
    color: #d68910;
}

.alert-danger {
    background: rgba(231, 76, 60, 0.1);
    border-left: 4px solid var(--danger);
    color: #c0392b;
}

.alert-success {
    background: rgba(39, 174, 96, 0.1);
    border-left: 4px solid var(--success);
    color: #219a52;
}

.signature-pad {
    border: 2px dashed var(--border);
    border-radius: 8px;
    background: #fafafa;
    cursor: crosshair;
    touch-action: none;
}

.timeline { position: relative; padding-left: 2rem; }

.timeline::before {
    content: '';
    position: absolute;
    left: 0.5rem;
    top: 0; bottom: 0;
    width: 2px;
    background: var(--border);
}

.timeline-item { position: relative; padding-bottom: 1.5rem; }

.timeline-item::before {
    content: '';
    position: absolute;
    left: -1.5rem;
    top: 0.25rem;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--primary);
    border: 3px solid white;
    box-shadow: 0 0 0 2px var(--primary);
}

.timeline-content { background: var(--bg); padding: 1rem; border-radius: 8px; }
.timeline-date { font-size: 0.75rem; color: var(--text-light); margin-bottom: 0.25rem; }

.charts-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(400px, 1fr)); gap: 1.5rem; }
.chart-container { position: relative; height: 300px; }

.employee-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: var(--bg);
    border-radius: 12px;
    margin-bottom: 1rem;
}

.employee-avatar {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.5rem;
    font-weight: 600;
}

.employee-info h4 { font-weight: 600; margin-bottom: 0.25rem; }
.employee-info p { font-size: 0.875rem; color: var(--text-light); }

.search-bar { display: flex; gap: 0.75rem; margin-bottom: 1.5rem; flex-wrap: wrap; }

.search-input { flex: 1; min-width: 200px; position: relative; }

.search-input i {
    position: absolute;
    left: 0.875rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-light);
}

.search-input input {
    width: 100%;
    padding: 0.625rem 0.875rem 0.625rem 2.5rem;
    border: 2px solid var(--border);
    border-radius: 8px;
    font-size: 0.9rem;
}

.checkbox-group { display: flex; flex-direction: column; gap: 0.5rem; }

.checkbox-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 6px;
    transition: background 0.2s;
}

.checkbox-item:hover { background: var(--bg); }

.checkbox-item input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--primary); }
.checkbox-item input[type="radio"] { width: 18px; height: 18px; accent-color: var(--primary); }

.footer {
    background: var(--primary-dark);
    color: white;
    text-align: center;
    padding: 1.5rem;
    margin-top: 3rem;
}

.footer p { opacity: 0.8; font-size: 0.875rem; }

@media (max-width: 768px) {
    .header-content { flex-direction: column; text-align: center; }
    .nav { gap: 0; }
    .nav-item { padding: 0.875rem 1rem; font-size: 0.8rem; }
    .main-container { padding: 1rem; }
    .stats-grid { grid-template-columns: 1fr; }
    .charts-grid { grid-template-columns: 1fr; }
    .form-grid { grid-template-columns: 1fr; }
}

@media print {
    .header, .nav-container, .btn, .modal-overlay, .footer { display: none !important; }
    .tab-content { display: block !important; }
}

.sub-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    border-bottom: 2px solid var(--border);
}

.sub-tab {
    padding: 0.75rem 1.25rem;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    font-weight: 500;
    color: var(--text-light);
    transition: all 0.3s;
}

.sub-tab:hover { color: var(--primary); }
.sub-tab.active { color: var(--primary); border-bottom-color: var(--primary); }

.sub-content { display: none; }
.sub-content.active { display: block; }

.epi-list-container {
    background: var(--bg);
    border-radius: 8px;
    padding: 1rem;
    margin-top: 0.5rem;
}

.epi-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: white;
    padding: 0.375rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
    margin: 0.25rem;
    border: 1px solid var(--border);
}

.epi-tag .remove { cursor: pointer; color: var(--danger); font-weight: bold; }

.dashboard-grid { display: grid; grid-template-columns: 2fr 1fr; gap: 1.5rem; }

@media (max-width: 1024px) { .dashboard-grid { grid-template-columns: 1fr; } }

.alerts-container { max-height: 400px; overflow-y: auto; }

.alert-item {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 1rem;
    border-left: 4px solid var(--warning);
    background: rgba(243, 156, 18, 0.05);
    margin-bottom: 0.75rem;
    border-radius: 0 8px 8px 0;
}

.alert-item.danger { border-left-color: var(--danger); background: rgba(231, 76, 60, 0.05); }
.alert-item.info { border-left-color: var(--primary); background: rgba(26, 95, 122, 0.05); }

.alert-icon { font-size: 1.25rem; }
.alert-content { flex: 1; }
.alert-title { font-weight: 600; font-size: 0.9rem; margin-bottom: 0.25rem; }
.alert-desc { font-size: 0.8rem; color: var(--text-light); }

.cargo-row {
    background: var(--bg);
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    border: 1px solid var(--border);
}

.ficha-epi-document {
    background: white;
    padding: 2rem;
    border: 1px solid #ccc;
    font-family: 'Times New Roman', serif;
    max-width: 800px;
    margin: 0 auto;
}

.ficha-header { text-align: center; margin-bottom: 2rem; border-bottom: 2px solid #333; padding-bottom: 1rem; }
.ficha-title { font-size: 1.5rem; font-weight: bold; margin-bottom: 0.5rem; }
.ficha-subtitle { font-size: 0.9rem; color: #666; }
.ficha-section { margin-bottom: 1.5rem; }
.ficha-section h4 { border-bottom: 1px solid #ddd; padding-bottom: 0.5rem; margin-bottom: 1rem; }

.ficha-table { width: 100%; border-collapse: collapse; margin: 1rem 0; }
.ficha-table th, .ficha-table td { border: 1px solid #333; padding: 0.5rem; text-align: left; }
.ficha-table th { background: #f0f0f0; }

.ficha-texto { text-align: justify; font-size: 0.85rem; line-height: 1.6; margin: 1rem 0; }

.ficha-assinatura { margin-top: 3rem; display: flex; justify-content: space-between; }
.ficha-assinatura-box { width: 45%; text-align: center; }
.ficha-assinatura-line { border-top: 1px solid #333; margin-top: 3rem; padding-top: 0.5rem; }
