:root {
    --brand-black: #121212;
    --brand-black-2: #1d1d1d;
    --brand-yellow: #f4c400;
    --brand-yellow-soft: #fff4bf;
    --brand-yellow-muted: #d4aa00;
    --page-bg: #f4f5f7;
    --surface: #ffffff;
    --surface-muted: #f8f9fb;
    --border: #dfe3e8;
    --border-strong: #cbd2da;
    --text-main: #1f242b;
    --text-muted: #66717f;
    --shadow-soft: 0 12px 30px rgba(18, 18, 18, .07);
    --shadow-tight: 0 4px 14px rgba(18, 18, 18, .06);
    --radius: 8px;
}

body {
    background:
        linear-gradient(180deg, rgba(244, 196, 0, .08) 0, rgba(244, 196, 0, 0) 260px),
        var(--page-bg);
    color: var(--text-main);
    font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: .94rem;
}

.app-navbar {
    background: linear-gradient(180deg, var(--brand-black) 0%, var(--brand-black-2) 100%);
    border-bottom: 3px solid var(--brand-yellow);
    box-shadow: 0 8px 24px rgba(18, 18, 18, .18);
    min-height: 64px;
}

.app-navbar .navbar-brand {
    color: #fff;
    font-weight: 800;
    letter-spacing: .01em;
}

.app-navbar .navbar-brand i {
    color: var(--brand-yellow);
}

.app-navbar .nav-identity {
    color: rgba(255, 255, 255, .74);
    max-width: 260px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.page-shell {
    max-width: 1180px;
}

.page-shell-narrow {
    max-width: 760px;
}

.page-shell-wide {
    max-width: 1120px;
}

.page-title-row {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.1rem;
}

.page-kicker {
    color: var(--brand-yellow-muted);
    font-size: .76rem;
    font-weight: 800;
    letter-spacing: .08em;
    margin-bottom: .28rem;
    text-transform: uppercase;
}

.page-title {
    color: var(--text-main);
    font-size: clamp(1.35rem, 2vw, 1.9rem);
    font-weight: 800;
    letter-spacing: 0;
    margin: 0;
}

.page-subtitle {
    color: var(--text-muted);
    margin: .35rem 0 0;
    max-width: 760px;
}

.surface {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-soft);
}

.surface-header {
    align-items: center;
    background: linear-gradient(180deg, #fff 0%, var(--surface-muted) 100%);
    border-bottom: 1px solid var(--border);
    border-radius: var(--radius) var(--radius) 0 0;
    display: flex;
    gap: .75rem;
    justify-content: space-between;
    padding: .95rem 1.1rem;
}

.surface-title {
    align-items: center;
    display: flex;
    font-size: .98rem;
    font-weight: 800;
    gap: .5rem;
    margin: 0;
}

.surface-title i {
    color: var(--brand-yellow-muted);
}

.surface-body {
    padding: 1.1rem;
}

.accent-strip {
    border-left: 4px solid var(--brand-yellow);
}

.quick-panel {
    background:
        linear-gradient(135deg, rgba(244, 196, 0, .13) 0%, rgba(244, 196, 0, 0) 46%),
        var(--surface);
}

.form-label {
    color: #4a5360;
    font-size: .78rem;
    font-weight: 800;
    margin-bottom: .35rem;
}

.form-control,
.form-select,
.input-group-text {
    border-color: var(--border-strong);
    border-radius: 7px;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--brand-yellow-muted);
    box-shadow: 0 0 0 .2rem rgba(244, 196, 0, .18);
}

.btn {
    border-radius: 7px;
    font-weight: 700;
}

.btn-primary {
    background: var(--brand-black);
    border-color: var(--brand-black);
    color: #fff;
}

.btn-primary:hover,
.btn-primary:focus {
    background: #000;
    border-color: #000;
    color: var(--brand-yellow);
}

.btn-outline-warning {
    border-color: rgba(244, 196, 0, .78);
    color: var(--brand-yellow);
}

.btn-outline-warning:hover {
    background: var(--brand-yellow);
    border-color: var(--brand-yellow);
    color: var(--brand-black);
}

.btn-soft {
    background: #fff;
    border: 1px solid var(--border-strong);
    color: #2f3742;
}

.btn-soft:hover {
    background: var(--surface-muted);
    border-color: #b8c0ca;
}

.badge-admin,
.role-chip {
    background: var(--brand-yellow);
    color: var(--brand-black);
    border-radius: 999px;
    font-weight: 800;
    padding: .42rem .65rem;
}

.table {
    --bs-table-hover-bg: #fffaf0;
    color: #27303a;
}

.table thead th {
    background: #f0f2f5;
    border-bottom: 1px solid var(--border-strong);
    color: #394351;
    font-size: .76rem;
    font-weight: 800;
    letter-spacing: .03em;
    padding: .85rem .9rem;
    text-transform: uppercase;
}

.table tbody td {
    border-color: #edf0f3;
    padding: .82rem .9rem;
    vertical-align: middle;
}

.table code {
    background: #f3f4f6;
    border: 1px solid #e3e6ea;
    border-radius: 6px;
    color: #111;
    padding: .16rem .35rem;
}

.history-filter-bar {
    background: #fbfcfd;
    border-bottom: 1px solid var(--border);
}

.status-filter-group .btn {
    border-radius: 999px;
    font-size: .78rem;
}

.btn-check:checked + .btn-outline-secondary {
    background: var(--brand-black);
    border-color: var(--brand-black);
    color: #fff;
}

.status-pill,
.status-pending,
.status-running,
.status-completed,
.status-failed,
.status-stopped {
    align-items: center;
    border-radius: 999px;
    display: inline-flex;
    font-size: .8rem;
    font-weight: 800;
    gap: .35rem;
    padding: .28rem .56rem;
}

.status-pending {
    background: #eef1f5;
    color: #5c6673;
}

.status-running {
    background: #e8f1ff;
    color: #0757b8;
}

.status-completed {
    background: #e8f6ee;
    color: #177245;
}

.status-failed {
    background: #fdecec;
    color: #b4232a;
}

.status-stopped {
    background: #fff1df;
    color: #a75200;
}

.pagination .page-link {
    border-color: var(--border);
    color: #313944;
}

.pagination .active .page-link {
    background: var(--brand-black);
    border-color: var(--brand-black);
    color: #fff;
}

.empty-state {
    color: var(--text-muted);
    padding: 2.4rem 1rem;
    text-align: center;
}

.empty-state i {
    color: var(--brand-yellow-muted);
    display: block;
    font-size: 1.9rem;
    margin-bottom: .45rem;
}

.feedback-line {
    min-height: 1.5rem;
}

.input-help {
    color: var(--text-muted);
    font-size: .82rem;
}

.settings-grid {
    display: grid;
    gap: 1rem;
}

.metric-note {
    color: var(--text-muted);
    font-size: .82rem;
    margin: 0;
}

@media (max-width: 767.98px) {
    .app-navbar {
        align-items: flex-start;
        gap: .75rem;
        padding-bottom: .9rem !important;
        padding-top: .9rem !important;
    }

    .app-navbar .d-flex {
        flex-wrap: wrap;
        justify-content: flex-start;
        width: 100%;
    }

    .page-title-row {
        align-items: flex-start;
        flex-direction: column;
    }

    .surface-header {
        align-items: flex-start;
        flex-direction: column;
    }

    .table tbody td,
    .table thead th {
        white-space: nowrap;
    }
}
