/* CSS DO PAINEL ADMINISTRATIVO */
:root {
    --primary: #1e3a8a;
    --primary-light: #2563eb;
    --secondary: #e11d48;
    --bg-main: #f0f4f8;
    --bg-white: #ffffff;
    --text-dark: #0f172a;
    --text-light: #334155;
    --text-muted: #64748b;
    --sidebar-bg: #0f172a;
    --border: #e2e8f0;
    --transition: all 0.3s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
}

body {
    background-color: var(--bg-main);
    color: var(--text-light);
}

/* === MODAL DE LOGIN === */
.login-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;

    height: 100vh;
    background: linear-gradient(135deg, rgba(30, 58, 138, 0.9), rgba(15, 23, 42, 0.95));
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    transition: opacity 0.4s ease;
}

.login-card {
    background: var(--bg-white);
    padding: 40px;
    border-radius: 16px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    width: 100%;

    max-width: 400px;
}

.login-logo {
    text-align: center;
    margin-bottom: 30px;
}

.login-logo i {
    font-size: 60px;
    color: var(--primary);
    margin-bottom: 10px;
}

.login-logo h2 {
    color: var(--text-dark);
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-size: 0.9rem;
    font-weight: 600;
}

.form-group input,
.form-group textarea {
    width: 100%;

    padding: 12px 16px;
    border: 1px solid var(--border);
    border-radius: 8px;
    outline: none;
    font-size: 1rem;
    transition: var(--transition);
}

.form-group textarea {
    resize: vertical;
}

.form-group input:focus,
.form-group textarea:focus {
    border-color: var(--primary-light);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.error-msg {
    color: var(--secondary);
    font-size: 0.85rem;
    margin-bottom: 15px;
    display: none;
}

.btn-primary {
    width: 100%;

    padding: 12px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
}

.btn-primary:hover {
    background: #172a6b;
}

.btn-secondary {
    padding: 10px 20px;
    background: #e2e8f0;
    color: var(--text-dark);
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-secondary:hover {
    background: #cbd5e1;
}

/* === ESTRUTURA DO PAINEL === */
.admin-wrapper {
    display: flex;
    min-height: 100vh;
}

/* SIDEBAR */
.sidebar {
    width: 260px;
    background: var(--sidebar-bg);
    color: white;
    display: flex;
    flex-direction: column;
}

.sidebar-header {
    padding: 24px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-header h2 {
    font-size: 1.5rem;
    letter-spacing: 1px;
}

.sidebar-nav {
    flex: 1;
    padding: 24px 0;
}

.sidebar-nav ul {
    list-style: none;
}

.sidebar-nav li a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 24px;
    color: #94a3b8;
    text-decoration: none;
    transition: var(--transition);
    font-weight: 500;
}

.sidebar-nav li a:hover,
.sidebar-nav li a.active {
    background: rgba(255, 255, 255, 0.05);
    color: white;
    border-left: 4px solid var(--primary-light);
}

.sidebar-footer {
    padding: 24px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.btn-logout {
    width: 100%;

    padding: 10px;
    background: transparent;
    color: #ef4444;
    border: 1px solid #ef4444;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: var(--transition);
}

.btn-logout:hover {
    background: #ef4444;
    color: white;
}

/* MAIN CONTENT */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.top-header {
    height: 70px;
    background: white;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 40px;
}

.welcome-msg {
    font-weight: 600;
    color: var(--text-dark);
}

.avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #e2e8f0;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 20px;
}

.content-area {
    padding: 40px;
    flex: 1;
    overflow-y: auto;
}

/* VIEWS BASE */
.view-section {
    display: none;
}

.view-section.active {
    display: block;
    animation: fadeIn 0.3s;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.view-title {
    font-size: 1.8rem;
    margin-bottom: 24px;
    color: var(--text-dark);
}

/* WIDGETS E PAINÉIS */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 24px;
}

.stat-card {
    background: white;
    padding: 24px;
    border-radius: 12px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    display: flex;
    align-items: center;
    gap: 20px;
}

.stat-card i {
    font-size: 40px;
    color: var(--primary-light);
}

.stat-card h4 {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.stat-card span {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-dark);
}

.panel-box {
    background: white;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

/* TABELA DE USUÁRIOS */
.data-table {
    width: 100%;

    border-collapse: collapse;
}

.data-table th,
.data-table td {
    padding: 14px;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

.data-table th {
    background: #f8fafc;
    font-weight: 600;
    color: var(--text-dark);
}

.badge {
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 600;
}

.badge.active {
    background: #dcfce7;
    color: #166534;
}

.badge.inactive {
    background: #fee2e2;
    color: #991b1b;
}

/* CHECKLIST MULTI-CAMPOS */
.checklist-grid-form {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 30px;
    background: #f8fafc;
    padding: 24px;
    border-radius: 12px;
    border: 1px dashed var(--border);
}

.checklist-grid-form .form-group {
    margin-bottom: 0;
}

.checklist-grid-form .full-width {
    grid-column: span 2;
}

.checklist-grid-form button {
    margin-top: 10px;
    padding: 14px;
    background-color: var(--primary);
    color: white;
    border-radius: 8px;
    border: none;
    font-weight: 600;
    width: auto;
    align-self: flex-start;
    cursor: pointer;
}

.checklist-grid-form button:hover {
    background-color: var(--primary-light);
}

.checklist-container ul {
    list-style: none;
}

.checklist-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px;
    border: 1px solid var(--border);
    border-radius: 8px;
    margin-bottom: 10px;
    transition: var(--transition);
}

.checklist-item:hover {
    background: #f8fafc;
}

.checklist-item.completed {
    opacity: 0.6;
    text-decoration: line-through;
    background: #f1f5f9;
}

.task-content {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    cursor: pointer;
    flex: 1;
}

.task-details {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.task-details .task-title {
    font-weight: 600;
    color: var(--text-dark);
    font-size: 1.05rem;
}

.task-details .task-meta {
    font-size: 0.85rem;
    color: var(--text-muted);
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.task-details .task-desc {
    font-size: 0.95rem;
    color: var(--text-light);
    margin-top: 4px;
    background: #f1f5f9;
    padding: 10px;
    border-radius: 6px;
}

.task-content .checkbox {
    width: 20px;
    height: 20px;
    border: 2px solid var(--primary-light);
    border-radius: 4px;
    display: flex;
    justify-content: center;
    align-items: center;
    color: transparent;
}

.checklist-item.completed .checkbox {
    background: var(--primary-light);
    color: white;
}

.task-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

.btn-delete-task {
    background: transparent;
    border: none;
    color: #ef4444;
    font-size: 1.2rem;
    cursor: pointer;
    transition: var(--transition);
}

.btn-delete-task:hover {
    color: #b91c1c;
    transform: scale(1.1);
}

.btn-edit-task {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 1.2rem;
    cursor: pointer;
    transition: var(--transition);
}

/* === MODAL GERAL (CLIENTES/USUÁRIOS) === */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(4px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
}

.modal-content {
    background: var(--bg-main);
    width: 90%;
    max-width: 850px;
    height: 90vh;
    border-radius: 16px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: modalFadeIn 0.3s ease-out;
}

.modal-content.large {
    max-width: 1300px;
    width: 95%;
}

.modal-content.full {
    max-width: 98vw;
    width: 98vw;
    height: 98vh;
    border-radius: 8px;
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

.modal-header {
    padding: 24px 40px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    font-size: 1.8rem;
    color: var(--text-dark);
}

.btn-close-modal {
    background: transparent;
    border: none;
    font-size: 1.5rem;
    color: var(--text-muted);
    cursor: pointer;
    transition: var(--transition);
}

.btn-close-modal:hover {
    color: var(--secondary);
    transform: rotate(90deg);
}

.modal-body {
    flex: 1;
    padding: 40px;
    overflow-y: auto;
}

/* Ajustes no admin para não scrollar com modal */
body.modal-open {
    overflow: hidden;
}

/* Linha de Bomba Dinâmica no Modal */
.pump-row {
    display: grid;
    grid-template-columns: 2fr 2fr 1.5fr 1fr 40px;
    gap: 10px;
    align-items: end;
    background: #f1f5f9;
    padding: 12px;
    border-radius: 8px;
    border: 1px solid var(--border);
    animation: slideInDown 0.2s ease-out;
    margin-bottom: 10px;
}

@keyframes slideInDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.pump-row input {
    width: 100%;

    padding: 8px !important;
    font-size: 0.85rem !important;
    border: 1px solid var(--border);
    border-radius: 4px;
}

.btn-remove-pump {
    background: #fee2e2;
    color: #ef4444;
    border: none;
    width: 35px;
    height: 35px;
    border-radius: 6px;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: var(--transition);
}

.btn-remove-pump:hover {
    background: #fecaca;
    color: #dc2626;
}

    color: var(--text-light);
    margin-top: 4px;
    background: #f1f5f9;
    padding: 10px;
    border-radius: 6px;
}

.task-content .checkbox {
    width: 20px;
    height: 20px;
    border: 2px solid var(--primary-light);
    border-radius: 4px;
    display: flex;
    justify-content: center;
    align-items: center;
    color: transparent;
}

.checklist-item.completed .checkbox {
    background: var(--primary-light);
    color: white;
}

.task-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

.btn-delete-task {
    background: transparent;
    border: none;
    color: #ef4444;
    font-size: 1.2rem;
    cursor: pointer;
    transition: var(--transition);
}

.btn-delete-task:hover {
    color: #b91c1c;
    transform: scale(1.1);
}

.btn-edit-task {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 1.2rem;
    cursor: pointer;
    transition: var(--transition);
}

/* === MODAL GERAL (CLIENTES/USUÁRIOS) === */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(4px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
}

.modal-content {
    background: var(--bg-main);
    width: 90%;
    max-width: 850px;
    height: 90vh;
    border-radius: 16px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: modalFadeIn 0.3s ease-out;
}

.modal-content.large {
    max-width: 1300px;
    width: 95%;
}

.modal-content.full {
    max-width: 98vw;
    width: 98vw;
    height: 98vh;
    border-radius: 8px;
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

.modal-header {
    padding: 24px 40px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    font-size: 1.8rem;
    color: var(--text-dark);
}

.btn-close-modal {
    background: transparent;
    border: none;
    font-size: 1.5rem;
    color: var(--text-muted);
    cursor: pointer;
    transition: var(--transition);
}

.btn-close-modal:hover {
    color: var(--secondary);
    transform: rotate(90deg);
}

.modal-body {
    flex: 1;
    padding: 40px;
    overflow-y: auto;
}

/* Ajustes no admin para não scrollar com modal */
body.modal-open {
    overflow: hidden;
}

/* Linha de Bomba Dinâmica no Modal */
.pump-row {
    display: grid;
    grid-template-columns: 2fr 2fr 1.5fr 1fr 40px;
    gap: 10px;
    align-items: end;
    background: #f1f5f9;
    padding: 12px;
    border-radius: 8px;
    border: 1px solid var(--border);
    animation: slideInDown 0.2s ease-out;
    margin-bottom: 10px;
}

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

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

.pump-row input {
    width: 100%;
    padding: 8px !important;
    font-size: 0.85rem !important;
    border: 1px solid var(--border);
    border-radius: 4px;
}

.btn-remove-pump {
    background: #fee2e2;
    color: #ef4444;
    border: none;
    width: 35px;
    height: 35px;
    border-radius: 6px;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: var(--transition);
}

.btn-remove-pump:hover {
    background: #fecaca;
    color: #dc2626;
}

/* === MODULO DE MAPAS - DASHBOARD REORGANIZADO === */
.maps-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-top: 20px;
}

#map-tanques { border-top: 6px solid #3b82f6; }
#map-bombas { border-top: 6px solid #10b981; }
#map-bicos { border-top: 6px solid #6366f1; }
#map-logicos { border-top: 6px solid #f59e0b; }

@media (max-width: 1200px) {
    .maps-grid { grid-template-columns: 1fr; }
    #map-tanques { grid-column: span 1; }
}

.map-card {
    background: white;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
    border: 1px solid var(--border);
    overflow: hidden;
    transition: var(--transition);
    display: flex;
    flex-direction: column;
}

.map-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

.map-card-header {
    padding: 15px 20px;
    background: #f8fafc;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.map-content {
    font-size: 0.95rem;
    color: var(--text-light);
}

.bombas-grid-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    width: 100%;
}

.printable-area p {
    margin-bottom: 5px;
}

/* Estilo para tanques */
.tank-visual {
    border: 1px solid #3b82f6;
    display: flex;
    align-items: center;
    padding: 12px;
    border-radius: 8px;
    background-color: #eff6ff;
}

.tank-circle {
    width: 45px;
    height: 45px;
    border: 3px solid #3b82f6;
    border-radius: 50%;
    margin-right: 15px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: white;
}/* === LAYOUT CORPORATIVO 'WAVE' - RELATÃ“RIOS === */

.report-body-wave {
    background-color: #ffffff;
    min-height: 297mm;
    display: flex;
    flex-direction: column;
    position: relative;
    font-family: 'Inter', sans-serif;
}

.report-header-wave {
    background: white;
    padding: 40px 20px 20px 20px;
    text-align: center;
    position: relative;
    z-index: 10;
}

.logo-main-centered {
    max-width: 400px;
    margin: 0 auto;
    display: block;
}

.company-legal-info {
    color: #30365f;
    font-size: 0.9rem;
    font-weight: 500;
    margin-top: 5px;
}

.report-client-title {
    padding: 30px 60px 10px 60px;
    text-align: left;
}

.report-client-title h2 {
    font-size: 1.8rem;
    color: #000;
    font-weight: 600;
    margin: 0;
}

.report-subtitle {
    padding: 0 60px 30px 60px;
    font-size: 1.2rem;
    color: #000;
    font-weight: 400;
}

.report-content-body {
    padding: 0 60px;
    flex-grow: 1;
    z-index: 5;
    color: #000;
}

/* RodapÃ© em Onda (Wave) - FIDELIDADE TOTAL */
.footer-wave-wrap {
    position: relative;
    width: 100%;
    margin-top: auto;
    line-height: 0;
}

.wave-svg {
    width: 100%;
    height: auto;
    display: block;
}


/* === RESTAURAÇÃO DO SELETOR DE CLIENTES === */
.client-selector-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 24px;
    margin-top: 20px;
}
.client-card-item {
    background: white;
    border-radius: 12px;
    padding: 20px;
    border: 1px solid var(--border);
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
}

.client-card-main {
    display: flex;
    align-items: center;
    gap: 15px;
    flex: 1;
}
.client-card-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.08);
    border-color: var(--primary);
}

.btn-delete-card-client {
    background: #fee2e2;
    color: #ef4444;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: 0.2s;
    opacity: 0.6;
}

.btn-delete-card-client:hover {
    background: #ef4444;
    color: white;
    opacity: 1;
}
.client-card-item i { font-size: 3rem; color: var(--primary); }
.client-card-item h3 { font-size: 1.25rem; color: var(--text-dark); }
.client-card-item .client-loc { font-size: 0.9rem; color: var(--text-muted); }
.btn-back-maps {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: #f1f5f9;
    border: none;
    border-radius: 8px;
    color: var(--text-dark);
    font-weight: 600;
    cursor: pointer;
    margin-bottom: 24px;
    transition: var(--transition);
}
.logo-print-only { display: none; }
.report-body-wave .logo-print-only { display: block; } /* Mostrar logo na janela de visualização */
@media print { 
    .btn-back-maps { display: none !important; } 
    .logo-print-only { display: block !important; margin-bottom: 20px; }
}

/* === ESTILO FINAL DOS TANQUES - FIDELIDADE TOTAL === */
.tank-technical-row {
    display: flex;
    flex-direction: column;
    gap: 50px;
    margin-top: 30px;
    background: transparent;
}

.tank-main-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    width: 100%;
    background: transparent;
}

.tank-body-rectangle {
    width: 100%;
    height: 120px;
    border: 3px solid #000;
    display: flex;
    flex-direction: row !important;
    background: linear-gradient(180deg, #ffffff 0%, #f1f5f9 100%);
    border-radius: 70px;
    overflow: hidden;
    position: relative;
    box-sizing: border-box;
    box-shadow: inset 0 2px 10px rgba(0,0,0,0.05), 0 5px 15px rgba(0,0,0,0.1);
}

/* Cores de Fundo por Produto - REMOVIDO A PEDIDO */
.tank-body-rectangle.prod-gasolina, 
.tank-body-rectangle.prod-diesel, 
.tank-body-rectangle.prod-etanol, 
.tank-body-rectangle.prod-outros { 
    border-color: #000; 
    background: linear-gradient(180deg, #ffffff 0%, #f1f5f9 100%); 
}

.tank-comp-section {
    flex: 1;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    border-right: 2px solid rgba(0,0,0,0.1);
    height: 100%;
    padding: 0 40px;
    box-sizing: border-box;
}

.tank-comp-section:last-child {
    border-right: none;
}

.tank-info-labels {
    display: flex;
    flex-direction: column;
    gap: 3px;
    text-align: center;
    flex: 1;
    min-width: 0;
}

.tank-info-labels .t-name { font-weight: 800; font-size: 1.1rem; color: #000; margin: 0; }
.tank-info-labels .t-prod { font-weight: 600; font-size: 0.95rem; color: #000; margin: 0; }
.tank-info-labels .t-cap { font-weight: 700; font-size: 0.95rem; color: #000; margin: 0; }

.circle-large {
    width: 70px;
    height: 70px;
    border: 5px solid #000;
    border-radius: 50%;
    background: #fff;
    flex-shrink: 0;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    display: flex;
    align-items: center;
    justify-content: center;
}

.prod-gasolina .circle-large,
.prod-diesel .circle-large,
.prod-etanol .circle-large { border-color: #000; }

.tank-body-rectangle.pleno {
    justify-content: space-between;
    align-items: center;
    padding: 0 50px;
}

.circle-small-right {
    width: 30px;
    height: 30px;
    border: 3px solid #000;
    border-radius: 50%;
    flex-shrink: 0;
    background: #fff;
}

.circle-tiny {
    width: 12px;
    height: 12px;
    border: 2px solid #000;
    border-radius: 50%;
    flex-shrink: 0;
    background: #fff;
}

.t-type-title {
    font-size: 1rem;
    font-weight: 700;
    color: #444;
    margin-bottom: 5px;
    text-align: center;
}

.tank-end-elements {
    display: flex;
    align-items: center;
    gap: 15px;
    padding-right: 30px;
}

.tank-body-rectangle.pleno {
    margin: 0 auto;
}

.btn-backup {
    width: 100%;
    padding: 12px;
    background: #10b981;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-weight: 600;
    margin-bottom: 10px;
    transition: all 0.3s ease;
}

.btn-backup:hover {
    background: #059669;
    transform: translateY(-2px);
}


/* === PÁGINA DE BACKUP (IMPORTAR / EXPORTAR) === */
.backup-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    margin-top: 20px;
}

.backup-card {
    background: white;
    padding: 40px;
    border-radius: 16px;
    border: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 20px;
    transition: all 0.3s ease;
}

.backup-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.05);
}

.backup-card i {
    font-size: 4rem;
    margin-bottom: 10px;
}

.backup-card.export { color: #10b981; }
.backup-card.import { color: #3b82f6; }

.backup-card h3 {
    font-size: 1.5rem;
    color: var(--text-dark);
}

.backup-card p {
    color: var(--text-muted);
    font-size: 0.95rem;
    line-height: 1.5;
}

.btn-backup-action {
    width: 100%;
    max-width: 250px;
    padding: 14px;
    border-radius: 8px;
    border: none;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all 0.3s ease;
}

.btn-export { background: #10b981; color: white; }
.btn-export:hover { background: #059669; }

.btn-import { background: #3b82f6; color: white; }
.btn-import:hover { background: #2563eb; }

#file-import { display: none; }

/* === ESTILOS PARA RELATÓRIO DE AFERIÇÃO === */
.afericao-form-table input, 
.afericao-form-table select {
    width: 100%;
    padding: 8px;
    border: 1px solid #e2e8f0;
    border-radius: 4px;
    font-size: 0.9rem;
}

.afericao-form-table th {
    background: #f8fafc;
    color: #1e3a8a;
    font-weight: 800;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
    border: 1px solid #cbd5e1;
}

.afericao-form-table td {
    padding: 8px;
    border: 1px solid #e2e8f0;
}

.afericao-form-table tr:hover {
    background: #f8fafc;
}

.badge-afericao {
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-afericao.ok { background: #dcfce7; color: #166534; }
.badge-afericao.alerta { background: #fee2e2; color: #991b1b; }

/* Impressão específica para Aferição */
@media print {
    .report-body-wave {
        width: 210mm;
        height: 297mm;
    }
    .afericao-print-table {
        width: 100%;
        border-collapse: collapse;
    }
    .afericao-print-table th, 
    .afericao-print-table td {
        border: 1px solid #000;
        padding: 5px;
        font-size: 0.8rem;
    }
}


/* INTERATIVIDADE DASHBOARD */
.stat-card.clickable { 
    cursor: pointer; 
    transition: all 0.3s ease; 
}
.stat-card.clickable:hover { 
    transform: translateY(-5px); 
    box-shadow: 0 10px 15px -3px rgba(0,0,0,0.1); 
    background: #f8faff; 
    border-color: var(--primary-light); 
}

/* ESTILOS MANUTENÇÃO PREVENTIVA */
.manutencao-categoria {
    background: #f1f5f9;
    padding: 12px 18px;
    border-radius: 10px;
    margin: 25px 0 15px 0;
    color: #1e3a8a;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 12px;
    border-left: 5px solid #1e3a8a;
    font-size: 1rem;
}

.man-item-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 20px;
    border-bottom: 1px solid #f1f5f9;
    transition: all 0.2s;
    background: #fff;
    margin-bottom: 8px;
    border-radius: 12px;
    border: 1px solid #f1f5f9;
    gap: 20px;
}

.man-item-row:hover {
    background: #f8fafc;
    border-color: #e2e8f0;
    transform: translateX(5px);
}

.man-item-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.man-item-label {
    font-weight: 700;
    color: #1e3a8a;
    font-size: 1rem;
}

.man-item-note {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 0.9rem;
    color: #475569;
    background: #fcfcfc;
    transition: all 0.2s;
    min-height: 45px;
    resize: vertical;
    font-family: inherit;
    line-height: 1.4;
}

.man-item-note:focus {
    outline: none;
    border-color: #3b82f6;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.status-btn-group {
    display: flex;
    gap: 8px;
}

.status-btn {
    border: 1px solid #e2e8f0;
    background: white;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 0.8rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    color: #64748b;
    min-width: 90px;
    text-align: center;
}

.status-btn:hover {
    border-color: #cbd5e1;
    background: #f1f5f9;
}

.status-btn.active.ok {
    background: #22c55e;
    color: white;
    border-color: #16a34a;
    box-shadow: 0 4px 6px -1px rgba(34, 197, 94, 0.3);
}

.status-btn.active.atencao {
    background: #eab308;
    color: white;
    border-color: #ca8a04;
    box-shadow: 0 4px 6px -1px rgba(234, 179, 8, 0.3);
}

.status-btn.active.substituir {
    background: #ef4444;
    color: white;
    border-color: #dc2626;
    box-shadow: 0 4px 6px -1px rgba(239, 68, 68, 0.3);
}

.manutencao-list-container {
    overflow-x: auto;
}

.badge-manutencao {
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
}

.badge-manutencao.baixa { background: #dcfce7; color: #166534; }
.badge-manutencao.media { background: #fef9c3; color: #854d0e; }
.badge-manutencao.alta { background: #fee2e2; color: #991b1b; }
.stat-card.clickable:active { 
    transform: translateY(-2px); 
}

.mobile-menu-toggle {
    display: none;
    font-size: 1.8rem;
    cursor: pointer;
    color: var(--text-dark);
    margin-right: 15px;
    align-items: center;
    justify-content: center;
}

.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 998;
    backdrop-filter: blur(2px);
}

.sidebar-overlay.active {
    display: block;
}

/* === RESPONSIVIDADE === */
@media (max-width: 1024px) {
    .sidebar {
        position: fixed;
        left: -260px;
        top: 0;
        height: 100%;
        z-index: 1001;
        transition: left 0.3s ease;
        box-shadow: 10px 0 30px rgba(0,0,0,0.2);
    }

    .sidebar.active {
        left: 0;
    }

    .mobile-menu-toggle {
        display: flex;
    }
    .top-header {
        padding: 0 20px;
        justify-content: flex-start;
        gap: 15px;
    }

    .user-profile {
        margin-left: auto;
    }

    .content-area {
        padding: 20px;
    }

    .stats-grid {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
        gap: 15px;
    }

    .checklist-grid-form {
        grid-template-columns: 1fr;
    }

    .checklist-grid-form .full-width {
        grid-column: span 1;
    }

    .maps-grid {
        grid-template-columns: 1fr;
    }

    .client-selector-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .modal-content {
        width: 100% !important;
        height: 100% !important;
        max-width: 100% !important;
        border-radius: 0;
    }

    .modal-header {
        padding: 15px 20px;
    }

    .modal-body {
        padding: 20px;
    }

    .view-title {
        font-size: 1.5rem;
    }

    .stat-card {
        padding: 15px;
    }

    .stat-card i {
        font-size: 30px;
    }

    /* Tabelas responsivas */
    .panel-box {
        padding: 15px;
        overflow-x: auto;
    }

    .data-table {
        min-width: 600px;
    }

    .pump-row {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    /* Ajustes para Tanques em Mobile */
    .tank-body-rectangle {
        height: auto;
        flex-direction: column !important;
        border-radius: 20px;
        padding: 20px;
    }

    .tank-comp-section {
        border-right: none;
        border-bottom: 2px solid rgba(0,0,0,0.1);
        padding: 15px 0;
        width: 100%;
    }

    .tank-comp-section:last-child {
        border-bottom: none;
    }

    .tank-end-elements {
        padding: 15px 0;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .view-title {
        font-size: 1.3rem;
    }

    .welcome-msg {
        font-size: 0.9rem;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .map-card-header {
        flex-direction: column;
        gap: 10px;
        align-items: flex-start;
    }

    .map-card-header div {
        width: 100%;
        display: flex;
        flex-wrap: wrap;
    }

    .map-card-header button {
        flex: 1;
    }
}

@media print {
    .logo-print-only {
        display: flex !important;
        align-items: center;
        gap: 15px;
        margin-bottom: 25px;
        border-bottom: 2px solid #1e3a8a;
        padding-bottom: 15px;
    }
}

/* --- ROLE-BASED ACCESS CONTROL (TÉCNICO) --- */
body.role-tech .admin-only,
body.role-tech .btn-delete-task,
body.role-tech .btn-delete-report {
    display: none !important;
}

/* Ajustes visuais para o técnico */
body.role-tech .view-section {
    padding-top: 20px;
}
