/* Google Gemini Style Dashboard */
@import url('https://fonts.googleapis.com/css2?family=Google+Sans:wght@400;500;700&display=swap');

/* Base Styles */
* {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
    height: 100%;
    font-family: 'Google Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    color: #202124;
    background-color: #fafafa;
}

/* Layout Principal */
.app-container {
    display: flex;
    height: 100vh;
    overflow: hidden;
}

/* Sidebar */
.sidebar {
    width: 280px;
    background: #1f1f1f;
    color: #e8eaed;
    display: flex;
    flex-direction: column;
    position: fixed;
    left: 0;
    top: 0;
    height: 100vh;
    z-index: 1000;
    transition: width 0.3s ease, transform 0.3s ease;
}

.sidebar.collapsed {
    width: 80px;
}

.sidebar-brand {
    padding: 0 24px;
    border-bottom: 1px solid #333;
    display: flex;
    align-items: center;
    gap: 12px;
    height: 64px;
    box-sizing: border-box;
    position: relative;
}

.sidebar-brand h1 {
    font-size: 1.375rem;
    font-weight: 500;
    margin: 0;
    color: #e8eaed;
}

.sidebar-brand .brand-icon img {
    width: 150px;
    height: auto;
    margin-left: -12px;
}

.sidebar-brand .brand-text {
    transition: all 0.3s ease;
}

.sidebar.collapsed .brand-text {
    display: none;
}


.sidebar-toggle-btn {
    background: none;
    border: none;
    color: #e8eaed;
    font-size: 16px;
    cursor: pointer;
    margin-left: auto;
    padding: 12px 16px;
    border-radius: 12px;
    transition: all 0.2s ease;
}

.sidebar-toggle-btn:hover {
    background-color: rgba(232, 234, 237, 0.08);
}

.sidebar.collapsed .brand-icon {
    display: none;
}


.sidebar.collapsed .sidebar-brand {
    justify-content: center;
    gap: 0;
    padding: 0;
    margin: 4px 12px;
}

.sidebar.collapsed .sidebar-toggle-btn {
    position: static;
    margin: 0;
    padding: 12px 16px;
    font-size: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
}

/* Menu de Navegação */
.sidebar-nav {
    flex: 1;
    padding: 8px 0;
    overflow-y: auto;
}

.nav-item {
    margin: 4px 12px;
}

.nav-link {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    color: #e8eaed;
    text-decoration: none;
    border-radius: 12px;
    transition: all 0.2s ease;
    font-weight: 400;
    gap: 16px;
}

.nav-link:hover {
    background-color: rgba(232, 234, 237, 0.08);
    color: #e8eaed;
    text-decoration: none;
}

.nav-link.active {
    background-color: #1a73e8;
    color: white;
}

.nav-link i {
    width: 20px;
    font-size: 20px;
    text-align: center;
}

.nav-text {
    transition: all 0.3s ease;
}

.sidebar.collapsed .nav-text {
    display: none;
}

.sidebar.collapsed .nav-link {
    justify-content: center;
    padding: 12px;
}

.sidebar.collapsed .nav-item {
    margin: 4px 12px;
}

/* Área Principal */
.main-content {
    margin-left: 280px;
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: margin-left 0.3s ease;
}

/* Header */
.main-header {
    background: white;
    border-bottom: 1px solid #e8eaed;
    padding: 0 32px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 1px 3px rgba(60, 64, 67, 0.12);
}

.header-title {
    font-size: 1.375rem;
    font-weight: 400;
    margin: 0;
    color: #202124;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

.header-time {
    color: #5f6368;
    font-size: 0.875rem;
}

/* Conteúdo */
.content-area {
    flex: 1;
    padding: 32px;
    overflow-y: auto;
    background: #fafafa;
}

/* Cards estilo Google */
.gemini-card {
    background: white;
    border-radius: 12px;
    border: 1px solid #e8eaed;
    box-shadow: 0 1px 3px rgba(60, 64, 67, 0.12);
    transition: box-shadow 0.2s ease;
}

.gemini-card:hover {
    box-shadow: 0 2px 8px rgba(60, 64, 67, 0.15);
}

.card-header {
    padding: 20px 24px 16px;
    border-bottom: none;
}

.gemini-card:not(.dashboard-card) .card-header {
    border-bottom: 1px solid #f1f3f4;
}

/* Cards - HR customizado */
.gemini-card.dashboard-card hr,
.vehicle-card hr {
    opacity: 1;
    border-color: #f1f3f4;
    margin: 0.5rem auto;
}

.card-title {
    font-size: 1.125rem;
    font-weight: 500;
    margin: 0;
    color: #202124;
}

.card-body {
    padding: 20px 24px;
}

/* Cards da Dashboard com altura padronizada */
.dashboard-card {
    height: 400px;
    display: flex;
    flex-direction: column;
}

.dashboard-card .card-header {
    flex-shrink: 0;
}

.dashboard-card-body {
    flex: 1;
    overflow-y: auto;
    max-height: calc(400px - 60px); /* 400px total - header height */
}

.dashboard-card-body::-webkit-scrollbar {
    width: 6px;
}

.dashboard-card-body::-webkit-scrollbar-track {
    background: #f1f3f4;
    border-radius: 3px;
}

.dashboard-card-body::-webkit-scrollbar-thumb {
    background: #dadce0;
    border-radius: 3px;
}

.dashboard-card-body::-webkit-scrollbar-thumb:hover {
    background: #bdc1c6;
}

/* KPI Cards */
.kpi-card {
    background: white;
    border-radius: 12px;
    border: 1px solid #e8eaed;
    padding: 24px;
    transition: all 0.2s ease;
}

.kpi-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(60, 64, 67, 0.15);
}

.kpi-value {
    font-size: 2.5rem;
    font-weight: 500;
    margin: 0 0 8px 0;
    color: #1a73e8;
}

.kpi-label {
    color: #5f6368;
    font-size: 0.875rem;
    margin: 0;
}

.kpi-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: white;
    margin-bottom: 16px;
}

.kpi-icon.primary { background: linear-gradient(45deg, #1a73e8, #4285f4); }
.kpi-icon.success { background: linear-gradient(45deg, #34a853, #137333); }
.kpi-icon.warning { background: linear-gradient(45deg, #fbbc04, #f29900); }
.kpi-icon.info { background: linear-gradient(45deg, #4285f4, #1a73e8); }

/* KPI Icons - Plain (without background) */
.kpi-icon-plain {
    font-size: 24px;
    margin-bottom: 16px;
    display: block;
}

/* Google-style KPI Cards */
.kpi-card-google {
    background: #ffffff;
    border: 1px solid #e8eaed;
    border-radius: 12px;
    padding: 16px;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    box-shadow: 0 1px 3px rgba(60, 64, 67, 0.12);
    transition: box-shadow 0.2s ease;
    position: relative;
}

.kpi-card-google:hover {
    box-shadow: 0 2px 8px rgba(60, 64, 67, 0.15);
}

.kpi-content {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.kpi-number {
    font-size: 28px;
    font-weight: 500;
    color: #202124;
    line-height: 1.1;
    font-family: 'Segoe UI', Roboto, -apple-system, BlinkMacSystemFont, sans-serif;
}

.kpi-text {
    font-size: 14px;
    color: #5f6368;
    font-weight: 400;
    line-height: 1.2;
    font-family: 'Segoe UI', Roboto, -apple-system, BlinkMacSystemFont, sans-serif;
}

.kpi-icon-google {
    font-size: 18px;
}

.kpi-icon-google.fa-car {
    color: #1a73e8;
}

.kpi-icon-google.fa-check-circle {
    color: #34a853;
}

.kpi-icon-google.fa-wrench {
    color: #fbbc04;
}

.kpi-icon-google.fa-gas-pump {
    color: #4285f4;
}

.kpi-icon-google.fa-warehouse {
    color: #34a853;
}

.kpi-icon-google.fa-route {
    color: #4285f4;
}

/* Alertas */
.alert {
    border: none;
    border-radius: 8px;
    padding: 12px 16px;
    margin-bottom: 12px;
}

.alert-success {
    background: #e6f4ea;
    color: #137333;
}

.alert-warning {
    background: #fef7e0;
    color: #b26b00;
}

.alert-danger {
    background: #fce8e6;
    color: #d93025;
}

.alert-info {
    background: #e8f0fe;
    color: #1a73e8;
}

/* Container de Alertas com Scroll */
.alerts-container {
    max-height: 260px;
    min-height: 50px;
    overflow-y: auto;
    margin-bottom: 12px;
    scrollbar-width: thin;
    scrollbar-color: #dadce0 transparent;
}

.alerts-container::-webkit-scrollbar {
    width: 6px;
}

.alerts-container::-webkit-scrollbar-track {
    background: transparent;
}

.alerts-container::-webkit-scrollbar-thumb {
    background-color: #dadce0;
    border-radius: 3px;
}

.alerts-container::-webkit-scrollbar-thumb:hover {
    background-color: #bdc1c6;
}


/* Responsividade */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }
    
    .sidebar.show {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .main-header {
        padding: 0 16px;
    }
    
    .content-area {
        padding: 16px;
    }
}

/* Menu Toggle Mobile */
.menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 24px;
    color: #5f6368;
    cursor: pointer;
}

/* Tablets (768px - 991px) - Ajustes mínimos */
@media (max-width: 991px) {
    .dashboard-card {
        height: 350px;
    }
    
    .content-area {
        padding: 20px;
    }
    
    .dashboard-card-body {
        max-height: calc(350px - 60px);
    }
}

/* Mobile (<=767px) - Adaptações naturais */
@media (max-width: 767px) {
    .menu-toggle {
        display: block;
    }
    
    /* Em mobile, desabilitar o comportamento collapsed */
    .sidebar.collapsed {
        width: 280px !important;
        transform: translateX(-100%);
    }
    
    .sidebar.collapsed.show {
        transform: translateX(0);
        width: 280px !important;
    }
    
    /* Forçar sidebar a ser completamente escondido em mobile */
    .sidebar:not(.show) {
        transform: translateX(-100%) !important;
    }
    
    .main-content {
        margin-left: 0 !important;
    }
    
    .dashboard-card {
        height: auto;
        min-height: 280px;
    }
    
    .dashboard-card-body {
        max-height: none;
        min-height: 200px;
    }
    
    .kpi-value {
        font-size: 2rem;
    }
    
    .card-title {
        font-size: 1rem;
    }
    
    .row.g-4 {
        gap: 1.5rem !important;
    }
}

/* Mobile Pequeno (<=575px) - Refinamentos */
@media (max-width: 575px) {
    .col-md-3 {
        width: 100% !important;
        margin-bottom: 1rem;
    }
    
    .content-area {
        padding: 12px;
    }
    
    .card-body,
    .dashboard-card-body {
        padding: 16px;
    }
    
    .kpi-value {
        font-size: 1.8rem;
    }
    
    .kpi-card {
        padding: 16px;
    }
    
    .row.g-4 {
        gap: 1rem !important;
    }
}

/* Página de Veículos */
.page-header {
    margin-bottom: 2rem;
}

.page-title {
    font-size: 2rem;
    font-weight: 500;
    color: #202124;
    margin: 0;
}

.page-subtitle {
    font-size: 1rem;
    margin: 0.5rem 0 0 0;
}

/* Componente de Busca */
.search-filters-card {
    background: white;
    border-radius: 12px;
    border: 1px solid #e8eaed;
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: 0 1px 3px rgba(60, 64, 67, 0.12);
}

.search-input-group {
    position: relative;
}

.search-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: #5f6368;
    font-size: 16px;
    z-index: 2;
}

.search-input {
    padding-left: 48px !important;
    padding-right: 48px !important;
    border: 1px solid #dadce0;
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.2s ease;
}

.search-input:hover {
    border-color: #86b7fe;
}

.search-input:focus {
    border-color: #1a73e8;
    box-shadow: 0 0 0 3px rgba(26, 115, 232, 0.1);
}

.btn-clear-search {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #5f6368;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: background-color 0.2s ease;
}

.btn-clear-search:hover {
    background-color: rgba(95, 99, 104, 0.1);
}

.results-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* Estado Vazio */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
}

/* Grid de Veículos */
.vehicles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 24px;
}

/* Cards de Veículos */
.vehicle-card {
    background: white;
    border-radius: 12px;
    border: 1px solid #e8eaed;
    transition: all 0.2s ease;
    overflow: hidden;
}

.vehicle-card:hover {
    box-shadow: 0 4px 12px rgba(60, 64, 67, 0.15);
    transform: translateY(-2px);
}

.vehicle-card-header {
    padding: 20px 24px 16px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.vehicle-id .vehicle-placa {
    font-size: 1.25rem;
    font-weight: 600;
    color: #202124;
    margin: 0 0 4px 0;
}

.vehicle-code {
    font-size: 0.875rem;
    color: #5f6368;
    font-weight: 500;
}

.location-badge {
    font-size: 0.75rem;
    font-weight: 500;
    padding: 4px 8px;
    border-radius: 6px;
    text-transform: uppercase;
}

.location-patio {
    background: #e6f4ea;
    color: #137333;
}

.location-viagem {
    background: #e8f0fe;
    color: #1565c0;
}

.location-oficina {
    background: #fef7e0;
    color: #b26b00;
}

.vehicle-card-body {
    padding: 16px 24px;
}

.vehicle-description {
    font-size: 1rem;
    font-weight: 500;
    color: #202124;
    margin: 0 0 4px 0;
}

.vehicle-type {
    font-size: 0.875rem;
    color: #5f6368;
    font-weight: 400;
}

.vehicle-info-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
    margin-top: 16px;
}

.info-item {
    display: flex;
    align-items: center;
    gap: 12px;
}

.info-item i {
    width: 16px;
    font-size: 16px;
}

.info-label {
    flex: 1;
    font-size: 0.875rem;
    color: #5f6368;
    font-weight: 400;
}

.info-value {
    font-size: 0.875rem;
    color: #202124;
    font-weight: 500;
    min-width: 80px;
    text-align: right;
}

.vehicle-card-footer {
    padding: 16px 24px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.vehicle-alerts {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.btn-ver-detalhes {
    background: transparent;
    border: none;
    color: #5f6368;
    font-size: 0.875rem;
    font-weight: 400;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    transition: background-color 0.2s ease;
    white-space: nowrap;
}

.btn-ver-detalhes:hover {
    background-color: rgba(95, 99, 104, 0.08);
    text-decoration: none;
}

.alert-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.75rem;
    font-weight: 500;
    padding: 4px 8px;
    border-radius: 6px;
    text-transform: uppercase;
}

.alert-danger {
    background: #fce8e6;
    color: #d93025;
}

.alert-warning {
    background: #fef7e0;
    color: #b26b00;
}

.alert-secondary {
    background: #f1f3f4;
    color: #5f6368;
}

/* Responsividade para página de veículos */
@media (max-width: 991px) {
    .vehicles-grid {
        grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
        gap: 20px;
    }
    
    .page-title {
        font-size: 1.75rem;
    }
}

@media (max-width: 767px) {
    .vehicles-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    .search-filters-card {
        padding: 16px;
    }
    
    .vehicle-card-header,
    .vehicle-card-body,
    .vehicle-card-footer {
        padding-left: 16px;
        padding-right: 16px;
    }
    
    .vehicle-card-footer {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
    
    .btn-ver-detalhes {
        align-self: flex-end;
    }
    
    .results-summary {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
    
    .page-title {
        font-size: 1.5rem;
    }
}

@media (max-width: 575px) {
    .search-filters-card .row {
        gap: 16px !important;
    }
    
    .empty-state {
        padding: 3rem 1rem;
    }
}

/* Estilos para ícones de veículos */
.vehicle-header-with-icon {
    display: flex;
    align-items: center;
    gap: 12px;
}

.vehicle-type-icon {
    font-size: 24px;
    width: 32px;
    text-align: center;
    flex-shrink: 0;
}

.vehicle-icon-leve {
    color: #1a73e8;
}

.vehicle-icon-pesado {
    color: #137333;
}

.vehicle-icon-maquina {
    color: #f57c00;
}

.vehicle-icon-default {
    color: #5f6368;
}

.vehicle-info {
    flex: 1;
    min-width: 0;
}

/* Componente User Profile */
.user-profile-container {
    position: relative;
}

.user-profile-button {
    background: #1a73e8;
    border: none;
    padding: 8px;
    border-radius: 50%;
    cursor: pointer;
    transition: background-color 0.2s ease;
    color: white;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.user-profile-button:hover {
    background-color: #1557b0;
}

.user-avatar-img {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    object-fit: cover;
}

.user-popup-avatar-img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
}

.user-avatar-initials {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: white;
    color: #1a73e8;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 500;
    font-size: 0.75rem;
}

.user-popup-avatar-initials {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #1a73e8, #4285f4);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 500;
    font-size: 1rem;
}


.user-popup {
    min-width: 250px;
    z-index: 1000;
    animation: popupFadeIn 0.2s ease-out;
    box-shadow: 0 4px 20px rgba(60, 64, 67, 0.2) !important;
}

.user-popup .dropdown-item {
    border-radius: 12px;
    margin: 8px 0 4px 0;
    padding: 8px 12px;
    transition: all 0.2s ease;
}

.user-popup .dropdown-item:hover {
    background-color: rgba(0, 0, 0, 0.05);
}

.user-popup-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 999;
    background: transparent;
}

@keyframes popupFadeIn {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}


.user-popup-badge {
    display: inline-block;
    background: #e8f0fe;
    color: #1a73e8;
    font-size: 0.75rem;
    font-weight: 500;
    padding: 2px 6px;
    border-radius: 4px;
    margin-top: 2px;
}

/* Responsividade para User Profile */
@media (max-width: 767px) {
    .user-popup {
        right: -12px;
        min-width: 240px;
    }
}

/* Utilities */
.text-muted {
    color: #5f6368 !important;
}

.d-flex {
    display: flex !important;
}

.align-items-center {
    align-items: center !important;
}

.justify-content-between {
    justify-content: space-between !important;
}

.gap-3 {
    gap: 1rem !important;
}

.mb-4 {
    margin-bottom: 1.5rem !important;
}

.me-2 {
    margin-right: 0.5rem !important;
}

/* Hover effect para form-control (inputs date, text, number, etc) */
.form-control:hover:not(:focus):not(:disabled),
input[type="date"]:hover:not(:focus):not(:disabled),
input[type="time"]:hover:not(:focus):not(:disabled),
input[type="number"]:hover:not(:focus):not(:disabled),
input[type="text"]:hover:not(:focus):not(:disabled),
.search-filters-card .form-control:hover:not(:focus) {
    border-color: #86b7fe !important;
    transition: border-color 0.15s ease-in-out;
}

/* Ocultar banner de erro - erros de extensões não afetam a aplicação */
#blazor-error-ui {
    display: none !important;
}