/* SUPEXUP Formation — admin theme (sober palette over Bootstrap 5 variables). */

:root {
    --app-sidebar-bg: #1b2538;
    --app-sidebar-bg-active: #28354e;
    --app-sidebar-text: #aab4c8;
    --app-sidebar-text-active: #ffffff;
    --app-sidebar-width: 15.5rem;

    --bs-primary: #2f5fa8;
    --bs-primary-rgb: 47, 95, 168;
    --bs-link-color: var(--bs-primary);
    --bs-link-color-rgb: var(--bs-primary-rgb);
    --bs-link-hover-color: #244880;
    --bs-link-hover-color-rgb: 36, 72, 128;

    --bs-body-bg: #f4f6f9;
    --bs-body-color: #222c3c;
    --bs-secondary-color: #5b6677;
    --bs-border-color: #dfe3ea;
    --bs-border-color-translucent: #dfe3ea;

    --bs-body-font-family: -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

body {
    background: var(--bs-body-bg);
}

h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    letter-spacing: -0.01em;
}

/* ---------- App shell / sidebar ---------- */

.app-shell {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: var(--app-sidebar-width);
    flex-shrink: 0;
    background: var(--app-sidebar-bg);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 1030;
    transition: transform 0.2s ease;
}

.sidebar-brand {
    color: #fff;
    font-weight: 700;
    font-size: 1.05rem;
    padding: 1.1rem 1.25rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    text-decoration: none;
    display: block;
}

.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: 0.75rem 0;
}

.sidebar-section {
    color: #6c7891;
    text-transform: uppercase;
    font-size: 0.68rem;
    letter-spacing: 0.06em;
    font-weight: 600;
    padding: 0.9rem 1.25rem 0.3rem;
}

.sidebar-nav .nav-link {
    color: var(--app-sidebar-text);
    padding: 0.5rem 1.25rem;
    font-size: 0.92rem;
    border-left: 3px solid transparent;
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.sidebar-nav .nav-link:hover {
    color: var(--app-sidebar-text-active);
    background: rgba(255, 255, 255, 0.04);
}

.sidebar-nav .nav-link.active {
    color: var(--app-sidebar-text-active);
    background: var(--app-sidebar-bg-active);
    border-left-color: #5b9bf5;
    font-weight: 600;
}

.sidebar-user {
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    padding: 0.9rem 1.25rem;
    font-size: 0.82rem;
    color: var(--app-sidebar-text);
}

.sidebar-user a {
    color: #fff;
}

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

.app-shell.no-sidebar .main-content {
    margin-left: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
}

.topbar {
    background: #fff;
    border-bottom: 1px solid var(--bs-border-color);
    padding: 0.75rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.sidebar-toggle {
    display: none;
}

@media (max-width: 991.98px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .app-shell.sidebar-open .sidebar {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0;
    }

    .sidebar-toggle {
        display: inline-flex;
    }
}

/* ---------- Components ---------- */

.card {
    border: 1px solid var(--bs-border-color);
    box-shadow: 0 1px 2px rgba(16, 24, 40, 0.04);
}

.stat-tile {
    cursor: pointer;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.stat-tile:hover {
    border-color: var(--bs-primary);
}

.stat-tile.active {
    border-color: var(--bs-primary);
    box-shadow: 0 0 0 2px rgba(47, 95, 168, 0.25);
}

.table thead th {
    background: #eef1f6;
    color: var(--bs-secondary-color);
    font-size: 0.74rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-weight: 600;
    border-bottom: none;
}

.table-striped > tbody > tr:nth-of-type(odd) > * {
    background-color: rgba(47, 95, 168, 0.03);
}

.btn {
    border-radius: 0.4rem;
}

/* ---------- Status badges ---------- */

.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.3rem 0.6rem;
    border-radius: 999px;
    font-size: 0.76rem;
    font-weight: 600;
}

.status-badge::before {
    content: "";
    width: 0.45rem;
    height: 0.45rem;
    border-radius: 50%;
    background: currentColor;
}

.status-running, .status-active { background: #e4f6ea; color: #1e7a42; }
.status-stopped, .status-draft { background: #eceff3; color: #495366; }
.status-error { background: #fbe7e7; color: #b42318; }
.status-archived { background: #e6e8ec; color: #3d4452; }
.status-pending { background: #fef3e2; color: #9a5b12; }

/* ---------- Misc page helpers ---------- */

.reading-width {
    max-width: 860px;
}
