/*
 * Off-taker portal.
 *
 * Built for a clerk working a queue of twenty to fifty sheets on a cheap Android handset or an
 * old desktop browser, often on a poor connection. No web fonts, no script, no images. Tap
 * targets are large because the job is repetitive and the phone is being held one-handed.
 */

:root {
  --ink: #13251c;
  --ink-soft: #607066;
  --line: #dce5df;
  --page: #f3f7f4;
  --card: #ffffff;
  --accent: #16734a;
  --accent-dark: #0d5635;
  --accent-soft: #e8f5ed;
  --accent-ink: #ffffff;
  --warn-bg: #fdf3e3;
  --warn-ink: #7a4f13;
  --danger: #a12f2f;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

.masthead {
  background:
    radial-gradient(circle at 85% -80%, rgb(255 255 255 / 18%), transparent 45%),
    linear-gradient(125deg, var(--accent-dark), var(--accent));
  color: var(--accent-ink);
  padding: 1rem 1.25rem;
  box-shadow: 0 8px 24px rgb(15 68 43 / 10%);
}

.masthead-inner,
.wrap {
  max-width: 60rem;
  margin: 0 auto;
}

.masthead h1 {
  font-size: 1.1rem;
  font-weight: 750;
  margin: 0;
  letter-spacing: 0.01em;
}

.masthead p {
  margin: 0.15rem 0 0;
  font-size: 0.85rem;
  opacity: 0.85;
}

nav.portal-nav {
  background: var(--card);
  border-bottom: 1px solid var(--line);
  padding: 0 1rem;
  box-shadow: 0 1px 8px rgb(19 37 28 / 5%);
}

nav.portal-nav ul {
  max-width: 60rem;
  margin: 0 auto;
  padding: 0;
  list-style: none;
  display: flex;
  gap: 0.25rem;
  flex-wrap: wrap;
}

nav.portal-nav a,
nav.portal-nav button {
  display: block;
  padding: 0.85rem 0.9rem;
  color: var(--ink-soft);
  text-decoration: none;
  font-size: 0.95rem;
  background: none;
  border: 0;
  border-bottom: 3px solid transparent;
  cursor: pointer;
  font: inherit;
  transition: color 160ms ease, background 160ms ease, border-color 160ms ease;
}

nav.portal-nav a:hover,
nav.portal-nav button:hover {
  color: var(--accent);
  background: var(--accent-soft);
}

nav.portal-nav a[aria-current="page"] {
  color: var(--accent);
  border-bottom-color: var(--accent);
  font-weight: 600;
}

.wrap {
  padding: 2rem 1.25rem 4rem;
}

h2 {
  font-size: clamp(1.45rem, 3vw, 2rem);
  line-height: 1.2;
  letter-spacing: -0.025em;
  margin: 0 0 0.25rem;
}

.lede {
  color: var(--ink-soft);
  margin: 0 0 1.25rem;
}

/* Queue. A table on a wide screen, stacked cards on a narrow one. */
.queue {
  width: 100%;
  border-collapse: collapse;
  background: var(--card);
  border: 0;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 10px 32px rgb(25 56 40 / 8%);
}

.queue th {
  text-align: left;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--ink-soft);
  padding: 0.8rem 0.9rem;
  background: #f8faf8;
  border-bottom: 1px solid var(--line);
}

.queue td {
  padding: 0.9rem;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}

.queue tbody tr {
  transition: background 150ms ease;
}

.queue tbody tr:hover {
  background: #f9fcfa;
}

.queue tr:last-child td {
  border-bottom: 0;
}

.numeric {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.muted {
  color: var(--ink-soft);
  font-size: 0.85rem;
}

.action {
  display: inline-block;
  padding: 0.6rem 1rem;
  background: var(--accent);
  color: var(--accent-ink);
  text-decoration: none;
  border: 0;
  border-radius: 9px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  min-height: 44px;
  line-height: 1.75;
  box-shadow: 0 6px 16px rgb(22 115 74 / 16%);
  transition: transform 150ms ease, box-shadow 150ms ease, background 150ms ease;
}

.action:hover {
  background: var(--accent-dark);
  box-shadow: 0 8px 22px rgb(22 115 74 / 24%);
  transform: translateY(-1px);
}

.action.secondary {
  background: var(--card);
  color: var(--accent);
  border: 1px solid var(--accent);
}

.tag {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  background: var(--line);
  color: var(--ink-soft);
}

.tag.verified {
  background: #e2f0e8;
  color: #1f6b46;
}

.tag.rejected {
  background: #f6e4e4;
  color: var(--danger);
}

.tag.disputed {
  background: var(--warn-bg);
  color: var(--warn-ink);
}

.panel {
  background: var(--card);
  border: 1px solid rgb(220 229 223 / 80%);
  border-radius: 14px;
  padding: 1.5rem;
  max-width: 34rem;
  box-shadow: 0 14px 40px rgb(25 56 40 / 8%);
}

dl.detail {
  display: grid;
  grid-template-columns: 11rem 1fr;
  gap: 0.5rem 1rem;
  margin: 0;
}

dl.detail dt {
  color: var(--ink-soft);
  font-size: 0.9rem;
}

dl.detail dd {
  margin: 0;
  font-variant-numeric: tabular-nums;
}

label {
  display: block;
  margin: 0 0 0.3rem;
  font-size: 0.9rem;
  font-weight: 600;
}

input[type="text"],
input[type="password"],
select {
  width: 100%;
  padding: 0.7rem 0.6rem;
  font: inherit;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
  min-height: 44px;
  transition: border-color 150ms ease, box-shadow 150ms ease;
}

input[type="text"]:focus,
input[type="password"]:focus,
select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgb(22 115 74 / 10%);
}

h3 {
  font-size: 1.05rem;
  margin: 0 0 0.25rem;
}

.notice.done {
  border-left-color: var(--accent);
  background: #e8f2ec;
  color: #175536;
}

input:focus-visible,
select:focus-visible,
a:focus-visible,
button:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}

.field {
  margin-bottom: 1rem;
}

.notice {
  padding: 0.75rem 0.9rem;
  border-left: 4px solid var(--warn-ink);
  background: var(--warn-bg);
  color: var(--warn-ink);
  margin-bottom: 1.25rem;
  border-radius: 0 10px 10px 0;
}

.notice.error {
  border-left-color: var(--danger);
  background: #f9ecec;
  color: var(--danger);
}

.empty {
  background: var(--card);
  border: 1px dashed var(--line);
  padding: 3.5rem 1.5rem;
  text-align: center;
  color: var(--ink-soft);
  border-radius: 14px;
}

.login-page {
  background:
    radial-gradient(circle at 10% 5%, rgb(22 115 74 / 11%), transparent 26rem),
    radial-gradient(circle at 95% 95%, rgb(211 156 65 / 10%), transparent 24rem),
    var(--page);
}

.login-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(18rem, 0.9fr) minmax(24rem, 1.1fr);
}

.login-brand {
  padding: clamp(2rem, 6vw, 5rem);
  color: white;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background:
    linear-gradient(155deg, rgb(8 57 34 / 15%), rgb(8 57 34 / 68%)),
    radial-gradient(circle at 75% 15%, #2a9a68, transparent 38%),
    #0e5b39;
}

.brand-mark {
  width: 3rem;
  height: 3rem;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: rgb(255 255 255 / 14%);
  border: 1px solid rgb(255 255 255 / 20%);
  font-size: 1.4rem;
  font-weight: 800;
}

.login-brand h1 {
  max-width: 30rem;
  margin: 2rem 0 1rem;
  font-size: clamp(2.2rem, 5vw, 4.4rem);
  line-height: 0.98;
  letter-spacing: -0.055em;
}

.login-brand p {
  max-width: 28rem;
  margin: 0;
  color: rgb(255 255 255 / 78%);
  font-size: 1.05rem;
}

.brand-footnote {
  font-size: 0.8rem;
  color: rgb(255 255 255 / 62%);
}

.login-main {
  display: grid;
  place-items: center;
  padding: 2rem;
}

.login-card {
  width: min(100%, 28rem);
}

.login-card .panel {
  max-width: none;
}

.login-eyebrow {
  margin: 0 0 0.5rem;
  color: var(--accent);
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.login-meta {
  margin-top: 1.2rem;
  color: var(--ink-soft);
  font-size: 0.82rem;
}

.login-meta a {
  color: var(--accent);
}

.pager {
  display: flex;
  gap: 0.5rem;
  margin-top: 1rem;
}

@media (max-width: 640px) {
  .login-shell {
    display: block;
  }

  .login-brand {
    min-height: 15rem;
    padding: 2rem 1.5rem;
  }

  .login-brand h1 {
    font-size: 2.5rem;
  }

  .brand-footnote {
    display: none;
  }

  .login-main {
    padding: 2rem 1rem 3rem;
  }

  .queue thead {
    display: none;
  }

  .queue,
  .queue tbody,
  .queue tr,
  .queue td {
    display: block;
    width: 100%;
  }

  .queue tr {
    border-bottom: 1px solid var(--line);
    padding: 0.5rem 0;
  }

  .queue td {
    border: 0;
    padding: 0.2rem 0.75rem;
  }

  .queue td::before {
    content: attr(data-label) ": ";
    color: var(--ink-soft);
    font-size: 0.8rem;
  }

  .queue td.row-action::before {
    content: "";
  }

  .queue td.row-action {
    padding-top: 0.6rem;
  }

  .action {
    display: block;
    text-align: center;
  }

  dl.detail {
    grid-template-columns: 1fr;
    gap: 0.1rem 0;
  }

  dl.detail dd {
    margin-bottom: 0.6rem;
  }
}

/* Application workspace */
.app-body {
  background: #f5f7f6;
  color: #14261d;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 17rem minmax(0, 1fr);
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 1.5rem 1rem 1rem;
  display: flex;
  flex-direction: column;
  background: #10271d;
  color: white;
  z-index: 10;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  padding: 0 0.65rem 1.7rem;
  color: white;
  text-decoration: none;
}

.sidebar-logo {
  width: 2.5rem;
  height: 2.5rem;
  display: grid;
  place-items: center;
  border-radius: 11px;
  background: linear-gradient(145deg, #37b477, #168653);
  box-shadow: 0 8px 24px rgb(28 157 96 / 26%);
  font-size: 1.05rem;
  font-weight: 850;
}

.sidebar-brand strong,
.sidebar-brand small,
.profile-copy strong,
.profile-copy small {
  display: block;
}

.sidebar-brand strong {
  font-size: 1.06rem;
  letter-spacing: -0.01em;
}

.sidebar-brand small,
.profile-copy small {
  color: rgb(255 255 255 / 52%);
  font-size: 0.72rem;
}

.side-nav {
  flex: 1;
}

.nav-label {
  margin: 1.2rem 0.7rem 0.45rem;
  color: rgb(255 255 255 / 35%);
  font-size: 0.65rem;
  font-weight: 750;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.side-nav a {
  min-height: 46px;
  margin: 0.2rem 0;
  padding: 0.68rem 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  border-radius: 9px;
  color: rgb(255 255 255 / 68%);
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 580;
  transition: 150ms ease;
}

.side-nav a:hover {
  color: white;
  background: rgb(255 255 255 / 6%);
}

.side-nav a.active {
  color: white;
  background: linear-gradient(110deg, rgb(39 163 100 / 25%), rgb(39 163 100 / 10%));
  box-shadow: inset 3px 0 #39b978;
}

.nav-icon {
  width: 1.45rem;
  height: 1.45rem;
  display: grid;
  place-items: center;
  color: #5bc68d;
  font-size: 1rem;
}

.nav-count {
  min-width: 1.4rem;
  margin-left: auto;
  padding: 0.08rem 0.4rem;
  border-radius: 999px;
  background: rgb(255 255 255 / 10%);
  text-align: center;
  font-size: 0.7rem;
}

.sidebar-profile {
  padding: 0.9rem 0.7rem 0.15rem;
  display: flex;
  align-items: center;
  gap: 0.7rem;
  border-top: 1px solid rgb(255 255 255 / 9%);
}

.avatar {
  width: 2.25rem;
  height: 2.25rem;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 50%;
  color: #0e4028;
  background: #bfe9d1;
  font-size: 0.78rem;
  font-weight: 800;
}

.profile-copy {
  min-width: 0;
  flex: 1;
}

.profile-copy strong {
  overflow: hidden;
  font-size: 0.8rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.icon-button {
  width: 2rem;
  height: 2rem;
  border: 0;
  border-radius: 7px;
  color: rgb(255 255 255 / 55%);
  background: transparent;
  cursor: pointer;
}

.icon-button:hover {
  color: white;
  background: rgb(255 255 255 / 8%);
}

.app-main {
  min-width: 0;
}

.app-header {
  min-height: 9.5rem;
  padding: 2.1rem clamp(1.5rem, 4vw, 3.5rem);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 2rem;
  color: white;
  background:
    radial-gradient(circle at 82% -60%, rgb(75 191 132 / 22%), transparent 38%),
    linear-gradient(120deg, #153c2b, #1c5339);
}

.breadcrumb {
  margin: 0 0 0.65rem;
  color: rgb(255 255 255 / 50%);
  font-size: 0.72rem;
}

.app-header h1 {
  margin: 0;
  font-size: clamp(1.7rem, 3vw, 2.2rem);
  line-height: 1.1;
  letter-spacing: -0.035em;
}

.app-header > div > p:last-child {
  margin: 0.5rem 0 0;
  color: rgb(255 255 255 / 67%);
  font-size: 0.9rem;
}

.header-status {
  margin-top: 0.55rem;
  padding: 0.5rem 0.75rem;
  border: 1px solid rgb(255 255 255 / 12%);
  border-radius: 999px;
  color: rgb(255 255 255 / 72%);
  background: rgb(255 255 255 / 6%);
  font-size: 0.72rem;
  white-space: nowrap;
}

.header-status span {
  width: 0.45rem;
  height: 0.45rem;
  margin-right: 0.35rem;
  display: inline-block;
  border-radius: 50%;
  background: #50d88e;
  box-shadow: 0 0 0 4px rgb(80 216 142 / 12%);
}

.content-area {
  width: min(100%, 86rem);
  margin: -1.5rem auto 0;
  padding: 0 clamp(1rem, 3vw, 2.5rem) 4rem;
  position: relative;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

.metric-card {
  min-height: 9rem;
  padding: 1.2rem 1.3rem;
  border: 1px solid #e5ebe7;
  border-radius: 13px;
  background: white;
  box-shadow: 0 8px 30px rgb(22 54 38 / 7%);
}

.metric-card.metric-primary {
  color: white;
  border-color: transparent;
  background: linear-gradient(135deg, #198556, #21a268);
  box-shadow: 0 12px 30px rgb(25 133 86 / 22%);
}

.metric-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #66756c;
  font-size: 0.76rem;
  font-weight: 650;
}

.metric-primary .metric-top,
.metric-primary p {
  color: rgb(255 255 255 / 70%);
}

.metric-icon {
  width: 1.8rem;
  height: 1.8rem;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: rgb(255 255 255 / 15%);
}

.metric-icon.success {
  color: #168653;
  background: #e7f6ed;
}

.metric-icon.calm {
  color: #9a6a1c;
  background: #fff6df;
}

.metric-card > strong {
  margin-top: 0.55rem;
  display: block;
  font-size: 2rem;
  line-height: 1;
  letter-spacing: -0.04em;
}

.metric-card > strong.metric-word {
  font-size: 1.65rem;
}

.metric-card p {
  margin: 0.55rem 0 0;
  color: #829087;
  font-size: 0.75rem;
}

.workspace-card {
  margin-top: 1.25rem;
  border: 1px solid #e4ebe6;
  border-radius: 14px;
  overflow: hidden;
  background: white;
  box-shadow: 0 12px 40px rgb(22 54 38 / 6%);
}

.section-heading {
  min-height: 5.8rem;
  padding: 1.25rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  border-bottom: 1px solid #edf1ee;
}

.section-heading h2 {
  margin: 0;
  font-size: 1rem;
  letter-spacing: -0.01em;
}

.section-heading p {
  margin: 0.3rem 0 0;
  color: #79877f;
  font-size: 0.76rem;
}

.record-count {
  padding: 0.35rem 0.65rem;
  border-radius: 999px;
  color: #16734a;
  background: #eaf6ef;
  font-size: 0.7rem;
  font-weight: 700;
}

.premium-empty {
  min-height: 19rem;
  padding: 3rem 1.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.empty-illustration {
  width: 4.2rem;
  height: 4.2rem;
  display: grid;
  place-items: center;
  border-radius: 18px;
  color: #168653;
  background: #e9f7ef;
  box-shadow: 0 0 0 10px #f5fbf7;
  font-size: 1.3rem;
}

.premium-empty h3 {
  margin: 1.35rem 0 0.45rem;
  font-size: 1.05rem;
}

.premium-empty p {
  max-width: 28rem;
  margin: 0;
  color: #7b8981;
  font-size: 0.8rem;
}

.text-link,
.table-action {
  color: #16734a;
  font-weight: 700;
  text-decoration: none;
}

.text-link {
  margin-top: 1.25rem;
  font-size: 0.78rem;
}

.table-wrap {
  overflow-x: auto;
}

.modern-table {
  border-radius: 0;
  box-shadow: none;
}

.modern-table td small {
  display: block;
  color: #859188;
  font-size: 0.68rem;
}

.forced-shell { display: block; }
.narrow-content { max-width: 58rem; }
.security-card { overflow: visible; }
.security-form, .decision-form { padding: 1.5rem; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.form-footer { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding-top: 0.25rem; }
.form-footer p { margin: 0; color: #7b8981; font-size: 0.76rem; }
.security-badge { padding: 0.35rem 0.65rem; border-radius: 999px; color: #16734a; background: #eaf6ef; font-size: 0.7rem; font-weight: 700; }
.header-back { margin-top: 0.4rem; padding: 0.55rem 0.8rem; border: 1px solid rgb(255 255 255 / 14%); border-radius: 8px; color: rgb(255 255 255 / 75%); text-decoration: none; font-size: 0.75rem; }
.review-layout { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(20rem, 0.95fr); align-items: start; gap: 1.25rem; }
.delivery-summary, .decision-column .workspace-card { margin-top: 0; }
.detail-grid { padding: 1.5rem; display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.5rem 2rem; }
.detail-grid > div { padding-bottom: 0.8rem; border-bottom: 1px solid #edf1ee; }
.detail-grid span, .attachment-row small { display: block; color: #829087; font-size: 0.7rem; }
.detail-grid strong { display: block; margin-top: 0.35rem; font-size: 0.95rem; }
.detail-grid .value-detail strong { color: #16734a; font-size: 1.15rem; }
.attachment-row { margin: 0 1.5rem 1.5rem; padding: 0.9rem; display: flex; align-items: center; gap: 0.8rem; border: 1px solid #e7ece9; border-radius: 10px; background: #fafcfb; }
.attachment-icon { width: 2rem; height: 2rem; display: grid; place-items: center; border-radius: 7px; color: #16734a; background: #eaf6ef; }
.attachment-row div { flex: 1; }
.attachment-row strong { display: block; font-size: 0.78rem; }
.attachment-state { color: #6f7e75; font-size: 0.7rem; }
.decision-column { display: grid; gap: 1rem; }
.decision-icon { width: 2rem; height: 2rem; display: grid; place-items: center; border-radius: 8px; }
.decision-icon.approve { color: #16734a; background: #e7f6ed; }
.optional { display: inline; margin-left: 0.3rem; font-weight: 400; }
.full-action { width: 100%; text-align: center; }
.reject-card { padding: 1rem 1.25rem; }
.reject-card summary { color: #9a3434; font-size: 0.8rem; font-weight: 700; cursor: pointer; }
.reject-card form { padding-top: 1.1rem; }
.danger-action { width: 100%; min-height: 44px; border: 1px solid #c85a5a; border-radius: 9px; color: #a12f2f; background: #fff; font-weight: 700; cursor: pointer; }

.table-action {
  font-size: 0.76rem;
  white-space: nowrap;
}

@media (max-width: 900px) {
  .app-shell {
    grid-template-columns: 4.7rem minmax(0, 1fr);
  }

  .sidebar {
    padding-inline: 0.65rem;
  }

  .sidebar-brand {
    justify-content: center;
    padding-inline: 0;
  }

  .sidebar-brand > span:last-child,
  .nav-label,
  .side-nav a:not(.active) .nav-count,
  .side-nav a { font-size: 0; }

  .side-nav a {
    justify-content: center;
    padding-inline: 0;
  }

  .nav-icon { font-size: 1rem; }
  .nav-count { display: none; }
  .profile-copy, .sidebar-profile form { display: none; }
  .sidebar-profile { justify-content: center; padding-inline: 0; }
}

@media (max-width: 1100px) {
  .review-layout { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
  .app-shell { display: block; }
  .sidebar {
    position: static;
    width: 100%;
    height: auto;
    padding: 0.75rem 1rem;
    flex-direction: row;
    align-items: center;
  }
  .sidebar-brand { padding: 0; }
  .sidebar-brand > span:last-child { display: block; }
  .side-nav { display: flex; margin-left: auto; }
  .side-nav .nav-label, .side-nav a:nth-of-type(3) { display: none; }
  .side-nav a { min-height: 40px; margin: 0; padding: 0.4rem 0.7rem; }
  .side-nav a .nav-icon { font-size: 1rem; }
  .sidebar-profile { display: none; }
  .app-header { min-height: 8.5rem; padding: 1.5rem 1.2rem 2.5rem; }
  .header-status { display: none; }
  .content-area { margin-top: -1rem; }
  .metric-grid { grid-template-columns: 1fr; }
  .metric-card { min-height: 7.5rem; }
  .form-grid, .detail-grid { grid-template-columns: 1fr; }
}
