:root {
  --bg: #0f1115;
  --surface: #171a21;
  --text: #e8eaf0;
  --muted: #9aa3b2;
  --accent: #5bd39b;
  --error: #e5697a;
  --radius: 12px;
  font-family: "Space Grotesk", system-ui, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
}

main {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 1.5rem 4rem;
}

main.narrow {
  max-width: 640px;
  padding-top: 3rem;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* nav / hero */
.nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem 0;
}

.logo {
  font-weight: 700;
  font-size: 1.1rem;
}

.nav-links {
  display: flex;
  gap: 1.25rem;
  align-items: center;
}

.nav-links a {
  color: var(--text);
}

.nav-links .cta {
  background: var(--accent);
  color: var(--bg);
  padding: 0.4rem 1rem;
  border-radius: 999px;
  font-weight: 600;
}

.hero-body {
  padding: 5rem 0 4rem;
}

.hero-body h1 {
  font-size: clamp(2rem, 5vw, 3.25rem);
  margin: 0 0 1rem;
}

.hero-body p {
  color: var(--muted);
  max-width: 34rem;
  font-size: 1.1rem;
}

.social {
  display: flex;
  gap: 1rem;
  margin-top: 1.5rem;
}

/* sections */
.section {
  padding: 3rem 0;
  border-top: 1px solid #262a33;
}

.section h2 {
  margin-top: 0;
}

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

.card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
}

.card h3 {
  margin-top: 0;
}

.card p {
  color: var(--muted);
  margin-bottom: 0;
}

/* forms */
.contact-form,
.stacked-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  max-width: 480px;
}

.stacked-form .row {
  display: flex;
  gap: 1rem;
}

.stacked-form .row label {
  flex: 1;
}

label {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: 0.9rem;
  color: var(--muted);
}

input,
textarea,
select {
  background: var(--surface);
  border: 1px solid #2c313c;
  border-radius: 8px;
  padding: 0.6rem 0.75rem;
  color: var(--text);
  font: inherit;
}

input:focus,
textarea:focus,
select:focus {
  outline: 2px solid var(--accent);
  border-color: transparent;
}

button {
  align-self: flex-start;
  background: var(--accent);
  color: var(--bg);
  border: none;
  border-radius: 999px;
  padding: 0.6rem 1.5rem;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

button:hover {
  filter: brightness(1.1);
}

/* flashes */
.flashes {
  max-width: 960px;
  margin: 1rem auto 0;
  padding: 0 1.5rem;
}

.flash {
  border-radius: 8px;
  padding: 0.6rem 1rem;
  margin-bottom: 0.5rem;
  background: var(--surface);
}

.flash-success {
  border-left: 4px solid var(--accent);
}

.flash-error {
  border-left: 4px solid var(--error);
}

/* admin */
.admin-nav {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}

.invoice-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.invoice-table th,
.invoice-table td {
  text-align: left;
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid #262a33;
}

.admin-nav h1 small {
  color: var(--muted);
  font-size: 0.6em;
  font-weight: 400;
}

.client-heading {
  margin: 1.5rem 0 0.25rem;
  color: var(--muted);
  font-size: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

button.secondary {
  background: transparent;
  color: var(--accent);
  border: 1px solid var(--accent);
}

.hint {
  color: var(--muted);
  font-size: 0.9rem;
  max-width: 480px;
}

.inline-check {
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  gap: 0.35rem;
}

.button-link {
  align-self: center;
  padding: 0.6rem 0;
}

button.danger-link {
  background: none;
  border: none;
  color: var(--error);
  padding: 0;
  font-weight: 400;
}

button.danger-link:hover {
  text-decoration: underline;
  filter: none;
}

/* stats */
.chart-card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  margin-bottom: 1.5rem;
}

.chart-card h2 {
  margin: 0;
}

.chart-subtitle {
  color: var(--muted);
  font-size: 0.85rem;
  margin: 0.25rem 0 1rem;
}

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

.chart-card details {
  margin-top: 0.75rem;
  font-size: 0.85rem;
  color: var(--muted);
}

.chart-card summary {
  cursor: pointer;
}

.chart-tooltip {
  position: fixed;
  z-index: 10;
  background: var(--bg);
  border: 1px solid #2c313c;
  border-radius: 8px;
  padding: 0.4rem 0.6rem;
  font-size: 0.8rem;
  pointer-events: none;
  max-width: 240px;
}

.footer {
  border-top: 1px solid #262a33;
  padding-top: 2rem;
  color: var(--muted);
  font-size: 0.9rem;
}
