/* Analytics is deliberately scoped: existing approval screens stay unchanged. */
.cm-analytics { --an-blue:#315cdb; --an-ink:#15253c; --an-muted:#6f7e93; --an-line:#e5eaf2; color:var(--an-ink); }
.cm-analytics button,.cm-analytics input,.cm-analytics select { font:inherit; }
.cm-analytics button { border:1px solid #dce3ef; border-radius:9px; padding:9px 13px; background:#fff; color:#314563; font-weight:650; cursor:pointer; transition:background .15s,box-shadow .15s; }
.cm-analytics button:hover:not(:disabled) { background:#edf3ff; border-color:#b6c8fa; }
.cm-analytics button:disabled { opacity:.45; cursor:not-allowed; }
.cm-analytics :focus-visible { outline:3px solid #92b2ff; outline-offset:3px; }
.an-tools { display:flex; align-items:center; justify-content:space-between; gap:16px; margin:2px 0 18px; }
.an-kicker { display:block; color:#557ad4; font-size:10px; font-weight:800; letter-spacing:.16em; margin-bottom:6px; }
.cm-analytics h2 { font-size:17px; font-weight:750; line-height:1.45; margin:0; }
.an-actions { display:flex; flex-wrap:wrap; gap:8px; align-items:center; }
.an-filters { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:14px; background:#fff; padding:20px; border:1px solid var(--an-line); border-radius:15px; }
.an-filters label { display:flex; flex-direction:column; gap:7px; min-width:0; font-size:11px; color:#54657d; font-weight:650; }
.an-filters input,.an-filters select,.an-panel-head select { width:100%; min-width:0; height:39px; border:1px solid #dce4f0; border-radius:8px; padding:7px 10px; background:#fafbfd; color:#263b57; font-size:12px; }
.an-filters .an-search { grid-column:span 2; }
.an-filter-note { grid-column:span 2; align-self:center; font-size:11px; line-height:1.65; color:var(--an-muted); }
.an-notice { font-size:13px; line-height:1.7; color:#315cdb; }
.an-notice:not(:empty) { padding:12px 0; }
.an-meta { display:flex; justify-content:space-between; flex-wrap:wrap; gap:8px; margin:19px 0 12px; font-size:11px; color:var(--an-muted); }
.an-meta b { color:#34445e; }
.an-kpis { display:grid; grid-template-columns:repeat(6,minmax(0,1fr)); gap:12px; margin-bottom:20px; }
.an-kpi { position:relative; display:flex; flex-direction:column; gap:10px; padding:17px 16px; border:1px solid var(--an-line); background:linear-gradient(160deg,#fff,#f8faff); border-radius:14px; overflow:hidden; }
.an-kpi:before { content:""; position:absolute; width:36px; height:4px; background:#6689ef; right:16px; top:0; border-radius:0 0 4px 4px; }
.an-kpi>span { font-size:11px; font-weight:650; color:#64758c; min-height:17px; }
.an-kpi>strong { font-size:clamp(20px,2.1vw,31px); letter-spacing:-.04em; font-variant-numeric:tabular-nums; line-height:1.2; }
.an-kpi>small { color:#8a98aa; font-size:10px; }
.an-kpi.red { background:linear-gradient(160deg,#fff,#fff3f3); }
.an-kpi.red:before { background:#df6c7a; }
.an-kpi.red>strong { color:#bc354f; }
.an-kpi.green:before { background:#46a88c; }
.an-kpi.green>strong { color:#158368; }
.an-primary-grid { display:grid; grid-template-columns:minmax(0,1fr) 285px; gap:18px; margin-bottom:20px; align-items:start; }
.an-panel { min-width:0; padding:20px; border:1px solid var(--an-line); border-radius:15px; background:#fff; box-shadow:0 3px 14px #263c6404; margin-bottom:20px; }
.an-primary-grid>.an-panel { margin:0; }
.an-panel-head { display:flex; align-items:flex-start; justify-content:space-between; gap:18px; margin-bottom:18px; flex-wrap:wrap; }
.an-panel-head p,.an-description { color:var(--an-muted); font-size:11px; line-height:1.75; margin:6px 0 0; max-width:760px; }
.an-panel-head select { width:auto; max-width:230px; flex-shrink:0; }
.an-scroll { overflow-x:auto; overscroll-behavior-x:contain; }
.cm-analytics table { width:100%; border-collapse:collapse; font-size:12px; font-variant-numeric:tabular-nums; }
.cm-analytics th { background:#f6f8fc; color:#78879b; font-size:10px; font-weight:650; padding:12px 10px; white-space:nowrap; text-align:left; border-bottom:1px solid var(--an-line); }
.cm-analytics td { padding:14px 10px; border-bottom:1px solid #eef1f6; vertical-align:middle; line-height:1.65; }
.cm-analytics tr:last-child td { border-bottom:0; }
.cm-analytics tbody tr:hover { background:#fafcff; }
.cm-analytics td:first-child { min-width:105px; }
.an-cell-note { display:block; font-size:10px; color:#8693a4; font-weight:400; margin-top:3px; }
.cm-analytics button.an-dept { border:0; background:none; color:#324e7a; padding:0; text-align:left; white-space:nowrap; font-size:12px; }
.an-pill { display:inline-block; border-radius:6px; padding:3px 8px; background:#f0f4fa; color:#67778e; font-size:11px; font-weight:700; white-space:nowrap; }
.an-pill.red { background:#fff0f2; color:#c44459; }
.an-pill.amber { background:#fff4e1; color:#9a6816; }
.an-danger { color:#c44459; font-weight:650; }
.an-progress { height:4px; width:65px; background:#edf1f8; border-radius:4px; overflow:hidden; margin-bottom:5px; }
.an-progress>span { display:block; height:100%; background:#4a7bda; border-radius:4px; }
.an-focus { background:radial-gradient(ellipse at top right,#31467b00 0,#182944 80%),linear-gradient(135deg,#243e69,#14253f); color:#fff; padding:23px 20px; border-radius:15px; box-shadow:0 10px 25px #22395c13; }
.an-focus .an-kicker { color:#90b3ff; }
.an-focus h2 { font-size:38px; letter-spacing:-.05em; margin:12px 0 7px; }
.an-focus h2>small { font-size:11px; color:#b8c7df; font-weight:500; letter-spacing:0; }
.an-focus>p { font-size:11px; color:#a5b7d4; line-height:1.8; }
.cm-analytics .an-focus-item { display:grid; grid-template-columns:24px minmax(0,1fr); gap:8px; width:100%; text-align:left; padding:15px 0; border:0; border-bottom:1px solid #ffffff12; border-radius:0; background:transparent; color:#fff; }
.cm-analytics .an-focus-item:hover { background:#ffffff08; border-color:#ffffff15; }
.an-rank { color:#6385bd; font-size:11px; padding-top:2px; }
.an-focus-item>span>strong { display:block; font-size:12px; }
.an-focus-item>span>span { display:block; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; font-size:10px; color:#9eb0cc; margin-top:4px; font-weight:400; }
.an-focus-item>b { grid-column:2; color:#ffb29b; font-size:12px; }
.an-quality { margin-top:18px; padding-top:14px; border-top:1px solid #ffffff15; color:#96abcc; font-size:10px; line-height:1.9; }
.an-focus-empty { padding:26px 0; font-size:12px; color:#b9cae2; line-height:1.8; }
.an-count { font-size:12px; padding:3px 8px; color:#5e79bc; background:#edf2ff; border-radius:6px; margin-left:6px; }
.cm-analytics button.an-primary { color:#fff; background:#315cdb; border-color:#315cdb; }
.cm-analytics button.an-primary:hover { background:#254ec5; }
.an-queue td:first-child { min-width:220px; max-width:330px; overflow-wrap:anywhere; }
.an-queue td:first-child>strong { color:#304762; font-weight:650; }
.an-queue td:nth-child(2) { min-width:140px; }
.an-queue td:nth-child(3) { min-width:100px; }
.an-queue td:nth-child(4) { min-width:125px; font-size:11px; color:#72839b; }
.an-queue td:nth-child(6) { min-width:145px; }
.cm-analytics button.an-link { color:#315cdb; font-size:11px; border:0; background:none; padding:5px 0; white-space:nowrap; }
.an-pagination { display:flex; align-items:center; justify-content:space-between; gap:12px; flex-wrap:wrap; padding-top:15px; color:#8a96a9; font-size:10px; }
.an-pagination>div { white-space:nowrap; }
.an-pagination button { font-size:10px; padding:6px 9px; }
.an-chart-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:18px; align-items:start; }
.an-chart-grid .an-panel { margin:0; }
.an-bar-row { margin-top:20px; }
.an-bar-row>div:first-child { display:flex; align-items:baseline; justify-content:space-between; gap:14px; font-size:12px; color:#4f617b; }
.an-bar-row strong { color:#2a4369; white-space:nowrap; font-size:13px; }
.an-track { height:7px; margin-top:9px; background:#f0f3f9; border-radius:5px; overflow:hidden; }
.an-track>span { display:block; height:100%; border-radius:5px; background:linear-gradient(90deg,#406ddc,#86a6fa); }
.an-bar-row:nth-of-type(3n) .an-track>span { background:linear-gradient(90deg,#3c99a8,#8dc6ce); }
.an-bar-row>small { display:block; margin-top:7px; font-size:10px; color:#8e9db0; }
.an-empty { text-align:center; color:#8a99ad; padding:35px 12px!important; font-size:12px; }
.an-error { margin-top:15px; padding:30px; border:1px solid #f1d8dd; background:#fff7f8; border-radius:14px; }
.an-error button { margin-top:14px; }
.an-definitions { margin:20px 0; padding:17px 20px; border:1px solid #e1e8f3; border-radius:12px; color:#73839a; background:#f7f9fd; font-size:11px; }
.an-definitions summary { cursor:pointer; font-weight:700; color:#536985; }
.an-definitions p { line-height:1.95; margin-top:12px; }
.an-dialog { width:min(700px,90vw); border:1px solid #dce4f0; border-radius:16px; padding:24px; color:#233b5b; box-shadow:0 20px 70px #12203940; }
.an-dialog::backdrop { background:#12203380; }
.an-dialog textarea { display:block; width:100%; min-height:280px; margin:20px 0; border:1px solid #dbe3f0; border-radius:8px; padding:12px; line-height:1.8; font-size:12px; }
@media (max-width:1400px) {
  .an-primary-grid { grid-template-columns:minmax(0,1fr); }
  .an-focus { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); column-gap:22px; }
  .an-focus>.an-kicker,.an-focus>h2,.an-focus>p,.an-quality,.an-focus-empty { grid-column:1/-1; }
  .an-focus h2 { margin:0; }
  .an-kpis { grid-template-columns:repeat(3,minmax(0,1fr)); }
}
@media (max-width:800px) {
  .an-filters { grid-template-columns:repeat(2,minmax(0,1fr)); padding:15px; }
  .an-chart-grid { grid-template-columns:1fr; }
  .an-panel { padding:15px; }
  .an-focus { display:block; }
  .an-panel-head .an-actions { width:100%; }
}
@media (max-width:480px) {
  .an-kpis { grid-template-columns:repeat(2,minmax(0,1fr)); gap:8px; }
  .an-kpi { padding:14px 12px; }
  .an-filters { gap:10px; }
  .an-tools { align-items:flex-start; }
  .an-tools button { font-size:11px; padding:7px 8px; }
}
@media (prefers-reduced-motion:reduce) { .cm-analytics * { transition:none!important; scroll-behavior:auto!important; } }
