﻿
/* APR Cargo Group - Dashboard */

.dashboard {
    --navy: #102a4c;
    --blue: #2f6690;
    --muted: #64748b;
    --border: #e2e8f0;
    color: #172b43;
    padding: 28px 0 16px;
}

.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 20px;
    margin-bottom: 26px;
}

.eyebrow {
    color: #47749a;
    font-size: .72rem;
    font-weight: 800;
    letter-spacing: .13em;
    margin-bottom: 9px;
}

.dashboard h1 {
    color: var(--navy);
    font-size: clamp(1.8rem, 3vw, 2.35rem);
    font-weight: 750;
    letter-spacing: -.04em;
    margin: 0 0 8px;
}

.subtitle,
.panel-heading p,
.table-heading p {
    color: var(--muted);
    margin: 0;
    font-size: .92rem;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.demo-label {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    background: #fff7e6;
    color: #986316;
    border: 1px solid #f4dfb5;
    border-radius: 999px;
    padding: 8px 12px;
    font-size: .7rem;
    font-weight: 800;
    letter-spacing: .06em;
}

    .demo-label span {
        width: 7px;
        height: 7px;
        background: #e6a23c;
        border-radius: 50%;
    }

.btn-refresh {
    background: #fff;
    color: var(--navy);
    border: 1px solid var(--border);
    border-radius: 9px;
    padding: 9px 13px;
    font-size: .85rem;
    font-weight: 650;
    cursor: pointer;
}

    .btn-refresh:hover {
        background: #f8fafc;
    }

/* Filtros */

.filters {
    display: grid;
    grid-template-columns: 1fr 1fr 1.6fr;
    gap: 14px;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 16px;
    margin-bottom: 18px;
    box-shadow: 0 4px 16px rgba(15, 42, 76, .025);
}

    .filters label {
        display: flex;
        flex-direction: column;
        gap: 7px;
        min-width: 0;
    }

        .filters label > span {
            color: #475569;
            font-size: .77rem;
            font-weight: 700;
        }

    .filters select,
    .filters input {
        width: 100%;
        min-width: 0;
        border: 1px solid #dbe3ec;
        background: #fff;
        border-radius: 8px;
        padding: 10px 11px;
        color: #263b53;
        font-size: .88rem;
        outline: none;
    }

        .filters select:focus,
        .filters input:focus {
            border-color: #6c9bc1;
            box-shadow: 0 0 0 3px rgba(47, 102, 144, .1);
        }

/* Tarjetas de indicadores */

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

.kpi-card,
.panel {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 14px;
    box-shadow: 0 5px 20px rgba(15, 42, 76, .035);
}

.kpi-card {
    padding: 19px 20px 17px;
}

.kpi-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: #64748b;
    font-size: .84rem;
    font-weight: 650;
}

.kpi-icon {
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border-radius: 10px;
    color: var(--blue);
    background: #edf4f9;
    font-size: 1.1rem;
    font-weight: 800;
}

.kpi-value {
    color: var(--navy);
    font-size: 2rem;
    font-weight: 780;
    line-height: 1.2;
    margin: 12px 0 5px;
    letter-spacing: -.04em;
}

.kpi-caption {
    color: #8290a2;
    font-size: .78rem;
}

.attention-card .kpi-icon {
    color: #a76d17;
    background: #fff5df;
}

/* Gráficas */

.analytics-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr);
    gap: 18px;
    margin-bottom: 18px;
}

.panel {
    min-width: 0;
    overflow: hidden;
}

.chart-panel {
    padding: 20px 21px 14px;
}

.panel-heading h2,
.table-heading h2 {
    color: var(--navy);
    font-size: 1.05rem;
    font-weight: 750;
    margin: 0 0 5px;
}

.panel-heading p,
.table-heading p {
    font-size: .8rem;
}

.chart-wrap {
    height: 260px;
    position: relative;
    margin-top: 16px;
}

.doughnut-wrap {
    height: 230px;
}

.chart-note {
    text-align: center;
    color: #94a3b8;
    font-size: .72rem;
    padding: 0 0 5px;
}

/* Tabla de embarques */

.shipments-panel {
    margin-bottom: 20px;
}

.table-heading {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 20px 21px 16px;
}

.table-tag {
    white-space: nowrap;
    color: #51728f;
    background: #edf4f9;
    border-radius: 6px;
    padding: 7px 9px;
    font-size: .68rem;
    font-weight: 800;
    letter-spacing: .06em;
}

.table-scroll {
    overflow-x: auto;
}

#shipmentsTable {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: .81rem;
}

    #shipmentsTable th {
        text-align: left;
        white-space: nowrap;
        color: #64748b;
        background: #f8fafc;
        padding: 12px 15px;
        font-size: .7rem;
        text-transform: uppercase;
        letter-spacing: .04em;
        border-top: 1px solid #edf1f5;
        border-bottom: 1px solid #edf1f5;
    }

    #shipmentsTable td {
        padding: 14px 15px;
        color: #43566d;
        border-bottom: 1px solid #edf1f5;
        white-space: nowrap;
    }

    #shipmentsTable tbody tr:hover {
        background: #f8fbfd;
    }

    #shipmentsTable td strong {
        color: #1d4268;
        font-weight: 750;
    }

    #shipmentsTable tr[hidden] {
        display: none;
    }

.status {
    display: inline-block;
    border-radius: 6px;
    padding: 5px 7px;
    font-size: .7rem;
    font-weight: 750;
}

.status-ok {
    color: #287454;
    background: #eaf7f0;
}

.status-warn {
    color: #966318;
    background: #fff4dd;
}

.table-footer {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 13px 20px;
    color: #8a98a9;
    font-size: .73rem;
}

/* Pie de página */

.dashboard-footer {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 2px;
    color: #94a3b8;
    font-size: .73rem;
}

    .dashboard-footer span:first-child {
        color: #57738e;
        font-weight: 800;
        letter-spacing: .1em;
    }

/* Adaptación a pantallas pequeñas */

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

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

    .chart-wrap {
        height: 245px;
    }
}

@media (max-width: 640px) {
    .dashboard {
        padding-top: 16px;
    }

    .dashboard-header {
        flex-direction: column;
    }

    .header-actions {
        width: 100%;
        justify-content: space-between;
    }

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

    .kpi-grid {
        gap: 10px;
    }

    .kpi-card {
        padding: 15px;
    }

    .kpi-value {
        font-size: 1.7rem;
    }

    .table-heading,
    .table-footer,
    .dashboard-footer {
        align-items: flex-start;
        flex-direction: column;
    }
}
