:root {
    --cbs-sidebar: #0f172a;
    --cbs-sidebar-2: #1e293b;
    --cbs-accent: #2563eb;
    --cbs-accent-2: #1d4ed8;
    --cbs-bg: #f4f6fb;
    --cbs-card: #ffffff;
    --cbs-muted: #64748b;
    --cbs-border: #e2e8f0;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    background: var(--cbs-bg);
    color: #0f172a;
    font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
    font-size: 14px;
}

a { text-decoration: none; }

.cbs-sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: 245px;
    background: linear-gradient(180deg, var(--cbs-sidebar) 0%, var(--cbs-sidebar-2) 100%);
    color: #cbd5e1;
    padding: 22px 14px;
    z-index: 1030;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.cbs-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #fff;
    font-weight: 700;
    font-size: 16px;
    padding: 0 10px 18px;
    border-bottom: 1px solid rgba(255,255,255,.08);
    margin-bottom: 14px;
}

.cbs-brand .mark {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: linear-gradient(135deg, #3b82f6, #06b6d4);
    display: grid;
    place-items: center;
    font-size: 13px;
    letter-spacing: .5px;
}

.cbs-nav-label {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: .12em;
    color: #64748b;
    padding: 12px 10px 6px;
}

.cbs-nav a {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #cbd5e1;
    padding: 10px 12px;
    border-radius: 9px;
    font-weight: 500;
    transition: .15s;
}

.cbs-nav a:hover { background: rgba(255,255,255,.07); color: #fff; }
.cbs-nav a.active { background: var(--cbs-accent); color: #fff; box-shadow: 0 6px 18px rgba(37,99,235,.35); }
.cbs-nav .ico { width: 20px; text-align: center; opacity: .9; }

.cbs-sidebar .footer {
    margin-top: auto;
    padding: 12px 10px 0;
    font-size: 11px;
    color: #64748b;
    border-top: 1px solid rgba(255,255,255,.08);
}

.cbs-main {
    margin-left: 245px;
    min-height: 100vh;
    padding: 24px 28px 40px;
}

.cbs-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 22px;
}

.cbs-topbar h1 { font-size: 22px; font-weight: 700; margin: 0; }
.cbs-topbar p { margin: 2px 0 0; color: var(--cbs-muted); font-size: 13px; }

.cbs-card {
    background: var(--cbs-card);
    border: 1px solid var(--cbs-border);
    border-radius: 14px;
    box-shadow: 0 1px 2px rgba(15,23,42,.04);
}

.cbs-card .card-body { padding: 18px 20px; }
.cbs-card .card-title { font-size: 13px; font-weight: 700; margin: 0 0 2px; }
.cbs-card .card-sub { color: var(--cbs-muted); font-size: 12px; margin: 0; }

.metric {
    padding: 18px 20px;
    height: 100%;
}
.metric .label { color: var(--cbs-muted); font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.metric .value { font-size: 28px; font-weight: 700; margin-top: 6px; line-height: 1.1; }
.metric .hint { color: var(--cbs-muted); font-size: 12px; margin-top: 4px; }
.metric.blue .value { color: #2563eb; }
.metric.green .value { color: #16a34a; }
.metric.amber .value { color: #d97706; }
.metric.red .value { color: #dc2626; }
.metric.violet .value { color: #7c3aed; }

.badge-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 9px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .03em;
}
.badge-status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.st-enviando { background: #e2e8f0; color: #475569; }
.st-processando { background: #dbeafe; color: #1d4ed8; }
.st-notificado { background: #ede9fe; color: #6d28d9; }
.st-concluido { background: #dcfce7; color: #15803d; }
.st-erro { background: #fee2e2; color: #b91c1c; }

.table { font-size: 13px; margin-bottom: 0; }
.table > :not(caption) > * > * { padding: 10px 12px; vertical-align: middle; }
.table thead th { font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: #64748b; background: #f8fafc; border-bottom: 1px solid var(--cbs-border); white-space: nowrap; }
.table-hover tbody tr:hover { background: #f8fafc; }

.btn-cbs { background: var(--cbs-accent); border-color: var(--cbs-accent); color: #fff; font-weight: 600; }
.btn-cbs:hover { background: var(--cbs-accent-2); border-color: var(--cbs-accent-2); color: #fff; }
.btn-soft { background: #eef2ff; color: #1e40af; border: 1px solid #dbeafe; font-weight: 600; }
.btn-soft:hover { background: #e0e7ff; color: #1e3a8a; }

.form-control, .form-select { font-size: 13px; border-color: var(--cbs-border); }
.form-label { font-size: 12px; font-weight: 600; color: #334155; margin-bottom: 4px; }

.nav-tabs .nav-link { font-size: 13px; font-weight: 600; color: #64748b; }
.nav-tabs .nav-link.active { color: var(--cbs-accent); }

.code-box {
    background: #0f172a;
    color: #e2e8f0;
    border-radius: 10px;
    padding: 16px;
    font-family: Consolas, "Courier New", monospace;
    font-size: 12px;
    max-height: 520px;
    overflow: auto;
    white-space: pre;
}

.empty {
    text-align: center;
    padding: 46px 20px;
    color: var(--cbs-muted);
}
.empty strong { display: block; color: #0f172a; font-size: 15px; margin-bottom: 4px; }

.login-wrap {
    min-height: 100vh;
    display: grid;
    place-items: center;
    background: radial-gradient(circle at 20% 20%, #1e3a8a 0%, #0f172a 45%, #020617 100%);
    padding: 20px;
}
.login-card {
    width: 100%;
    max-width: 390px;
    background: #fff;
    border-radius: 18px;
    padding: 30px;
    box-shadow: 0 25px 60px rgba(0,0,0,.35);
}
.login-card .mark { width: 52px; height: 52px; border-radius: 14px; background: linear-gradient(135deg,#3b82f6,#06b6d4); color: #fff; display: grid; place-items: center; font-weight: 700; margin-bottom: 16px; }

.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { position: relative; padding: 0 0 18px 22px; border-left: 2px solid #e2e8f0; }
.timeline li::before { content: ""; position: absolute; left: -6px; top: 2px; width: 10px; height: 10px; border-radius: 50%; background: #2563eb; }
.timeline li:last-child { border-left-color: transparent; padding-bottom: 0; }
.timeline .when { font-size: 11px; color: #64748b; }
.timeline .what { font-weight: 600; font-size: 13px; }

.alert-note { border-radius: 12px; font-size: 13px; }

.small-muted { font-size: 12px; color: var(--cbs-muted); }

.autocomplete-wrap { position: relative; }
.autocomplete-list {
    position: absolute;
    z-index: 1050;
    left: 0; right: 0;
    top: calc(100% + 4px);
    background: #fff;
    border: 1px solid var(--cbs-border);
    border-radius: 10px;
    box-shadow: 0 14px 34px rgba(15,23,42,.14);
    max-height: 280px;
    overflow: auto;
    display: none;
}
.autocomplete-list.show { display: block; }
.autocomplete-item { padding: 9px 12px; cursor: pointer; border-bottom: 1px solid #f1f5f9; font-size: 13px; }
.autocomplete-item:hover { background: #f8fafc; }
.autocomplete-item small { display: block; color: #64748b; }

@media (max-width: 992px) {
    .cbs-sidebar { position: static; width: 100%; flex-direction: row; flex-wrap: wrap; padding: 12px; }
    .cbs-sidebar .footer, .cbs-nav-label { display: none; }
    .cbs-brand { border: 0; margin: 0; padding: 0 8px; }
    .cbs-nav { display: flex; flex-wrap: wrap; gap: 4px; }
    .cbs-nav a { padding: 8px 10px; font-size: 12px; }
    .cbs-main { margin-left: 0; padding: 18px 14px 30px; }
}
