:root {
    --bg: #f4f7fb;
    --surface: #ffffff;
    --line: #dde5ef;
    --text: #1f2a3b;
    --muted: #6b778c;
    --blue: #2f6fb8;
    --blue-soft: #eaf2fd;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: "Plus Jakarta Sans", sans-serif;
    color: var(--text);
    background:
        radial-gradient(circle at 15% 10%, #f8fbff 0%, transparent 25%),
        radial-gradient(circle at 80% 5%, #eef4fb 0%, transparent 20%),
        var(--bg);
}

.app-shell {
    min-height: 100vh;
    display: flex;
}

.sidebar {
    width: 260px;
    background: var(--surface);
    border-right: 1px solid var(--line);
    padding: 1.5rem 1rem;
    position: sticky;
    top: 0;
    align-self: flex-start;
    height: 100vh;
}

.brand {
    font-size: 1.3rem;
    margin: 0;
    color: var(--blue);
    font-weight: 700;
}

.brand-subtitle {
    margin: 0.25rem 0 0;
    color: var(--muted);
    font-size: 0.9rem;
}

.nav-link {
    border-radius: 10px;
    color: var(--text);
    font-weight: 600;
    transition: all 0.2s ease;
}

.nav-link:hover,
.nav-link.active {
    background: var(--blue-soft);
    color: var(--blue);
}

.content-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.topbar {
    background: rgba(255, 255, 255, 0.92);
    border-bottom: 1px solid var(--line);
    backdrop-filter: blur(8px);
    padding: 1rem 1.5rem;
}

.offcanvas {
    --bs-offcanvas-width: 300px;
}

.page-title {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 700;
}

.content-body {
    padding: 1.5rem;
}

.card {
    border: 1px solid var(--line);
    border-radius: 14px;
    box-shadow: 0 8px 20px rgba(18, 42, 72, 0.05);
}

.stat-card .card-body {
    min-height: 120px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.stat-label {
    color: var(--muted);
    font-size: 0.9rem;
}

.stat-number {
    font-size: 2rem;
    font-weight: 700;
}

.stat-primary {
    border-left: 6px solid #2f6fb8;
}

.stat-secondary {
    border-left: 6px solid #486c96;
}

.stat-success {
    border-left: 6px solid #1f9d67;
}

.stat-warning {
    border-left: 6px solid #e09d2f;
}

.table > :not(caption) > * > * {
    padding: 0.85rem;
}

.runner-row {
    cursor: pointer;
}

.runner-row:hover {
    background: rgba(47, 111, 184, 0.04);
}

.runner-row td:last-child {
    white-space: nowrap;
}

.runner-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.runner-actions form,
.runner-actions a {
    margin: 0;
}

.btn-primary {
    background-color: var(--blue);
    border-color: var(--blue);
}

.btn-primary:hover {
    background-color: #2a629f;
    border-color: #2a629f;
}

@media (max-width: 992px) {
    .app-shell {
        flex-direction: column;
    }

    .sidebar {
        display: none;
    }

    .topbar {
        padding: 0.85rem 1rem;
    }

    .content-body {
        padding: 1rem;
    }

    .runner-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .runner-actions .btn {
        width: 100%;
    }
}

/* Fix column alignment for actions: give the actions column a fixed width
   on larger screens to prevent it from shifting when buttons wrap. */
.runners-table th:last-child,
.runners-table td.runner-actions {
    width: 220px;
}

@media (max-width: 767.98px) {
    .runners-table.align-middle > :not(caption) > * > * {
        vertical-align: top !important;
    }

    .runner-row td:last-child {
        white-space: normal;
    }

    .runner-actions {
        justify-content: flex-start;
    }

    .runners-table th:last-child,
    .runners-table td.runner-actions {
        width: auto;
    }
}
