:root {
  --bg-night: #0e1a24;
  --bg-deep: #13293d;
  --bg-soft: #edf4f8;
  --panel: rgba(255, 255, 255, 0.82);
  --panel-strong: rgba(255, 255, 255, 0.93);
  --border: rgba(19, 41, 61, 0.12);
  --text-main: #10212f;
  --text-soft: #4f6271;
  --brand: #be6a15;
  --brand-deep: #934c08;
  --ok: #1b7f5c;
  --warn: #b04b2f;
  --shadow: 0 20px 60px rgba(16, 33, 47, 0.12);
}

html {
  font-size: 16px;
  min-height: 100%;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--text-main);
  font-family: Arial, "Helvetica Neue", Helvetica, sans-serif;
  background:
    radial-gradient(circle at top left, rgba(190, 106, 21, 0.18), transparent 30%),
    radial-gradient(circle at top right, rgba(27, 127, 92, 0.18), transparent 26%),
    linear-gradient(180deg, #f8fbfc 0%, var(--bg-soft) 100%);
}

a {
  color: inherit;
}

.site-header {
  padding: 1.5rem 1.5rem 0;
}

.site-nav,
.page-shell {
  width: min(1120px, calc(100% - 2rem));
  margin: 0 auto;
}

.site-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.25rem;
  border: 1px solid rgba(255, 255, 255, 0.45);
  border-radius: 24px;
  background: rgba(14, 26, 36, 0.82);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.site-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-decoration: none;
  color: #f8fbfc;
}

.site-brand__text-wrap {
  display: inline-flex;
  flex-direction: column;
  line-height: 1.02;
}

.site-brand__version {
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(248, 251, 252, 0.62);
}

.site-brand__mark {
  display: inline-grid;
  place-items: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 0.9rem;
  background: linear-gradient(135deg, #f0aa61 0%, var(--brand) 100%);
  color: #21150a;
}

.site-nav__links {
  display: flex;
  gap: 1rem;
}

.site-nav__auth {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.site-nav__user {
  color: rgba(248, 251, 252, 0.84);
  font-size: 0.92rem;
}

.project-switcher {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.45rem 0.7rem;
  border-radius: 999px;
  background: rgba(248, 251, 252, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.16);
}

.project-switcher__label {
  margin: 0;
  color: rgba(248, 251, 252, 0.78);
  font-size: 0.82rem;
}

.project-switcher__select {
  min-width: 12rem;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 999px;
  padding: 0.35rem 0.8rem;
  background: rgba(14, 26, 36, 0.65);
  color: #f8fbfc;
}

.project-switcher__select:focus {
  outline: 2px solid rgba(255, 255, 255, 0.3);
  outline-offset: 2px;
}

.site-nav__login,
.site-nav__logout {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.4rem;
  padding: 0.55rem 0.9rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(248, 251, 252, 0.08);
  color: #f8fbfc;
  text-decoration: none;
}

.site-nav__logout {
  cursor: pointer;
}

.site-nav__links a {
  color: rgba(248, 251, 252, 0.84);
  text-decoration: none;
}

.site-nav__links a:hover {
  color: #ffffff;
}

.page-shell {
  padding: 2rem 0 4rem;
}

.hero-panel {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(280px, 0.9fr);
  gap: 1.5rem;
  align-items: stretch;
  margin-bottom: 1.5rem;
}

.hero-copy,
.glass-card,
.status-card,
.project-card {
  border: 1px solid var(--border);
  border-radius: 28px;
  box-shadow: var(--shadow);
}

.hero-copy {
  padding: 2.25rem;
  background: linear-gradient(135deg, rgba(19, 41, 61, 0.96), rgba(15, 71, 99, 0.9));
  color: #f8fbfc;
}

.hero-copy h1,
.simple-card h1 {
  margin: 0 0 0.9rem;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2.1rem, 4vw, 3.65rem);
  line-height: 1.02;
}

.lead {
  max-width: 48rem;
  margin: 0;
  color: rgba(248, 251, 252, 0.82);
  font-size: 1.05rem;
}

.eyebrow {
  display: inline-block;
  margin-bottom: 0.85rem;
  color: var(--brand);
  font-size: 0.78rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.status-card {
  padding: 1.5rem;
  color: #f8fbfc;
}

.status-card--ok {
  background: linear-gradient(180deg, #1b7f5c, #135641);
}

.status-card--warn {
  background: linear-gradient(180deg, #b04b2f, #84311c);
}

.status-card__label {
  opacity: 0.78;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.72rem;
}

.status-card__title {
  margin: 0.8rem 0 1rem;
  font-size: 1.9rem;
  font-weight: 700;
}

.status-card__meta + .status-card__meta {
  margin-top: 0.4rem;
}

.status-card__meta--error {
  color: #ffd7c8;
  font-weight: 700;
}

.info-grid,
.project-grid {
  display: grid;
  gap: 1.25rem;
}

.info-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-bottom: 2rem;
}

.glass-card,
.project-card {
  padding: 1.5rem;
  background: var(--panel);
  backdrop-filter: blur(18px);
}

.glass-card h2,
.projects-section h2,
.project-card h3 {
  margin: 0 0 0.9rem;
  font-family: Georgia, "Times New Roman", serif;
}

.info-list,
.project-meta {
  margin: 0;
}

.info-list div,
.project-meta div {
  padding: 0.8rem 0;
  border-top: 1px solid rgba(19, 41, 61, 0.09);
}

.info-list div:first-child,
.project-meta div:first-child {
  padding-top: 0;
  border-top: 0;
}

.info-list dt,
.project-meta dt {
  margin-bottom: 0.2rem;
  color: var(--text-soft);
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.info-list dd,
.project-meta dd {
  margin: 0;
  font-weight: 600;
}

.callout-text,
.project-note {
  color: var(--text-soft);
}

.section-head {
  margin-bottom: 1rem;
}

.project-grid {
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.project-card {
  background: var(--panel-strong);
}

.project-card__head {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  align-items: flex-start;
}

.project-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
}

.project-badge--active {
  background: rgba(27, 127, 92, 0.12);
  color: var(--ok);
}

.project-badge--inactive {
  background: rgba(176, 75, 47, 0.1);
  color: var(--warn);
}

.project-badge--warn {
  background: rgba(190, 106, 21, 0.14);
  color: var(--brand-deep);
}

.project-key {
  margin: 0 0 0.6rem;
  color: var(--brand-deep);
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.simple-card {
  max-width: 760px;
}

.site-footer {
  padding: 0 0 2rem;
  color: var(--text-soft);
}

.site-footer a {
  color: inherit;
}

.statement-form {
  display: grid;
  gap: 1rem;
}

.statement-form label {
  display: grid;
  gap: 0.35rem;
  font-weight: 600;
}

.radio-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
}

.radio-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.65rem 0.9rem;
  border: 1px solid rgba(38, 63, 89, 0.18);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
}

.radio-pill input {
  margin: 0;
}

.statement-textarea {
  min-height: 12rem;
  resize: vertical;
  font-family: Consolas, "Courier New", monospace;
}

.automation-card .form-label {
  display: block;
  margin-top: 0.9rem;
}

.automation-card .form-control,
.automation-card .form-select {
  margin-top: 0.2rem;
}

.statement-toggle {
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 0.8rem;
}

.statement-toggle input[type="checkbox"] {
  width: 1.15rem;
  height: 1.15rem;
}

.statement-mode-group {
  display: grid;
  gap: 0.75rem;
  margin: 0;
  padding: 0;
  border: 0;
}

.statement-mode-group legend {
  margin-bottom: 0.2rem;
  font-weight: 700;
}

.statement-radio {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.8rem;
  align-items: start;
  padding: 0.9rem 1rem;
  border: 1px solid rgba(19, 41, 61, 0.1);
  border-radius: 18px;
  background: rgba(19, 41, 61, 0.03);
}

.statement-radio input[type="radio"] {
  margin-top: 0.2rem;
}

.statement-field--muted {
  opacity: 0.55;
}

.statement-button,
.statement-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 2.9rem;
  padding: 0.75rem 1rem;
  border-radius: 999px;
  border: 1px solid rgba(19, 41, 61, 0.12);
  background: rgba(19, 41, 61, 0.06);
  color: var(--text-main);
  font-weight: 700;
  text-decoration: none;
}

.statement-link--button {
  cursor: pointer;
  font: inherit;
}

.statement-inline-form {
  display: inline;
  margin: 0;
}

.statement-button--accent {
  background: linear-gradient(135deg, #f0aa61 0%, var(--brand) 100%);
  color: #21150a;
  border-color: rgba(147, 76, 8, 0.24);
}

.statement-button[disabled] {
  opacity: 0.5;
  cursor: not-allowed;
}

.statement-success {
  margin-top: 1rem;
  color: var(--ok);
  font-weight: 700;
}

.statement-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.25rem;
}

.statement-card {
  display: grid;
  gap: 1rem;
}

.statement-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.statement-toolbar {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: center;
  margin-bottom: 1.25rem;
}

.statement-toolbar__actions {
  display: grid;
  justify-items: end;
  gap: 0.35rem;
}

.statement-toolbar__hint {
  max-width: 26rem;
  color: var(--text-soft);
  font-size: 0.82rem;
  text-align: right;
}

.statement-sheet {
  width: min(960px, 100%);
  margin: 0 auto;
  padding: 2.25rem;
  padding-bottom: 3.6rem;
  border-radius: 28px;
  border: 1px solid rgba(19, 41, 61, 0.12);
  background: rgba(255, 255, 255, 0.97);
  box-shadow: 0 28px 70px rgba(16, 33, 47, 0.12);
  font-family: Arial, "Helvetica Neue", Helvetica, sans-serif;
}

.statement-header {
  display: grid;
  gap: 0.9rem;
  margin-bottom: 2rem;
}

.statement-header__top {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(220px, 260px);
  gap: 1.4rem;
  min-height: 11rem;
}

.statement-header__recipient {
  padding-top: calc(2.75rem + 2cm);
  font-size: 0.98rem;
  line-height: 1.5;
}

.statement-header__recipient-senderline {
  margin-bottom: 0.55rem;
  color: var(--text-soft);
  font-size: 0.76rem;
}

.statement-header__aside {
  display: grid;
  align-content: start;
  justify-items: end;
  gap: 0.85rem;
}

.statement-header__logo {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  min-height: 5.2rem;
}

.statement-header__logo img {
  max-width: 100%;
  max-height: 5.2rem;
  object-fit: contain;
}

.statement-header__meta {
  width: 100%;
  display: grid;
  gap: 0.35rem;
  color: var(--text-main);
  font-size: 0.92rem;
}

.statement-header__meta div {
  display: grid;
  grid-template-columns: 6.1rem 1fr;
  gap: 0.7rem;
}

.statement-header__meta span {
  color: var(--text-soft);
}

.statement-title h1 {
  margin: 0 0 0.75rem;
  font-family: Arial, "Helvetica Neue", Helvetica, sans-serif;
  font-size: clamp(1.26rem, 2.1vw, 1.82rem);
  font-weight: 700;
  letter-spacing: 0.01em;
}

.statement-title p {
  margin: 0 0 1.5rem;
  color: var(--text-soft);
}

.statement-lines {
  column-gap: 1.25rem;
  margin-bottom: 1.35rem;
}

.statement-lines--revenue {
  columns: 3 15rem;
}

.statement-lines--payout {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.35rem 0.5rem;
}

.statement-line {
  break-inside: avoid;
  margin-bottom: 0.55rem;
  padding: 0.42rem 0.55rem;
  border-radius: 12px;
  background: rgba(19, 41, 61, 0.04);
  font-size: 0.86rem;
}

.statement-lines--payout .statement-line {
  font-family: Bahnschrift, "Arial Narrow", Arial, sans-serif;
  font-weight: 300;
  font-stretch: condensed;
  letter-spacing: -0.01em;
  margin-bottom: 0;
  padding: 0.28rem 0.4rem;
  border-radius: 8px;
  background: rgba(19, 41, 61, 0.025);
  font-size: calc(0.78rem + 1px);
  line-height: 1.18;
}

.statement-total {
  margin-top: 1rem;
  padding-top: 1.25rem;
  border-top: 1px solid rgba(19, 41, 61, 0.12);
}

.statement-total__line {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.35rem 0;
}

.statement-total__line--grand {
  margin-top: 0.5rem;
  padding-top: 0.9rem;
  border-top: 1px solid rgba(19, 41, 61, 0.12);
  font-size: 1.08rem;
}

.statement-total__note,
.statement-payment-note {
  margin-top: 1rem;
  color: var(--text-soft);
}

.statement-footer {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(19, 41, 61, 0.12);
  color: var(--text-soft);
  font-size: calc(0.92rem - 2px);
}

.statement-footer__column {
  white-space: pre-line;
  line-height: 1.45;
}

.statement-page-number {
  display: none;
}

.login-shell {
  display: grid;
  place-items: center;
  min-height: calc(100vh - 12rem);
}

.login-panel {
  width: min(760px, 100%);
  display: grid;
  gap: 1.5rem;
  padding: 2rem;
  border-radius: 30px;
  border: 1px solid var(--border);
  background:
    linear-gradient(135deg, rgba(19, 41, 61, 0.96), rgba(15, 71, 99, 0.92)),
    linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.02));
  color: #f8fbfc;
  box-shadow: var(--shadow);
}

.login-panel__intro h1 {
  margin: 0 0 0.8rem;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2rem, 4vw, 3.2rem);
}

.login-form {
  display: grid;
  gap: 1rem;
}

.login-form label {
  display: grid;
  gap: 0.35rem;
  font-weight: 600;
}

.login-form .form-control {
  min-height: 3rem;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(248, 251, 252, 0.08);
  color: #ffffff;
}

.login-form .form-control:focus {
  border-color: rgba(240, 170, 97, 0.7);
  box-shadow: 0 0 0 0.2rem rgba(240, 170, 97, 0.18);
  background: rgba(248, 251, 252, 0.12);
}

.login-error {
  margin: 0;
  padding: 0.85rem 1rem;
  border-radius: 16px;
  background: rgba(176, 75, 47, 0.18);
  color: #ffd7c8;
  font-weight: 700;
}

@media (max-width: 900px) {
  .hero-panel,
  .info-grid {
    grid-template-columns: 1fr;
  }

  .statement-header__top,
  .statement-footer {
    grid-template-columns: 1fr;
  }

  .statement-header__recipient {
    padding-top: 0;
  }

  .statement-header__aside {
    justify-items: start;
  }

  .statement-header__logo {
    justify-content: flex-start;
  }
}

@media (max-width: 640px) {
  .site-header {
    padding: 1rem 1rem 0;
  }

  .site-nav {
    width: min(1120px, calc(100% - 1.25rem));
    flex-direction: column;
    align-items: flex-start;
  }

  .site-nav__links {
    flex-wrap: wrap;
  }

  .site-nav__auth {
    width: 100%;
    justify-content: space-between;
  }

  .project-switcher {
    width: 100%;
    justify-content: space-between;
  }

  .project-switcher__select {
    min-width: 0;
    flex: 1;
  }

  .page-shell {
    width: min(1120px, calc(100% - 1.25rem));
    padding-top: 1.25rem;
  }

  .hero-copy,
  .glass-card,
  .status-card,
  .project-card,
  .statement-sheet {
    border-radius: 22px;
  }

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

  .statement-toolbar__actions,
  .statement-toolbar__hint {
    justify-items: start;
    text-align: left;
  }

  .statement-lines--revenue,
  .statement-lines--payout {
    display: block;
    columns: 1;
  }
}

@media print {
  @page {
    margin: 12mm;
  }

  body {
    background: #ffffff;
  }

  .site-header,
  .site-footer,
  .print-hidden {
    display: none !important;
  }

  .page-shell {
    width: 100%;
    padding: 0;
  }

  .statement-sheet {
    width: 100%;
    margin: 0;
    padding: 0;
    padding-bottom: 14mm;
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }

  .statement-page-number {
    position: fixed;
    right: 0;
    bottom: 0;
    display: block;
    color: transparent;
    font-size: 0.78rem;
  }

  .statement-page-number::before {
    content: counter(page);
  }
}
