:root {
  --bg: #f3f5fa;
  --ink: #182447;
  --muted: #64718b;
  --green: rgb(10, 33, 113);
  --accent: #d9edff;
  --soft: #eef2fb;
  --line: #e0e6f0;
}
.sidebar {
  background: #fff;
}
.brand {
  color: #0a2171;
}
.eos-logo {
  width: 46px;
  height: 46px;
  flex-shrink: 0;
}
.brand small {
  letter-spacing: 0.01em;
}
.nav button.active {
  background: #eaf0ff;
  color: #0a2171;
}
.btn.primary {
  background: #0a2171;
  border-color: #0a2171;
  color: #fff;
}
.btn.primary:hover {
  background: #173c9a;
}
.heading .eyebrow {
  color: #3156a5;
}
.card {
  box-shadow: 0 5px 25px #142b6010;
}
.stats button.stat {
  text-align: left;
  font: inherit;
  border: 1px solid var(--line);
  background: white;
  color: var(--ink);
  transition:
    border-color 0.15s,
    box-shadow 0.15s;
}
.stats button.stat:hover {
  border-color: #6c88c4;
  box-shadow: 0 3px 14px #0a217112;
}
.stats button.stat.selected {
  background: #edf3ff;
  border-color: #0a2171;
  box-shadow: inset 0 3px #0a2171;
}
.stat label {
  cursor: pointer;
}
.stats .stat:last-child {
  background: white;
  color: var(--ink);
}
.stats .stat:last-child small {
  color: var(--muted);
}
.stats .stat.selected:last-child {
  background: #edf3ff;
}
.status-row td:first-child {
  border-left: 5px solid var(--row-status, #0a2171);
}
.status-row:hover {
  background: #f8faff;
}
.file-row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}
.file-row small {
  display: block;
  color: var(--muted);
  margin-top: 5px;
}
.scan-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 24px;
}
.scan-page {
  border: 1px solid var(--line);
  padding: 14px;
  border-radius: 12px;
}
.scan-page img {
  width: 100%;
  height: auto;
  max-height: none;
  object-fit: contain;
  background: #f1f3f9;
}
.scan-page strong {
  display: block;
  overflow-wrap: anywhere;
  margin: 12px 0;
}
.scan-page small {
  color: var(--muted);
}
.finance-stats {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}
.finance-stats .stat {
  padding: 18px;
}
.totals-strip {
  display: flex;
  gap: 30px;
  padding: 20px 24px;
  margin-bottom: 24px;
  background: #eaf0ff;
  border-radius: 14px;
  flex-wrap: wrap;
}
.totals-strip strong,
.totals-strip small {
  display: block;
}
.totals-strip strong {
  font-size: 24px;
  margin: 6px 0;
}
.cost-row {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 12px;
  align-items: end;
}
.cost-row > .btn {
  margin-bottom: 20px;
}
.filters label {
  font-size: 12px;
  color: var(--muted);
}
.filters label input {
  display: block;
  max-width: 155px;
}
.auth-hero {
  background: #0a2171;
}
.modalfoot {
  flex-wrap: wrap;
}
#invoice-file {
  margin-top: 15px;
}
#invoice-form .formgrid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
[hidden] {
  display: none !important;
}
@media (max-width: 900px) {
  .finance-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .scan-grid {
    grid-template-columns: 1fr;
  }
  .cost-row {
    grid-template-columns: 1fr;
  }
  .file-row {
    align-items: flex-start;
    flex-direction: column;
  }
}

.sidebar {
  overflow-y: auto;
}
.nav {
  gap: 3px;
}
.nav button {
  padding: 11px 14px;
}
.sidebar .help-card {
  display: none;
}
.sidebar-bottom {
  padding-top: 20px;
}
.finance-stats .stat {
  min-height: 68px;
}
.auth-story {
  background: linear-gradient(145deg, #0a2171, #163b99);
}
.auth-story .brand {
  color: white;
}
.auth-story .brand small,
.auth-story .eyebrow {
  color: #bfdbff !important;
}
.help-card {
  background: #edf3ff;
  border-color: #dfe7f6;
}
.topbar {
  background: white;
}
.btn {
  color: var(--ink);
}

.finance-partner-picker {
  width: min(850px, 94vw);
}
.finance-partner-picker .modalbody {
  max-height: 70vh;
  overflow: auto;
}
#invoice-form input[readonly] {
  background: #f1f4f9;
  color: #536078;
}

.sort-heading {
  font: inherit;
  color: inherit;
  text-align: left;
  border: 0;
  background: transparent;
  padding: 0;
  cursor: pointer;
  display: inline-flex;
  gap: 8px;
  align-items: center;
}
.sort-heading:hover,
.name-link:hover {
  color: #0a2171;
  text-decoration: underline;
}
.sort-heading:focus-visible,
.name-link:focus-visible {
  outline: 2px solid #0a2171;
  outline-offset: 4px;
}
.name-link {
  border: 0;
  background: transparent;
  padding: 0;
  color: inherit;
  font: inherit;
  font-weight: 700;
  text-align: left;
  cursor: pointer;
}
.line-actions {
  display: flex;
  gap: 3px;
  white-space: nowrap;
}

.invoice-attachment-banner,
.invoice-file-picker {
  display: flex;
  gap: 16px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.invoice-attachment-banner {
  background: #eef3fc;
  padding: 16px;
  border-radius: 12px;
}
.invoice-upload {
  padding: 16px;
  background: #f4f6fa;
  border-radius: 12px;
  margin-bottom: 20px;
}
.invoice-file-picker .field {
  flex: 1;
  min-width: 200px;
}
.invoice-preview {
  background: #e7ebf2;
  padding: 12px;
  max-height: 60vh;
  overflow: auto;
  border-radius: 10px;
}
.invoice-preview figure {
  margin: 0 0 16px;
}
.invoice-preview figcaption {
  padding: 8px;
  text-align: center;
  color: #536078;
}
.invoice-preview img {
  display: block;
  width: 100%;
  height: auto;
  background: white;
}
.invoice-pdf-icon {
  color: #0a2171;
  vertical-align: middle;
}

.app-utility {
  position: fixed;
  bottom: 14px;
  right: 18px;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px 4px 4px;
  background: white;
  border: 1px solid #dbe2ef;
  border-radius: 12px;
  box-shadow: 0 3px 15px #0a217114;
}
.version-link {
  color: #0a2171;
  background: none;
  border: 0;
  cursor: pointer;
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  padding: 8px;
}
.version-link:hover {
  text-decoration: underline;
}
.pagefooter {
  padding-bottom: 64px;
}
.release-list {
  display: grid;
  gap: 16px;
  margin-top: 24px;
}
.feedback-dialog {
  width: min(600px, 94vw);
}
.feedback-dialog .modalbody {
  max-height: 70vh;
  overflow: auto;
}
.feedback-item {
  padding: 20px 0;
  border-bottom: 1px solid #e7ebf2;
}
.feedback-item:first-child {
  padding-top: 0;
}
.feedback-item .field {
  max-width: 250px;
}
.feedback-body {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.invoice-item {
  border: 1px solid #dbe2ef;
  border-radius: 12px;
  margin: 0 0 16px;
  padding: 16px;
}
.invoice-item legend {
  color: #0a2171;
  font-weight: 700;
  padding: 0 8px;
}
#invoice-item-total {
  margin-top: 18px;
}

#item-invoice-form {
  background: white;
  border: 1px solid var(--border, #dce4ef);
  border-radius: 18px;
  overflow: hidden;
}
#item-invoice-form h3 {
  margin-top: 28px;
}
#add-invoice-item {
  margin: 16px 0;
}
#invoice-item-rows td {
  vertical-align: middle;
}

.scan-drop {
  border: 2px dashed var(--line);
  padding: 24px;
  border-radius: 12px;
  background: #f6f8ff;
}
.scan-drop.dragging {
  border-color: #0a2171;
  background: #e5ebff;
}
.scan-page .actions {
  flex-wrap: wrap;
  margin-bottom: 12px;
}

#attachment-drop {
  width: 100%;
  text-align: left;
  color: inherit;
  font: inherit;
  cursor: pointer;
  margin-bottom: 20px;
}
