:root {
  --ov-company-accent: #1769ff;
  --ov-company-accent-text: #fff;
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #17233d;
  background: #f4f7fb;
  font-synthesis: none;
}

.ov-company-themed .primary-button,
.ov-company-themed .step-number,
.ov-company-themed .archive-filter-button.active,
.ov-company-themed .settings-actions .primary-button {
  background: var(--ov-company-accent);
  color: var(--ov-company-accent-text);
}

.ov-company-themed input:focus,
.ov-company-themed select:focus,
.ov-company-themed textarea:focus {
  border-color: var(--ov-company-accent);
}

.report-payment-breakdown {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0 0 18px;
}
.report-payment-breakdown span {
  padding: 8px 12px;
  border-radius: 999px;
  background: #fff;
  border: 1px solid #dce5f1;
  font-weight: 700;
}
.settings-device-actions { display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
.settings-device-actions .secondary-button { min-height: 38px; }
.ov-industry-card{display:flex;align-items:center;justify-content:space-between;gap:20px;margin:0 0 18px;padding:20px;border:1px solid #dce5f1;border-radius:16px;background:#fff}
.ov-industry-card h2{margin:4px 0}.ov-industry-card p{margin:0;color:#66758a}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 15% 10%, rgba(42,113,255,.12), transparent 32rem),
    #f4f7fb;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: default;
  opacity: .65;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid #cad3e1;
  border-radius: 12px;
  padding: 12px 14px;
  background: #fff;
  color: #17233d;
  outline: none;
}

input,
select {
  min-height: 48px;
}

textarea {
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: #1769ff;
  box-shadow: 0 0 0 4px rgba(23,105,255,.1);
}

label {
  display: block;
  margin-bottom: 7px;
  font-size: 14px;
  font-weight: 700;
}

[hidden] {
  display: none !important;
}

.plain-button {
  border: 0;
  padding: 0;
  background: transparent;
  color: inherit;
}

.primary-button,
.secondary-button {
  min-height: 44px;
  border-radius: 11px;
  padding: 0 17px;
  font-weight: 800;
}

.primary-button {
  border: 0;
  background: #1769ff;
  color: #fff;
}

.primary-button:hover {
  background: #095be5;
}

.secondary-button {
  border: 1px solid #cad3e1;
  background: #fff;
  color: #17233d;
}

.app-shell {
  min-height: 100vh;
}

.login-view {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 32px 18px;
}

.login-card {
  width: min(100%,460px);
  padding: 36px;
  background: #fff;
  border: 1px solid #e2e8f2;
  border-radius: 24px;
  box-shadow: 0 24px 70px rgba(24,42,76,.12);
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-mark {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border-radius: 15px;
  background: linear-gradient(145deg,#1769ff,#3b8cff);
  color: #fff;
  font-weight: 800;
}

.brand-mark.small {
  width: 36px;
  height: 36px;
  border-radius: 11px;
  font-size: 13px;
}

.brand-name {
  font-size: 22px;
  font-weight: 800;
}

.brand-tagline {
  margin-top: 3px;
  color: #6c7890;
  font-size: 13px;
}

.login-heading {
  margin: 38px 0 24px;
}

.login-heading h1 {
  margin: 0;
  font-size: 30px;
}

.login-heading p {
  margin: 8px 0 0;
  color: #6c7890;
}

#login-form {
  display: grid;
  gap: 10px;
}

#login-button {
  margin-top: 14px;
}

.security-note {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid #edf0f5;
  color: #79859a;
  font-size: 12px;
  text-align: center;
}

.topbar {
  min-height: 66px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px clamp(16px,4vw,48px);
  background: rgba(255,255,255,.95);
  border-bottom: 1px solid #e4e9f1;
}

.topbar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.user-area {
  display: flex;
  align-items: center;
  gap: 18px;
}

.user-data {
  display: grid;
  text-align: right;
}

.user-data span {
  color: #6c7890;
  font-size: 12px;
}

.dashboard,
.purchase-page {
  width: min(1250px,calc(100% - 36px));
  margin: 0 auto;
  padding: 58px 0;
}

.dashboard-heading,
.purchase-page-heading,
.section-heading {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: flex-start;
}

.dashboard-heading {
  margin-bottom: 32px;
}

.dashboard-heading h1,
.purchase-page-heading h1 {
  margin: 5px 0 0;
  font-size: clamp(34px,5vw,52px);
  letter-spacing: -.04em;
}

.dashboard-heading p,
.purchase-page-heading p {
  margin: 8px 0 0;
  color: #6c7890;
}

.eyebrow,
.card-label {
  color: #1769ff;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .09em;
}

.status-pill {
  padding: 10px 14px;
  border-radius: 999px;
  background: #e9f8ef;
  color: #207541;
  font-size: 13px;
  font-weight: 700;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(3,1fr);
  gap: 18px;
}

.dashboard-card {
  min-height: 260px;
  display: flex;
  flex-direction: column;
  padding: 26px;
  border: 1px solid #e2e8f2;
  border-radius: 20px;
  background: #fff;
  box-shadow: 0 12px 35px rgba(24,42,76,.06);
}

.dashboard-card.featured {
  border-color: #cbdcff;
}

.dashboard-card h2 {
  margin: 12px 0 8px;
  font-size: 22px;
}

.dashboard-card p {
  margin: 0;
  color: #6c7890;
  line-height: 1.55;
}

.dashboard-card button {
  margin-top: auto;
}

.draft-section {
  margin-top: 46px;
}

.section-heading {
  align-items: center;
  margin-bottom: 16px;
}

.section-heading h2 {
  margin: 5px 0 0;
}

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

.draft-row,
.empty-state {
  padding: 18px 20px;
  border: 1px solid #e2e8f2;
  border-radius: 14px;
  background: #fff;
}

.draft-row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 20px;
  align-items: center;
}

.draft-row strong {
  display: block;
}

.draft-meta {
  margin-top: 4px;
  color: #79859a;
  font-size: 13px;
}

.draft-amount {
  font-weight: 800;
}

.empty-state {
  color: #79859a;
}

.purchase-page {
  max-width: 1050px;
}

.back-button {
  display: block;
  margin-bottom: 26px;
  border: 0;
  padding: 0;
  background: transparent;
  color: #587092;
  font-weight: 700;
}

.purchase-total-box {
  min-width: 180px;
  padding: 18px 22px;
  background: #17233d;
  color: #fff;
  border-radius: 16px;
}

.purchase-total-box span {
  display: block;
  margin-bottom: 4px;
  opacity: .72;
  font-size: 12px;
}

.purchase-total-box strong {
  font-size: 26px;
}

#purchase-form {
  display: grid;
  gap: 20px;
  margin-top: 32px;
}

.form-card {
  padding: 28px;
  border: 1px solid #e2e8f2;
  border-radius: 20px;
  background: #fff;
  box-shadow: 0 8px 28px rgba(24,42,76,.05);
}

.form-card-heading {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  margin-bottom: 26px;
}

.split-heading {
  justify-content: space-between;
}

.heading-group {
  display: flex;
  gap: 14px;
}

.form-card-heading h2 {
  margin: 2px 0 4px;
}

.form-card-heading p {
  margin: 0;
  color: #79859a;
}

.step-number {
  flex: none;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: #eaf1ff;
  color: #1769ff;
  font-weight: 800;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2,1fr);
  gap: 18px;
}

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

.purchase-item {
  margin-top: 16px;
  padding: 22px;
  background: #f7f9fc;
  border: 1px solid #e2e8f2;
  border-radius: 16px;
}

.purchase-item:first-child {
  margin-top: 0;
}

.item-heading {
  display: flex;
  justify-content: space-between;
  margin-bottom: 20px;
}

.item-heading h3 {
  margin: 0;
}

.danger-link {
  border: 0;
  background: transparent;
  color: #ae3447;
  font-weight: 700;
}

.item-total {
  display: flex;
  justify-content: flex-end;
  align-items: baseline;
  gap: 18px;
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid #dfe5ee;
}

.item-total span {
  color: #6c7890;
}

.item-total strong {
  min-width: 120px;
  font-size: 22px;
  text-align: right;
}

.purchase-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

.message {
  padding: 13px 15px;
  border-radius: 11px;
  font-size: 14px;
}

.message.error {
  color: #951e2e;
  background: #fff0f2;
  border: 1px solid #ffd0d6;
}

.message.success {
  color: #176438;
  background: #ebfaef;
  border: 1px solid #c5ebd0;
}

@media (max-width: 800px) {
  .dashboard-grid {
    grid-template-columns: 1fr;
  }

  .dashboard-heading,
  .purchase-page-heading {
    display: block;
  }

  .status-pill,
  .purchase-total-box {
    display: inline-block;
    margin-top: 20px;
  }

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

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

  .draft-row {
    grid-template-columns: 1fr;
  }

  .draft-amount {
    text-align: left;
  }
}

@media (max-width: 520px) {
  .login-card,
  .form-card {
    padding: 22px 18px;
  }

  .user-data {
    display: none;
  }

  .split-heading {
    display: block;
  }

  .split-heading > button {
    margin-top: 18px;
  }

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

@media (min-width: 801px) {
  .draft-row {
    grid-template-columns: minmax(0, 1fr) auto auto auto;
  }
}

.draft-row .secondary-button {
  min-width: 82px;
}

.photo-section {
  margin-top: 4px;
  padding-top: 18px;
  border-top: 1px solid #dfe5ee;
}

.photo-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.photo-heading label {
  margin: 0;
}

.photo-help {
  margin-top: 4px;
  color: #79859a;
  font-size: 12px;
}

.photo-upload-button {
  flex: none;
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 15px;
  border: 1px solid #bfcbe0;
  border-radius: 10px;
  background: #fff;
  color: #17233d;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
}

.photo-upload-button:hover {
  border-color: #1769ff;
  color: #1769ff;
}

.photo-upload-button.disabled {
  cursor: default;
  opacity: .55;
  border-color: #d8dee8;
  color: #79859a;
}

.photo-status {
  margin-top: 12px;
  padding: 10px 12px;
  border-radius: 9px;
  background: #eef3fa;
  color: #52627a;
  font-size: 13px;
}

.photo-status.error {
  background: #fff0f2;
  color: #951e2e;
}

.photo-status.success {
  background: #ebfaef;
  color: #176438;
}

.photo-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 150px));
  gap: 12px;
  margin-top: 14px;
}

.photo-card {
  position: relative;
  overflow: hidden;
  aspect-ratio: 1 / 1;
  border: 1px solid #dce3ed;
  border-radius: 12px;
  background: #eef2f7;
}

.photo-card img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.photo-delete {
  position: absolute;
  top: 7px;
  right: 7px;
  width: 31px;
  height: 31px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(18, 30, 52, .84);
  color: #fff;
  font-size: 17px;
  font-weight: 800;
}

.photo-delete:hover {
  background: #ae3447;
}

.photo-empty {
  grid-column: 1 / -1;
  color: #79859a;
  font-size: 13px;
}

@media (max-width: 600px) {
  .photo-heading {
    display: block;
  }

  .photo-upload-button {
    margin-top: 12px;
    width: 100%;
  }

  .photo-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.seller-approval {
  margin-top: 28px;
  padding: 24px;
  border: 1px solid #d9e2ef;
  border-radius: 16px;
  background: #f8fafc;
}

.approval-header h3 {
  margin: 0 0 6px;
  font-size: 20px;
}

.approval-header p {
  margin: 0;
  color: #68778d;
  line-height: 1.5;
}

.seller-confirmation {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-top: 22px;
  padding: 14px;
  border: 1px solid #d9e2ef;
  border-radius: 10px;
  background: #fff;
  cursor: pointer;
}

.seller-confirmation input {
  width: 20px;
  height: 20px;
  flex: none;
  margin-top: 1px;
}

.signature-wrap {
  margin-top: 22px;
}

.signature-label {
  margin-bottom: 8px;
  font-size: 14px;
  font-weight: 800;
}

.signature-canvas {
  display: block;
  width: 100%;
  height: 220px;
  border: 2px solid #cbd6e5;
  border-radius: 12px;
  background: #fff;
  cursor: crosshair;
  touch-action: none;
}

.signature-status {
  min-height: 20px;
  margin-top: 8px;
  color: #66758a;
  font-size: 13px;
}

.signature-status.error {
  color: #a12638;
}

.signature-status.success {
  color: #17713b;
}

.signature-actions {
  display: flex;
  gap: 10px;
  margin-top: 12px;
}

.saved-signature-preview {
  margin-top: 20px;
  padding: 16px;
  border: 1px solid #d9e2ef;
  border-radius: 12px;
  background: #fff;
}

.saved-signature-title {
  margin-bottom: 8px;
  font-size: 13px;
  font-weight: 800;
}

.saved-signature-preview img {
  display: block;
  max-width: 360px;
  width: 100%;
  max-height: 160px;
  object-fit: contain;
  object-position: left center;
}

.final-approval-box {
  margin-top: 24px;
  padding-top: 22px;
  border-top: 1px solid #d9e2ef;
}

.final-approval-box p {
  margin: 5px 0 15px;
  color: #68778d;
  font-size: 13px;
}

.approve-purchase-button {
  min-height: 48px;
  padding: 0 22px;
  border: 0;
  border-radius: 10px;
  background: #1769ff;
  color: #fff;
  font-weight: 800;
  cursor: pointer;
}

.approve-purchase-button:disabled {
  opacity: .45;
  cursor: not-allowed;
}

@media (max-width: 600px) {
  .seller-approval {
    padding: 18px;
  }

  .signature-canvas {
    height: 190px;
  }

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

  .approve-purchase-button {
    width: 100%;
  }
}


/* ==========================================================
   Arkisto
   ========================================================== */

.archive-page {
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
  padding: 36px 0 70px;
}

.archive-page-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 24px;
}

.archive-page-heading h1 {
  margin: 5px 0 6px;
}

.archive-page-heading p {
  margin: 0;
  color: #68778d;
}

.archive-summary {
  display: flex;
  align-items: center;
  margin-bottom: 16px;
  padding: 16px 18px;
  border: 1px solid #dbe3ee;
  border-radius: 12px;
  background: #f8fafc;
}

.archive-summary span {
  display: block;
  margin-bottom: 3px;
  color: #748298;
  font-size: 12px;
}

.archive-summary strong {
  font-size: 17px;
}

.archive-filters {
  display: grid;
  grid-template-columns:
    minmax(240px, 1.6fr)
    minmax(150px, .7fr)
    minmax(145px, .65fr)
    minmax(145px, .65fr)
    auto;
  align-items: end;
  gap: 14px;
  margin-bottom: 12px;
  padding: 18px;
  border: 1px solid #dbe3ee;
  border-radius: 14px;
  background: #fff;
}

.archive-filter-field label {
  display: block;
  margin-bottom: 6px;
  color: #45566f;
  font-size: 12px;
  font-weight: 800;
}

.archive-filter-field input,
.archive-filter-field select {
  width: 100%;
  min-height: 42px;
}

.archive-filter-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.archive-filter-actions button {
  min-height: 42px;
  white-space: nowrap;
}

.archive-result-info {
  min-height: 20px;
  margin: 0 2px 10px;
  color: #68778d;
  font-size: 12px;
}

.archive-pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 18px;
}

.archive-page-button {
  min-width: 40px;
  min-height: 40px;
  padding: 0 12px;
  border: 1px solid #cbd6e5;
  border-radius: 9px;
  background: #fff;
  color: #17233d;
  font: inherit;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
}

.archive-page-button:hover:not(:disabled),
.archive-page-button.current {
  border-color: #1769ff;
  color: #1769ff;
}

.archive-page-button.current {
  background: #eaf2ff;
}

.archive-page-button:disabled {
  opacity: .45;
  cursor: default;
}

.archive-page-separator {
  padding: 0 2px;
  color: #748298;
}

.archive-list {
  overflow: hidden;
  border: 1px solid #dbe3ee;
  border-radius: 14px;
  background: #fff;
}

.archive-row {
  display: grid;
  grid-template-columns:
    minmax(120px, .85fr)
    minmax(180px, 1.5fr)
    minmax(110px, .75fr)
    minmax(150px, 1fr)
    auto;
  align-items: center;
  gap: 18px;
  padding: 18px 20px;
  border-bottom: 1px solid #e5eaf1;
}

.archive-row:last-child {
  border-bottom: 0;
}

.archive-row:hover {
  background: #fafbfd;
}

.archive-receipt-number {
  font-weight: 800;
  color: #17233d;
}

.archive-seller {
  min-width: 0;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.archive-total {
  font-weight: 800;
}

.archive-date {
  color: #68778d;
  font-size: 13px;
}

.archive-pdf-button {
  min-height: 39px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 14px;
  border: 1px solid #cbd6e5;
  border-radius: 9px;
  background: #fff;
  color: #1769ff;
  font-size: 13px;
  font-weight: 800;
  text-decoration: none;
  white-space: nowrap;
}

.archive-pdf-button:hover {
  border-color: #1769ff;
}

.archive-empty {
  padding: 36px 20px;
  color: #748298;
  text-align: center;
}

.archive-status {
  display: inline-flex;
  margin-top: 5px;
  padding: 3px 8px;
  border-radius: 999px;
  background: #eaf8ee;
  color: #23683b;
  font-size: 11px;
  font-weight: 800;
}

@media (max-width: 800px) {
  .archive-page-heading {
    display: block;
  }

  .archive-page-heading > button {
    margin-top: 16px;
  }

  .archive-filters {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .archive-search-field,
  .archive-filter-actions {
    grid-column: 1 / -1;
  }

  .archive-row {
    grid-template-columns: 1fr auto;
    gap: 9px 16px;
  }

  .archive-seller,
  .archive-total,
  .archive-date {
    grid-column: 1;
  }

  .archive-pdf-button {
    grid-column: 2;
    grid-row: 1 / span 4;
    align-self: center;
  }
}

@media (max-width: 520px) {
  .archive-page {
    width: min(100% - 28px, 1180px);
  }

  .archive-row {
    display: block;
  }

  .archive-filters {
    grid-template-columns: 1fr;
  }

  .archive-search-field,
  .archive-filter-actions {
    grid-column: auto;
  }

  .archive-filter-actions {
    align-items: stretch;
  }

  .archive-filter-actions button {
    flex: 1;
  }

  .archive-seller,
  .archive-total,
  .archive-date {
    margin-top: 8px;
  }

  .archive-pdf-button {
    width: 100%;
    margin-top: 14px;
  }
}


/* ==========================================================
   Arkiston ostotapahtuman tarkka näkymä
   ========================================================== */

.archive-detail {
  margin-top: 18px;
}

.archive-detail-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  margin: 20px 0 24px;
  padding: 24px;
  border: 1px solid #dbe3ee;
  border-radius: 14px;
  background: #f8fafc;
}

.archive-detail-header h2 {
  margin: 4px 0 5px;
  font-size: 25px;
}

.archive-detail-header p {
  margin: 0;
  color: #68778d;
}

.archive-detail-section {
  margin-top: 18px;
  padding: 22px;
  border: 1px solid #dbe3ee;
  border-radius: 14px;
  background: #fff;
}

.archive-detail-section h3 {
  margin: 0 0 16px;
  font-size: 17px;
}

.archive-detail-data {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px 24px;
}

.archive-detail-field {
  min-width: 0;
}

.archive-detail-field span {
  display: block;
  margin-bottom: 3px;
  color: #748298;
  font-size: 12px;
}

.archive-detail-field strong {
  overflow-wrap: anywhere;
  font-size: 14px;
}

.archive-detail-item {
  padding: 18px 0;
  border-bottom: 1px solid #e5eaf1;
}

.archive-detail-item:first-of-type {
  padding-top: 0;
}

.archive-detail-item:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.archive-detail-item-heading {
  display: flex;
  justify-content: space-between;
  gap: 20px;
}

.archive-detail-item-heading h4 {
  margin: 0;
  font-size: 15px;
}

.archive-detail-item-total {
  flex: none;
  font-weight: 800;
}

.archive-detail-description {
  margin-top: 8px;
  color: #68778d;
  font-size: 13px;
  line-height: 1.5;
}

.archive-detail-meta {
  margin-top: 8px;
  color: #536279;
  font-size: 13px;
}

.archive-photo-grid {
  display: grid;
  grid-template-columns: repeat(
    auto-fill,
    minmax(130px, 170px)
  );
  gap: 12px;
  margin-top: 14px;
}

.archive-photo {
  overflow: hidden;
  aspect-ratio: 1 / 1;
  border: 1px solid #dce3ed;
  border-radius: 11px;
  background: #eef2f7;
}

.archive-photo img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.archive-detail-total {
  margin-top: 18px;
  padding: 20px 22px;
  border-radius: 14px;
  background: #17233d;
  color: #fff;
  text-align: right;
}

.archive-detail-total span {
  display: block;
  margin-bottom: 3px;
  font-size: 12px;
  opacity: .75;
}

.archive-detail-total strong {
  font-size: 24px;
}

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

.archive-details-button {
  min-height: 39px;
  padding: 0 14px;
  border: 1px solid #cbd6e5;
  border-radius: 9px;
  background: #fff;
  color: #17233d;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
}

.archive-details-button:hover {
  border-color: #1769ff;
  color: #1769ff;
}

@media (max-width: 700px) {
  .archive-detail-header {
    display: block;
  }

  .archive-detail-header .archive-pdf-button {
    width: 100%;
    margin-top: 16px;
  }

  .archive-detail-data {
    grid-template-columns: 1fr;
  }

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

  .archive-actions {
    justify-content: stretch;
    margin-top: 14px;
  }

  .archive-actions > * {
    flex: 1;
  }
}


/* Kuitin mitätöinti */

.void-receipt-button {
  min-height: 39px;
  padding: 0 14px;
  border: 1px solid #c94355;
  border-radius: 9px;
  background: #fff;
  color: #a72539;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
}

.void-receipt-button:hover {
  background: #fff3f5;
}

.void-receipt-notice {
  margin-top: 18px;
  padding: 16px 18px;
  border: 1px solid #e5b2ba;
  border-radius: 12px;
  background: #fff4f5;
  color: #791f2d;
}

.void-receipt-notice strong {
  display: block;
  margin-bottom: 5px;
}

.void-receipt-notice p {
  margin: 0;
  line-height: 1.5;
}

.archive-status.voided {
  background: #fff0f2;
  color: #98283a;
}


/* Kuittien korjausketju */

.receipt-relation-box {
  margin-top: 18px;
  padding: 16px 18px;
  border: 1px solid #b9cce9;
  border-radius: 12px;
  background: #f2f7ff;
}

.receipt-relation-box strong {
  display: block;
  margin-bottom: 5px;
  color: #17233d;
}

.receipt-relation-box p {
  margin: 0;
  color: #52627a;
  line-height: 1.5;
}

.receipt-relation-link {
  margin-top: 10px;
  padding: 0;
  border: 0;
  background: transparent;
  color: #1769ff;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.receipt-relation-link:hover {
  text-decoration: underline;
}


/* ==========================================================
   Raportointi
   ========================================================== */

.reporting-page {
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
  padding: 36px 0 70px;
}

.reporting-heading {
  margin-bottom: 24px;
}

.reporting-heading h1 {
  margin: 5px 0 6px;
}

.reporting-heading p {
  margin: 0;
  color: #68778d;
}

.reporting-toolbar {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  margin-bottom: 20px;
  padding: 18px;
  border: 1px solid #dbe3ee;
  border-radius: 14px;
  background: #f8fafc;
}

.report-date-field {
  min-width: 210px;
}

.report-date-field label {
  display: block;
  margin-bottom: 6px;
  font-size: 13px;
  font-weight: 800;
}

.report-date-field input {
  width: 100%;
  min-height: 43px;
}

.reporting-download {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 43px;
  text-decoration: none;
}

.reporting-download.disabled {
  opacity: .45;
  pointer-events: none;
}

.report-summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin: 20px 0;
}

.report-summary-card {
  padding: 20px;
  border: 1px solid #dbe3ee;
  border-radius: 14px;
  background: #fff;
}

.report-summary-card span {
  display: block;
  margin-bottom: 7px;
  color: #748298;
  font-size: 12px;
}

.report-summary-card strong {
  font-size: 24px;
  color: #17233d;
}

.report-table-wrap {
  overflow: hidden;
  border: 1px solid #dbe3ee;
  border-radius: 14px;
  background: #fff;
}

.report-table-head,
.report-row {
  display: grid;
  grid-template-columns:
    minmax(105px, .8fr)
    minmax(180px, 1.5fr)
    minmax(80px, .55fr)
    minmax(110px, .85fr)
    minmax(100px, .8fr)
    minmax(90px, .7fr);
  gap: 16px;
  align-items: center;
}

.report-table-head {
  padding: 13px 18px;
  background: #f4f7fb;
  color: #67768c;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .03em;
}

.report-row {
  padding: 17px 18px;
  border-top: 1px solid #e5eaf1;
  font-size: 13px;
}

.report-row:hover {
  background: #fafbfd;
}

.report-receipt-number {
  font-weight: 800;
}

.report-seller {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 700;
}

.report-amount {
  font-weight: 800;
}

.report-status {
  display: inline-flex;
  width: fit-content;
  padding: 4px 8px;
  border-radius: 999px;
  background: #eaf8ee;
  color: #23683b;
  font-size: 11px;
  font-weight: 800;
}

.report-status.voided {
  background: #fff0f2;
  color: #98283a;
}

.report-status.replaced {
  background: #f1f3f6;
  color: #59677c;
}

.report-empty {
  padding: 38px 20px;
  color: #748298;
  text-align: center;
}

@media (max-width: 900px) {
  .report-summary-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .report-table-head {
    display: none;
  }

  .report-row {
    grid-template-columns: 1fr auto;
    gap: 8px 16px;
  }

  .report-row > * {
    grid-column: 1;
  }

  .report-row .report-status {
    grid-column: 2;
    grid-row: 1;
  }
}

@media (max-width: 650px) {
  .reporting-page {
    width: min(100% - 28px, 1180px);
  }

  .reporting-toolbar {
    display: grid;
    grid-template-columns: 1fr;
  }

  .report-date-field {
    min-width: 0;
  }

  .reporting-toolbar > * {
    width: 100%;
  }

  .report-summary-grid {
    grid-template-columns: 1fr 1fr;
  }
}


/* ==========================================================
   Yrityksen asetukset
   ========================================================== */

.settings-page {
  width: min(1000px, calc(100% - 40px));
  margin: 0 auto;
  padding: 36px 0 70px;
}

.settings-heading {
  margin-bottom: 24px;
}

.settings-heading h1 {
  margin: 5px 0 6px;
}

.settings-heading p {
  margin: 0;
  color: #68778d;
}

.settings-card {
  margin-bottom: 18px;
  padding: 24px;
  border: 1px solid #dbe3ee;
  border-radius: 14px;
  background: #fff;
}

.settings-card h2 {
  margin: 0 0 20px;
  font-size: 18px;
}

.settings-grid {
  display: grid;
  grid-template-columns:
    repeat(2, minmax(0, 1fr));
  gap: 18px 20px;
}

.settings-grid .field-wide {
  grid-column: 1 / -1;
}

.settings-grid small {
  display: block;
  margin-top: 6px;
  color: #78869a;
  font-size: 11px;
}

.settings-readonly {
  min-height: 44px;
  display: flex;
  align-items: center;
  padding: 0 13px;
  border: 1px solid #e0e6ef;
  border-radius: 9px;
  background: #f5f7fa;
  color: #536279;
  font-weight: 700;
}

#settings-brand-color {
  width: 100%;
  min-height: 44px;
  padding: 4px;
  cursor: pointer;
}

.settings-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 20px;
}

@media (max-width: 650px) {
  .settings-page {
    width: min(100% - 28px, 1000px);
  }

  .settings-grid {
    grid-template-columns: 1fr;
  }

  .settings-grid .field-wide {
    grid-column: auto;
  }

  .settings-actions .primary-button {
    width: 100%;
  }
}


/* Yrityksen logo */

.settings-logo-help {
  margin: -10px 0 18px;
  color: #68778d;
  font-size: 13px;
}

.settings-logo-area {
  display: flex;
  align-items: center;
  gap: 24px;
}

.settings-logo-preview {
  width: 260px;
  min-height: 130px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  border: 1px solid #dbe3ee;
  border-radius: 12px;
  background: #f8fafc;
}

.settings-logo-preview img {
  display: block;
  max-width: 100%;
  max-height: 100px;
  object-fit: contain;
}

.settings-logo-empty {
  color: #8591a3;
  font-size: 13px;
}

.settings-logo-controls {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
}

.settings-logo-upload {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.settings-logo-controls small {
  color: #78869a;
  font-size: 11px;
}

@media (max-width: 650px) {
  .settings-logo-area {
    display: block;
  }

  .settings-logo-preview {
    width: 100%;
    margin-bottom: 16px;
  }
}


/* ==========================================================
   Käyttäjät ja laitteet
   ========================================================== */

.settings-section-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 18px;
}

.settings-section-heading h2 {
  margin: 0 0 5px;
}

.settings-section-heading p {
  margin: 0;
  color: #68778d;
  font-size: 13px;
}

.settings-users-list,
.settings-devices-list {
  overflow: hidden;
  border: 1px solid #dbe3ee;
  border-radius: 12px;
  background: #fff;
}

.settings-user-row,
.settings-device-row {
  display: grid;
  align-items: center;
  gap: 14px;
  padding: 16px;
  border-bottom: 1px solid #e5eaf1;
}

.settings-user-row {
  grid-template-columns:
    minmax(180px, 1.6fr)
    minmax(135px, .8fr)
    minmax(135px, .8fr)
    auto;
}

.settings-device-row {
  grid-template-columns:
    minmax(180px, 1.4fr)
    minmax(120px, .7fr)
    minmax(150px, 1fr)
    auto;
}

.settings-user-row:last-child,
.settings-device-row:last-child {
  border-bottom: 0;
}

.settings-user-identity strong,
.settings-device-name strong {
  display: block;
  color: #17233d;
}

.settings-user-identity span,
.settings-device-name span,
.settings-device-date {
  display: block;
  margin-top: 3px;
  color: #748298;
  font-size: 12px;
}

.settings-current-user {
  display: inline-flex;
  margin-left: 7px;
  padding: 2px 7px;
  border-radius: 999px;
  background: #eaf2ff;
  color: #1769ff;
  font-size: 10px;
  font-weight: 800;
}

.settings-user-row select {
  width: 100%;
}

.settings-user-save {
  min-height: 39px;
  padding: 0 13px;
  border: 1px solid #cbd6e5;
  border-radius: 9px;
  background: #fff;
  color: #17233d;
  font-weight: 800;
  cursor: pointer;
}

.settings-user-save:hover {
  border-color: #1769ff;
  color: #1769ff;
}

.settings-user-save:disabled {
  opacity: .45;
  cursor: default;
}

.settings-user-create {
  margin-top: 22px;
  padding-top: 22px;
  border-top: 1px solid #e0e6ef;
}

.settings-user-create h3 {
  margin: 0 0 17px;
  font-size: 16px;
}

.settings-user-create > .primary-button {
  margin-top: 18px;
}

.settings-list-empty {
  padding: 28px 18px;
  color: #7a879a;
  text-align: center;
}

.settings-archived-details {
  margin-top: 14px;
  border: 1px solid #dbe3ee;
  border-radius: 12px;
  background: #f8fafc;
}

.settings-archived-details > summary {
  padding: 14px 16px;
  color: #45566f;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  user-select: none;
}

.settings-archived-details[open] > summary {
  border-bottom: 1px solid #dbe3ee;
}

.settings-archived-details > .settings-users-list,
.settings-archived-details > .settings-devices-list {
  border: 0;
  border-radius: 0 0 12px 12px;
}

.device-license-counter {
  flex: none;
  padding: 10px 14px;
  border-radius: 10px;
  background: #f1f6ff;
  text-align: right;
}

.device-license-counter strong {
  display: block;
  color: #1769ff;
  font-size: 18px;
}

.device-license-counter span {
  color: #718096;
  font-size: 11px;
}

.device-status {
  display: inline-flex;
  width: fit-content;
  padding: 4px 8px;
  border-radius: 999px;
  background: #eaf8ee;
  color: #23683b;
  font-size: 11px;
  font-weight: 800;
}

.device-status.revoked {
  background: #f1f3f6;
  color: #68778d;
}

.device-revoke-button {
  min-height: 38px;
  padding: 0 12px;
  border: 1px solid #d59aa4;
  border-radius: 9px;
  background: #fff;
  color: #a72539;
  font-weight: 800;
  cursor: pointer;
}

.device-revoke-button:hover {
  background: #fff3f5;
}

.settings-device-note {
  margin: 13px 0 0;
  color: #748298;
  font-size: 11px;
}

@media (max-width: 800px) {
  .settings-user-row,
  .settings-device-row {
    grid-template-columns: 1fr;
  }

  .settings-section-heading {
    display: block;
  }

  .device-license-counter {
    width: fit-content;
    margin-top: 12px;
    text-align: left;
  }
}


/* Käyttäjän toimintopainikkeet */

.settings-user-actions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.settings-user-cancel {
  min-height: 39px;
  padding: 0 13px;
  border: 1px solid #d59aa4;
  border-radius: 9px;
  background: #fff;
  color: #a72539;
  font-weight: 800;
  cursor: pointer;
}

.settings-user-cancel:hover {
  background: #fff3f5;
}

.settings-user-cancel:disabled {
  opacity: .55;
  cursor: default;
}

@media (max-width: 800px) {
  .settings-user-actions {
    justify-content: flex-start;
  }
}


.settings-user-delete {
  min-height: 39px;
  padding: 0 13px;
  border: 1px solid #c94b5e;
  border-radius: 9px;
  background: #fff;
  color: #a71930;
  font-weight: 800;
  cursor: pointer;
}

.settings-user-delete:hover {
  background: #fff0f2;
}

.settings-user-delete:disabled {
  opacity: .55;
  cursor: default;
}


/* ==========================================================
   Unohtuiko salasana
   ========================================================== */

.forgot-password-toggle {
  display: block;
  margin: 13px auto 3px;
  padding: 7px 10px;
  border: 0;
  background: transparent;
  color: #1769ff;
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.forgot-password-toggle:hover {
  text-decoration: underline;
}

.forgot-password-panel {
  margin-top: 15px;
  padding: 17px;
  border: 1px solid #dbe4ef;
  border-radius: 12px;
  background: #f7f9fc;
}

.forgot-password-panel p {
  margin: 0 0 14px;
  color: #65758b;
  font-size: 13px;
  line-height: 1.5;
}

.forgot-password-panel label {
  display: block;
  margin-bottom: 6px;
}

.forgot-password-panel input {
  width: 100%;
  margin-bottom: 12px;
}

.forgot-password-panel .secondary-button {
  width: 100%;
}


/* ==========================================================
   Yrityksen logo yläpalkissa
   ========================================================== */

.topbar-company-logo {
  display: block;
  width: auto;
  height: 44px;
  max-width: 150px;
  object-fit: contain;
  object-position: left center;
  flex-shrink: 0;
}

.topbar-company-logo[hidden] {
  display: none !important;
}

@media (max-width: 720px) {
  .topbar-company-logo {
    height: 38px;
    max-width: 110px;
  }
}

/* ==========================================================
   SaaS-käyttöönotto / billing_required
   ========================================================== */

.billing-required-view[hidden] {
  display: none;
}

.billing-required-view {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 40px 18px;
}

.billing-required-card {
  width: min(100%, 760px);
  padding: clamp(28px, 5vw, 46px);
  background: #fff;
  border: 1px solid #e2e8f2;
  border-radius: 24px;
  box-shadow: 0 24px 70px rgba(24,42,76,.12);
}

.billing-required-heading {
  margin: 34px 0 26px;
}

.billing-required-heading h1 {
  margin: 7px 0 10px;
  font-size: clamp(28px, 5vw, 40px);
  line-height: 1.08;
}

.billing-required-heading p {
  max-width: 650px;
  margin: 0;
  color: #6c7890;
  line-height: 1.65;
}

.billing-account {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 26px 0;
}

.billing-account > div {
  display: grid;
  gap: 5px;
  padding: 16px 18px;
  background: #f7f9fc;
  border: 1px solid #e7ebf2;
  border-radius: 14px;
}

.billing-account span {
  color: #78859a;
  font-size: 12px;
}

.billing-account strong {
  overflow-wrap: anywhere;
}

.onboarding-steps {
  display: grid;
  gap: 12px;
  margin: 30px 0;
  padding: 0;
  list-style: none;
}

.onboarding-steps li {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 15px 16px;
  border: 1px solid #e4e9f1;
  border-radius: 14px;
}

.onboarding-steps li > div {
  display: grid;
  gap: 3px;
}

.onboarding-steps li > div span {
  color: #78859a;
  font-size: 13px;
}

.step-number {
  width: 30px;
  height: 30px;
  flex: 0 0 30px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #edf2fa;
  color: #53627a;
  font-size: 13px;
  font-weight: 800;
}

.onboarding-steps li.complete {
  border-color: #cfe0ff;
  background: #f6f9ff;
}

.onboarding-steps li.complete .step-number {
  background: #1769ff;
  color: #fff;
}

.billing-status {
  display: grid;
  gap: 5px;
  padding: 17px 18px;
  background: #f7f9fc;
  border: 1px solid #e4e9f1;
  border-radius: 14px;
}

.billing-status span {
  color: #6c7890;
  font-size: 13px;
  line-height: 1.5;
}

.billing-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 24px;
}

@media (max-width: 620px) {
  .billing-required-view {
    padding: 24px 14px;
  }

  .billing-required-card {
    padding: 28px 20px;
    border-radius: 20px;
  }

  .billing-account {
    grid-template-columns: 1fr;
  }

  .billing-actions {
    justify-content: stretch;
  }

  .billing-actions button {
    width: 100%;
  }
}

/* ==========================================================
   SaaS / read_only
   ========================================================== */

.read-only-banner[hidden] {
  display: none;
}

.read-only-banner {
  margin-bottom: 26px;
  padding: 16px 18px;
  background: #fff8e8;
  border: 1px solid #ead8a7;
  border-radius: 14px;
}

.read-only-banner > div {
  display: grid;
  gap: 5px;
}

.read-only-banner strong {
  color: #493b14;
}

.read-only-banner span {
  color: #746434;
  font-size: 14px;
  line-height: 1.5;
}

@media (max-width: 620px) {
  .read-only-banner {
    padding: 15px 16px;
  }
}


/* Read only -tilan status */
.status-pill.read-only {
  background: #fff8e8;
  color: #746434;
  border: 1px solid #ead8a7;
}
