/* ── Google Fonts ────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Roboto+Condensed:ital,wght@0,300;0,400;0,500;0,600;0,700;0,800;1,400&family=Roboto+Slab:wght@300;400;500;600;700;800&display=swap');

/* ── Reset & tokens ──────────────────────────────────── */
#aifaq-dash, #aifaq-dash * { box-sizing: border-box; margin: 0; padding: 0; }
#aifaq-dash {
    --bg:      #09090b;
    --surface: #111115;
    --card:    #18181b;
    --card2:   #1c1c21;
    --border:  #27272a;
    --border2: #3f3f46;
    --accent:  #800020;
    --accent2: #a0002a;
    --text:    #fafafa;
    --muted:   #71717a;
    --muted2:  #a1a1aa;
    --ok:      #22c55e;
    --miss:    #ef4444;
    --blue:    #3b82f6;
    --purple:  #8b5cf6;
    --gold:    #f59e0b;
    --cyan:    #06b6d4;
    --r:       12px;
    --r2:      8px;
    --gutter:  clamp(12px, 3vw, 40px);

    background: var(--bg);
    color: var(--text);
    font-family: 'Roboto Condensed', 'Segoe UI', system-ui, sans-serif;
    font-size: 14px;
    line-height: 1.5;
    padding: 0;
    width: 100%;
    max-width: 100%;
    margin: 0;
}

/* Headings & labels use Roboto Slab */
#aifaq-dash h2,
#aifaq-dash .bd-stat-num,
#aifaq-dash .bd-analytic-num,
#aifaq-dash .bd-bot-count,
#aifaq-dash .bd-cnt-total {
    font-family: 'Roboto Slab', Georgia, serif;
}
#aifaq-dash .ch-title,
#aifaq-dash .bd-stat-lbl,
#aifaq-dash .bd-analytic-lbl,
#aifaq-dash .bd-mod-label,
#aifaq-dash .bd-files-divider span {
    font-family: 'Roboto Condensed', sans-serif;
    letter-spacing: .8px;
}

/* ── Header ──────────────────────────────────────────── */
.bd-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 28px var(--gutter) 24px;
    border-bottom: 1px solid var(--border);
    flex-wrap: wrap;
    gap: 16px;
    background: linear-gradient(135deg, #09090b 60%, #18070e 100%);
}
.bd-header-left h2 {
    font-size: 20px;
    font-weight: 700;
    letter-spacing: -0.4px;
    color: #fff;
    margin-bottom: 3px;
}
.bd-header-left p {
    font-size: 12px;
    color: var(--muted);
}
.bd-header-left .live-dot {
    display: inline-block;
    width: 7px; height: 7px;
    background: var(--ok);
    border-radius: 50%;
    margin-right: 6px;
    animation: pulse-dot 2s ease-in-out infinite;
    vertical-align: middle;
    box-shadow: 0 0 0 0 rgba(34,197,94,.4);
}
@keyframes pulse-dot {
    0%, 100% { box-shadow: 0 0 0 0 rgba(34,197,94,.4); }
    50%       { box-shadow: 0 0 0 6px rgba(34,197,94,0); }
}
.bd-regen-btn {
    background: var(--accent);
    background-image: linear-gradient(135deg, var(--accent), var(--accent2));
    color: #fff;
    border: none;
    padding: 10px 22px;
    border-radius: var(--r2);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    letter-spacing: 0.2px;
    transition: all .2s;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    box-shadow: 0 0 20px rgba(128,0,32,.35);
}
.bd-regen-btn:hover  { box-shadow: 0 0 28px rgba(128,0,32,.55); transform: translateY(-1px); }
.bd-regen-btn:active { transform: scale(.97); }
.bd-regen-btn:disabled { opacity: .5; cursor: wait; transform: none; }
.bd-regen-btn .spin { display:none; }
.bd-regen-btn.loading .spin  { display:inline; animation: spin .7s linear infinite; }
.bd-regen-btn.loading .label { display:none; }
@keyframes spin { to { transform:rotate(360deg); } }
.bd-toast {
    display: none;
    font-size: 12px;
    padding: 8px 14px;
    border-radius: var(--r2);
    margin-top: 8px;
    border: 1px solid;
}
.bd-toast.ok  { background:#0d2a1a; color:var(--ok);   border-color:#22c55e33; display:block; }
.bd-toast.err { background:#2a0d0d; color:var(--miss); border-color:#ef444433; display:block; }

/* ── Main grid ───────────────────────────────────────── */
.bd-grid {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 14px;
    padding: 24px var(--gutter) 40px;
}
@media (max-width: 960px) { .bd-grid { grid-template-columns: repeat(6,1fr); padding: 16px var(--gutter); } }
@media (max-width: 768px) { .bd-grid { grid-template-columns: 1fr; padding: 12px; gap: 10px; } }
@media (max-width: 600px) { .bd-grid { grid-template-columns: 1fr; padding: 10px; gap: 8px; } }

/* ── Bento card ──────────────────────────────────────── */
.bd-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--r);
    overflow: hidden;
    transition: border-color .2s, transform .2s;
    position: relative;
}
.bd-card:hover { border-color: var(--border2); }
.bd-card.glow-accent { box-shadow: inset 0 0 0 1px rgba(128,0,32,.2), 0 0 30px rgba(128,0,32,.08); }
.bd-card.glow-purple { box-shadow: inset 0 0 0 1px rgba(139,92,246,.2), 0 0 30px rgba(139,92,246,.06); }
.bd-card.glow-blue   { box-shadow: inset 0 0 0 1px rgba(59,130,246,.2), 0 0 30px rgba(59,130,246,.06); }
.bd-card.glow-green  { box-shadow: inset 0 0 0 1px rgba(34,197,94,.2),  0 0 30px rgba(34,197,94,.06); }

/* Span helpers */
.span-3  { grid-column: span 3; }
.span-4  { grid-column: span 4; }
.span-6  { grid-column: span 6; }
.span-8  { grid-column: span 8; }
.span-12 { grid-column: span 12; }
@media (max-width: 960px) {
    .span-3 { grid-column: span 3; }
    .span-4 { grid-column: span 3; }
    .span-6,.span-8 { grid-column: span 6; }
    .span-12 { grid-column: span 6; }
}
@media (max-width: 768px) {
    .bd-grid { grid-template-columns: 1fr; padding: 12px; gap: 10px; }
    .span-3,.span-4,.span-6,.span-8,.span-12 { grid-column: 1 / -1; }
    .bd-analytics-col { grid-column: 1 / -1 !important; }
}
@media (max-width: 600px) {
    .span-3,.span-4,.span-6,.span-8,.span-12 { grid-column: 1 / -1; }
    .bd-analytics-col { grid-column: 1 / -1 !important; }
}

/* ── Stat card (span-3) ──────────────────────────────── */
.bd-stat {
    padding: 22px 22px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.bd-stat-num {
    font-size: 38px;
    font-weight: 800;
    letter-spacing: -2px;
    line-height: 1;
}
.bd-stat-lbl {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .7px;
    color: var(--muted);
    font-weight: 500;
}
.bd-stat-sub {
    font-size: 11px;
    color: var(--muted);
    margin-top: 2px;
}
.c-accent  { color: #f87171; }
.c-green   { color: var(--ok); }
.c-blue    { color: #60a5fa; }
.c-purple  { color: #c084fc; }
.c-gold    { color: var(--gold); }
.c-cyan    { color: var(--cyan); }
.c-white   { color: #fff; }

/* ── Card header ─────────────────────────────────────── */
.bd-card-head {
    padding: 14px 22px 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    border-bottom: 1px solid var(--border);
}
.bd-card-head .ch-icon { font-size: 14px; }
.bd-card-head .ch-title {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .7px;
    color: var(--muted2);
}
.bd-card-head .ch-badge {
    margin-left: auto;
    font-size: 10px;
    background: var(--border);
    padding: 2px 8px;
    border-radius: 20px;
    color: var(--muted2);
}
.bd-card-body { padding: 18px 22px; }

/* ── LLM Hero card ───────────────────────────────────── */
.bd-llm-hero {
    background: linear-gradient(145deg, #13101e 0%, #1a1028 50%, #0f1520 100%);
    border-color: rgba(139,92,246,.3) !important;
}
.bd-llm-hero .bd-card-head { border-color: rgba(139,92,246,.2); }
.bd-llm-table { width: 100%; border-collapse: collapse; }
.bd-llm-table th {
    text-align: left;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: .5px;
    color: var(--muted);
    padding: 0 8px 10px 0;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}
.bd-llm-table th:not(:first-child) { text-align: center; }
.bd-llm-table td {
    padding: 10px 8px 10px 0;
    border-bottom: 1px solid rgba(255,255,255,.04);
    font-size: 12px;
    vertical-align: middle;
}
.bd-llm-table td:not(:first-child) { text-align: center; }
.bd-llm-table tr:last-child td { border-bottom: none; }
.bd-engine-name {
    font-weight: 600;
    color: #c084fc;
    font-size: 13px;
}
.bd-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    min-width: 28px;
    text-align: center;
}
.bb-purple { background: rgba(139,92,246,.2); color: #c084fc; }
.bb-green  { background: rgba(34,197,94,.15);  color: var(--ok); }
.bb-blue   { background: rgba(59,130,246,.15); color: #60a5fa; }
.bb-red    { background: rgba(239,68,68,.15);  color: #f87171; }
.bb-gray   { color: var(--border2); }
.bd-endpoint-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 8px;
}
.bd-ep-pill {
    background: rgba(139,92,246,.1);
    border: 1px solid rgba(139,92,246,.25);
    border-radius: 20px;
    padding: 3px 10px;
    font-size: 10px;
    color: #a78bfa;
    font-family: monospace;
}
.bd-ep-pill span {
    color: #c084fc;
    font-weight: 700;
    margin-left: 4px;
}

/* ── Files unified card ──────────────────────────────── */
.bd-files-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 8px;
}
@media (max-width: 700px) { .bd-files-grid { grid-template-columns: 1fr; } }
.bd-file-item {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r2);
    padding: 12px 14px;
    display: flex;
    flex-direction: column;
    gap: 5px;
    transition: border-color .2s, background .2s;
    position: relative;
    overflow: hidden;
}
.bd-file-item:hover { border-color: var(--border2); background: var(--card2); }
.bd-file-item::before {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 3px; height: 100%;
    border-radius: 2px 0 0 2px;
    background: var(--file-color, var(--border2));
    opacity: .8;
}
.bd-file-item.fi-ok::after {
    content: '●';
    position: absolute;
    top: 10px; right: 10px;
    font-size: 7px;
    color: var(--ok);
}
.bd-file-item.fi-miss::after {
    content: '●';
    position: absolute;
    top: 10px; right: 10px;
    font-size: 7px;
    color: var(--miss);
}
.bd-fi-top {
    display: flex;
    align-items: center;
    gap: 7px;
}
.bd-fi-icon { font-size: 16px; }
.bd-fi-name {
    font-size: 11px;
    font-family: monospace;
    color: #93c5fd;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
}
.bd-fi-cat {
    font-size: 10px;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: .4px;
}
.bd-fi-meta {
    font-size: 10px;
    color: var(--muted);
    display: flex;
    gap: 10px;
}
.bd-fi-meta .ok  { color: var(--ok); }
.bd-fi-meta .mis { color: var(--miss); }
.bd-fi-actions {
    display: flex;
    gap: 5px;
    margin-top: 2px;
}
.bd-btn-xs {
    background: transparent;
    border: 1px solid var(--border2);
    color: var(--muted2);
    font-size: 10px;
    padding: 3px 8px;
    border-radius: 4px;
    cursor: pointer;
    text-decoration: none;
    transition: all .15s;
    display: inline-flex;
    align-items: center;
    gap: 3px;
    line-height: 1;
}
.bd-btn-xs:hover { border-color: var(--muted2); color: var(--text); }
.bd-btn-xs.copied { border-color: var(--ok); color: var(--ok); }
.bd-files-divider {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 4px 0;
}
.bd-files-divider span {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: .6px;
    color: var(--muted);
    white-space: nowrap;
}
.bd-files-divider::before, .bd-files-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border);
}

/* ── Analytics section ───────────────────────────────── */
.bd-analytics-row {
    display: grid;
    grid-template-columns: repeat(4,1fr);
    gap: 1px;
    background: var(--border);
    border-radius: var(--r2);
    overflow: hidden;
}
.bd-analytic-cell {
    background: var(--card);
    padding: 14px 16px;
    text-align: center;
}
.bd-analytic-num {
    font-size: 26px;
    font-weight: 800;
    letter-spacing: -1px;
    line-height: 1;
    margin-bottom: 4px;
}
.bd-analytic-lbl {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: .5px;
    color: var(--muted);
}
@media (max-width: 480px) { .bd-analytics-row { grid-template-columns: repeat(2,1fr); } }

/* ── Agentic control plane ───────────────────────────── */
.bd-agentic-control-plane {
    border-color: rgba(20,184,166,.28);
    box-shadow: inset 0 0 0 1px rgba(20,184,166,.08), 0 0 28px rgba(20,184,166,.05);
}
.bd-agentic-summary {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1px;
    background: var(--border);
    border: 1px solid var(--border);
    border-radius: var(--r2);
    overflow: hidden;
    margin-bottom: 14px;
}
.bd-agentic-summary > div {
    background: var(--surface);
    padding: 14px 16px;
    min-width: 0;
}
.bd-agentic-kicker {
    display: block;
    color: var(--muted);
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0;
    margin-bottom: 6px;
}
.bd-agentic-summary strong {
    display: block;
    font-size: 22px;
    line-height: 1.1;
    margin-bottom: 5px;
    overflow-wrap: anywhere;
}
.bd-agentic-summary small {
    color: var(--muted2);
    display: block;
    font-size: 11px;
    line-height: 1.35;
}
.bd-agentic-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
}
.bd-agentic-panel {
    border: 1px solid var(--border);
    border-radius: var(--r2);
    padding: 14px;
    background: rgba(255,255,255,.02);
    min-width: 0;
}
.bd-agentic-panel h3 {
    color: #fff;
    font-family: 'Roboto Slab', Georgia, serif;
    font-size: 14px;
    line-height: 1.25;
    margin: 0 0 10px;
}
.bd-agentic-panel p {
    color: var(--muted2);
    font-size: 11px;
    line-height: 1.45;
    margin-top: 10px;
}
.bd-agentic-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 7px;
}
.bd-agentic-list li {
    align-items: center;
    border-bottom: 1px solid rgba(255,255,255,.05);
    display: flex;
    gap: 8px;
    justify-content: space-between;
    padding-bottom: 7px;
}
.bd-agentic-list li:last-child { border-bottom: none; padding-bottom: 0; }
.bd-agentic-list span {
    color: var(--muted2);
    font-size: 11px;
    min-width: 0;
    overflow-wrap: anywhere;
}
.bd-agentic-list strong {
    color: #fff;
    font-size: 11px;
    text-align: right;
    white-space: nowrap;
}
.bd-agentic-flow {
    border-bottom: 1px solid rgba(255,255,255,.05);
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 0 0 9px;
    margin-bottom: 9px;
}
.bd-agentic-flow:last-child { border-bottom: none; margin-bottom: 0; padding-bottom: 0; }
.bd-agentic-flow strong {
    color: #67e8f9;
    font-size: 11px;
}
.bd-agentic-flow span {
    color: var(--muted2);
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 10px;
    line-height: 1.4;
    overflow-wrap: anywhere;
}
.bd-agentic-attribution {
    border-color: rgba(6,182,212,.28);
    box-shadow: inset 0 0 0 1px rgba(6,182,212,.08), 0 0 28px rgba(6,182,212,.05);
}
.bd-attribution-metrics {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 14px;
}
.bd-attribution-metrics > div {
    min-height: 86px;
    padding: 16px;
    border: 1px solid var(--border);
    border-radius: var(--r2);
    background: var(--card2);
    min-width: 0;
}
.bd-attribution-metrics span {
    display: block;
    margin-bottom: 8px;
    color: var(--muted);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .7px;
    text-transform: uppercase;
}
.bd-attribution-metrics strong {
    display: block;
    font-family: 'Roboto Slab', Georgia, serif;
    font-size: 28px;
    line-height: 1.1;
    overflow-wrap: anywhere;
}
.bd-attribution-grid {
    display: grid;
    grid-template-columns: 1.15fr 1.35fr 1fr;
    gap: 12px;
}
@media (max-width: 1100px) {
    .bd-agentic-summary,
    .bd-agentic-grid,
    .bd-attribution-metrics,
    .bd-attribution-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
    .bd-agentic-summary,
    .bd-agentic-grid,
    .bd-attribution-metrics,
    .bd-attribution-grid { grid-template-columns: 1fr; }
    .bd-agentic-list li { align-items: flex-start; flex-direction: column; }
    .bd-agentic-list strong { text-align: left; white-space: normal; }
}

/* ── Crawlere ─────────────────────────────────────────── */
.bd-bot-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.bd-bot-chip {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r2);
    padding: 8px 14px;
    display: flex;
    flex-direction: column;
    gap: 2px;
    transition: border-color .15s;
}
.bd-bot-chip:hover { border-color: var(--gold); }
.bd-bot-count { font-size: 22px; font-weight: 800; color: var(--gold); line-height: 1; }
.bd-bot-name  { font-size: 11px; color: var(--muted2); }

/* ── Endpoint accesări ───────────────────────────────── */
.bd-ep-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 9px 0;
    border-bottom: 1px solid rgba(255,255,255,.04);
    gap: 10px;
}
.bd-ep-row:last-child { border-bottom: none; }
.bd-ep-name { font-size: 11px; font-family: monospace; color: #93c5fd; }
.bd-ep-bar {
    flex: 1;
    height: 3px;
    background: var(--border);
    border-radius: 2px;
    overflow: hidden;
    margin: 0 10px;
}
.bd-ep-bar-fill { height: 100%; background: linear-gradient(90deg, var(--blue), var(--cyan)); border-radius: 2px; }
.bd-ep-count { font-size: 12px; font-weight: 700; color: var(--text); min-width: 30px; text-align: right; }

/* ── Module grid ──────────────────────────────────────── */
.bd-module-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
    gap: 8px;
}
.bd-mod {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r2);
    padding: 12px 8px;
    text-align: center;
    transition: all .2s;
}
.bd-mod.active {
    border-color: rgba(128,0,32,.5);
    background: rgba(128,0,32,.07);
}
.bd-mod:hover { transform: translateY(-2px); border-color: var(--border2); }
.bd-mod.active:hover { border-color: var(--accent); }
.bd-mod-icon  { font-size: 20px; margin-bottom: 6px; }
.bd-mod-count { font-size: 22px; font-weight: 800; color: #fff; line-height: 1; margin-bottom: 3px; }
.bd-mod.active .bd-mod-count { color: #f87171; }
.bd-mod-label { font-size: 9px; color: var(--muted); line-height: 1.3; text-transform: uppercase; letter-spacing: .3px; }

/* ── Pages table ──────────────────────────────────────── */
.bd-pages-wrap { overflow-x: auto; }
.bd-pages-table { width: 100%; border-collapse: collapse; min-width: 680px; }
.bd-pages-table th {
    text-align: center;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: .4px;
    color: var(--muted);
    padding: 0 6px 10px;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}
.bd-pages-table th:first-child { text-align: left; padding-left: 0; }
.bd-pages-table td {
    padding: 9px 6px;
    border-bottom: 1px solid rgba(255,255,255,.04);
    text-align: center;
    font-size: 12px;
    vertical-align: middle;
}
.bd-pages-table td:first-child { text-align: left; max-width: 220px; padding-left: 0; }
.bd-pages-table tr:last-child td { border-bottom: none; }
.bd-pages-table tr.excl td { opacity: .4; }
.bd-page-link { color: #f87171; text-decoration: none; font-weight: 500; }
.bd-page-link:hover { text-decoration: underline; }
.bd-excl-badge { background:#3a1616; color:#f87171; font-size:10px; padding:1px 6px; border-radius:4px; margin-left:5px; }
.bd-cnt-badge {
    display: inline-block;
    background: rgba(128,0,32,.35);
    color: #fca5a5;
    font-size: 11px;
    font-weight: 700;
    padding: 1px 7px;
    border-radius: 20px;
    min-width: 22px;
    text-align: center;
}
.bd-cnt-total { font-weight: 800; color: #f87171; font-size: 14px; }
.bd-dash { color: var(--border2); }

/* ── Hide pages breakdown on mobile ─────────────────── */
@media (max-width: 768px) {
    .bd-pages-section { display: none !important; }
}

/* ── Cache info strip ─────────────────────────────────── */
.bd-cache-strip {
    display: flex;
    gap: 24px;
    flex-wrap: wrap;
    padding: 12px 22px;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    font-size: 12px;
}
.bd-cache-item { display: flex; align-items: center; gap: 6px; }
.bd-cache-item .lbl { color: var(--muted); }
.bd-cache-item .val { font-weight: 500; }
.bd-cache-item .val.ok { color: var(--ok); }
.bd-cache-item .val.miss { color: var(--miss); }
