/* GROW Mentoring brand: blue #096AD3, light-blue cards, Jost for UI text,
   serif display headings — matching growmentoring.org. */

[hidden] {
  display: none !important;
}

@font-face {
  font-family: "Jost";
  src: url("/assets/fonts/Jost-regular.ttf") format("truetype");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "Jost";
  src: url("/assets/fonts/Jost-bold.ttf") format("truetype");
  font-weight: 700;
  font-display: swap;
}

:root {
  --blue: #096AD3;
  --blue-dark: #0857ab;
  --blue-pale: #dbeeff;
  --blue-wash: #f2f8ff;
  --ink: #16233b;
  --muted: #5b6b84;
  --line: #d8e2ef;
  --danger: #b3261e;
  --radius: 14px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Jost", "Segoe UI", system-ui, sans-serif;
  color: var(--ink);
  background: var(--blue-wash);
  min-height: 100vh;
}

.serif { font-family: Georgia, "Times New Roman", serif; color: var(--blue); font-weight: 400; }

/* ---------- login ---------- */
.login-view {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 48px;
  background: #fff;
}
.login-card {
  text-align: center;
  padding: 48px 40px;
  max-width: 420px;
  width: calc(100% - 32px);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 24px;
  box-shadow: 0 12px 40px rgba(9, 106, 211, 0.10);
}
.login-mark { width: 96px; height: auto; margin-bottom: 8px; }
.login-card h1 { font-size: 2.2rem; margin: 8px 0 4px; }
.login-sub { color: var(--muted); margin: 0 0 24px; }
.google-btn-holder { display: flex; justify-content: center; min-height: 44px; }
.dev-login { display: flex; gap: 8px; justify-content: center; margin-top: 16px; }
.dev-login input { flex: 1; }
.dev-accounts { display: flex; flex-direction: column; gap: 10px; margin-top: 8px; }
.dev-accounts .btn { width: 100%; }
.dev-note { color: var(--muted); font-size: 0.85rem; margin-top: 14px; }

.ticker {
  width: 100%;
  overflow: hidden;
  white-space: nowrap;
  color: var(--blue);
  font-weight: 700;
  font-size: 1.4rem;
  opacity: 0.85;
  padding: 10px 0;
  border-top: 1px solid var(--line);
}

/* ---------- app chrome ---------- */
.app-header {
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 14px 28px;
  background: #fff;
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 5;
  flex-wrap: wrap;
}
.brand { display: flex; align-items: center; gap: 12px; }
.brand-mark { width: 44px; height: 44px; }
.brand-text { display: flex; flex-direction: column; line-height: 1; }
.brand-name { color: var(--blue); font-weight: 700; font-size: 1.5rem; letter-spacing: 0.18em; }
.brand-sub { color: var(--muted); font-size: 0.8rem; letter-spacing: 0.28em; text-transform: uppercase; margin-top: 3px; }

.tabs { display: flex; gap: 4px; flex: 1; }
.tab {
  border: 0;
  background: none;
  font: inherit;
  font-weight: 700;
  color: var(--blue);
  padding: 10px 18px;
  border-radius: 999px;
  cursor: pointer;
}
.tab:hover { background: var(--blue-pale); }
.tab.active { background: var(--blue); color: #fff; }

.user-chip { display: flex; align-items: center; gap: 12px; color: var(--muted); }

.container { max-width: 980px; margin: 0 auto; padding: 32px 20px 80px; }
.page-title { font-size: 2.4rem; margin: 8px 0 20px; text-align: center; }

/* ---------- panels & forms ---------- */
.panel {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 28px;
  box-shadow: 0 6px 24px rgba(9, 106, 211, 0.06);
}
.panel + .panel { margin-top: 20px; }
.panel-inset {
  background: var(--blue-pale);
  border-radius: var(--radius);
  padding: 18px 22px;
  margin: 18px 0;
}

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-bottom: 6px; }
@media (max-width: 720px) { .grid-2 { grid-template-columns: 1fr; } }

.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; }
.field > span { font-weight: 700; color: var(--ink); }
.field small { font-weight: 400; color: var(--muted); }
.invoice-number-field { max-width: 380px; margin-bottom: 20px; }
.invoice-number-control { display: flex; align-items: stretch; width: max-content; }
.invoice-number-prefix {
  display: flex;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-right: 0;
  border-radius: 10px 0 0 10px;
  background: var(--blue-pale);
  color: var(--blue);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.invoice-number-control .invoice-number-suffix {
  width: 76px;
  border-radius: 0 10px 10px 0;
  text-align: center;
  font-weight: 700;
  letter-spacing: 0.12em;
  font-variant-numeric: tabular-nums;
}
.field .field-help { margin-top: -2px; }

input, textarea {
  font: inherit;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
}
input:focus, textarea:focus { outline: 2px solid var(--blue); outline-offset: 0; border-color: var(--blue); }

.items-fieldset { border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; margin: 10px 0 14px; }
.items-fieldset legend { font-weight: 700; padding: 0 8px; }
.item-row { display: grid; grid-template-columns: 1fr 170px 40px; gap: 10px; margin-bottom: 10px; align-items: center; }
.item-row .amount-input { text-align: right; }
.item-remove {
  border: 0; background: none; color: var(--muted); font-size: 1.2rem; cursor: pointer; border-radius: 8px;
}
.item-remove:hover { color: var(--danger); background: #fdecea; }
@media (max-width: 720px) { .item-row { grid-template-columns: 1fr 120px 36px; } }

.vat-toggle { display: flex; align-items: center; gap: 10px; margin: 10px 0; cursor: pointer; }
.vat-toggle input { width: 18px; height: 18px; accent-color: var(--blue); }

.breakdown table { width: 100%; border-collapse: collapse; }
.breakdown td { padding: 4px 0; }
.breakdown td.num { text-align: right; font-variant-numeric: tabular-nums; }
.breakdown .total-line td { border-top: 2px solid var(--blue); font-weight: 700; padding-top: 8px; }
.breakdown .muted { color: var(--muted); }

/* ---------- buttons ---------- */
.btn {
  display: inline-block;
  border: 0;
  font: inherit;
  font-weight: 700;
  border-radius: 999px;
  padding: 10px 22px;
  cursor: pointer;
  text-decoration: none;
  text-align: center;
}
.btn-primary { background: var(--blue); color: #fff; }
.btn-primary:hover { background: var(--blue-dark); }
.btn-secondary { background: var(--blue-pale); color: var(--blue); }
.btn-secondary:hover { background: #c8e2fb; }
.btn-ghost { background: none; color: var(--blue); padding: 8px 12px; }
.btn-ghost:hover { background: var(--blue-pale); }
.btn-large { width: 100%; padding: 14px; font-size: 1.1rem; margin-top: 6px; }
.btn[disabled] { opacity: 0.55; cursor: wait; }
.btn-danger-ghost { background: none; color: var(--danger); padding: 6px 10px; }
.btn-danger-ghost:hover { background: #fdecea; }

.hint { color: var(--muted); font-size: 0.9rem; }
.error { color: var(--danger); font-weight: 700; }

/* ---------- success card ---------- */
.success-card { margin-top: 22px; text-align: center; border: 2px solid var(--blue); }
.success-card h2 { font-size: 1.9rem; margin: 4px 0 8px; }
.download-row { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin-top: 16px; }

/* ---------- tables ---------- */
.search { width: 100%; margin-bottom: 14px; }
.table-wrap { overflow-x: auto; }
.history-table { width: 100%; border-collapse: collapse; font-size: 0.95rem; }
.history-table th {
  text-align: left; color: var(--blue); text-transform: uppercase; letter-spacing: 0.06em;
  font-size: 0.75rem; padding: 8px 10px; border-bottom: 2px solid var(--blue);
}
.history-table td { padding: 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.history-table td.num { text-align: right; font-variant-numeric: tabular-nums; }
.history-table tr.voided td { color: var(--muted); }
.history-table tr.voided .inv-number { text-decoration: line-through; }
.badge {
  display: inline-block; border-radius: 999px; padding: 2px 10px; font-size: 0.75rem; font-weight: 700;
  background: var(--blue-pale); color: var(--blue);
}
.badge-void { background: #fdecea; color: var(--danger); }
.dl-link { color: var(--blue); font-weight: 700; text-decoration: none; margin-right: 10px; }
.dl-link:hover { text-decoration: underline; }

.add-user-row { display: flex; gap: 12px; align-items: center; margin: 14px 0; flex-wrap: wrap; }
.add-user-row input[type="email"] { flex: 1; min-width: 220px; }
