/* ================================================================
   Fusión de wwwroot/app.css + los CSS "scoped" de los componentes
   Blazor originales (MainLayout, NavMenu, DashboardHeader,
   DashboardCards, DashboardMap, DashboardRecentTable), adaptados
   a HTML/JS plano con Bootstrap + Tabler icons.
   ================================================================ */

html, body {
    font-family: "Inter", "Helvetica Neue", Helvetica, Arial, sans-serif;
    background: #F5F7FB;
    color: #1F2937;
    margin: 0;
    padding: 0;
}

a { color: #006bb7; }

/* ===========================
   LAYOUT (MainLayout.razor.css)
=========================== */

.app-shell {
    display: flex;
    min-height: 100vh;
    background: #F5F7FB;
}

.sidebar {
    width: 250px;
    min-height: 100vh;
    position: sticky;
    top: 0;
    flex-shrink: 0;
    overflow: hidden;
    background: linear-gradient(180deg, #241E45 0%, #1A1633 100%);
    transition: width .25s ease;
    color: white;
}

.sidebar.collapsed { width: 72px; }

.shell-card {
    flex: 1;
    min-height: 100vh;
    background: white;
    min-width: 0;
}

.content {
    padding: 24px;
    width: 100%;
    box-sizing: border-box;
}

@media (max-width: 900px) {
    .content { padding: 16px; }
}

/* ===========================
   SIDEBAR / NAV (NavMenu.razor.css)
=========================== */

.sidebar-header { padding: 24px 18px 18px; }

.brand { display: flex; align-items: center; gap: 18px; }

.brand-title { font-size: 18px; font-weight: 700; color: white; line-height: 1.2; }

.menu { padding: 30px 12px 0; display: flex; flex-direction: column; }

.menu .nav-link {
    display: flex;
    align-items: center;
    gap: 14px;
    min-height: 48px;
    margin-bottom: 8px;
    padding: 12px 16px;
    border-radius: 12px;
    color: #C8CCE0;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    transition: all .2s ease;
}

.menu .nav-link i { min-width: 24px; font-size: 20px; }

.menu .nav-link:hover { background: rgba(255,255,255,.08); color: white; }

.menu .nav-link.disabled { opacity: .45; pointer-events: none; }

.sidebar.collapsed .brand-text { display: none; }
.sidebar.collapsed .menu .nav-link { justify-content: center; padding: 12px; }
.sidebar.collapsed .menu .nav-link span { display: none; }

/* ===========================
   DASHBOARD HEADER (DashboardHeader.razor.css)
=========================== */

.dashboard-header{

    display:flex;

    justify-content:space-between;

    align-items:flex-start;

    gap:24px;

    margin-bottom:24px;

    flex-wrap:wrap;
}

.dashboard-title h1{

    font-size:2rem;

    font-weight:700;

    margin-bottom:6px;
}

.dashboard-title .subtitulo{

    color:#6B7280;

    font-size:.90rem;
}

.dashboard-actions{

    display:flex;

    align-items:flex-start;

    justify-content:flex-end;

    gap:14px;
}

.filtro-item{

    position:relative;

    width:170px;
}

.filtro-item label{

    position:absolute;

    top:-8px;

    left:12px;

    padding:0 6px;

    margin:0;

    background:#fff;

    font-size:12px;

    font-weight:600;

    color:#5F6368;

    z-index:20;

    line-height:1;
}

.filtro-select{

    width:100%;

    height:48px;

    padding:18px 40px 8px 14px;

    border:1.5px solid #C8CDD3 !important;

    border-radius:6px !important;

    background:#fff;

    font-size:15px;

    font-weight:500;

    box-shadow:none !important;

    transition:.2s;
}

#filtroFundo{
    width:170px;
}

#filtroEstado{
    width:150px;
}

#filtroRetencion{
    width:170px;
}

#filtroFecha{
    width:170px;
}

.filtro-select:hover{

    border-color:#9CA3AF !important;
}

.filtro-select:focus{

    border-color:#2563EB !important;

    box-shadow:0 0 0 .18rem rgba(37,99,235,.15) !important;
}

@media (max-width: 768px) {
    .dashboard-actions {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
        gap: 10px;
        width: 100%;
    }
    .dashboard-actions select { width: 100%; min-width: auto; }
}

/* ===========================
   TARJETAS KPI DEL DASHBOARD (DashboardCards.razor.css)
=========================== */

.dashboard-cards-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 22px;
    width: 100%;
    margin-bottom: 24px;
}

.dashboard-card {
    position: relative;
    width: 100%;
    min-width: 0;
    background: #FFFFFF;
    border: 1px solid #E8EDF5;
    border-radius: 16px;
    overflow: hidden;
    height: 165px;
    transition: all .25s ease;
    box-shadow: 0 3px 12px rgba(15,23,42,.05);
}

.dashboard-card:hover { transform: translateY(-3px); box-shadow: 0 14px 30px rgba(15,23,42,.10); }

.dashboard-card-border { width: 100%; height: 4px; }

.dashboard-card-body { height: calc(100% - 4px); display: flex; flex-direction: column; padding: 12px 18px; }

.dashboard-card-header { display: flex; justify-content: space-between; align-items: center; }

.dashboard-card-content { flex: 1; display: flex; flex-direction: column; justify-content: center; margin-top: -6px; }

.dashboard-icon { width: 42px; height: 42px; border-radius: 50%; display: flex; align-items: center; justify-content: center; }
.dashboard-icon i { font-size: 20px; }

.dashboard-card-title { text-align: center; font-size: 13px; font-weight: 600; color: #4B5563; margin-bottom: 8px; }
.dashboard-card-value { text-align: center; font-size: 42px; font-weight: 800; line-height: 1; margin-bottom: 8px; }
.dashboard-card-description { text-align: center; font-size: 12px; color: #6B7280; font-weight: 500; }

.dashboard-badge { padding: 4px 10px; border-radius: 999px; font-size: 10px; font-weight: 700; }

.dashboard-purple { background: rgba(124,58,237,.12); color: #7C3AED; }
.dashboard-warning { background: rgba(245,158,11,.12); color: #F59E0B; }
.dashboard-success { background: rgba(34,197,94,.12); color: #22C55E; }
.dashboard-primary { background: rgba(37,99,235,.12); color: #2563EB; }
.dashboard-danger { background: rgba(239,68,68,.12); color: #EF4444; }

.dashboard-badge-purple { background: rgba(124,58,237,.10); color: #7C3AED; }
.dashboard-badge-warning { background: rgba(245,158,11,.10); color: #F59E0B; }
.dashboard-badge-success { background: rgba(34,197,94,.10); color: #22C55E; }
.dashboard-badge-primary { background: rgba(37,99,235,.10); color: #2563EB; }
.dashboard-badge-danger { background: rgba(239,68,68,.10); color: #EF4444; }

.bg-purple { background: #7C3AED; }
.bg-warning { background: #F59E0B; }
.bg-success { background: #22C55E; }
.bg-primary { background: #2563EB; }
.bg-danger { background: #EF4444; }

@media (max-width: 1600px) { .dashboard-cards-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 1000px) { .dashboard-cards-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 700px)  { .dashboard-cards-grid { grid-template-columns: 1fr; } }

/* ===========================
   MAPA / TABLA (DashboardMap.razor.css, DashboardRecentTable.razor.css)
=========================== */

.caja-mapa, .caja-tabla {
    background: white;
    border: 1px solid #E8EDF3;
    border-radius: 16px;
    padding: 20px;
    margin-top: 20px;
    box-shadow: 0 2px 8px rgba(15,23,42,.05);
}

.caja-titulo { font-size: 16px; font-weight: 700; color: #1F2937; margin-bottom: 18px; }

.leaflet-container { border-radius: 12px; }

.sortable-header { cursor: pointer !important; user-select: none; transition: background-color .18s ease; white-space: nowrap; }
.sortable-header:hover { background: #DCEEFF; }
.sortable-header i { font-size: 14px; margin-left: 4px; }

.badge-pill {
    display: inline-block;
    color: white;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
}

.fila-acopio { cursor: pointer; }

/* ===========================
   TRANSPORTE (TransporteHeader / TransporteCards / TiempoChartCard)
=========================== */

.filtro-panel {
    background: white;
    border: 1px solid #E8EDF3;
    border-radius: 18px;
    padding: 14px 18px;
    box-shadow: 0 2px 8px rgba(15,23,42,.05);
}

.actualizacion { display: flex; flex-direction: column; justify-content: center; height: 100%; }
.actualizacion-titulo { font-size: 12px; color: #6B7280; font-weight: 600; }
.actualizacion-fecha { font-size: 15px; font-weight: 600; color: #111827; }

.kpi-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 18px;
    margin: 20px 0;
}

@media (max-width: 1200px) { .kpi-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 768px)  { .kpi-grid { grid-template-columns: 1fr; } }

.kpi-card {
    height: 140px;
    border-radius: 18px;
    border: 1px solid #E5E7EB;
    background: white;
    box-shadow: 0 2px 8px rgba(0,0,0,.06);
    transition: .2s;
    padding: 16px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.kpi-card:hover { transform: translateY(-3px); box-shadow: 0 8px 20px rgba(0,0,0,.12); }
.kpi-top { display: flex; }
.kpi-value { font-size: 28px; font-weight: 800; margin-top: 8px; }
.kpi-label { font-size: 13px; color: #6B7280; margin-top: 2px; }

.chart-card {
    height: 300px;
    padding: 15px;
    border-radius: 16px;
    border: 1px solid #E7ECF4;
    background: white;
}

.chart-title { text-align: center; font-size: 14px; font-weight: 700; color: #1F2937; margin-bottom: 10px; }
