:root {
  color-scheme: light;
  --ink: #102326;
  --muted: #5e6f73;
  --line: #d8e3e1;
  --paper: #f7faf8;
  --panel: #ffffff;
  --brand: #0b5b5f;
  --brand-strong: #083f42;
  --accent: #d94532;
  --success: #16784f;
  --warning: #ad6b00;
  --blue: #235f9c;
  --shadow: 0 14px 32px rgba(12, 42, 42, 0.12);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--paper);
}

body {
  min-height: 100%;
  margin: 0;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at 16% 0%, rgba(11, 91, 95, 0.08), transparent 28rem),
    linear-gradient(180deg, #f4faf7 0%, #eef5f2 100%);
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  width: min(100%, 1180px);
  min-height: 100vh;
  margin: 0 auto;
  padding: max(18px, env(safe-area-inset-top)) 14px max(22px, env(safe-area-inset-bottom));
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 4px 2px 16px;
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.brand-mark {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 8px;
  background: var(--brand);
  color: #fff;
  font-weight: 900;
  letter-spacing: 0;
  box-shadow: var(--shadow);
}

.brand-copy {
  min-width: 0;
}

.brand-name {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 850;
}

.brand-meta {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 0.84rem;
}

.switcher {
  display: flex;
  gap: 6px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
}

.switcher button,
.secondary-button,
.ghost-button {
  min-height: 44px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--brand-strong);
  font-weight: 800;
}

.switcher button {
  min-width: 72px;
  padding: 0 12px;
}

.switcher .active {
  background: var(--brand);
  color: #fff;
}

.login-view,
.success-view,
.loading-view {
  display: grid;
  min-height: 100vh;
  align-content: center;
  gap: 18px;
  padding: max(18px, env(safe-area-inset-top)) 0 max(120px, env(safe-area-inset-bottom));
}

.login-panel,
.success-panel,
.loading-panel,
.sheet-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.login-panel,
.success-panel,
.loading-panel {
  padding: 22px;
}

.loading-panel {
  display: grid;
  gap: 20px;
  border-width: 2px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(255, 255, 255, 0.94)),
    radial-gradient(circle at 10% 0%, rgba(11, 91, 95, 0.12), transparent 18rem);
}

.loading-head {
  display: flex;
  align-items: center;
  gap: 12px;
}

.loading-mark {
  display: grid;
  width: 58px;
  height: 58px;
  place-items: center;
  border-radius: 8px;
  background: var(--brand);
  color: #fff;
  font-size: 1.25rem;
  font-weight: 950;
  box-shadow: var(--shadow);
}

.loading-head strong,
.loading-head span {
  display: block;
}

.loading-head strong {
  font-size: 1.05rem;
  font-weight: 950;
}

.loading-head span {
  margin-top: 2px;
  color: var(--muted);
  font-weight: 760;
}

.loading-copy {
  display: grid;
  gap: 8px;
}

.loading-panel h1 {
  margin: 0;
  font-size: clamp(1.9rem, 9vw, 2.8rem);
  line-height: 1.04;
}

.loading-panel p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 1rem;
  font-weight: 760;
  line-height: 1.4;
}

.loading-bar {
  height: 9px;
  overflow: hidden;
  border-radius: 99px;
  background: #e5efed;
}

.loading-bar span {
  display: block;
  width: 42%;
  height: 100%;
  border-radius: inherit;
  background: var(--brand);
  animation: loading-slide 1.15s ease-in-out infinite;
}

.loading-skeleton {
  display: grid;
  gap: 10px;
}

.loading-skeleton span {
  display: block;
  height: 58px;
  border-radius: 8px;
  background:
    linear-gradient(90deg, #eef6f3 0%, #f8fbfa 48%, #eef6f3 100%);
  background-size: 220% 100%;
  animation: loading-shimmer 1.35s ease-in-out infinite;
}

.loading-skeleton span:nth-child(2) {
  height: 48px;
  width: 78%;
}

.error-panel {
  border-color: #efc6bd;
}

@keyframes loading-slide {
  0% {
    transform: translateX(-110%);
  }
  100% {
    transform: translateX(250%);
  }
}

@keyframes loading-shimmer {
  0% {
    background-position: 100% 0;
  }
  100% {
    background-position: -100% 0;
  }
}

.login-title,
.success-title {
  margin: 0;
  font-size: clamp(1.75rem, 7vw, 2.5rem);
  line-height: 1.04;
  letter-spacing: 0;
}

.login-copy,
.success-copy {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.45;
}

.login-grid {
  display: grid;
  gap: 12px;
  margin-top: 18px;
}

.input-label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 750;
}

.text-input {
  min-height: 54px;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 14px;
  color: var(--ink);
  background: #fff;
  font-size: 1rem;
}

.role-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.role-card {
  min-height: 92px;
  padding: 12px;
  border: 2px solid var(--line);
  border-radius: 8px;
  background: #fff;
  text-align: left;
}

.role-card.active {
  border-color: var(--brand);
  background: #edf8f6;
}

.role-card strong {
  display: block;
  font-size: 1.05rem;
}

.role-card span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.84rem;
}

.primary-button,
.danger-button,
.choice-button {
  min-height: 58px;
  width: 100%;
  border: 0;
  border-radius: 8px;
  padding: 0 18px;
  color: #fff;
  font-size: 1.02rem;
  font-weight: 900;
  letter-spacing: 0;
  box-shadow: var(--shadow);
}

.primary-button {
  background: var(--brand);
}

.danger-button {
  background: var(--accent);
}

.primary-button:disabled,
.danger-button:disabled {
  cursor: not-allowed;
  opacity: 0.52;
}

.ghost-button,
.secondary-button {
  padding: 0 14px;
}

.secondary-button {
  border: 1px solid var(--line);
  background: #fff;
}

.secondary-button.compact {
  width: auto;
  min-width: 92px;
}

.staff-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 14px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.78);
}

.today-hero {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
  padding: 20px;
  border: 2px solid #cbdad7;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 10px 24px rgba(12, 42, 42, 0.08);
}

.today-copy {
  min-width: 0;
}

.staff-kicker {
  margin: 0 0 4px;
  color: var(--success);
  font-size: 0.78rem;
  font-weight: 950;
  text-transform: uppercase;
}

.today-hero h1 {
  margin: 0;
  font-size: clamp(1.7rem, 8vw, 2.45rem);
  line-height: 1.02;
}

.today-hero p {
  margin: 5px 0 0;
  color: var(--muted);
  font-weight: 760;
}

.assignment-banner,
.assignment-note {
  border-radius: 7px;
  background: #e4f5ec;
  color: #126142;
  font-weight: 900;
  line-height: 1.35;
}

.today-hero .assignment-banner {
  margin-top: 10px;
  padding: 9px 10px;
}

.quick-change {
  margin-bottom: 14px;
  border: 2px solid #d7c4be;
  border-radius: 8px;
  background: #281513;
  overflow: hidden;
  box-shadow: 0 14px 32px rgba(68, 28, 20, 0.14);
}

.quick-change.open {
  border-color: #d94532;
  box-shadow: 0 18px 38px rgba(68, 28, 20, 0.2);
}

.quick-change-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  min-height: 76px;
  border: 0;
  padding: 0 18px;
  background: #2d1714;
  color: #fff;
  font-size: 1.08rem;
  font-weight: 900;
  text-align: left;
}

.quick-change-toggle strong {
  color: #ffd2c9;
  font-size: 1.08rem;
}

.quick-change-form {
  display: grid;
  gap: 12px;
  padding: 14px;
  background: #fff;
}

.assignment-note {
  margin: 0;
  padding: 10px 12px;
}

.contract-chip {
  margin: 0;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #f7faf8;
  color: var(--muted);
  font-weight: 850;
  line-height: 1.35;
}

.contract-chip strong {
  color: var(--ink);
}

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

.segmented button {
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--brand-strong);
  font-size: 0.9rem;
  font-weight: 850;
}

.segmented button.active {
  border-color: var(--accent);
  background: #fff1ee;
  color: #8b1e12;
}

.staff-name {
  margin: 0;
  font-weight: 900;
}

.staff-subtitle {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 0.86rem;
}

.tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 14px;
}

.tab {
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--brand-strong);
  font-weight: 850;
}

.tab.active {
  border-color: var(--brand);
  background: var(--brand);
  color: #fff;
}

.dashboard-layout {
  display: grid;
  gap: 14px;
}

.dashboard-side,
.dashboard-main {
  min-width: 0;
}

.read-only-banner {
  margin-bottom: 12px;
  padding: 12px 14px;
  border: 1px solid #d9c79f;
  border-radius: 8px;
  background: #fff8e7;
  color: #5f3d00;
  font-weight: 850;
  line-height: 1.35;
}

.job-list {
  display: grid;
  gap: 14px;
}

.more-jobs {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.78);
}

.more-jobs summary {
  min-height: 54px;
  padding: 15px 16px;
  color: var(--brand-strong);
  font-weight: 900;
  cursor: pointer;
}

.more-job-list {
  display: grid;
  gap: 12px;
  padding: 0 12px 12px;
}

.job-card,
.journey-card,
.detail-panel,
.exception-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 10px 24px rgba(12, 42, 42, 0.08);
}

.job-card {
  display: grid;
  gap: 10px;
  padding: 16px;
  text-align: left;
}

.job-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.job-actions .small-action:only-child {
  grid-column: 1 / -1;
}

.job-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.badge-row {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  border-radius: 7px;
  padding: 0 9px;
  background: #eaf1ef;
  color: var(--brand-strong);
  font-size: 0.78rem;
  font-weight: 850;
}

.badge.warning {
  background: #fff2d9;
  color: #805100;
}

.badge.complete {
  background: #e4f5ec;
  color: var(--success);
}

.badge.danger {
  background: #fdeae6;
  color: #a22a18;
}

.job-title {
  margin: 0;
  font-size: 1.35rem;
  line-height: 1.12;
}

.job-route {
  margin: 0;
  color: var(--muted);
  line-height: 1.35;
}

.cover-note {
  margin: 0;
  border-left: 4px solid var(--accent);
  padding: 10px 12px;
  border-radius: 7px;
  background: #fff7f5;
  color: #823426;
  font-weight: 850;
  line-height: 1.35;
}

.job-card.submitted {
  cursor: default;
  opacity: 0.72;
  box-shadow: none;
}

.journey-card {
  overflow: hidden;
}

.journey-header {
  padding: 16px;
  background: #f8fbfa;
  border-bottom: 1px solid var(--line);
}

.journey-title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.journey-title {
  margin: 0;
  font-size: clamp(1.45rem, 6vw, 2.1rem);
  line-height: 1.05;
}

.time-pill {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  min-width: 76px;
  min-height: 52px;
  border-radius: 8px;
  background: var(--ink);
  color: #fff;
  font-size: 1.08rem;
  font-weight: 950;
}

.notice {
  margin-top: 12px;
  padding: 12px;
  border-left: 5px solid var(--warning);
  border-radius: 6px;
  background: #fff8eb;
  color: #5f3d00;
  line-height: 1.35;
  font-weight: 760;
}

.journey-body {
  display: grid;
  gap: 12px;
  padding: 16px;
}

.driver-summary {
  padding: 14px;
  border: 1px solid #cfe0dc;
  border-radius: 8px;
  background: linear-gradient(180deg, #ffffff 0%, #f2faf7 100%);
}

.driver-summary h2 {
  margin: 3px 0 4px;
  font-size: 1.32rem;
  line-height: 1.1;
}

.driver-summary p {
  margin: 0;
  color: var(--muted);
  font-size: 0.94rem;
  line-height: 1.35;
}

.stepper-panel {
  display: grid;
  gap: 10px;
}

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

.route-step {
  display: grid;
  grid-template-columns: 38px 1fr;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.route-step.active {
  border-color: var(--brand);
  box-shadow: inset 4px 0 0 var(--brand);
}

.route-step.done {
  border-color: #cce4d8;
  background: #f1fbf6;
}

.route-step.issue {
  border-color: #efc6bd;
  background: #fff8f6;
}

.route-step.locked {
  opacity: 0.58;
}

.step-number {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 50%;
  background: #eaf1ef;
  color: var(--brand-strong);
  font-weight: 950;
}

.route-step.active .step-number {
  background: var(--brand);
  color: #fff;
}

.route-step.done .step-number {
  background: var(--success);
  color: #fff;
}

.route-step.issue .step-number {
  background: var(--accent);
  color: #fff;
}

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

.step-main h3 {
  margin: 2px 0 4px;
  font-size: 1.08rem;
  line-height: 1.12;
}

.step-main p,
.step-main small {
  display: block;
  margin: 0;
  color: var(--muted);
  line-height: 1.35;
}

.step-main small {
  margin-top: 6px;
  font-size: 0.82rem;
}

.problem-note {
  color: #8b1e12;
  font-weight: 900;
}

.step-actions {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.problem-choice-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 10px;
}

.problem-choice-grid button {
  min-height: 46px;
  border: 1px solid #efc6bd;
  border-radius: 8px;
  background: #fff1ee;
  color: #8b1e12;
  font-weight: 850;
}

.issue-summary {
  padding: 14px;
  border: 1px solid #efc6bd;
  border-radius: 8px;
  background: #fff8f6;
}

.issue-summary h2,
.issue-summary p {
  margin: 0;
}

.issue-summary h2 {
  color: #8b1e12;
  font-size: 1rem;
}

.issue-summary p {
  margin-top: 5px;
  color: var(--muted);
  font-weight: 760;
  line-height: 1.35;
}

.eyebrow {
  color: var(--success);
  font-size: 0.76rem;
  font-weight: 950;
  text-transform: uppercase;
}

.focus-row {
  display: grid;
  gap: 10px;
  grid-template-columns: 1fr;
}

.info-line {
  display: grid;
  gap: 3px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdfc;
}

.info-label {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 850;
  text-transform: uppercase;
}

.info-value {
  color: var(--ink);
  font-weight: 850;
  line-height: 1.3;
}

.section-title {
  margin: 0 0 10px;
  color: var(--ink);
  font-size: 1rem;
  font-weight: 950;
}

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

.client-check {
  display: grid;
  grid-template-columns: 34px 1fr;
  align-items: center;
  min-height: 62px;
  padding: 10px 12px;
  border: 2px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.client-check input {
  width: 26px;
  height: 26px;
  accent-color: var(--brand);
}

.client-check strong {
  display: block;
}

.client-check span {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.86rem;
}

.attended-address {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 58px;
  gap: 12px;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  font-weight: 850;
}

.change-check {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.change-check h2 {
  margin: 3px 0 4px;
  font-size: 1.1rem;
  line-height: 1.16;
}

.change-check p {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.35;
}

.toggle {
  position: relative;
  width: 58px;
  height: 34px;
  border-radius: 99px;
  background: var(--brand);
}

.toggle::after {
  content: "";
  position: absolute;
  top: 4px;
  right: 4px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #fff;
}

.toggle.off {
  background: #8b9799;
}

.toggle.off::after {
  right: 28px;
}

.exception-panel,
.detail-panel {
  padding: 14px;
}

.reason-grid {
  display: grid;
  gap: 9px;
}

.reason-button {
  min-height: 50px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font-weight: 830;
  text-align: left;
  padding: 0 12px;
}

.reason-button.active {
  border-color: var(--accent);
  background: #fff1ee;
  color: #8b1e12;
}

.staff-picker {
  display: grid;
  gap: 10px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.staff-picker h3 {
  margin: 0;
  font-size: 0.96rem;
}

.staff-choice-list {
  display: grid;
  gap: 8px;
}

.staff-choice {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 58px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  background: #fff;
  color: var(--ink);
  text-align: left;
}

.staff-choice strong,
.staff-choice span {
  display: block;
}

.staff-choice span {
  color: var(--muted);
  font-size: 0.85rem;
}

.staff-choice.active {
  border-color: var(--brand);
  background: #edf8f6;
  box-shadow: inset 4px 0 0 var(--brand);
}

.actions {
  position: sticky;
  bottom: max(8px, env(safe-area-inset-bottom));
  display: grid;
  gap: 8px;
  margin-top: 4px;
  padding: 10px 0 0;
  background: linear-gradient(180deg, rgba(247, 250, 248, 0), var(--paper) 24%);
}

.report-button {
  width: 100%;
  background: #fff;
}

.details-grid {
  display: grid;
  gap: 10px;
}

.nav-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  margin-top: 8px;
  border-radius: 8px;
  background: var(--blue);
  color: #fff;
  font-weight: 850;
  text-decoration: none;
}

.small-action {
  min-height: 48px;
  padding: 0 12px;
  font-size: 0.96rem;
}

.pa-actions {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.choice-button.worked {
  background: var(--success);
}

.choice-button.not-worked {
  background: var(--accent);
}

.empty {
  padding: 22px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.72);
  text-align: center;
}

.sheet-panel {
  margin-top: 16px;
  padding: 12px;
}

.sheet-panel summary {
  min-height: 42px;
  color: var(--brand-strong);
  font-weight: 900;
  cursor: pointer;
}

.sheet-panel pre {
  overflow: auto;
  margin: 0;
  padding: 12px;
  border-radius: 8px;
  background: #102326;
  color: #e8f7f3;
  font-size: 0.78rem;
  line-height: 1.45;
}

@media (min-width: 680px) {
  .app-shell {
    padding-inline: 24px;
  }

  .login-view,
  .success-view {
    justify-items: center;
  }

  .login-panel,
  .success-panel {
    width: min(100%, 520px);
  }

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

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

  .focus-row,
  .details-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .pa-actions {
    grid-template-columns: 1fr 1fr;
  }
}

@media (min-width: 920px) {
  .app-shell {
    padding-top: 34px;
  }

  .topbar {
    padding-bottom: 22px;
  }

  .brand-mark {
    width: 52px;
    height: 52px;
  }

  .brand-name {
    font-size: 1.25rem;
  }

  .dashboard-layout {
    grid-template-columns: minmax(280px, 340px) minmax(0, 1fr);
    align-items: start;
    gap: 22px;
  }

  .dashboard-side {
    position: sticky;
    top: 22px;
  }

  .today-hero {
    display: grid;
    gap: 18px;
    padding: 22px;
  }

  .today-hero h1 {
    font-size: 2.15rem;
  }

  .secondary-button.compact {
    width: 100%;
  }

  .quick-change-toggle {
    min-height: 86px;
    font-size: 1.15rem;
  }

  .tabs {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .job-list {
    grid-template-columns: 1fr;
  }

  .job-card {
    grid-template-columns: 1fr auto;
    align-items: center;
    gap: 18px;
    padding: 18px 20px;
  }

  .job-card .job-actions {
    width: 240px;
  }

  .job-title {
    font-size: 1.45rem;
  }

  .journey-card {
    width: min(100%, 840px);
    margin-inline: auto;
  }
}

/* --- Payment statements -------------------------------------------------- */

.today-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.statements-view {
  display: grid;
  gap: 16px;
}

.statements-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding: 20px;
  border: 2px solid #cbdad7;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 10px 24px rgba(12, 42, 42, 0.08);
}

.statements-head h1 {
  margin: 0;
  font-size: clamp(1.7rem, 8vw, 2.45rem);
  line-height: 1.02;
}

.statements-sub {
  margin: 8px 0 0;
  color: var(--muted);
  font-weight: 720;
  line-height: 1.4;
}

.statement-list {
  display: grid;
  gap: 14px;
}

.statement-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 10px 24px rgba(12, 42, 42, 0.08);
  padding: 16px;
}

.statement-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.statement-card h2 {
  margin: 10px 0 0;
  font-size: 1.2rem;
  line-height: 1.15;
}

.statement-meta {
  margin: 5px 0 0;
  color: var(--muted);
  font-weight: 720;
  line-height: 1.4;
}

.statement-amount {
  flex: none;
  color: var(--ink);
  font-size: 1.5rem;
  font-weight: 950;
  white-space: nowrap;
}

.statement-card-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-top: 14px;
}

.statement-note {
  margin: 6px 0 0;
  color: var(--muted);
  font-weight: 720;
  line-height: 1.4;
}

.statement-error {
  margin: 0;
  padding: 12px 14px;
  border: 1px solid #f0c4b8;
  border-radius: 8px;
  background: #fdeae6;
  color: #a22a18;
  font-weight: 820;
}

.statement-status-banner {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 12px;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 10px 24px rgba(12, 42, 42, 0.08);
}

.statement-status-banner.queried {
  border-color: #f0c4b8;
  background: #fdeae6;
}

.statement-status-banner.paid {
  border-color: #bfe3d2;
  background: #e9f7f0;
}

.statement-status-label {
  font-weight: 950;
  text-transform: uppercase;
  font-size: 0.82rem;
  letter-spacing: 0.04em;
}

.statement-status-amount {
  font-size: 1.5rem;
  font-weight: 950;
}

.statement-status-sub {
  color: var(--muted);
  font-weight: 760;
}

.statement-lines {
  display: grid;
  gap: 10px;
}

.statement-lines-head {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 950;
  text-transform: uppercase;
}

.statement-line {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  padding: 14px 16px;
}

.statement-line strong {
  display: block;
  margin-top: 8px;
  line-height: 1.15;
}

.statement-line-amount {
  flex: none;
  font-weight: 950;
  white-space: nowrap;
}

.statement-review {
  border: 2px solid #cbdad7;
  border-radius: 8px;
  background: #ffffff;
  padding: 18px;
  box-shadow: 0 10px 24px rgba(12, 42, 42, 0.08);
}

.statement-review h2 {
  margin: 0;
  font-size: 1.25rem;
}

.statement-review p {
  margin: 8px 0 0;
  color: var(--muted);
  font-weight: 720;
  line-height: 1.4;
}

.statement-review-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

.query-box {
  margin-top: 14px;
  min-height: 92px;
  resize: vertical;
}

@media (max-width: 640px) {
  .statements-head {
    flex-direction: column;
  }

  .statement-card-head {
    flex-direction: column;
  }

  .statement-line {
    flex-direction: column;
  }
}
