/* At-Partners design system: soft neutrals with a purple accent, soft surfaces and
   smooth motion. Light and dark themes; "system" follows the device setting. */

:root {
  color-scheme: light;
  --bg: #f7f5fd;
  --surface: #ffffff;
  --surface-2: #f1eefb;
  --text: #0a0519;
  --muted: #56565c;
  --faint: #83838b;
  --border: #e5e5e6;
  --accent: #8062d9;
  --accent-strong: #562dcd;
  --accent-soft: #e7e1f7;
  --accent-soft-text: #562dcd;
  --gold: #88c5fd;
  --ok: #15803d;
  --ok-soft: #dcf5e4;
  --warn: #a16207;
  --warn-soft: #fdf0c8;
  --danger: #ef3e42;
  --danger-soft: #fde7e7;
  --neutral-soft: #f2f2f3;
  --shadow-sm: 0 0 1px rgba(108, 108, 108, 0.12), 0 0 8px rgba(108, 108, 108, 0.08);
  --shadow-md: 0 4px 12px rgba(40, 20, 90, 0.07), 0 16px 40px rgba(40, 20, 90, 0.08);
  --shadow-lg: 0 12px 28px rgba(40, 20, 90, 0.1), 0 32px 80px rgba(40, 20, 90, 0.14);
  --glow: rgba(128, 98, 217, 0.18);
  --gradient: linear-gradient(135deg, #9980df 0%, #8062d9 45%, #562dcd 130%);
  --map-filter: none;

  --radius: 12px;
  --radius-lg: 20px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --font-body: var(--font-sans), system-ui, sans-serif;
  --font-mono: var(--font-code), ui-monospace, monospace;
}

/* Dark theme: chosen explicitly, or by the device when no choice was made. */
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #161618;
  --surface: #2c2c2f;
  --surface-2: #38383c;
  --text: #fafafa;
  --muted: #b0b0b5;
  --faint: #83838b;
  --border: #46464c;
  --accent: #9980df;
  --accent-strong: #cbc0ef;
  --accent-soft: #3a3160;
  --accent-soft-text: #cbc0ef;
  --gold: #88c5fd;
  --ok: #4ade80;
  --ok-soft: #173322;
  --warn: #facc15;
  --warn-soft: #3a2e0d;
  --danger: #e16d6a;
  --danger-soft: #45201f;
  --neutral-soft: #3a3a3e;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3), 0 2px 8px rgba(0, 0, 0, 0.2);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.3), 0 16px 40px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 12px 28px rgba(0, 0, 0, 0.4), 0 32px 80px rgba(0, 0, 0, 0.45);
  --glow: rgba(153, 128, 223, 0.2);
  --gradient: linear-gradient(135deg, #9980df 0%, #8062d9 45%, #562dcd 130%);
  --map-filter: invert(1) hue-rotate(180deg) brightness(0.85) contrast(0.9);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #161618;
    --surface: #2c2c2f;
    --surface-2: #38383c;
    --text: #fafafa;
    --muted: #b0b0b5;
    --faint: #83838b;
    --border: #46464c;
    --accent: #9980df;
    --accent-strong: #cbc0ef;
    --accent-soft: #3a3160;
    --accent-soft-text: #cbc0ef;
    --gold: #88c5fd;
    --ok: #4ade80;
    --ok-soft: #173322;
    --warn: #facc15;
    --warn-soft: #3a2e0d;
    --danger: #e16d6a;
    --danger-soft: #45201f;
    --neutral-soft: #3a3a3e;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3), 0 2px 8px rgba(0, 0, 0, 0.2);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.3), 0 16px 40px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 12px 28px rgba(0, 0, 0, 0.4), 0 32px 80px rgba(0, 0, 0, 0.45);
    --glow: rgba(153, 128, 223, 0.2);
    --gradient: linear-gradient(135deg, #9980df 0%, #8062d9 45%, #562dcd 130%);
    --map-filter: invert(1) hue-rotate(180deg) brightness(0.85) contrast(0.9);
  }
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  /* Decorative glows may extend past the edge; they must not make the page scroll sideways. */
  overflow-x: clip;
  transition:
    background-color 0.35s var(--ease),
    color 0.35s var(--ease);
}

h1,
h2,
h3 {
  margin: 0;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.12;
}

p {
  margin: 0;
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color 0.2s var(--ease);
}

a:hover {
  color: var(--accent-strong);
}

::selection {
  background: var(--accent-soft);
  color: var(--accent-soft-text);
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.mono {
  font-family: var(--font-mono);
}

.eyebrow {
  display: inline-block;
  padding: 5px 12px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-soft-text);
  font-size: 13px;
  font-weight: 600;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
}

/* Logo */

.logo {
  color: var(--text);
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.logo span {
  color: var(--accent);
}

.logo:hover {
  color: var(--text);
}

/* Buttons */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 46px;
  padding: 0 22px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  background: var(--text);
  color: var(--bg);
  font: inherit;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  transition:
    transform 0.2s var(--ease),
    box-shadow 0.2s var(--ease),
    background-color 0.2s var(--ease),
    border-color 0.2s var(--ease),
    opacity 0.2s;
}

.btn:hover {
  color: var(--bg);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.btn:active {
  transform: translateY(0) scale(0.98);
}

.btn:disabled {
  opacity: 0.55;
  transform: none;
  box-shadow: none;
  cursor: default;
}

.btn-accent {
  background: var(--gradient);
  color: #fff;
  box-shadow: 0 6px 20px var(--glow);
}

.btn-accent:hover {
  color: #fff;
  box-shadow:
    0 10px 28px var(--glow),
    var(--shadow-sm);
}

.btn-ghost {
  border-color: var(--border);
  background: var(--surface);
  color: var(--text);
}

.btn-ghost:hover {
  border-color: var(--faint);
  color: var(--text);
  box-shadow: var(--shadow-sm);
}

.btn-danger {
  border-color: color-mix(in srgb, var(--danger) 45%, transparent);
  background: transparent;
  color: var(--danger);
}

.btn-danger:hover {
  background: var(--danger-soft);
  color: var(--danger);
  box-shadow: none;
}

.btn-small {
  height: 38px;
  padding: 0 14px;
  border-radius: 10px;
  font-size: 14px;
}

/* Fields */

.field {
  display: block;
  width: 100%;
  height: 46px;
  padding: 0 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  outline: none;
  transition:
    border-color 0.2s var(--ease),
    box-shadow 0.2s var(--ease),
    background-color 0.35s var(--ease);
}

textarea.field {
  height: 130px;
  padding: 12px 14px;
  resize: vertical;
}

.field::placeholder {
  color: var(--faint);
}

.field:hover {
  border-color: var(--faint);
}

.field:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--glow);
}

select.field {
  appearance: none;
  padding-right: 32px;
  background-image:
    linear-gradient(45deg, transparent 50%, var(--muted) 50%),
    linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position:
    calc(100% - 16px) 50%,
    calc(100% - 11px) 50%;
  background-size: 5px 5px;
  background-repeat: no-repeat;
  cursor: pointer;
}

.field-small {
  height: 38px;
  padding: 0 10px;
  border-radius: 10px;
  font-size: 14px;
}

.field-file {
  height: auto;
  padding: 10px;
}

.label {
  display: block;
  margin-bottom: 6px;
  font-size: 14px;
  font-weight: 600;
}

.form-row {
  margin-bottom: 16px;
}

.form-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 12px;
}

.field-error {
  margin: 6px 0 0;
  color: var(--danger);
  font-size: 14px;
}

.form-error,
.form-success {
  margin: 0 0 16px;
  padding: 11px 14px;
  border-radius: var(--radius);
  font-size: 14px;
  animation: rise 0.3s var(--ease);
}

.form-error {
  background: var(--danger-soft);
  color: var(--danger);
}

.form-error ul {
  margin: 0;
  padding-left: 18px;
}

.form-success {
  background: var(--ok-soft);
  color: var(--ok);
}

.check {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 16px;
  color: var(--muted);
  font-size: 15px;
  cursor: pointer;
}

input[type="checkbox"],
input[type="radio"] {
  width: 16px;
  height: 16px;
  margin: 0;
  accent-color: var(--accent);
}

/* Theme switcher */

.theme-toggle {
  display: inline-flex;
  gap: 2px;
  padding: 3px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface-2);
}

.theme-toggle button {
  display: grid;
  place-items: center;
  width: 30px;
  height: 28px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition:
    background-color 0.25s var(--ease),
    color 0.25s var(--ease),
    box-shadow 0.25s var(--ease);
}

.theme-toggle button:hover {
  color: var(--text);
}

.theme-toggle button[aria-pressed="true"] {
  background: var(--surface);
  color: var(--accent);
  box-shadow: var(--shadow-sm);
}

.theme-toggle svg {
  width: 15px;
  height: 15px;
}

/* ---------- Landing ---------- */

.wrap {
  max-width: 1160px;
  margin: 0 auto;
  padding: 0 24px;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  border-bottom: 1px solid color-mix(in srgb, var(--border) 60%, transparent);
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  backdrop-filter: blur(16px) saturate(1.4);
}

.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  height: 68px;
}

.site-nav {
  display: flex;
  gap: 6px;
  font-size: 15px;
}

.site-nav a {
  padding: 7px 14px;
  border-radius: 999px;
  color: var(--muted);
  font-weight: 500;
  transition:
    background-color 0.2s var(--ease),
    color 0.2s var(--ease);
}

.site-nav a:hover {
  background: var(--surface-2);
  color: var(--text);
}

.site-actions {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 15px;
  font-weight: 500;
}

.site-actions > a:not(.btn) {
  color: var(--text);
}

.hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
  align-items: center;
  gap: 56px;
  padding-top: 96px;
  padding-bottom: 104px;
}

/* Soft warm glow behind the hero. */
.hero::before {
  content: "";
  position: absolute;
  inset: -80px -20% auto;
  height: 620px;
  z-index: -1;
  background:
    radial-gradient(42% 55% at 22% 40%, var(--glow), transparent 70%),
    radial-gradient(
      38% 50% at 78% 30%,
      color-mix(in srgb, var(--gold) 16%, transparent),
      transparent 70%
    );
  pointer-events: none;
}

.hero > * {
  animation: rise 0.7s var(--ease) both;
}

.hero > :last-child {
  animation-delay: 0.12s;
}

.hero h1 {
  margin: 20px 0 22px;
  font-size: clamp(40px, 5.4vw, 68px);
  font-weight: 800;
  letter-spacing: -0.045em;
  line-height: 1.04;
}

.hero h1 em,
.auth-side h2 em {
  font-style: normal;
}

.hero h1 em {
  background: var(--gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero-lead {
  max-width: 500px;
  margin-bottom: 30px;
  color: var(--muted);
  font-size: 18px;
}

.inline-form {
  display: flex;
  gap: 10px;
  max-width: 480px;
}

.inline-form .field {
  flex: 1;
  min-width: 0;
}

.hero-note {
  margin-top: 14px;
  color: var(--faint);
  font-size: 14px;
}

/* Illustrative dashboard */

.mock {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  transition:
    transform 0.6s var(--ease),
    box-shadow 0.6s var(--ease);
}

.mock:hover {
  transform: translateY(-4px);
}

.mock-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 13px 18px;
  border-bottom: 1px solid var(--border);
  color: var(--faint);
  font-size: 12px;
}

.mock-bar i {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--border);
}

.mock-bar span {
  margin-left: 10px;
}

.mock-body {
  display: grid;
  gap: 14px;
  padding: 18px;
}

.mock-kpis {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.mock-kpi,
.mock-chart {
  padding: 14px;
  border-radius: 14px;
  background: var(--surface-2);
}

.mock-kpi small,
.mock-chart small {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.mock-kpi strong {
  display: block;
  margin: 4px 0 2px;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}

.mock-kpi em {
  font-size: 12px;
  font-style: normal;
  font-weight: 600;
}

.up {
  color: var(--ok);
}

.down {
  color: var(--danger);
}

.mock-charts {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 12px;
}

.mock-chart small {
  margin-bottom: 8px;
}

.mock-chart svg {
  display: block;
  width: 100%;
  height: auto;
}

/* Sections */

.section {
  padding-top: 104px;
  padding-bottom: 104px;
}

.section-head {
  max-width: 640px;
  margin-bottom: 48px;
}

.section-head h2 {
  margin: 16px 0 16px;
  font-size: clamp(30px, 3.6vw, 44px);
}

.section-head p {
  color: var(--muted);
  font-size: 18px;
}

.band {
  background: var(--surface-2);
  transition: background-color 0.35s var(--ease);
}

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

.feature {
  padding: 28px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  transition:
    transform 0.35s var(--ease),
    box-shadow 0.35s var(--ease),
    border-color 0.35s var(--ease);
}

.feature:hover {
  transform: translateY(-4px);
  border-color: color-mix(in srgb, var(--accent) 35%, var(--border));
  box-shadow: var(--shadow-md);
}

.feature .mono {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: var(--accent-soft);
  color: var(--accent-soft-text);
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 700;
}

.feature h3 {
  margin: 18px 0 8px;
  font-size: 20px;
}

.feature p {
  color: var(--muted);
}

.steps {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: step;
}

.steps li {
  padding: 24px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  counter-increment: step;
}

.steps li::before {
  content: counter(step);
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--gradient);
  color: #fff;
  font-size: 14px;
  font-weight: 700;
}

.steps h3 {
  margin: 16px 0 6px;
  font-size: 19px;
}

.steps p {
  color: var(--muted);
}

/* Pricing */

.billing {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px 24px;
  margin-bottom: 32px;
  color: var(--muted);
  font-size: 15px;
}

.billing label {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}

.badge {
  padding: 3px 11px;
  border-radius: 999px;
  background: var(--warn-soft);
  color: var(--warn);
  font-size: 13px;
  font-weight: 600;
}

.plans {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  align-items: start;
}

.plan {
  padding: 30px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  transition:
    transform 0.35s var(--ease),
    box-shadow 0.35s var(--ease);
}

.plan:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}

.plan-recommended {
  border: 2px solid transparent;
  background:
    linear-gradient(var(--surface), var(--surface)) padding-box,
    var(--gradient) border-box;
  box-shadow: 0 18px 50px var(--glow);
}

.plan-flag {
  display: inline-block;
  margin-bottom: 14px;
  padding: 4px 11px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-soft-text);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.plan h3 {
  font-size: 24px;
}

.plan-desc {
  margin: 6px 0 20px;
  color: var(--muted);
  font-size: 15px;
}

.price {
  margin-bottom: 22px;
  font-size: 44px;
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1;
}

.price span {
  margin-left: 4px;
  color: var(--muted);
  font-size: 15px;
  font-weight: 500;
  letter-spacing: 0;
}

.plan .btn {
  width: 100%;
}

.plan ul {
  margin: 24px 0 0;
  padding: 0;
  list-style: none;
  color: var(--muted);
  font-size: 15px;
}

.plan li {
  position: relative;
  padding: 8px 0 8px 28px;
}

.plan li::before {
  content: "";
  position: absolute;
  left: 4px;
  top: 14px;
  width: 11px;
  height: 6px;
  border-left: 2px solid var(--accent);
  border-bottom: 2px solid var(--accent);
  transform: rotate(-45deg);
}

.vat-note {
  margin-top: 28px;
  color: var(--faint);
  font-size: 14px;
}

/* Contact */

.contact {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 56px;
  align-items: start;
}

.contact form {
  display: grid;
  gap: 12px;
  margin-top: 28px;
}

.contact form .btn {
  justify-self: start;
}

.contact .field-error {
  margin-top: -6px;
}

.contact-facts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-top: 14px;
}

.contact-facts > div,
.contact-facts > address {
  padding: 16px 18px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--surface);
}

.contact-facts > .contact-company {
  display: grid;
  grid-column: 1 / -1;
  gap: 2px;
  font-style: normal;
}

.contact-company span {
  color: var(--muted);
  font-size: 15px;
}

.footer-company {
  font-style: normal;
}

.footer-company span {
  display: block;
}

.footer-company a {
  margin-top: 6px;
}

.contact-facts small {
  display: block;
  margin-bottom: 2px;
  color: var(--faint);
  font-size: 13px;
}

.map {
  position: relative;
  height: 380px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.map::before {
  content: "";
  position: absolute;
  inset: 0;
  background: url("../assets/map.png") center / cover no-repeat;
  filter: var(--map-filter);
}

.map-pin {
  position: absolute;
  left: calc(50% - 9px);
  top: calc(50% - 9px);
  width: 18px;
  height: 18px;
  border: 3px solid var(--surface);
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 8px var(--glow);
  animation: pulse 2.4s var(--ease) infinite;
}

@keyframes pulse {
  50% {
    box-shadow: 0 0 0 16px transparent;
  }
}

.map-credit {
  position: absolute;
  right: 8px;
  bottom: 8px;
  padding: 2px 8px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--surface) 85%, transparent);
  color: var(--muted);
  font-size: 11px;
}

/* Call to action and footer */

.cta .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 28px;
  margin-bottom: 72px;
  padding: 56px;
  border-radius: 28px;
  background: var(--gradient);
  box-shadow: 0 24px 70px var(--glow);
  color: #fff;
}

.cta h2 {
  max-width: 520px;
  font-size: clamp(28px, 3.2vw, 40px);
}

.cta .inline-form {
  flex: 1;
  min-width: 280px;
}

.cta .field {
  border-color: rgba(255, 255, 255, 0.35);
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
}

.cta .field::placeholder {
  color: rgba(255, 255, 255, 0.75);
}

.cta .field:focus {
  border-color: #fff;
  box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.25);
}

.cta .btn {
  background: #fff;
  color: #562dcd;
  box-shadow: none;
}

.site-footer {
  border-top: 1px solid var(--border);
}

.site-footer .wrap {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 32px;
  padding-top: 48px;
  padding-bottom: 48px;
  color: var(--muted);
  font-size: 15px;
}

.site-footer h4 {
  margin: 0 0 10px;
  color: var(--text);
  font-size: 14px;
  font-weight: 700;
}

.site-footer a:not(.logo) {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
}

.site-footer a:not(.logo):hover {
  color: var(--accent);
}

.footer-brand {
  max-width: 280px;
}

.footer-brand p {
  margin: 10px 0 16px;
}

/* ---------- Login and sign-up ---------- */

.auth {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  min-height: 100vh;
}

.auth-side {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 40px;
  margin: 14px;
  padding: 36px 44px;
  border-radius: 28px;
  background: var(--gradient);
  color: #fff;
  overflow: hidden;
}

.auth-side::after {
  content: "";
  position: absolute;
  inset: auto -30% -40% auto;
  width: 520px;
  height: 520px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.28), transparent 65%);
  pointer-events: none;
}

.auth-side .logo,
.auth-side .logo span {
  color: #fff;
}

.auth-side h2 {
  max-width: 420px;
  font-size: clamp(30px, 3.4vw, 46px);
  font-weight: 800;
}

.auth-side p {
  max-width: 400px;
  margin-top: 16px;
  color: rgba(255, 255, 255, 0.86);
}

.auth-side svg {
  position: relative;
  z-index: 1;
  display: block;
  width: 100%;
  max-width: 420px;
  height: auto;
}

.auth-main {
  display: flex;
  flex-direction: column;
  padding: 28px 40px;
}

.auth-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  color: var(--muted);
  font-size: 15px;
}

.auth-top-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.auth-form {
  width: 100%;
  max-width: 420px;
  margin: auto;
  padding: 40px 0;
  animation: rise 0.6s var(--ease) both;
}

.auth-form h1 {
  margin-bottom: 10px;
  font-size: 36px;
  font-weight: 800;
}

.auth-form > p {
  margin-bottom: 28px;
  color: var(--muted);
}

.auth-form .field {
  margin-top: 12px;
}

.auth-options {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 16px;
  font-size: 15px;
}

.auth-options .check {
  margin-top: 0;
}

.auth-form .form-success {
  margin-bottom: 4px;
}

.auth-form .btn {
  width: 100%;
  margin-top: 22px;
}

/* ---------- Application ---------- */

.shell {
  display: grid;
  grid-template-columns: 256px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  gap: 24px;
  height: 100vh;
  padding: 22px 14px;
  border-right: 1px solid var(--border);
  background: var(--surface);
  /* On short screens the menu scrolls by itself, so the bottom controls stay reachable. */
  overflow-y: auto;
  scrollbar-width: thin;
  transition: background-color 0.35s var(--ease);
}

.sidebar .logo {
  padding: 0 12px;
}

.sidebar nav {
  display: grid;
  gap: 2px;
}

.sidebar h5 {
  margin: 18px 12px 6px;
  color: var(--faint);
  font-size: 12px;
  font-weight: 600;
}

.nav-link {
  display: block;
  padding: 9px 12px;
  border-radius: 10px;
  color: var(--muted);
  font-size: 15px;
  font-weight: 500;
  transition:
    background-color 0.2s var(--ease),
    color 0.2s var(--ease),
    padding-left 0.25s var(--ease);
}

.nav-link:hover {
  padding-left: 15px;
  background: var(--surface-2);
  color: var(--text);
}

.nav-link.active {
  background: var(--accent-soft);
  color: var(--accent-soft-text);
  font-weight: 600;
}

.sidebar > * {
  flex: none;
}

.sidebar-user {
  margin-top: auto;
  padding: 16px 12px 0;
  border-top: 1px solid var(--border);
  font-size: 14px;
}

.sidebar-user strong {
  display: block;
  font-weight: 600;
}

.sidebar-user > span {
  display: block;
  margin-bottom: 12px;
  color: var(--muted);
}

.sidebar-user .theme-toggle {
  margin-bottom: 10px;
}

.sidebar-user .btn {
  width: 100%;
}

.page {
  max-width: 1040px;
  padding: 40px 40px 80px;
  animation: rise 0.45s var(--ease) both;
}

.page-wide {
  max-width: 1240px;
}

.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 28px;
}

.page-head h1 {
  font-size: 32px;
  font-weight: 800;
}

.page-head p {
  margin-top: 6px;
  color: var(--muted);
}

.page-head .pill {
  margin-right: 10px;
}

.crumbs {
  margin-bottom: 10px;
  color: var(--faint);
  font-size: 14px;
}

.crumbs a {
  color: var(--muted);
}

.crumbs a:hover {
  color: var(--accent);
}

.loading {
  padding: 40px;
  color: var(--muted);
}

.card {
  margin-bottom: 20px;
  padding: 24px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  transition:
    background-color 0.35s var(--ease),
    border-color 0.35s var(--ease);
}

.card > h2 {
  margin-bottom: 6px;
  font-size: 19px;
}

.card > h2 + p {
  margin-bottom: 18px;
  color: var(--muted);
  font-size: 15px;
}

.card form {
  max-width: 460px;
}

.card form:has(.table-form),
.button-row form {
  max-width: none;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
}

.tile {
  display: block;
  padding: 22px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  color: var(--text);
  transition:
    transform 0.3s var(--ease),
    box-shadow 0.3s var(--ease),
    border-color 0.3s var(--ease);
}

a.tile:hover {
  transform: translateY(-3px);
  border-color: color-mix(in srgb, var(--accent) 40%, var(--border));
  box-shadow: var(--shadow-md);
  color: var(--text);
}

.tile h3 {
  margin-bottom: 4px;
  font-size: 18px;
}

.tile p {
  color: var(--muted);
  font-size: 14px;
}

.tile-soon {
  border-style: dashed;
  background: transparent;
  box-shadow: none;
  opacity: 0.75;
}

/* Tables */

.table-wrap {
  overflow-x: auto;
}

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 15px;
}

.table th {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  text-align: left;
  white-space: nowrap;
}

.table td {
  padding: 12px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

.table tbody tr {
  transition: background-color 0.15s;
}

.table tbody tr:hover {
  background: var(--surface-2);
}

.table tbody tr:last-child td {
  border-bottom: 0;
}

.table-form {
  margin-bottom: 16px;
}

.table-form td {
  padding: 6px 12px;
  vertical-align: middle;
}

.table-data {
  font-size: 14px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.table-data td {
  padding: 9px 12px;
}

.num,
.table th.num {
  text-align: right;
}

.table tfoot td,
.total {
  font-weight: 700;
}

.table tfoot td {
  border-top: 1px solid var(--faint);
  border-bottom: 0;
}

.cell-note,
.table-note,
.result-meta {
  color: var(--muted);
  font-size: 14px;
}

.result-meta {
  margin-bottom: 14px;
}

.table-note {
  margin-top: 12px;
}

/* Pills */

.pill {
  display: inline-block;
  margin: 0 4px 4px 0;
  padding: 3px 11px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-soft-text);
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
}

.pill-muted,
.pill-disabled {
  background: var(--neutral-soft);
  color: var(--muted);
}

.pill-enabled {
  background: var(--ok-soft);
  color: var(--ok);
}

.pill-preparing {
  background: var(--warn-soft);
  color: var(--warn);
}

.pill-failed {
  background: var(--danger-soft);
  color: var(--danger);
}

.yes {
  color: var(--ok);
  font-weight: 700;
}

.no {
  color: var(--faint);
}

/* Form pieces used in the application */

.checks {
  display: grid;
  gap: 8px;
  margin: 0 0 16px;
  padding: 0;
  border: 0;
}

.checks legend {
  margin-bottom: 8px;
  padding: 0;
  font-size: 14px;
  font-weight: 600;
}

.checks label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
  cursor: pointer;
}

.row-form {
  display: flex;
  gap: 10px;
  max-width: 460px;
}

.row-form .field {
  flex: 1;
  min-width: 0;
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

.page-head .button-row {
  margin-top: 0;
}

.empty {
  margin-bottom: 18px;
  color: var(--muted);
  font-size: 15px;
}

.danger-zone {
  border-color: color-mix(in srgb, var(--danger) 30%, var(--border));
}

details.confirm > summary {
  list-style: none;
}

details.confirm > summary::-webkit-details-marker {
  display: none;
}

details.confirm[open] > summary {
  display: none;
}

details.confirm p {
  margin-bottom: 12px;
  font-weight: 600;
}

/* Catalog */

.folder-list,
.item-list {
  margin: 0 0 18px;
  padding: 0;
  list-style: none;
}

.item-list {
  margin-bottom: 0;
}

.folder-list a,
.item-list a {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 -10px;
  padding: 11px 10px;
  border-radius: 10px;
  color: var(--text);
  transition:
    background-color 0.2s var(--ease),
    color 0.2s var(--ease);
}

.folder-list a:hover,
.item-list a:hover {
  background: var(--surface-2);
  color: var(--accent);
}

.folder-list a::before {
  content: "";
  flex: none;
  width: 18px;
  height: 14px;
  border-radius: 4px;
  background: var(--gold);
  box-shadow: inset 0 4px 0 color-mix(in srgb, var(--gold) 70%, #000);
}

.item-list a::before {
  content: "";
  flex: none;
  width: 14px;
  height: 16px;
  border-radius: 3px;
  background: var(--accent-soft);
  box-shadow: inset 0 0 0 1.5px var(--accent);
}

/* Data sources */

.filters {
  display: grid;
  grid-template-columns: 1.4fr repeat(5, 1fr) auto;
  align-items: end;
  gap: 12px;
  padding: 16px;
}

.filters .field {
  height: 38px;
  padding: 0 10px;
  border-radius: 10px;
  font-size: 14px;
}

.filters select.field {
  padding-right: 30px;
}

.filters .label,
.prompts .label {
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 12px;
}

.filters-actions {
  display: flex;
  gap: 8px;
}

.tabs {
  display: inline-flex;
  gap: 4px;
  margin-bottom: 20px;
  padding: 4px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface-2);
}

.tab {
  padding: 8px 16px;
  border-radius: 10px;
  color: var(--muted);
  font-size: 15px;
  font-weight: 600;
  transition:
    background-color 0.25s var(--ease),
    color 0.25s var(--ease),
    box-shadow 0.25s var(--ease);
}

.tab:hover {
  color: var(--text);
}

.tab.active {
  background: var(--surface);
  color: var(--accent);
  box-shadow: var(--shadow-sm);
}

/* Reports */

.pick-groups {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 28px;
}

.pick-groups h3 {
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0;
}

.pick {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 46px;
  margin: 0 -10px;
  padding: 0 10px;
  border-radius: 10px;
  transition: background-color 0.2s var(--ease);
}

.pick:hover {
  background: var(--surface-2);
}

.pick label {
  display: flex;
  flex: 1;
  align-items: center;
  gap: 10px;
  min-height: 46px;
  cursor: pointer;
}

.pick .field {
  width: 150px;
}

.filter-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.filter-row .field {
  width: auto;
  min-width: 150px;
}

.filter-prompt {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 14px;
  cursor: pointer;
}

.builder-save {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 16px;
}

.builder-save .form-row:last-child {
  grid-column: 1 / -1;
}

.prompts {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 14px;
  padding: 16px;
}

.prompt-inputs {
  display: flex;
  gap: 8px;
}

/* Highlights (conditional formatting) */

.hl {
  font-weight: 700;
}

.hl-red {
  background: var(--danger-soft);
  color: var(--danger);
}

.hl-amber {
  background: var(--warn-soft);
  color: var(--warn);
}

.hl-green {
  background: var(--ok-soft);
  color: var(--ok);
}

/* Dashboards */

.page-full {
  max-width: 1600px;
}

.dash-section {
  margin-bottom: 28px;
}

.dash-section > h2,
.dash-section > summary {
  margin-bottom: 14px;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.03em;
}

.dash-section > summary {
  cursor: pointer;
  list-style: none;
}

.dash-section > summary::-webkit-details-marker {
  display: none;
}

.dash-section > summary::before {
  content: "";
  display: inline-block;
  width: 8px;
  height: 8px;
  margin: 0 12px 3px 2px;
  border-right: 2px solid var(--muted);
  border-bottom: 2px solid var(--muted);
  transform: rotate(-45deg);
  transition: transform 0.25s var(--ease);
}

.dash-section[open] > summary::before {
  transform: rotate(45deg);
}

.dash-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 18px;
  align-items: start;
}

.dash-cell {
  min-width: 0;
}

.span-3 {
  grid-column: span 3;
}

.span-4 {
  grid-column: span 4;
}

.span-6 {
  grid-column: span 6;
}

.span-8 {
  grid-column: span 8;
}

.span-12 {
  grid-column: span 12;
}

.dash-item {
  height: 100%;
  padding: 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  animation: rise 0.45s var(--ease) both;
}

.dash-item > header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.dash-item h3 {
  font-size: 17px;
}

.dash-item > header a {
  flex: none;
  font-size: 14px;
  font-weight: 600;
}

.dash-text h3 {
  margin-bottom: 8px;
}

.dash-text p {
  color: var(--muted);
  white-space: pre-line;
}

.dash-loading {
  display: grid;
  place-items: center;
  min-height: 180px;
  color: var(--faint);
}

.dash-short .chart {
  height: 240px;
}

.dash-medium .chart {
  height: 340px;
}

.dash-tall .chart {
  height: 480px;
}

/* Dashboard editor */

.section-title {
  flex: 1;
  min-width: 220px;
  font-weight: 600;
}

.dash-grid.editing {
  margin-bottom: 16px;
}

.dash-edit {
  cursor: grab;
  transition:
    border-color 0.2s var(--ease),
    box-shadow 0.2s var(--ease),
    opacity 0.2s;
}

.dash-edit:hover {
  border-color: color-mix(in srgb, var(--accent) 40%, var(--border));
  box-shadow: var(--shadow-md);
}

.dragging .dash-edit {
  opacity: 0.4;
}

.dash-edit h3 {
  display: flex;
  align-items: center;
  gap: 10px;
}

.grip {
  flex: none;
  width: 10px;
  height: 16px;
  background-image: radial-gradient(var(--faint) 1.5px, transparent 1.6px);
  background-size: 5px 5px;
}

.dash-edit .field {
  margin-bottom: 10px;
}

.dash-edit textarea.field {
  height: 90px;
}

.dash-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.dash-controls .field {
  flex: 1;
  width: auto;
  min-width: 120px;
  margin-bottom: 0;
}

.dash-add {
  margin-bottom: 0;
}

.add-section {
  margin-bottom: 20px;
}

/* KPIs */

.kpi-value {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px;
  margin-bottom: 14px;
}

.kpi-value strong {
  font-size: 40px;
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.kpi-value .pill {
  margin: 0;
}

.kpi-facts,
.facts {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 28px;
  margin: 0 0 14px;
}

.kpi-facts dt,
.facts dt {
  color: var(--faint);
  font-size: 13px;
}

.kpi-facts dd,
.facts dd {
  margin: 0;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.facts {
  margin-bottom: 20px;
}

.sparkline {
  display: block;
  width: 100%;
  height: 48px;
}

.spark-cell {
  width: 140px;
}

.spark-cell .sparkline {
  height: 28px;
}

.state-rule {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 14px;
}

.state-rule .field {
  width: 90px;
  min-width: 0;
}

.order-list {
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: order;
}

.order-list li {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  counter-increment: order;
}

.order-list li:last-child {
  border-bottom: 0;
}

.order-list span {
  flex: 1;
}

.order-list span::before {
  content: counter(order) ".";
  display: inline-block;
  width: 28px;
  color: var(--faint);
}

.card > .label {
  margin-top: 6px;
}

/* Tutorial */

.sidebar-tools {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.sidebar-user .sidebar-tools .theme-toggle {
  margin-bottom: 0;
}

.help-button {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition:
    border-color 0.2s var(--ease),
    color 0.2s var(--ease),
    background-color 0.2s var(--ease);
}

.help-button:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent-soft-text);
}

.tour {
  position: fixed;
  left: 272px;
  bottom: 24px;
  z-index: 40;
  width: min(400px, calc(100vw - 32px));
  padding: 20px;
  border: 1px solid color-mix(in srgb, var(--accent) 35%, var(--border));
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-lg);
  color: var(--text);
  animation: rise 0.35s var(--ease) both;
}

.tour > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
  color: var(--faint);
  font-size: 13px;
  font-weight: 600;
}

.tour-close {
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--muted);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
}

.tour-close:hover {
  background: var(--surface-2);
  color: var(--text);
}

.tour h2 {
  margin-bottom: 8px;
  font-size: 19px;
}

.tour p {
  color: var(--muted);
  font-size: 15px;
}

.tour-progress {
  display: flex;
  gap: 5px;
  margin: 16px 0;
}

.tour-progress i {
  flex: 1;
  height: 4px;
  border-radius: 2px;
  background: var(--border);
  transition: background-color 0.3s var(--ease);
}

.tour-progress i.done {
  background: var(--accent);
}

.tour > footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.tour-link {
  font-size: 14px;
  font-weight: 600;
}

.tour-buttons {
  display: flex;
  gap: 8px;
  margin-left: auto;
}

/* The menu entry the current tutorial step is about. */
.nav-link.tour-target {
  box-shadow:
    0 0 0 2px var(--accent),
    0 0 0 6px var(--glow);
  color: var(--text);
}

.welcome {
  border-color: color-mix(in srgb, var(--accent) 35%, var(--border));
  background:
    radial-gradient(60% 120% at 100% 0%, var(--glow), transparent 70%),
    var(--surface);
}

/* Schedules */

.schedule-list {
  margin: 0 0 20px;
  padding: 0;
  list-style: none;
}

.schedule-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}

.schedule-info {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.schedule-info strong {
  font-weight: 600;
}

.schedule-info span {
  color: var(--muted);
  font-size: 14px;
  overflow-wrap: anywhere;
}

.schedule-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.schedule-actions form {
  max-width: none;
}

.schedule-actions .form-success,
.schedule-actions .form-error {
  margin: 0 8px 0 0;
  padding: 6px 10px;
}

.schedule-actions form:has(.form-success, .form-error) {
  display: flex;
  align-items: center;
}

.schedule-fields {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.card form:has(.schedule-fields) {
  max-width: 760px;
}

/* Usage */

.usage-grid {
  margin-bottom: 20px;
}

.page-head .tabs {
  margin-bottom: 0;
}

.zone-form {
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}

/* Invoicing */

.list-tools {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 20px;
}

.list-tools .tabs {
  margin-bottom: 0;
}

.invoice-steps {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

.invoice-steps > p {
  color: var(--muted);
}

.invoice-steps .button-row {
  margin-top: 0;
  align-items: flex-start;
}

.invoice-steps form {
  max-width: 420px;
}

.form-heading {
  margin: 24px 0 14px;
  font-size: 17px;
}

.invoice-doc-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 24px;
}

.invoice-doc h2 {
  font-size: 26px;
}

.invoice-number {
  margin-top: 4px;
  color: var(--accent);
  font-weight: 700;
}

.invoice-meta {
  display: grid;
  gap: 6px;
  margin: 0;
  min-width: 240px;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.invoice-meta > div,
.invoice-totals > div {
  display: flex;
  justify-content: space-between;
  gap: 24px;
}

.invoice-meta dt,
.invoice-totals dt {
  color: var(--muted);
  font-size: 14px;
}

.invoice-meta dd,
.invoice-totals dd {
  margin: 0;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.invoice-parties {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin-bottom: 24px;
}

.invoice-parties section {
  display: grid;
  align-content: start;
  gap: 4px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.invoice-parties h3 {
  margin-bottom: 8px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--accent);
  font-size: 16px;
}

.invoice-parties span {
  color: var(--muted);
  font-size: 15px;
}

.invoice-parties a {
  margin-top: 6px;
  font-size: 14px;
  font-weight: 600;
}

.invoice-fields {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 24px;
}

.invoice-lines {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 14px;
  font-variant-numeric: tabular-nums;
}

.invoice-lines th {
  padding: 12px;
  background: var(--accent);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  text-align: left;
  white-space: nowrap;
}

.invoice-lines th:first-child {
  border-radius: 12px 0 0 12px;
}

.invoice-lines th:last-child {
  border-radius: 0 12px 12px 0;
}

.invoice-lines td {
  padding: 12px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

.invoice-lines.editing td {
  padding: 8px 4px;
  border-bottom: 0;
}

.invoice-lines.editing .field {
  min-width: 150px;
}

.invoice-lines.editing .field.narrow {
  min-width: 0;
  width: 84px;
}

.invoice-lines .field.num {
  text-align: right;
}

.invoice-lines .field-error {
  display: block;
  margin-top: 4px;
  font-size: 12px;
}

.line-total {
  padding-top: 16px !important;
  font-weight: 600;
  white-space: nowrap;
}

.add-line {
  width: 100%;
  margin: 8px 0 24px;
  padding: 12px;
  border: 1.5px dashed var(--border);
  border-radius: var(--radius);
  background: transparent;
  color: var(--accent);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  transition:
    border-color 0.2s var(--ease),
    background-color 0.2s var(--ease);
}

.add-line:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.invoice-totals {
  display: grid;
  gap: 8px;
  width: min(360px, 100%);
  margin: 20px 0 20px auto;
}

.invoice-total {
  margin-top: 4px;
  padding-top: 10px;
  border-top: 1px solid var(--faint);
}

.invoice-total dt,
.invoice-total dd {
  color: var(--text);
  font-size: 17px;
  font-weight: 700;
}

.invoice-notes {
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--muted);
  white-space: pre-line;
}

.invoice-edit textarea.field {
  height: 90px;
  margin-bottom: 16px;
}

.print-page .invoice-doc {
  padding: 8px;
}

/* Paper is white, and the two parties stay side by side at paper width. */
body:has(.print-page) {
  background: #fff;
}

.print-page .invoice-parties {
  grid-template-columns: 1fr 1fr;
}

/* Charts */

.chart {
  width: 100%;
  height: 440px;
  margin-bottom: 8px;
}

.chart-data {
  margin-top: 12px;
}

.chart-data > summary {
  display: inline-block;
  padding: 7px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
  list-style: none;
  cursor: pointer;
  transition:
    border-color 0.2s var(--ease),
    color 0.2s var(--ease);
}

.chart-data > summary::-webkit-details-marker {
  display: none;
}

.chart-data > summary:hover {
  border-color: var(--faint);
  color: var(--text);
}

.chart-data[open] > summary {
  margin-bottom: 14px;
}

/* Pages rendered to PDF */

.print-page {
  max-width: 1120px;
  margin: 0 auto;
  padding: 8px;
}

.print-page header {
  margin-bottom: 20px;
}

.print-page h1 {
  margin: 14px 0 6px;
  font-size: 28px;
}

.print-page .chart {
  height: 400px;
  break-inside: avoid;
}

.print-page .table-data {
  white-space: normal;
}

.print-page tr {
  break-inside: avoid;
}

/* ---------- Small screens ---------- */

@media (max-width: 960px) {
  .site-nav {
    display: none;
  }

  .hero,
  .contact,
  .auth {
    grid-template-columns: minmax(0, 1fr);
  }

  .hero {
    padding-top: 56px;
    padding-bottom: 64px;
  }

  .section {
    padding-top: 64px;
    padding-bottom: 64px;
  }

  .features,
  .plans {
    grid-template-columns: minmax(0, 1fr);
  }

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

  .cta .wrap {
    margin: 0 16px 56px;
    padding: 36px 24px;
  }

  .auth-side {
    display: none;
  }

  .shell {
    grid-template-columns: minmax(0, 1fr);
  }

  .sidebar {
    position: static;
    height: auto;
    border-right: 0;
    border-bottom: 1px solid var(--border);
  }

  .tour {
    left: 16px;
    bottom: 16px;
  }

  .page {
    padding: 28px 20px 60px;
  }

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

  .pick-groups,
  .builder-save,
  .invoice-parties {
    grid-template-columns: minmax(0, 1fr);
  }

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

  .dash-cell {
    grid-column: span 12;
  }
}

@media (max-width: 560px) {
  .inline-form,
  .row-form {
    flex-direction: column;
  }

  .mock-kpis,
  .mock-charts,
  .steps,
  .contact-facts {
    grid-template-columns: minmax(0, 1fr);
  }

  .site-actions {
    gap: 10px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}
