html {
    font-size: 14px;
}

body {
    margin: 0;
    background-color: #f5f7fa;
    color: #212529;
    font-family: "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
}


/* ========================================================= */
/* APP */
/* ========================================================= */

.app-wrapper {
    min-height: 100vh;
    display: flex;
}


/* ========================================================= */
/* SIDEBAR */
/* ========================================================= */

.sidebar {
    width: 250px;
    min-width: 250px;
    min-height: 100vh;
    background: #18212f;
    color: #ffffff;
    display: flex;
    flex-direction: column;
    transition: all 0.25s ease;
}


/* ========================================================= */
/* BRAND */
/* ========================================================= */

.sidebar-brand {
    height: 75px;
    display: flex;
    align-items: center;
    padding: 0 20px;
    border-bottom: 1px solid rgba(255,255,255,.08);
}

    .sidebar-brand > a {
        display: flex;
        align-items: center;
        width: 100%;
    }

.brand-logo {
    width: 42px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

    .brand-logo img {
        width: 42px;
        height: 42px;
        object-fit: contain;
    }

.brand-text {
    display: flex;
    flex-direction: column;
    margin-left: 12px;
}

.brand-name {
    color: white;
    font-size: 1.05rem;
    font-weight: 700;
    letter-spacing: .5px;
}

.brand-subtitle {
    color: rgba(255,255,255,.5);
    font-size: .65rem;
}


/* ========================================================= */
/* MENU */
/* ========================================================= */

.sidebar-menu {
    flex: 1;
    padding: 18px 12px;
}

.menu-section {
    padding: 0 12px;
    margin-bottom: 7px;
    color: rgba(255,255,255,.35);
    font-size: .68rem;
    font-weight: 700;
    letter-spacing: .08em;
}

.sidebar-link {
    display: flex;
    align-items: center;
    width: 100%;
    padding: 10px 12px;
    margin-bottom: 3px;
    border-radius: 8px;
    color: rgba(255,255,255,.72);
    text-decoration: none;
    font-size: .9rem;
    transition: all .15s ease;
}

    .sidebar-link i {
        width: 25px;
        margin-right: 9px;
        font-size: 1.05rem;
    }

    .sidebar-link:hover {
        background: rgba(255,255,255,.08);
        color: white;
    }

    .sidebar-link.active {
        background: #0d6efd;
        color: white;
    }


/* ========================================================= */
/* USER */
/* ========================================================= */

.sidebar-user {
    padding: 15px;
    border-top: 1px solid rgba(255,255,255,.08);
}


/* ========================================================= */
/* MAIN */
/* ========================================================= */

.main-wrapper {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}


/* ========================================================= */
/* TOPBAR */
/* ========================================================= */

.topbar {
    height: 65px;
    background: white;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 25px;
    position: sticky;
    top: 0;
    z-index: 100;
}

.topbar-left {
    display: flex;
    align-items: center;
}

.sidebar-toggle {
    color: #6c757d;
    font-size: 1.4rem;
    padding: 4px 8px;
}

    .sidebar-toggle:hover {
        color: #0d6efd;
    }

.page-context-title {
    margin-left: 10px;
    font-size: .95rem;
    font-weight: 600;
    color: #343a40;
}


/* ========================================================= */
/* CONTENT */
/* ========================================================= */

.main-content {
    flex: 1;
    padding: 30px;
}


/* ========================================================= */
/* FOOTER */
/* ========================================================= */

.app-footer {
    padding: 15px 30px;
    border-top: 1px solid #e5e7eb;
    background: white;
    display: flex;
    justify-content: space-between;
    color: #8a94a6;
    font-size: .8rem;
}


/* ========================================================= */
/* CARDS */
/* ========================================================= */

.card {
    border: 1px solid #e8ebef;
    border-radius: 10px;
}

    .card.shadow-sm {
        box-shadow: 0 .125rem .4rem rgba(0,0,0,.04) !important;
    }


/* ========================================================= */
/* TABLES */
/* ========================================================= */

.table {
    margin-bottom: 0;
}

    .table thead th {
        font-size: .78rem;
        font-weight: 600;
        color: #6c757d;
        text-transform: uppercase;
        letter-spacing: .02em;
    }

    .table tbody td {
        font-size: .88rem;
    }

.table-hover tbody tr:hover {
    background-color: #f8faff;
}


/* ========================================================= */
/* BADGES */
/* ========================================================= */

.badge {
    font-weight: 500;
    padding: .4em .65em;
}


/* ========================================================= */
/* FORMULARIOS */
/* ========================================================= */

.form-label {
    font-size: .8rem;
    font-weight: 600;
    color: #495057;
}

.form-control,
.form-select {
    border-color: #dfe3e8;
    border-radius: 7px;
}

    .form-control:focus,
    .form-select:focus {
        border-color: #86b7fe;
        box-shadow: 0 0 0 .15rem rgba(13,110,253,.1);
    }


/* ========================================================= */
/* BOTONES */
/* ========================================================= */

.btn {
    border-radius: 7px;
}

.btn-primary {
    box-shadow: 0 2px 4px rgba(13,110,253,.15);
}


/* ========================================================= */
/* DASHBOARD KPI */
/* ========================================================= */

.dashboard-kpi-card {
    background: #ffffff;
    border: 1px solid #e8ebef;
    border-radius: 10px;
    padding: 18px;
    min-height: 105px;
    display: flex;
    align-items: center;
    box-shadow: 0 .125rem .4rem rgba(0,0,0,.04);
    transition: transform .15s ease, box-shadow .15s ease;
}

    .dashboard-kpi-card:hover {
        transform: translateY(-2px);
        box-shadow: 0 .35rem 1rem rgba(0,0,0,.07);
    }

.dashboard-kpi-icon {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 1.25rem;
}

.dashboard-kpi-content {
    margin-left: 13px;
    min-width: 0;
}

.dashboard-kpi-label {
    color: #7a8494;
    font-size: .75rem;
    font-weight: 600;
    white-space: nowrap;
}

.dashboard-kpi-value {
    color: #202733;
    font-size: 1.65rem;
    line-height: 1.2;
    font-weight: 700;
    margin-top: 2px;
}

.dashboard-kpi-detail {
    color: #8a94a6;
    font-size: .68rem;
    margin-top: 3px;
    white-space: nowrap;
}


/* ========================================================= */
/* KPI COLORES */
/* ========================================================= */

.kpi-icon-blue {
    background: #e8f1ff;
    color: #0d6efd;
}

.kpi-icon-purple {
    background: #f0eaff;
    color: #6f42c1;
}

.kpi-icon-orange {
    background: #fff1df;
    color: #fd7e14;
}

.kpi-icon-green {
    background: #e5f7ed;
    color: #198754;
}

.kpi-icon-red {
    background: #fde8e8;
    color: #dc3545;
}


/* ========================================================= */
/* DASHBOARD CHART HEADERS */
/* ========================================================= */

.dashboard-card-header {
    display: flex;
    align-items: center;
    min-height: 48px;
    color: #343a40;
}

    .dashboard-card-header i {
        color: #0d6efd;
    }


/* ========================================================= */
/* SIDEBAR COLLAPSED */
/* ========================================================= */

.sidebar-collapsed .sidebar {
    width: 72px;
    min-width: 72px;
}

.sidebar-collapsed .brand-text,
.sidebar-collapsed .sidebar-link span,
.sidebar-collapsed .menu-section {
    display: none;
}

.sidebar-collapsed .sidebar-brand {
    justify-content: center;
    padding: 0;
}

    .sidebar-collapsed .sidebar-brand > a {
        justify-content: center;
    }

.sidebar-collapsed .sidebar-link {
    justify-content: center;
}

    .sidebar-collapsed .sidebar-link i {
        margin-right: 0;
    }

.sidebar-collapsed .sidebar-user {
    padding: 10px;
}


/* ========================================================= */
/* RESPONSIVE */
/* ========================================================= */

@media (max-width: 991.98px) {

    .sidebar {
        width: 220px;
        min-width: 220px;
    }

    .main-content {
        padding: 20px;
    }
}


@media (max-width: 767.98px) {

    .sidebar {
        width: 72px;
        min-width: 72px;
    }

    .brand-text,
    .sidebar-link span,
    .menu-section {
        display: none;
    }

    .sidebar-brand {
        justify-content: center;
        padding: 0;
    }

        .sidebar-brand > a {
            justify-content: center;
        }

    .sidebar-link {
        justify-content: center;
    }

        .sidebar-link i {
            margin-right: 0;
        }

    .main-content {
        padding: 15px;
    }

    .topbar {
        padding: 0 15px;
    }

    .topbar-right {
        display: none;
    }

    .app-footer {
        padding: 12px 15px;
    }

    .log-sort-link {
        color: inherit;
        text-decoration: none;
        display: inline-flex;
        align-items: center;
        gap: 6px;
        white-space: nowrap;
    }

        .log-sort-link:hover {
            color: #fff;
            text-decoration: none;
        }

        .log-sort-link i {
            font-size: .75rem;
            opacity: .7;
        }

        .log-sort-link:hover i {
            opacity: 1;
        }

    .diggiconnect-logo {
        display: block;
        width: 150px;
        height: auto;
        max-height: 45px;
        object-fit: contain;
    }
}
