/* ── Reset & base ────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:        #f5f6f8;
  --surface:   #ffffff;
  --border:    #e4e7ec;
  --border-hv: #c7ccda;
  --text:      #111827;
  --text-muted:#6b7280;
  --text-xmuted:#9ca3af;
  --accent:    #4f46e5;
  --accent-hv: #4338ca;
  --accent-bg: #eef2ff;
  --success:   #059669;
  --success-bg:#ecfdf5;
  --error:     #dc2626;
  --error-bg:  #fef2f2;
  --warning:   #d97706;
  --radius:    10px;
  --radius-sm: 6px;
  /* Layered, low-opacity shadows for quiet premium depth */
  --shadow:    0 1px 1px rgb(16 24 40/.04), 0 1px 3px rgb(16 24 40/.06);
  --shadow-md: 0 2px 4px rgb(16 24 40/.05), 0 8px 24px rgb(16 24 40/.08);
  --shadow-lg: 0 4px 8px rgb(16 24 40/.06), 0 16px 40px rgb(16 24 40/.12);
  --ring:      0 0 0 3px rgba(79,70,229,.32);
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, system-ui, sans-serif;
  --mono: ui-monospace, 'SF Mono', 'Menlo', 'Monaco', 'Consolas', monospace;
}

html { font-size: 16px; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  font-feature-settings: 'cv02','cv03','cv04','cv11';
}

/* ── Global text selection ───────────────────────────── */
::selection { background: rgba(79,70,229,.18); color: var(--text); }

/* ── Global thin scrollbar ───────────────────────────── */
* { scrollbar-width: thin; scrollbar-color: var(--border-hv) transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #d3d7e0; border-radius: 8px; border: 2px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: var(--border-hv); }

/* ── Unified keyboard focus ring ─────────────────────── */
a:focus-visible,
button:focus-visible,
[tabindex]:focus-visible,
.review-btn:focus-visible,
.nav-link:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: var(--radius-sm); }
/* Inputs keep their own softer colored ring rather than a hard outline */
input:focus-visible, textarea:focus-visible { outline: none; }

/* Tabular figures for any numeric data display */
.stat-value, .summary-num, .vp-stat, .count-badge, .upgrade-plan-price,
.upgrade-meter-count, .awards-date, .meta-value { font-variant-numeric: tabular-nums; }

/* ── Content entrance motion ─────────────────────────── */
@keyframes content-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
}

/* ── Screen-reader only ──────────────────────────────── */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

/* ── Nav ─────────────────────────────────────────────── */
.nav { background: var(--surface); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 50; }
.nav-inner { max-width: 960px; margin: 0 auto; padding: 0 24px; height: 56px; display: flex; align-items: center; gap: 12px; }
.nav-logo { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: .9375rem; color: var(--text); text-decoration: none; }
.nav-logo:hover { color: var(--accent); }
.nav-logo-icon { color: var(--accent); display: flex; align-items: center; }
.nav-badge { font-size: .6875rem; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; background: var(--accent-bg); color: var(--accent); padding: 2px 7px; border-radius: 20px; }

/* ── Main / layout ───────────────────────────────────── */
.main { flex: 1; max-width: 960px; width: 100%; margin: 0 auto; padding: 40px 24px 64px; animation: content-in .24s ease both; }

.page-header { margin-bottom: 32px; }
.page-title { font-size: 1.5rem; font-weight: 700; line-height: 1.25; color: var(--text); letter-spacing: -.021em; }
.page-subtitle { margin-top: 6px; color: var(--text-muted); font-size: .9375rem; max-width: 560px; }

.layout { display: flex; flex-direction: column; gap: 32px; }

/* ── Flash messages ──────────────────────────────────── */
.flash-stack { display: flex; flex-direction: column; gap: 8px; margin-bottom: 24px; }
.flash { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-radius: var(--radius-sm); font-size: .9375rem; font-weight: 500; }
.flash--success { background: var(--success-bg); color: var(--success); border: 1px solid #a7f3d0; }
.flash--error   { background: var(--error-bg);   color: var(--error);   border: 1px solid #fecaca; }

/* ── Upload card ─────────────────────────────────────── */
.upload-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }

.upload-card { transition: border-color .15s, box-shadow .2s; }
.upload-card:hover { box-shadow: var(--shadow-md); }
.upload-zone { padding: 48px 32px; text-align: center; border-bottom: 1px solid var(--border); transition: background .15s, box-shadow .15s; }
.upload-zone.drag-over { background: var(--accent-bg); border-color: var(--accent); box-shadow: inset 0 0 0 2px var(--accent); }
.upload-zone.drag-over .upload-zone-icon { color: var(--accent); }
.upload-zone-icon { color: var(--text-xmuted); margin-bottom: 16px; display: flex; justify-content: center; }
.upload-zone-label { font-size: 1rem; font-weight: 600; color: var(--text); margin-bottom: 4px; }
.upload-zone-sub { font-size: .875rem; color: var(--text-muted); margin-bottom: 20px; }

.upload-footer { display: flex; align-items: center; justify-content: space-between; padding: 16px 24px; gap: 16px; flex-wrap: wrap; }
.upload-meta { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.upload-hint { font-size: .8125rem; color: var(--text-muted); }

.upload-selected { margin-top: 12px; font-size: .875rem; font-weight: 500; color: var(--accent); }

/* ── Buttons ─────────────────────────────────────────── */
.btn { display: inline-flex; align-items: center; gap: 8px; font-family: var(--font); font-size: .9375rem; font-weight: 500; padding: 9px 18px; border-radius: var(--radius-sm); border: none; cursor: pointer; text-decoration: none; transition: background .15s, box-shadow .15s, transform .1s; line-height: 1.4; }
.btn:active { transform: translateY(1px); }
.btn--primary { background: var(--accent); color: #fff; box-shadow: 0 1px 2px rgb(0 0 0/.15); }
.btn--primary:hover { background: var(--accent-hv); }
.btn--primary:focus-visible { outline: 3px solid #a5b4fc; outline-offset: 2px; }
.upload-browse-btn { cursor: pointer; }

/* ── Badges ──────────────────────────────────────────── */
.badge { display: inline-flex; align-items: center; font-size: .75rem; font-weight: 600; padding: 2px 8px; border-radius: 20px; }
.badge--info    { background: var(--accent-bg); color: var(--accent); }
.badge--neutral { background: #f3f4f6; color: #374151; }

/* ── Section header ──────────────────────────────────── */
.awards-section {}
.section-header { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; }
.section-title { font-size: 1rem; font-weight: 600; color: var(--text); }
.count-badge { font-size: .75rem; font-weight: 700; background: #f3f4f6; color: var(--text-muted); padding: 2px 8px; border-radius: 20px; }

/* ── Awards table ────────────────────────────────────── */
.awards-table-wrap { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; overflow-x: auto; }
.awards-table { width: 100%; border-collapse: collapse; font-size: .9375rem; }
.awards-table thead tr { border-bottom: 1px solid var(--border); }
.awards-table th { padding: 11px 16px; text-align: left; font-size: .75rem; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--text-muted); white-space: nowrap; }
.awards-row { border-bottom: 1px solid var(--border); transition: background .1s; }
.awards-row:last-child { border-bottom: none; }
.awards-row:hover { background: #fafafa; }
.awards-table td { padding: 13px 16px; vertical-align: middle; }

.awards-filename { display: flex; align-items: center; gap: 10px; min-width: 0; }
.filename-text { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 260px; }

.file-icon { font-size: .6875rem; font-weight: 700; padding: 3px 6px; border-radius: 4px; letter-spacing: .03em; flex-shrink: 0; }
.file-icon--pdf { background: #fee2e2; color: #991b1b; }
.file-icon--txt { background: #dbeafe; color: #1d4ed8; }

.status-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; margin-right: 6px; vertical-align: middle; }
.status-dot--uploaded { background: var(--warning); }
.status-dot--analyzed { background: var(--success); }

.awards-date { color: var(--text-muted); white-space: nowrap; font-size: .875rem; }
.coming-soon { font-size: .8125rem; color: var(--text-xmuted); }

/* ── Empty state ─────────────────────────────────────── */
.empty-state { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 64px 32px; text-align: center; }
.empty-icon { display: flex; justify-content: center; color: var(--text-xmuted); margin-bottom: 20px; }
.empty-title { font-size: 1rem; font-weight: 600; color: var(--text); margin-bottom: 8px; }
.empty-sub { font-size: .9375rem; color: var(--text-muted); max-width: 400px; margin: 0 auto; line-height: 1.6; }

/* ── Footer ──────────────────────────────────────────── */
.footer { border-top: 1px solid var(--border); padding: 20px 24px; }
.footer-inner { max-width: 960px; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; font-size: .8125rem; color: var(--text-muted); }
.footer-sub { color: var(--text-xmuted); }

/* ── Spinner animation ───────────────────────────────── */
@keyframes spin { to { transform: rotate(360deg); } }
.spin { animation: spin .7s linear infinite; }

/* ── Ghost button / small variant ───────────────────── */
.btn--ghost { background: transparent; color: var(--accent); border: 1px solid var(--border); box-shadow: none; }
.btn--ghost:hover { background: var(--accent-bg); border-color: var(--accent); }
.btn--sm { font-size: .8125rem; padding: 5px 12px; }
.btn--disabled { opacity: .45; pointer-events: none; }

/* ── Award detail page header ────────────────────────── */
.page-header--with-back { margin-bottom: 24px; }
.back-link { display: inline-flex; align-items: center; gap: 5px; font-size: .875rem; color: var(--text-muted); text-decoration: none; margin-bottom: 16px; transition: color .15s; }
.back-link:hover { color: var(--accent); }
.page-header-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.page-title-group { display: flex; align-items: center; gap: 12px; min-width: 0; }
.page-title--detail { font-size: 1.25rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 520px; }
.header-actions { flex-shrink: 0; display: flex; align-items: center; gap: 8px; }

/* ── Metadata strip ──────────────────────────────────── */
.meta-strip { display: flex; gap: 0; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); margin-bottom: 24px; overflow: hidden; }
.meta-item { flex: 1; padding: 16px 20px; display: flex; flex-direction: column; gap: 4px; border-right: 1px solid var(--border); }
.meta-item:last-child { border-right: none; }
.meta-label { font-size: .6875rem; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; color: var(--text-xmuted); }
.meta-value { font-size: .9375rem; font-weight: 500; color: var(--text); }
.status-pill { display: inline-flex; align-items: center; gap: 6px; font-size: .875rem; font-weight: 500; }
.status-dot--extracted { background: var(--accent); }

/* ── Extracted text panel ────────────────────────────── */
.text-panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); margin-bottom: 24px; overflow: hidden; }
.text-panel-header { padding: 16px 20px; border-bottom: 1px solid var(--border); }
.text-panel-title { font-size: .9375rem; font-weight: 600; color: var(--text); margin-bottom: 4px; }
.text-panel-hint { font-size: .8125rem; color: var(--text-muted); }
.text-panel-body { padding: 20px; }

.extracted-text { font-family: var(--mono); font-size: .8125rem; line-height: 1.65; color: var(--text); white-space: pre-wrap; word-break: break-word; overflow-wrap: break-word; max-height: 560px; overflow-y: auto; padding-right: 8px; }
.extracted-text::-webkit-scrollbar { width: 6px; }
.extracted-text::-webkit-scrollbar-track { background: transparent; }
.extracted-text::-webkit-scrollbar-thumb { background: var(--border-hv); border-radius: 3px; }

.text-empty { text-align: center; padding: 40px 20px; color: var(--text-muted); display: flex; flex-direction: column; align-items: center; gap: 12px; }
.text-empty svg { color: var(--text-xmuted); }
.text-empty p { font-size: .9375rem; font-weight: 500; color: var(--text-muted); }
.text-empty-sub { font-size: .875rem; color: var(--text-xmuted); font-weight: 400; max-width: 380px; }

/* ── Next step callout ───────────────────────────────── */
.next-callout { background: var(--accent-bg); border: 1px solid #c7d2fe; border-radius: var(--radius); padding: 18px 20px; display: flex; gap: 14px; align-items: flex-start; }
.next-callout-icon { color: var(--accent); flex-shrink: 0; margin-top: 1px; }
.next-callout-title { font-size: .9375rem; font-weight: 600; color: var(--accent); margin-bottom: 4px; }
.next-callout-sub { font-size: .875rem; color: #4338ca; line-height: 1.55; }

/* ── Monitoring record section ───────────────────────── */
.monitor-section { margin-bottom: 24px; }
.monitor-section-header { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius) var(--radius) 0 0; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.monitor-section-title-row { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.monitor-section-title { font-size: 1rem; font-weight: 600; color: var(--text); }

.category-summary { display: flex; flex-wrap: wrap; gap: 6px; }
.cat-pill { font-size: .75rem; font-weight: 600; padding: 3px 10px; border-radius: 20px; }
.cat-pill--deadline   { background: #fef3c7; color: #92400e; }
.cat-pill--restriction{ background: #fee2e2; color: #991b1b; }
.cat-pill--threshold  { background: #ede9fe; color: #5b21b6; }
.cat-pill--obligation { background: #dbeafe; color: #1d4ed8; }
.cat-pill--risk_flag  { background: #fce7f3; color: #9d174d; }

.monitor-items { display: flex; flex-direction: column; gap: 0; }
.monitor-item { background: var(--surface); border: 1px solid var(--border); border-top: none; padding: 18px 20px; transition: background .1s; }
.monitor-item:last-child { border-radius: 0 0 var(--radius) var(--radius); }
.monitor-item:hover { background: #fafafa; }
.monitor-item--high   { border-left: 3px solid var(--error); }
.monitor-item--medium { border-left: 3px solid var(--warning); }
.monitor-item--low    { border-left: 3px solid #9ca3af; }

.monitor-item-meta { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; flex-wrap: wrap; }
.cat-tag { font-size: .6875rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; padding: 2px 8px; border-radius: 4px; }
.cat-tag--deadline   { background: #fef3c7; color: #92400e; }
.cat-tag--restriction{ background: #fee2e2; color: #991b1b; }
.cat-tag--threshold  { background: #ede9fe; color: #5b21b6; }
.cat-tag--obligation { background: #dbeafe; color: #1d4ed8; }
.cat-tag--risk_flag  { background: #fce7f3; color: #9d174d; }

.risk-badge { font-size: .6875rem; font-weight: 600; padding: 2px 8px; border-radius: 4px; }
.risk-badge--high   { background: #fef2f2; color: var(--error); border: 1px solid #fecaca; }
.risk-badge--medium { background: #fffbeb; color: var(--warning); border: 1px solid #fde68a; }
.risk-badge--low    { background: #f3f4f6; color: #6b7280; border: 1px solid var(--border); }

.due-badge { display: inline-flex; align-items: center; gap: 4px; font-size: .75rem; font-weight: 500; color: var(--text-muted); background: #f3f4f6; padding: 2px 8px; border-radius: 4px; }

.monitor-item-title { font-size: .9375rem; font-weight: 600; color: var(--text); margin-bottom: 6px; }
.monitor-item-desc  { font-size: .875rem; color: var(--text-muted); line-height: 1.6; margin-bottom: 12px; }

.source-clause { background: #f9fafb; border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 12px 14px; }
.source-label { display: block; font-size: .6875rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--text-xmuted); margin-bottom: 6px; }
.source-text { font-family: var(--mono); font-size: .8125rem; line-height: 1.6; color: #374151; white-space: pre-wrap; word-break: break-word; overflow-wrap: break-word; }

/* ── Verification progress bar ───────────────────────── */
.verify-progress { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--border); }
.vp-bar-bg { height: 6px; background: #f3f4f6; border-radius: 20px; overflow: hidden; display: flex; margin-bottom: 8px; }
.vp-bar-piece { height: 100%; transition: width .35s ease; }
.vp-bar-piece--verified { background: var(--success); border-radius: 20px 0 0 20px; }
.vp-bar-piece--flagged  { background: var(--error); }
.vp-stats { display: flex; gap: 14px; flex-wrap: wrap; }
.vp-stat { font-size: .8125rem; font-weight: 500; }
.vp-stat--verified { color: var(--success); }
.vp-stat--flagged  { color: var(--error); }
.vp-stat--pending  { color: var(--text-xmuted); }

/* ── Review status badge (in item meta row) ──────────── */
.review-status-badge { display: inline-flex; align-items: center; gap: 4px; font-size: .6875rem; font-weight: 600; padding: 2px 8px; border-radius: 4px; }
.review-status-badge--hidden  { display: none; }
.review-status-badge--verified { background: var(--success-bg); color: var(--success); border: 1px solid #a7f3d0; }
.review-status-badge--flagged  { background: var(--error-bg); color: var(--error); border: 1px solid #fecaca; }

/* ── Review action row ───────────────────────────────── */
.review-row { margin-top: 14px; border-top: 1px solid var(--border); padding-top: 12px; }
.review-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.review-row-label { font-size: .6875rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--text-xmuted); margin-right: 2px; }

.review-btn { display: inline-flex; align-items: center; gap: 5px; font-family: var(--font); font-size: .8125rem; font-weight: 500; padding: 5px 12px; border-radius: var(--radius-sm); border: 1px solid var(--border); background: transparent; color: var(--text-muted); cursor: pointer; transition: all .15s; line-height: 1.4; }
.review-btn:hover { border-color: var(--border-hv); color: var(--text); background: #f9fafb; }
.review-btn:active { transform: translateY(1px); }
.review-btn:focus-visible { outline: 3px solid #a5b4fc; outline-offset: 2px; }

.review-btn--active-verify { background: var(--success-bg); color: var(--success); border-color: #a7f3d0; }
.review-btn--active-verify:hover { background: #d1fae5; border-color: #6ee7b7; color: var(--success); }

.review-btn--active-flag { background: var(--error-bg); color: var(--error); border-color: #fecaca; }
.review-btn--active-flag:hover { background: #fee2e2; border-color: #fca5a5; color: var(--error); }

/* ── Flag note input ─────────────────────────────────── */
.review-note-wrap { margin-top: 10px; }
.review-note-input { width: 100%; font-family: var(--font); font-size: .875rem; padding: 8px 12px; border: 1px solid var(--border); border-radius: var(--radius-sm); color: var(--text); background: var(--surface); outline: none; transition: border-color .15s, box-shadow .15s; }
.review-note-input:focus { border-color: var(--error); box-shadow: 0 0 0 3px rgba(220,38,38,.12); }
.review-note-input::placeholder { color: var(--text-xmuted); }

/* ── Nav links ───────────────────────────────────────── */
.nav-links { display: flex; align-items: center; gap: 2px; margin-left: auto; }
.nav-link { font-size: .875rem; font-weight: 500; color: var(--text-muted); text-decoration: none; padding: 6px 10px; border-radius: var(--radius-sm); transition: color .15s, background .15s; }
.nav-link:hover { color: var(--text); background: #f3f4f6; }
.nav-link--active { color: var(--accent); background: var(--accent-bg); }

/* ── Stats strip ─────────────────────────────────────── */
.stats-strip { display: grid; grid-template-columns: repeat(4, 1fr); background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); margin-bottom: 32px; overflow: hidden; }
.stat-card { padding: 20px 22px; display: flex; flex-direction: column; gap: 5px; border-right: 1px solid var(--border); }
.stat-card:last-child { border-right: none; }
.stat-label { font-size: .6875rem; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; color: var(--text-xmuted); }
.stat-value { font-size: 1.875rem; font-weight: 700; line-height: 1.1; color: var(--text); }
.stat-value--danger { color: var(--error); }
.stat-value--warn   { color: var(--warning); }
.stat-sub { font-size: .8125rem; color: var(--text-muted); }

/* ── Dashboard two-col grid ──────────────────────────── */
.dash-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin-bottom: 32px; }
.dash-panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; display: flex; flex-direction: column; }
.dash-panel-header { padding: 14px 18px; border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.dash-panel-icon { display: flex; align-items: center; color: var(--text-muted); }
.dash-panel-icon--danger { color: var(--error); }
.dash-panel-title { font-size: .9375rem; font-weight: 600; color: var(--text); flex: 1; }
.dash-panel-body { flex: 1; overflow-y: auto; max-height: 480px; }

/* ── Count badge variants ────────────────────────────── */
.count-badge--danger { background: #fef2f2; color: var(--error); }

/* ── Deadline groups ─────────────────────────────────── */
.deadline-group { }
.deadline-group-label { padding: 8px 18px; font-size: .6875rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; display: flex; align-items: center; gap: 8px; border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 1; }
.deadline-group-label--overdue  { background: #fff1f2; color: var(--error); }
.deadline-group-label--urgent   { background: #fffbeb; color: var(--warning); }
.deadline-group-label--soon     { background: var(--accent-bg); color: var(--accent); }
.deadline-group-label--upcoming { background: #f0fdf4; color: var(--success); }
.deadline-group-label--later    { background: #f9fafb; color: var(--text-muted); }

.deadline-item { display: block; padding: 13px 18px; border-bottom: 1px solid var(--border); text-decoration: none; transition: background .1s; }
.deadline-item:last-child { border-bottom: none; }
.deadline-item:hover { background: #fafafa; }
.deadline-item-title { font-size: .875rem; font-weight: 500; color: var(--text); margin-bottom: 5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.deadline-item-meta { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.deadline-item-award { font-size: .75rem; color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 140px; margin-left: auto; }

.due-urgency { font-size: .75rem; font-weight: 600; padding: 2px 7px; border-radius: 20px; white-space: nowrap; flex-shrink: 0; }
.due-urgency--overdue { background: #fef2f2; color: var(--error); }
.due-urgency--today   { background: #fffbeb; color: var(--warning); }
.due-urgency--urgent  { background: #fffbeb; color: var(--warning); }
.due-urgency--soon    { background: var(--accent-bg); color: var(--accent); }
.due-urgency--normal  { background: #f3f4f6; color: var(--text-muted); }

/* ── High-risk flag items ────────────────────────────── */
.risk-item { display: flex; align-items: flex-start; gap: 12px; padding: 13px 18px; border-bottom: 1px solid var(--border); text-decoration: none; transition: background .1s; }
.risk-item:last-child { border-bottom: none; }
.risk-item:hover { background: #fafafa; }
.risk-item-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; margin-top: 5px; }
.risk-item-dot--pending  { background: var(--error); }
.risk-item-dot--flagged  { background: var(--warning); }
.risk-item-dot--verified { background: var(--success); }
.risk-item-body { flex: 1; min-width: 0; }
.risk-item-title { font-size: .875rem; font-weight: 500; color: var(--text); margin-bottom: 5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.risk-item-meta { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.risk-item-award { font-size: .75rem; color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 140px; margin-left: auto; }
.risk-item-status { font-size: .6875rem; font-weight: 600; padding: 2px 7px; border-radius: 4px; }
.risk-item-status--pending  { background: #fef2f2; color: var(--error); border: 1px solid #fecaca; }
.risk-item-status--flagged  { background: #fffbeb; color: var(--warning); border: 1px solid #fde68a; }
.risk-item-status--verified { background: var(--success-bg); color: var(--success); border: 1px solid #a7f3d0; }

/* ── Panel empty state ───────────────────────────────── */
.panel-empty { padding: 40px 20px; text-align: center; }
.panel-empty-title { font-size: .875rem; font-weight: 600; color: var(--text-muted); margin-bottom: 5px; }
.panel-empty-sub { font-size: .8125rem; color: var(--text-xmuted); line-height: 1.55; }

/* ── Awards overview table ───────────────────────────── */
.awards-overview { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; overflow-x: auto; }
.overview-table { width: 100%; border-collapse: collapse; font-size: .9375rem; }
.overview-table thead tr { border-bottom: 1px solid var(--border); }
.overview-table th { padding: 11px 16px; text-align: left; font-size: .75rem; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--text-muted); white-space: nowrap; }
.overview-row { border-bottom: 1px solid var(--border); transition: background .1s; }
.overview-row:last-child { border-bottom: none; }
.overview-row:hover { background: #fafafa; }
.overview-table td { padding: 12px 16px; vertical-align: middle; }
.overview-name { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 220px; }
.overview-item-count { font-weight: 500; }
.overview-risk-chip { margin-left: 4px; vertical-align: middle; }

.verify-mini-bar { height: 5px; background: #f3f4f6; border-radius: 20px; overflow: hidden; display: flex; width: 80px; }
.vmb-verified { background: var(--success); height: 100%; }
.vmb-flagged  { background: var(--error); height: 100%; }

/* ── Mobile ──────────────────────────────────────────── */
@media (max-width: 640px) {
  .main { padding: 24px 16px 48px; }
  .page-title { font-size: 1.25rem; }
  .upload-zone { padding: 36px 20px; }
  .upload-footer { flex-direction: column; align-items: flex-start; }
  .upload-footer .btn { width: 100%; justify-content: center; }
  .awards-table th:last-child, .awards-table td:last-child { display: none; }
  .filename-text { max-width: 150px; }
  .footer-sub { display: none; }
  .meta-strip { flex-wrap: wrap; }
  .meta-item { flex: 1 1 45%; border-bottom: 1px solid var(--border); }
  .meta-item:nth-last-child(-n+2) { border-bottom: none; }
  .page-title--detail { font-size: 1rem; max-width: 200px; }
  .page-header-row { flex-direction: column; }
  .next-callout { flex-direction: column; }
  .nav-links { display: none; }
  .stats-strip { grid-template-columns: 1fr 1fr; }
  .stat-card:nth-child(2) { border-right: none; }
  .stat-card:nth-child(3) { border-top: 1px solid var(--border); }
  .stat-card:nth-child(4) { border-top: 1px solid var(--border); border-right: none; }
  .dash-grid { grid-template-columns: 1fr; }
  .dash-panel-body { max-height: none; }
  .overview-name { max-width: 130px; }
  .overview-table th:nth-child(5), .overview-table td:nth-child(5) { display: none; }
}

/* ── Nav user pill ───────────────────────────────────── */
.nav-user { display: flex; align-items: center; gap: 8px; padding: 0 4px; }
.nav-user-email { font-size: .8125rem; color: var(--text-muted); max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-plan-pill { font-size: .6875rem; font-weight: 600; padding: 2px 8px; border-radius: 20px; }
.nav-plan-pill--free  { background: #f3f4f6; color: var(--text-muted); }
.nav-plan-pill--pilot { background: var(--accent-bg); color: var(--accent); }

/* ── Upgrade sitewide banner ─────────────────────────── */
.upgrade-banner { background: #fffbeb; border-bottom: 1px solid #fde68a; padding: 10px 24px; }
.upgrade-banner-inner { max-width: 960px; margin: 0 auto; display: flex; align-items: center; gap: 10px; font-size: .875rem; color: var(--warning); }
.upgrade-banner-link { margin-left: auto; font-weight: 600; color: var(--warning); text-decoration: underline; white-space: nowrap; }
.upgrade-banner-link:hover { color: #b45309; }

/* ── Limit notice (agreements page) ─────────────────── */
.limit-notice { display: flex; align-items: flex-start; gap: 14px; background: #fffbeb; border: 1px solid #fde68a; border-radius: var(--radius); padding: 16px 20px; margin-bottom: 28px; }
.limit-notice-icon { color: var(--warning); flex-shrink: 0; margin-top: 1px; }
.limit-notice-body { flex: 1; font-size: .9375rem; color: #78350f; line-height: 1.55; }
.limit-notice-body strong { font-weight: 600; }

/* ── Auth pages ──────────────────────────────────────── */
.auth-page { display: flex; justify-content: center; align-items: flex-start; padding: 40px 0; }
.auth-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-md); padding: 40px 44px; width: 100%; max-width: 420px; }
.auth-logo { display: flex; justify-content: center; margin-bottom: 24px; }
.auth-h1 { font-size: 1.375rem; font-weight: 700; color: var(--text); text-align: center; margin-bottom: 6px; letter-spacing: -.02em; }
.auth-sub { font-size: .9375rem; color: var(--text-muted); text-align: center; margin-bottom: 28px; line-height: 1.5; }
.auth-trial-badge { display: flex; align-items: flex-start; gap: 8px; background: var(--accent-bg); border: 1px solid #c7d2fe; border-radius: var(--radius-sm); padding: 10px 14px; margin-bottom: 24px; font-size: .875rem; color: var(--accent); line-height: 1.5; }
.auth-form { display: flex; flex-direction: column; gap: 16px; }
.auth-field { display: flex; flex-direction: column; gap: 6px; }
.auth-label { font-size: .875rem; font-weight: 500; color: var(--text); display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.auth-label-hint { font-size: .75rem; font-weight: 400; color: var(--text-muted); }
.auth-input { font-family: var(--font); font-size: .9375rem; padding: 10px 14px; border: 1px solid var(--border); border-radius: var(--radius-sm); color: var(--text); background: var(--surface); outline: none; transition: border-color .15s, box-shadow .15s; }
.auth-input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(79,70,229,.12); }
.auth-input::placeholder { color: var(--text-xmuted); }
.auth-submit { width: 100%; justify-content: center; margin-top: 4px; font-size: 1rem; padding: 11px 20px; }
.auth-switch { margin-top: 20px; text-align: center; font-size: .875rem; color: var(--text-muted); }
.auth-switch-link { color: var(--accent); font-weight: 500; text-decoration: none; }
.auth-switch-link:hover { text-decoration: underline; }

/* ── Upgrade page ────────────────────────────────────── */
.upgrade-meter-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 24px 28px; margin-bottom: 32px; }
.upgrade-meter-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; gap: 16px; }
.upgrade-meter-label { font-size: .875rem; font-weight: 600; color: var(--text); }
.upgrade-meter-count { font-size: .875rem; font-weight: 600; color: var(--error); }
.upgrade-meter-bar-bg { height: 8px; background: #f3f4f6; border-radius: 20px; overflow: hidden; margin-bottom: 12px; }
.upgrade-meter-bar-fill { height: 100%; background: var(--error); border-radius: 20px; transition: width .4s ease; min-width: 2px; }
.upgrade-meter-note { font-size: .875rem; color: var(--text-muted); line-height: 1.55; }

.upgrade-plans { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin-bottom: 48px; }
.upgrade-plan { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 28px; display: flex; flex-direction: column; gap: 0; position: relative; }
.upgrade-plan--featured { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(79,70,229,.1), var(--shadow-md); }
.upgrade-plan--current { opacity: .8; }
.upgrade-plan-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.upgrade-plan-name { font-size: 1rem; font-weight: 600; color: var(--text); }
.upgrade-plan-tag { font-size: .6875rem; font-weight: 700; padding: 3px 10px; border-radius: 20px; text-transform: uppercase; letter-spacing: .04em; }
.upgrade-plan-tag--current { background: #f3f4f6; color: var(--text-muted); }
.upgrade-plan-tag--pilot   { background: var(--accent-bg); color: var(--accent); }
.upgrade-plan-price { font-size: 2.25rem; font-weight: 800; color: var(--text); letter-spacing: -.03em; line-height: 1; margin-bottom: 4px; }
.upgrade-plan-period { font-size: .875rem; font-weight: 400; color: var(--text-muted); }
.upgrade-plan-sub { font-size: .8125rem; color: var(--text-muted); margin-bottom: 20px; margin-top: 4px; }
.upgrade-plan-features { list-style: none; display: flex; flex-direction: column; gap: 10px; margin: 20px 0 24px; flex: 1; }
.upgrade-plan-feature { display: flex; align-items: flex-start; gap: 10px; font-size: .9375rem; color: var(--text); line-height: 1.4; }
.upgrade-plan-feature--done::before { content: ''; width: 16px; height: 16px; border-radius: 50%; flex-shrink: 0; margin-top: 1px; background: var(--success); background-image: url("data:image/svg+xml,%3Csvg width='10' height='8' viewBox='0 0 10 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 4l2.5 2.5L9 1' stroke='white' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: center; }
.upgrade-plan-feature--off { color: var(--text-muted); }
.upgrade-plan-feature--off::before { content: ''; width: 16px; height: 16px; border-radius: 50%; flex-shrink: 0; margin-top: 1px; background: #f3f4f6; background-image: url("data:image/svg+xml,%3Csvg width='10' height='10' viewBox='0 0 10 10' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M3 3l4 4M7 3L3 7' stroke='%239ca3af' stroke-width='1.4' stroke-linecap='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: center; }
.upgrade-plan-feature--accent { font-weight: 600; color: var(--accent); }
.upgrade-plan-feature--accent::before { background: var(--accent); }
.upgrade-plan-cta { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.upgrade-plan-cta-note { font-size: .8125rem; color: var(--text-muted); text-align: center; line-height: 1.5; }

.upgrade-faq { margin-bottom: 32px; }
.upgrade-faq-title { font-size: 1.125rem; font-weight: 700; color: var(--text); margin-bottom: 20px; }
.upgrade-faq-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.upgrade-faq-item { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; }
.upgrade-faq-q { font-size: .9375rem; font-weight: 600; color: var(--text); margin-bottom: 8px; }
.upgrade-faq-a { font-size: .875rem; color: var(--text-muted); line-height: 1.6; }

@media (max-width: 640px) {
  .auth-card { padding: 28px 20px; }
  .upgrade-plans { grid-template-columns: 1fr; }
  .upgrade-faq-grid { grid-template-columns: 1fr; }
  .nav-user-email { display: none; }
  .limit-notice { flex-direction: column; }
}

/* ── Polish layer: depth, hover elevation, motion ───────── */
.dash-panel, .upgrade-plan, .upgrade-faq-item, .auth-card { transition: box-shadow .2s ease, border-color .2s ease, transform .18s ease; }
.upgrade-plan:hover, .upgrade-faq-item:hover { box-shadow: var(--shadow-md); border-color: var(--border-hv); }
.dash-panel:hover { box-shadow: var(--shadow-md); }

/* Quieter, layered depth on primary buttons + lift on hover */
.btn--primary { box-shadow: 0 1px 2px rgb(16 24 40/.12), 0 1px 1px rgb(16 24 40/.06); }
.btn--primary:hover { box-shadow: 0 2px 4px rgb(79 70 229/.18), 0 4px 12px rgb(79 70 229/.22); }

/* Ghost button: clearer affordance on hover */
.btn--ghost:hover { box-shadow: 0 1px 2px rgb(16 24 40/.06); }

/* Stat numbers crisper, tighter */
.stat-value, .summary-num { letter-spacing: -.01em; }

/* Auth + flag note inputs get the unified focus ring already; keep their colored glow */
.auth-input:focus { box-shadow: var(--ring); }

/* Logo mark gets a subtle press affordance */
.nav-logo, .lp-logo { transition: opacity .15s ease; }
.nav-logo:active { opacity: .7; }
