/* =========================================================================
   PubArx — researcher panel (dashboard, notifications, account settings).
   Loaded after pubarx.css and panel.css; uses their tokens only, so it
   follows light and dark mode automatically.
   ========================================================================= */

/* ------------------------------------------------------------------ shell */

.dash-main { min-width: 0; }
.dash-nav-user { display: flex; align-items: center; gap: 10px; padding: 0 12px 14px; margin-bottom: 4px; border-bottom: 1px solid var(--border); }
.dash-nav-user > div { min-width: 0; }
.dash-nav-user strong { display: block; font-size: 0.93rem; line-height: 1.3; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dash-nav-user > div > span { display: block; font-size: 0.8rem; color: var(--text-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.shell-nav .dash-nav-cta { margin: 18px 12px 0; justify-content: center; color: var(--brand-ink); font-weight: 600; }
.shell-nav .dash-nav-cta:hover { background: var(--brand-hover); color: var(--brand-ink); }
.shell-nav .dash-nav-cta svg { width: 16px; height: 16px; }
@media (max-width: 980px) {
  .dash-nav-user, .shell-nav .dash-nav-cta { display: none; }
}

.dash-grid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 20px; align-items: start; }
@media (max-width: 1180px) { .dash-grid { grid-template-columns: 1fr; } }
.dash-col { display: grid; gap: 16px; min-width: 0; }
.dash-col > .card + .card { margin-top: 0; }
.dash-section-title { font-size: 1.25rem; margin: 32px 0 14px; }
.dash-h { font-size: 1.2rem; margin: 0 0 6px; }
.dash-settings { max-width: 820px; }
.card .kv.dash-kv { grid-template-columns: max-content minmax(0, 1fr); gap: 6px 16px; }
@media (min-width: 1181px) { .stat-grid.dash-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

@media (max-width: 640px) {
  .dash-main .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .dash-main .stat-card { padding: 14px; }
  .dash-main .stat-card .value { font-size: 1.5rem; }
  .shell-head > .row, .shell-head > form, .shell-head > .btn { width: 100%; }
}

/* ------------------------------------------------------------------ profile completeness */

.dash-todo { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 24px; }
@media (max-width: 760px) { .dash-todo { grid-template-columns: 1fr; } }
.dash-todo li { align-items: flex-start; }
.dash-todo li svg { margin-top: 3px; }
.dash-todo li:not(.done) svg { color: var(--accent); }
.dash-todo .xsmall { display: block; }

/* ------------------------------------------------------------------ row lists */

.dash-rows { list-style: none; margin: 0; padding: 0; }
.dash-rows > li { display: flex; align-items: center; justify-content: space-between; gap: 10px 16px; padding: 14px 0; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.dash-rows > li:first-child { padding-top: 2px; }
.dash-rows > li:last-child { border-bottom: 0; padding-bottom: 2px; }
.dash-row-main { flex: 1 1 260px; min-width: 0; }
.dash-row-title { display: block; font-family: var(--font-serif); font-size: 1.04rem; font-weight: 600; line-height: 1.35; color: var(--text); overflow-wrap: anywhere; }
a.dash-row-title:hover { color: var(--link); text-decoration: none; }
.dash-row-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; margin-top: 6px; font-size: 0.83rem; color: var(--text-3); }
.dash-row-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.dash-row-actions form { margin: 0; }
.dash-metrics { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 8px; font-size: 0.84rem; color: var(--text-2); }
.dash-amount { font-family: var(--font-mono); font-weight: 700; font-size: 0.95rem; color: var(--text-2); min-width: 2.5em; text-align: right; }
.dash-amount.is-minus { color: var(--text-2); }
.dash-amount.is-plus { color: var(--success); }

/* ------------------------------------------------------------------ papers open for review */

.dash-papers { list-style: none; margin: 0; padding: 0; }
.dash-papers > li { display: flex; align-items: center; justify-content: space-between; gap: 12px 16px; padding: 14px 0; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.dash-papers > li:first-child { padding-top: 0; }
.dash-papers > li:last-child { border-bottom: 0; padding-bottom: 0; }
.dash-paper-main { flex: 1 1 280px; min-width: 0; }
.dash-paper-main .paper-meta-top { margin-bottom: 4px; }
.dash-paper-title { display: block; font-family: var(--font-serif); font-size: 1.06rem; font-weight: 600; line-height: 1.35; color: var(--text); overflow-wrap: anywhere; }
.dash-paper-title:hover { color: var(--link); text-decoration: none; }
.dash-paper-sub { font-size: 0.86rem; color: var(--text-2); margin-top: 4px; }
.dash-dot::before { content: "·"; margin: 0 8px; color: var(--border-strong); }

/* ------------------------------------------------------------------ notifications */

.dash-notices { list-style: none; margin: 0; padding: 0; }
.dash-notice { display: flex; align-items: flex-start; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--border); }
.dash-notice:first-child { padding-top: 2px; }
.dash-notice:last-child { border-bottom: 0; padding-bottom: 2px; }
.dash-notice.list-unread::before { top: 22px; }
.dash-notice:first-child.list-unread::before { top: 12px; }
.dash-notice-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; color: var(--text-2); }
.dash-notice-body:hover { text-decoration: none; }
.dash-notice-body:hover .dash-notice-text { color: var(--link); }
.dash-notice-text { font-size: 0.94rem; line-height: 1.5; overflow-wrap: anywhere; }
.dash-notice.is-unread .dash-notice-text { color: var(--text); font-weight: 600; }
.dash-notice-meta { font-size: 0.8rem; color: var(--text-3); }
.dash-notice-group { font-family: var(--font-sans); font-size: 0.76rem; font-weight: 650; letter-spacing: .08em; text-transform: uppercase; color: var(--text-3); margin: 0 0 4px; }
.dash-notices + .dash-notice-group { margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--border); }
.dash-notices.is-compact .dash-notice { padding: 10px 0; gap: 10px; }
.dash-notices.is-compact .dash-notice-text { font-size: 0.88rem; }
.dash-notices.is-compact .dash-ico { width: 30px; height: 30px; }
.dash-notices.is-compact .dash-ico svg { width: 15px; height: 15px; }

.dash-ico { display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; flex-shrink: 0; background: var(--neutral-soft); color: var(--neutral); }
.dash-ico svg { width: 17px; height: 17px; }
.dash-ico-lg { width: 52px; height: 52px; }
.dash-ico-lg svg { width: 24px; height: 24px; }
.dash-ico-brand { background: var(--brand-soft); color: var(--brand); }
.dash-ico-success { background: var(--success-soft); color: var(--success); }
.dash-ico-info { background: var(--info-soft); color: var(--info); }
.dash-ico-accent { background: var(--accent-soft); color: var(--accent); }
.dash-ico-warning { background: var(--warning-soft); color: var(--warning); }
.dash-ico-danger { background: var(--danger-soft); color: var(--danger); }
.dash-ico-neutral { background: var(--neutral-soft); color: var(--neutral); }

/* ------------------------------------------------------------------ submission credits */

.dash-big { font-family: var(--font-serif); font-size: 2.8rem; font-weight: 600; line-height: 1; color: var(--text); letter-spacing: -0.02em; }
.dash-credit-card { background: linear-gradient(160deg, var(--accent-soft), var(--surface) 55%); }
.dash-credit-card .card-header { border-bottom-color: color-mix(in srgb, var(--accent) 18%, var(--border)); }
.dash-credit-card .dash-big { margin-bottom: 4px; }
.dash-credit-hero { background: linear-gradient(135deg, var(--brand-soft), var(--surface) 60%); }
.dash-credit-figure { display: flex; align-items: center; gap: 18px; }
.dash-credit-figure .dash-big { font-size: 3.2rem; min-width: 1.2em; text-align: center; }
@media (max-width: 520px) { .dash-credit-figure { align-items: flex-start; gap: 14px; } .dash-credit-figure .dash-big { font-size: 2.4rem; } }

.dash-credit-strip {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 12px 16px; margin-bottom: 20px;
  border-radius: var(--radius); background: var(--brand-soft); border: 1px solid color-mix(in srgb, var(--brand) 20%, transparent);
  font-size: 0.93rem; color: var(--text);
}
.dash-credit-strip > svg { width: 20px; height: 20px; color: var(--brand); }
.dash-credit-strip > div { flex: 1 1 240px; min-width: 0; }
.dash-credit-strip.is-empty { background: var(--warning-soft); border-color: color-mix(in srgb, var(--warning) 30%, transparent); }
.dash-credit-strip.is-empty > svg { color: var(--warning); }
.dash-no-credit { border-color: color-mix(in srgb, var(--warning) 40%, var(--border)); }

.dash-ledger td { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }
.dash-ledger td .small { display: block; font-weight: 400; }
.dash-ledger th { width: auto; }
.dash-ledger .dash-ledger-sum th, .dash-ledger .dash-ledger-sum td { color: var(--text); font-weight: 700; border-top: 2px solid var(--border-strong); }

/* ------------------------------------------------------------------ contributions */

.dash-contribs { list-style: none; margin: 0; padding: 0; }
.dash-contribs > .card.is-hidden { border-style: dashed; background: color-mix(in srgb, var(--surface) 70%, var(--surface-2)); }
.dash-contrib-title { font-size: 1.12rem; margin: 0 0 6px; overflow-wrap: anywhere; }
.dash-contrib-title a { color: var(--text); }
.dash-contrib-title a:hover { color: var(--link); text-decoration: none; }
.dash-excerpt { font-size: 0.93rem; color: var(--text-2); margin: 0 0 10px; white-space: pre-line; overflow-wrap: anywhere; }
.dash-contribs .hidden-note { margin-bottom: 8px; }

/* ------------------------------------------------------------------ following */

.dash-follow { margin: 0; flex-shrink: 0; }
.dash-following { color: var(--success); }
.dash-following:hover { color: var(--danger); background: var(--danger-soft); }
.dash-subjects { list-style: none; margin: 0; padding: 0; }
.dash-subjects > li { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 7px 0; border-bottom: 1px dashed var(--border); font-size: 0.92rem; }
.dash-subjects > li:last-child { border-bottom: 0; }
.dash-subjects > li > span { min-width: 0; display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; }
.dash-field .card-header h3 { font-size: 1.02rem; }
.dash-field .card-header h3 a { color: var(--text); }
.dash-field.is-followed { border-color: color-mix(in srgb, var(--brand) 35%, var(--border)); }

/* ------------------------------------------------------------------ readership chart */

/* SVG text scales with the viewBox: keep the chart wide enough to stay legible on phones and let it scroll. */
.dash-chart-wrap { overflow-x: auto; }
@media (max-width: 640px) { .dash-chart { min-width: 540px; } }
.dash-chart .dash-hit { fill: transparent; }
.dash-day:hover .dash-hit { fill: var(--surface-2); }
.dash-chart .bar, .dash-chart .bar-alt { stroke: var(--surface); stroke-width: 1; }

/* ------------------------------------------------------------------ privacy & data */

.dash-stored .panel-title { margin-bottom: 4px; }
.dash-danger { border-color: color-mix(in srgb, var(--danger) 35%, var(--border)); }
.dash-danger .card-header h2 { color: var(--danger); }
.dash-danger .card-footer { background: var(--danger-soft); }
