/* ============================================
   VARIÁVEIS CSS
   ============================================ */
:root {
    --primary: #191639;
    --primary-light: #2e2b5c;
    --primary-dark: #0f0e2b;
    --secondary: #6c757d;
    --success: #28a745;
    --info: #17a2b8;
    --warning: #ffc107;
    --danger: #dc3545;
    --light: #f8f9fa;
    --dark: #343a40;
    --white: #ffffff;
    --gray-100: #f8f9fa;
    --gray-200: #e9ecef;
    --gray-300: #dee2e6;
    --gray-400: #ced4da;
    --gray-500: #adb5bd;
    --gray-600: #6c757d;
    --gray-700: #495057;
    --gray-800: #343a40;
    --gray-900: #212529;
    --primary-rgb: 25, 22, 57;
}

/* ============================================
   UTILITÁRIOS - COR PRIMÁRIA
   ============================================ */
.bg-primary-custom {
    background-color: var(--primary) !important;
}

.bg-primary-light {
    background-color: rgba(var(--primary-rgb), 0.1);
}

.bg-opacity-10 {
    --bs-bg-opacity: 0.1;
    background-color: rgba(var(--primary-rgb), var(--bs-bg-opacity)) !important;
}

.text-primary-custom {
    color: var(--primary) !important;
}

.btn-outline-primary {
    color: var(--primary);
    border-color: var(--primary);
}

.btn-outline-primary:hover {
    background-color: var(--primary);
    color: var(--white);
    border-color: var(--primary);
}

.badge.bg-primary-custom.bg-opacity-10 {
    background-color: rgba(var(--primary-rgb), 0.1) !important;
}

/* ============================================
   BOTÕES CUSTOMIZADOS
   ============================================ */
.btn-primary-custom {
    background-color: var(--primary);
    border-color: var(--primary);
    color: var(--white);
    transition: all 0.2s ease-in-out;
}

.btn-primary-custom:hover,
.btn-primary-custom:focus {
    background-color: var(--primary-light);
    border-color: var(--primary-light);
    color: var(--white);
}

.btn-primary-custom:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-outline-primary-custom {
    color: var(--primary);
    border-color: var(--primary);
}

.btn-outline-primary-custom:hover {
    background-color: var(--primary);
    color: var(--white);
}

.btn-lg {
    padding: 0.75rem 2rem;
    font-size: 1rem;
    border-radius: 50px;
}

.btn-outline-secondary {
    border-color: #ced4da;
    color: #495057;
}

.btn-outline-secondary:hover {
    background-color: #e9ecef;
    border-color: #adb5bd;
    color: #212529;
}

/* ============================================
   LAYOUT PRINCIPAL
   ============================================ */
#app-layout {
    width: 100dvw;
    height: 100dvh;
    overflow: hidden;
    padding-bottom: 30px;
}

.main-content {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    overflow: hidden;
}

footer {
    flex-shrink: 0;
    background-color: white;
    border-top: 1px solid var(--gray-300);
    padding: 1rem 0;
    width: 100%;
}

#footer {
    width: calc(100vw - var(--sidebar-width));
    z-index: 100;
    padding-inline: 30px;
    position: fixed;
    bottom: 0;
}

/* ============================================
   SIDEBAR
   ============================================ */
.sidebar-custom {
    background-color: var(--primary);
}

.sidebar {
    width: 260px;
    min-height: 100vh;
    flex: 0 0 260px;
    transition: all 0.3s ease;
    white-space: nowrap;
    position: relative;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    overflow-y: auto;
}

.sidebar.collapsed {
    flex: 0 0 80px;
    width: 80px !important;
}

.sidebar.collapsed .nav-menu-toggle>span>span {
    display: none !important;
}

.sidebar.collapsed .nav-menu-toggle>span {
    display: flex !important;
    align-items: center;
    justify-content: center;
    margin-right: auto;
}

.sidebar.collapsed .nav-menu-toggle>span>i {
    display: inline-block !important;
    margin-right: 0 !important;
}

.sidebar.collapsed .nav-menu-toggle .menu-icon {
    display: none !important;
}

.sidebar.collapsed .nav-link:not(.submenu-item) span:not(.float-end) {
    display: none !important;
}

.sidebar.collapsed .nav-link:not(.submenu-item) i {
    display: inline-block !important;
    margin-right: 0 !important;
}

.sidebar.collapsed .menu-items {
    display: none;
}

.sidebar.collapsed .menu-items.open {
    display: block !important;
}

.sidebar.collapsed .menu-items.open .submenu-item {
    position: relative;
    padding-left: 0.75rem !important;
    padding-right: 0.75rem !important;
    justify-content: center !important;
}

.sidebar.collapsed .menu-items.open .submenu-item span:not(.float-end) {
    display: none !important;
}

.sidebar.collapsed .menu-items.open .submenu-item .float-end {
    position: absolute;
    top: 50%;
    right: 0.25rem;
    transform: translateY(-50%);
    margin-right: 0 !important;
    font-size: 0.6rem;
}

.sidebar.collapsed .nav-menu-toggle {
    padding-left: 0.75rem !important;
    padding-right: 0.75rem !important;
    justify-content: space-between !important;
}

.sidebar.collapsed .nav-link:not(.submenu-item) {
    padding-left: 0.75rem !important;
    padding-right: 0.75rem !important;
    justify-content: center !important;
}

.sidebar .toggle-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    background: #000000b7;
    border: none;
    color: white;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s;
    z-index: 200;
}

.sidebar .toggle-btn:hover {
    background: rgb(0, 0, 0);
}

.sidebar-backdrop {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 990;
}

.sidebar-backdrop.show {
    display: block;
}

.nav-link:hover {
    background-color: rgba(255, 255, 255, 0.1);
    transform: translateX(5px);
}

.nav-link.active {
    background-color: rgba(255, 255, 255, 0.2) !important;
    font-weight: 500;
}

a.custom-link {
    color: var(--primary);
    text-decoration: none;
}

a.custom-link:hover {
    color: var(--primary-light);
    text-decoration: underline;
}

/* ============================================
   NAVBAR
   ============================================ */
.navbar-custom {
    background-color: var(--white);
    border-bottom: 1px solid var(--gray-300);
}

/* ============================================
   CARDS
   ============================================ */
.card-custom {
    border: none;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    transition: box-shadow 0.2s;
}

.card-custom:hover {
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

.card-dashboard {
    height: 100%;
    transition: transform 0.2s, box-shadow 0.2s;
    border-radius: 12px;
}

.card-dashboard:hover {
    transform: translateY(-5px);
    box-shadow: 0 0.5rem 1.5rem rgba(0, 0, 0, 0.1) !important;
}

.card-hover {
    transition: transform 0.2s, box-shadow 0.2s;
    border-radius: 12px;
    overflow: hidden;
}

.card-hover:hover {
    transform: translateY(-5px);
    box-shadow: 0 0.5rem 1.5rem rgba(0, 0, 0, 0.1) !important;
}

.card {
    border-radius: 12px;
}

.card.shadow-lg:hover {
    box-shadow: 0 20px 40px rgba(var(--primary-rgb), 0.15) !important;
}

.card-header {
    padding: 1.5rem 1.5rem 0.5rem 1.5rem;
}

/* ============================================
   ELEMENT CARD (para elementos do diagnóstico)
   ============================================ */
.element-card {
    border: 2px solid transparent;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    transition: all 0.2s;
}

.element-card:hover {
    border-color: var(--primary);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.element-card.selected {
    border-color: #28a745;
    background-color: #f0fff0;
}

/* ============================================
   LOG CARDS
   ============================================ */
.log-card {
    transition: transform 0.2s, box-shadow 0.2s;
    border-radius: 12px;
    overflow: hidden;
}

.log-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 0.5rem 1.5rem rgba(0, 0, 0, 0.1) !important;
}

.log-icon {
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.log-card .table td {
    vertical-align: middle;
    font-size: 0.85rem;
}

.log-card td.text-danger {
    background-color: rgba(220, 53, 69, 0.05);
    font-weight: 500;
}

.log-card td.text-success {
    background-color: rgba(40, 167, 69, 0.05);
    font-weight: 500;
}

.log-card code {
    color: #d63384;
    background: none;
    padding: 0;
}

.log-json {
    background: #f8f9fa;
    padding: 0.75rem;
    border-radius: 6px;
    font-size: 0.8rem;
    white-space: pre-wrap;
    word-break: break-word;
}

pre {
    background-color: #f8f9fa;
    padding: 0.5rem;
    border-radius: 4px;
    font-size: 0.8rem;
}

/* ============================================
   FORMULÁRIOS E INPUTS
   ============================================ */
.form-control:focus {
    border-color: var(--primary-light);
    box-shadow: 0 0 0 0.2rem rgba(var(--primary-rgb), 0.25);
}

.form-label {
    font-weight: 500;
    color: var(--gray-700);
    font-size: 0.875rem;
    margin-bottom: 0.25rem;
}

.form-control-sm {
    font-size: 0.875rem;
    padding: 0.25rem 0.5rem;
    height: calc(1.5em + 0.5rem + 2px);
}

.form-check-label {
    font-size: 0.875rem;
}

/* ============================================
   TABELAS
   ============================================ */
.table th {
    font-weight: 600;
    color: #495057;
}

.table td {
    vertical-align: middle;
}

.table th,
.table td {
    vertical-align: middle;
}

.table input[type=radio],
.table input[type=checkbox] {
    transform: scale(1.2);
    cursor: pointer;
}

/* ============================================
   PAGINAÇÃO
   ============================================ */
.pagination .page-link {
    color: var(--primary);
    border-color: var(--gray-300);
}

.pagination .page-link:hover {
    background-color: var(--primary-light);
    color: white;
    border-color: var(--primary-light);
}

.pagination .page-item.active .page-link {
    background-color: var(--primary);
    border-color: var(--primary);
    color: white;
}

.pagination-custom {
    display: flex;
    padding-left: 0;
    list-style: none;
    border-radius: 0.25rem;
    gap: 0.25rem;
}

.pagination-custom .page-item .page-link {
    position: relative;
    display: block;
    padding: 0.5rem 0.75rem;
    font-size: 0.9rem;
    color: var(--primary);
    background-color: #fff;
    border: 1px solid #dee2e6;
    border-radius: 0.375rem;
    transition: all 0.2s ease-in-out;
    cursor: pointer;
    text-decoration: none;
}

.pagination-custom .page-item .page-link:hover {
    z-index: 2;
    color: #fff;
    background-color: var(--primary);
    border-color: var(--primary);
}

.pagination-custom .page-item.active .page-link {
    z-index: 3;
    color: #fff;
    background-color: var(--primary);
    border-color: var(--primary);
}

.pagination-custom .page-item.disabled .page-link {
    color: #6c757d;
    pointer-events: none;
    background-color: #fff;
    border-color: #dee2e6;
    opacity: 0.6;
}

.pagination-custom .page-link:focus {
    box-shadow: 0 0 0 0.2rem rgba(var(--primary-rgb), 0.25);
    outline: 0;
}

/* ============================================
   ABAS (NAV-TABS)
   ============================================ */
.nav-tabs .nav-link {
    color: var(--primary);
    border: none;
    padding: 0.75rem 1.25rem;
    font-weight: 500;
    border-bottom: 2px solid transparent;
    transition: all 0.2s;
}

.nav-tabs .nav-link:hover {
    border-bottom-color: var(--primary-light);
}

.nav-tabs .nav-link.active {
    color: var(--primary);
    background-color: transparent;
    border-bottom-color: var(--primary);
    font-weight: 600;
}

/* ============================================
   ACCORDION
   ============================================ */
.accordion-button:not(.collapsed) {
    background-color: rgba(var(--primary-rgb), 0.05);
    color: var(--primary);
}

.accordion-button:focus {
    box-shadow: none;
    border-color: rgba(var(--primary-rgb), 0.3);
}

/* ============================================
   MODAIS ALPINE
   ============================================ */
.modal-alpine {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1050;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(3px);
}

.modal-alpine-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.4);
}

.modal-alpine-content {
    position: relative;
    background: white;
    border-radius: 16px;
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2), 0 8px 12px rgba(0, 0, 0, 0.1);
    z-index: 1051;
    border: none;
    transform-origin: center;
}

.modal-alpine-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid #e9ecef;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #fafbfc;
    border-top-left-radius: 16px;
    border-top-right-radius: 16px;
}

.modal-alpine-header .modal-title {
    font-size: 1.25rem;
    color: var(--primary);
}

.modal-alpine-body {
    padding: 1.5rem;
}

.modal-alpine-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid #e9ecef;
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    background: #fafbfc;
    border-bottom-left-radius: 16px;
    border-bottom-right-radius: 16px;
}

.btn-close {
    background: transparent url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%236c757d'%3e%3cpath d='M.293.293a1 1 0 0 1 1.414 0L8 6.586 14.293.293a1 1 0 1 1 1.414 1.414L9.414 8l6.293 6.293a1 1 0 0 1-1.414 1.414L8 9.414l-6.293 6.293a1 1 0 0 1-1.414-1.414L6.586 8 .293 1.707a1 1 0 0 1 0-1.414z'/%3e%3c/svg%3e") center/1em auto no-repeat;
    border: 0;
    width: 1.25em;
    height: 1.25em;
    opacity: 0.6;
    cursor: pointer;
    transition: opacity 0.2s;
}

.btn-close:hover {
    opacity: 1;
}

/* ============================================
   LOADING SPLASH
   ============================================ */
.loading-splash {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgb(255, 255, 255);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 999999;
    transition: opacity 0.4s ease-out, visibility 0.4s ease-out;
    backdrop-filter: blur(3px);
}

.loading-splash.fade-out {
    opacity: 0;
    visibility: hidden;
}

.loading-splash.hidden {
    display: none !important;
}

.glass-effect {
    backdrop-filter: blur(8px);
    border-radius: 20px;
    padding: 2.5rem 3rem;
    text-align: center;
    animation: float 3s ease-in-out infinite;
}

.spinner-wrapper {
    display: inline-flex;
    position: relative;
}

.spinner-wrapper::after {
    content: '';
    position: absolute;
    top: -10px;
    left: -10px;
    right: -10px;
    bottom: -10px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(var(--primary-rgb), 0.1) 0%, transparent 70%);
    animation: pulse 2s ease infinite;
}

.spinner-border.text-primary-custom {
    color: var(--primary);
    filter: drop-shadow(0 0 8px rgba(var(--primary-rgb), 0.3));
}

.splash-text {
    color: var(--primary);
    font-size: 1.2rem;
    letter-spacing: 0.5px;
    text-shadow: 0 2px 4px rgba(255, 255, 255, 0.8);
    margin-top: 1.5rem;
}

@keyframes float {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-10px);
    }
}

@keyframes pulse {

    0%,
    100% {
        transform: scale(1);
        opacity: 0.5;
    }

    50% {
        transform: scale(1.1);
        opacity: 0.2;
    }
}

body.splash-active {
    overflow: hidden;
}

/* ============================================
   STEPS INDICATOR (formulários multi-step)
   ============================================ */
.form-steps-container {
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 4px 32px rgba(var(--primary-rgb), 0.10);
    padding: 2rem 1.5rem;
    max-width: 100%;
    margin: 0 auto 2rem auto;
}

.steps-indicator {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 2rem;
    margin-bottom: 2rem;
}

.step-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    min-width: 60px;
    cursor: pointer;
}

.step-item.disabled {
    cursor: not-allowed;
    opacity: 0.6;
}

.step-circle {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background-color: var(--gray-200);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.1rem;
    margin-bottom: 0.3rem;
    border: 2px solid var(--gray-300);
    transition: all 0.2s;
}

.step-item.active .step-circle {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    color: #fff;
    border-color: var(--primary);
    box-shadow: 0 2px 8px rgba(var(--primary-rgb), 0.15);
    transform: scale(1.05);
}

.step-label {
    font-size: 0.75rem;
    color: var(--primary);
    font-weight: 500;
    max-width: 80px;
    white-space: normal;
}

.step-item.inactive .step-label {
    color: var(--gray-600);
}

.step-content {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 2rem 1.5rem;
    margin-bottom: 2rem;
    box-shadow: 0 2px 8px rgba(var(--primary-rgb), 0.04);
}

.section-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-weight: 600;
    color: var(--gray-700);
}

.tab-icon {
    font-size: 1.05rem;
    opacity: 0.95;
}

/* ============================================
   Stap 7 diversos
   ============================================ */

body.body-responsive {
    height: 200px;
}

th.th-mg-right,
td.th-mg-right {
    border-right: 1px solid #ccc;
}

thead.thead-p,
thead.thead-p tr th {
    background-color: white;
}

.select-icon {
    width: 48px;
    height: 48px;
    background: rgba(25, 22, 57, 0.05);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    transition: all 0.2s;
}

.card:hover .select-icon {
    background: rgba(25, 22, 57, 0.1);
    transform: scale(1.05);
}

.form-select-lg {
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--gray-700);
    cursor: pointer;
    transition: all 0.2s;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23191639' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e");
    background-size: 16px 12px;
}

.form-select-lg:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 0.2rem rgba(25, 22, 57, 0.15);
}

.form-select[multiple] {
    padding: 0.5rem 1rem;
    height: auto;
    background-image: none;
}

.form-select[multiple] option {
    padding: 0.5rem 1rem;
    border-radius: 30px;
    margin-bottom: 2px;
}

.form-select[multiple] option:checked {
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    color: white;
}

.form-select[multiple] option:hover {
    background-color: rgba(25, 22, 57, 0.05);
}

.classification-footer {
    margin-top: 1.5rem;
    margin-bottom: 0.5rem;
}

.classification-footer .card {
    border-radius: 16px;
    background: #ffffff;
    border: 1px solid rgba(0, 0, 0, 0.03);
}

.classification-footer .footer-icon {
    width: 48px;
    height: 48px;
    background: rgba(25, 22, 57, 0.03);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.badge.bg-opacity-10 {
    font-weight: 500;
    letter-spacing: 0.3px;
}

/* ============================================
   INSPECTION HELPERS (pré-visualização, ações)
   ============================================ */
.inspection-preview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 0.5rem;
}

.inspection-preview-grid img {
    width: 100%;
    height: auto;
    object-fit: cover;
    max-width: 150px;
    max-height: 150px;
}

.inspection-actions {
    position: sticky;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.95);
    border-top: 1px solid rgba(0, 0, 0, 0.04);
    z-index: 1055;
}

@media (max-width: 576px) {
    .inspection-actions .container {
        padding-left: 0.75rem;
        padding-right: 0.75rem;
    }
}

/* ============================================
   DASHBOARD CARDS (estatísticas)
   ============================================ */
.dashboard {
    margin-bottom: 2rem;
}

.stat-card {
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    height: 100%;
    display: flex;
    flex-direction: column;
    color: white;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.15);
}

.bg-gradient-primary {
    background: linear-gradient(135deg, #191639 0%, #2e2b5c 100%);
}

.bg-gradient-success {
    background: linear-gradient(135deg, #28a745 0%, #48c774 100%);
}

.bg-gradient-warning {
    background: linear-gradient(135deg, #ffc107 0%, #ffdb6e 100%);
}

.bg-gradient-info {
    background: linear-gradient(135deg, #17a2b8 0%, #48d1e0 100%);
}

.bg-gradient-secondary {
    background: linear-gradient(135deg, #6c757d 0%, #939ba3 100%);
}

.bg-gradient-purple {
    background: linear-gradient(135deg, #6610f2 0%, #945ef5 100%);
}

.bg-gradient-pink {
    background: linear-gradient(135deg, #e83e8c 0%, #ff6bb5 100%);
}

.bg-gradient-orange {
    background: linear-gradient(135deg, #fd7e14 0%, #ffaa5e 100%);
}

.stat-card-body {
    padding: 1.5rem;
    flex: 1;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.stat-icon {
    width: 50px;
    height: 50px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
}

.stat-content {
    flex: 1;
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
    line-height: 1;
}

.stat-label {
    font-size: 0.9rem;
    opacity: 0.9;
    margin-bottom: 0;
}

.stat-footer {
    padding: 0.5rem 1.5rem;
    background: rgba(0, 0, 0, 0.1);
    font-size: 0.85rem;
}

.trend-up {
    color: rgba(255, 255, 255, 0.9);
}

.chart-container {
    position: relative;
    width: 100%;
}

/* ============================================
   RESPONSIVIDADE
   ============================================ */
@media (max-width: 992px) {
    #app-layout {
        overflow: hidden;
    }

    .sidebar {
        position: fixed;
        left: -260px;
        top: 0;
        bottom: 0;
        height: 100vh;
        z-index: 1050;
        transition: left 0.3s ease;
        overflow-y: auto;
    }

    .sidebar.show {
        left: 0;
        box-shadow: 2px 0 8px rgba(0, 0, 0, 0.15);
    }

    .sidebar.collapsed {
        left: -80px;
    }

    .sidebar .toggle-btn {
        display: none;
    }

    #footer {
        width: 100vw;
    }
}

@media (max-width: 768px) {
    .search-bar {
        display: none;
    }

    .card-dashboard .card-body {
        padding: 1rem;
    }

    .card-dashboard .d-flex.align-items-center.mb-3 {
        margin-bottom: 0.5rem !important;
    }

    .card-dashboard .fs-3 {
        font-size: 1.5rem !important;
    }

    .stat-value {
        font-size: 1.5rem;
    }

    .stat-icon {
        width: 40px;
        height: 40px;
        font-size: 1.3rem;
    }

    .steps-indicator {
        flex-wrap: nowrap;
        overflow-x: auto;
        justify-content: flex-start;
        gap: 1rem;
        padding-bottom: 0.5rem;
    }

    .step-item {
        flex: 0 0 auto;
    }

    .step-circle {
        width: 32px;
        height: 32px;
        font-size: 0.9rem;
    }

    .step-label {
        font-size: 0.7rem;
        max-width: 60px;
    }

    .step-content {
        padding: 1rem 0.5rem;
    }

    .form-steps-container {
        padding: 1rem 0.5rem;
        border-radius: 8px;
    }
}

@media (max-width: 576px) {
    .sidebar {
        width: 280px;
        left: -280px;
    }

    .sidebar.collapsed {
        left: -70px;
    }

    .card-body>div[style*="height"] {
        height: 200px !important;
    }
}

/* ============================================
   IMPRESSÃO
   ============================================ */
@media print {

    .sidebar,
    .navbar,
    .btn,
    footer {
        display: none !important;
    }

    .main-content {
        padding: 0 !important;
    }

    .card {
        box-shadow: none !important;
        border: 1px solid #dee2e6 !important;
    }
}

/* ============================================
   UTILITÁRIOS DIVERSOS
   ============================================ */
[x-cloak] {
    display: none !important;
}

.progress-bar {
    border-radius: 10px;
}

.step-arrow {
    color: #adb5bd;
    font-size: 1.2rem;
    margin: 0 0.25rem;
}

.step-arrow i {
    display: block;
}

.swal2-actions {
    gap: 0.5rem !important;
}

.swal2-actions .btn-sm {
    margin: 0 0.25rem;
}

.alert-primary-custom {
    background-color: rgba(var(--primary-rgb), 0.1);
    color: var(--primary);
    border-left: 4px solid var(--primary);
}


.inspecao-container .list-group-item {
    border-left: 3px solid transparent;
    transition: all 0.2s;
}

.inspecao-container .list-group-item.active {
    border-left-color: re;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    color: white;
}

.inspecao-container .list-group-item:not(.active):hover {
    border-left-color: var(--primary);
    background-color: rgba(var(--primary-rgb), 0.05);
}

.bg-gradient-success {
    background: linear-gradient(135deg, #28a745 0%, #48c774 100%);
}

.bg-gradient-info {
    background: linear-gradient(135deg, #17a2b8 0%, #48d1e0 100%);
}

.bg-gradient-warning {
    background: linear-gradient(135deg, #ffc107 0%, #ffdb6e 100%);
}

.bg-gradient-danger {
    background: linear-gradient(135deg, #dc3545 0%, #e4606d 100%);
}

.image-preview {
    transition: transform 0.2s;
}

.image-preview:hover {
    transform: scale(1.02);
}

.step-content {
    animation: fadeIn 0.3s ease-in-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.step-navigation .btn-primary-custom {
    background-color: var(--primary);
    border-color: var(--primary);
    color: white;
}

.step-navigation .btn-outline-secondary:hover {
    background-color: var(--primary);
    border-color: var(--primary);
    color: white;
}

.step-navigation .btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.step-name {
    font-size: 0.7rem;
    line-height: 1.2;
    max-width: 70px;
    word-wrap: break-word;
}

.section-header {
    color: var(--primary);
    font-weight: 600;
    margin-top: 1.5rem;
    margin-bottom: 1rem;
}

.card {
    border-radius: 12px;
}

.card-header {
    background-color: transparent;
}

.badge {
    font-weight: 500;
}

.photo-thumb {
    transition: transform 0.2s;
    display: inline-block;
}

/* Wrapper do editor */
.json-editor-wrapper {
    display: flex;
    background: #1e1e2f;
    /* fundo escuro elegante */
    border-radius: 0 0 12px 12px;
    overflow: hidden;
    font-family: 'Fira Code', 'Consolas', 'Monaco', monospace;
    font-size: 14px;
    line-height: 1.5;
    min-height: 400px;
    max-height: 70vh;
}

/* Numeração de linhas */
.line-numbers {
    flex: 0 0 50px;
    padding: 12px 0;
    background: #2a2a3c;
    color: #8585b0;
    text-align: right;
    user-select: none;
    border-right: 1px solid #3a3a4c;
    font-size: 13px;
    overflow-y: hidden;
    white-space: pre;
    counter-reset: line;
}

.line-numbers span {
    display: block;
    padding: 0 8px;
    counter-increment: line;
}

.line-numbers span::before {
    content: counter(line);
    color: #8585b0;
}

/* Textarea principal */
.json-textarea {
    flex: 1;
    padding: 12px 15px;
    background: #1e1e2f;
    color: #e0e0ff;
    border: none;
    outline: none;
    resize: vertical;
    font-family: inherit;
    font-size: inherit;
    line-height: inherit;
    white-space: pre;
    overflow: auto;
    scrollbar-width: thin;
    scrollbar-color: #5a5a7a #2a2a3c;
}

.json-textarea::placeholder {
    color: #5a5a7a;
    font-style: italic;
}

.json-textarea::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

.json-textarea::-webkit-scrollbar-track {
    background: #2a2a3c;
}

.json-textarea::-webkit-scrollbar-thumb {
    background: #5a5a7a;
    border-radius: 4px;
}

.json-textarea::-webkit-scrollbar-thumb:hover {
    background: #7a7a9a;
}

/* Destaque de sintaxe básica (opcional - pode ser melhorado) */
.json-textarea {
    color: #c5c5e0;
}

.nav-tabs .nav-link {
    color: var(--gray-700);
    border: none;
    border-bottom: 2px solid transparent;
}

.nav-tabs .nav-link.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
    font-weight: 600;
}

.nav-tabs .nav-link:hover {
    border-bottom-color: var(--primary-light);
}

/* Estilos gerais da página */
.inspection-detail {
    font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}

.hover-shadow {
    transition: all 0.25s ease-in-out;
}

.hover-shadow:hover {
    transform: translateY(-4px);
    box-shadow: 0 1rem 2rem rgba(0, 0, 0, 0.1) !important;
}

.rounded-4 {
    border-radius: 1rem !important;
}

.info-icon {
    width: 48px;
    height: 48px;
    background: rgba(25, 22, 57, 0.05);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Tabela de anomalias */
.anomaly-table th {
    background-color: #f8f9fa;
    font-weight: 600;
    border-bottom-width: 2px;
}

.anomaly-table td {
    vertical-align: middle;
}

/* Thumbnails de fotos */
.photo-thumb img {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 12px;
    transition: transform 0.2s, box-shadow 0.2s;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.photo-thumb:hover img {
    transform: scale(1.05);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
}

/* Lightbox modal */
.lightbox-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1060;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(2px);
}

.lightbox-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.92);
    cursor: pointer;
}

.lightbox-container {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
    z-index: 1061;
}

.lightbox-image {
    max-width: 90vw;
    max-height: 90vh;
    object-fit: contain;
    border-radius: 16px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
}

.lightbox-close {
    position: absolute;
    top: -50px;
    right: -20px;
    background: rgba(0, 0, 0, 0.6);
    border: none;
    color: white;
    font-size: 32px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 1062;
    transition: background 0.2s;
}

.lightbox-close:hover {
    background: rgba(0, 0, 0, 0.9);
}

.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.5);
    color: white;
    border: none;
    font-size: 48px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s;
    z-index: 1062;
}

.lightbox-nav:hover {
    background: rgba(0, 0, 0, 0.8);
}

.lightbox-prev {
    left: -80px;
}

.lightbox-next {
    right: -80px;
}

@media (max-width: 768px) {
    .lightbox-nav {
        width: 40px;
        height: 40px;
        font-size: 32px;
    }

    .lightbox-prev {
        left: -50px;
    }

    .lightbox-next {
        right: -50px;
    }

    .lightbox-close {
        top: -40px;
        right: -10px;
        width: 36px;
        height: 36px;
        font-size: 24px;
    }
}

[x-cloak] {
    display: none !important;
}

.report-content {
    white-space: pre-wrap;
    font-family: 'Segoe UI', 'Roboto', system-ui;
    font-size: 0.9rem;
    line-height: 1.6;
    background-color: #ffffff;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    max-height: 500px;
    overflow-y: auto;
}

.report-structured .card {
    transition: all 0.2s;
}

.report-structured .card:hover {
    transform: translateY(-2px);
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.1) !important;
}

/* Estilos do modal Alpine.js */
.modal-alpine {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1050;
}

.card {
    border-radius: 12px;
}

.card-header {
    background-color: transparent;
}

.report-content {
    white-space: pre-wrap;
    font-family: 'Segoe UI', 'Roboto', system-ui;
    font-size: 0.9rem;
    line-height: 1.6;
    background-color: #ffffff;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    max-height: 500px;
    overflow-y: auto;
}

/* ============================================
   LAYOUT SPLIT PARA AUTENTICAÇÃO (MELHORADO)
   ============================================ */
.auth-split {
    display: flex;
    min-height: 100vh;
    width: 100%;
}

.auth-split .auth-left {
    flex: 1;
    position: relative;
    background-size: cover;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 3rem;
    color: white;
    z-index: 1;
}

/* Gradiente escuro sobre a imagem (overlay) */
.auth-split .auth-left::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(25, 22, 57, 0.85) 0%, rgba(46, 43, 92, 0.8) 100%);
    z-index: -1;
}

.auth-split .auth-left .brand h2 {
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    letter-spacing: -0.5px;
}

.auth-split .auth-left .brand p {
    opacity: 0.85;
    font-size: 0.9rem;
}

.auth-split .auth-left .quote {
    margin-top: auto;
    margin-bottom: 2rem;
    animation: fadeInUp 0.6s ease-out;
}

.auth-split .auth-left .quote h3 {
    font-size: 1.5rem;
    font-weight: 600;
    line-height: 1.3;
}

.auth-split .auth-right {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #ffffff;
    padding: 2rem;
    flex-direction: column;
}

.auth-split .auth-right .logo {
    margin-bottom: 2rem;
}

.auth-split .auth-right .logo img {
    width: 200px;
}

.auth-split .auth-card {
    width: 100%;
    max-width: 380px;
    padding: 1.5rem;
    background: white;
    border-radius: 1rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
    transition: transform 0.2s, box-shadow 0.2s;
}

.auth-split .auth-card:hover {
    box-shadow: 0 15px 40px rgba(25, 22, 57, 0.12);
}

.auth-split .auth-card h2 {
    font-size: 1.6rem;
    font-weight: 700;
    color: #191639;
    margin-bottom: 0.5rem;
}

.auth-split .auth-link {
    margin-bottom: 1.5rem;
    font-size: 0.85rem;
    color: #6c757d;
}

.auth-split .auth-link a {
    color: #191639;
    font-weight: 600;
    text-decoration: none;
    transition: color 0.2s;
}

.auth-split .auth-link a:hover {
    color: #2e2b5c;
    text-decoration: underline;
}

.auth-split .form-group {
    margin-bottom: 1rem;
}

.auth-split .form-control {
    width: 100%;
    padding: 0.5rem 0.9rem;
    font-size: 0.875rem;
    border: 1px solid #ced4da;
    border-radius: 0.5rem;
    transition: all 0.2s;
    background-color: #fff;
}

.auth-split .form-control:focus {
    border-color: #191639;
    box-shadow: 0 0 0 3px rgba(25, 22, 57, 0.1);
    outline: none;
}

.auth-split .form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 1rem 0 1.5rem;
    font-size: 0.8rem;
}

.auth-split .btn-auth {
    width: 100%;
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    font-weight: 600;
    background: #191639;
    border: none;
    border-radius: 0.5rem;
    color: white;
    cursor: pointer;
    transition: all 0.2s;
}

.auth-split .btn-auth:hover {
    background: #2e2b5c;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(25, 22, 57, 0.2);
}

.auth-split .btn-auth:active {
    transform: translateY(0);
}

.auth-split .alert-error,
.auth-split .alert-success {
    padding: 0.6rem 0.9rem;
    border-radius: 0.5rem;
    font-size: 0.8rem;
    margin-bottom: 1.2rem;
}

.auth-split .alert-error {
    background: #f8d7da;
    border-left: 4px solid #dc3545;
    color: #721c24;
}

.auth-split .alert-success {
    background: #d4edda;
    border-left: 4px solid #28a745;
    color: #155724;
}

/* Animação */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsividade */
@media (max-width: 768px) {
    .auth-split .auth-left {
        display: none;
    }

    .auth-split .auth-right {
        flex: none;
        width: 100%;
    }

    .auth-split .auth-card {
        max-width: 90%;
        margin: 0 auto;
    }
}
