:root {
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color-scheme: light;
  --ink: #172639;
  --muted: #536578;
  --navy: #070c14;
  --panel-navy: #111d2b;
  --line: #d8e2e8;
  --paper: #f4f7f9;
  --white: #fff;
  --link: #1b5c81;
  --accent: #a6dbef;
  --focus: #0f76aa;
  --spectrum: linear-gradient(90deg, #61d4f3, #7d88eb 34%, #cd6dbe 62%, #ffa95a 84%, #f6ce7a);
  font-size: 16px;
  line-height: 1.5;
  background: var(--paper);
  color: var(--ink);
}

* { box-sizing: border-box; }
body { margin: 0; }
a { color: var(--link); text-underline-offset: .22em; }
button, input { font: inherit; }
button { cursor: pointer; }
img { display: block; max-width: 100%; height: auto; }
h1, h2, p { margin: 0; }
h1, h2 { line-height: 1.15; }
h1 { font-size: 2.2rem; letter-spacing: -.03em; }
h2 { font-size: 1.28rem; letter-spacing: -.018em; }
::selection { color: var(--navy); background: #c1e7f7; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
.site-header :focus-visible, .account-hero :focus-visible { outline-color: #a6dbef; }
.wrap { width: min(100% - 64px, 1100px); margin-inline: auto; }

.skip-link {
  position: absolute;
  left: 16px;
  top: 8px;
  z-index: 1;
  padding: 8px 12px;
  background: var(--white);
  transform: translateY(calc(-100% - 16px));
}
.skip-link:focus { transform: none; }

.site-header {
  background: var(--navy);
  color: #f4f8fb;
  border-bottom: 3px solid transparent;
  border-image: var(--spectrum) 1;
}
.header-inner {
  min-height: 70px;
  display: flex;
  gap: 24px;
  align-items: center;
  justify-content: space-between;
}
.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  color: #f4f8fb;
  text-decoration: none;
  font-weight: 650;
}
.brand img { width: 116px; }
.brand span { border-left: 1px solid #475b70; padding-left: 14px; }
.header-actions { display: flex; gap: 18px; align-items: center; }
.preview-label, .staff-label { color: #b7c7d6; font-size: .82rem; }
.staff-label { color: var(--accent); font-weight: 630; text-align: right; }
.quiet-button, .switch-account {
  display: inline-flex;
  align-items: center;
  min-height: 42px;
  padding: 8px 14px;
  border: 1px solid #54677a;
  border-radius: 8px;
  color: #f4f8fb;
  background: transparent;
  font-weight: 600;
  font-size: .88rem;
  text-decoration: none;
}
.quiet-button:hover, .switch-account:hover { background: #243a50; border-color: #839bb0; }

#main { padding-block: 38px 44px; min-height: 65vh; }
.account-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px 32px;
  padding: 32px 35px;
  background: var(--panel-navy);
  color: #f5f9fc;
  border-radius: 14px;
}
.hero-body { min-width: 0; }
.hero-body h1 { margin: 5px 0 8px; overflow-wrap: anywhere; }
.hero-body p { color: #bccddd; }
.account-ref { display: block; color: var(--accent); font-size: .88rem; font-weight: 650; }
.switch-account { flex: none; }

.history { margin-top: 33px; }
.section-heading {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 24px;
  margin-bottom: 15px;
}
.period-filter { display: flex; flex-wrap: wrap; gap: 6px; }
.period-filter a {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 6px 12px;
  border: 1px solid transparent;
  border-radius: 8px;
  font-size: .88rem;
  font-weight: 630;
  text-decoration: none;
}
.period-filter a:hover { color: var(--ink); background: #e8f1f6; }
.period-filter a[aria-current] { color: var(--ink); background: #e3edf3; border-color: #c9d9e3; }

.invoice-list { border: 1px solid var(--line); border-radius: 14px; background: var(--white); }
.invoice-list ul { margin: 0; padding: 0; list-style: none; }
.invoice-columns, .invoice-row {
  display: grid;
  grid-template-columns: minmax(158px, 1.3fr) minmax(145px, 1fr) minmax(66px, .5fr) minmax(90px, .6fr) minmax(157px, 1fr);
  gap: 14px;
  align-items: center;
  padding-inline: 20px;
}
.invoice-columns {
  padding-block: 13px;
  border-radius: 13px 13px 0 0;
  background: #edf3f6;
  color: #3b5369;
  font-size: .84rem;
  font-weight: 650;
}
.invoice-row { padding-block: 18px; border-top: 1px solid var(--line); }
.invoice-number a { display: inline-block; font-weight: 700; overflow-wrap: anywhere; }
.issued-date { display: block; color: var(--muted); font-size: .82rem; }
.service-period { font-size: .92rem; }
.phone-label { display: none; }
.invoice-status {
  display: inline-block;
  padding: 3px 8px;
  background: #e9f2ef;
  color: #295e4f;
  border-radius: 5px;
  font-size: .82rem;
  font-weight: 650;
}
.invoice-columns > :nth-child(4), .invoice-amount { text-align: right; }
.invoice-amount { font-weight: 720; font-variant-numeric: tabular-nums; white-space: nowrap; }
.invoice-columns > :last-child, .invoice-row .file-links { justify-self: end; }
.file-links { display: flex; flex-wrap: wrap; gap: 8px; }
.file-link, .primary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 8px 12px;
  border: 1px solid #cddce5;
  border-radius: 8px;
  color: var(--link);
  background: var(--white);
  font-size: .86rem;
  font-weight: 650;
  text-decoration: none;
}
.file-link:hover { color: #143b57; background: #edf6fa; border-color: #94afc0; }
.file-link:active, .primary-button:active { transform: translateY(1px); }

.breadcrumbs { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; font-size: .92rem; color: var(--muted); }
.hero-total {
  flex: none;
  display: grid;
  padding-left: 28px;
  border-left: 1px solid #52677b;
  font-size: .84rem;
  color: #bccddd;
  text-align: right;
}
.hero-total strong { font-size: 1.65rem; font-variant-numeric: tabular-nums; color: #f4f8fb; }
.detail-layout { display: grid; grid-template-columns: 1.5fr 1fr; gap: 20px; margin-top: 22px; }
.detail-panel, .access-panel { border: 1px solid var(--line); border-radius: 14px; padding: 23px; background: var(--white); }
.detail-panel h2 { margin-bottom: 13px; }
.detail-panel p { margin-bottom: 14px; color: var(--muted); }
.detail-lines { margin: 0; }
.detail-lines div {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}
.detail-lines div:last-child { padding-bottom: 0; border-bottom: 0; }
.detail-lines dt { color: var(--muted); }
.detail-lines dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; }

.access-layout { display: grid; grid-template-columns: 1fr minmax(350px, 455px); gap: 60px; align-items: start; padding-block: 28px; }
.access-intro { padding-block: 38px; }
.access-intro p { margin-top: 14px; max-width: 42ch; color: var(--muted); font-size: 1.04rem; }
.access-panel { padding: 29px; }
.access-panel form { display: grid; gap: 8px; }
.access-panel label { font-size: .9rem; font-weight: 670; }
.access-panel input {
  padding: 10px 11px;
  width: 100%;
  min-height: 44px;
  border: 1px solid #9bafbe;
  border-radius: 8px;
  background: var(--white);
  color: var(--ink);
  caret-color: var(--link);
}
.access-panel input + label { margin-top: 7px; }
.primary-button { background: #173d58; color: #fff; border-color: #173d58; font-size: .94rem; padding-inline: 17px; }
.primary-button:hover { background: #245779; border-color: #245779; }
.access-panel .primary-button { margin-top: 9px; }
.demo-details { margin-top: 22px; padding-top: 16px; border-top: 1px solid var(--line); font-size: .88rem; }
.demo-details summary { font-weight: 660; color: var(--link); cursor: pointer; }
.demo-details p { margin-top: 7px; color: var(--muted); }
.demo-credentials { margin: 10px 0 0; }
.demo-credentials div { display: flex; gap: 10px; justify-content: space-between; align-items: start; padding: 4px 0; }
.demo-credentials dt { overflow-wrap: anywhere; }
.demo-credentials dd { margin: 0; font-variant-numeric: tabular-nums; font-weight: 670; }
.staff-credential dt span { display: block; color: var(--muted); font-size: .8rem; }
.error { margin-bottom: 16px; padding: 10px 12px; border: 1px solid #e7c5ca; border-radius: 8px; background: #fff4f5; color: #8b2b3c; }

.account-choices { margin: 22px 0 0; padding: 0; list-style: none; max-width: 640px; }
.account-choices li + li { margin-top: 10px; }
.account-choices a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 4px 18px;
  padding: 15px 18px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--white);
  text-decoration: none;
}
.account-choices a:hover { background: #eaf4f9; }
.account-choices span, .empty { color: var(--muted); font-size: .88rem; }
.empty { padding: 18px; background: var(--white); border: 1px solid var(--line); border-radius: 12px; }
.message-page p { margin: 12px 0 17px; color: var(--muted); }
.site-footer { padding-block: 17px 23px; border-top: 1px solid var(--line); color: var(--muted); font-size: .82rem; }
.site-footer span { margin: 0 5px; }

@media (max-width: 895px) {
  .wrap { width: min(100% - 40px, 1100px); }
  .invoice-columns { display: none; }
  .invoice-row { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) minmax(72px, .7fr); gap: 12px 18px; }
  .invoice-row:first-child { border-top: 0; }
  .invoice-number { grid-row: 1; grid-column: 1 / 3; }
  .invoice-amount { grid-row: 1; grid-column: 3; align-self: start; }
  .service-period { grid-row: 2; grid-column: 1; }
  .status-wrap { grid-row: 2; grid-column: 2; }
  .invoice-row .file-links { grid-row: 2; grid-column: 3; justify-self: end; justify-content: end; }
  .phone-label { display: block; color: var(--muted); font-size: .79rem; font-weight: 500; }
  .access-layout { gap: 38px; }
}
@media (max-width: 670px) {
  h1 { font-size: 1.8rem; }
  .wrap { width: calc(100% - 32px); }
  .header-inner { gap: 8px 10px; min-height: 62px; flex-wrap: wrap; padding-block: 8px; }
  .brand { gap: 9px; }
  .brand img { width: 105px; }
  .brand span { padding-left: 9px; }
  .header-actions { gap: 8px; }
  .preview-label { display: none; }
  #main { padding-block: 22px 34px; }
  .account-hero { padding: 23px; flex-wrap: wrap; align-items: start; }
  .history { margin-top: 25px; }
  .section-heading { gap: 8px; }
  .period-filter a { min-height: 36px; padding-inline: 8px; }
  .invoice-row { grid-template-columns: minmax(0, 1fr) minmax(76px, auto); padding: 15px 13px; gap: 11px; }
  .invoice-number { grid-column: 1; }
  .invoice-amount { grid-column: 2; }
  .status-wrap { grid-column: 2; justify-self: end; }
  .invoice-row .file-links { grid-column: 1 / -1; grid-row: 3; justify-self: start; }
  .file-link { min-height: 44px; }
  .access-layout, .detail-layout { grid-template-columns: 1fr; gap: 15px; }
  .access-layout { padding-block: 0; }
  .access-intro { padding: 12px 0 6px; }
  .access-panel, .detail-panel { padding: 19px; }
  .hero-total { padding: 11px 0 0; border-left: 0; border-top: 1px solid #52677b; text-align: left; width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  .file-link:active, .primary-button:active { transform: none; }
}
