:root {
  --bg: #f6f3ea;
  --panel: #ffffff;
  --line: #d9d4c7;
  --text: #1d2a22;
  --muted: #617065;
  --brand: #1c6a4d;
  --queued: #a16912;
  --fetching: #0f5b8d;
  --ready: #17603f;
  --failed: #972d20;

  /* --------------------------------------------------------------
   * Section accents.
   *
   * The app mixes two kinds of records that visually look similar
   * but semantically are very different:
   *   - "notices" (KRPP notice feed)          -> green (brand)
   *   - "plans" + "report rows" + "interested"-> blue
   *
   * Each page sets ``--section-accent`` / ``--section-accent-soft``
   * on its shell so headers, panels, and table accents pick the
   * right tone without having to thread it through every selector.
   * Defaults match the original brand (green) so untouched pages
   * keep their look.
   * -------------------------------------------------------------- */

  /* Notices palette (brand green). Used by ``.notices-shell``,
   * ``.notice-detail-shell`` and ``.cell-notice``. */
  --notice-accent: var(--brand);
  --notice-accent-soft: rgba(28, 106, 77, 0.09);
  --notice-accent-tint: rgba(28, 106, 77, 0.05);

  /* Plans/rows palette (subtle blue). Used by ``.plans2-shell``,
   * ``.detail-report-shell``, ``.report-rows-shell``,
   * ``.interested-shell`` and ``.cell-plan``. */
  --plans-accent: #2f5fa3;
  --plans-accent-soft: rgba(47, 95, 163, 0.09);
  --plans-accent-tint: rgba(47, 95, 163, 0.045);

  /* The active accent. Shells override these three variables to
   * switch between the notices and plans palettes in one place; all
   * accent rules consume ``--section-accent*`` rather than the
   * underlying palette variables so theme swaps stay cheap. */
  --section-accent: var(--notice-accent);
  --section-accent-soft: var(--notice-accent-soft);
  --section-accent-tint: var(--notice-accent-tint);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: linear-gradient(180deg, #fbf8f1, var(--bg));
  color: var(--text);
  font-family: Georgia, 'Times New Roman', serif;
}

/* Unified content width across all data-heavy pages. Login / home
 * dashboards keep their narrower card layouts via the overrides
 * below. */
.shell {
  width: min(1360px, calc(100% - 28px));
  margin: 0 auto;
  padding: 32px 0 48px;
}

.home-shell {
  max-width: 900px;
}

.auth-shell {
  max-width: 860px;
}

.header,
.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow: 0 18px 48px rgba(47, 41, 23, 0.08);
}

/* Scoped accent: any plans/rows/interested shell switches its local
 * ``--section-accent*`` to the blue palette. Notices leave the
 * defaults alone and stay green.
 *
 * Plan detail and report rows already ship with
 * ``.detail-report-shell`` on <main>, so they pick up the blue
 * accent automatically without a per-page edit. */
.plans2-shell,
.detail-report-shell,
.report-rows-shell,
.interested-shell {
  --section-accent: var(--plans-accent);
  --section-accent-soft: var(--plans-accent-soft);
  --section-accent-tint: var(--plans-accent-tint);
}

/* Very subtle visual identity: a soft tinted background on the page
 * header and each panel inside the shell is enough to register as
 * "this is a plans page / this is a notices page" without competing
 * with the content. Same tint intensity as the cell grouping below.
 * Notices shells use the default (green) accent; plans/rows shells
 * override to blue above. This rule must come AFTER the base
 * ``.header, .panel`` shorthand so the ``background`` longhand is
 * not overwritten by the cascade.
 *
 * Descendant combinators on purpose: wrapping a panel in a layout
 * div should not silently disable the accent. No other elements
 * inside these shells use ``.header`` or ``.panel`` classes. */
.notices-shell .header,
.notices-shell .panel,
.notice-detail-shell .header,
.notice-detail-shell .panel,
.plans2-shell .header,
.plans2-shell .panel,
.detail-report-shell .header,
.detail-report-shell .panel,
.report-rows-shell .header,
.report-rows-shell .panel,
.interested-shell .header,
.interested-shell .panel {
  background: var(--section-accent-tint);
}

.plans2-shell .eyebrow,
.detail-report-shell .eyebrow,
.report-rows-shell .eyebrow,
.interested-shell .eyebrow {
  color: var(--section-accent);
}

/* Plan vs notice cell tinting.
 *
 * Tables that mix plan-row information with matched-notice
 * information (interested page, report rows, any future hybrid
 * table) can tag each cell with ``.cell-plan`` or ``.cell-notice``
 * and get a very subtle colored background that separates the two
 * logical groups at a glance. The tints are deliberately tiny
 * (~5% alpha) so they read as "grouping" not "warning/status".
 * Row hover darkens the same tint slightly for continuity with the
 * existing hover style.
 *
 * We don't use ``:nth-child`` here on purpose: admin-only columns
 * shift indices between user roles, which would break position-
 * based rules. Class tags stay correct regardless. */
.plans-table tbody td.cell-plan {
  background: var(--plans-accent-tint);
}

.plans-table tbody td.cell-notice {
  background: var(--notice-accent-tint);
}

.plans-table tbody tr:hover td.cell-plan {
  background: var(--plans-accent-soft);
}

.plans-table tbody tr:hover td.cell-notice {
  background: var(--notice-accent-soft);
}

.top-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 16px;
}

.top-nav a,
.top-nav button,
.top-nav .top-nav-user {
  display: inline-flex;
  align-items: center;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text);
  text-decoration: none;
  font-family: 'Trebuchet MS', 'Segoe UI', sans-serif;
  font-size: 0.82rem;
  font-weight: 700;
  line-height: 1.4;
  letter-spacing: 0.01em;
  transition: border-color 0.12s ease, background 0.12s ease;
}

.top-nav a:hover:not([aria-current='page']) {
  background: #faf7f0;
  border-color: rgba(28, 106, 77, 0.25);
  text-decoration: none;
}

.top-nav .top-nav-user {
  background: #f3eee2;
  color: var(--muted);
}

.top-nav button {
  cursor: pointer;
  border: 1px solid var(--line);
}

.top-nav button:hover:not(:disabled) {
  background: #faf7f0;
  border-color: rgba(28, 106, 77, 0.25);
}

.top-nav a[aria-current='page'] {
  background: var(--brand);
  color: #fff;
  border-color: var(--brand);
}

.lang-switcher {
  display: inline-flex;
  gap: 4px;
  margin-left: auto;
  border-radius: 999px;
  border: 1px solid var(--line);
  padding: 3px;
  background: #fff;
}

.lang-switcher-btn {
  appearance: none;
  border: none;
  background: transparent;
  color: var(--muted);
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  cursor: pointer;
  font-family: inherit;
}

.lang-switcher-btn:hover {
  background: #faf7f0;
  color: var(--text);
}

.lang-switcher-btn[aria-current='true'] {
  background: var(--brand);
  color: #fff;
}

.auth-shell .lang-switcher {
  position: absolute;
  top: 16px;
  right: 16px;
  margin-left: 0;
}

.auth-shell {
  position: relative;
}

.header {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  padding: 24px 28px;
  align-items: flex-start;
}

.eyebrow,
.status,
.sync-meta,
.panel-head > p,
.panel-head > div > p:first-child,
button,
label,
th {
  font-family: 'Trebuchet MS', 'Segoe UI', sans-serif;
}

.eyebrow {
  margin: 0 0 6px;
  text-transform: uppercase;
  letter-spacing: 0.13em;
  color: var(--brand);
  font-size: 0.74rem;
  font-weight: 700;
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1 {
  font-size: clamp(1.65rem, 3.5vw, 2.8rem);
  line-height: 1.1;
  letter-spacing: -0.01em;
}

h2 {
  font-size: 1.2rem;
  line-height: 1.35;
  letter-spacing: -0.005em;
}

h3 {
  font-size: 0.95rem;
  line-height: 1.4;
  font-weight: 700;
}

.lede {
  margin-top: 10px;
  max-width: 52ch;
  color: var(--muted);
  line-height: 1.65;
  font-size: 0.93rem;
}

.actions {
  display: grid;
  gap: 12px;
  justify-items: end;
}

.progress {
  width: min(280px, 100%);
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  border: 1px solid rgba(28, 106, 77, 0.15);
  background: linear-gradient(90deg, #efe7d6, #f7f3ea);
  box-shadow: inset 0 1px 2px rgba(29, 42, 34, 0.08);
}

.progress-bar {
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #1c6a4d, #3c8f6f 55%, #7eb191);
  box-shadow: 0 0 18px rgba(28, 106, 77, 0.22);
  transition: width 0.35s ease;
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

button {
  border: 0;
  border-radius: 999px;
  padding: 11px 20px;
  background: var(--brand);
  color: #fff;
  font-size: 0.88rem;
  font-weight: 700;
  line-height: 1.4;
  letter-spacing: 0.01em;
  cursor: pointer;
  transition: background 0.15s ease, opacity 0.15s ease;
}

button:hover:not(:disabled) {
  background: #155c42;
}

.button-danger {
  background: #a33d2e;
}

.button-danger:hover:not(:disabled) {
  background: #8c3124;
}

button:disabled {
  opacity: 0.6;
  cursor: wait;
}

.status,
.sync-meta {
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.55;
}

.status-error {
  color: var(--failed);
}

.status-success {
  color: var(--ready);
}

.panel {
  margin-top: 20px;
  padding: 22px 24px 24px;
}

.nav-panel {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.admin-card-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.nav-card {
  display: grid;
  gap: 8px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #fcfbf7;
  color: var(--text);
  text-decoration: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.nav-card:hover {
  border-color: rgba(28, 106, 77, 0.35);
  background: #faf8f2;
  box-shadow: 0 4px 16px rgba(47, 41, 23, 0.07);
  text-decoration: none;
}

.nav-card strong {
  font-size: 1.05rem;
}

.nav-card p {
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.55;
}

.nav-label {
  font-family: 'Trebuchet MS', 'Segoe UI', sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.76rem;
  color: var(--brand);
}

.panel-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  margin-bottom: 8px;
}

.panel-head > p:first-child,
.panel-head > div > p:first-child {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: 0.01em;
  line-height: 1.4;
}

.admin-header-aside {
  min-width: min(420px, 100%);
}

.admin-summary-grid {
  display: grid;
  gap: 12px;
}

.admin-summary-card {
  display: grid;
  gap: 5px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fcfbf7;
}

.admin-summary-card strong {
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.35;
}

.admin-summary-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.5;
}

.auth-hero {
  margin-bottom: 20px;
}

.auth-header-actions {
  align-self: center;
}

.auth-panel {
  width: min(680px, 100%);
  margin: 0 auto;
}

.auth-form {
  display: grid;
  gap: 16px;
  margin-top: 18px;
}

.user-form-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  align-items: end;
}

.auth-field,
.auth-checkbox-field {
  display: grid;
  gap: 8px;
  font-family: 'Trebuchet MS', 'Segoe UI', sans-serif;
}

.auth-field input,
.auth-field select,
.user-table-input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 11px 14px;
  background: #fff;
  color: var(--text);
  font: inherit;
  font-size: 0.95rem;
  transition: border-color 0.15s ease;
}

.auth-field input:focus,
.auth-field select:focus,
.user-table-input:focus {
  outline: none;
  border-color: rgba(28, 106, 77, 0.5);
  box-shadow: 0 0 0 3px rgba(28, 106, 77, 0.08);
}

.auth-checkbox-field {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
}

.auth-button-row {
  justify-content: flex-start;
}

.user-page-actions {
  min-width: min(340px, 100%);
}

.users-table th,
.users-table td {
  vertical-align: top;
}

.users-table input[type='checkbox'] {
  width: 18px;
  height: 18px;
  margin-top: 8px;
}

.authorities-summary-panel {
  display: grid;
  gap: 18px;
}

.authorities-summary-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.authorities-summary-card {
  display: grid;
  gap: 5px;
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fcfbf7;
}

.authorities-summary-card strong {
  font-size: 1.55rem;
  line-height: 1.15;
  letter-spacing: -0.015em;
}

.authorities-summary-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.5;
}

.match-list {
  display: grid;
  gap: 10px;
}

.match-entry {
  display: grid;
  gap: 4px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fcfbf7;
}

.match-entry strong {
  font-size: 0.92rem;
  line-height: 1.45;
}

.match-entry span {
  color: var(--muted);
  font-size: 0.84rem;
}

.interested-actions-cell {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.table-wrap {
  margin-top: 18px;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: auto;
}

.plans-table {
  width: 100%;
  min-width: 980px;
  border-collapse: collapse;
  background: #fff;
}

.plans-table th,
.plans-table td {
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
  font-size: 0.88rem;
  line-height: 1.45;
}

.plans-table th {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
  background: #f6f3ec;
  font-weight: 700;
  white-space: nowrap;
  vertical-align: middle;
}

.plans-table thead th {
  position: sticky;
  top: 0;
  z-index: 3;
  box-shadow: 0 1px 0 var(--line);
}

.plans-table tbody tr:last-child td {
  border-bottom: 0;
}

.plans-table tbody tr:hover {
  background: #faf7f0;
}

/* Section-accent override for tables living inside an accent-aware
 * shell (notices green, plans/rows/interested blue). Admin/db/users
 * pages use ``.plans-table`` as a generic table skeleton without any
 * section theming, so they keep the neutral defaults above. */
.notices-shell .plans-table th,
.notice-detail-shell .plans-table th,
.plans2-shell .plans-table th,
.detail-report-shell .plans-table th,
.report-rows-shell .plans-table th,
.interested-shell .plans-table th {
  background: var(--section-accent-soft);
}

.notices-shell .plans-table tbody tr:hover,
.notice-detail-shell .plans-table tbody tr:hover,
.plans2-shell .plans-table tbody tr:hover,
.detail-report-shell .plans-table tbody tr:hover,
.report-rows-shell .plans-table tbody tr:hover,
.interested-shell .plans-table tbody tr:hover {
  background: var(--section-accent-soft);
}

a {
  color: var(--brand);
  text-decoration: none;
  font-weight: 700;
}

a:hover {
  text-decoration: underline;
}

.empty-row td,
.empty-row {
  color: var(--muted);
  padding: 32px 16px;
  text-align: center;
  font-family: 'Trebuchet MS', 'Segoe UI', sans-serif;
  font-size: 0.86rem;
}

.detail-meta {
  display: grid;
  gap: 8px;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 4px 10px;
  font-family: 'Trebuchet MS', 'Segoe UI', sans-serif;
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  background: #efe7d6;
  color: var(--text);
}

.status-badge.status-not-fetched {
  background: #efe7d6;
  color: #6b5a3f;
}

.status-badge.status-queued {
  background: #f8ead1;
  color: var(--queued);
}

.status-badge.status-fetching {
  background: #dcecf7;
  color: var(--fetching);
}

.status-badge.status-ready {
  background: #dff2e8;
  color: var(--ready);
}

.status-badge.status-failed {
  background: #f8dfdb;
  color: var(--failed);
}

.detail-meta-lines {
  display: grid;
  gap: 4px;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.4;
}

.detail-actions {
  display: grid;
  gap: 8px;
}

.button-secondary {
  background: #284f41;
}

.button-secondary:hover:not(:disabled) {
  background: #1e3d32;
}

.review-badge {
  display: inline-flex;
  align-items: center;
  margin-left: 6px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  background: rgba(255, 255, 255, 0.22);
  color: #fff;
}

.review-badge--completed {
  background: #2f8f6c;
  color: #fff;
}

.review-badge--running {
  background: #c8923a;
  color: #fff;
}

.review-badge--failed {
  background: #c0463d;
  color: #fff;
}

.model-chip {
  display: inline-block;
  margin-left: 8px;
  padding: 2px 8px;
  border-radius: 999px;
  background: #efe7d6;
  color: #6b5a3f;
  font-family: 'Trebuchet MS', 'Segoe UI', sans-serif;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  vertical-align: middle;
}

.button-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: 11px 20px;
  background: #efe7d6;
  color: var(--text);
  font-family: 'Trebuchet MS', 'Segoe UI', sans-serif;
  font-size: 0.88rem;
  font-weight: 700;
  line-height: 1.4;
  text-decoration: none;
  transition: background 0.15s ease;
}

.button-link:hover {
  background: #e0d4b8;
  text-decoration: none;
}

.button-link.is-disabled {
  opacity: 0.55;
  pointer-events: none;
}

.button-link-primary {
  background: var(--brand);
  color: #fff;
}

.button-link-primary:hover {
  background: #14533c;
  color: #fff;
}

/* Compact size modifier: used in dense row/table cells where the
 * default CTA pill (padding 11/20, 0.88rem) is visually too heavy.
 * Keeps the same pill shape and weight so buttons still read as
 * primary actions, just right-sized. */
.button-link--sm {
  padding: 6px 12px;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  border: 1px solid transparent;
  cursor: pointer;
}

.button-link--sm + .button-link--sm {
  margin-left: 0; /* gap handled by parent flex */
}

/* Accent variant: soft-tinted brand-green pill used for secondary
 * actions (Enrich) that should stand out from neutral buttons without
 * competing with the primary "Details" button. */
.button-link--accent {
  background: var(--notice-accent-soft);
  color: var(--brand);
  border-color: rgba(28, 106, 77, 0.22);
}

.button-link--accent:hover {
  background: rgba(28, 106, 77, 0.16);
  color: var(--brand);
  text-decoration: none;
}

/* Warning variant: soft-tinted danger pill used for Retry on failed
 * enrichments. Muted on purpose so it reads as "recoverable action",
 * not "destructive". */
.button-link--warning {
  background: rgba(151, 45, 32, 0.10);
  color: var(--failed);
  border-color: rgba(151, 45, 32, 0.24);
}

.button-link--warning:hover {
  background: rgba(151, 45, 32, 0.18);
  color: var(--failed);
  text-decoration: none;
}

.detail-shell {
  width: min(1280px, calc(100% - 32px));
}

.detail-header-actions {
  min-width: 240px;
}

.detail-overview-panel {
  display: grid;
  gap: 18px;
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.detail-card {
  display: grid;
  gap: 5px;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fcfbf7;
}

.detail-card-label {
  color: var(--muted);
  font-family: 'Trebuchet MS', 'Segoe UI', sans-serif;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  line-height: 1.4;
}

.detail-card-value {
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.5;
  word-break: break-word;
}

.detail-card strong {
  font-size: 1.4rem;
  line-height: 1.2;
  letter-spacing: -0.01em;
}

.detail-items-table {
  min-width: 900px;
}

.detail-report-shell {
  width: min(1440px, calc(100% - 24px));
}

.report-summary-panel,
.report-filters-panel,
.report-table-panel {
  display: grid;
  gap: 18px;
}

.report-filters-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  align-items: end;
}

.filter-field,
.filter-toggle {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-family: 'Trebuchet MS', 'Segoe UI', sans-serif;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  line-height: 1.4;
}

.filter-field-wide {
  grid-column: span 2;
}

.filter-field input,
.filter-field select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 9px 14px;
  font: inherit;
  font-size: 0.88rem;
  background: #fff;
  color: var(--text);
  transition: border-color 0.15s ease;
}

.filter-field input:focus,
.filter-field select:focus {
  outline: none;
  border-color: rgba(28, 106, 77, 0.5);
  box-shadow: 0 0 0 3px rgba(28, 106, 77, 0.08);
}

.filter-toggle {
  grid-template-columns: auto 1fr;
  align-items: center;
  min-height: 48px;
  padding: 0 4px;
}

.filter-toggle input {
  margin: 0;
}

.filter-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
  grid-column: span 2;
}

.filter-actions button {
  padding: 11px 18px;
}

.report-table-head {
  align-items: flex-start;
}

.report-head-meta {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.report-count-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 999px;
  background: #f2ece0;
  border: 1px solid var(--line);
  color: var(--text);
  font-family: 'Trebuchet MS', 'Segoe UI', sans-serif;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.03em;
}

.report-table-wrap {
  max-height: 76vh;
  overflow: auto;
}

.detail-report-table {
  min-width: 1680px;
}

.detail-report-table thead th {
  position: sticky;
  top: 0;
  z-index: 5;
  background: #f6f3ec;
  box-shadow: 0 1px 0 var(--line);
}

/* Accent-aware override, matches ``.plans-table th`` behavior above. */
.notices-shell .detail-report-table thead th,
.notice-detail-shell .detail-report-table thead th,
.plans2-shell .detail-report-table thead th,
.detail-report-shell .detail-report-table thead th,
.report-rows-shell .detail-report-table thead th,
.interested-shell .detail-report-table thead th {
  background: var(--section-accent-soft);
}

.detail-report-table th:nth-child(10),
.detail-report-table td:nth-child(10),
.detail-report-table th:nth-child(8),
.detail-report-table td:nth-child(8),
.detail-report-table th:nth-child(9),
.detail-report-table td:nth-child(9) {
  text-align: right;
}

.detail-report-table td {
  line-height: 1.5;
  font-size: 0.86rem;
}

.report-rows-shell {
  width: min(1600px, calc(100% - 24px));
}

.report-rows-filters-grid {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.analytics-report-table {
  min-width: 2300px;
}

.report-section-row td {
  position: sticky;
  top: 45px;
  z-index: 4;
  padding: 0;
  background: #fff;
}

.report-section-banner {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  padding: 10px 16px;
  background: linear-gradient(90deg, var(--section-accent-soft), var(--section-accent-tint) 65%);
  border-top: 1px solid rgba(217, 212, 199, 0.8);
  border-bottom: 1px solid rgba(217, 212, 199, 0.8);
  font-family: 'Trebuchet MS', 'Segoe UI', sans-serif;
}

.report-section-banner strong {
  font-size: 0.86rem;
  letter-spacing: 0.02em;
}

.report-section-banner span {
  color: var(--muted);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
}

.report-row.continuation-row {
  background: var(--section-accent-tint);
}

.report-row.continuation-row:hover {
  background: var(--section-accent-soft);
}

.report-row-match {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 240px;
  padding: 4px 0;
}

.report-row.split-contract-row td:first-child {
  box-shadow: inset 3px 0 0 #2a7c5b;
}

.cell-muted {
  color: transparent;
}

.cell-muted::selection {
  color: transparent;
}

.cell-numeric {
  white-space: nowrap;
}

.article-cell {
  display: grid;
  gap: 6px;
}

.report-badge {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  padding: 4px 8px;
  border-radius: 999px;
  font-family: 'Trebuchet MS', 'Segoe UI', sans-serif;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.report-badge-split {
  background: #dff0e5;
  color: #13583a;
}

.report-badge-continuation {
  background: #efe7d6;
  color: #765f2d;
}

.db-shell {
  width: min(1380px, calc(100% - 32px));
}

.db-layout {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}

.db-sidebar,
.db-main {
  display: grid;
  gap: 20px;
}

.db-card {
  display: grid;
  gap: 18px;
  padding: 0;
}

.db-panel-head {
  align-items: flex-start;
}

.table-list {
  display: grid;
  gap: 10px;
}

.table-chip {
  width: 100%;
  text-align: left;
  border: 1px solid var(--line);
  background: #fcfbf7;
  color: var(--text);
}

.table-chip.is-active,
.table-chip:hover:not(:disabled) {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}

.db-description,
.db-form,
.db-sql-form {
  padding: 0;
}

.db-form,
.db-sql-form {
  display: grid;
  gap: 14px;
}

.db-form {
  grid-template-columns: repeat(3, minmax(0, 1fr)) auto;
  align-items: end;
}

.db-form label,
.db-sql-form label,
.db-inline-field {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-family: 'Trebuchet MS', 'Segoe UI', sans-serif;
  font-size: 0.9rem;
}

.db-form input,
.db-sql-form textarea,
.db-inline-field input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 11px 14px;
  font: inherit;
  font-size: 0.9rem;
  color: var(--text);
  background: #fff;
  transition: border-color 0.15s ease;
}

.db-form input:focus,
.db-sql-form textarea:focus,
.db-inline-field input:focus {
  outline: none;
  border-color: rgba(28, 106, 77, 0.5);
  box-shadow: 0 0 0 3px rgba(28, 106, 77, 0.08);
}

.db-sql-form textarea {
  min-height: 160px;
  resize: vertical;
}

.db-inline-actions {
  align-items: end;
  justify-content: flex-start;
}

.db-toolbar,
.db-pagination {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
}

.db-pagination {
  justify-content: flex-end;
}

.db-schema-grid {
  display: grid;
  gap: 16px;
}

.db-schema-block {
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 16px;
  background: #fcfbf7;
}

.db-schema-block h3 {
  margin: 0 0 12px;
  font-family: 'Trebuchet MS', 'Segoe UI', sans-serif;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
  font-weight: 700;
}

.db-schema-list {
  display: grid;
  gap: 10px;
}

.db-schema-item {
  display: grid;
  gap: 3px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(217, 212, 199, 0.65);
}

.db-schema-item:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.db-schema-item strong,
.db-schema-item span,
.db-schema-item em {
  font-style: normal;
}

.db-table-wrap {
  margin-top: 0;
}

.db-results-table {
  min-width: 720px;
}

.batch-shell {
  width: min(1440px, calc(100% - 28px));
}

.batch-actions {
  min-width: 260px;
  justify-items: end;
}

.batch-control-panel,
.batch-summary-panel,
.batch-results-panel {
  display: grid;
  gap: 18px;
}

.batch-section-head {
  align-items: flex-start;
}

.batch-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 180px)) minmax(220px, 1fr);
  gap: 14px;
  align-items: end;
}

.batch-form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-start;
}

.flash-message {
  padding: 11px 16px;
  border-radius: 14px;
  border: 1px solid var(--line);
  font-family: 'Trebuchet MS', 'Segoe UI', sans-serif;
  font-size: 0.86rem;
  font-weight: 600;
  line-height: 1.55;
}

.flash-neutral {
  background: #f5efe3;
  color: #5e5237;
}

.flash-success {
  background: #dff2e8;
  color: var(--ready);
  border-color: rgba(23, 96, 63, 0.2);
}

.flash-error {
  background: #f8dfdb;
  color: var(--failed);
  border-color: rgba(151, 45, 32, 0.2);
}

.batch-summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.batch-failure-summary {
  display: grid;
  gap: 10px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fcfbf7;
}

.batch-inline-head {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
  font-family: 'Trebuchet MS', 'Segoe UI', sans-serif;
}

.batch-filters-grid {
  display: grid;
  grid-template-columns: minmax(180px, 220px) 150px 150px minmax(220px, 320px);
  gap: 14px;
  align-items: end;
}

.batch-table-wrap {
  max-height: none;
}

.batch-results-table {
  min-width: 1900px;
}

.batch-results-table th:nth-child(1),
.batch-results-table td:nth-child(1),
.batch-results-table th:nth-child(12),
.batch-results-table td:nth-child(12),
.batch-results-table th:nth-child(13),
.batch-results-table td:nth-child(13),
.batch-results-table th:nth-child(14),
.batch-results-table td:nth-child(14) {
  text-align: right;
}

.batch-result-row td {
  font-size: 0.9rem;
}

.batch-detail-row td {
  padding: 0;
  background: #fbf8f1;
}

.batch-detail-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  padding: 16px;
}

.batch-detail-card {
  display: grid;
  gap: 10px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
}

.batch-detail-text {
  color: var(--muted);
  line-height: 1.55;
}

.json-block {
  margin: 0;
  padding: 12px 14px;
  min-height: 84px;
  border-radius: 14px;
  background: #f5f1e8;
  color: #33443a;
  overflow: auto;
  font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
  font-size: 0.82rem;
  line-height: 1.5;
}

.batch-inspect-button {
  width: 100%;
  border: 0;
}

.plans2-shell {
  width: min(1480px, calc(100% - 28px));
}

.plans2-toolbar-panel,
.plans2-stats-panel,
.plans2-table-panel {
  display: grid;
  gap: 18px;
}

.plans2-toolbar-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.plans2-inline-form {
  display: grid;
  grid-template-columns: minmax(0, 180px) auto;
  gap: 12px;
  align-items: end;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fcfbf7;
}

.plans2-table-wrap {
  max-height: none;
}

.plans2-filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: end;
}

.plans2-filter-bar .filter-field {
  min-width: 180px;
}

.notices-filter-bar {
  margin-bottom: 16px;
}

.plans2-filter-field-wide {
  flex: 1 1 280px;
}

.plans2-table {
  min-width: 1600px;
}

.plans2-actions-cell {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.plans2-files-list {
  display: grid;
  gap: 6px;
}

.plans2-files-entry {
  display: flex;
  gap: 6px;
  align-items: baseline;
  flex-wrap: wrap;
}

.plans2-files-label {
  font-weight: 600;
}

.plans2-secondary-text {
  color: var(--muted);
}

.plans2-id-line {
  display: block;
  white-space: nowrap;
}

.plans2-error-cell {
  color: var(--failed);
}

.notices-shell {
  width: min(1600px, calc(100% - 24px));
}

.comparison-shell {
  width: min(1520px, calc(100% - 28px));
}

.comparison-header {
  align-items: stretch;
}

.comparison-actions {
  min-width: 320px;
}

.comparison-editor-panel,
.comparison-summary-panel,
.comparison-plan-panel,
.comparison-matches-panel,
.comparison-notices-panel {
  display: grid;
  gap: 18px;
}

.comparison-form {
  display: grid;
  grid-template-columns: 220px auto;
  gap: 14px;
  align-items: start;
}

.comparison-threshold-field {
  max-width: 220px;
}

.comparison-form-actions {
  display: flex;
  justify-content: flex-end;
  align-items: end;
}

.comparison-editor-card {
  display: grid;
  gap: 10px;
}

.comparison-editor-title {
  color: var(--muted);
  font-family: 'Trebuchet MS', 'Segoe UI', sans-serif;
  font-size: 0.86rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.comparison-editor-card textarea {
  min-height: 420px;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 16px;
  resize: vertical;
  background: #fcfbf7;
  color: var(--text);
  font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
  font-size: 0.84rem;
  line-height: 1.55;
  transition: border-color 0.15s ease;
}

.comparison-editor-card textarea:focus {
  outline: none;
  border-color: rgba(28, 106, 77, 0.4);
  box-shadow: 0 0 0 3px rgba(28, 106, 77, 0.07);
}

.comparison-summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.comparison-table-wrap {
  max-height: none;
}

.comparison-table,
.comparison-matches-table {
  min-width: 1120px;
}

.comparison-inline-block {
  min-height: 0;
  white-space: pre-wrap;
}

.comparison-notices-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 14px;
}

.comparison-notices-groups {
  display: grid;
  gap: 16px;
}

.comparison-notices-group {
  display: grid;
  gap: 12px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #fcfbf7;
}

.comparison-notice-card {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: linear-gradient(180deg, #fffdf7, #f5efe3);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.comparison-notice-card p {
  line-height: 1.6;
}

.notices-table {
  min-width: 1480px;
  table-layout: fixed;
}

.notices-table thead th:nth-child(1),
.notices-table .notice-id-cell {
  width: 140px;
  max-width: 140px;
  overflow-wrap: anywhere;
}

.notices-table thead th:nth-child(2),
.notices-table .notice-title-cell {
  width: 44%;
  max-width: 44%;
  overflow-wrap: anywhere;
  /* Seed-height trick: table cells normally don't propagate row
     height to children via ``height: 100%``. Setting the td itself
     to ``height: 1px`` makes the table row layout honour ``100%``
     on the inner flex column below. The cell still expands to the
     full row height because the table layout is the authority on
     final dimensions; the 1px is just a parser-friendly seed. */
  height: 1px;
}

/* Bottom-align the action button row across all rows.
   The flex container is an inner wrapper, NOT the <td> itself - making
   the cell display:flex breaks the table column-width algorithm and
   collapses the cell to its content width (titles wrapped much more
   aggressively). The <td> stays a table-cell and ``.notice-title-cell-inner``
   carries the flex column layout that pushes ``.notice-title-krpp``
   to the bottom via margin-top: auto. */
.notices-table .notice-title-cell-inner {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 100%;
}
.notices-table .notice-title-cell-inner > .notice-title-krpp {
  margin-top: auto;
}

.notices-table thead th:nth-child(3) {
  width: 140px;
}

.notices-table thead th:nth-child(4),
.notices-table .notices-typing-cell {
  overflow-wrap: anywhere;
}

.notice-actions-cell {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.notice-title-source {
  display: inline-flex;
  align-items: center;
  font-size: 0.82rem;
  white-space: nowrap;
}

.notice-title-krpp {
  margin-top: 4px;
  font-size: 0.82rem;
}

.notice-title-krpp a:not(.button-link) {
  color: var(--color-link, #2161b8);
}

.notice-detail-row td {
  padding: 0;
  background: var(--section-accent-tint);
}

.notice-detail-grid {
  display: grid;
  grid-template-columns: 1.1fr 1.2fr 1.4fr;
  gap: 14px;
  padding: 16px;
}

.notice-detail-card {
  display: grid;
  gap: 12px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
}

.notice-detail-line {
  color: var(--muted);
  line-height: 1.5;
  font-size: 0.9rem;
}

.notice-detail-line strong {
  color: var(--text);
  font-weight: 600;
}

.notice-documents-list {
  display: grid;
  gap: 12px;
}

.notice-document-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: start;
  padding: 13px 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fcfbf7;
}

.notice-document-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
}

.debug-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 14px;
}

.debug-notice-card {
  align-content: start;
}

.debug-metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
  gap: 10px;
}

.debug-metric-card {
  display: grid;
  gap: 6px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fcfbf7;
}

.debug-metric-card strong {
  color: var(--text);
}

.debug-metric-card span {
  color: var(--muted);
}

.is-hidden {
  display: none;
}

.status-badge.status-running,
.status-badge.status-started {
  background: #dcecf7;
  color: var(--fetching);
}

.status-badge.status-pending,
.status-badge.status-warning,
.status-badge.status-partial {
  background: #f8ead1;
  color: var(--queued);
}

.status-badge.status-success,
.status-badge.status-succeeded,
.status-badge.status-finished {
  background: #dff2e8;
  color: var(--ready);
}

.status-badge.status-error,
.status-badge.status-failure {
  background: #f8dfdb;
  color: var(--failed);
}

.empty-state {
  color: var(--muted);
  border: 1px dashed var(--line);
  border-radius: 16px;
  padding: 28px 24px;
  background: #fcfbf7;
  text-align: center;
  font-family: 'Trebuchet MS', 'Segoe UI', sans-serif;
  font-size: 0.88rem;
  line-height: 1.6;
}

/* Notice detail compact layout ------------------------------------------ */

/* Key info ribbon: the most important fields surfaced above the fold so
 * the user does not need to expand any collapsible panels to get the
 * essentials (deadline, value, procedure, CPV, dates). */
.notice-key-info-panel {
  padding: 16px 20px;
}

.notice-key-info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
}

.notice-key-info-card {
  display: grid;
  gap: 4px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fcfbf7;
}

.notice-key-info-label {
  color: var(--muted);
  font-family: 'Trebuchet MS', 'Segoe UI', sans-serif;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  line-height: 1.3;
}

.notice-key-info-value {
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.35;
  word-break: break-word;
}

/* Collapsible panels: ``<details>``/``<summary>`` styled to look like the
 * existing ``.panel-head`` while keeping the native disclosure behavior.
 * The default ▶ marker is replaced by a discrete caret on the right so
 * the row reads like a clickable header rather than a list item. */
.panel--collapsible {
  padding: 0;
}

.panel--collapsible > details > summary {
  list-style: none;
  cursor: pointer;
  padding: 16px 22px;
  margin-bottom: 0;
  border-radius: 20px;
  position: relative;
  user-select: none;
}

.panel--collapsible > details > summary::-webkit-details-marker {
  display: none;
}

.panel--collapsible > details > summary::after {
  content: '▾';
  position: absolute;
  right: 22px;
  top: 50%;
  transform: translateY(-50%) rotate(-90deg);
  color: var(--muted);
  font-size: 0.85rem;
  transition: transform 0.15s ease;
}

.panel--collapsible > details[open] > summary::after {
  transform: translateY(-50%) rotate(0deg);
}

.panel--collapsible > details > summary:hover {
  background: var(--section-accent-soft);
}

.panel--collapsible > details[open] > summary {
  border-bottom: 1px solid var(--line);
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
  margin-bottom: 16px;
}

.panel--collapsible > details > *:not(summary) {
  padding-left: 22px;
  padding-right: 22px;
}

.panel--collapsible > details > *:last-child:not(summary) {
  padding-bottom: 22px;
}

@media (max-width: 800px) {
  .shell {
    width: min(100% - 20px, 1100px);
    padding-top: 20px;
  }

  .header,
  .panel {
    padding: 20px;
  }

  .header,
  .panel-head {
    flex-direction: column;
    align-items: flex-start;
  }

  .nav-panel {
    grid-template-columns: 1fr;
  }

  .admin-card-grid {
    grid-template-columns: 1fr;
  }

  .authorities-summary-grid {
    grid-template-columns: 1fr;
  }

  .user-form-grid {
    grid-template-columns: 1fr;
  }

  .db-layout {
    grid-template-columns: 1fr;
  }

   .detail-grid {
    grid-template-columns: 1fr;
  }

  .db-form {
    grid-template-columns: 1fr;
  }

  .batch-form,
  .batch-summary-grid,
  .batch-filters-grid,
  .batch-detail-grid,
   .notice-detail-grid,
   .plans2-toolbar-grid,
   .comparison-summary-grid {
    grid-template-columns: 1fr;
  }

  .comparison-form {
    grid-template-columns: 1fr;
  }

  .plans2-inline-form {
    grid-template-columns: 1fr;
  }

  .batch-actions {
    justify-items: start;
  }

  .report-filters-grid {
    grid-template-columns: 1fr;
  }

  .filter-field-wide,
  .filter-actions {
    grid-column: span 1;
  }

  .report-head-meta {
    justify-content: flex-start;
  }

  .actions {
    justify-items: start;
  }

  .button-row {
    justify-content: flex-start;
  }
}

/* ---- Notices2 Phase 2 controls -------------------------------------- */

.notices-actions-cell {
  white-space: nowrap;
  vertical-align: top;
}

.notices-actions-cell > a,
.notices-actions-cell > .notices-row-actions {
  display: block;
}

.notices-actions-cell > * + * {
  margin-top: 6px;
}

.notices-row-actions {
  margin-top: 0;
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.notices-match-meta {
  margin-top: 4px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 0.78rem;
}

.notices-status-cell {
  vertical-align: top;
}

.notices-status-cell > * + * {
  margin-top: 4px;
}

.notices-typing-cell {
  vertical-align: top;
  min-width: 220px;
}

.notices-typing-cell > * + * {
  margin-top: 4px;
}

.notices-date-row > span {
  display: inline-block;
  white-space: nowrap;
}

.notices-status-row {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 4px;
}

/* ── Flag picker (Gmail/Outlook-style dropdown) ──────────────────────────── */

.notice-id-cell {
  white-space: nowrap;
}

/* Awards contract numbers (e.g. ``70433702-25-2129-2-4-7/C283``) are
   ~25 chars and would overflow the 140px column under the global
   ``nowrap`` above. Re-enable wrapping for awards rows specifically;
   notices2 IDs (short numeric) keep the existing nowrap. */
.awards-table .notice-id-cell {
  white-space: normal;
}

/* Awards-specific column widths. The shared ``.notices-table`` rules
   set ``:nth-child(3)`` to 140px (designed for notices2's narrow
   "Value" column). On the awards table column 3 is the Operator name
   - frequently 40-60 characters long ("Grup i Operatorëve Ekonomik
   ...") - so 140px wraps almost every row. Give it more room and let
   the cell wrap naturally. */
.awards-table thead th:nth-child(3),
.awards-table tbody td:nth-child(3) {
  width: auto;
  min-width: 280px;
  max-width: none;
  overflow-wrap: anywhere;
}

.awards-eproc-link {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px dotted currentColor;
}

.awards-eproc-link:hover,
.awards-eproc-link:focus-visible {
  color: #2563eb;
  border-bottom-style: solid;
}

.awards-eproc-icon {
  font-size: 0.85em;
  opacity: 0.65;
}

.awards-row-actions {
  margin-top: 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.awards-row-button {
  font-size: 11px;
  padding: 3px 10px;
  border-radius: 6px;
  border: 1px solid #b91c1c;
  background: var(--panel);
  color: #b91c1c;
  cursor: pointer;
  line-height: 1.4;
  text-decoration: none;
  display: inline-block;
  white-space: nowrap;
}

.awards-row-button:hover:not(:disabled),
.awards-row-button:focus-visible {
  background: #b91c1c;
  color: #fff;
}

.awards-row-button:disabled {
  opacity: 0.6;
  cursor: progress;
}

.notice-id-row {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.notice-new-badge,
.notice-expired-badge,
.notice-soon-badge {
  display: inline-block;
  padding: 1px 6px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.4px;
  color: #fff;
  border-radius: 999px;
  line-height: 1.4;
  text-transform: uppercase;
}

.notice-new-badge {
  background: #10b981;
}

.notice-expired-badge {
  background: #ef4444;
}

.notice-soon-badge {
  background: #f59e0b;
}

.notice-id-flag {
  margin-top: 4px;
}

.flag-picker {
  position: relative;
  display: inline-block;
}

.flag-picker-trigger {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 8px 3px 7px;
  min-width: 86px;
  border: 1px solid rgba(29, 42, 34, 0.18);
  border-radius: 6px;
  background: #fff;
  color: var(--text, #1d2a22);
  font-family: 'Trebuchet MS', 'Segoe UI', sans-serif;
  font-size: 0.76rem;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  transition: border-color 0.12s ease, box-shadow 0.12s ease, background-color 0.12s ease;
}

.flag-picker-trigger:hover {
  background: #f8f5ee;
  border-color: rgba(29, 42, 34, 0.3);
}

.flag-picker-trigger:focus-visible {
  outline: 2px solid rgba(28, 106, 77, 0.35);
  outline-offset: 2px;
}

.flag-picker.is-open .flag-picker-trigger {
  border-color: rgba(28, 106, 77, 0.5);
  box-shadow: 0 0 0 2px rgba(28, 106, 77, 0.12);
}

.flag-picker-label {
  flex: 1;
  white-space: nowrap;
  text-align: left;
}

.flag-picker-caret {
  font-size: 0.65rem;
  opacity: 0.6;
  margin-left: 2px;
}

.flag-picker-menu {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  z-index: 400;
  min-width: 160px;
  background: #fff;
  border: 1px solid rgba(0, 0, 0, 0.12);
  border-radius: 8px;
  box-shadow: 0 6px 20px rgba(29, 42, 34, 0.14);
  padding: 4px;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.flag-picker-menu[hidden] {
  display: none;
}

.flag-menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 7px 10px;
  border: none;
  background: transparent;
  border-radius: 5px;
  font-family: 'Trebuchet MS', 'Segoe UI', sans-serif;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text, #1d2a22);
  cursor: pointer;
  text-align: left;
  transition: background-color 0.1s ease;
}

.flag-menu-item:hover,
.flag-menu-item:focus-visible {
  background: #f2ede4;
  outline: none;
}

.flag-menu-item.is-active {
  background: #ece7db;
  font-weight: 700;
}

.flag-menu-item--clear {
  border-top: 1px solid rgba(0, 0, 0, 0.08);
  margin-top: 3px;
  padding-top: 8px;
  color: #6a6f6b;
}

.flag-menu-item--clear:hover {
  background: #f7f2eb;
  color: #3c3f3d;
}

.flag-menu-item-label {
  line-height: 1;
}

/* Colored dot indicator */
.flag-dot {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
  font-size: 0.55rem;
  font-weight: 700;
  color: #fff;
}

.flag-dot--none {
  background: #dcd7cb;
  border: 1px solid #c6c0b3;
}

.flag-dot--red {
  background: #c0392b;
}

.flag-dot--blue {
  background: #2980b9;
}

.flag-dot--green {
  background: var(--brand, #1c6a4d);
}

.flag-dot--yellow {
  background: #f1c40f;
}

.flag-dot--orange {
  background: #e67e22;
}

.flag-dot--purple {
  background: #8e44ad;
}

.flag-dot--clear {
  background: transparent;
  color: #888;
  font-size: 0.6rem;
  width: 12px;
  height: 12px;
}

/* Enrichment-status badges reuse the existing palette; only the
   ``enriched`` success tint needs a dedicated rule because ``ready`` is
   already wired. Everything else slots into the shared styles. */
.status-badge.status-enriched {
  background: #dff2e8;
  color: var(--ready);
}

/* At-a-glance enrich/review state pills rendered beside the notice
   title (see ``renderRows`` in notices2.js). Same palette as the
   status badges but smaller and lowercase so they read as metadata,
   not shouting. */
.notice-state-badge {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 8px;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  white-space: nowrap;
  vertical-align: 1px;
}

.notice-state-badge--enriched {
  background: #dff2e8;
  color: var(--ready);
}

.notice-state-badge--reviewed {
  background: #e3e9fb;
  color: #3d4fb5;
}

.notice-state-badge--progress {
  background: #f8ead1;
  color: var(--queued);
}

.notice-state-badge--failed {
  background: #f8dfdb;
  color: var(--failed);
}

/* ==========================================================================
   Home page redesign (home.html). All rules are scoped to ``.home-v2`` so
   admin.html / other dashboards keep using ``.nav-card`` / ``.nav-panel``.
   ========================================================================== */

.home-v2 {
  width: min(1360px, calc(100% - 28px));
}

/* Hero ---------------------------------------------------------------- */
.home-hero {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
  padding: 28px 32px 28px;
  border-radius: 22px;
  border: 1px solid var(--line);
  position: relative;
  overflow: hidden;
}

.home-hero::before {
  content: '';
  position: absolute;
  inset: 0 0 auto 0;
  height: 4px;
  background: linear-gradient(
    90deg,
    var(--notice-accent),
    var(--plans-accent)
  );
}

@media (min-width: 880px) {
  .home-hero {
    grid-template-columns: 1fr minmax(280px, 320px);
    align-items: center;
  }
}

.home-hero-text h1 {
  margin: 4px 0 8px;
  font-size: 1.85rem;
  letter-spacing: -0.01em;
}

.home-hero-text .lede {
  margin: 0;
  max-width: 60ch;
}

.home-hero-meta {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-content: flex-start;
}

.home-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #fbf9f3;
  font-family: 'Trebuchet MS', 'Segoe UI', sans-serif;
  font-size: 0.78rem;
  line-height: 1;
}

.home-chip-key {
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-size: 0.66rem;
  color: var(--muted);
}

.home-chip-val {
  font-weight: 600;
  color: var(--text);
}

.home-chip--notice {
  background: var(--notice-accent-tint);
  border-color: rgba(28, 106, 77, 0.25);
}

.home-chip--plan {
  background: var(--plans-accent-tint);
  border-color: rgba(47, 95, 163, 0.22);
}

.home-chip--ok {
  background: #dff2e8;
  border-color: rgba(23, 96, 63, 0.28);
}

.home-chip--ok .home-chip-val {
  color: var(--ready);
}

.home-chip--warn {
  background: #fcefe1;
  border-color: rgba(161, 105, 18, 0.32);
}

.home-chip--warn .home-chip-val {
  color: var(--queued);
}

.home-chip--placeholder .home-chip-val {
  color: var(--muted);
}

/* Sections + headings ------------------------------------------------- */
.home-v2 .home-section {
  margin-top: 28px;
}

.home-section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 14px;
  margin-bottom: 14px;
}

.home-section-head h2 {
  margin: 0;
  font-size: 1.1rem;
  letter-spacing: -0.005em;
}

.home-section-head p {
  margin: 0;
  color: var(--muted);
  font-size: 0.86rem;
}

/* Grids --------------------------------------------------------------- */
.home-grid {
  display: grid;
  gap: 16px;
}

.home-grid--primary {
  grid-template-columns: 1fr;
}

@media (min-width: 720px) {
  .home-grid--primary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 1080px) {
  .home-grid--primary {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

.home-grid--secondary {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

/* Primary tiles ------------------------------------------------------- */
.home-tile {
  position: relative;
  display: grid;
  gap: 8px;
  align-content: start;
  padding: 22px 22px 56px;
  min-height: 168px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--text);
  text-decoration: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease,
    transform 0.15s ease;
  overflow: hidden;
}

.home-tile::before {
  content: '';
  position: absolute;
  inset: 0 0 auto 0;
  height: 3px;
  background: var(--tile-accent, var(--brand));
}

.home-tile:hover {
  text-decoration: none;
  border-color: var(--tile-accent, var(--brand));
  box-shadow: 0 6px 20px rgba(47, 41, 23, 0.07);
  transform: translateY(-1px);
}

.home-tile-label {
  font-family: 'Trebuchet MS', 'Segoe UI', sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.72rem;
  color: var(--tile-accent, var(--brand));
}

.home-tile strong {
  font-size: 1.18rem;
  letter-spacing: -0.01em;
}

.home-tile p {
  margin: 0;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.55;
}

.home-tile-cta {
  position: absolute;
  left: 22px;
  bottom: 18px;
  font-family: 'Trebuchet MS', 'Segoe UI', sans-serif;
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  color: var(--tile-accent, var(--brand));
  font-weight: 600;
}

.home-tile--notice {
  --tile-accent: var(--notice-accent);
  background: linear-gradient(
    180deg,
    var(--notice-accent-tint),
    var(--panel) 65%
  );
}

.home-tile--plan {
  --tile-accent: var(--plans-accent);
  background: linear-gradient(
    180deg,
    var(--plans-accent-tint),
    var(--panel) 65%
  );
}

/* Mini tiles ---------------------------------------------------------- */
.home-mini-tile {
  display: grid;
  gap: 4px;
  padding: 16px 18px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: #fcfbf7;
  color: var(--text);
  text-decoration: none;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.home-mini-tile:hover {
  text-decoration: none;
  border-color: rgba(28, 106, 77, 0.4);
  background: #faf8f2;
}

.home-mini-tile strong {
  font-size: 0.98rem;
}

.home-mini-tile p {
  margin: 0;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.5;
}

.home-mini-tile--admin {
  background: #f9f5ec;
  border-style: dashed;
}

.home-mini-tile--admin:hover {
  border-style: solid;
}

/* About panel --------------------------------------------------------- */
.home-v2 .home-about {
  margin-top: 28px;
  padding: 28px 28px 24px;
}

.home-pipeline {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 14px;
  grid-template-columns: 1fr;
}

@media (min-width: 720px) {
  .home-pipeline {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 1080px) {
  .home-pipeline {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }
}

.home-pipeline li {
  position: relative;
  padding: 14px 16px 16px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: #fbf9f3;
}

.home-pipeline-step {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--brand);
  color: #fff;
  font-family: 'Trebuchet MS', 'Segoe UI', sans-serif;
  font-size: 0.78rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.home-pipeline strong {
  display: block;
  font-size: 0.98rem;
  margin-bottom: 4px;
}

.home-pipeline p {
  margin: 0;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.5;
}

.home-config {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px dashed var(--line);
}

.home-config h3 {
  margin: 0 0 12px;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--brand);
}

.home-config-dl {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px 22px;
  margin: 0;
  font-size: 0.88rem;
}

@media (min-width: 720px) {
  .home-config-dl {
    grid-template-columns: max-content 1fr max-content 1fr;
  }
}

.home-config-dl dt {
  color: var(--muted);
  font-weight: 500;
}

.home-config-dl dd {
  margin: 0;
  color: var(--text);
  font-family: 'Menlo', 'Consolas', monospace;
  font-size: 0.84rem;
  word-break: break-word;
}

.home-config-note {
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.5;
}

/* Admin row ----------------------------------------------------------- */
.home-admin-row {
  margin-top: 28px;
  padding-top: 24px;
  border-top: 1px dashed var(--line);
}
