:root {
  --bg: #0f1420;
  --panel: #171d2b;
  --border: #2a3244;
  --text: #e6e9ef;
  --muted: #8b93a7;
  --income: #3fb97a;
  --expense: #e0655b;
  --accent: #5b8cff;
  /* Same green as the icon mark's top tile. Paired with --bg (dark) text
     this gives ~8.6:1 contrast, well past WCAG AA's 4.5:1. Use for any
     solid button fill; keep --accent for text/icons on dark backgrounds. */
  --accent-btn: #35c48a;
  --error: #f2555a;
  --font-body: "Inter", -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-heading: "Space Grotesk", "Inter", -apple-system, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SF Mono", Consolas, monospace;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
}

h1, h2, h3 {
  font-family: var(--font-heading);
  font-weight: 700;
  letter-spacing: -0.02em;
}

header:not(.site-head) {
  padding: 24px 32px 8px;
}

header h1 { margin: 0; font-size: 1.5rem; }
.subtitle { color: var(--muted); margin: 4px 0 0; font-size: 0.9rem; }

main {
  max-width: 960px;
  margin: 0 auto;
  padding: 16px 32px 48px;
}

.summary {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.card .label { color: var(--muted); font-size: 0.75rem; font-family: var(--font-mono); text-transform: uppercase; letter-spacing: 0.04em; }
.card .value { font-size: 1.5rem; font-weight: 600; }
.card.income .value { color: var(--income); }
.card.expense .value { color: var(--expense); }
.card.net .value { color: var(--accent); }

.panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 20px;
  margin-bottom: 24px;
}

.panel h2 { margin: 0 0 12px; font-size: 1.05rem; }

.row {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

label {
  display: flex;
  flex-direction: column;
  font-size: 0.8rem;
  color: var(--muted);
  gap: 4px;
  flex: 1;
  min-width: 140px;
}

label.full { flex-basis: 100%; }

input, select {
  background: #0f1420;
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  padding: 8px 10px;
  font-size: 0.9rem;
}

button {
  background: var(--accent-btn);
  color: var(--bg);
  border: none;
  border-radius: 6px;
  padding: 9px 16px;
  font-size: 0.9rem;
  cursor: pointer;
  align-self: flex-end;
}

button#clearFilters {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
}

.filters { align-items: flex-end; }

#exportLink {
  align-self: flex-end;
  color: var(--accent);
  text-decoration: none;
  padding: 9px 4px;
  font-size: 0.9rem;
}
#exportLink:hover { text-decoration: underline; }

table { width: 100%; border-collapse: collapse; font-size: 0.85rem; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--border); }
th { color: var(--muted); font-weight: 500; font-size: 0.7rem; font-family: var(--font-mono); text-transform: uppercase; }
tr.income td.amount { color: var(--income); }
tr.expense td.amount { color: var(--expense); }

.delete-btn {
  background: transparent;
  border: none;
  color: var(--muted);
  cursor: pointer;
  padding: 2px 6px;
  align-self: center;
}
.delete-btn:hover { color: var(--expense); }

.user-bar {
  position: absolute;
  top: 24px;
  right: 32px;
  display: flex;
  gap: 16px;
  align-items: center;
  color: var(--muted);
  font-size: 0.85rem;
}
.user-bar[hidden] { display: none; }

.link-btn {
  background: none;
  border: none;
  color: var(--accent);
  cursor: pointer;
  font-size: 0.85rem;
  padding: 0;
}
.link-btn:hover { text-decoration: underline; }

header:not(.site-head) { position: relative; }

.login-screen {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 60vh;
  padding: 16px;
}
.login-screen[hidden] { display: none; }

.login-panel {
  width: 100%;
  max-width: 340px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.login-panel label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  color: var(--muted);
  font-size: 0.85rem;
}

.error-text {
  color: var(--error);
  font-size: 0.85rem;
  margin: 0;
}

.hint {
  color: var(--muted);
  font-size: 0.8rem;
  display: block;
  margin: 4px 0 12px;
}

.receipt-import {
  border-bottom: 1px solid var(--border);
  padding-bottom: 12px;
  margin-bottom: 4px;
}

#importPreviewWrap { margin-top: 12px; }
#importTable input, #importTable select {
  padding: 4px 6px;
  font-size: 0.8rem;
  width: 100%;
}
#importTable td { padding: 4px 6px; }

/* Lilly Tech brand bar: same structure/classes as every other Lilly Tech
   product (sitexure.lillytechsystems.com, redactpro-web, etc.) so the header
   reads as one company across products, not a one-off design. */
.site-head {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(11, 18, 32, 0.82);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.site-head .wrap {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  height: 56px;
  max-width: none;
  padding: 0 28px;
}
.site-head .brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  text-decoration: none;
}
.site-head .brand:hover { text-decoration: none; }
.brand-flower { width: 28px; height: 28px; object-fit: contain; flex: 0 0 auto; }
.brand-name {
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
}
.brand-name .thin { font-weight: 300; letter-spacing: 0.14em; }
.site-head .product-badge {
  grid-column: 2;
  justify-self: center;
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: -0.01em;
  color: var(--text);
}
.site-head .product-badge .mark { width: 26px; height: 26px; flex: 0 0 auto; display: block; }

/* Hidden until the page's own hero-lockup logo scrolls out of view (see the
   IntersectionObserver script at the bottom of pages that have a hero), so
   the brand isn't shown twice at once. Pages with no .hero-lockup (signup,
   the app itself) fall straight back to always-visible via that same script. */
.site-head .product-badge {
  opacity: 0;
  transform: translateY(-4px);
  transition: opacity 0.25s ease, transform 0.25s ease;
  pointer-events: none;
}
.site-head .product-badge.is-visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}
@media (prefers-reduced-motion: reduce) {
  .site-head .product-badge { transition: opacity 0.01ms; }
}

.hero-lockup {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin-bottom: 20px;
}
.hero-lockup .hero-mark { width: 76px; height: 76px; flex: 0 0 auto; }
.hero-lockup .hero-wordmark {
  font-family: var(--font-heading);
  font-size: 3.2rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
  line-height: 1;
}
@media (max-width: 720px) {
  .hero-lockup .hero-mark { width: 56px; height: 56px; }
  .hero-lockup .hero-wordmark { font-size: 2.4rem; }
}
@media (max-width: 600px) {
  .hero-lockup { gap: 10px; }
}
@media (max-width: 420px) {
  .hero-lockup .hero-mark { width: 44px; height: 44px; }
  .hero-lockup .hero-wordmark { font-size: 1.9rem; }
}

@media (max-width: 560px) { .brand-name .thin { display: none; } }
@media (max-width: 480px) { .site-head .wrap { padding: 0 16px; } .brand-name { font-size: 0.82rem; letter-spacing: 0.04em; } }
@media (max-width: 400px) { .brand-name { display: none; } }

.site-foot {
  border-top: 1px solid var(--border);
  padding: 40px 24px 32px;
  text-align: center;
}
.site-foot .flower { width: 36px; height: auto; margin: 0 auto 10px; display: block; opacity: 0.9; }
.site-foot .fb {
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 0.95rem;
  margin-bottom: 6px;
}
.site-foot .fb .thin { font-weight: 300; letter-spacing: 0.14em; }
.site-foot .links {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px 20px;
  margin: 16px 0;
  font-size: 0.85rem;
}
.site-foot .links a { color: var(--muted); text-decoration: none; }
.site-foot .links a:hover { color: var(--text); }
.site-foot .footer-social {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 14px;
  margin-bottom: 20px;
}
.site-foot .footer-social a { color: var(--muted); display: flex; }
.site-foot .footer-social a:hover { color: var(--accent); }
.site-foot .cp { font-size: 0.8rem; color: var(--muted); max-width: 620px; margin: 0 auto; }
