:root {
  --bg: #f4f6fa;
  --surface: #ffffff;
  --ink: #1b2430;
  --muted: #5d6b7f;
  --line: #dfe4ec;
  --brand: #4f46e5;
  --brand-deep: #4338ca;
  --brand-soft: #eef0fe;
  --brand-ink: #ffffff;
  --danger: #b3261e;
  --danger-bg: #fdecea;
  --radius: 10px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

h1 { font-size: 1.5rem; margin: 0 0 .25rem; }
h2 { font-size: 1.15rem; margin: 0 0 .5rem; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.block { display: block; }

.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;
}

/* ---------------------------------------------------------------- layout */
.shell { display: grid; grid-template-columns: 250px minmax(0, 1fr); min-height: 100vh; }

.sidebar {
  display: flex; flex-direction: column; gap: 1.5rem;
  padding: 1.5rem 1.1rem;
  background: var(--surface);
  border-right: 1px solid var(--line);
  position: sticky; top: 0; height: 100vh;
}
.sidebar-brand {
  display: flex; align-items: center; gap: .55rem;
  color: var(--brand); text-decoration: none;
  font-weight: 700; font-size: 1rem; letter-spacing: -.01em;
  padding: .25rem;
}
.sidebar-brand svg { width: 30px; height: 30px; flex: none; }
.sidebar-brand span { color: var(--ink); }

.sidebar-nav { display: flex; flex-direction: column; gap: .15rem; flex: 1; }
.nav-heading {
  font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .07em;
  color: var(--muted); padding: 1rem .7rem .4rem;
}
.sidebar-nav a {
  padding: .6rem .7rem; border-radius: 8px;
  color: var(--muted); text-decoration: none; font-weight: 500; font-size: .92rem;
}
.sidebar-nav a:hover { background: var(--bg); color: var(--ink); }
.sidebar-nav a.is-current { background: var(--brand-soft); color: var(--brand); font-weight: 600; }

.sidebar-user {
  display: grid; gap: .6rem;
  padding: .75rem;
  border: 1px solid var(--line); border-radius: 12px;
  background: var(--bg);
}
.sidebar-user-id {
  display: grid; grid-template-columns: auto minmax(0, 1fr);
  gap: .6rem; align-items: center; min-width: 0;
}
.avatar {
  width: 36px; height: 36px; border-radius: 50%; flex: none;
  display: grid; place-items: center;
  background: var(--brand); color: #fff;
  font-weight: 700; font-size: .95rem;
}
.sidebar-user-meta { min-width: 0; display: grid; gap: .25rem; justify-items: start; }
.sidebar-user-meta strong {
  font-size: .86rem; font-weight: 600; line-height: 1.2;
  max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

.btn-signout {
  width: 100%; margin-top: 0;
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
  padding: .5rem .7rem;
  background: var(--surface); color: var(--muted);
  border: 1px solid var(--line); border-radius: 8px;
  font-size: .84rem; font-weight: 500;
}
.btn-signout svg { width: 16px; height: 16px; flex: none; }
.btn-signout:hover { background: var(--danger-bg); color: var(--danger); border-color: #f0c4c0; }

/* back-to-list link: reads as navigation, not as body-copy link */
.back-link {
  display: inline-flex; align-items: center; gap: .3rem;
  margin-bottom: .5rem;
  color: var(--muted); text-decoration: none;
  font-size: .86rem; font-weight: 500;
}
.back-link svg { width: 15px; height: 15px; transition: transform .12s ease; }
.back-link:hover { color: var(--brand); }
.back-link:hover svg { transform: translateX(-2px); }

.page { padding: clamp(1.25rem, 3vw, 2.25rem); max-width: 1200px; }
.page-status { padding: 2rem 1.25rem; color: var(--muted); }
.page-head { margin-bottom: 1.5rem; }
.page-head h1 { font-size: 1.65rem; letter-spacing: -.02em; }
.page-head p { margin: 0; }

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 1.25rem;
  margin-bottom: 1.25rem;
}

/* ------------------------------------------------------------ stat tiles */
.stat-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 1rem; margin-bottom: 1.25rem;
}
.stat {
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px;
  padding: 1.1rem; display: grid; gap: .3rem;
}
.stat-lead { background: var(--brand); border-color: var(--brand); color: #fff; }
.stat strong { font-size: 2rem; font-weight: 700; letter-spacing: -.02em; line-height: 1.1; }
.stat-label {
  font-size: .72rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .06em; color: var(--muted);
}
.stat-foot { font-size: .78rem; color: var(--muted); }
.stat-lead .stat-label, .stat-lead .stat-foot { color: rgba(255, 255, 255, .78); }

/* -------------------------------------------------------- forms in pages */
.field { display: grid; gap: .35rem; align-content: start; }
.field label { font-size: .82rem; font-weight: 600; margin: 0; }
.field input, .field select { margin-top: 0; max-width: none; }
.field-grow { flex: 1 1 14rem; }
.field-actions { align-self: end; display: flex; gap: .5rem; align-items: center; }
.field-actions button { margin-top: 0; }

.filter-bar { display: flex; flex-wrap: wrap; gap: .85rem; align-items: end; }
.filter-bar .field { min-width: 10rem; }

.form-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 1rem; margin-top: 1rem;
}

.disclosure summary {
  cursor: pointer; font-weight: 600;
  list-style: none; display: flex; align-items: center; gap: .5rem;
}
.disclosure summary::-webkit-details-marker { display: none; }
.disclosure summary::before {
  content: "+"; display: grid; place-items: center;
  width: 22px; height: 22px; border-radius: 6px;
  background: var(--brand-soft); color: var(--brand); font-weight: 700;
}
.disclosure[open] summary::before { content: "\2212"; }

.btn-ghost {
  display: inline-block; margin-top: 0; padding: .6rem .9rem;
  background: var(--surface); color: var(--ink);
  border: 1px solid var(--line); border-radius: 8px;
  font: inherit; font-weight: 500; text-decoration: none; cursor: pointer;
}
.btn-ghost:hover { background: var(--bg); }
.btn-danger { color: var(--danger); border-color: #f0c4c0; }
.btn-danger:hover { background: var(--danger-bg); }

.empty { text-align: center; padding: 2.5rem 1.25rem; }
.empty p { margin: 0 0 .3rem; }

/* ------------------------------------------------------- form primitives */
input {
  width: 100%; margin-top: .35rem; padding: .6rem .7rem;
  border: 1px solid var(--line); border-radius: 6px;
  font: inherit; color: inherit; background: var(--surface);
}
input:focus-visible, button:focus-visible, select:focus-visible {
  outline: 3px solid var(--brand); outline-offset: 2px;
}

button {
  margin-top: 1.25rem; padding: .65rem 1.1rem;
  background: var(--brand); color: var(--brand-ink);
  border: 0; border-radius: 6px; font: inherit; font-weight: 500; cursor: pointer;
}
button:disabled { opacity: .6; cursor: progress; }
button.link {
  margin: 0; padding: 0; background: none; color: inherit;
  text-decoration: underline; font-weight: 400;
}

/* ------------------------------------------------------------------ auth */
.auth {
  min-height: 100vh;
  display: grid; place-items: center;
  padding: clamp(1rem, 3vw, 2.5rem);
  background: var(--bg);
}

.auth-panel {
  width: 100%; max-width: 1180px;
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
  gap: clamp(1.5rem, 3vw, 3rem);
  background: var(--surface);
  border-radius: 22px;
  padding: clamp(1.5rem, 3vw, 2.25rem);
  box-shadow: 0 24px 60px rgba(27, 36, 48, .10);
}

/* -- left column: brand, form, footer ------------------------------------ */
.auth-form-col {
  display: flex; flex-direction: column;
  padding: clamp(.5rem, 2vw, 1.75rem);
}

.auth-brand { display: flex; align-items: center; gap: .6rem; color: var(--brand); }
.auth-mark { width: 34px; height: 34px; flex: none; }
.auth-wordmark { font-size: 1.15rem; font-weight: 700; color: var(--ink); letter-spacing: -.01em; }

.auth-form {
  margin: auto 0;                     /* vertically centres the form in the column */
  width: 100%; max-width: 400px;
  align-self: center;
  padding: 2.5rem 0;
}
.auth-form h1 {
  font-size: clamp(1.9rem, 3.4vw, 2.5rem);
  font-weight: 700; letter-spacing: -.02em;
  text-align: center; margin: 0 0 .5rem;
}
.auth-sub { text-align: center; color: var(--muted); margin: 0 0 2rem; }

.auth-form label {
  display: block; margin-top: 1.1rem;
  font-weight: 500; font-size: .9rem;
}
.auth-form input {
  padding: .8rem .9rem;
  border-radius: 10px;
}
.auth-form input::placeholder { color: #9aa5b6; }

/* the reveal button sits inside the field box, so the box owns the focus ring */
.field-with-button { position: relative; }
.field-with-button input { padding-right: 3rem; }
.reveal {
  position: absolute; right: .35rem; top: 50%; transform: translateY(-50%);
  margin: 0; padding: .45rem;
  display: grid; place-items: center;
  background: none; color: var(--muted); border-radius: 8px;
}
.reveal svg { width: 20px; height: 20px; display: block; }
.reveal[aria-pressed="true"] .reveal-slash { display: none; }
.reveal:hover { color: var(--ink); }

.btn-primary {
  width: 100%; margin-top: 1.75rem; padding: .85rem 1rem;
  border-radius: 10px; font-size: 1rem; font-weight: 600;
  background: var(--brand);
}
.btn-primary:hover { background: var(--brand-deep); }

.auth-hint {
  margin: 1.25rem 0 0; text-align: center;
  font-size: .85rem; color: var(--muted);
}
.auth-hint code {
  background: var(--brand-soft); color: var(--brand);
  padding: .1rem .4rem; border-radius: 5px; font-size: .85em;
}

.auth-foot {
  display: flex; flex-wrap: wrap; gap: .5rem;
  justify-content: space-between;
  font-size: .85rem; color: var(--muted);
}

/* -- right column: decorative product preview ---------------------------- */
.auth-hero {
  border-radius: 16px;
  background: var(--brand);
  color: #fff;
  padding: clamp(1.75rem, 3vw, 3rem);
  padding-bottom: 0;              /* the preview card bleeds off the bottom edge */
  display: flex; flex-direction: column;
  min-height: 520px;
  overflow: hidden;
}
.auth-hero h2 {
  font-size: clamp(1.5rem, 2.6vw, 2.15rem);
  line-height: 1.25; font-weight: 700; letter-spacing: -.02em;
  margin: 0 0 .9rem;
}
.auth-hero > p { margin: 0 0 2.5rem; color: rgba(255, 255, 255, .8); }

.hero-art {
  margin-top: auto;
  background: #fff; color: var(--ink);
  border-radius: 14px 14px 0 0;
  padding: 1.1rem;
  display: grid; gap: .8rem;
  box-shadow: 0 -10px 40px rgba(0, 0, 0, .15);
}
.hero-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .7rem; }
.hero-stat {
  border: 1px solid var(--line); border-radius: 10px;
  padding: .8rem; display: grid; gap: .3rem;
}
.hero-stat-lead { background: var(--brand); border-color: var(--brand); color: #fff; }
.hero-stat strong { font-size: 1.6rem; font-weight: 700; letter-spacing: -.02em; }
.hero-label { font-size: .72rem; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.hero-foot { font-size: .72rem; color: var(--muted); }
.hero-stat-lead .hero-label,
.hero-stat-lead .hero-foot { color: rgba(255, 255, 255, .75); }

.hero-list { border: 1px solid var(--line); border-radius: 10px; padding: .8rem; }
.hero-list ul { list-style: none; margin: .6rem 0 0; padding: 0; }
.hero-list li {
  display: flex; justify-content: space-between; gap: 1rem;
  padding: .45rem 0; font-size: .85rem;
  border-bottom: 1px solid var(--line);
}
.hero-list li:last-child { border-bottom: 0; }
.hero-list em { font-style: normal; font-weight: 600; color: var(--brand); }

@media (max-width: 900px) {
  /* single column: the form comes first so it is never pushed below the fold -
     the hero is decorative and reads fine underneath it. */
  .auth-panel { grid-template-columns: 1fr; }
  .auth-hero { min-height: 0; }
  .auth-form { padding: 1.75rem 0; margin: 0 auto; }
  .auth-foot { margin-bottom: 1.25rem; }
}
@media (max-width: 560px) {
  .auth { padding: 0; }
  .auth-panel { border-radius: 0; box-shadow: none; min-height: 100vh; }
  .hero-stats { grid-template-columns: 1fr; }
}

.notice { padding: .8rem 1rem; border-radius: 10px; margin: 0 0 1.25rem; font-size: .92rem; }
.notice-error { background: var(--danger-bg); color: var(--danger); }
.notice-success { background: #e7f6ee; color: #146c43; }
.auth-form .notice { margin: 0 0 1rem; }

/* ----------------------------------------------------------------- table */
.table-wrap { padding: 0; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; min-width: 640px; }
th, td { text-align: left; padding: .8rem 1.1rem; border-bottom: 1px solid var(--line); vertical-align: middle; }
th {
  font-size: .72rem; text-transform: uppercase; letter-spacing: .06em;
  color: var(--muted); background: var(--bg); font-weight: 700;
}
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: #fafbfe; }
tr.is-inactive td { opacity: .55; }
td.col-action { text-align: right; }
td.nowrap { white-space: nowrap; }
td form { margin: 0; }
td select { max-width: 11rem; padding: .4rem .5rem; font-size: .88rem; }
td .btn-ghost { padding: .4rem .7rem; font-size: .85rem; }

.row-title { font-weight: 600; color: var(--ink); text-decoration: none; }
.row-title:hover { color: var(--brand); text-decoration: underline; }

.tag {
  display: inline-block; padding: .2rem .55rem; border-radius: 999px;
  background: var(--brand-soft); color: var(--brand);
  font-size: .75rem; font-weight: 600; white-space: nowrap;
}

.status { font-size: .82rem; font-weight: 600; white-space: nowrap; }
.status-completed   { color: #146c43; }
.status-in_progress { color: #8a5a00; }
.status-approved    { color: var(--brand); }
.status-proposed    { color: var(--muted); }
.status-rejected    { color: var(--danger); }

.progress {
  width: 100px; height: 7px; border-radius: 999px;
  background: var(--line); overflow: hidden; margin-bottom: .3rem;
}
.progress span { display: block; height: 100%; background: var(--brand); border-radius: 999px; }

/* ------------------------------------------------- filter form + detail list */
select {
  width: 100%; margin-top: .35rem; padding: .6rem .7rem;
  border: 1px solid var(--line); border-radius: 8px;
  font: inherit; color: inherit; background: var(--surface);
}

dl { margin: 0; display: grid; grid-template-columns: minmax(7rem, 10rem) 1fr; gap: .6rem 1rem; }
dl dt { margin: 0; }
dl dd { margin: 0; }

/* ------------------------------------------------------------- responsive */
@media (max-width: 860px) {
  /* the sidebar becomes a horizontal strip above the page */
  .shell { grid-template-columns: 1fr; }
  .sidebar {
    position: static; height: auto;
    flex-direction: row; flex-wrap: wrap; align-items: center;
    gap: .75rem 1rem; border-right: 0; border-bottom: 1px solid var(--line);
  }
  /* row 1: brand + account. row 2: the nav links, full width. */
  .sidebar-brand { order: 0; }
  .sidebar-user  { order: 1; margin-left: auto; }
  .sidebar-nav   { order: 2; flex-basis: 100%; flex-direction: row; flex-wrap: wrap; align-items: center; }
  .nav-heading { display: none; }

  .sidebar-user {
    grid-template-columns: auto auto; align-items: center;
    gap: .6rem; padding: .4rem .5rem;
  }
  .sidebar-user .avatar { width: 30px; height: 30px; font-size: .85rem; }
  .btn-signout { width: auto; }
}
@media (max-width: 560px) {
  dl { grid-template-columns: 1fr; gap: .15rem; }
  dl dd { margin-bottom: .6rem; }
  .filter-bar .field { min-width: 100%; }
}

/* ------------------------------------------------- domains & keyword editor */
.callout {
  display: flex; flex-wrap: wrap; gap: 1rem;
  align-items: center; justify-content: space-between;
  background: var(--brand-soft); border-color: transparent;
}
.callout p { margin: .2rem 0 0; }
.callout form { flex: none; }
.callout button { margin-top: 0; }

.domain-head {
  display: flex; flex-wrap: wrap; gap: .75rem 1rem;
  align-items: start; justify-content: space-between;
  margin-bottom: 1rem;
}
.domain-head h2 { font-size: 1.05rem; margin: 0; }
.domain-head p { margin: .2rem 0 0; }
.domain-meta { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; }
.domain-meta form { margin: 0; }

.chips { list-style: none; margin: 0 0 1rem; padding: 0; display: flex; flex-wrap: wrap; gap: .45rem; }
.chip {
  display: inline-flex; align-items: center; gap: .4rem;
  padding: .3rem .3rem .3rem .65rem;
  border: 1px solid var(--line); border-radius: 999px;
  background: var(--surface); font-size: .85rem;
}
.chip form { margin: 0; display: flex; }
.chip-weight {
  padding: .05rem .4rem; border-radius: 999px;
  background: var(--brand-soft); color: var(--brand);
  font-size: .72rem; font-weight: 700;
}
.chip-x {
  margin: 0; padding: 0; width: 20px; height: 20px;
  display: grid; place-items: center;
  background: none; color: var(--muted);
  border-radius: 50%; font-size: 1rem; line-height: 1;
}
.chip-x:hover { background: var(--danger-bg); color: var(--danger); }

.keyword-add {
  display: flex; flex-wrap: wrap; gap: .75rem; align-items: end;
  border-top: 1px solid var(--line); padding-top: 1rem;
}
.keyword-add .field { min-width: 8rem; }
.keyword-add input[type="number"] { width: 6rem; }

/* ------------------------------------------------------- status decision panel */
.decision h2 { margin-bottom: .25rem; }
.decision-form {
  display: flex; flex-wrap: wrap; gap: .85rem;
  align-items: end; margin-top: 1rem;
}
.decision-actions { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.decision-actions button { margin-top: 0; }

/* ------------------------------------------------ submissions & thread */
.page-head { display: flex; flex-wrap: wrap; gap: 1rem; align-items: end; justify-content: space-between; }
.page-head-actions { display: flex; gap: .5rem; }
.btn-ghost.is-on { background: var(--brand-soft); color: var(--brand); border-color: transparent; }

textarea {
  width: 100%; padding: .6rem .7rem;
  border: 1px solid var(--line); border-radius: 8px;
  font: inherit; color: inherit; background: var(--surface); resize: vertical;
}
textarea:focus-visible { outline: 3px solid var(--brand); outline-offset: 2px; }
input[type="file"] { padding: .45rem .5rem; }

.submission { border-top: 1px solid var(--line); padding: 1rem 0; }
.submission:first-of-type { border-top: 0; padding-top: .25rem; }
.submission-head {
  display: flex; flex-wrap: wrap; gap: .6rem 1rem;
  align-items: start; justify-content: space-between;
}

.thread { list-style: none; margin: .9rem 0 0; padding: 0 0 0 .9rem; border-left: 2px solid var(--line); }
.thread li { margin-bottom: .8rem; }
.thread li:last-child { margin-bottom: 0; }
.thread-who { display: flex; flex-wrap: wrap; gap: .35rem; align-items: center; font-size: .82rem; font-weight: 600; }
.thread p { margin: .3rem 0 0; font-size: .9rem; }

.plain-list { list-style: none; margin: 0; padding: 0; }
.plain-list li {
  padding: .55rem 0; border-bottom: 1px solid var(--line);
  font-size: .9rem; display: flex; flex-wrap: wrap; gap: .45rem; align-items: center;
}
.plain-list li:last-child { border-bottom: 0; }

.similar-list .sim-score {
  min-width: 3.4rem; padding: .1rem .45rem; border-radius: 6px;
  background: var(--bg); color: var(--muted);
  font-variant-numeric: tabular-nums; font-weight: 700; font-size: .8rem; text-align: center;
}
.similar-list a { color: var(--ink); font-weight: 600; text-decoration: none; }
.similar-list a:hover { color: var(--brand); text-decoration: underline; }
.similar-list li.is-flagged .sim-score { background: var(--danger-bg); color: var(--danger); }
.tag-danger { background: var(--danger-bg); color: var(--danger); }

.progress-form { border-top: 1px solid var(--line); padding-top: 1rem; margin-top: 1rem; }
.progress-form input { width: 6rem; }
.progress-note { flex-basis: 100%; margin: 0; }

.schedule-actions form { margin: 0; }
.consult-body { margin-bottom: 1rem; }
.consult-reply { display: flex; flex-wrap: wrap; gap: .75rem; align-items: end;
  border-top: 1px solid var(--line); padding-top: 1rem; }
.report-table table { min-width: 520px; }
.report-more { margin: .75rem 0 0; }
.cell-flag { color: var(--danger); font-weight: 700; }

/* ------------------------------------ notifications, profile, archive, panel */
.nav-bell { display: flex; align-items: center; justify-content: space-between; gap: .5rem; }
.badge {
  min-width: 20px; padding: .05rem .4rem; border-radius: 999px;
  background: var(--danger); color: #fff;
  font-size: .7rem; font-weight: 700; text-align: center; line-height: 1.5;
}
.sidebar-user-name {
  font-size: .86rem; font-weight: 600; line-height: 1.2; color: var(--ink); text-decoration: none;
  max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.sidebar-user-name:hover { color: var(--brand); }

.notif-list { padding: 0; }
.notif {
  display: flex; flex-wrap: wrap; gap: .75rem 1rem;
  align-items: center; justify-content: space-between;
  padding: .9rem 1.25rem; border-bottom: 1px solid var(--line);
}
.notif:last-child { border-bottom: 0; }
.notif.is-unread { background: var(--brand-soft); }
.notif.is-unread .notif-body strong::before {
  content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%;
  background: var(--brand); margin-right: .45rem; vertical-align: middle;
}
.notif-body { min-width: 0; }
.notif-body p { margin: .15rem 0; }
.notif form { margin: 0; }

.profile-facts {
  grid-template-columns: minmax(5rem, 7rem) 1fr;
  padding-bottom: 1rem; margin-bottom: .25rem; border-bottom: 1px solid var(--line);
}

.archive-abstract { margin: 0 0 .75rem; font-size: .9rem; }
.archive-entry .chips { margin-bottom: 0; }

.verdicts { margin-bottom: 1rem; }
.evaluation, .reschedule {
  border-top: 1px solid var(--line); padding-top: 1rem; margin-top: 1rem;
}
.reschedule summary {
  cursor: pointer; font-size: .86rem; font-weight: 600; color: var(--muted);
  list-style: none;
}
.reschedule summary::-webkit-details-marker { display: none; }
.reschedule summary::before { content: "\1F5D3\FE0F"; margin-right: .4rem; }
.reschedule summary:hover { color: var(--brand); }
.reschedule .decision-form { border-top: 0; padding-top: .75rem; margin-top: 0; }

/* --------------------------------------------------- proposal & assignment */
.btn-primary-link {
  display: inline-block; padding: .65rem 1.1rem;
  background: var(--brand); color: var(--brand-ink);
  border-radius: 8px; font-weight: 600; font-size: .92rem; text-decoration: none;
}
.btn-primary-link:hover { background: var(--brand-deep); }

#proposal .field { margin-bottom: 1rem; }
.proposal-actions { justify-content: flex-end; }

.check { display: flex; gap: .6rem; align-items: start; font-size: .92rem; margin-bottom: 1rem; }
.check input { width: auto; margin: .2rem 0 0; flex: none; }

select[multiple] { padding: .35rem; }
.assignment .decision-form { border-top: 1px solid var(--line); padding-top: 1rem; margin-top: 1rem; }

/* ---------------------------------------- next-schedule tile + row actions */
.stat-wide { grid-column: span 2; }
.stat-when { display: flex; align-items: baseline; gap: .5rem; font-size: 1.35rem; }
.stat-when span { font-size: 1.05rem; color: var(--muted); font-weight: 600; }
.stat-none { font-size: 1.1rem; color: var(--muted); }
.stat-foot a { color: var(--brand); }

.row-actions { display: flex; gap: .4rem; justify-content: flex-end; }
.row-actions form { margin: 0; }

@media (max-width: 700px) {
  .stat-wide { grid-column: span 1; }
}

/* -------------------------------------------------------------- a11y basics */
/* keyboard-only escape hatch past the sidebar; visible only when focused */
.skip-link {
  position: absolute; left: .5rem; top: -3rem; z-index: 10;
  padding: .6rem 1rem; border-radius: 0 0 8px 8px;
  background: var(--brand); color: #fff; text-decoration: none; font-weight: 600;
  transition: top .12s ease;
}
.skip-link:focus { top: 0; }

/* every interactive element gets the same ring, links included */
a:focus-visible,
summary:focus-visible,
[tabindex]:focus-visible {
  outline: 3px solid var(--brand);
  outline-offset: 2px;
  border-radius: 4px;
}
main:focus { outline: none; }

/* honour a reduced-motion preference: the only animations here are decorative */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ------------------------------------------------------------------- pager */
.pager {
  display: flex; flex-wrap: wrap; gap: .75rem 1rem;
  align-items: center; justify-content: space-between;
  margin: -.25rem 0 1.25rem;
}
.pager-count { margin: 0; font-size: .85rem; color: var(--muted); }
.pager-links { list-style: none; display: flex; gap: .3rem; margin: 0; padding: 0; }
.pager-links a,
.pager-links span {
  display: block; min-width: 2.1rem; padding: .4rem .6rem;
  border: 1px solid var(--line); border-radius: 8px;
  font-size: .85rem; font-weight: 500; text-align: center;
  color: var(--ink); text-decoration: none; background: var(--surface);
}
.pager-links a:hover { background: var(--bg); color: var(--brand); }
.pager-links .is-current { background: var(--brand); border-color: var(--brand); color: #fff; font-weight: 600; }
.pager-links .is-disabled { color: var(--muted); opacity: .55; }
.pager-links .is-gap { border-color: transparent; background: none; color: var(--muted); }
