/* ── Opslytica Backoffice Theme ─────────────────────────────── */

:root {
    --bo-sidebar-width: 240px;
    --bo-sidebar-bg: #1a1d23;
    --bo-sidebar-text: #a0aec0;
    --bo-sidebar-active: #667eea;
    --bo-topbar-height: 48px;
    --bo-bg: #f7f8fc;
    --bo-card-bg: #ffffff;
    --bo-text: #2d3748;
    --bo-text-muted: #718096;
    --bo-border: #e2e8f0;
    --bo-success: #48bb78;
    --bo-warning: #ed8936;
    --bo-danger: #f56565;
    --bo-info: #4299e1;
}

* { font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif; }
h1, h2, h3, h4, h5, h6 { outline: none !important; border: none !important; }

body { margin: 0; background: var(--bo-bg); color: var(--bo-text); }

/* Layout */
.bo-layout { display: flex; min-height: 100vh; }

.bo-sidebar {
    width: var(--bo-sidebar-width);
    background: var(--bo-sidebar-bg);
    color: var(--bo-sidebar-text);
    position: fixed;
    top: 0; left: 0; bottom: 0;
    overflow-y: auto;
    z-index: 100;
}

.bo-brand {
    padding: 20px 16px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    display: flex;
    align-items: center;
    gap: 8px;
}
.bo-brand i { font-size: 1.4rem; color: var(--bo-sidebar-active); }
.bo-brand span { font-weight: 700; font-size: 1.1rem; color: #fff; }
.bo-brand small {
    font-size: 0.6rem;
    background: var(--bo-sidebar-active);
    color: #fff;
    padding: 2px 6px;
    border-radius: 3px;
    font-weight: 600;
    letter-spacing: 0.05em;
    margin-left: auto;
}

.bo-main {
    margin-left: var(--bo-sidebar-width);
    flex: 1;
    min-width: 0;
}

.bo-topbar {
    height: var(--bo-topbar-height);
    background: var(--bo-card-bg);
    border-bottom: 1px solid var(--bo-border);
    display: flex;
    align-items: center;
    padding: 0 24px;
}

.bo-content { padding: 24px; }

/* Nav */
.bo-nav { padding: 12px 0; }

.bo-nav-section {
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    color: rgba(255,255,255,0.35);
    padding: 16px 16px 6px;
    text-transform: uppercase;
}

.bo-nav-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 16px;
    color: var(--bo-sidebar-text);
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 500;
    border-left: 3px solid transparent;
    transition: all 0.15s;
}
.bo-nav-link:hover {
    background: rgba(255,255,255,0.05);
    color: #fff;
}
.bo-nav-link.active {
    background: rgba(102, 126, 234, 0.15);
    color: var(--bo-sidebar-active);
    border-left-color: var(--bo-sidebar-active);
}
.bo-nav-link i { font-size: 1rem; width: 20px; text-align: center; }

/* Cards */
.bo-card {
    background: var(--bo-card-bg);
    border: 1px solid var(--bo-border);
    border-radius: 8px;
    padding: 20px;
}
.bo-card-header {
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    color: var(--bo-text-muted);
    text-transform: uppercase;
    margin-bottom: 12px;
}

/* KPI Cards */
.bo-kpi { text-align: center; }
.bo-kpi-value {
    font-size: 1.8rem;
    font-weight: 700;
    line-height: 1.2;
}
.bo-kpi-label {
    font-size: 0.75rem;
    color: var(--bo-text-muted);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    margin-top: 4px;
}
.bo-kpi-sub {
    font-size: 0.8rem;
    margin-top: 4px;
}

/* Tables */
.bo-table {
    width: 100%;
    font-size: 0.85rem;
}
.bo-table th {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--bo-text-muted);
    border-bottom: 2px solid var(--bo-border);
    padding: 8px 12px;
}
.bo-table td {
    padding: 10px 12px;
    border-bottom: 1px solid var(--bo-border);
    vertical-align: middle;
}
.bo-table tr:hover td { background: #f8fafc; }

/* Badges */
.bo-badge {
    display: inline-block;
    font-size: 0.7rem;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}
.bo-badge-free { background: #edf2f7; color: #4a5568; }
.bo-badge-starter { background: #ebf8ff; color: #2b6cb0; }
.bo-badge-professional { background: #faf5ff; color: #6b46c1; }
.bo-badge-enterprise { background: #fffaf0; color: #c05621; }
.bo-badge-active { background: #f0fff4; color: #276749; }
.bo-badge-inactive { background: #fff5f5; color: #c53030; }
.bo-badge-trial { background: #fffff0; color: #975a16; }

/* Progress bars */
.bo-progress {
    height: 6px;
    background: #edf2f7;
    border-radius: 3px;
    overflow: hidden;
}
.bo-progress-bar {
    height: 100%;
    border-radius: 3px;
    transition: width 0.3s;
}

/* Change indicators */
.bo-change-up { color: var(--bo-success); }
.bo-change-down { color: var(--bo-danger); }

/* Activity feed */
.bo-activity-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid var(--bo-border);
}
.bo-activity-item:last-child { border-bottom: none; }
.bo-activity-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    flex-shrink: 0;
}
.bo-activity-text { font-size: 0.85rem; }
.bo-activity-time { font-size: 0.75rem; color: var(--bo-text-muted); }

/* Login page */
.bo-login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #1a1d23 0%, #2d3748 100%);
}
.bo-login-card {
    background: #fff;
    border-radius: 12px;
    padding: 40px;
    width: 100%;
    max-width: 400px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}

/* Filters bar */
.bo-filters {
    display: flex;
    gap: 12px;
    align-items: center;
    margin-bottom: 16px;
    flex-wrap: wrap;
}
.bo-filters .form-control,
.bo-filters .form-select {
    font-size: 0.85rem;
    max-width: 220px;
}

/* Section headers */
.bo-section-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Hamburger button — hidden on desktop */
.bo-hamburger {
    display: none;
    background: none;
    border: none;
    font-size: 1.4rem;
    color: var(--bo-text);
    cursor: pointer;
    padding: 4px 8px;
    margin-right: 8px;
    line-height: 1;
}

/* Logout button */
.bo-logout-btn {
    background: none;
    border: none;
    color: var(--bo-text-muted);
    font-size: 1.1rem;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    transition: color 0.15s;
}
.bo-logout-btn:hover { color: var(--bo-danger); }

/* Sidebar backdrop — hidden by default */
.bo-sidebar-backdrop {
    display: none;
}

/* Responsive */
@media (max-width: 768px) {
    .bo-hamburger { display: block; }

    .bo-sidebar {
        transform: translateX(-100%);
        z-index: 200;
    }

    .bo-main { margin-left: 0; }
    .bo-content { padding: 16px; }

    /* Open state */
    .sidebar-open .bo-sidebar {
        transform: translateX(0);
    }
    .sidebar-open .bo-sidebar-backdrop {
        display: block;
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: 150;
    }
}

/* Utility */
.text-success { color: var(--bo-success) !important; }
.text-warning { color: var(--bo-warning) !important; }
.text-danger { color: var(--bo-danger) !important; }
.text-info { color: var(--bo-info) !important; }
