:root {
    --sidebar-width: 240px;
}

body { font-size: 0.9rem; background-color: #f5f6fa; }

.sidebar-nav {
    width: var(--sidebar-width);
    min-height: calc(100vh - 56px);
    position: sticky;
    top: 56px;
    overflow-y: auto;
    transition: width 0.25s ease;
    z-index: 100;
}

.sidebar-nav .nav-link {
    color: #444;
    padding: 0.45rem 1rem;
    font-size: 0.85rem;
    border-radius: 0;
}

.sidebar-nav .nav-link:hover,
.sidebar-nav .nav-link.active {
    background-color: #e8f0fe;
    color: #1a73e8;
}

.sidebar-heading {
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    color: #aaa;
    padding: 0.6rem 1rem 0.2rem;
    text-transform: uppercase;
}

#mainContent { min-height: calc(100vh - 56px); }

.card { border: none; box-shadow: 0 1px 4px rgba(0,0,0,.08); }
.card-header { background: #fff; border-bottom: 1px solid #f0f0f0; font-weight: 600; }

.stat-card { border-left: 4px solid; }
.stat-card.primary { border-color: #0d6efd; }
.stat-card.success { border-color: #198754; }
.stat-card.danger  { border-color: #dc3545; }
.stat-card.warning { border-color: #ffc107; }
.stat-card.info    { border-color: #0dcaf0; }
.stat-card.purple  { border-color: #6f42c1; }

.table th { font-size: 0.78rem; text-transform: uppercase; color: #888; letter-spacing: 0.04em; }

.badge { font-size: 0.72rem; }

.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
}
.page-header h4 { margin: 0; font-weight: 700; }

.chart-container { position: relative; height: 280px; }

@media (max-width: 991.98px) {
    .sidebar-nav {
        position: fixed;
        left: 0;
        width: var(--sidebar-width);
        transform: translateX(-100%);
        transition: transform 0.25s ease;
        height: calc(100vh - 56px);
        background: #fff;
        z-index: 999;
        box-shadow: 2px 0 8px rgba(0,0,0,.15);
    }
    .sidebar-nav.show {
        transform: translateX(0);
    }
    #mainContent { width: 100%; }
}

.flatpickr-input { background: #fff !important; }

.dataTables_wrapper .dataTables_filter input {
    border: 1px solid #dee2e6;
    border-radius: 4px;
    padding: 4px 8px;
}

.progress-sm { height: 6px; }

.api-key-box {
    font-family: monospace;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    padding: 6px 10px;
    font-size: 0.8rem;
    word-break: break-all;
}

.integration-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 0.72rem;
    font-weight: 600;
}

.source-sm    { background: #e3f2fd; color: #1565c0; }
.source-epos  { background: #e8f5e9; color: #2e7d32; }
.source-mydd  { background: #fce4ec; color: #ad1457; }
