/* UEA StockApp — App shell & compact UI */

/* ── Sidebar ─────────────────────────────────────── */
.sidebar {
    width: 14rem !important;
    min-height: 100vh;
}

.sidebar .nav-item .nav-link {
    padding: 0.55rem 1rem;
    font-size: 0.82rem;
    font-weight: 600;
}

.sidebar .nav-item .nav-link i {
    font-size: 0.85rem;
    width: 1.1rem;
    margin-right: 0.45rem;
}

.sidebar-brand {
    height: 3.25rem !important;
    padding: 0.5rem 1rem;
}

.sidebar-brand-text {
    font-size: 0.95rem;
}

.sidebar-brand-icon img {
    width: 42px !important;
}

.sidebar-heading {
    font-size: 0.62rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    padding: 0.4rem 1rem 0.15rem;
    margin-top: 0.15rem;
}

.sidebar .nav-item.active > .nav-link {
    background: rgba(255, 255, 255, 0.14);
    border-left: 3px solid #fff;
    padding-left: calc(1rem - 3px);
}

.sidebar .nav-item.sub .nav-link {
    padding: 0.38rem 1rem 0.38rem 2.15rem;
    font-size: 0.76rem;
    font-weight: 500;
    opacity: 0.92;
}

.sidebar .nav-item.sub.active > .nav-link {
    background: rgba(255, 255, 255, 0.1);
    border-left: 3px solid rgba(255, 255, 255, 0.65);
    padding-left: calc(2.15rem - 3px);
}

.sidebar-divider {
    margin: 0.35rem 0.75rem;
}

body.sidebar-toggled .sidebar {
    width: 6.5rem !important;
}

body.sidebar-toggled .sidebar .sidebar-heading,
body.sidebar-toggled .sidebar .nav-item.sub {
    display: none;
}

/* ── Topbar ──────────────────────────────────────── */
.topbar {
    height: 3.25rem !important;
    padding: 0 1rem !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06) !important;
}

.topbar.navbar {
    margin-bottom: 0.75rem !important;
}

.topbar-toggle-btn {
    width: 2rem;
    height: 2rem;
    border-radius: 0.45rem;
    border: 1px solid #e3e6f0;
    background: #f8f9fc;
    color: #5a5c69;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.topbar-toggle-btn:hover {
    background: #eaecf4;
    color: #3a3b45;
}

.topbar-context {
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-width: 0;
    margin-left: 0.65rem;
}

.topbar-context-title {
    font-size: 0.92rem;
    font-weight: 700;
    color: #3a3b45;
    line-height: 1.15;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.topbar-context-crumb {
    font-size: 0.68rem;
    color: #858796;
    line-height: 1.1;
}

.topbar-context-crumb a {
    color: #4e73df;
    text-decoration: none;
}

.topbar-filters {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.topbar-filters label {
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #858796;
    margin: 0;
    white-space: nowrap;
}

.topbar-filters .form-control-sm {
    font-size: 0.78rem;
    height: calc(1.5em + 0.55rem);
    min-width: 11rem;
}

.topbar-user {
    font-size: 0.8rem;
    font-weight: 600;
    color: #5a5c69;
}

.topbar .img-profile {
    width: 1.75rem;
    height: 1.75rem;
}

/* ── Compact KPI cards ───────────────────────────── */
.kpi-row {
    margin-bottom: 0.65rem;
}

.kpi-card {
    border: 1px solid #e3e6f0;
    border-radius: 0.5rem;
    background: #fff;
    box-shadow: 0 1px 2px rgba(58, 59, 69, 0.06);
    height: 100%;
    transition: box-shadow 0.15s ease;
}

.kpi-card:hover {
    box-shadow: 0 3px 10px rgba(58, 59, 69, 0.08);
}

.kpi-card .card-body {
    padding: 0.65rem 0.85rem;
    display: flex;
    align-items: center;
    gap: 0.65rem;
}

.kpi-icon {
    width: 2.1rem;
    height: 2.1rem;
    border-radius: 0.45rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    flex-shrink: 0;
}

.kpi-icon.primary { background: #e8edfb; color: #4e73df; }
.kpi-icon.success { background: #e6f9f1; color: #1cc88a; }
.kpi-icon.info    { background: #e7f7fa; color: #36b9cc; }
.kpi-icon.warning { background: #fef6e7; color: #f6c23e; }
.kpi-icon.danger  { background: #fdecea; color: #e74a3b; }

.kpi-label {
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #858796;
    line-height: 1.1;
}

.kpi-value {
    font-size: 1.05rem;
    font-weight: 800;
    color: #2e2f37;
    line-height: 1.15;
}

.kpi-meta {
    font-size: 0.68rem;
    color: #858796;
    line-height: 1.1;
}

/* ── Insight chips row ───────────────────────────── */
.insight-row {
    margin-bottom: 0.85rem;
}

.insight-card {
    border: 1px dashed #d1d3e2;
    border-radius: 0.45rem;
    background: #fcfcfe;
    padding: 0.45rem 0.7rem;
    height: 100%;
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
}

.insight-card i {
    color: #4e73df;
    font-size: 0.8rem;
    margin-top: 0.1rem;
}

.insight-card .insight-text {
    font-size: 0.74rem;
    color: #5a5c69;
    line-height: 1.35;
    margin: 0;
}

.insight-card .insight-text strong {
    color: #3a3b45;
}

/* ── Reports (compact) ───────────────────────────── */
.report-position-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.72rem;
    color: #2c6875;
    background: #eefafe;
    border: 1px solid #c9edf5;
    border-radius: 999px;
    padding: 0.2rem 0.65rem;
    margin-bottom: 0.65rem;
}

.report-chart-card .card-header,
.report-table-card .card-header {
    padding: 0.55rem 1rem;
}

.report-chart-card .card-header h6,
.report-table-card .card-header h6 {
    font-size: 0.82rem;
    margin: 0;
}

.report-chart-card .card-body,
.report-table-card .card-body {
    padding: 0.85rem;
}

.report-loading {
    position: relative;
    min-height: 100px;
}

.report-loading::after {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0.75);
    z-index: 5;
    border-radius: inherit;
}

.report-loading::before {
    content: '\f110';
    font-family: 'Font Awesome 5 Free';
    font-weight: 900;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 6;
    color: #4e73df;
    font-size: 1.25rem;
    animation: report-spin 0.8s linear infinite;
}

@keyframes report-spin {
    to { transform: translate(-50%, -50%) rotate(360deg); }
}

.report-empty {
    text-align: center;
    padding: 2rem 1rem;
    color: #858796;
}

.report-trend-badge {
    font-size: 0.65rem;
    padding: 0.15rem 0.4rem;
    border-radius: 0.25rem;
    font-weight: 600;
}

.report-trend-up   { background: #d4edda; color: #155724; }
.report-trend-down { background: #f8d7da; color: #721c24; }
.report-trend-flat { background: #e2e3e5; color: #383d41; }

.report-hub-card {
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    border: 1px solid #e3e6f0;
    height: 100%;
}

.report-hub-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 0.35rem 1rem rgba(78, 115, 223, 0.12);
    text-decoration: none;
}

.report-hub-card .hub-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    margin-bottom: 0.5rem;
}

.container-fluid {
    padding-left: 1rem;
    padding-right: 1rem;
}

@media (max-width: 767px) {
    .topbar-filters {
        width: 100%;
        margin-top: 0.35rem;
    }

    .topbar-filters .form-control-sm {
        min-width: 0;
        flex: 1;
    }
}

@media print {
    .sidebar, .topbar, .topbar-filters, .btn-export { display: none !important; }
}
