/* ============================================
   SISTEMA DE GESTÃO DE COMBUSTÍVEL
   Prefeitura de Ipixuna do Pará
   ============================================ */

/* === VARIÁVEIS === */
:root {
    --verde-principal: #008B5A;
    --azul-institucional: #0877B9;
    --amarelo: #FFD51A;
    --verde-limao: #93C900;
    --branco: #FFFFFF;
    --cinza-fundo: #F5F7FA;
    --texto-escuro: #1F2937;
    --cinza-claro: #E5E7EB;
    --cinza-medio: #9CA3AF;
    --vermelho: #DC2626;
    --verde-success: #059669;
    --azul-info: #2563EB;
    --laranja-warning: #D97706;
    --sidebar-width: 260px;
    --topbar-height: 64px;
    --shadow-card: 0 1px 3px rgba(0, 0, 0, 0.08), 0 1px 2px rgba(0, 0, 0, 0.06);
    --shadow-hover: 0 4px 6px rgba(0, 0, 0, 0.1), 0 2px 4px rgba(0, 0, 0, 0.06);
    --radius: 8px;
}

/* === RESET & BASE === */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: var(--cinza-fundo);
    color: var(--texto-escuro);
    min-height: 100vh;
}

a {
    color: var(--azul-institucional);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

/* === LAYOUT PRINCIPAL === */
.sistema-layout {
    display: flex;
    min-height: 100vh;
}

/* === SIDEBAR === */
.sidebar {
    width: var(--sidebar-width);
    background: linear-gradient(180deg, #006644 0%, #0877B9 100%);
    color: var(--branco);
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease;
    overflow-y: auto;
}

.sidebar-logo {
    padding: 1.5rem 1rem;
    text-align: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.15);
}

.sidebar-logo img {
    max-width: 80px;
    height: auto;
    margin-bottom: 0.5rem;
}

.sidebar-logo h1 {
    font-size: 0.95rem;
    font-weight: 600;
    line-height: 1.3;
}

.sidebar-logo span {
    font-size: 0.75rem;
    opacity: 0.8;
}

.sidebar-user {
    padding: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.15);
    font-size: 0.85rem;
}

.sidebar-user .user-name {
    font-weight: 600;
}

.sidebar-user .user-role {
    opacity: 0.7;
    font-size: 0.75rem;
}

/* === MENU SIDEBAR === */
.sidebar-menu {
    padding: 0.5rem 0;
    flex: 1;
}

.sidebar-menu .menu-label {
    padding: 0.5rem 1rem;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    opacity: 0.6;
}

.sidebar-menu a {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.65rem 1rem;
    color: rgba(255, 255, 255, 0.85);
    font-size: 0.875rem;
    transition: all 0.2s;
    text-decoration: none;
    border-left: 3px solid transparent;
}

.sidebar-menu a:hover,
.sidebar-menu a.active {
    background: rgba(255, 255, 255, 0.1);
    color: var(--branco);
    border-left-color: var(--amarelo);
}

.sidebar-menu a .menu-icon {
    width: 20px;
    text-align: center;
    font-size: 1rem;
}

.sidebar-footer {
    padding: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.15);
}

.sidebar-footer a,
.sidebar-logout-button {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: rgba(255, 255, 255, 0.75);
    font-size: 0.875rem;
    padding: 0.5rem 0;
    text-decoration: none;
}

.sidebar-logout-button {
    width: 100%;
    border: 0;
    background: transparent;
    cursor: pointer;
    font: inherit;
}

.sidebar-footer a:hover,
.sidebar-logout-button:hover {
    color: var(--branco);
}

/* === CONTEÚDO PRINCIPAL === */
.main-content {
    margin-left: var(--sidebar-width);
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* === TOPBAR === */
.topbar {
    height: var(--topbar-height);
    background: var(--branco);
    border-bottom: 1px solid var(--cinza-claro);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.5rem;
    position: sticky;
    top: 0;
    z-index: 900;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.topbar-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.25rem;
    cursor: pointer;
    color: var(--texto-escuro);
    padding: 0.25rem;
}

.topbar-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--texto-escuro);
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.topbar-user {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: var(--texto-escuro);
}

.topbar-user .avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--verde-principal);
    color: var(--branco);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.8rem;
}

/* === PAGE CONTENT === */
.page-content {
    padding: 1.5rem;
    flex: 1;
}

/* === PAGE HEADER === */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.page-header h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--texto-escuro);
}

.page-header .breadcrumb {
    font-size: 0.85rem;
    color: var(--cinza-medio);
}

.page-header .breadcrumb a {
    color: var(--azul-institucional);
}

/* === CARDS === */
.card {
    background: var(--branco);
    border-radius: var(--radius);
    box-shadow: var(--shadow-card);
    margin-bottom: 1.5rem;
    transition: box-shadow 0.2s;
}

.card:hover {
    box-shadow: var(--shadow-hover);
}

.card-header {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--cinza-claro);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.card-header h3,
.card-header h4 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--texto-escuro);
}

.card-body {
    padding: 1.25rem;
}

.card-footer {
    padding: 0.75rem 1.25rem;
    border-top: 1px solid var(--cinza-claro);
    background: #F9FAFB;
    border-radius: 0 0 var(--radius) var(--radius);
}

/* === STATS CARDS GRID === */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.stat-card {
    background: var(--branco);
    border-radius: var(--radius);
    padding: 1.25rem;
    box-shadow: var(--shadow-card);
    transition: all 0.2s;
    border-left: 4px solid var(--verde-principal);
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
}

.stat-card .stat-icon {
    width: 40px;
    height: 40px;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 0.75rem;
    font-size: 1.2rem;
}

.stat-card .stat-label {
    font-size: 0.8rem;
    color: var(--cinza-medio);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.25rem;
}

.stat-card .stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--texto-escuro);
}

.stat-card .stat-sub {
    font-size: 0.8rem;
    color: var(--cinza-medio);
    margin-top: 0.25rem;
}

/* === Cores dos stat cards === */
.stat-card.green { border-left-color: var(--verde-principal); }
.stat-card.blue { border-left-color: var(--azul-institucional); }
.stat-card.yellow { border-left-color: var(--amarelo); }
.stat-card.lime { border-left-color: var(--verde-limao); }
.stat-card.red { border-left-color: var(--vermelho); }
.stat-card.info { border-left-color: var(--azul-info); }
.stat-card.warning { border-left-color: var(--laranja-warning); }

.stat-card.green .stat-icon { background: #D1FAE5; color: var(--verde-principal); }
.stat-card.blue .stat-icon { background: #DBEAFE; color: var(--azul-institucional); }
.stat-card.yellow .stat-icon { background: #FEF3C7; color: #B45309; }
.stat-card.lime .stat-icon { background: #ECFCCB; color: var(--verde-limao); }
.stat-card.red .stat-icon { background: #FEE2E2; color: var(--vermelho); }
.stat-card.info .stat-icon { background: #DBEAFE; color: var(--azul-info); }
.stat-card.warning .stat-icon { background: #FEF3C7; color: var(--laranja-warning); }

/* === BOTÕES === */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 500;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    line-height: 1.5;
}

.btn:hover {
    text-decoration: none;
}

.btn-primary {
    background: var(--verde-principal);
    color: var(--branco);
}

.btn-primary:hover {
    background: #00704A;
    color: var(--branco);
}

.btn-secondary {
    background: var(--azul-institucional);
    color: var(--branco);
}

.btn-secondary:hover {
    background: #0665A0;
    color: var(--branco);
}

.btn-warning {
    background: var(--amarelo);
    color: #92400E;
}

.btn-warning:hover {
    background: #E6BF17;
    color: #92400E;
}

.btn-danger {
    background: var(--vermelho);
    color: var(--branco);
}

.btn-danger:hover {
    background: #B91C1C;
    color: var(--branco);
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--cinza-claro);
    color: var(--texto-escuro);
}

.btn-outline:hover {
    background: var(--cinza-fundo);
    border-color: var(--cinza-medio);
}

.btn-sm {
    padding: 0.3rem 0.65rem;
    font-size: 0.8rem;
}

.btn-lg {
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
}

/* === TABELAS === */
.table-container {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

table thead {
    background: #F9FAFB;
}

table th {
    padding: 0.75rem 1rem;
    text-align: left;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--cinza-medio);
    border-bottom: 2px solid var(--cinza-claro);
}

table td {
    padding: 0.75rem 1rem;
    font-size: 0.875rem;
    border-bottom: 1px solid var(--cinza-claro);
    color: var(--texto-escuro);
}

table tbody tr:hover {
    background: #F9FAFB;
}

table .actions {
    display: flex;
    gap: 0.5rem;
}

/* === BADGES === */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.2rem 0.65rem;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 9999px;
    line-height: 1.4;
}

.badge-success {
    background: #D1FAE5;
    color: #065F46;
}

.badge-danger {
    background: #FEE2E2;
    color: #991B1B;
}

.badge-warning {
    background: #FEF3C7;
    color: #92400E;
}

.badge-info {
    background: #DBEAFE;
    color: #1E40AF;
}

.badge-secondary {
    background: var(--cinza-claro);
    color: var(--cinza-medio);
}

/* === FORMULÁRIOS === */
.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--texto-escuro);
    margin-bottom: 0.375rem;
}

.form-control {
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--cinza-claro);
    border-radius: 6px;
    font-size: 0.875rem;
    color: var(--texto-escuro);
    background: var(--branco);
    transition: border-color 0.2s, box-shadow 0.2s;
    font-family: inherit;
}

.form-control:focus {
    outline: none;
    border-color: var(--verde-principal);
    box-shadow: 0 0 0 3px rgba(0, 139, 90, 0.1);
}

.form-control.error {
    border-color: var(--vermelho);
}

.form-control:disabled {
    background: var(--cinza-fundo);
    cursor: not-allowed;
}

select.form-control {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%236B7280' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    padding-right: 2rem;
}

textarea.form-control {
    resize: vertical;
    min-height: 80px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.form-actions {
    display: flex;
    gap: 0.75rem;
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--cinza-claro);
}

/* === ALERTAS === */
.alert {
    padding: 0.75rem 1rem;
    border-radius: var(--radius);
    margin-bottom: 1rem;
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.alert-success {
    background: #D1FAE5;
    color: #065F46;
    border-left: 4px solid var(--verde-principal);
}

.alert-danger,
.alert-error {
    background: #FEE2E2;
    color: #991B1B;
    border-left: 4px solid var(--vermelho);
}

.alert-warning {
    background: #FEF3C7;
    color: #92400E;
    border-left: 4px solid var(--amarelo);
}

.alert-info {
    background: #DBEAFE;
    color: #1E40AF;
    border-left: 4px solid var(--azul-institucional);
}

.alert .alert-icon {
    font-size: 1.25rem;
    flex-shrink: 0;
}

.alert .alert-close {
    margin-left: auto;
    cursor: pointer;
    background: none;
    border: none;
    font-size: 1.25rem;
    opacity: 0.5;
    padding: 0;
    line-height: 1;
    color: inherit;
}

.alert .alert-close:hover {
    opacity: 1;
}

/* === PAGINAÇÃO === */
.pagination {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    padding: 1rem 0;
}

.pagination a,
.pagination span {
    padding: 0.4rem 0.75rem;
    border-radius: 6px;
    font-size: 0.875rem;
    color: var(--texto-escuro);
    border: 1px solid var(--cinza-claro);
    transition: all 0.2s;
}

.pagination a:hover {
    background: var(--verde-principal);
    color: var(--branco);
    border-color: var(--verde-principal);
}

.pagination .active {
    background: var(--verde-principal);
    color: var(--branco);
    border-color: var(--verde-principal);
}

/* === GRID RESPONSIVO === */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 1.5rem; }
.grid-4 { display: grid; grid-template-columns: 1fr 1fr 1fr 1fr; gap: 1.5rem; }

/* === QR CODE READER PAGE === */
.qr-reader-container {
    max-width: 600px;
    margin: 2rem auto;
    text-align: center;
}

.qr-reader-container .qr-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
}

.qr-reader-container h2 {
    margin-bottom: 0.5rem;
}

.qr-reader-container p {
    color: var(--cinza-medio);
    margin-bottom: 2rem;
}

.qr-reader-container input[type="text"] {
    font-size: 1.1rem;
    padding: 1rem;
    text-align: center;
    letter-spacing: 2px;
}

/* === VALIDAÇÃO QR CODE === */
.qr-validation {
    max-width: 700px;
    margin: 2rem auto;
}

.qr-validation .info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.qr-validation .info-item {
    padding: 0.75rem;
    background: var(--cinza-fundo);
    border-radius: 6px;
}

.qr-validation .info-item .label {
    font-size: 0.75rem;
    color: var(--cinza-medio);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.qr-validation .info-item .value {
    font-size: 1rem;
    font-weight: 600;
    margin-top: 0.25rem;
}

.qr-validation .btn-lg {
    width: 100%;
    justify-content: center;
    padding: 1rem;
}

/* === IMPRESSÃO === */
@media print {
    .sidebar,
    .topbar,
    .btn,
    .no-print {
        display: none !important;
    }
    .main-content {
        margin-left: 0;
    }
    .page-content {
        padding: 0;
    }
    .card {
        box-shadow: none;
        border: 1px solid #ddd;
    }
}

/* === RESPONSIVIDADE === */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .topbar-toggle {
        display: block;
    }

    .main-content {
        margin-left: 0;
    }

    .stats-grid {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    }

    .form-row,
    .grid-2,
    .grid-3,
    .grid-4 {
        grid-template-columns: 1fr;
    }

    .qr-validation .info-grid {
        grid-template-columns: 1fr;
    }

    .page-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .topbar-title {
        font-size: 0.95rem;
    }
}

/* === SIDEBAR OVERLAY (mobile) === */
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
}

.sidebar-overlay.active {
    display: block;
}

@media (max-width: 768px) {
    .sidebar-overlay.active {
        display: block;
    }
}

/* === UTILITÁRIOS === */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-left { text-align: left; }
.text-success { color: var(--verde-principal); }
.text-danger { color: var(--vermelho); }
.text-warning { color: var(--laranja-warning); }
.text-info { color: var(--azul-info); }
.text-muted { color: var(--cinza-medio); }
.font-bold { font-weight: 700; }
.font-semibold { font-weight: 600; }
.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 0.75rem; }
.mt-4 { margin-top: 1rem; }
.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 0.75rem; }
.mb-4 { margin-bottom: 1rem; }
.ml-1 { margin-left: 0.25rem; }
.ml-2 { margin-left: 0.5rem; }
.mr-1 { margin-right: 0.25rem; }
.mr-2 { margin-right: 0.5rem; }
.d-flex { display: flex; }
.align-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-1 { gap: 0.25rem; }
.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 0.75rem; }
.gap-4 { gap: 1rem; }
.flex-wrap { flex-wrap: wrap; }
.w-full { width: 100%; }

/* === EMPTY STATE === */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--cinza-medio);
}

.empty-state .empty-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.empty-state p {
    font-size: 1rem;
    margin-bottom: 0.5rem;
}

/* === FILTROS === */
.filters-bar {
    display: flex;
    align-items: flex-end;
    gap: 1rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.filters-bar .form-group {
    margin-bottom: 0;
    min-width: 150px;
}

.filters-bar .form-group label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--cinza-medio);
}

@media (max-width: 768px) {
    .filters-bar {
        flex-direction: column;
        align-items: stretch;
    }

    .filters-bar .form-group {
        min-width: auto;
    }
}

/* === REFINAMENTO VISUAL 2026 === */
:root {
    --verde-principal: #075e54;
    --azul-institucional: #1769aa;
    --amarelo: #f4c542;
    --verde-limao: #7dbd35;
    --cinza-fundo: #f3f6f8;
    --texto-escuro: #122033;
    --cinza-claro: #dce4ea;
    --cinza-medio: #6b7a90;
    --sidebar-width: 248px;
    --topbar-height: 68px;
    --shadow-card: 0 1px 2px rgba(18, 32, 51, 0.08), 0 8px 24px rgba(18, 32, 51, 0.04);
    --shadow-hover: 0 10px 28px rgba(18, 32, 51, 0.08);
}

html,
body {
    overflow-x: hidden;
}

body {
    font-family: Figtree, "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
    background: var(--cinza-fundo);
}

.sistema-layout {
    background: var(--cinza-fundo);
}

.sidebar {
    background: #0c4f46;
    box-shadow: 1px 0 0 rgba(255, 255, 255, 0.06) inset, 12px 0 30px rgba(18, 32, 51, 0.08);
}

.sidebar-logo {
    padding: 1.25rem 1rem 1rem;
    text-align: left;
}

.brand-mark {
    width: 42px;
    height: 42px;
    border-radius: 8px;
    display: grid;
    place-items: center;
    margin-bottom: 0.75rem;
    background: linear-gradient(135deg, #ffffff 0%, #d7f5ea 100%);
    color: var(--verde-principal);
    font-weight: 800;
    letter-spacing: 0;
}

.sidebar-logo h1 {
    font-size: 1rem;
    letter-spacing: 0;
}

.sidebar-logo span,
.sidebar-user .user-role,
.sidebar-menu .menu-label {
    color: rgba(255, 255, 255, 0.68);
    opacity: 1;
}

.sidebar-menu .menu-label {
    padding: 0.85rem 1rem 0.4rem;
    letter-spacing: 0.08em;
}

.sidebar-menu a,
.sidebar-footer a,
.sidebar-logout-button {
    min-height: 42px;
    margin: 0.125rem 0.75rem;
    padding: 0.55rem 0.75rem;
    border-left: 0;
    border-radius: 8px;
    color: rgba(255, 255, 255, 0.84);
}

.sidebar-menu a:hover,
.sidebar-menu a.active,
.sidebar-footer a:hover,
.sidebar-logout-button:hover {
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
    border-left-color: transparent;
}

.sidebar-menu a.active {
    box-shadow: inset 3px 0 0 var(--amarelo);
}

.menu-icon,
.alert-icon {
    width: 20px;
    height: 20px;
    display: inline-block;
    flex: 0 0 20px;
    background: currentColor;
    -webkit-mask: var(--icon) center / contain no-repeat;
    mask: var(--icon) center / contain no-repeat;
}

.icon-dashboard { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M3 13h8V3H3v10Zm0 8h8v-6H3v6Zm10 0h8V11h-8v10Zm0-18v6h8V3h-8Z'/%3E%3C/svg%3E"); }
.icon-building { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M4 21V5l8-3 8 3v16h-5v-7H9v7H4Zm3-3h2v-2H7v2Zm0-4h2v-2H7v2Zm0-4h2V8H7v2Zm4 0h2V8h-2v2Zm4 0h2V8h-2v2Zm0 4h2v-2h-2v2Z'/%3E%3C/svg%3E"); }
.icon-users { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M16 11c1.66 0 3-1.34 3-3s-1.34-3-3-3-3 1.34-3 3 1.34 3 3 3ZM8 11c1.66 0 3-1.34 3-3S9.66 5 8 5 5 6.34 5 8s1.34 3 3 3Zm0 2c-2.33 0-7 1.17-7 3.5V19h14v-2.5C15 14.17 10.33 13 8 13Zm8 0c-.29 0-.62.02-.97.05 1.16.84 1.97 1.96 1.97 3.45V19h6v-2.5c0-2.33-4.67-3.5-7-3.5Z'/%3E%3C/svg%3E"); }
.icon-car { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M5 11 6.5 6.5A3 3 0 0 1 9.35 4h5.3a3 3 0 0 1 2.85 2.5L19 11h1a1 1 0 0 1 1 1v6h-2v2h-3v-2H8v2H5v-2H3v-6a1 1 0 0 1 1-1h1Zm2.1 0h9.8L15.8 7a1 1 0 0 0-.95-.75h-5.7A1 1 0 0 0 8.2 7L7.1 11ZM7 16a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3Zm10 0a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3Z'/%3E%3C/svg%3E"); }
.icon-pump { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M5 3h10a2 2 0 0 1 2 2v15h1v2H4v-2h1V3Zm3 3v5h6V6H8Zm10.5-1.5L22 8v9.5a2.5 2.5 0 0 1-5 0V14h-1v-2h3v5.5a.5.5 0 0 0 1 0V9l-3-3 1.5-1.5Z'/%3E%3C/svg%3E"); }
.icon-droplet { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2s7 7.16 7 12a7 7 0 1 1-14 0c0-4.84 7-12 7-12Zm0 18a4 4 0 0 0 4-4h-2a2 2 0 0 1-2 2v2Z'/%3E%3C/svg%3E"); }
.icon-wallet { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M4 5h15a2 2 0 0 1 2 2v2h-6a4 4 0 0 0 0 8h6v2a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V7a2 2 0 0 1 2-2Zm11 6h7v4h-7a2 2 0 0 1 0-4Z'/%3E%3C/svg%3E"); }
.icon-shield { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2 4 5v6c0 5 3.4 9.7 8 11 4.6-1.3 8-6 8-11V5l-8-3Zm1 11v4h-2v-4a3 3 0 1 1 2 0Z'/%3E%3C/svg%3E"); }
.icon-chart { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M4 19h16v2H2V3h2v16Zm3-2V9h3v8H7Zm5 0V5h3v12h-3Zm5 0v-6h3v6h-3Z'/%3E%3C/svg%3E"); }
.icon-plus { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M11 4h2v7h7v2h-7v7h-2v-7H4v-2h7V4Z'/%3E%3C/svg%3E"); }
.icon-clipboard { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M9 2h6l1 2h3v18H5V4h3l1-2Zm0 6h6V6H9v2Zm0 4h8v-2H7v2h2Zm-2 4h10v-2H7v2Z'/%3E%3C/svg%3E"); }
.icon-download { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M11 3h2v9l3.5-3.5L18 10l-6 6-6-6 1.5-1.5L11 12V3ZM5 19h14v2H5v-2Z'/%3E%3C/svg%3E"); }
.icon-camera { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M9 4h6l1.5 2H20a2 2 0 0 1 2 2v10a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h3.5L9 4Zm3 14a5 5 0 1 0 0-10 5 5 0 0 0 0 10Zm0-2.2a2.8 2.8 0 1 1 0-5.6 2.8 2.8 0 0 1 0 5.6Z'/%3E%3C/svg%3E"); }
.icon-logout { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M10 3h10v18H10v-2h8V5h-8V3Zm-1.5 5.5L10 7l5 5-5 5-1.5-1.5L11 13H3v-2h8L8.5 8.5Z'/%3E%3C/svg%3E"); }
.icon-menu { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M3 6h18v2H3V6Zm0 5h18v2H3v-2Zm0 5h18v2H3v-2Z'/%3E%3C/svg%3E"); }
.icon-check { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='m9 16.2-3.5-3.5L4 14.2 9 19 20 8l-1.5-1.5L9 16.2Z'/%3E%3C/svg%3E"); }
.icon-alert { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M1 21h22L12 2 1 21Zm12-3h-2v-2h2v2Zm0-4h-2v-4h2v4Z'/%3E%3C/svg%3E"); }
.icon-info { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M11 17h2v-6h-2v6Zm1-14a9 9 0 1 0 0 18 9 9 0 0 0 0-18Zm-1 4h2v2h-2V7Z'/%3E%3C/svg%3E"); }

.topbar {
    padding: 0 1.75rem;
    border-bottom-color: #d9e3ea;
    box-shadow: none;
}

.topbar-toggle {
    width: 42px;
    height: 42px;
    border-radius: 8px;
    place-items: center;
}

.topbar-toggle:hover {
    background: #eef4f7;
}

.topbar-title {
    font-size: 1.05rem;
}

.topbar-user span {
    max-width: 180px;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.topbar-user .avatar {
    border-radius: 8px;
    background: #087f69;
}

.page-content {
    width: 100%;
    max-width: 1440px;
    padding: 1.75rem;
}

.legacy-header h2 {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

.page-header h2,
.legacy-header h2,
.card-header h3,
.card-header h4 {
    letter-spacing: 0;
}

.card,
.bg-white.overflow-hidden.shadow-sm,
.bg-white.shadow-sm,
.bg-white {
    border: 1px solid #e2e9ee;
}

.card:hover {
    box-shadow: var(--shadow-card);
}

.card-body,
.p-6 {
    min-width: 0;
}

.stats-grid {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    align-items: stretch;
}

.stat-card {
    border-left-width: 3px;
    padding: 1rem;
}

.stat-card:hover {
    transform: none;
}

.stat-card .stat-icon {
    width: 36px;
    height: 36px;
    font-size: 0;
}

.stat-card .stat-icon .menu-icon,
.stat-card .stat-icon {
    color: inherit;
}

.stat-card .stat-label {
    letter-spacing: 0.04em;
}

.stat-card .stat-value {
    font-size: 1.55rem;
}

.btn,
button.btn,
a.btn {
    min-height: 38px;
    border-radius: 8px;
    justify-content: center;
    white-space: nowrap;
}

.btn-primary,
.bg-blue-500 {
    background: var(--verde-principal) !important;
}

.btn-secondary {
    background: var(--azul-institucional);
}

.btn-outline {
    background: #fff;
}

.table-container {
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.table-container table,
table.min-w-full {
    min-width: 680px;
}

table th {
    color: #617083;
    letter-spacing: 0.04em;
    white-space: nowrap;
}

table td {
    vertical-align: middle;
}

table .actions,
td:last-child {
    white-space: nowrap;
}

.badge,
.rounded-full {
    border-radius: 999px;
    text-transform: capitalize;
}

.form-control,
input[type="text"],
input[type="email"],
input[type="password"],
input[type="date"],
input[type="number"],
select,
textarea {
    min-height: 42px;
    border-color: #ccd8e0;
    border-radius: 8px;
}

.form-actions {
    flex-wrap: wrap;
}

.empty-state {
    min-height: 180px;
    display: grid;
    place-items: center;
    align-content: center;
}

.empty-state .empty-icon {
    width: 46px;
    height: 46px;
    margin: 0 auto 0.75rem;
    color: #718096;
    font-size: 0;
}

.empty-state .empty-icon::before {
    content: "";
    width: 46px;
    height: 46px;
    display: block;
    background: currentColor;
    -webkit-mask: var(--icon) center / contain no-repeat;
    mask: var(--icon) center / contain no-repeat;
    --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M4 19h16v2H2V3h2v16Zm3-2V9h3v8H7Zm5 0V5h3v12h-3Zm5 0v-6h3v6h-3Z'/%3E%3C/svg%3E");
}

.alert {
    border: 1px solid transparent;
}

.alert-list {
    margin: 0.25rem 0 0 1.25rem;
}

.hidden {
    display: none !important;
}

@media (max-width: 860px) {
    .sidebar {
        width: min(86vw, 300px);
        transform: translateX(-100%);
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .topbar-toggle {
        display: grid;
    }

    .main-content {
        margin-left: 0;
        width: 100%;
    }

    .topbar {
        height: 60px;
        padding: 0 0.85rem;
    }

    .topbar-left {
        min-width: 0;
        gap: 0.5rem;
    }

    .topbar-title {
        overflow: hidden;
        white-space: nowrap;
        text-overflow: ellipsis;
    }

    .topbar-user span {
        display: none;
    }

    .page-content {
        padding: 1rem;
    }

    .page-header,
    .legacy-header h2 {
        align-items: stretch;
    }

    .legacy-header h2 .btn,
    .legacy-header h2 a {
        float: none !important;
        width: 100%;
    }

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

    .stat-card {
        padding: 0.85rem;
    }

    .stat-card .stat-value {
        font-size: 1.35rem;
    }

    .card {
        margin-bottom: 1rem;
    }

    .card-header,
    .card-body {
        padding: 1rem;
    }

    .filters-bar .form-group,
    .filters-bar .btn {
        width: 100%;
    }

    .form-actions,
    .flex.justify-end {
        flex-direction: column-reverse;
        align-items: stretch;
    }

    .form-actions .btn,
    .flex.justify-end .btn,
    .flex.justify-end a,
    .flex.justify-end button {
        width: 100%;
        margin-right: 0 !important;
    }
}

@media (max-width: 420px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}

.info-item {
    min-width: 0;
    padding: 0.85rem;
    background: #f7fafc;
    border: 1px solid #e2e9ee;
    border-radius: 8px;
}

.info-item .label {
    margin-bottom: 0.25rem;
    color: var(--cinza-medio);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.info-item .value {
    color: var(--texto-escuro);
    font-weight: 600;
    overflow-wrap: anywhere;
}

.info-wide {
    grid-column: 1 / -1;
}

.qrcode-preview {
    display: grid;
    justify-items: center;
    gap: 0.35rem;
    margin-bottom: 1rem;
    text-align: center;
}

.qrcode-preview img {
    width: min(260px, 100%);
    aspect-ratio: 1;
    object-fit: contain;
    padding: 0.75rem;
    border: 1px solid #dce4ea;
    border-radius: 8px;
    background: #fff;
}

.qrcode-preview strong {
    font-size: 1rem;
    color: var(--texto-escuro);
}

.qrcode-preview span {
    color: var(--cinza-medio);
    font-size: 0.85rem;
}

.qrcode-actions {
    align-items: stretch;
}

.qrcode-actions .btn {
    flex: 1 1 150px;
}

.qr-reader-card {
    grid-column: span 2;
}

.qr-camera-panel {
    margin-top: 1rem;
}

.qr-camera-panel[hidden] {
    display: none !important;
}

.qr-camera-frame {
    position: relative;
    overflow: hidden;
    width: min(520px, 100%);
    aspect-ratio: 4 / 3;
    border: 1px solid #c9d6df;
    border-radius: 8px;
    background: #101820;
}

.qr-camera-frame video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.qr-scan-box {
    position: absolute;
    inset: 18%;
    border: 3px solid rgba(255, 255, 255, 0.9);
    border-radius: 8px;
    box-shadow: 0 0 0 999px rgba(0, 0, 0, 0.34);
}

.qr-scan-box::before,
.qr-scan-box::after {
    content: "";
    position: absolute;
    left: 10%;
    right: 10%;
    height: 2px;
    background: rgba(255, 213, 26, 0.95);
}

.qr-scan-box::before {
    top: 18%;
}

.qr-scan-box::after {
    bottom: 18%;
}

.qr-camera-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-top: 0.75rem;
    color: var(--cinza-medio);
    font-size: 0.85rem;
}

#qr-reader-status[data-type="success"] {
    color: var(--verde-principal);
    font-weight: 700;
}

#qr-reader-status[data-type="warning"] {
    color: var(--laranja-warning);
    font-weight: 700;
}

#qr-reader-status[data-type="error"] {
    color: var(--vermelho);
    font-weight: 700;
}

.qr-token-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0.75rem;
}

.qr-token-row input {
    text-align: center;
    font-size: 1rem;
    letter-spacing: 0.04em;
}

@media (max-width: 640px) {
    .qr-reader-card {
        grid-column: span 1;
    }

    .qr-token-row {
        grid-template-columns: 1fr;
    }

    .qr-camera-frame {
        width: 100%;
    }

    .qr-camera-actions {
        align-items: stretch;
        flex-direction: column;
    }

    .qr-camera-actions .btn {
        width: 100%;
    }
}

@media (max-width: 640px) {
    .info-grid {
        grid-template-columns: 1fr;
    }
}

/* === LOGIN INSTITUCIONAL === */
.auth-body {
    min-height: 100vh;
    background:
        radial-gradient(circle at 20% 20%, rgba(255, 213, 26, 0.18), transparent 28%),
        linear-gradient(135deg, #064e3b 0%, #008b5a 48%, #0877b9 100%);
    font-family: Figtree, "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
    color: #1f2937;
}

.auth-page {
    min-height: 100vh;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 430px;
    gap: 3rem;
    align-items: center;
    width: min(1120px, calc(100% - 2rem));
    margin: 0 auto;
    padding: 2rem 0;
}

.auth-panel {
    color: #fff;
}

.auth-brand {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    margin-bottom: 2rem;
}

.auth-logo-wrap {
    width: 86px;
    height: 86px;
    flex: 0 0 86px;
    display: grid;
    place-items: center;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 22px 50px rgba(0, 0, 0, 0.18);
    overflow: hidden;
}

.brand-mark img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.auth-logo-wrap img {
    max-width: 76px;
    max-height: 76px;
    object-fit: contain;
}

.auth-logo-fallback {
    display: none;
    width: 100%;
    height: 100%;
    place-items: center;
    color: #008b5a;
    font-size: 1.7rem;
    font-weight: 800;
}

.auth-brand p {
    margin-bottom: 0.35rem;
    color: rgba(255, 255, 255, 0.78);
    font-size: 0.92rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.auth-brand h1 {
    margin-bottom: 0.35rem;
    color: #fff;
    font-size: clamp(2rem, 5vw, 3.6rem);
    line-height: 1;
    font-weight: 800;
    letter-spacing: 0;
}

.auth-brand span {
    display: block;
    max-width: 620px;
    color: rgba(255, 255, 255, 0.86);
    font-size: 1.05rem;
    line-height: 1.5;
}

.auth-highlights {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.85rem;
}

.auth-highlights div {
    min-height: 118px;
    padding: 1rem;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(10px);
}

.auth-highlights strong {
    display: block;
    margin-bottom: 0.45rem;
    color: #fff;
    font-size: 0.95rem;
}

.auth-highlights span {
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.86rem;
    line-height: 1.45;
}

.auth-card {
    padding: 2rem;
    border: 1px solid rgba(255, 255, 255, 0.72);
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 28px 70px rgba(6, 78, 59, 0.28);
}

.auth-card-header {
    margin-bottom: 1.5rem;
}

.auth-card-header h2 {
    margin-bottom: 0.35rem;
    color: #1f2937;
    font-size: 1.45rem;
    font-weight: 800;
    letter-spacing: 0;
}

.auth-card-header p {
    color: #6b7280;
    font-size: 0.94rem;
}

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

.auth-form label,
.auth-remember {
    color: #1f2937;
}

.auth-form .form-control {
    min-height: 48px;
    border-color: #d1d9e0;
    background: #f9fbfc;
}

.auth-form .form-control:focus {
    background: #fff;
}

.auth-remember {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    margin: 0.25rem 0 1.25rem;
    font-size: 0.9rem;
}

.auth-remember input {
    width: 16px;
    height: 16px;
    accent-color: #008b5a;
}

.auth-submit {
    width: 100%;
    min-height: 48px;
    font-size: 0.98rem;
    font-weight: 800;
    background: #008b5a !important;
}

.auth-status {
    margin-bottom: 1rem;
    color: #065f46;
    font-size: 0.9rem;
}

@media (max-width: 900px) {
    .auth-page {
        grid-template-columns: 1fr;
        gap: 1.5rem;
        align-items: start;
        padding: 1.25rem 0;
    }

    .auth-brand {
        align-items: flex-start;
        margin-bottom: 1rem;
    }

    .auth-highlights {
        grid-template-columns: 1fr;
    }

    .auth-highlights div {
        min-height: auto;
    }

    .auth-card {
        padding: 1.25rem;
    }
}

@media (max-width: 520px) {
    .auth-brand {
        flex-direction: column;
    }

    .auth-logo-wrap {
        width: 72px;
        height: 72px;
        flex-basis: 72px;
    }
}
