/*
 * home.css — the home page (`tally:home`, 2026-10-25, Almon; Morning's home as
 * a reference, Tally's own look). Key figures + quick actions redone as glass
 * 2026-10-25 (`tally:home-pane`, Almon picked "A · חלון אחד"). Colours come from the tokens, so all three
 * designs (C glass, M etched, M · בצבע) and dark mode follow. Tints keep the
 * app's meaning of colour: green = money in, red = money owed, amber = needs a look.
 */

.home { display: flex; flex-direction: column; gap: 22px; padding-block-end: 12px; }

/* ---- who ---- */
.home-who { display: flex; align-items: center; gap: 14px; padding-block-start: 6px; }
.home-who__logo { flex: none; inline-size: 56px; block-size: 56px; border-radius: 50%; object-fit: cover; background: var(--bg-raise); box-shadow: var(--shadow-sm), 0 0 0 1px var(--border); }
.home-who__logo--initial { display: grid; place-items: center; color: var(--accent); font-size: 1.5rem; font-weight: 700; }
.home-who__text { display: flex; flex-direction: column; min-inline-size: 0; }
.home-who__biz { color: var(--text-muted); font-size: 0.875rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.home-who__biz--switch { border: 0; background: none; padding: 0; font: inherit; font-weight: 600; text-align: start; cursor: pointer; color: var(--text-muted); }
.home-who__hello { margin: 2px 0 0; font-size: 1.625rem; font-weight: 700; line-height: 1.2; color: var(--text); }
.home-who__date { color: var(--text-muted); font-size: 0.8125rem; }

/* ---- key figures: one glass pane (`tally:home-pane`, Almon's pick A · חלון אחד) ---- */
.home {
  --home-line: color-mix(in srgb, var(--text) 10%, transparent);
  --home-lens-a: rgba(255, 255, 255, 0.62);
  --home-lens-b: rgba(255, 255, 255, 0.22);
  --home-lens-hi: rgba(255, 255, 255, 0.9);
  --home-lens-rim: rgba(255, 255, 255, 1);
  --home-lens-rim-low: rgba(255, 255, 255, 0.16);
}
.home-pane {
  position: relative; padding: 20px 20px 6px; border-radius: var(--radius-lg);
  background: var(--surface); backdrop-filter: var(--surface-blur); -webkit-backdrop-filter: var(--surface-blur);
  border: 1px solid rgba(255, 255, 255, 0.6); box-shadow: var(--shadow-sm);
}
.home-pane.is-skeleton { min-block-size: 260px; animation: home-pulse 1.4s ease-in-out infinite; }
@keyframes home-pulse { 50% { opacity: 0.55; } }
:where(.home-pane) button { border: 0; background: none; font: inherit; color: inherit; text-align: start; cursor: pointer; border-radius: 14px; }
.home-pane button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.home-pane__hero { display: grid; grid-template-columns: 1fr auto; align-items: end; gap: 4px 12px; inline-size: 100%; padding: 0 0 16px; }
.home-pane__k { grid-column: 1 / -1; color: var(--text-muted); font-size: 0.875rem; font-weight: 600; }
.home-pane__big { min-inline-size: 0; font-family: "Heebo", system-ui, sans-serif; font-weight: 300; font-size: 3rem; line-height: 1; letter-spacing: -0.015em; color: var(--text); white-space: nowrap; }
.home-pane__big.is-long { font-size: 2.25rem; }
.home-pane__go { align-self: center; padding: 7px 13px; border-radius: 999px; font-size: 0.8125rem; font-weight: 600; white-space: nowrap; color: var(--accent); }
.home-pane__n { grid-column: 1 / -1; color: var(--text-muted); font-size: 0.8125rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.home-pane__dot { display: inline-block; inline-size: 6px; block-size: 6px; margin-inline-end: 6px; border-radius: 50%; vertical-align: 1px; background: var(--text-muted); }
.home-pane__dot--collect { background: var(--neg); }
.home-pane__dot--income { background: var(--pos); }
.home-pane__dot--expense, .home-pane__dot--tasks { background: var(--accent-2); }
.home-pane__dot--invoice, .home-pane__dot--calls { background: var(--amber); }
.home-pane__dot--jobs { background: var(--accent); }
.home-pane__grid { display: grid; grid-template-columns: 1fr 1fr; }
.home-pane__cell { display: flex; flex-direction: column; gap: 2px; min-inline-size: 0; border-radius: 0; padding: 14px 4px; border-block-start: 1px solid var(--home-line); }
.home-pane__cell:nth-child(odd) { padding-inline-end: 14px; border-inline-end: 1px solid var(--home-line); }
.home-pane__cell:nth-child(even) { padding-inline-start: 14px; }
.home-pane__grid.is-odd .home-pane__cell:last-child { grid-column: 1 / -1; border-inline-end: 0; }
.home-pane__l { color: var(--text-muted); font-size: 0.8125rem; font-weight: 600; }
.home-pane__v { font-family: "Heebo", system-ui, sans-serif; font-weight: 300; font-size: 1.625rem; line-height: 1.15; letter-spacing: -0.01em; color: var(--text); }
.home-pane__cell .home-pane__n { font-size: 0.75rem; }
button.home-pane__hero:active, button.home-pane__cell:active { opacity: 0.7; }

/* A clear glass lens: the quick actions and the pane's "go" chip. */
.home-lens {
  position: relative; display: grid; place-items: center; color: var(--accent);
  background: linear-gradient(160deg, var(--home-lens-a), var(--home-lens-b));
  backdrop-filter: blur(14px) saturate(130%); -webkit-backdrop-filter: blur(14px) saturate(130%);
  box-shadow: inset 0 1px 0 var(--home-lens-hi), 0 8px 18px -12px rgba(30, 36, 48, 0.45);
}
.home-lens::after {
  content: ""; position: absolute; inset: 0; padding: 1px; border-radius: inherit; pointer-events: none;
  background: conic-gradient(from 210deg, var(--home-lens-rim), var(--home-lens-rim-low) 22%, var(--home-lens-rim) 48%, var(--home-lens-rim-low) 74%, var(--home-lens-rim));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude;
}

/* ---- quick actions: square glass lenses, four to a row ---- */
.home-h { margin: 0 0 10px; font-size: 1.0625rem; font-weight: 700; }
.home-acts__grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px 8px; }
.home-act { display: flex; flex-direction: column; align-items: center; gap: 7px; min-inline-size: 0; padding: 2px 0; border: 0; background: none; font: inherit; color: var(--text); cursor: pointer; }
.home-act__ic { inline-size: 58px; block-size: 58px; border-radius: 18px; transition: transform 0.15s ease; }
.home-act__ic::before { content: ""; position: absolute; inset: 5px; border-radius: 13px; border: 1px solid var(--home-lens-hi); opacity: 0.75; pointer-events: none; }
.home-act:active .home-act__ic { transform: scale(0.94); }
.home-act__ic svg { inline-size: 24px; block-size: 24px; }
.home-act__label { font-size: 0.8125rem; line-height: 1.25; text-align: center; }
.home-acts:not(.is-open) .home-act.is-extra { display: none; }

/* ---- blocks and rows ---- */
.home__cols { display: grid; gap: 22px; }
.home__col { display: flex; flex-direction: column; gap: 22px; min-inline-size: 0; }
.home-block { padding: 16px; border-radius: var(--radius-lg); background: var(--surface); backdrop-filter: var(--surface-blur); -webkit-backdrop-filter: var(--surface-blur); box-shadow: var(--shadow-sm); border: 1px solid rgba(255, 255, 255, 0.6); }
.home-block__h { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.home-link { border: 0; background: none; padding: 0; color: var(--accent); font: inherit; font-size: 0.8125rem; font-weight: 600; cursor: pointer; white-space: nowrap; }
.home-list { display: flex; flex-direction: column; }
.home-item { display: flex; align-items: center; gap: 12px; inline-size: 100%; min-block-size: 52px; padding: 8px 2px; border: 0; border-block-end: 1px solid var(--border); background: none; font: inherit; color: var(--text); text-align: start; cursor: pointer; }
.home-item:last-child { border-block-end: 0; }
.home-item__ic { flex: none; display: grid; place-items: center; inline-size: 36px; block-size: 36px; border-radius: 12px; background: var(--accent-soft); color: var(--accent); }
.home-item__ic svg { inline-size: 18px; block-size: 18px; }
.home-item__tx { flex: 1 1 auto; display: flex; flex-direction: column; min-inline-size: 0; }
.home-item__t { font-weight: 600; font-size: 0.9375rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.home-item__m { color: var(--text-muted); font-size: 0.8125rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.home-item__side { flex: none; font-size: 0.875rem; font-weight: 600; color: var(--text-muted); }
.home-item.is-income .home-item__ic, .home-item.is-income .home-item__side { color: var(--pos); }
.home-item.is-income .home-item__ic { background: color-mix(in srgb, var(--pos) 13%, transparent); }
.home-item.is-owed .home-item__side { color: var(--neg); }
.home-item.is-late .home-item__ic { background: color-mix(in srgb, var(--neg) 12%, transparent); color: var(--neg); }
.home-item.is-late .home-item__side { color: var(--neg); }
.home-item.is-warn .home-item__ic { background: color-mix(in srgb, var(--amber) 15%, transparent); color: var(--amber); }
.home-item.is-warn .home-item__side { color: var(--amber); }
.home-more { margin: 6px 0 0; color: var(--text-muted); font-size: 0.8125rem; }

.home-month { display: grid; gap: 14px; margin-block-start: 4px; }
.home-bar__top { display: flex; justify-content: space-between; font-size: 0.9375rem; }
.home-bar__track { block-size: 10px; margin-block: 6px 4px; border-radius: 999px; background: color-mix(in srgb, var(--text-muted) 14%, transparent); overflow: hidden; }
.home-bar__fill { display: block; block-size: 100%; border-radius: inherit; background: var(--accent-2); transition: inline-size 0.6s cubic-bezier(.2,.8,.2,1); }
.home-bar.is-in .home-bar__fill { background: var(--pos); }
.home-bar__was { color: var(--text-muted); font-size: 0.75rem; }
.home-month__net { display: flex; justify-content: space-between; padding-block-start: 10px; border-block-start: 1px solid var(--border); font-weight: 600; }
.home-month__net .is-positive { color: var(--pos); }
.home-month__net .is-negative { color: var(--neg); }
.home-month__note { margin: 0; color: var(--text-muted); font-size: 0.8125rem; }

.home-doc-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-block: 2px 8px; }
.home-chip { padding: 6px 12px; border: 0; border-radius: 999px; background: var(--accent-soft); color: var(--accent); font: inherit; font-size: 0.8125rem; font-weight: 600; cursor: pointer; }

/* Computer: the big figure beside the other four in one row; all actions in one row. */
@media (min-width: 1024px) {
  #app.screen-home { max-inline-size: 1040px; }
  .home-pane { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 3fr); align-items: center; gap: 0 24px; padding: 22px 24px; }
  .home-pane__hero { grid-template-columns: 1fr; padding: 0 0 0 22px; border-inline-end: 1px solid var(--home-line); }
  .home-pane__big { font-size: 2.6rem; }
  .home-pane__big.is-long { font-size: 2rem; }
  .home-pane__go { grid-row: 4; justify-self: start; margin-block-start: 8px; }
  .home-pane__grid, .home-pane__grid.is-odd { grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); }
  .home-pane__cell, .home-pane__cell:nth-child(odd), .home-pane__cell:nth-child(even), .home-pane__grid.is-odd .home-pane__cell:last-child { grid-column: auto; padding: 4px 14px; border: 0; }
  .home-pane__cell + .home-pane__cell { border-inline-start: 1px solid var(--home-line); }
  .home-acts__grid { grid-template-columns: repeat(auto-fit, minmax(84px, 1fr)); }
  .home-acts:not(.is-open) .home-act.is-extra { display: flex; }
  .home-act--more { display: none; }
  .home__cols { grid-template-columns: 1.1fr 1fr; align-items: start; }
}

/* M designs: frosted panes with the etched line, the selected clear ring. */
html[data-design="etched"] .home-block { outline: 1px solid color-mix(in srgb, var(--text) 10%, transparent); outline-offset: -7px; }
html[data-design="etched"] .home-pane { border-color: var(--border); outline: 1px solid var(--etch); outline-offset: -7px; }

/* Dark: cards on the dark raise colour. */
html[data-mode="dark"] .home-block,
html[data-mode="dark"] .home-pane { border-color: rgba(255, 255, 255, 0.06); }
html[data-mode="dark"] .home {
  --home-lens-a: rgba(255, 255, 255, 0.14);
  --home-lens-b: rgba(255, 255, 255, 0.04);
  --home-lens-hi: rgba(255, 255, 255, 0.22);
  --home-lens-rim: rgba(255, 255, 255, 0.4);
  --home-lens-rim-low: rgba(255, 255, 255, 0.05);
}

@media (prefers-reduced-motion: reduce) {
  .home-act__ic, .home-bar__fill { transition: none; }
  .home-pane.is-skeleton { animation: none; }
}

/* ---- Business-type features (`tally:biz-types`, 2026-10-29) --------------- */
.home-setup__bar { margin-block: 2px 10px; }
.home-setup__grid { display: grid; grid-template-columns: 1fr; gap: 6px; }
@media (min-width: 720px) { .home-setup__grid { grid-template-columns: repeat(2, 1fr); } }
.home-setup__step {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px; min-block-size: 52px;
  border: 0; border-radius: 14px; background: var(--surface); box-shadow: inset 0 0 0 1px var(--border);
  font: inherit; color: inherit; text-align: start; cursor: pointer;
}
.home-setup__step:disabled { cursor: default; opacity: 0.6; }
.home-setup__tick {
  flex: none; inline-size: 24px; block-size: 24px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; font-size: 0.8125rem;
  box-shadow: inset 0 0 0 1.5px var(--border);
}
.home-setup__step.is-done .home-setup__tick { background: var(--pos); color: #fff; box-shadow: none; }
.home-cap { display: flex; flex-direction: column; gap: 8px; }
.home-cap .home-bar__fill { background: var(--accent); }
.home-cap.is-near .home-bar__fill { background: var(--amber); }
.home-cap.is-over .home-bar__fill { background: var(--neg); }
.home-cap__msg { margin: 0; font-size: 0.875rem; line-height: 1.55; }
.home-cap.is-over .home-cap__msg { color: var(--neg); }
.home-report { display: flex; flex-direction: column; gap: 8px; }
.home-vat { display: flex; flex-direction: column; gap: 4px; }
.home-vat__row { display: flex; justify-content: space-between; gap: 12px; font-size: 0.875rem; color: var(--text-muted); }
.home-vat__row b { color: var(--text); font-weight: 500; }
.home-vat__row.is-total { padding-block-start: 6px; border-block-start: 1px solid var(--border); color: var(--text); font-weight: 600; }
.home-vat__row.is-total b { font-weight: 700; }
