:root {
  font-family:
    Inter,
    ui-sans-serif,
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  color: #18263e;
  background: #f7f8fc;
  font-synthesis: none;
}
* {
  box-sizing: border-box;
}
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
body {
  margin: 0;
  min-width: 320px;
  background:
    radial-gradient(circle at 72% -15%, #e8edff 0, transparent 30%), #f7f8fc;
}
.app-shell {
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr);
  min-height: 100vh;
}
.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 20px 0;
  border-right: 1px solid #e1e6ef;
  background: #fbfcff;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}
.sidebar nav {
  display: grid;
  gap: 8px;
}
.sidebar a {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  color: #71809a;
  text-decoration: none;
  font-size: 18px;
  transition: 0.18s ease;
}
.sidebar a:hover {
  background: #edf1f8;
  color: #213d70;
}
.sidebar .mark {
  font-size: 11px;
  font-weight: 900;
  color: #fff;
  background: #203c70;
  letter-spacing: -0.04em;
}
.sidebar .mark.mark-image { padding: 3px; background: #203c70; }
.sidebar .mark.mark-image img { width: 100%; height: 100%; object-fit: contain; }
.sidebar .nav-dashboard span,.sidebar .nav-archive span,.sidebar .nav-warranty span,.sidebar .nav-export span { width: 23px; height: 23px; display:block; background-image:url('/receipt-icons.png'); background-repeat:no-repeat; background-size:400% 200%; }
.sidebar .nav-dashboard span { background-position:0 0; }.sidebar .nav-archive span { background-position:66.667% 0; }.sidebar .nav-warranty span { background-position:66.667% 100%; }.sidebar .nav-export span { background-position:100% 100%; }
.sidebar .active {
  background: #e7edfc;
  color: #203c70;
}
.sidebar > a:last-child {
  margin-top: auto;
}
.archive-tools { display: grid; grid-template-columns: minmax(220px, 1fr) repeat(2, minmax(150px, 190px)); gap: 10px; margin: 18px 0; }
.archive-tools input, .archive-tools select { width: 100%; min-height: 44px; border: 1px solid #dbe3f0; border-radius: 10px; padding: 0 13px; background: #fff; color: #18263e; font: inherit; }
.archive-tools input:focus, .archive-tools select:focus { border-color: #1f5eea; outline: 3px solid #dce8ff; outline-offset: 1px; }
@media (max-width: 760px) { .archive-tools { grid-template-columns: 1fr; } }
.metrics .icon { width:42px; height:42px; display:block; background-image:url('/receipt-icons.png'); background-repeat:no-repeat; background-size:400% 200%; font-size:0; }
.metrics article:nth-child(1) .icon { background-position:0 0; }.metrics article:nth-child(2) .icon { background-position:100% 0; }.metrics article:nth-child(3) .icon { background-position:66.667% 100%; }.metrics article:nth-child(4) .icon { background-position:100% 0; }.metrics article:nth-child(5) .icon { background-position:33.333% 100%; }
main {
  width: min(1440px, 100%);
  margin: 0 auto;
  padding: 26px 44px 56px;
}
header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 44px;
}
.header-actions { display:flex; align-items:center; gap:12px; }
.button-quiet { min-height:42px; border:1px solid #d6deeb; background:#fff; color:#203c70; padding:0 13px; }
.crumb,
.kicker {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.13em;
  color: #62728b;
}
.crumb {
  text-decoration: none;
}
.crumb span {
  color: #ee7f42;
  margin: 0 8px;
}
.profile {
  min-height: 42px;
  padding: 0 14px;
  border: 1px solid #d6deeb;
  border-radius: 10px;
  color: #203252;
  background: #fff;
  font: 600 13px inherit;
  cursor: pointer;
}
.profile i {
  margin-left: 7px;
  color: #ee7f42;
  font-style: normal;
}
.app-status {
  height: 22px;
  margin: 12px 0 -1px;
  color: #62728b;
  font-size: 13px;
}
.app-status[data-tone="error"] {
  color: #bf3b4a;
}
.app-status[data-tone="success"] {
  color: #25834e;
}
.hero {
  display: grid;
  grid-template-columns: minmax(340px, 0.95fr) minmax(360px, 1.05fr);
  align-items: center;
  gap: 42px;
  min-height: 350px;
  border-bottom: 1px solid #e1e6ef;
}
.hero h1 {
  margin: 12px 0 18px;
  font-size: clamp(38px, 4.5vw, 62px);
  line-height: 0.98;
  letter-spacing: -0.055em;
}
.hero-copy > p:not(.kicker) {
  max-width: 460px;
  margin: 0;
  color: #65758d;
  font-size: 15px;
  line-height: 1.6;
}
.button {
  min-height: 46px;
  border: 0;
  border-radius: 10px;
  padding: 0 13px 0 17px;
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  font: 700 14px inherit;
  cursor: pointer;
  transition:
    transform 0.18s,
    background 0.18s;
  white-space: nowrap;
}
.button:hover:not(:disabled) {
  transform: translateY(-1px);
}
.button-primary,
.navy {
  color: #fff;
  background: #203c70;
}
.hero .button {
  margin-top: 23px;
}
.button b {
  display: grid;
  place-items: center;
  width: 23px;
  height: 23px;
  border-radius: 7px;
  background: #ffffff1c;
  font-size: 16px;
}
.hero-art {
  height: 252px;
  overflow: hidden;
  border-radius: 20px;
  box-shadow: 0 18px 42px #263a671c;
}
.hero-art img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.metrics {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 12px;
  padding: 22px 0;
}
.metrics article,
.lower article,
.article-grid div,
.faq details {
  background: #fff;
  border: 1px solid #e1e6ef;
  border-radius: 14px;
}
.metrics article {
  min-height: 128px;
  padding: 17px;
}
.metrics p {
  margin: 14px 0 7px;
  font-size: 12px;
  color: #687790;
}
.metrics strong {
  font-size: 20px;
  letter-spacing: -0.04em;
}
.metrics small {
  font-size: 12px;
  color: #71809a;
  font-weight: 500;
}
.return-metric small { display:block; min-height:14px; margin-top:4px; color:#bd6129; font-size:10px; }
.icon {
  font-size: 18px;
  color: #ee7f42;
}
.lower {
  margin-top: 14px;
}
.spend-bars { display:grid; gap:12px; margin-top:21px; }.spend-row { display:grid; grid-template-columns:150px minmax(80px,1fr) auto; align-items:center; gap:13px; font-size:13px; }.spend-row b { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }.spend-track { height:10px; overflow:hidden; border-radius:99px; background:#edf1f7; }.spend-track i { display:block; height:100%; border-radius:inherit; background:linear-gradient(90deg,#203c70,#ee7f42); }.spend-row span { color:#62728b; font-variant-numeric:tabular-nums; }
.lower article {
  padding: 22px;
}
.section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
}
.section-head h2,
.article h2,
.faq h2 {
  margin: 7px 0 0;
  font-size: 22px;
  letter-spacing: -0.035em;
}
.section-head > span {
  padding-top: 6px;
  font-size: 12px;
  color: #71809a;
}
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(215px, 1fr));
  gap: 14px;
  margin-top: 20px;
}
.receipt-card {
  position: relative;
  min-height: 166px;
  padding: 17px;
  border: 1px solid #e0e6f0;
  border-radius: 12px;
  background: linear-gradient(135deg, #fff, #fafbff);
  transition:
    box-shadow 0.18s,
    transform 0.18s;
}
.receipt-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 24px #253b6d12;
}
.receipt-open {
  width: 100%;
  min-height: 130px;
  padding: 0;
  border: 0;
  color: inherit;
  background: transparent;
  text-align: left;
  cursor: pointer;
}
.receipt-open:focus-visible {
  outline: 3px solid #ee7f42;
  outline-offset: 4px;
}
.barcode {
  color: #314f89;
  font-size: 20px;
}
.receipt-card h3 {
  margin: 12px 25px 5px 0;
  font-size: 14px;
  line-height: 1.35;
}
.receipt-card .meta {
  margin: 0 0 12px;
  color: #71809a;
  font-size: 12px;
}
.badge {
  display: inline-flex;
  border-radius: 999px;
  padding: 4px 8px;
  font-size: 11px;
  font-weight: 700;
}
.badge.active {
  background: #e7f6ec;
  color: #1d7a45;
}
.badge.expiring {
  background: #fff0df;
  color: #bd6129;
}
.badge.expired {
  background: #fee9ea;
  color: #b53c47;
}
.badge.none {
  background: #edf1f7;
  color: #60708b;
}
.del {
  position: absolute;
  right: 12px;
  top: 12px;
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #93a0b5;
  cursor: pointer;
}
.del:hover {
  background: #fff0f0;
  color: #b53c47;
}
.empty-line {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  min-height: 57px;
  margin: 20px 0 0;
  padding-top: 18px;
  border-top: 1px solid #e6eaf1;
  color: #71809a;
  font-size: 13px;
}
.empty-line span:first-child {
  color: #ee7f42;
}
.timeline-row {
  position: relative;
  display: flex;
  overflow-x: auto;
  margin-top: 26px;
  padding: 20px 0 6px;
}
.timeline-row:before {
  content: "";
  position: absolute;
  top: 5px;
  left: 0;
  right: 0;
  height: 1px;
  background: #dbe2ee;
}
.stop {
  position: relative;
  flex: 0 0 150px;
  padding-top: 13px;
  text-align: center;
}
.dot {
  width: 11px;
  height: 11px;
  margin: -18px auto 8px;
  border: 2px solid #fff;
  border-radius: 50%;
  background: #98a5b8;
}
.stop.active .dot {
  background: #2e9c5c;
}
.stop.expiring .dot {
  background: #ee7f42;
}
.stop.expired .dot {
  background: #c74b56;
}
.stop b {
  display: block;
  overflow: hidden;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.stop span {
  font-size: 11px;
  color: #71809a;
}
dialog {
  width: min(520px, calc(100% - 28px));
  max-height: min(760px, calc(100vh - 32px));
  margin: auto;
  padding: 27px;
  border: 1px solid #dce3ee;
  border-radius: 18px;
  color: #18263e;
  background: #fff;
  box-shadow: 0 24px 70px #17264138;
}
#auth {
  min-height: 422px;
}
#item {
  min-height: 680px;
}
dialog::backdrop {
  background: #17264166;
  backdrop-filter: blur(3px);
}
dialog[open] {
  animation: dialog-in 0.18s ease-out;
}
.dialog-heading {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}
.dialog-heading h2 {
  margin: 10px 0 24px;
  font-size: 28px;
  line-height: 1;
  letter-spacing: -0.045em;
}
.close {
  display: grid;
  place-items: center;
  flex: 0 0 34px;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 9px;
  background: #f2f5fa;
  color: #5f6f88;
  font-size: 24px;
  cursor: pointer;
}
.close:hover {
  background: #e8edf5;
}
form {
  display: grid;
  gap: 14px;
}
label {
  display: grid;
  gap: 7px;
  color: #61718b;
  font-size: 12px;
  font-weight: 650;
}
input,
select {
  width: 100%;
  min-height: 45px;
  padding: 0 12px;
  border: 1px solid #d5deeb;
  border-radius: 9px;
  color: #18263e;
  background: #fff;
  font: 400 14px inherit;
  transition:
    border-color 0.15s,
    box-shadow 0.15s;
}
input[type="file"] {
  padding: 10px;
}
select {
  appearance: none;
  background-image:
    linear-gradient(45deg, transparent 50%, #53647e 50%),
    linear-gradient(135deg, #53647e 50%, transparent 50%);
  background-position:
    calc(100% - 18px) 19px,
    calc(100% - 13px) 19px;
  background-size:
    5px 5px,
    5px 5px;
  background-repeat: no-repeat;
  padding-right: 38px;
  cursor: pointer;
}
.item-form {
  grid-template-columns: 1fr 1fr;
}
.item-form label:first-child,
.item-form label:nth-child(3),
.item-form label:nth-child(8),
.item-form label:nth-child(9),
.item-form button {
  grid-column: 1/-1;
}
.consent {
  display: flex;
  align-items: flex-start;
  gap: 9px;
}
.consent input {
  width: 16px;
  min-height: 16px;
  margin: 0;
}
.or {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 18px 0;
  color: #8b98ab;
  font-size: 12px;
  text-align: center;
}
.or:before,
.or:after {
  content: "";
  height: 1px;
  flex: 1;
  background: #e3e8f0;
}
.yandex {
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-height: 46px;
  padding: 0 14px;
  border: 1px solid #d5deeb;
  border-radius: 10px;
  color: #203252;
  text-decoration: none;
  font-size: 14px;
  font-weight: 650;
}
.form-message {
  min-height: 20px;
  margin: 14px 0 0;
  color: #bd6129;
  font-size: 13px;
}
.auth-note {
  min-height: 43px;
  margin: 0;
  color: #65758d;
  font-size: 13px;
  line-height: 1.55;
}
.auth-note strong {
  color: #203252;
}
.auth-actions,
.dialog-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}
.text-button {
  min-height: 42px;
  border: 0;
  color: #304f87;
  background: transparent;
  font: 700 13px inherit;
  cursor: pointer;
}
.button-secondary {
  color: #203252;
  background: #edf2fb;
}
.button-danger {
  color: #b53c47;
  background: #fff0f1;
}
.receipt-detail {
  min-height: 190px;
}
.receipt-photo,
.no-photo {
  display: grid;
  min-height: 150px;
  margin: 0 0 20px;
  place-items: center;
  overflow: hidden;
  border: 1px solid #e0e6f0;
  border-radius: 12px;
  color: #71809a;
  background: #f7f9fc;
  font-size: 13px;
}
.receipt-photo img {
  grid-area: 1 / 1;
  width: 100%;
  max-height: 390px;
  object-fit: contain;
}
.receipt-photo span {
  grid-area: 1 / 1;
}
.receipt-detail dl {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin: 0;
}
.receipt-detail dt {
  color: #71809a;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.receipt-detail dd {
  margin: 5px 0 0;
  color: #203252;
  font-size: 14px;
  font-weight: 650;
  overflow-wrap: anywhere;
}
.detail-notes {
  grid-column: 1 / -1;
}
.dialog-actions {
  justify-content: space-between;
  margin-top: 24px;
  padding-top: 18px;
  border-top: 1px solid #e3e8f0;
}
.account {
  position: relative;
}
.account-menu {
  position: absolute;
  z-index: 4;
  top: calc(100% + 8px);
  right: 0;
  min-width: 190px;
  padding: 6px;
  border: 1px solid #dce3ee;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 14px 34px #17264118;
}
.account-menu button {
  width: 100%;
  min-height: 38px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: #203252;
  text-align: left;
  cursor: pointer;
}
.account-menu button:hover {
  background: #f0f4fb;
}
button:disabled {
  cursor: wait;
  opacity: 0.8;
}
.is-loading {
  pointer-events: none;
}
.is-loading:after {
  content: "";
  width: 14px;
  height: 14px;
  margin-left: 2px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
.article {
  margin-top: 32px;
  padding-top: 28px;
  border-top: 1px solid #e1e6ef;
}
.article > p {
  max-width: 960px;
  margin: 14px 0 0;
  color: #65758d;
  font-size: 14px;
  line-height: 1.75;
}
.article-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
  margin-top: 20px;
}
.article-grid div {
  padding: 17px;
}
.article-grid h3 {
  margin: 0 0 7px;
  color: #29477f;
  font-size: 14px;
}
.article-grid p,
.faq p {
  margin: 0;
  color: #65758d;
  font-size: 13px;
  line-height: 1.65;
}
.faq {
  margin: 32px 0 24px;
}
.faq h2 {
  margin-bottom: 14px;
}
.faq details {
  margin-bottom: 10px;
  padding: 16px 18px;
}
.faq summary {
  color: #203252;
  cursor: pointer;
  font-size: 14px;
  font-weight: 700;
  list-style: none;
}
.faq summary::-webkit-details-marker {
  display: none;
}
.faq summary:after {
  content: "+";
  float: right;
  color: #ee7f42;
  font-size: 18px;
}
.faq details[open] summary:after {
  content: "−";
}
.faq p {
  margin-top: 12px;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
@keyframes dialog-in {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
summary:focus-visible {
  outline: 3px solid #ee7f42;
  outline-offset: 3px;
}
@media (max-width: 900px) {
  main {
    padding: 22px 28px 44px;
  }
  .hero {
    gap: 24px;
  }
  .metrics {
    grid-template-columns: repeat(3, 1fr);
  }
}
@media (max-width: 680px) {
  .app-shell {
    display: block;
  }
  .sidebar {
    display: none;
  }
  main {
    padding: 18px 16px 36px;
  }
  .hero {
    grid-template-columns: 1fr;
    gap: 20px;
    min-height: 0;
    padding: 40px 0 22px;
  }
  .hero-art {
    order: -1;
    height: 180px;
    border-radius: 16px;
  }
  .hero h1 {
    font-size: 42px;
  }
  .metrics {
    grid-template-columns: repeat(2, 1fr);
    gap: 9px;
  }
  .metrics article {
    min-height: 112px;
    padding: 14px;
  }
  .lower article {
    padding: 17px;
  }
  .section-head > span {
    display: none;
  }
  .article-grid {
    grid-template-columns: 1fr;
  }
  .item-form {
    grid-template-columns: 1fr;
  }
  .item-form label {
    grid-column: 1/-1 !important;
  }
  .receipt-detail dl {
    grid-template-columns: 1fr;
    gap: 13px;
  }
  dialog {
    padding: 21px;
  }
  .dialog-heading h2 {
    font-size: 25px;
  }
  .grid {
    grid-template-columns: 1fr;
  }
  .header-actions { gap:7px; }.button-quiet { min-height:40px; padding:0 9px; font-size:12px; }.spend-row { grid-template-columns:90px minmax(55px,1fr) auto; gap:8px; }
}
@media (max-width: 360px) {
  .metrics {
    grid-template-columns: 1fr;
  }
  .hero h1 {
    font-size: 36px;
  }
}
