/* Cross-Sell Matrix — agoodun.com
   Brand tokens, type stack and component shapes follow BRAND.md and the
   other agoodun.com apps, so this sits alongside them without redoing
   the look per app. */

:root {
  --color-primary: #ce0f69;
  --color-secondary-teal: #009ca6;
  --color-secondary-purple: #68478d;
  --color-tertiary-gold: #ffb81c;
  --color-tertiary-black: #000000;

  /* The gap fill. Gold is the brand's opportunity colour and the only
     one used at scale in the grid — the ticks stay uncoloured, because
     a matrix that shouts about settled business hides the point of it. */
  --gap-fill: rgba(255, 184, 28, 0.24);
  --gap-fill-hover: rgba(255, 184, 28, 0.5);
  --gap-edge: rgba(255, 184, 28, 0.5);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* Several classes below set `display`, which has equal specificity to
   the UA [hidden] rule and would silently win by source order — leaving
   "hidden" elements visible. Force it explicitly. */
[hidden] {
  display: none !important;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  padding: 24px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: #f4f5f7;
  color: var(--color-tertiary-black);
}

a {
  color: inherit;
}

/* ---------------------------------------------------------------------
   App shell / nav
   --------------------------------------------------------------------- */

.app-shell {
  width: 100%;
  max-width: 720px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.app-shell.wide {
  max-width: 900px;
}

/* The matrix earns the extra width: every service is a column, and a
   column that has to be scrolled to is a column nobody looks at. */
.app-shell.widest {
  max-width: 1180px;
}

.nav-bar {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: #ffffff;
  border-radius: 16px;
  padding: 14px 20px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.06);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}

.nav-link {
  font-size: 0.88rem;
  font-weight: 600;
  color: #6b7280;
  text-decoration: none;
  padding: 8px 12px;
  border-radius: 8px;
  transition: background 0.15s ease, color 0.15s ease;
}

.nav-link:hover {
  background: #f4f5f7;
  color: var(--color-tertiary-black);
}

.nav-link.active {
  color: var(--color-primary);
  background: rgba(206, 15, 105, 0.08);
}

.nav-user {
  display: flex;
  align-items: center;
  gap: 12px;
}

.nav-email {
  font-size: 0.8rem;
  color: #6b7280;
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nav-logout {
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  color: #6b7280;
  background: none;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  padding: 7px 12px;
  cursor: pointer;
  transition: color 0.15s ease, border-color 0.15s ease;
}

.nav-logout:hover {
  color: var(--color-primary);
  border-color: var(--color-primary);
}

/* Inside a project the bar carries the project's identity on the left and
   its pages on the right, so you always know which project you're in. */

.nav-bar-project {
  justify-content: flex-start;
  gap: 20px;
}

.nav-bar-project .nav-links {
  flex: 1;
}

.nav-context {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.nav-back {
  font-size: 0.82rem;
  font-weight: 600;
  color: #6b7280;
  text-decoration: none;
  white-space: nowrap;
  transition: color 0.15s ease;
}

.nav-back:hover {
  color: var(--color-primary);
}

.nav-divider {
  width: 1px;
  height: 20px;
  background: #e5e7eb;
  flex-shrink: 0;
}

.nav-project-name {
  font-size: 1rem;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nav-app-name {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--color-tertiary-black);
  white-space: nowrap;
}

.nav-project-select {
  font-family: inherit;
  font-size: 1rem;
  font-weight: 700;
  color: var(--color-tertiary-black);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 4px 6px;
  max-width: 200px;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.nav-project-select:hover {
  background: #f4f5f7;
}

.nav-project-select:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(206, 15, 105, 0.12);
}

/* ---------------------------------------------------------------------
   Cards
   --------------------------------------------------------------------- */

.card {
  width: 100%;
  background: #ffffff;
  border-radius: 16px;
  padding: 32px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.06);
}

.card.accent {
  border-top: 6px solid transparent;
  border-image: linear-gradient(
    90deg,
    var(--color-primary),
    var(--color-secondary-teal),
    var(--color-secondary-purple),
    var(--color-tertiary-gold)
  );
  border-image-slice: 1;
}

.card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}

.page-title {
  margin-bottom: 4px;
}

h1 {
  font-size: 1.5rem;
  margin-bottom: 4px;
}

h2 {
  font-size: 1.1rem;
  margin-bottom: 4px;
}

.subtitle {
  font-size: 0.9rem;
  color: #6b7280;
  line-height: 1.4;
}

.status {
  font-size: 0.9rem;
  color: #6b7280;
  text-align: center;
  padding: 40px 0;
}

.status.error {
  color: var(--color-primary);
}

/* ---------------------------------------------------------------------
   Project cards (the home page)
   --------------------------------------------------------------------- */

.project-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
  width: 100%;
}

.project-card {
  cursor: pointer;
  transition: box-shadow 0.15s ease, transform 0.15s ease;
}

.project-card:hover {
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.1);
  transform: translateY(-2px);
}

.project-card:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

.project-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}

.project-card-head h2 {
  font-size: 1.15rem;
}

.project-card-actions {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
}

.project-figures {
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.project-amount {
  font-size: 1.6rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--color-tertiary-black);
}

.project-amount-note {
  font-size: 0.85rem;
  color: #6b7280;
}

.project-card-links {
  display: flex;
  gap: 10px;
  margin-top: 18px;
}

.project-card-links .btn-secondary {
  flex: 1;
  padding: 9px 14px;
  font-size: 0.85rem;
}

.progress-track {
  width: 100%;
  height: 10px;
  border-radius: 6px;
  overflow: hidden;
  background: #e5e7eb;
}

.progress-fill {
  height: 100%;
  background: var(--color-secondary-teal);
  transition: width 0.2s ease;
}

.progress-legend {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 8px;
  font-size: 0.8rem;
  color: #6b7280;
}

/* ---------------------------------------------------------------------
   Headline stats
   --------------------------------------------------------------------- */

.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

.stat {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 16px;
  border-radius: 10px;
  background: #f9fafb;
  min-width: 0;
}

.stat-label {
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--color-primary);
}

.stat-value {
  font-size: 1.3rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
}

/* The gap count is the headline figure of the whole app, so it carries
   the same colour the grid uses for a gap. */
.stat-value.gap {
  color: #b07400;
}

.stat-value.positive {
  color: var(--color-secondary-teal);
}

.stat-value.negative {
  color: var(--color-primary);
}

.stat-note {
  font-size: 0.78rem;
  color: #6b7280;
  line-height: 1.35;
}

/* ---------------------------------------------------------------------
   Month navigator
   --------------------------------------------------------------------- */

.month-nav {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin: 18px 0 22px;
  padding-bottom: 20px;
  border-bottom: 1px solid #f0f1f3;
}

.month-label {
  font-size: 1.05rem;
  font-weight: 700;
  min-width: 150px;
}

.month-note {
  font-size: 0.8rem;
  color: #6b7280;
}

.month-caption {
  margin-top: 18px;
  font-size: 0.82rem;
  color: #6b7280;
}

/* ---------------------------------------------------------------------
   The matrix
   --------------------------------------------------------------------- */

.grid-toolbar {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 18px;
}

.grid-search {
  width: auto;
  min-width: 220px;
  max-width: 300px;
  padding: 10px 14px;
  font-size: 0.9rem;
}

.grid-toolbar-note {
  font-size: 0.82rem;
  color: #6b7280;
}

.ticking-as {
  display: flex;
  flex-direction: column;
  gap: 4px;
  align-items: flex-end;
}

.ticking-as-label {
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--color-primary);
}

/* Who is ticking stopped being a choice once projects were shared with
   real accounts, so this reads as a statement rather than a control —
   the only thing still adjustable is the handle itself. */
.identity {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.identity-name {
  font-size: 0.95rem;
  font-weight: 700;
}

.identity-hint {
  font-size: 0.78rem;
  color: #b07400;
}

.badge-shared {
  display: inline-block;
  vertical-align: middle;
  margin-left: 8px;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--color-secondary-purple);
  background: rgba(104, 71, 141, 0.1);
}

.matrix-wrap {
  width: 100%;
  overflow-x: auto;
  padding-bottom: 4px;
}

/* `separate` rather than `collapse`: a collapsed table drops the borders
   of the sticky first column as it scrolls under the cells. */
.matrix {
  border-collapse: separate;
  border-spacing: 0;
}

.matrix-corner,
.matrix-client {
  position: sticky;
  left: 0;
  z-index: 2;
  background: #ffffff;
  text-align: left;
  font-size: 0.85rem;
  font-weight: 600;
  padding: 6px 14px 6px 0;
  min-width: 170px;
  max-width: 230px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  border-right: 1px solid #e5e7eb;
}

.matrix-corner {
  z-index: 3;
  vertical-align: bottom;
  padding-bottom: 12px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: #6b7280;
}

/* Service names run bottom-to-top so a thirteen-column matrix fits on
   screen at once. Horizontal headings would set the column width from
   the longest name and push half the grid out of view. */
.matrix-service {
  height: 150px;
  width: 46px;
  vertical-align: bottom;
  padding: 0 0 10px;
}

.matrix-service-label {
  display: inline-block;
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  max-height: 138px;
  overflow: hidden;
  white-space: nowrap;
  font-size: 0.8rem;
  font-weight: 600;
  color: #374151;
  text-align: left;
}

.matrix-tally-head .matrix-service-label {
  color: #6b7280;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.matrix-cell {
  padding: 2px;
}

.cell {
  display: block;
  width: 42px;
  height: 42px;
  border-radius: 8px;
  border: 1px solid transparent;
  background: none;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.12s ease, border-color 0.12s ease, transform 0.12s ease;
}

.cell:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 1px;
}

/* A gap is filled and a tick is not, which is the wrong way round until
   you remember what the grid is for: the blanks are the work. */
.cell-gap {
  background: var(--gap-fill);
  border-color: var(--gap-edge);
}

.cell-gap::after {
  content: "+";
  display: block;
  font-size: 1rem;
  font-weight: 600;
  line-height: 40px;
  color: #b07400;
  opacity: 0;
  transition: opacity 0.12s ease;
}

.cell-gap:hover {
  background: var(--gap-fill-hover);
}

.cell-gap:hover::after {
  opacity: 1;
}

/* A gap that was ticked last month. Marked with a dot rather than a
   different colour: it is still a gap, just the one with the shortest
   route to being filled. */
.cell-gap.lapsed {
  background:
    radial-gradient(circle at 50% 50%, #b07400 0 3px, transparent 3px) center / 100% 100% no-repeat,
    var(--gap-fill);
}

.cell-gap.lapsed:hover {
  background:
    radial-gradient(circle at 50% 50%, #b07400 0 3px, transparent 3px) center / 100% 100% no-repeat,
    var(--gap-fill-hover);
}

/* The dot and the hover "+" would sit on top of each other. */
.cell-gap.lapsed:hover::after {
  opacity: 0;
}

.cell-tick {
  background: #ffffff;
  border-color: #e5e7eb;
  color: var(--color-secondary-teal);
  font-size: 1rem;
  font-weight: 700;
  line-height: 1;
}

.cell-tick:hover {
  border-color: var(--color-secondary-teal);
}

/* A note is worth knowing about before you click, but not worth a second
   colour — a corner mark is enough. */
.cell-tick.has-note {
  background:
    linear-gradient(225deg, var(--color-secondary-purple) 0 7px, transparent 7px) top right / 14px 14px no-repeat,
    #ffffff;
}

.cell.saving {
  opacity: 0.5;
  cursor: default;
}

/* Stepping to another month refetches; dimming the grid says the figures
   on screen belong to the month you just left, not the one now named. */
.loading .matrix-wrap {
  opacity: 0.4;
  pointer-events: none;
  transition: opacity 0.15s ease;
}

.matrix-tally {
  padding: 6px 4px;
  text-align: center;
  font-size: 0.82rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: #374151;
  white-space: nowrap;
}

.matrix-tally-of {
  color: #9ca3af;
  font-weight: 600;
}

/* A service no client buys is the one number in the footer worth
   noticing on its own. */
.matrix-tally.none {
  color: #b07400;
}

.matrix tfoot .matrix-client,
.matrix tfoot .matrix-tally {
  padding-top: 12px;
  border-top: 1px solid #e5e7eb;
  color: #6b7280;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  font-weight: 700;
}

.matrix tfoot .matrix-tally {
  text-transform: none;
  letter-spacing: 0;
  font-size: 0.82rem;
}

.matrix-key {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px solid #f0f1f3;
  font-size: 0.82rem;
  color: #6b7280;
}

.matrix-key-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.key-swatch {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 6px;
  border: 1px solid transparent;
  flex-shrink: 0;
}

.key-gap {
  background: var(--gap-fill);
  border-color: var(--gap-edge);
}

.key-swatch.key-lapsed {
  background:
    radial-gradient(circle at 50% 50%, #b07400 0 3px, transparent 3px) center / 100% 100% no-repeat,
    var(--gap-fill);
}

.key-tick {
  background: #ffffff;
  border-color: #e5e7eb;
  color: var(--color-secondary-teal);
  font-size: 0.8rem;
  font-weight: 700;
}

/* ---------------------------------------------------------------------
   Cell detail popover
   --------------------------------------------------------------------- */

.cell-popover {
  position: absolute;
  z-index: 40;
  width: 250px;
  background: #ffffff;
  border-radius: 12px;
  padding: 16px 18px;
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.16);
  border: 1px solid #e5e7eb;
}

.cell-popover-head {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-bottom: 12px;
}

.cell-popover-head strong {
  font-size: 0.95rem;
}

.cell-popover-head span {
  font-size: 0.82rem;
  color: #6b7280;
}

.cell-popover-meta {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.cell-popover-meta > div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 0.85rem;
}

.cell-popover-meta dt {
  color: #6b7280;
}

.cell-popover-meta dd {
  font-weight: 600;
  text-align: right;
}

.cell-popover-note {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid #f0f1f3;
  font-size: 0.85rem;
  line-height: 1.45;
  color: #374151;
}

.cell-popover-actions {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-top: 12px;
  padding-top: 8px;
  border-top: 1px solid #f0f1f3;
}

/* ---------------------------------------------------------------------
   Editable lists (clients, services, people)
   --------------------------------------------------------------------- */

.list-card + .list-card {
  margin-top: 20px;
}

.list-add {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-bottom: 8px;
}

.list-add .text-input {
  flex: 1;
  min-width: 0;
}

.item-list {
  list-style: none;
  margin-top: 8px;
}

.item-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid #f0f1f3;
}

.item-row:last-child {
  border-bottom: none;
}

.item-order {
  width: 22px;
  flex-shrink: 0;
  font-size: 0.78rem;
  font-variant-numeric: tabular-nums;
  color: #9ca3af;
  text-align: right;
}

.item-name {
  flex: 1;
  min-width: 0;
  font-size: 0.92rem;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
}

.item-meta {
  font-size: 0.78rem;
  color: #6b7280;
  white-space: nowrap;
}

.item-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.list-empty {
  padding: 18px 0;
  font-size: 0.88rem;
  color: #6b7280;
  text-align: center;
}

/* ---------------------------------------------------------------------
   Buttons
   --------------------------------------------------------------------- */

.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 12px 22px;
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  white-space: nowrap;
  color: #ffffff;
  background: var(--color-primary);
  border: none;
  border-radius: 10px;
  cursor: pointer;
  transition: box-shadow 0.15s ease;
  text-decoration: none;
}

.btn-primary:hover {
  box-shadow: 0 0 0 3px rgba(206, 15, 105, 0.12);
}

.btn-primary:disabled {
  opacity: 0.6;
  cursor: default;
  box-shadow: none;
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 11px 20px;
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  white-space: nowrap;
  color: var(--color-tertiary-black);
  background: #ffffff;
  border: 1px solid #d1d5db;
  border-radius: 10px;
  cursor: pointer;
  transition: border-color 0.15s ease;
  text-decoration: none;
}

.btn-secondary:hover {
  border-color: var(--color-primary);
}

.btn-text {
  display: inline-block;
  padding: 6px;
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  color: #6b7280;
  background: none;
  border: none;
  cursor: pointer;
  transition: color 0.15s ease;
  text-decoration: none;
}

.btn-text:hover {
  color: var(--color-tertiary-black);
}

.btn-text.danger:hover {
  color: var(--color-primary);
}

.btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  flex-shrink: 0;
  font-size: 0.95rem;
  color: #6b7280;
  background: #f9fafb;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.btn-icon:hover {
  background: rgba(206, 15, 105, 0.1);
  color: var(--color-primary);
}

.btn-icon:disabled {
  opacity: 0.35;
  cursor: default;
  background: #f9fafb;
  color: #6b7280;
}

.btn-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.btn-primary.danger {
  background: var(--color-primary);
}

.header-actions {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

/* ---------------------------------------------------------------------
   Forms
   --------------------------------------------------------------------- */

.input-group {
  margin-bottom: 20px;
}

.input-group:last-child {
  margin-bottom: 0;
}

label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 6px;
  color: #374151;
}

.field-hint {
  font-size: 0.78rem;
  color: #6b7280;
  margin-top: 6px;
  line-height: 1.4;
}

.text-input,
.text-select {
  display: block;
  width: 100%;
  padding: 12px 14px;
  font-family: inherit;
  font-size: 0.95rem;
  color: var(--color-tertiary-black);
  background: #ffffff;
  border: 1px solid #d1d5db;
  border-radius: 10px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.text-input:focus,
.text-select:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(206, 15, 105, 0.12);
}

.text-select {
  cursor: pointer;
}

.note-input {
  resize: vertical;
  line-height: 1.5;
}

.project-select {
  width: auto;
  min-width: 180px;
  max-width: 240px;
  padding: 10px 12px;
  font-weight: 600;
}

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.9rem;
  font-weight: 600;
  color: #374151;
  cursor: pointer;
  margin-bottom: 0;
}

.checkbox-row input {
  width: 16px;
  height: 16px;
  accent-color: var(--color-primary);
  cursor: pointer;
}

.form-error {
  margin-top: 10px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--color-primary);
}

.panel-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* ---------------------------------------------------------------------
   Auth gate
   --------------------------------------------------------------------- */

.auth-landing {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 28px;
  margin: 40px auto;
}

.hero-copy {
  width: 100%;
  max-width: 480px;
  text-align: center;
}

.hero-copy h1 {
  font-size: 1.8rem;
  margin-bottom: 10px;
}

.hero-tagline {
  font-size: 1rem;
  color: #6b7280;
  line-height: 1.5;
  margin-bottom: 22px;
}

.hero-features {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
  text-align: left;
}

.hero-features li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 0.9rem;
  color: #374151;
  line-height: 1.4;
}

.hero-features li::before {
  content: "✓";
  flex-shrink: 0;
  color: var(--color-secondary-teal);
  font-weight: 700;
}

.auth-shell {
  width: 100%;
  max-width: 400px;
  margin: 0 auto;
}

/* ---------------------------------------------------------------------
   Empty states
   --------------------------------------------------------------------- */

.empty-state {
  text-align: center;
  padding: 48px 24px;
  color: #6b7280;
}

.empty-state p {
  font-size: 0.9rem;
  margin-top: 6px;
}

/* ---------------------------------------------------------------------
   Biggest openings
   --------------------------------------------------------------------- */
/* The brand's result-row pattern, as used across the agoodun apps: a
   coloured dot, a label with a secondary line, and a right-aligned
   figure. */

.results {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 20px;
}

.result-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 10px;
  background: #f9fafb;
}

.result-label {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.result-label > div {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.result-title {
  font-size: 0.95rem;
  font-weight: 600;
}

.result-percent {
  font-size: 0.8rem;
  color: #6b7280;
}

.result-amount {
  font-size: 1.15rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* ---------------------------------------------------------------------
   Modal
   --------------------------------------------------------------------- */

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  z-index: 50;
}

.modal-card {
  width: 100%;
  max-width: 460px;
  max-height: 90vh;
  overflow-y: auto;
  background: #ffffff;
  border-radius: 16px;
  padding: 28px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.2);
}

/* ---------------------------------------------------------------------
   Explainer
   --------------------------------------------------------------------- */

.explainer {
  width: 100%;
  background: #ffffff;
  border-radius: 16px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.06);
  overflow: hidden;
}

.explainer summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 24px;
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--color-tertiary-black);
}

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

.explainer summary:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: -2px;
}

.explainer summary::after {
  content: "";
  width: 8px;
  height: 8px;
  flex-shrink: 0;
  border-right: 2px solid #6b7280;
  border-bottom: 2px solid #6b7280;
  transform: rotate(45deg);
  transition: transform 0.2s ease;
}

.explainer[open] summary::after {
  transform: rotate(-135deg);
}

.explainer[open] summary {
  border-bottom: 1px solid #f0f1f3;
}

.explainer-content {
  padding: 4px 24px 24px;
}

.explainer-content h2 {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--color-primary);
  margin-top: 18px;
  margin-bottom: 6px;
}

.explainer-content h2:first-child {
  margin-top: 0;
}

.explainer-content p {
  font-size: 0.9rem;
  line-height: 1.55;
  color: #374151;
}

/* ---------------------------------------------------------------------
   Footer credit
   --------------------------------------------------------------------- */

.powered-by a {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  color: #6b7280;
  font-size: 0.85rem;
  transition: color 0.15s ease;
}

.powered-by a:hover {
  color: var(--color-tertiary-black);
}

.powered-by-logo {
  width: 20px;
  height: 20px;
  border-radius: 5px;
}

.powered-by strong {
  color: var(--color-primary);
  font-weight: 700;
}

/* ---------------------------------------------------------------------
   Responsive
   --------------------------------------------------------------------- */

@media (max-width: 760px) {
  .stat-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .project-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  body {
    padding: 16px;
  }

  .nav-bar {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  .nav-user {
    justify-content: space-between;
  }

  .nav-bar-project {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }

  .nav-context {
    justify-content: flex-start;
  }

  .nav-project-select {
    max-width: none;
    flex: 1;
  }

  .nav-email {
    max-width: none;
  }

  .card {
    padding: 20px;
  }

  .card-header {
    flex-direction: column;
    align-items: stretch;
    gap: 14px;
  }

  .card-header .header-actions {
    width: 100%;
  }

  .header-actions .btn-primary,
  .header-actions .project-select,
  .header-actions .ticking-as {
    width: 100%;
    max-width: none;
  }

  .ticking-as {
    align-items: flex-start;
  }

  .grid-toolbar {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }

  .month-label {
    min-width: 0;
    flex: 1;
  }

  .month-note {
    width: 100%;
  }

  .grid-search {
    width: 100%;
    max-width: none;
  }

  /* The client column keeps a visible sliver of the next service column
     rather than filling the width: a full-bleed sticky column reads as
     "nothing else here" even when the grid scrolls. */
  .matrix-corner,
  .matrix-client {
    min-width: min(52vw, 170px);
    max-width: min(52vw, 170px);
  }

  .list-add {
    flex-direction: column;
    align-items: stretch;
  }

  .item-row {
    flex-wrap: wrap;
  }

  .item-meta {
    order: 3;
    width: 100%;
    padding-left: 34px;
  }
}

/* The stats deliberately stay two-up on the narrowest phones rather than
   stacking: four full-width cards would push the grid itself — the only
   thing anyone opens this page for — off the bottom of the screen. */
