/* =========================================================================
   PubArx — shared primitives for the researcher panel and the admin panel.
   Loaded on every page after pubarx.css. Uses the tokens defined there.
   ========================================================================= */

/* Header additions: notification bell and site announcement */
.bell { position: relative; }
.bell-count {
  position: absolute; top: -6px; right: -6px; min-width: 18px; height: 18px; padding: 0 5px;
  border-radius: 999px; background: var(--accent); color: var(--on-accent); font-size: 0.7rem; font-weight: 700;
  display: grid; place-items: center; line-height: 1; border: 2px solid var(--surface);
}
.announcement { font-size: 0.92rem; padding: 10px 0; border-bottom: 1px solid var(--border); }
.announcement-info { background: var(--info-soft); }
.announcement-success { background: var(--success-soft); }
.announcement-warning { background: var(--warning-soft); }

/* Shell: sidebar navigation + content */
.shell { display: grid; grid-template-columns: 248px minmax(0, 1fr); gap: 32px; align-items: start; }
@media (max-width: 980px) { .shell { grid-template-columns: 1fr; gap: 20px; } }
.shell-nav { position: sticky; top: 88px; display: flex; flex-direction: column; gap: 2px; }
@media (max-width: 980px) {
  .shell-nav { position: static; flex-direction: row; overflow-x: auto; gap: 4px; padding-bottom: 6px; border-bottom: 1px solid var(--border); }
  .shell-nav .shell-nav-title { display: none; }
}
.shell-nav-title { font-size: 0.74rem; font-weight: 650; letter-spacing: .08em; text-transform: uppercase; color: var(--text-3); padding: 14px 12px 6px; }
.shell-nav-title:first-child { padding-top: 0; }
.shell-nav a {
  display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: var(--radius-sm);
  color: var(--text-2); font-weight: 500; font-size: 0.93rem; white-space: nowrap;
}
.shell-nav a svg { width: 17px; height: 17px; }
.shell-nav a:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }
.shell-nav a[aria-current="page"] { background: var(--surface); color: var(--text); font-weight: 600; box-shadow: var(--shadow-sm); border: 1px solid var(--border); }
.shell-nav a .badge { margin-left: auto; }
.shell-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 24px; }
.shell-head h1 { margin: 0; font-size: clamp(1.5rem, 1.2rem + 1vw, 1.9rem); }
.shell-head p { margin: 4px 0 0; color: var(--text-2); }

/* Statistic cards */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px; margin-bottom: 24px; }
.stat-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow-sm); }
.stat-card .label { display: flex; align-items: center; gap: 8px; font-size: 0.82rem; color: var(--text-3); font-weight: 500; }
.stat-card .label svg { width: 16px; height: 16px; }
.stat-card .value { font-family: var(--font-serif); font-size: 1.85rem; font-weight: 600; line-height: 1.15; margin-top: 6px; color: var(--text); }
.stat-card .delta { font-size: 0.8rem; color: var(--text-3); margin-top: 2px; }
.stat-card .delta.up { color: var(--success); }
.stat-card.is-highlight { background: linear-gradient(135deg, var(--brand-soft), var(--surface)); border-color: color-mix(in srgb, var(--brand) 25%, var(--border)); }

/* Progress meter */
.meter { height: 10px; border-radius: 999px; background: var(--surface-3); overflow: hidden; }
.meter > span { display: block; height: 100%; border-radius: 999px; background: var(--brand); }
.meter.is-accent > span { background: var(--accent); }
.meter.is-success > span { background: var(--success); }
/* Width steps (no inline styles allowed under the CSP): add class w-0 … w-100 in steps of 5 */
.w-0 { width: 0; } .w-5 { width: 5%; } .w-10 { width: 10%; } .w-15 { width: 15%; } .w-20 { width: 20%; } .w-25 { width: 25%; }
.w-30 { width: 30%; } .w-35 { width: 35%; } .w-40 { width: 40%; } .w-45 { width: 45%; } .w-50 { width: 50%; } .w-55 { width: 55%; }
.w-60 { width: 60%; } .w-65 { width: 65%; } .w-70 { width: 70%; } .w-75 { width: 75%; } .w-80 { width: 80%; } .w-85 { width: 85%; }
.w-90 { width: 90%; } .w-95 { width: 95%; } .w-100 { width: 100%; }

/* Server-rendered SVG charts */
.chart { width: 100%; height: auto; }
.chart .bar { fill: var(--brand); }
.chart .bar-alt { fill: var(--accent); }
.chart .axis { stroke: var(--border-strong); stroke-width: 1; }
.chart .grid-line { stroke: var(--border); stroke-width: 1; stroke-dasharray: 3 3; }
.chart text { fill: var(--text-3); font-family: var(--font-sans); font-size: 11px; }
.chart-legend { display: flex; gap: 16px; font-size: 0.82rem; color: var(--text-2); margin-top: 8px; }
.chart-legend .swatch { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: 0; }
.swatch-brand { background: var(--brand); }
.swatch-accent { background: var(--accent); }

/* Lists inside cards */
.list { list-style: none; margin: 0; padding: 0; }
.list > li { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--border); }
.list > li:last-child { border-bottom: 0; }
.list .meta { font-size: 0.83rem; color: var(--text-3); }
.list-unread { position: relative; }
.list-unread::before { content: ""; position: absolute; left: -12px; top: 50%; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); transform: translateY(-50%); }

/* Toolbar of filters above tables */
.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 16px; }
.toolbar .input, .toolbar .select { width: auto; min-width: 180px; height: 38px; padding-top: 6px; padding-bottom: 6px; }
.toolbar .grow { flex: 1; min-width: 220px; }

/* Rank and score chips */
.rank { display: inline-grid; place-items: center; min-width: 34px; height: 34px; padding: 0 8px; border-radius: 10px; background: var(--surface-2); font-weight: 700; font-size: 0.9rem; color: var(--text-2); }
.rank-1 { background: var(--medal-gold); color: var(--medal-gold-ink); }
.rank-2 { background: var(--medal-silver); color: var(--medal-silver-ink); }
.rank-3 { background: var(--medal-bronze); color: var(--medal-bronze-ink); }
.score { font-family: var(--font-serif); font-weight: 600; font-size: 1.05rem; }

/* Two-column key/value table */
.kv-table { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
.kv-table th { text-align: left; font-weight: 500; color: var(--text-3); padding: 8px 12px 8px 0; width: 40%; vertical-align: top; }
.kv-table td { padding: 8px 0; }
.kv-table tr + tr th, .kv-table tr + tr td { border-top: 1px solid var(--border); }

/* Checklist with completion state */
.todo { list-style: none; margin: 0; padding: 0; }
.todo li { display: flex; gap: 10px; align-items: center; padding: 8px 0; font-size: 0.93rem; }
.todo li svg { width: 18px; height: 18px; color: var(--text-3); }
.todo li.done { color: var(--text-3); text-decoration: line-through; }
.todo li.done svg { color: var(--success); }
