/* =========================================================
   ESTILOS GERAIS E RESET DE TELA
   ========================================================= */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f4f6f9;
    color: #1a1a1a;
    line-height: 1.4;
}

/* =========================================================
   SPLASH SCREEN ANIMADA (3 SEGUNDOS)
   ========================================================= */
#splash-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: #ffffff;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 99999;
    opacity: 1;
    transition: opacity 0.8s ease-in-out;
}

.splash-content {
    text-align: center;
}

.splash-logo {
    font-size: 5rem;
    font-weight: 900;
    letter-spacing: 4px;
    background: linear-gradient(135deg, #0056b3, #00d2ff, #d9534f);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: pulseLogo 1.5s infinite alternate ease-in-out;
}

.splash-sub {
    font-size: 1.3rem;
    font-weight: 600;
    color: #333;
    margin-top: 10px;
}

.splash-footer {
    position: absolute;
    bottom: 25px;
    font-size: 0.95rem;
    color: #666;
}

.splash-footer a {
    color: #0056b3;
    font-weight: bold;
    text-decoration: none;
}

@keyframes pulseLogo {
    0% { transform: scale(0.96); filter: drop-shadow(0 0 2px rgba(0,86,179,0.2)); }
    100% { transform: scale(1.04); filter: drop-shadow(0 0 12px rgba(0,210,255,0.6)); }
}

/* =========================================================
   LAYOUT DO PAINEL PRINCIPAL
   ========================================================= */
.hidden { display: none !important; }

.main-header {
    background: #002b49;
    color: #fff;
    padding: 15px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 4px 10px rgba(0,0,0,0.15);
}

.header-brand {
    font-size: 1.4rem;
    font-weight: bold;
    display: flex;
    align-items: center;
    gap: 10px;
}

.hero-section {
    max-width: 1200px;
    margin: 25px auto 15px auto;
    padding: 0 20px;
    text-align: center;
}

.hero-title {
    font-size: 1.8rem;
    color: #002b49;
    font-weight: 800;
    margin-bottom: 8px;
}

.hero-desc {
    font-size: 0.95rem;
    color: #444;
    max-width: 900px;
    margin: 0 auto 20px auto;
}

/* PAINEL DE BOTÕES ANIMADOS */
.dashboard-controls {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 25px;
}

.btn-card {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 22px;
    font-size: 1rem;
    font-weight: 700;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    color: #fff;
    text-decoration: none;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.btn-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 7px 14px rgba(0,0,0,0.2);
}

.btn-card.primary { background-color: #0056b3; }
.btn-card.success { background-color: #1e7e34; }
.btn-card.warning { background-color: #d9534f; }
.btn-card.info { background-color: #17a2b8; }
.btn-card.dark { background-color: #343a40; }

/* =========================================================
   PAINEL ANALÍTICO (CHARTS)
   ========================================================= */
.analytics-container {
    max-width: 1200px;
    margin: 0 auto 25px auto;
    padding: 0 20px;
}

.card-analytics {
    background: #fff;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.card-analytics h3 {
    font-size: 1.1rem;
    color: #002b49;
    margin-bottom: 15px;
}

.metrics-grid {
    display: flex;
    gap: 20px;
    margin-bottom: 15px;
}

.metric-box {
    background: #eef3f8;
    padding: 12px 20px;
    border-radius: 6px;
    text-align: center;
    flex: 1;
}

.metric-val {
    display: block;
    font-size: 1.8rem;
    font-weight: bold;
    color: #0056b3;
}

.metric-lbl {
    font-size: 0.85rem;
    color: #555;
}

/* =========================================================
   DOCUMENTO ARPT (FORMULÁRIO FRENTE E VERSO)
   ========================================================= */
.document-workspace {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding-bottom: 50px;
}

.arpt-page {
    width: 210mm;
    min-height: 297mm;
    background: #fff;
    padding: 10mm;
    margin-bottom: 30px;
    box-shadow: 0 0 15px rgba(0,0,0,0.15);
    border: 1px solid #ccc;
    position: relative;
    box-sizing: border-box;
}

.arpt-doc-header h2 {
    text-align: center;
    font-size: 1.1rem;
    font-weight: bold;
    color: #000;
    border-bottom: 2px solid #000;
    padding-bottom: 4px;
    margin-bottom: 8px;
}

.doc-meta-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
    border: 1px solid #000;
    padding: 6px;
    margin-bottom: 8px;
    font-size: 0.8rem;
}

.meta-field {
    display: flex;
    align-items: center;
    gap: 4px;
}

.meta-field label { font-weight: bold; white-space: nowrap; }
.meta-field input[type="text"],
.meta-field input[type="date"],
.meta-field input[type="time"] {
    width: 100%;
    border: none;
    border-bottom: 1px dashed #666;
    font-size: 0.8rem;
    padding: 2px;
}

.meta-field.full-width { grid-column: span 4; }
.inline-checks label { margin-right: 6px; font-weight: normal; }

.instruction-text {
    font-size: 0.72rem;
    font-style: italic;
    margin-bottom: 8px;
    text-align: center;
}

/* GRADE DE PERIGOS 3x3 */
.hazard-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
}

.hazard-card {
    border: 1px solid #000;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    font-size: 0.7rem;
    background: #fff;
}

.hazard-head {
    background: #e0e0e0;
    font-weight: bold;
    padding: 4px;
    border-bottom: 1px solid #000;
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.72rem;
}

.hazard-body {
    display: flex;
    padding: 4px;
    gap: 4px;
}

.col-riscos, .col-medidas {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.col-riscos strong, .col-medidas strong {
    font-size: 0.68rem;
    text-decoration: underline;
    margin-bottom: 2px;
}

.col-riscos label, .col-medidas label {
    display: flex;
    align-items: flex-start;
    gap: 3px;
    margin-bottom: 2px;
    line-height: 1.1;
    font-size: 0.68rem;
}

.hazard-note {
    background: #f9f9f9;
    border-top: 1px solid #ccc;
    padding: 3px;
    font-size: 0.64rem;
    color: #222;
}

.other-hazards-block {
    margin-top: 8px;
    border: 1px solid #000;
    padding: 6px;
    font-size: 0.75rem;
}

.other-hazards-block textarea {
    width: 100%;
    border: none;
    resize: none;
    font-family: inherit;
    font-size: 0.75rem;
}

.arpt-doc-footer {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    font-weight: bold;
    border-top: 1px solid #000;
    padding-top: 5px;
    margin-top: 10px;
}

.arpt-doc-footer a {
    color: #000;
    text-decoration: none;
}

/* ESTILOS PÁGINA 2 */
.epi-section, .energy-block-section, .activity-steps-section, .workers-section, .approval-section {
    border: 1px solid #000;
    padding: 6px;
    margin-bottom: 8px;
    font-size: 0.72rem;
}

.epi-section h3, .energy-block-section h3, .activity-steps-section h3, .workers-section h3, .approval-section h3 {
    font-size: 0.75rem;
    margin-bottom: 4px;
    border-bottom: 1px solid #666;
    padding-bottom: 2px;
}

.epi-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 4px;
}

.epi-item {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.68rem;
}

.other-epi {
    margin-top: 4px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.other-epi input {
    flex: 1;
    border: none;
    border-bottom: 1px dashed #666;
}

.arpt-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 4px;
    font-size: 0.68rem;
}

.arpt-table th, .arpt-table td {
    border: 1px solid #000;
    padding: 2px 4px;
}

.arpt-table th { background: #e0e0e0; }

.arpt-table input[type="text"] {
    width: 100%;
    border: none;
    font-size: 0.68rem;
}

.approval-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 4px 10px;
    margin-bottom: 6px;
}

.approval-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px dotted #ccc;
    font-size: 0.68rem;
}

.signatures-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-top: 8px;
}

.sig-box {
    border: 1px solid #000;
    padding: 4px;
}

.sig-box h4 {
    text-align: center;
    background: #eee;
    margin-bottom: 4px;
}

.sig-box label {
    display: block;
    margin-bottom: 2px;
    font-size: 0.65rem;
}

.sig-box input {
    width: 100%;
    border: none;
    border-bottom: 1px solid #666;
}

.legal-notes {
    font-size: 0.6rem;
    font-style: italic;
    margin-top: 6px;
}

.system-global-footer {
    text-align: center;
    padding: 15px;
    background: #002b49;
    color: #fff;
    font-size: 0.9rem;
}

.system-global-footer a { color: #00d2ff; font-weight: bold; text-decoration: none; }

/* MODAIS */
.modal-overlay {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0,0,0,0.6);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
}

.modal-card {
    background: #fff;
    padding: 25px;
    border-radius: 8px;
    width: 350px;
    position: relative;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
}

.modal-large { width: 850px; max-width: 90%; }
.modal-close { position: absolute; top: 10px; right: 15px; font-size: 1.5rem; border: none; background: none; cursor: pointer; }

.auth-tabs { display: flex; margin-bottom: 15px; border-bottom: 2px solid #ccc; }
.tab-btn { flex: 1; padding: 8px; border: none; background: none; cursor: pointer; font-weight: bold; }
.tab-btn.active { border-bottom: 3px solid #0056b3; color: #0056b3; }

.form-group { margin-bottom: 12px; }
.form-group label { display: block; font-size: 0.85rem; margin-bottom: 4px; }
.form-group input { width: 100%; padding: 8px; border: 1px solid #ccc; border-radius: 4px; }
.full-btn { width: 100%; padding: 10px; margin-top: 10px; }

/* =========================================================
   REGRAS DE IMPRESSÃO (A4 FRENTE E VERSO PERFEITO)
   ========================================================= */
@media print {
    .no-print, header, footer, .dashboard-controls, .hero-section, .analytics-container, #splash-screen {
        display: none !important;
    }
    body { background: #fff; }
    .document-workspace { padding: 0; margin: 0; }
    .arpt-page {
        width: 100%;
        height: 100vh;
        margin: 0;
        border: none;
        box-shadow: none;
        page-break-after: always;
        page-break-inside: avoid;
    }
}