/* ── Fonte Maax ─────────────────────────────────────────────── */
@font-face {
    font-family: 'Maax';
    src: url('../fonts/Maax.eot');
    src: local('Maax'),
         url('../fonts/Maax.eot?#iefix') format('embedded-opentype'),
         url('../fonts/Maax.woff') format('woff'),
         url('../fonts/Maax.ttf') format('truetype');
    font-weight: normal; font-style: normal;
}
@font-face {
    font-family: 'Maax';
    src: url('../fonts/Maax-Bold.eot');
    src: local('Maax Bold'), local('Maax-Bold'),
         url('../fonts/Maax-Bold.eot?#iefix') format('embedded-opentype'),
         url('../fonts/Maax-Bold.woff') format('woff'),
         url('../fonts/Maax-Bold.ttf') format('truetype');
    font-weight: bold; font-style: normal;
}
@font-face {
    font-family: 'Maax';
    src: url('../fonts/Maax-Medium.eot');
    src: local('Maax Medium'), local('Maax-Medium'),
         url('../fonts/Maax-Medium.eot?#iefix') format('embedded-opentype'),
         url('../fonts/Maax-Medium.woff') format('woff'),
         url('../fonts/Maax-Medium.ttf') format('truetype');
    font-weight: 500; font-style: normal;
}
@font-face {
    font-family: 'Maax';
    src: url('../fonts/Maax-Italic.eot');
    src: local('Maax Italic'), local('Maax-Italic'),
         url('../fonts/Maax-Italic.eot?#iefix') format('embedded-opentype'),
         url('../fonts/Maax-Italic.woff') format('woff'),
         url('../fonts/Maax-Italic.ttf') format('truetype');
    font-weight: normal; font-style: italic;
}
@font-face {
    font-family: 'Maax';
    src: url('../fonts/Maax-BoldItalic.eot');
    src: local('Maax BoldItalic'), local('Maax-BoldItalic'),
         url('../fonts/Maax-BoldItalic.eot?#iefix') format('embedded-opentype'),
         url('../fonts/Maax-BoldItalic.woff') format('woff'),
         url('../fonts/Maax-BoldItalic.ttf') format('truetype');
    font-weight: bold; font-style: italic;
}

/* ── Variáveis ──────────────────────────────────────────────── */
:root {
    --primary:     #0c60a2;
    --primary-nav: #0f6aa8;
    --primary-dk:  #054171;
    --bg:          #f0f4f8;
}

/* ── Base ───────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

body {
    font-family: 'Maax', system-ui, -apple-system, sans-serif;
    background-color: var(--bg);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    color: #212529;
}

a { text-decoration: none; }

/* ── Navbar ─────────────────────────────────────────────────── */
.navbar {
    background-color: var(--primary-nav) !important;
    box-shadow: 0 2px 8px rgba(0,0,0,.2);
    padding: .55rem 1rem;
}
.navbar-brand {
    color: #fff !important;
    font-weight: bold;
    font-size: 1.15rem;
    letter-spacing: .02em;
}
.navbar-brand i { font-size: 1.3rem; vertical-align: -.1em; }
.nav-link { color: rgba(255,255,255,.82) !important; transition: color .15s; padding: .45rem .75rem !important; }
.nav-link:hover, .nav-link.active { color: #fff !important; }
.navbar-toggler { border-color: rgba(255,255,255,.35); }
.navbar-toggler-icon { filter: invert(1); }
.dropdown-menu { border: none; box-shadow: 0 4px 20px rgba(0,0,0,.15); border-radius: 10px; }

/* ── Main ───────────────────────────────────────────────────── */
main { flex: 1; }

/* ── Cards ──────────────────────────────────────────────────── */
.card {
    border: none;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,.07);
}
.card-header {
    background-color: #fff;
    border-bottom: 2px solid #e9ecef;
    border-radius: 10px 10px 0 0 !important;
    font-weight: 600;
    padding: .85rem 1.25rem;
    font-size: .95rem;
}
.card-header.bg-blue {
    background-color: var(--primary) !important;
    border-bottom: none;
    color: #fff;
}

/* ── Stat cards ─────────────────────────────────────────────── */
.stat-card { border-left: 4px solid var(--primary) !important; }
.stat-card .stat-icon { font-size: 2rem; opacity: .15; }
.stat-number { font-size: 2rem; font-weight: 700; color: var(--primary); line-height: 1; }

/* ── Buttons ────────────────────────────────────────────────── */
.btn-primary { background-color: var(--primary); border-color: var(--primary); }
.btn-primary:hover, .btn-primary:focus { background-color: #0a5490; border-color: #0a5490; }
.btn-outline-primary { color: var(--primary); border-color: var(--primary); }
.btn-outline-primary:hover { background-color: var(--primary); border-color: var(--primary); }

.btn-dk { background-color: var(--primary-dk); border-color: var(--primary-dk); color: #fff; }
.btn-dk:hover, .btn-dk:focus { background-color: #033256; border-color: #033256; color: #fff; }

/* ── Badges ─────────────────────────────────────────────────── */
.badge { font-size: .75rem; font-weight: 600; padding: .38em .72em; border-radius: 5px; }

/* ── Tables ─────────────────────────────────────────────────── */
.table thead th {
    background-color: var(--primary);
    color: #fff;
    font-weight: 600;
    border: none;
    white-space: nowrap;
    font-size: .88rem;
}
.table tbody tr:hover { background-color: #e8f0fb; }
.table td, .table th { vertical-align: middle; }

/* ── Forms ──────────────────────────────────────────────────── */
.form-label { font-weight: 500; font-size: .9rem; }
.form-control:focus, .form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 .2rem rgba(12,96,162,.18);
}

/* ── Upload de fotos ────────────────────────────────────────── */
.upload-area {
    border: 2px dashed var(--primary);
    border-radius: 10px;
    padding: 1.75rem 1rem;
    text-align: center;
    background: #f6faff;
    cursor: pointer;
    transition: background .2s;
    user-select: none;
}
.upload-area:hover { background: #e4eefb; }
.upload-area i { font-size: 2.5rem; color: var(--primary); display: block; margin-bottom: .5rem; }
.upload-area input[type=file] { display: none; }

.photo-thumb {
    width: 110px;
    height: 90px;
    object-fit: cover;
    border-radius: 8px;
    border: 2px solid #dee2e6;
    cursor: pointer;
    transition: transform .15s, border-color .15s;
}
.photo-thumb:hover { transform: scale(1.06); border-color: var(--primary); }

.doc-thumb {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f6faff;
}
.doc-thumb i { font-size: 2.25rem; color: #dc3545; }

/* ── Footer ─────────────────────────────────────────────────── */
footer {
    background-color: var(--primary-nav);
    color: rgba(255,255,255,.8);
    padding: .9rem 0;
    font-size: .85rem;
    margin-top: auto;
}
footer strong { color: #fff; }

/* ── Login ──────────────────────────────────────────────────── */
.login-wrapper {
    min-height: 100vh;
    background: linear-gradient(135deg, var(--primary-nav) 0%, var(--primary-dk) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}
.login-card {
    width: 100%;
    max-width: 430px;
    border-radius: 14px;
    box-shadow: 0 24px 64px rgba(0,0,0,.38);
    overflow: hidden;
}
.login-header {
    background-color: var(--primary-dk);
    color: #fff;
    padding: 2rem;
    text-align: center;
}
.login-header i { font-size: 3rem; display: block; margin-bottom: .5rem; }
.login-body { padding: 2rem; background: #fff; }

/* ── Page header ────────────────────────────────────────────── */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: .5rem;
}
.page-header h1 {
    font-size: 1.55rem;
    font-weight: 700;
    color: var(--primary-dk);
    margin: 0;
}

/* ── Flash messages ─────────────────────────────────────────── */
.flash-msg { position: fixed; top: 68px; right: 1rem; z-index: 9999; min-width: 280px; max-width: 420px; }

/* ── Section heading ────────────────────────────────────────── */
.section-heading {
    border-left: 3px solid var(--primary);
    padding-left: .65rem;
    font-weight: 600;
    color: var(--primary-dk);
    margin-bottom: 1rem;
}

/* ── Modal ──────────────────────────────────────────────────── */
.modal-header { background-color: var(--primary); color: #fff; border-radius: 0; }
.modal-header .btn-close { filter: invert(1) brightness(2); }
.modal-content { border: none; border-radius: 12px; overflow: hidden; }

/* ── Detail view ────────────────────────────────────────────── */
.detail-label { font-size: .78rem; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: #6c757d; }
.detail-value { font-size: .97rem; }

/* ── Responsive ─────────────────────────────────────────────── */
@media (max-width: 767px) {
    .stat-number { font-size: 1.6rem; }
    .page-header h1 { font-size: 1.25rem; }
    .table { font-size: .82rem; }
}

/* ── Print ──────────────────────────────────────────────────── */
@media print {
    .navbar, footer, .no-print { display: none !important; }
    body { background: #fff !important; }
    .card { box-shadow: none !important; border: 1px solid #dee2e6 !important; }
    .print-only { display: block !important; }
    main { padding: 0 !important; }
    a { color: inherit !important; }
    /* Assinaturas na impressão */
    .signature-grid { display: grid !important; grid-template-columns: repeat(3, 1fr) !important; gap: 1rem !important; }
    .signature-card { border: 1px solid #000 !important; break-inside: avoid !important; }
    .signature-card img { max-width: 100% !important; height: auto !important; }
}
.print-only { display: none; }

/* ── Timeline ────────────────────────────────────────────────── */
.timeline-container {
    position: relative;
    padding: 1rem 0;
}

.timeline {
    position: relative;
    padding-left: 2.5rem;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 0.5rem;
    top: 0;
    bottom: 0;
    width: 2px;
    background: linear-gradient(to bottom, #0c60a2, #e9ecef);
}

.timeline-event {
    position: relative;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
}

.timeline-event:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
}

.timeline-marker {
    position: absolute;
    left: -1.625rem;
    top: 0;
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 0.9rem;
    z-index: 1;
    box-shadow: 0 0 0 3px #fff, 0 2px 8px rgba(0,0,0,0.1);
}

.timeline-marker.bg-primary { background-color: #0c60a2; }
.timeline-marker.bg-info { background-color: #0dcaf0; }
.timeline-marker.bg-warning { background-color: #ffc107; color: #000; }
.timeline-marker.bg-success { background-color: #198754; }
.timeline-marker.bg-secondary { background-color: #6c757d; }
.timeline-marker.bg-dark { background-color: #212529; }
.timeline-marker.bg-light { background-color: #e9ecef; color: #212529; border: 2px solid #dee2e6; }

.timeline-content {
    background-color: #f8f9fa;
    padding: 1rem 1.25rem;
    border-radius: 8px;
    border-left: 3px solid #0c60a2;
    transition: all 0.2s ease;
}

.timeline-content:hover {
    box-shadow: 0 2px 12px rgba(0,0,0,0.08);
    transform: translateX(4px);
}

.timeline-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 0.5rem;
}

.timeline-header h6 {
    font-size: 0.95rem;
    margin: 0;
    color: #212529;
}

.timeline-header small {
    flex-shrink: 0;
    font-size: 0.75rem;
    white-space: nowrap;
}

.timeline-content p {
    font-size: 0.9rem;
    line-height: 1.5;
}

.timeline-thumb {
    max-width: 150px;
    max-height: 100px;
    border-radius: 4px;
    border: 1px solid #dee2e6;
    cursor: pointer;
    transition: all 0.2s ease;
}

.timeline-thumb:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}
