/* =========================================================
   MimirOne — Admin pages (Users, User detail, AI Agents, Diagnostics)
   Dark navy / gold, same language as the rest of the app.
   The hero itself is app.css's .mo-page-hero.
   ========================================================= */

.mo-ad {
    --ad-gold: #d8a83e;
    --ad-gold-soft: rgba(216, 168, 62, .12);
    --ad-gold-line: rgba(216, 168, 62, .38);
    --ad-blue: #5aa9ff;
    --ad-green: #2bd3a1;
    --ad-amber: #f2a64a;
    --ad-red: #ef6b6b;
    --ad-line: rgba(120, 160, 210, .16);
    --ad-panel: linear-gradient(150deg, rgba(11, 26, 48, .92), rgba(5, 14, 27, .95));
    --ad-muted: #8d9bb2;
    --ad-ease: cubic-bezier(.2, .8, .2, 1);
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    padding: .75rem 0 5rem;
    color: #e6ecf5;
}

.mo-ad-muted { color: var(--ad-muted); }
.mo-ad-small { font-size: .82rem; }
.mo-ad a:not(.mo-ad-btn):not(.mo-ad-iconbtn) { color: #f0d79a; }

/* ---------- hero bits ---------- */
.mo-ad-hero { display: flex; align-items: center; gap: 2rem; flex-wrap: wrap; }
.mo-ad-hero-copy { flex: 1 1 22rem; min-width: 0; }
.mo-ad-hero h1 { margin: .75rem 0 .6rem; font-family: Georgia, "Times New Roman", serif; font-size: clamp(2rem, 4vw, 3rem); font-weight: 600; line-height: 1.05; color: #fff; }
.mo-ad-hero p { max-width: 40rem; margin: 0; font-size: 1rem; line-height: 1.6; color: #c3cbe0; }
.mo-ad-back { display: inline-flex; align-items: center; gap: .4rem; font-size: .85rem; color: #c3cbe0 !important; text-decoration: none; }
.mo-ad-back:hover { color: #f0d79a !important; }

.mo-ad-kpis { position: relative; display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 1.4rem; }
.mo-ad-kpi {
    display: flex; flex-direction: column; align-items: flex-start; min-width: 7.5rem;
    padding: .75rem 1.1rem; border-radius: 1.1rem; color: #fff; text-align: left;
    background: rgba(255, 255, 255, .07); border: 1px solid rgba(255, 255, 255, .14);
    transition: background .2s ease, border-color .2s ease, translate .2s ease;
    animation: mo-ad-pop .5s var(--ad-ease) backwards; animation-delay: calc(.2s + var(--i, 0) * 70ms);
}
button.mo-ad-kpi { cursor: pointer; font: inherit; }
button.mo-ad-kpi:hover, .mo-ad-kpi.is-active { background: rgba(216, 168, 62, .10); border-color: var(--ad-gold-line); translate: 0 -2px; }
.mo-ad-kpi b { font-family: Georgia, "Times New Roman", serif; font-size: 1.6rem; font-weight: 600; line-height: 1.1; }
.mo-ad-kpi span { font-size: .78rem; color: #c3cbe0; }
.mo-ad-kpi.is-warn b { color: var(--ad-amber); }
.mo-ad-kpi.is-bad b { color: var(--ad-red); }

.mo-ad-hero-actions { position: relative; display: flex; flex-wrap: wrap; gap: .6rem; }

/* ---------- buttons ---------- */
.mo-ad-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: .45rem;
    height: 2.5rem; padding: 0 1.1rem; border-radius: 999px; border: 1px solid var(--ad-line);
    background: rgba(255, 255, 255, .04); color: #e6ecf5; font: inherit; font-size: .88rem; font-weight: 600;
    text-decoration: none; cursor: pointer; white-space: nowrap;
    transition: background .2s ease, border-color .2s ease, color .2s ease, translate .2s ease;
}
.mo-ad-btn:hover:not(:disabled) { border-color: var(--ad-gold-line); color: #fff; background: rgba(216, 168, 62, .08); }
.mo-ad-btn:disabled { opacity: .5; cursor: not-allowed; }
.mo-ad-btn.is-gold { background: var(--ad-gold); border-color: var(--ad-gold); color: var(--mo-ink, #111b26); }
.mo-ad-btn.is-gold:hover:not(:disabled) { background: #e7b84b; color: var(--mo-ink, #111b26); translate: 0 -1px; }
.mo-ad-btn.is-green { border-color: rgba(43, 211, 161, .45); color: #7ee8c6; }
.mo-ad-btn.is-green:hover:not(:disabled) { background: rgba(43, 211, 161, .12); border-color: var(--ad-green); color: #fff; }
.mo-ad-btn.is-danger { border-color: rgba(239, 107, 107, .45); color: #ff9c9c; }
.mo-ad-btn.is-danger:hover:not(:disabled) { background: rgba(239, 107, 107, .14); border-color: var(--ad-red); color: #fff; }
.mo-ad-btn.is-solid-danger { background: #c94a4a; border-color: #c94a4a; color: #fff; }
.mo-ad-btn.is-solid-danger:hover:not(:disabled) { background: #dd5656; }
.mo-ad-btn.is-sm { height: 2rem; padding: 0 .85rem; font-size: .8rem; }
.mo-ad-btn.is-ghost { background: transparent; }

.mo-ad-iconbtn {
    position: relative; display: inline-grid; place-items: center; width: 2.1rem; height: 2.1rem;
    border-radius: .7rem; border: 1px solid transparent; background: transparent; color: var(--ad-muted);
    cursor: pointer; text-decoration: none; transition: background .2s ease, color .2s ease, border-color .2s ease;
}
.mo-ad-iconbtn:hover:not(:disabled) { background: rgba(255, 255, 255, .06); border-color: var(--ad-line); color: #fff; }
.mo-ad-iconbtn.is-danger:hover:not(:disabled) { color: #ff9c9c; border-color: rgba(239, 107, 107, .4); background: rgba(239, 107, 107, .1); }
.mo-ad-iconbtn:disabled { opacity: .45; cursor: not-allowed; }

/* ---------- panels ---------- */
.mo-ad-panel {
    position: relative; border-radius: 1.25rem; border: 1px solid var(--ad-line);
    background: var(--ad-panel); box-shadow: 0 16px 44px rgba(0, 0, 0, .3), inset 0 1px 0 rgba(255, 255, 255, .04);
    animation: mo-ad-up .55s var(--ad-ease) backwards; animation-delay: calc(var(--i, 0) * 80ms);
}
.mo-ad-panel-head {
    display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
    padding: 1.1rem 1.4rem; border-bottom: 1px solid var(--ad-line);
}
.mo-ad-panel-title { display: flex; align-items: center; gap: .6rem; margin: 0; font-size: 1.05rem; font-weight: 700; color: #fff; }
.mo-ad-panel-title i { color: var(--ad-gold); }
.mo-ad-panel-sub { margin: .2rem 0 0; font-size: .82rem; color: var(--ad-muted); }
.mo-ad-panel-body { padding: 1.2rem 1.4rem; }
.mo-ad-count { display: inline-grid; place-items: center; min-width: 1.6rem; height: 1.6rem; padding: 0 .45rem; border-radius: 999px; background: rgba(255, 255, 255, .08); font-size: .75rem; font-weight: 700; color: #dfe6f1; }

/* ---------- needs-attention strip ---------- */
.mo-ad-attn { border-color: rgba(242, 166, 74, .35); background: radial-gradient(420px circle at 0% 0%, rgba(242, 166, 74, .10), transparent 70%), var(--ad-panel); }
.mo-ad-attn .mo-ad-panel-title i { color: var(--ad-amber); }
.mo-ad-attn-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(19rem, 1fr)); gap: .75rem; padding: 1.1rem 1.4rem 1.3rem; }
.mo-ad-attn-item {
    display: flex; align-items: center; gap: .8rem; padding: .8rem .9rem; border-radius: 1rem;
    border: 1px solid var(--ad-line); background: rgba(255, 255, 255, .03);
}
.mo-ad-attn-item .mo-ad-person { flex: 1 1 auto; }
.mo-ad-attn-actions { display: flex; gap: .35rem; }

/* ---------- toolbar ---------- */
.mo-ad-toolbar { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; padding: 1rem 1.4rem; border-bottom: 1px solid var(--ad-line); }
.mo-ad-chips { display: flex; flex-wrap: wrap; gap: .4rem; }
.mo-ad-chip {
    display: inline-flex; align-items: center; gap: .4rem; height: 2.1rem; padding: 0 .9rem; border-radius: 999px;
    border: 1px solid var(--ad-line); background: transparent; color: #c3cbe0; font: inherit; font-size: .82rem; font-weight: 600; cursor: pointer;
    transition: background .2s ease, border-color .2s ease, color .2s ease;
}
.mo-ad-chip span { font-size: .72rem; opacity: .7; }
.mo-ad-chip:hover { border-color: var(--ad-gold-line); color: #fff; }
.mo-ad-chip.is-active { background: var(--ad-gold-soft); border-color: var(--ad-gold-line); color: #f0d79a; }
.mo-ad-sep { width: 1px; height: 1.4rem; background: var(--ad-line); margin: 0 .2rem; }
.mo-ad-search { position: relative; margin-left: auto; min-width: 16rem; }
.mo-ad-search i { position: absolute; left: .85rem; top: 50%; translate: 0 -50%; color: var(--ad-muted); pointer-events: none; }
.mo-ad-search input, .mo-ad-input, .mo-ad-select, .mo-ad-textarea {
    width: 100%; border-radius: .8rem; border: 1px solid var(--ad-line); background: rgba(3, 10, 20, .55);
    color: #e6ecf5; font: inherit; font-size: .9rem; outline: none; transition: border-color .2s ease, box-shadow .2s ease;
}
.mo-ad-search input { height: 2.4rem; padding: 0 .9rem 0 2.3rem; border-radius: 999px; }
.mo-ad-input, .mo-ad-select { height: 2.6rem; padding: 0 .9rem; }
.mo-ad-textarea { padding: .8rem .95rem; line-height: 1.55; resize: vertical; }
.mo-ad-textarea.is-code { font-family: "IBM Plex Mono", ui-monospace, SFMono-Regular, Consolas, monospace; font-size: .82rem; }
.mo-ad-select option { background: #0b1929; }
.mo-ad-search input:focus, .mo-ad-input:focus, .mo-ad-select:focus, .mo-ad-textarea:focus { border-color: var(--ad-gold-line); box-shadow: 0 0 0 3px rgba(216, 168, 62, .12); }
.mo-ad-label { display: block; margin-bottom: .35rem; font-size: .76rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--ad-muted); }
.mo-ad-help { margin-top: .35rem; font-size: .78rem; line-height: 1.45; color: var(--ad-muted); }
.mo-ad-field { min-width: 0; }
.mo-ad-grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); }

/* ---------- user table ---------- */
.mo-ad-table { width: 100%; border-collapse: collapse; font-size: .88rem; }
.mo-ad-table th {
    padding: .7rem 1rem; text-align: left; font-size: .7rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
    color: var(--ad-muted); border-bottom: 1px solid var(--ad-line); white-space: nowrap;
}
.mo-ad-table td { padding: .75rem 1rem; border-bottom: 1px solid rgba(120, 160, 210, .08); vertical-align: middle; }
.mo-ad-table tbody tr { transition: background .2s ease; }
.mo-ad-table tbody tr.is-link { cursor: pointer; }
.mo-ad-table tbody tr:hover { background: rgba(216, 168, 62, .045); }
.mo-ad-table tbody tr:last-child td { border-bottom: 0; }
.mo-ad-table .is-num { text-align: right; font-variant-numeric: tabular-nums; }
.mo-ad-table .is-actions { width: 1%; white-space: nowrap; text-align: right; }
.mo-ad-table-wrap { overflow-x: auto; }

.mo-ad-person { display: flex; align-items: center; gap: .75rem; min-width: 0; }
.mo-ad-person-copy { min-width: 0; }
.mo-ad-person-name { font-weight: 700; color: #fff; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mo-ad-person-mail { font-size: .8rem; color: var(--ad-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mo-ad-avatar {
    flex: none; display: grid; place-items: center; width: 2.4rem; height: 2.4rem; border-radius: 50%;
    font-size: .8rem; font-weight: 800; letter-spacing: .02em; color: #f0d79a;
    background: radial-gradient(circle at 30% 25%, rgba(216, 168, 62, .32), rgba(216, 168, 62, .06) 70%); border: 1px solid rgba(216, 168, 62, .4);
}
.mo-ad-avatar.is-blue { color: #a9d1ff; background: radial-gradient(circle at 30% 25%, rgba(90, 169, 255, .32), rgba(90, 169, 255, .06) 70%); border-color: rgba(90, 169, 255, .4); }
.mo-ad-avatar.is-lg { width: 4.4rem; height: 4.4rem; font-size: 1.35rem; }

.mo-ad-dot { display: inline-flex; align-items: center; gap: .4rem; font-size: .8rem; font-weight: 600; white-space: nowrap; }
.mo-ad-dot::before { content: ""; width: .5rem; height: .5rem; border-radius: 50%; background: currentColor; box-shadow: 0 0 8px currentColor; }
.mo-ad-dot.is-ok { color: var(--ad-green); }
.mo-ad-dot.is-warn { color: var(--ad-amber); }
.mo-ad-dot.is-off { color: #7d8aa0; }
.mo-ad-dot.is-bad { color: var(--ad-red); }

.mo-ad-empty { padding: 2.5rem 1.4rem; text-align: center; color: var(--ad-muted); }
.mo-ad-empty i { display: block; margin-bottom: .6rem; font-size: 1.8rem; color: rgba(216, 168, 62, .6); }
.mo-ad-loading { display: grid; place-items: center; padding: 3rem; }

/* ---------- alerts + toast ---------- */
.mo-ad-alert { display: flex; align-items: flex-start; gap: .6rem; padding: .8rem 1rem; border-radius: .9rem; font-size: .88rem; line-height: 1.45; border: 1px solid; }
.mo-ad-alert.is-bad { color: #ffc0c0; border-color: rgba(239, 107, 107, .4); background: rgba(239, 107, 107, .08); }
.mo-ad-alert.is-warn { color: #ffd9a8; border-color: rgba(242, 166, 74, .4); background: rgba(242, 166, 74, .08); }
.mo-ad-alert.is-ok { color: #b6f2dd; border-color: rgba(43, 211, 161, .4); background: rgba(43, 211, 161, .08); }
.mo-ad-alert.is-info { color: #c9e2ff; border-color: rgba(90, 169, 255, .35); background: rgba(90, 169, 255, .07); }

.mo-ad-toast {
    position: fixed; right: 1.5rem; bottom: 1.5rem; z-index: 1080; display: flex; align-items: center; gap: .7rem;
    max-width: 26rem; padding: .85rem 1rem .85rem 1.1rem; border-radius: 1rem; font-size: .9rem; color: #e6ecf5;
    background: linear-gradient(150deg, #10233f, #081527); border: 1px solid rgba(43, 211, 161, .45);
    box-shadow: 0 18px 50px rgba(0, 0, 0, .5); animation: mo-ad-toast .4s var(--ad-ease) backwards;
}
.mo-ad-toast > i { color: var(--ad-green); font-size: 1.15rem; }
.mo-ad-toast.is-bad { border-color: rgba(239, 107, 107, .5); }
.mo-ad-toast.is-bad > i { color: var(--ad-red); }
.mo-ad-toast span { flex: 1 1 auto; }

/* ---------- modal ---------- */
.mo-ad-scrim {
    position: fixed; inset: 0; z-index: 1070; display: grid; place-items: center; padding: 1rem;
    background: rgba(2, 7, 15, .66); backdrop-filter: blur(6px); animation: mo-ad-fade .2s ease backwards;
}
.mo-ad-modal {
    width: min(36rem, 100%); max-height: calc(100vh - 2rem); overflow: auto; border-radius: 1.4rem;
    border: 1px solid var(--ad-gold-line, rgba(216, 168, 62, .38));
    background: linear-gradient(155deg, #0e2140, #071324 70%); color: #e6ecf5;
    box-shadow: 0 30px 80px rgba(0, 0, 0, .6); animation: mo-ad-pop .3s cubic-bezier(.2, .8, .2, 1) backwards;
}
.mo-ad-modal.is-danger { border-color: rgba(239, 107, 107, .45); }
.mo-ad-modal-head { display: flex; align-items: flex-start; gap: .9rem; padding: 1.4rem 1.5rem .4rem; }
.mo-ad-modal-ic { flex: none; display: grid; place-items: center; width: 2.6rem; height: 2.6rem; border-radius: 50%; color: #f0d79a; background: rgba(216, 168, 62, .12); border: 1px solid rgba(216, 168, 62, .4); }
.mo-ad-modal.is-danger .mo-ad-modal-ic { color: #ff9c9c; background: rgba(239, 107, 107, .12); border-color: rgba(239, 107, 107, .45); }
.mo-ad-modal-head h2 { margin: .1rem 0 .25rem; font-size: 1.2rem; font-weight: 700; color: #fff; }
.mo-ad-modal-head p { margin: 0; font-size: .88rem; color: var(--ad-muted, #8d9bb2); }
.mo-ad-modal-body { display: flex; flex-direction: column; gap: 1rem; padding: 1rem 1.5rem; }
.mo-ad-modal-foot { display: flex; justify-content: flex-end; gap: .6rem; padding: .6rem 1.5rem 1.4rem; }
.mo-ad-seg { display: inline-flex; padding: .25rem; border-radius: 999px; border: 1px solid var(--ad-line, rgba(120, 160, 210, .16)); background: rgba(3, 10, 20, .5); }
.mo-ad-seg button { height: 2rem; padding: 0 1rem; border: 0; border-radius: 999px; background: transparent; color: #c3cbe0; font: inherit; font-size: .84rem; font-weight: 600; cursor: pointer; }
.mo-ad-seg button.is-active { background: #d8a83e; color: #111b26; }
.mo-ad-loss { margin: 0; padding-left: 1.1rem; font-size: .88rem; line-height: 1.7; color: #dfe6f1; }

/* ---------- tabs ---------- */
.mo-ad-tabs { display: flex; gap: .3rem; flex-wrap: wrap; padding: .35rem; border-radius: 999px; border: 1px solid var(--ad-line); background: rgba(3, 10, 20, .5); width: fit-content; max-width: 100%; }
.mo-ad-tab { display: inline-flex; align-items: center; gap: .45rem; height: 2.3rem; padding: 0 1.05rem; border: 0; border-radius: 999px; background: transparent; color: #c3cbe0; font: inherit; font-size: .87rem; font-weight: 600; cursor: pointer; transition: background .2s ease, color .2s ease; }
.mo-ad-tab:hover { color: #fff; }
.mo-ad-tab.is-active { background: var(--ad-gold); color: var(--mo-ink, #111b26); }
.mo-ad-tab .mo-ad-count { height: 1.35rem; min-width: 1.35rem; font-size: .7rem; }
.mo-ad-tab.is-active .mo-ad-count { background: rgba(17, 27, 38, .18); color: var(--mo-ink, #111b26); }

/* ---------- stat tiles ---------- */
.mo-ad-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr)); gap: .8rem; }
.mo-ad-tile { padding: .9rem 1rem; border-radius: 1rem; border: 1px solid var(--ad-line); background: rgba(255, 255, 255, .03); }
.mo-ad-tile b { display: block; font-family: Georgia, "Times New Roman", serif; font-size: 1.45rem; font-weight: 600; color: #fff; }
.mo-ad-tile span { font-size: .78rem; color: var(--ad-muted); }

/* ---------- lists (nodes, opportunities, calls) ---------- */
.mo-ad-list { display: flex; flex-direction: column; gap: .6rem; }
.mo-ad-item { padding: .85rem 1rem; border-radius: 1rem; border: 1px solid var(--ad-line); background: rgba(255, 255, 255, .025); }
.mo-ad-item-title { font-weight: 700; color: #fff; }
.mo-ad-item-text { margin-top: .25rem; font-size: .85rem; line-height: 1.5; color: #aab6c9; }
.mo-ad-item-meta { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem; margin-top: .55rem; font-size: .78rem; color: var(--ad-muted); }
.mo-ad-group-label { margin: 1.1rem 0 .55rem; font-size: .72rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--ad-muted); }
.mo-ad-group-label:first-child { margin-top: 0; }

.mo-ad-opp { border-radius: 1rem; border: 1px solid var(--ad-line); background: rgba(255, 255, 255, .025); overflow: hidden; }
.mo-ad-opp > summary { list-style: none; display: flex; align-items: center; gap: .8rem; flex-wrap: wrap; padding: 1rem 1.1rem; cursor: pointer; }
.mo-ad-opp > summary::-webkit-details-marker { display: none; }
.mo-ad-opp > summary:hover { background: rgba(216, 168, 62, .04); }
.mo-ad-opp > summary .bi-chevron-right { transition: rotate .2s ease; color: var(--ad-muted); }
.mo-ad-opp[open] > summary .bi-chevron-right { rotate: 90deg; }
.mo-ad-opp-title { flex: 1 1 14rem; min-width: 0; }
.mo-ad-opp-title b { display: block; color: #fff; }
.mo-ad-opp-title span { font-size: .8rem; color: var(--ad-muted); }
.mo-ad-opp-body { padding: .2rem 1.1rem 1.1rem 2.9rem; display: flex; flex-direction: column; gap: .8rem; }
.mo-ad-trav { padding: .85rem 1rem; border-radius: .9rem; border: 1px solid rgba(120, 160, 210, .1); background: rgba(3, 10, 20, .35); }
.mo-ad-trav-head { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; }
.mo-ad-rep { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; padding: .45rem 0; border-top: 1px dashed rgba(120, 160, 210, .12); font-size: .85rem; }
.mo-ad-rep:first-of-type { margin-top: .5rem; }
.mo-ad-turn { padding: .5rem .8rem; border-left: 2px solid rgba(216, 168, 62, .4); margin: .5rem 0; font-size: .85rem; }

.mo-ad-call { border-radius: .9rem; border: 1px solid var(--ad-line); background: rgba(255, 255, 255, .025); overflow: hidden; }
.mo-ad-call.is-failed { border-color: rgba(239, 107, 107, .35); }
.mo-ad-call-row { display: grid; grid-template-columns: 1.2rem minmax(9rem, 1.4fr) minmax(8rem, 1fr) 5rem 9rem 6rem; align-items: center; gap: .8rem; width: 100%; padding: .7rem 1rem; border: 0; background: transparent; color: inherit; font: inherit; font-size: .85rem; text-align: left; cursor: pointer; }
.mo-ad-call-row:hover { background: rgba(216, 168, 62, .045); }
.mo-ad-call-row .bi-chevron-right { color: var(--ad-muted); transition: rotate .2s ease; }
.mo-ad-call.is-open .bi-chevron-right { rotate: 90deg; }
.mo-ad-call-op { font-weight: 700; color: #fff; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mo-ad-call-body { padding: .2rem 1rem 1rem 3rem; }
.mo-ad-json-head { display: flex; align-items: center; justify-content: space-between; margin: .7rem 0 .35rem; font-size: .75rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--ad-muted); }
.mo-ad-json { max-height: 22rem; overflow: auto; margin: 0; padding: .8rem .9rem; border-radius: .8rem; border: 1px solid var(--ad-line); background: rgba(2, 7, 15, .7); color: #cfe0f5; font-family: "IBM Plex Mono", ui-monospace, Consolas, monospace; font-size: .76rem; line-height: 1.5; white-space: pre-wrap; word-break: break-word; }

/* ---------- AI agents ---------- */
.mo-ad-agents { display: grid; grid-template-columns: repeat(auto-fill, minmax(20rem, 1fr)); gap: 1rem; }
.mo-ad-agent {
    position: relative; display: flex; flex-direction: column; gap: .7rem; padding: 1.3rem 1.35rem 1.15rem; border-radius: 1.25rem;
    border: 1px solid var(--ad-line); background: radial-gradient(360px circle at 100% 0%, rgba(216, 168, 62, .10), transparent 60%), var(--ad-panel);
    color: inherit; text-decoration: none; box-shadow: 0 14px 40px rgba(0, 0, 0, .3);
    transition: translate .3s var(--ad-ease), border-color .3s ease, box-shadow .3s ease;
    animation: mo-ad-up .55s var(--ad-ease) backwards; animation-delay: calc(var(--i, 0) * 60ms);
}
.mo-ad-agent:hover { translate: 0 -3px; border-color: var(--ad-gold-line); box-shadow: 0 20px 50px rgba(0, 0, 0, .4), 0 0 28px rgba(216, 168, 62, .1); color: inherit; }
.mo-ad-agent.is-off { opacity: .72; }
.mo-ad-agent-top { display: flex; align-items: flex-start; gap: .9rem; }
.mo-ad-agent-ic { flex: none; display: grid; place-items: center; width: 2.8rem; height: 2.8rem; border-radius: .95rem; font-size: 1.2rem; color: #f0d79a; background: rgba(216, 168, 62, .1); border: 1px solid rgba(216, 168, 62, .35); }
.mo-ad-agent h3 { margin: 0; font-size: 1.08rem; font-weight: 700; color: #fff; }
.mo-ad-agent code { font-size: .75rem; color: var(--ad-muted); }
.mo-ad-agent-desc { margin: 0; font-size: .86rem; line-height: 1.5; color: #aab6c9; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.mo-ad-agent-meta { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: auto; padding-top: .6rem; border-top: 1px solid rgba(120, 160, 210, .1); }
.mo-ad-pill { display: inline-flex; align-items: center; gap: .3rem; padding: .2rem .6rem; border-radius: 999px; font-size: .74rem; color: #c3cbe0; background: rgba(255, 255, 255, .05); border: 1px solid rgba(255, 255, 255, .08); }
.mo-ad-agent-cta { position: absolute; right: 1.2rem; top: 1.3rem; color: var(--ad-muted); transition: translate .25s ease, color .25s ease; }
.mo-ad-agent:hover .mo-ad-agent-cta { translate: 3px 0; color: #f0d79a; }

/* agent configure page: section nav + sticky save bar */
.mo-ad-layout { display: grid; grid-template-columns: 13rem minmax(0, 1fr); gap: 1.5rem; align-items: start; }
.mo-ad-nav { position: sticky; top: 5rem; display: flex; flex-direction: column; gap: .2rem; padding: .6rem; border-radius: 1.1rem; border: 1px solid var(--ad-line); background: var(--ad-panel); }
.mo-ad-nav a { display: flex; align-items: center; gap: .6rem; padding: .55rem .75rem; border-radius: .7rem; font-size: .88rem; font-weight: 600; color: #c3cbe0 !important; text-decoration: none; }
.mo-ad-nav a:hover { background: rgba(216, 168, 62, .08); color: #fff !important; }
.mo-ad-nav a i { color: var(--ad-gold); }
.mo-ad-sections { display: flex; flex-direction: column; gap: 1.25rem; min-width: 0; }
.mo-ad-sections > section { scroll-margin-top: 5rem; }
.mo-ad-check { display: flex; align-items: flex-start; gap: .8rem; padding: .8rem .9rem; border-radius: .9rem; border: 1px solid var(--ad-line); background: rgba(255, 255, 255, .02); cursor: pointer; transition: border-color .2s ease, background .2s ease; }
.mo-ad-check:hover { border-color: var(--ad-gold-line); }
.mo-ad-check.is-on { border-color: rgba(216, 168, 62, .45); background: rgba(216, 168, 62, .06); }
.mo-ad-check input { margin-top: .2rem; accent-color: #d8a83e; width: 1.05rem; height: 1.05rem; flex: none; }
.mo-ad-check b { display: block; color: #fff; font-size: .92rem; }
.mo-ad-check small { display: block; margin-top: .15rem; color: var(--ad-muted); font-size: .8rem; line-height: 1.45; }
.mo-ad-checks { display: grid; grid-template-columns: repeat(auto-fill, minmax(17rem, 1fr)); gap: .6rem; }

.mo-ad-savebar {
    position: sticky; bottom: 1rem; z-index: 20; display: flex; align-items: center; gap: 1rem; flex-wrap: wrap;
    padding: .8rem 1rem .8rem 1.3rem; border-radius: 1.1rem; border: 1px solid var(--ad-gold-line);
    background: linear-gradient(150deg, rgba(16, 35, 63, .96), rgba(8, 21, 39, .97)); backdrop-filter: blur(8px);
    box-shadow: 0 18px 50px rgba(0, 0, 0, .5); animation: mo-ad-up .35s var(--ad-ease) backwards;
}
.mo-ad-savebar > span { flex: 1 1 auto; font-size: .9rem; color: #f0d79a; }
.mo-ad-savebar > span i { margin-right: .4rem; }

.mo-ad-rev { padding: .8rem .9rem; border-radius: .9rem; border: 1px solid var(--ad-line); background: rgba(3, 10, 20, .45); }
.mo-ad-rev-head { display: flex; align-items: center; justify-content: space-between; gap: .6rem; font-size: .8rem; color: var(--ad-muted); }

/* diagnostics */
.mo-ad .card { border-radius: 1.25rem; border: 1px solid var(--ad-line) !important; background: var(--ad-panel) !important; box-shadow: 0 16px 44px rgba(0, 0, 0, .3) !important; overflow: hidden; }
.mo-ad .card-header { padding: 1rem 1.3rem; background: transparent; border-bottom: 1px solid var(--ad-line); font-weight: 700; color: #fff; }
.mo-ad .card-header .bi { color: var(--ad-gold) !important; }
.mo-ad .card-body { padding: 1.2rem 1.3rem; }
.mo-ad-section-title { display: flex; align-items: center; gap: .6rem; margin: .5rem 0 -.5rem; font-size: .78rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: #f0d79a; }
.mo-ad-section-title::after { content: ""; flex: 1; height: 1px; background: linear-gradient(90deg, rgba(216, 168, 62, .35), transparent); }

/* ---------- motion ---------- */
@keyframes mo-ad-up { from { opacity: 0; translate: 0 14px; } }
@keyframes mo-ad-pop { from { opacity: 0; scale: .95; } }
@keyframes mo-ad-fade { from { opacity: 0; } }
@keyframes mo-ad-toast { from { opacity: 0; translate: 0 16px; } }

@media (max-width: 900px) {
    .mo-ad-layout { grid-template-columns: 1fr; }
    .mo-ad-nav { position: static; flex-direction: row; flex-wrap: wrap; }
    .mo-ad-search { margin-left: 0; min-width: 0; width: 100%; }
    .mo-ad-call-row { grid-template-columns: 1.2rem minmax(0, 1fr) auto; }
    .mo-ad-call-row .is-hide-sm { display: none; }
    .mo-ad-opp-body { padding-left: 1.1rem; }
    .mo-ad-table .is-hide-sm { display: none; }
}
@media (prefers-reduced-motion: reduce) {
    .mo-ad *, .mo-ad-modal, .mo-ad-scrim, .mo-ad-toast { animation: none !important; transition: none !important; }
}

/* bootstrap bits still used inside admin pages (diagnostics forms, skill library) */
.mo-ad .table { --bs-table-bg: transparent; --bs-table-color: #dfe6f1; --bs-table-border-color: rgba(120, 160, 210, .12); --bs-table-active-bg: rgba(216, 168, 62, .06); }
.mo-ad .form-control, .mo-ad .form-select { background-color: rgba(3, 10, 20, .55); border-color: rgba(120, 160, 210, .16); color: #e6ecf5; border-radius: .7rem; }
.mo-ad .form-control:focus, .mo-ad .form-select:focus { border-color: rgba(216, 168, 62, .38); box-shadow: 0 0 0 3px rgba(216, 168, 62, .12); }
.mo-ad .btn { border-radius: 999px; }

/* prompt diff */
.mo-ad-diff-bar { display: flex; align-items: center; justify-content: space-between; gap: .8rem; flex-wrap: wrap; margin-top: .8rem; font-size: .8rem; color: var(--ad-muted, #8d9bb2); }
.mo-ad-diff { max-height: 32rem; }
.mo-ad-del, .mo-ad-ins { padding: .05rem .15rem; border-radius: .25rem; color: #fff; }
.mo-ad-del { background: rgba(239, 107, 107, .32); box-shadow: inset 0 -2px 0 rgba(239, 107, 107, .9); text-decoration: line-through; text-decoration-color: rgba(255, 180, 180, .7); }
.mo-ad-ins { background: rgba(43, 211, 161, .26); box-shadow: inset 0 -2px 0 rgba(43, 211, 161, .95); }
.mo-ad-diff-bar mark { text-decoration: none; }
.mo-ad-fold { display: block; margin: .35rem 0; padding: .2rem .6rem; border-radius: .4rem; background: rgba(255, 255, 255, .05); color: var(--ad-muted, #8d9bb2); font-style: italic; text-align: center; }
