:root {
  --ink: #17313b;
  --muted: #687b82;
  --navy: #073b4c;
  --teal: #008a8a;
  --teal-dark: #006d70;
  --teal-soft: #e2f4f2;
  --peach: #fff2e3;
  --pink: #fff0f7;
  --surface: #ffffff;
  --canvas: #f4f7f6;
  --line: #dbe4e2;
  --shadow: 0 16px 45px rgba(7, 59, 76, 0.08);
  --radius: 18px;
}

* {
  box-sizing: border-box;
}

html {
  color-scheme: light;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background:
    radial-gradient(circle at 8% -5%, rgba(0, 138, 138, 0.09), transparent 27rem),
    var(--canvas);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 15px;
  line-height: 1.5;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select {
  font: inherit;
}

.shell {
  width: min(1180px, calc(100% - 40px));
  margin-inline: auto;
}

.site-header {
  position: sticky;
  z-index: 20;
  top: 0;
  border-bottom: 1px solid rgba(219, 228, 226, 0.85);
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(18px);
}

.header-shell {
  width: min(1360px, calc(100% - 40px));
  margin-inline: auto;
}

.header-inner {
  position: relative;
  min-height: 74px;
  display: flex;
  align-items: center;
  gap: 16px;
}

.header-actions {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 11px;
  margin-left: auto;
  padding-left: 14px;
  border-left: 1px solid #e3eae8;
}

.header-action {
  min-height: 44px;
  flex: 0 0 auto;
  padding: 8px 14px 8px 9px;
  border-radius: 13px;
  white-space: nowrap;
}

.header-action-icon {
  width: 27px;
  height: 27px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.16);
  font-size: 18px;
  font-weight: 500;
  line-height: 1;
}

.header-session {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px;
  border: 1px solid #dfe8e6;
  border-radius: 14px;
  background: #f7faf9;
}

.header-session form {
  margin: 0;
}

.session-user {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 9px;
  padding-right: 4px;
  color: #53666d;
  font-weight: 750;
}

.session-user b {
  width: 35px;
  height: 35px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border-radius: 11px;
  color: #fff;
  background: linear-gradient(145deg, var(--navy), #0a5b68);
  font-size: 10px;
  letter-spacing: 0.04em;
}

.session-user-copy,
.session-user-copy strong,
.session-user-copy small {
  display: block;
}

.session-user-copy {
  min-width: 0;
  max-width: 150px;
}

.session-user-copy strong {
  overflow: hidden;
  color: #314b54;
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.session-user-copy small {
  margin-top: 1px;
  color: #809097;
  font-size: 9px;
  font-weight: 700;
}

.session-logout {
  min-height: 35px;
  padding: 6px 10px;
  border: 1px solid transparent;
  border-radius: 10px;
  cursor: pointer;
  color: #61747a;
  background: transparent;
  font-size: 10px;
  font-weight: 800;
  white-space: nowrap;
}

.session-logout:hover {
  color: var(--teal-dark);
  border-color: #c5ddda;
  background: #fff;
}

.session-logout-short {
  display: none;
}

.brand {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 11px;
  margin-right: 2px;
}

.brand-mark {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 13px;
  color: #fff;
  background: linear-gradient(145deg, var(--teal), var(--navy));
  box-shadow: 0 8px 20px rgba(0, 138, 138, 0.2);
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0.05em;
}

.brand strong,
.brand small {
  display: block;
}

.brand strong {
  font-size: 16px;
}

.brand small {
  color: var(--muted);
  font-size: 11px;
}

.main-nav {
  flex: 0 1 auto;
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 4px;
  border: 1px solid #e7eeec;
  border-radius: 14px;
  background: #f4f7f6;
}

.main-nav a {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  padding: 8px 10px;
  border-radius: 10px;
  color: #53666d;
  font-size: 12px;
  font-weight: 720;
  line-height: 1.2;
  white-space: nowrap;
  transition: color 150ms ease, background 150ms ease, box-shadow 150ms ease;
}

.main-nav a:hover {
  color: var(--teal-dark);
  background: var(--teal-soft);
}

.main-nav a.active {
  color: var(--teal-dark);
  background: #fff;
  box-shadow: 0 3px 10px rgba(7, 59, 76, 0.08);
}

.nav-toggle {
  display: none;
}

.button {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 16px;
  border: 1px solid transparent;
  border-radius: 11px;
  cursor: pointer;
  font-weight: 750;
  transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.button:hover {
  transform: translateY(-1px);
}

.button-primary {
  color: #fff;
  background: linear-gradient(135deg, var(--teal), var(--teal-dark));
  box-shadow: 0 10px 20px rgba(0, 109, 112, 0.16);
}

.button-primary:hover {
  box-shadow: 0 13px 25px rgba(0, 109, 112, 0.24);
}

.button-secondary {
  color: var(--teal-dark);
  border-color: #b9d9d6;
  background: #fff;
}

.button-ghost {
  color: var(--muted);
  border-color: transparent;
  background: transparent;
}

.button-danger {
  color: #fff;
  background: #a7444c;
}

.button-large {
  min-height: 48px;
  padding-inline: 22px;
}

.page {
  min-height: calc(100vh - 150px);
  padding-block: 44px 65px;
}

.page-heading {
  margin-bottom: 30px;
}

.page-heading h1 {
  max-width: 800px;
  margin: 6px 0 8px;
  color: var(--navy);
  font-size: clamp(32px, 4vw, 48px);
  line-height: 1.08;
  letter-spacing: -0.035em;
}

.compact-heading h1 {
  font-size: clamp(30px, 3.2vw, 40px);
}

.page-heading p {
  max-width: 720px;
  margin: 0;
  color: var(--muted);
  font-size: 16px;
}

.heading-actions {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 30px;
}

.eyebrow {
  display: inline-block;
  color: var(--teal-dark);
  font-size: 11px;
  font-weight: 850;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.back-link {
  display: block;
  width: max-content;
  margin-bottom: 17px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.back-link:hover,
.text-link:hover {
  color: var(--teal-dark);
}

.panel {
  border: 1px solid rgba(219, 228, 226, 0.9);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 24px 26px 19px;
}

.panel-heading h2 {
  margin: 2px 0 0;
  color: var(--navy);
  font-size: 21px;
  letter-spacing: -0.02em;
}

.text-link {
  color: var(--teal-dark);
  font-size: 13px;
  font-weight: 800;
}

.kpi-grid {
  display: grid;
  grid-template-columns: 1.35fr repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

.kpi-card {
  min-height: 150px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: 0 10px 30px rgba(7, 59, 76, 0.05);
}

.kpi-card strong,
.kpi-card small,
.kpi-card span {
  display: block;
}

.kpi-card strong {
  margin-top: 18px;
  color: var(--navy);
  font-size: clamp(24px, 2.6vw, 34px);
  line-height: 1;
  letter-spacing: -0.04em;
}

.kpi-card small {
  margin-top: 8px;
  color: var(--muted);
}

.kpi-icon {
  width: 33px;
  height: 33px;
  display: grid !important;
  place-items: center;
  border-radius: 10px;
  color: var(--teal-dark);
  background: var(--teal-soft);
  font-weight: 850;
}

.kpi-featured {
  color: #fff;
  border-color: transparent;
  background:
    radial-gradient(circle at 90% 12%, rgba(255, 255, 255, 0.16), transparent 10rem),
    linear-gradient(135deg, var(--navy), var(--teal-dark));
}

.kpi-featured strong,
.kpi-featured small {
  color: #fff;
}

.kpi-featured small,
.kpi-featured .kpi-label {
  opacity: 0.78;
}

.kpi-label {
  font-weight: 750;
}

.content-grid {
  display: grid;
  gap: 24px;
}

.dashboard-grid {
  grid-template-columns: minmax(0, 1.7fr) minmax(280px, 0.8fr);
  margin-bottom: 24px;
}

.detail-grid {
  grid-template-columns: minmax(0, 1.4fr) minmax(320px, 0.65fr);
}

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

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  padding: 14px 18px;
  border-top: 1px solid #edf1f0;
  text-align: left;
  vertical-align: middle;
}

th {
  color: #718188;
  background: #fbfcfc;
  font-size: 11px;
  font-weight: 850;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  white-space: nowrap;
}

tbody tr:hover {
  background: #fbfdfc;
}

td small,
.table-title {
  display: block;
}

td small {
  margin-top: 3px;
  color: var(--muted);
}

.table-title {
  font-weight: 750;
}

.table-title:hover {
  color: var(--teal-dark);
}

.align-right {
  text-align: right;
}

td[data-expense-total],
td[data-mileage-total],
td[data-trip-total] {
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.strong {
  color: var(--navy);
  font-weight: 800;
}

.date-chip {
  display: inline-block;
  padding: 5px 8px;
  border-radius: 8px;
  color: #53666d;
  background: #eef3f2;
  font-size: 12px;
  font-weight: 750;
  white-space: nowrap;
}

.source-label {
  width: max-content;
  padding: 2px 7px;
  border-radius: 8px;
  background: var(--peach);
  color: #96631c;
  font-size: 10px;
}

.table-route-stack {
  display: grid;
  gap: 4px;
  min-width: 220px;
}

.table-route-stack small {
  margin: 0;
}

.table-route-stack small b {
  display: inline-block;
  min-width: 45px;
  color: var(--teal-dark);
}

.row-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  white-space: nowrap;
}

.row-actions form {
  margin: 0;
}

.row-action {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 6px 9px;
  border: 1px solid transparent;
  border-radius: 8px;
  cursor: pointer;
  font: inherit;
  font-size: 11px;
  font-weight: 800;
}

.row-action-edit {
  color: var(--teal-dark);
  border-color: #b7d9d3;
  background: #f1f9f7;
}

.row-action-delete {
  color: #9b3f47;
  border-color: #efc5c8;
  background: #fff2f3;
}

.row-action:hover {
  filter: brightness(0.97);
}

.route-list {
  padding: 0 24px;
}

.route-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 2px 16px;
  padding: 15px 0;
  border-top: 1px solid #edf1f0;
}

.route-item:first-child {
  border-top: 0;
}

.route-item div strong,
.route-item div span {
  display: block;
}

.route-item div span,
.route-item small {
  color: var(--muted);
}

.route-item small {
  font-size: 11px;
}

.route-item b {
  grid-row: span 2;
  align-self: center;
  color: var(--teal-dark);
}

.panel-note {
  margin: 16px 24px 24px;
  padding: 13px;
  border-radius: 11px;
  color: #586c72;
  background: var(--teal-soft);
  font-size: 12px;
}

.year-panel {
  padding-bottom: 22px;
}

.year-total {
  color: var(--teal-dark);
  font-size: 22px;
  font-weight: 850;
}

.month-bars {
  height: 190px;
  display: flex;
  align-items: flex-end;
  gap: 12px;
  padding: 10px 28px 0;
}

.month-bar {
  min-width: 58px;
  height: 100%;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-end;
  text-align: center;
}

.bar-value {
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 10px;
  opacity: 0;
  transition: opacity 160ms ease;
}

.month-bar:hover .bar-value {
  opacity: 1;
}

.bar-track {
  height: 120px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  overflow: hidden;
}

.bar-track i {
  width: min(38px, 75%);
  display: block;
  min-height: 12px;
  max-height: 100%;
  border-radius: 9px 9px 3px 3px;
  background: linear-gradient(180deg, #34b8ae, var(--teal-dark));
  transition: transform 160ms ease;
}

.month-bar:hover .bar-track i {
  transform: scaleX(1.1);
}

.bar-label {
  margin-top: 8px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.toolbar {
  min-height: 68px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 18px;
  border-bottom: 1px solid #edf1f0;
  background: #fbfcfc;
}

.toolbar label:not(.search-field) {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.toolbar select {
  min-width: 300px;
}

.toolbar-count {
  margin-left: auto;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.flash {
  margin-bottom: 18px;
  padding: 13px 16px;
  border: 1px solid;
  border-radius: 12px;
  font-weight: 650;
}

.flash-success {
  color: #156149;
  border-color: #b7dfd1;
  background: #eaf8f2;
}

.flash-danger {
  color: #963f46;
  border-color: #f0c1c4;
  background: #fff0f1;
}

input,
select {
  width: 100%;
  min-height: 44px;
  padding: 9px 12px;
  border: 1px solid #cbd7d5;
  border-radius: 10px;
  outline: none;
  color: var(--ink);
  background: #fff;
  transition: border 150ms ease, box-shadow 150ms ease;
}

input:focus,
select:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(0, 138, 138, 0.12);
}

.form-section {
  display: grid;
  grid-template-columns: 78px 1fr;
  margin-bottom: 18px;
}

.section-number {
  padding-top: 26px;
  border-right: 1px solid #edf1f0;
  color: var(--teal);
  background: linear-gradient(180deg, var(--teal-soft), #fff);
  text-align: center;
  font-size: 17px;
  font-weight: 900;
}

.section-content {
  padding-bottom: 28px;
}

.section-content .panel-heading {
  padding-inline: 28px;
}

.form-grid {
  display: grid;
  gap: 18px;
  padding: 0 28px;
}

.two-columns {
  grid-template-columns: 0.7fr 1.3fr;
}

.field > span {
  display: block;
  margin-bottom: 7px;
  color: #53666d;
  font-size: 12px;
  font-weight: 800;
}

.field > span b {
  color: var(--teal);
}

.route-form-grid {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) 35px minmax(180px, 1fr) minmax(160px, 0.7fr);
  align-items: end;
  gap: 13px;
  padding: 0 28px;
}

.form-options.route-options {
  margin-top: 0;
  margin-bottom: 18px;
  padding-top: 0;
  border-top: 0;
}

.trip-legs {
  display: grid;
  gap: 14px;
  padding: 0 28px;
}

.route-leg-card {
  padding: 17px;
  border: 1px solid #dce5e3;
  border-radius: 15px;
  background: #fbfcfc;
}

.route-leg-card.return-leg {
  border-color: #cfe3df;
  background: #f5faf9;
}

.route-leg-card.is-synced {
  border-color: #b7dfd1;
  background: #f0faf6;
}

.route-leg-card.is-synced input[readonly] {
  color: #47645f;
  background: #e8f3ef;
}

.route-leg-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.leg-badge {
  display: inline-flex;
  align-items: center;
  min-height: 29px;
  padding: 5px 11px;
  border-radius: 999px;
  color: #fff;
  background: var(--teal);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.return-badge {
  background: var(--navy);
}

.route-leg-card .route-form-grid {
  padding: 0;
}

.route-arrow {
  width: 35px;
  height: 44px;
  display: grid;
  place-items: center;
  color: var(--teal);
  font-size: 24px;
}

.input-suffix {
  position: relative;
}

.input-suffix input {
  padding-right: 58px;
}

.input-suffix em {
  position: absolute;
  top: 50%;
  right: 13px;
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  font-weight: 800;
  transform: translateY(-50%);
}

.form-options {
  display: flex;
  align-items: center;
  gap: 20px;
  margin: 22px 28px 0;
  padding-top: 20px;
  border-top: 1px solid #edf1f0;
}

.check-card {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  cursor: pointer;
}

.check-card input {
  width: 20px;
  min-height: 20px;
  margin-top: 2px;
  accent-color: var(--teal);
}

.check-card strong,
.check-card small {
  display: block;
}

.check-card small {
  color: var(--muted);
}

.compact-field {
  width: 220px;
  margin-left: auto;
}

.distance-status {
  padding: 7px 10px;
  border-radius: 999px;
  color: var(--muted);
  background: #eef3f2;
  font-size: 11px;
  font-weight: 800;
}

.distance-status.found {
  color: #11634c;
  background: #e4f6ef;
}

.distance-status.loading {
  color: #786017;
  background: #fff8d9;
}

.distance-status.not-found {
  color: #8b5323;
  background: var(--peach);
}

.form-help {
  margin: -8px 28px 18px;
  color: var(--muted);
  font-size: 13px;
}

.existing-expenses {
  display: grid;
  gap: 5px;
  margin: 0 28px 18px;
  padding: 14px 16px;
  border: 1px solid #cfe3df;
  border-radius: 12px;
  color: #47645f;
  background: #f2faf7;
  font-size: 12px;
}

.existing-expenses strong {
  color: var(--navy);
}

.existing-expense-list {
  display: grid;
  gap: 8px;
  margin-top: 8px;
}

.existing-expense-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid #cfe3df;
  border-radius: 10px;
  background: #fff;
}

.existing-expense-summary {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.existing-expense-summary span {
  padding: 4px 8px;
  border-radius: 8px;
  color: #47645f;
  background: #e4f3ee;
  font-size: 11px;
  white-space: nowrap;
}

.existing-expense-summary strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.existing-expense-summary b {
  margin-left: auto;
  color: var(--teal-dark);
  white-space: nowrap;
}

.existing-expense-actions,
.expense-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
}

.expense-rows {
  padding: 0 28px;
}

.expense-row {
  display: grid;
  grid-template-columns: 0.65fr 1.15fr 0.55fr 1fr 38px;
  align-items: end;
  gap: 12px;
  margin-top: 12px;
  padding: 15px;
  border: 1px solid #dce5e3;
  border-radius: 13px;
  background: #fbfcfc;
}

.file-field input {
  padding: 7px;
  font-size: 12px;
}

.icon-button {
  width: 38px;
  height: 42px;
  border: 0;
  border-radius: 9px;
  cursor: pointer;
  color: #9c4f54;
  background: #fff0f1;
  font-size: 22px;
}

.empty-expenses {
  margin: 0 28px;
  padding: 20px;
  border: 1px dashed #cbd7d5;
  border-radius: 13px;
  color: var(--muted);
  text-align: center;
}

.empty-expenses span {
  margin-right: 8px;
  color: var(--teal);
}

.form-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding-top: 8px;
}

.journey-panel {
  margin-bottom: 24px;
}

.journey-list {
  display: grid;
  gap: 10px;
  padding: 0 24px 24px;
}

.journey-leg {
  display: grid;
  grid-template-columns: 76px 1fr auto;
  align-items: center;
  gap: 16px;
  padding: 15px;
  border: 1px solid #dce5e3;
  border-radius: 13px;
  background: #fbfcfc;
}

.journey-leg div strong,
.journey-leg div span {
  display: inline;
}

.journey-leg div span {
  color: var(--muted);
}

.journey-leg > b {
  color: var(--navy);
  font-size: 17px;
}

.detail-summary {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 24px;
}

.detail-summary article {
  padding: 21px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 10px 25px rgba(7, 59, 76, 0.04);
}

.detail-summary span,
.detail-summary strong,
.detail-summary small {
  display: block;
}

.detail-summary span,
.detail-summary small {
  color: var(--muted);
}

.detail-summary span {
  font-size: 12px;
  font-weight: 750;
}

.detail-summary strong {
  margin: 8px 0 3px;
  color: var(--navy);
  font-size: 25px;
}

.detail-summary small {
  font-size: 11px;
}

.detail-summary .summary-total {
  border-color: transparent;
  background: linear-gradient(145deg, var(--navy), var(--teal-dark));
}

.detail-summary .summary-total span,
.detail-summary .summary-total strong,
.detail-summary .summary-total small {
  color: #fff;
}

.summary-total span,
.summary-total small {
  opacity: 0.75;
}

.status-badge,
.attachment-badge {
  display: inline-flex;
  padding: 6px 10px;
  border-radius: 999px;
  color: var(--teal-dark);
  background: var(--teal-soft);
  font-size: 11px;
  font-weight: 800;
}

.attachment-badge:hover {
  color: #fff;
  background: var(--teal-dark);
}

.expense-list {
  padding: 0 25px 25px;
}

.expense-item {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) auto auto auto;
  align-items: center;
  gap: 14px;
  padding: 15px 0;
  border-top: 1px solid #edf1f0;
}

.expense-item:first-child {
  border-top: 0;
}

.expense-icon {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: var(--peach);
}

.expense-item strong,
.expense-item small {
  display: block;
}

.expense-item small {
  color: var(--muted);
}

.expense-item > b {
  color: var(--navy);
  white-space: nowrap;
}

.expense-actions form {
  margin: 0;
}

.expense-action {
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 5px 8px;
  border: 1px solid #cbdad7;
  border-radius: 8px;
  cursor: pointer;
  color: #526b70;
  background: #fff;
  font: inherit;
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
}

.expense-action:hover {
  color: var(--teal-dark);
  border-color: #9fc9c3;
  background: #f0f8f6;
}

.expense-action-open {
  color: var(--teal-dark);
  border-color: #b7d9d3;
  background: #f1f9f7;
}

.expense-action-delete {
  color: #9b3f47;
  border-color: #efc5c8;
  background: #fff2f3;
}

.stack-form {
  display: grid;
  gap: 14px;
  padding: 0 25px 25px;
}

.expense-edit-layout {
  grid-template-columns: minmax(0, 1.35fr) minmax(290px, 0.65fr);
  align-items: start;
}

.expense-edit-form {
  max-width: 680px;
}

.receipt-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px;
  border: 1px solid #cfe3df;
  border-radius: 12px;
  background: #f2faf7;
}

.receipt-card strong,
.receipt-card small {
  display: block;
}

.receipt-card small {
  margin-top: 3px;
  color: var(--muted);
}

.receipt-remove {
  padding: 12px 14px;
  border: 1px solid #f0d1d4;
  border-radius: 12px;
  background: #fff8f8;
}

.expense-context {
  padding-bottom: 24px;
}

.expense-context dl {
  margin: 0 25px 20px;
}

.expense-context dl div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 11px 0;
  border-top: 1px solid #edf1f0;
}

.expense-context dl div:first-child {
  border-top: 0;
}

.expense-context dt {
  color: var(--muted);
}

.expense-context dd {
  margin: 0;
  color: var(--navy);
  font-weight: 800;
  text-align: right;
}

.expense-context > .button {
  margin: 0 25px;
}

.danger-zone {
  margin: 24px 25px 0;
  padding: 16px;
  border: 1px solid #efc5c8;
  border-radius: 13px;
  background: #fff5f5;
}

.danger-zone strong {
  color: #8f3840;
}

.danger-zone p {
  margin: 5px 0 14px;
  color: #7d6568;
  font-size: 12px;
}

.danger-zone form {
  margin: 0;
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.tag-list span {
  padding: 3px 7px;
  border-radius: 7px;
  color: #53666d;
  background: #eef3f2;
  font-size: 11px;
}

.search-field {
  position: relative;
  width: min(480px, 100%);
}

.search-field span {
  position: absolute;
  z-index: 1;
  top: 50%;
  left: 13px;
  color: var(--muted);
  transform: translateY(-50%);
}

.search-field input {
  padding-left: 36px;
}

.export-heading {
  border-bottom: 1px solid #edf1f0;
}

.export-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  padding: 22px;
}

.month-card {
  position: relative;
  min-height: 125px;
  display: block;
  cursor: pointer;
}

.month-card input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.month-card-content {
  height: 100%;
  display: flex;
  flex-direction: column;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  transition: border 150ms ease, background 150ms ease, transform 150ms ease;
}

.month-card:hover .month-card-content {
  transform: translateY(-2px);
}

.month-card input:checked + .month-check + .month-card-content {
  border-color: var(--teal);
  background: var(--teal-soft);
}

.month-check {
  position: absolute;
  z-index: 1;
  top: 13px;
  right: 13px;
  width: 23px;
  height: 23px;
  display: grid;
  place-items: center;
  border: 1px solid #cbd7d5;
  border-radius: 7px;
  color: transparent;
  background: #fff;
  font-size: 13px;
  font-weight: 900;
}

.month-card input:checked + .month-check {
  color: #fff;
  border-color: var(--teal);
  background: var(--teal);
}

.month-card-content strong,
.month-card-content small,
.month-card-content b {
  display: block;
}

.month-card-content strong {
  padding-right: 30px;
  color: var(--navy);
  font-size: 16px;
}

.month-card-content small {
  margin-top: 5px;
  color: var(--muted);
}

.month-card-content b {
  margin-top: auto;
  color: var(--teal-dark);
  font-size: 20px;
}

.export-submit {
  position: sticky;
  bottom: 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-top: 18px;
  padding: 17px 20px;
  border: 1px solid rgba(219, 228, 226, 0.92);
  border-radius: 15px;
  background: rgba(255, 255, 255, 0.95);
  box-shadow: 0 18px 40px rgba(7, 59, 76, 0.15);
  backdrop-filter: blur(12px);
}

.export-submit strong,
.export-submit small {
  display: block;
}

.export-submit small {
  margin-top: 3px;
  color: var(--muted);
}

.settings-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(280px, 0.65fr);
  align-items: start;
  gap: 24px;
}

.settings-icon {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  color: var(--teal-dark);
  background: var(--teal-soft);
  font-weight: 900;
}

.settings-content {
  padding: 3px 26px 26px;
}

.rate-setting {
  display: block;
  max-width: 360px;
}

.rate-setting small {
  display: block;
  margin-top: 7px;
  color: var(--muted);
}

.settings-note {
  margin-top: 24px;
  padding: 16px 18px;
  border: 1px solid #cce4e1;
  border-radius: 13px;
  background: var(--teal-soft);
}

.settings-note strong {
  color: var(--teal-dark);
}

.settings-note p {
  margin: 5px 0 0;
  color: #526b70;
  font-size: 13px;
}

.settings-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 25px;
  padding-top: 20px;
  border-top: 1px solid #edf1f0;
}

.settings-preview {
  padding: 27px;
  color: #fff;
  border-color: transparent;
  background:
    radial-gradient(circle at 95% 5%, rgba(255, 255, 255, 0.16), transparent 11rem),
    linear-gradient(145deg, var(--navy), var(--teal-dark));
}

.settings-preview .eyebrow,
.settings-preview p {
  color: rgba(255, 255, 255, 0.72);
}

.settings-preview h2 {
  margin: 7px 0 25px;
  font-size: 20px;
}

.settings-preview strong {
  display: block;
  font-size: 38px;
  letter-spacing: -0.04em;
}

.settings-preview p {
  margin: 5px 0 0;
}

.admin-access-badge {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 7px 11px;
  border-radius: 999px;
  color: #765516;
  background: #fff4cf;
  font-size: 11px;
  font-weight: 850;
}

.account-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(330px, 0.75fr);
  align-items: start;
  gap: 24px;
}

.account-form-panel {
  padding-bottom: 28px;
}

.account-form {
  display: grid;
  gap: 20px;
  padding: 0 26px;
}

.account-email-field {
  max-width: 560px;
}

.account-password-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.account-errors {
  margin: 0 26px 22px;
  padding: 14px 16px;
  border: 1px solid #f0c1c4;
  border-radius: 12px;
  color: #963f46;
  background: #fff0f1;
  font-size: 13px;
}

.account-errors ul {
  margin: 7px 0 0;
  padding-left: 20px;
}

.role-choice {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 0;
  padding: 0;
  border: 0;
}

.role-choice legend {
  grid-column: 1 / -1;
  margin-bottom: 8px;
  color: #53666d;
  font-size: 12px;
  font-weight: 800;
}

.role-card {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 11px;
  padding: 16px;
  border: 1px solid #d3dfdd;
  border-radius: 13px;
  cursor: pointer;
  background: #fbfcfc;
}

.role-card:has(input:checked) {
  border-color: var(--teal);
  background: #eef9f7;
  box-shadow: 0 0 0 3px rgba(0, 138, 138, 0.08);
}

.role-card-admin:has(input:checked) {
  border-color: #d3a846;
  background: #fff8e5;
  box-shadow: 0 0 0 3px rgba(211, 168, 70, 0.09);
}

.role-card input {
  width: 18px;
  min-height: 18px;
  margin: 2px 0 0;
  accent-color: var(--teal);
}

.role-card span,
.role-card strong,
.role-card small {
  display: block;
}

.role-card span {
  min-width: 0;
}

.role-card strong {
  color: var(--navy);
}

.role-card small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
}

.account-form-actions {
  display: flex;
  justify-content: flex-end;
  padding-top: 4px;
}

.account-list-panel {
  padding-bottom: 22px;
}

.account-list {
  display: grid;
  padding: 0 22px;
}

.account-list-item {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  align-items: center;
  gap: 11px;
  padding: 14px 0;
  border-top: 1px solid #edf1f0;
}

.account-list-item:first-child {
  border-top: 0;
}

.account-avatar {
  width: 38px;
  height: 38px;
  grid-row: span 2;
  display: grid;
  place-items: center;
  border-radius: 11px;
  color: #fff;
  background: linear-gradient(145deg, var(--teal), var(--navy));
  font-size: 11px;
  font-weight: 900;
}

.account-list-item strong,
.account-list-item small {
  display: block;
  min-width: 0;
}

.account-list-item strong {
  overflow: hidden;
  color: var(--navy);
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-list-item small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 10px;
}

.account-role {
  grid-column: 2;
  width: max-content;
  padding: 4px 7px;
  border-radius: 7px;
  color: #526b70;
  background: #eef3f2;
  font-size: 10px;
  font-weight: 800;
}

.account-role.is-admin {
  color: #765516;
  background: #fff2c8;
}

.account-list-note {
  margin: 14px 22px 0;
  padding: 12px;
  border-radius: 10px;
  color: #526b70;
  background: var(--teal-soft);
  font-size: 11px;
}

.error-text {
  color: #a53c45;
}

.empty-state {
  padding: 25px;
  color: var(--muted);
  text-align: center;
}

.hidden {
  display: none !important;
}

.site-footer {
  padding: 22px 0;
  border-top: 1px solid var(--line);
  color: var(--muted);
  background: #fff;
  font-size: 12px;
}

.auth-page {
  min-width: 320px;
  background:
    radial-gradient(circle at 12% 8%, rgba(52, 184, 174, 0.24), transparent 24rem),
    radial-gradient(circle at 90% 88%, rgba(255, 180, 112, 0.14), transparent 24rem),
    #edf4f2;
}

.auth-main {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 32px 20px;
}

.auth-shell {
  width: min(960px, 100%);
  min-height: 540px;
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(380px, 0.92fr);
  border: 1px solid rgba(255, 255, 255, 0.85);
  border-radius: 28px;
  background: #fff;
  box-shadow: 0 28px 80px rgba(7, 59, 76, 0.16);
  overflow: hidden;
}

.auth-intro {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 48px;
  color: #fff;
  background:
    radial-gradient(circle at 95% 6%, rgba(255, 255, 255, 0.16), transparent 13rem),
    linear-gradient(150deg, var(--navy), var(--teal-dark));
}

.auth-intro::after {
  position: absolute;
  right: -70px;
  bottom: -100px;
  width: 280px;
  height: 280px;
  border: 45px solid rgba(255, 255, 255, 0.05);
  border-radius: 50%;
  content: "";
}

.auth-brand {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  width: max-content;
}

.auth-brand-mark {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.12);
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0.05em;
}

.auth-brand strong,
.auth-brand small {
  display: block;
}

.auth-brand strong {
  font-size: 17px;
}

.auth-brand small {
  color: rgba(255, 255, 255, 0.68);
  font-size: 11px;
}

.auth-intro-copy {
  position: relative;
  z-index: 1;
  margin-block: auto;
  padding-block: 60px;
}

.auth-eyebrow {
  display: inline-block;
  margin-bottom: 15px;
  color: #96ded8;
  font-size: 11px;
  font-weight: 850;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.auth-intro h1 {
  max-width: 440px;
  margin: 0;
  font-size: clamp(35px, 4.2vw, 52px);
  line-height: 1.04;
  letter-spacing: -0.045em;
}

.auth-intro-copy p {
  max-width: 430px;
  margin: 20px 0 0;
  color: rgba(255, 255, 255, 0.75);
  font-size: 15px;
}

.auth-benefits {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 9px;
  color: rgba(255, 255, 255, 0.78);
  font-size: 12px;
  font-weight: 700;
}

.auth-benefits span::before {
  margin-right: 9px;
  color: #76d2c9;
  content: "✓";
}

.auth-card {
  align-self: center;
  padding: 52px 48px;
}

.auth-card-heading h2 {
  margin: 7px 0 8px;
  color: var(--navy);
  font-size: 34px;
  line-height: 1.1;
  letter-spacing: -0.035em;
}

.auth-card-heading p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.auth-error {
  margin-top: 22px;
  padding: 12px 14px;
  border: 1px solid #f0c1c4;
  border-radius: 11px;
  color: #963f46;
  background: #fff0f1;
  font-size: 13px;
  font-weight: 700;
}

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

.auth-form input {
  min-height: 50px;
  padding-inline: 14px;
  border-radius: 12px;
}

.auth-submit {
  width: 100%;
  min-height: 50px;
  margin-top: 4px;
}

.auth-security-note {
  margin: 20px 0 0;
  color: #7a8b91;
  font-size: 11px;
  text-align: center;
}

.auth-security-note span {
  margin-right: 5px;
  color: #2aa98f;
  font-size: 8px;
}

@media (max-width: 1240px) {
  .header-shell {
    width: min(100% - 28px, 1360px);
  }

  .header-inner {
    gap: 11px;
  }

  .brand small,
  .session-user-copy {
    display: none;
  }

  .main-nav a {
    padding-inline: 8px;
    font-size: 11px;
  }

  .header-actions {
    gap: 8px;
    padding-left: 10px;
  }
}

@media (max-width: 980px) {
  .nav-toggle {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-left: auto;
    padding: 8px 11px;
    border: 1px solid var(--line);
    border-radius: 10px;
    color: var(--ink);
    background: #fff;
    font-weight: 780;
  }

  .nav-toggle span {
    color: var(--teal-dark);
    font-size: 15px;
  }

  .main-nav {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    z-index: 25;
    width: min(340px, calc(100vw - 28px));
    display: none;
    flex-direction: column;
    align-items: stretch;
    gap: 3px;
    padding: 8px;
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 18px 42px rgba(7, 59, 76, 0.16);
  }

  .main-nav.open {
    display: flex;
  }

  .main-nav a {
    min-height: 42px;
    padding-inline: 12px;
    font-size: 13px;
  }

  .main-nav a.active {
    background: var(--teal-soft);
    box-shadow: none;
  }

  .header-actions {
    margin-left: 0;
  }

  .kpi-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .dashboard-grid,
  .detail-grid,
  .expense-edit-layout,
  .settings-layout,
  .account-layout {
    grid-template-columns: 1fr;
  }

  .route-form-grid {
    grid-template-columns: 1fr 28px 1fr;
  }

  .distance-field {
    grid-column: 1 / -1;
  }

  .expense-row {
    grid-template-columns: repeat(2, 1fr) 38px;
  }

  .expense-row .file-field {
    grid-column: span 2;
  }

  .detail-summary {
    grid-template-columns: repeat(2, 1fr);
  }

  .expense-item {
    grid-template-columns: 38px minmax(0, 1fr) auto auto;
  }

  .expense-actions {
    grid-column: 2 / -1;
  }
}

@media (max-width: 760px) {
  .shell {
    width: min(100% - 24px, 1180px);
  }

  .header-inner {
    min-height: 68px;
  }

  .header-action {
    display: none;
  }

  .page {
    padding-block: 30px 50px;
  }

  .heading-actions {
    align-items: flex-start;
    flex-direction: column;
  }

  .kpi-grid,
  .detail-summary,
  .export-grid {
    grid-template-columns: 1fr;
  }

  .kpi-card {
    min-height: 130px;
  }

  .form-section {
    grid-template-columns: 45px 1fr;
  }

  .section-content .panel-heading,
  .form-grid,
  .route-form-grid,
  .trip-legs,
  .expense-rows,
  .existing-expenses {
    padding-inline: 16px;
  }

  .two-columns,
  .route-form-grid {
    grid-template-columns: 1fr;
  }

  .route-arrow {
    height: 20px;
    transform: rotate(90deg);
  }

  .route-leg-card {
    padding: 14px;
  }

  .route-leg-card .route-form-grid {
    padding-inline: 0;
  }

  .route-leg-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .journey-leg {
    grid-template-columns: 1fr;
    gap: 9px;
  }

  .distance-field {
    grid-column: auto;
  }

  .form-options {
    align-items: stretch;
    flex-direction: column;
    margin-inline: 16px;
  }

  .compact-field {
    width: 100%;
    margin-left: 0;
  }

  .expense-row {
    grid-template-columns: 1fr 38px;
  }

  .expense-row .field,
  .expense-row .file-field {
    grid-column: 1;
  }

  .expense-row .icon-button {
    grid-column: 2;
    grid-row: 1;
  }

  .empty-expenses,
  .form-help {
    margin-inline: 16px;
  }

  .existing-expense-item {
    grid-template-columns: 1fr;
  }

  .existing-expense-summary {
    flex-wrap: wrap;
  }

  .existing-expense-summary strong {
    width: 100%;
    order: -1;
  }

  .existing-expense-summary b {
    margin-left: 0;
  }

  .existing-expense-actions {
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  .expense-item {
    grid-template-columns: 38px minmax(0, 1fr) auto;
  }

  .expense-item .attachment-badge {
    grid-column: 2;
    width: max-content;
  }

  .expense-item > b {
    grid-column: 3;
  }

  .expense-actions {
    grid-column: 1 / -1;
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  .receipt-card {
    align-items: stretch;
    flex-direction: column;
  }

  .toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .toolbar select {
    min-width: 0;
  }

  .toolbar-count {
    margin-left: 0;
  }

  .export-submit {
    align-items: stretch;
    flex-direction: column;
  }

  .month-bars {
    overflow-x: auto;
  }

  .month-bar {
    min-width: 62px;
  }

  .account-password-grid,
  .role-choice {
    grid-template-columns: 1fr;
  }

  .account-form {
    padding-inline: 16px;
  }

  .account-errors {
    margin-inline: 16px;
  }

  .auth-main {
    padding: 0;
  }

  .auth-shell {
    min-height: 100vh;
    grid-template-columns: 1fr;
    border: 0;
    border-radius: 0;
  }

  .auth-intro {
    min-height: 255px;
    padding: 28px 24px;
  }

  .auth-intro-copy {
    padding: 45px 0 15px;
  }

  .auth-intro h1 {
    font-size: clamp(32px, 10vw, 43px);
  }

  .auth-intro-copy p {
    margin-top: 13px;
  }

  .auth-benefits {
    display: none;
  }

  .auth-card {
    padding: 38px 24px 46px;
  }

  .auth-card-heading h2 {
    font-size: 30px;
  }
}

@media (max-width: 520px) {
  .brand > span:last-child {
    display: none;
  }

  .brand-mark {
    width: 39px;
    height: 39px;
    border-radius: 12px;
  }

  .header-actions {
    padding-left: 8px;
  }

  .header-session {
    padding: 3px;
  }

  .session-user {
    padding-right: 0;
  }

  .session-user b {
    width: 33px;
    height: 33px;
  }

  .session-logout-label {
    display: none;
  }

  .session-logout-short {
    display: inline;
  }
}
/* Ajout rapide de frais depuis la liste des déplacements. */
.shell.trips-page { width: min(1560px, calc(100% - 40px)); }
.trips-with-summary { display: grid; grid-template-columns: minmax(0, 1fr) 270px; gap: 24px; align-items: start; }
.trips-with-summary > .panel { min-width: 0; }
.trip-month-summary { position: sticky; top: 96px; padding: 22px; max-height: calc(100dvh - 120px); overflow-y: auto; }
.trip-month-summary h2 { font-size: 20px; margin: 0 0 20px; }
.month-reimbursement + .month-reimbursement { border-top: 1px solid #dbe4e2; margin-top: 24px; padding-top: 20px; }
.month-reimbursement h3 { margin: 0 0 18px; font-size: 16px; color: var(--teal-dark); }
.month-reimbursement dl { margin: 0; display: grid; gap: 18px; }
.month-reimbursement dt { color: var(--muted); font-size: 13px; }
.month-reimbursement dd { margin: 4px 0 0; font-size: 22px; font-weight: 800; color: var(--navy); white-space: nowrap; font-variant-numeric: tabular-nums; }
.month-grand-total { padding-top: 16px; border-top: 1px solid #dbe4e2; }
.month-grand-total dd { color: var(--teal-dark); }
@media (max-width: 1100px) {
  .trips-with-summary { grid-template-columns: minmax(0, 1fr); }
  .trip-month-summary { position: static; max-height: none; }
  .month-reimbursement dl { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .month-grand-total { padding-top: 0; border-top: 0; }
}
@media (max-width: 600px) {
  .month-reimbursement dl { grid-template-columns: minmax(0, 1fr); }
  .month-grand-total { padding-top: 16px; border-top: 1px solid #dbe4e2; }
}
[data-trip-entries] { display: grid; gap: 36px; }
[data-trip-entry] + [data-trip-entry] { border-top: 2px solid #b7d9d3; padding-top: 28px; }
[data-trip-entry] > .panel-heading { flex-wrap: wrap; gap: 12px; }
.expense-dialog {
  width: min(560px, calc(100vw - 32px));
  max-height: calc(100dvh - 32px);
  overflow: auto;
  border: 1px solid #d8e4e4;
  border-radius: 20px;
  padding: 28px;
  color: #083b49;
  background: #fff;
  box-shadow: 0 24px 80px #083b4933;
}
.expense-dialog::backdrop { background: #083b4970; }
.expense-dialog .form-actions { flex-wrap: wrap; }
.expense-dialog [data-expense-trip] { margin-bottom: 20px; }
.expense-dialog [disabled] { opacity: .6; cursor: wait; }

.receipt-preview {
  grid-column: 1 / -1;
  min-width: 0;
  overflow: hidden;
  border: 1px solid #dce5e3;
  border-radius: 12px;
  background: #fff;
}
.receipt-preview-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  padding: 12px 16px;
  border-bottom: 1px solid #dce5e3;
  font-size: 13px;
}
.receipt-preview-heading strong {
  min-width: 0;
  overflow-wrap: anywhere;
}
.receipt-preview-heading a { flex-shrink: 0; }
.receipt-preview object {
  display: block;
  width: 100%;
  height: 560px;
  height: min(560px, 65dvh);
  border: 0;
}
.receipt-preview img {
  display: block;
  width: 100%;
  max-height: 560px;
  object-fit: contain;
  background: #f2f5f5;
}
.receipt-preview p { padding: 16px; }

.receipt-dropzone { padding: 18px; border: 2px dashed #9bc7c2; border-radius: 12px; background: #f2f9f8; display: grid; gap: 12px; margin: 16px 0; }
.receipt-dropzone input { max-width: 100%; }
.receipt-review-layout { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(280px, 1fr); gap: 24px; margin-bottom: 24px; }
.receipt-review-layout > .receipt-preview { grid-column: auto; }
.receipt-review-layout .receipt-preview object { height: 70vh; }
.history-entry { border-bottom: 1px solid #dce5e3; padding: 14px 0; overflow-wrap: anywhere; }
.receipt-camera { display: none !important; font-size: 12px; white-space: normal; }
@media (hover: none) and (pointer: coarse) {
  .receipt-camera { display: inline-flex !important; }
  .field.receipt-camera { display: flex !important; flex-direction: column; }
}
.expense-row { grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: start; }
.expense-row .icon-button { justify-self: end; }
[data-duplicate-warning] { font-size: 13px; }
@media (max-width: 760px) {
  .receipt-review-layout, .expense-row { grid-template-columns: minmax(0, 1fr); }
  .receipt-preview object { height: 55vh; }
  .receipt-camera { min-height: 44px; }
}

/* Small import preview beside the fields; the full document remains one click away. */
.receipt-preview-compact {
  width: 320px;
  max-width: 100%;
  justify-self: end;
  align-self: start;
}
.receipt-preview-compact .receipt-preview-heading {
  gap: 6px;
  padding: 8px;
  font-size: 11px;
}
.receipt-preview-compact .receipt-preview-heading strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.receipt-preview-compact object,
.receipt-preview-compact img {
  height: 420px;
  max-height: 420px;
}
.receipt-preview-compact p { padding: 8px; font-size: 12px; }
@media (min-width: 761px) {
  .expense-row:has(> .receipt-preview-compact) {
    grid-template-columns: repeat(2, minmax(0, 1fr)) 320px;
  }
  .expense-row > .receipt-preview-compact {
    grid-column: 3;
    grid-row: 1 / span 3;
  }
  .stack-form:has(> .receipt-preview-compact) {
    grid-template-columns: minmax(0, 1fr) min(320px, 45%);
    align-items: start;
  }
  .stack-form:has(> .receipt-preview-compact) > * {
    grid-column: 1;
    min-width: 0;
  }
  .stack-form > .receipt-preview-compact {
    grid-column: 2 !important;
    grid-row: 1 / span 6;
  }
  .stack-form:has(> .receipt-preview-compact) > .form-actions {
    grid-column: 1 / -1;
  }
}
