/* NavbexAI - Navy Blue Theme */
:root {
    --nb-navy: #0d1b2a;
    --nb-navy-mid: #1b2f4b;
    --nb-navy-light: #1e3a5f;
    --nb-accent: #4d9de0;
    --nb-accent-hover: #3a7bbf;
    --nb-sidebar-width: 240px;
    --nb-topbar-height: 56px;
}

body {
    background: #f0f4f8;
    font-family: 'Segoe UI', system-ui, sans-serif;
}

/* ── Sidebar ─────────────────────────────────────────────── */
.nb-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--nb-sidebar-width);
    height: 100vh;
    background: var(--nb-navy);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

.nb-sidebar-brand {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    display: flex;
    align-items: center;
    gap: 0.6rem;
    text-decoration: none;
}

.nb-sidebar-brand-icon {
    width: 36px;
    height: 36px;
    background: var(--nb-accent);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    color: #fff;
    flex-shrink: 0;
}

.nb-sidebar-brand-text {
    color: #fff;
    font-weight: 700;
    font-size: 1rem;
    letter-spacing: 0.02em;
}

.nb-sidebar-brand-text span {
    color: var(--nb-accent);
}

.nb-nav {
    padding: 0.75rem 0;
    flex: 1;
}

.nb-nav-section {
    padding: 0.5rem 1rem 0.25rem;
    font-size: 0.65rem;
    font-weight: 600;
    color: rgba(255,255,255,0.3);
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.nb-nav-link {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.5rem 1.25rem;
    color: rgba(255,255,255,0.65);
    text-decoration: none;
    font-size: 0.875rem;
    border-left: 3px solid transparent;
    transition: all 0.15s ease;
}

.nb-nav-link:hover {
    color: #fff;
    background: rgba(255,255,255,0.06);
}

.nb-nav-link.active {
    color: #fff;
    background: rgba(77,157,224,0.15);
    border-left-color: var(--nb-accent);
}

.nb-nav-link svg, .nb-nav-link i {
    width: 18px;
    text-align: center;
    opacity: 0.8;
    flex-shrink: 0;
}

.nb-nav-badge {
    margin-left: auto;
    font-size: 0.7rem;
    padding: 0.1rem 0.45rem;
}

/* ── Topbar ──────────────────────────────────────────────── */
.nb-topbar {
    position: fixed;
    top: 0;
    left: var(--nb-sidebar-width);
    right: 0;
    height: var(--nb-topbar-height);
    background: #fff;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    padding: 0 1.5rem;
    z-index: 999;
    gap: 1rem;
}

.nb-topbar-title {
    font-weight: 600;
    color: var(--nb-navy);
    font-size: 1rem;
    flex: 1;
}

/* ── Main content ────────────────────────────────────────── */
.nb-content {
    margin-left: var(--nb-sidebar-width);
    margin-top: var(--nb-topbar-height);
    padding: 1.5rem;
    min-height: calc(100vh - var(--nb-topbar-height));
}

/* ── Stat cards ──────────────────────────────────────────── */
.nb-stat-card {
    background: #fff;
    border-radius: 10px;
    padding: 1.25rem 1.5rem;
    border: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    gap: 1rem;
    height: 100%;
}

.nb-stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.35rem;
    flex-shrink: 0;
}

.nb-stat-icon.blue   { background: #dbeafe; color: #1d4ed8; }
.nb-stat-icon.green  { background: #dcfce7; color: #166534; }
.nb-stat-icon.orange { background: #ffedd5; color: #9a3412; }
.nb-stat-icon.purple { background: #f3e8ff; color: #6b21a8; }
.nb-stat-icon.teal   { background: #ccfbf1; color: #115e59; }
.nb-stat-icon.red    { background: #fee2e2; color: #991b1b; }

.nb-stat-value {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--nb-navy);
    line-height: 1.1;
}

.nb-stat-label {
    font-size: 0.78rem;
    color: #64748b;
    margin-top: 0.1rem;
}

/* ── Cards / panels ──────────────────────────────────────── */
.nb-card {
    background: #fff;
    border-radius: 10px;
    border: 1px solid #e2e8f0;
    overflow: hidden;
}

.nb-card-header {
    padding: 0.875rem 1.25rem;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #fff;
}

.nb-card-header-title {
    font-weight: 600;
    color: var(--nb-navy);
    font-size: 0.9rem;
    margin: 0;
}

.nb-card-body {
    padding: 1.25rem;
}

/* ── Tables ──────────────────────────────────────────────── */
.nb-table thead th {
    background: #f8fafc;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #64748b;
    border-bottom: 1px solid #e2e8f0;
    padding: 0.6rem 0.875rem;
    white-space: nowrap;
}

.nb-table tbody td {
    padding: 0.65rem 0.875rem;
    font-size: 0.85rem;
    color: #1e293b;
    border-bottom: 1px solid #f1f5f9;
    vertical-align: middle;
}

.nb-table tbody tr:last-child td { border-bottom: none; }
.nb-table tbody tr:hover td { background: #f8fafc; }

/* ── Status badges ───────────────────────────────────────── */
.nb-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.2rem 0.55rem;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.02em;
}

.nb-badge-pending    { background: #fff7ed; color: #c2410c; border: 1px solid #fed7aa; }
.nb-badge-processing { background: #eff6ff; color: #1d4ed8; border: 1px solid #bfdbfe; }
.nb-badge-completed  { background: #f0fdf4; color: #166534; border: 1px solid #bbf7d0; }
.nb-badge-failed     { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }
.nb-badge-active     { background: #f0fdf4; color: #166534; border: 1px solid #bbf7d0; }
.nb-badge-inactive   { background: #f1f5f9; color: #475569; border: 1px solid #e2e8f0; }
.nb-badge-sent       { background: #f0fdf4; color: #166534; border: 1px solid #bbf7d0; }
.nb-badge-notsent    { background: #f1f5f9; color: #475569; border: 1px solid #e2e8f0; }
.nb-badge-revoked    { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }

/* HTTP status code badges */
.nb-status-2xx { background: #f0fdf4; color: #166534; font-weight: 600; font-size: 0.8rem; }
.nb-status-4xx { background: #fff7ed; color: #c2410c; font-weight: 600; font-size: 0.8rem; }
.nb-status-5xx { background: #fef2f2; color: #991b1b; font-weight: 600; font-size: 0.8rem; }

/* HTTP method badges */
.nb-method { font-family: monospace; font-size: 0.78rem; font-weight: 700; padding: 0.15rem 0.4rem; border-radius: 4px; }
.nb-method-get    { background: #f0fdf4; color: #15803d; }
.nb-method-post   { background: #dbeafe; color: #1d4ed8; }
.nb-method-put    { background: #fff7ed; color: #c2410c; }
.nb-method-delete { background: #fef2f2; color: #dc2626; }
.nb-method-patch  { background: #f3e8ff; color: #7e22ce; }

/* ── Buttons ─────────────────────────────────────────────── */
.btn-nb-primary {
    background: var(--nb-navy-light);
    color: #fff;
    border: none;
    padding: 0.4rem 1rem;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 500;
    transition: background 0.15s;
}

.btn-nb-primary:hover {
    background: var(--nb-navy-mid);
    color: #fff;
}

/* ── Ollama status indicator ─────────────────────────────── */
.nb-ollama-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-right: 0.4rem;
}

.nb-ollama-online  { background: #22c55e; box-shadow: 0 0 0 3px rgba(34,197,94,0.2); }
.nb-ollama-offline { background: #ef4444; box-shadow: 0 0 0 3px rgba(239,68,68,0.2); }

/* ── Queue bar chart ─────────────────────────────────────── */
.nb-queue-bar {
    height: 24px;
    border-radius: 4px;
    overflow: hidden;
    background: #f1f5f9;
    display: flex;
}

.nb-queue-bar-segment {
    transition: width 0.5s ease;
}

/* ── Pre code blocks ─────────────────────────────────────── */
.nb-pre {
    background: #0d1b2a;
    color: #e2e8f0;
    border-radius: 8px;
    padding: 1rem;
    font-size: 0.8rem;
    overflow-x: auto;
    white-space: pre-wrap;
    word-break: break-word;
    max-height: 400px;
    overflow-y: auto;
}

/* ── Alert / key reveal ──────────────────────────────────── */
.nb-key-box {
    background: var(--nb-navy);
    color: #4ade80;
    font-family: monospace;
    font-size: 1rem;
    border-radius: 8px;
    padding: 1rem 1.25rem;
    word-break: break-all;
    letter-spacing: 0.04em;
}

/* ── Countdown timer ─────────────────────────────────────── */
.nb-refresh-timer {
    font-size: 0.75rem;
    color: #94a3b8;
}

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 768px) {
    .nb-sidebar { transform: translateX(-100%); }
    .nb-sidebar.open { transform: translateX(0); }
    .nb-content { margin-left: 0; }
    .nb-topbar { left: 0; }
}

/* ── Pagination ──────────────────────────────────────────── */
.nb-pagination { font-size: 0.85rem; }
