/* Umbrella — app layout on top of zap's theme tokens. Colours come only from
   var(--zap-*), so light / dark follow the theme without extra rules. */

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: var(--zap-bg, #fff); }
#app { min-height: 100%; }
.app-root, .app-root__view { min-height: 100vh; }
.muted { color: var(--zap-muted); }
.boot { display: grid; place-items: center; min-height: 100vh; }

/* shell */
.shell { display: flex; align-items: stretch; min-height: 100vh; }
.shell__main { flex: 1; min-width: 0; background: var(--zap-elevated); }
.page { padding: 28px 32px 48px; max-width: 1400px; margin: 0 auto; display: grid; gap: 20px; align-content: start; }
@media (max-width: 900px) {
  .shell { flex-direction: column; }
  .page { padding: 16px; }
}

.brand { display: flex; align-items: center; gap: 10px; }
.brand__logo { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 10px; font-size: 20px;
  background: var(--zap-primary); color: var(--zap-primary-contrast); }
.brand b { display: block; font-size: 16px; }
.brand small { display: block; color: var(--zap-muted); font-size: 12px; }
.side-user { width: 100%; }
.side-user__btn { all: unset; box-sizing: border-box; cursor: pointer; width: 100%; padding: 6px; border-radius: var(--zap-radius-sm); }
.side-user__btn:hover, .side-user__btn:focus-visible { background: var(--zap-primary-soft); }

/* page header */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.page-head__title { margin: 0; font-size: 24px; letter-spacing: -.01em; }
.page-head__sub { margin: 4px 0 0; color: var(--zap-muted); }
.page-head__actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* layout helpers */
.stack { display: grid; gap: 14px; }
.stack--tight { display: grid; gap: 8px; }
.cluster { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.spread { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.grid-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; align-items: start; }
@media (max-width: 900px) { .grid-2, .grid-3 { grid-template-columns: 1fr; } }

/* definition lists (read-only company info) */
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px 24px; margin: 0; }
.facts div { min-width: 0; }
.facts dt { font-size: 12px; color: var(--zap-muted); text-transform: uppercase; letter-spacing: .04em; }
.facts dd { margin: 2px 0 0; font-weight: 500; overflow-wrap: anywhere; }

/* editable child lists (owners, employees…) */
.rows { display: grid; gap: 10px; }
.rows__item { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)) auto; align-items: end;
  padding: 12px; border: 1px solid var(--zap-border); border-radius: var(--zap-radius-sm); background: var(--zap-surface); }
.rows__empty { color: var(--zap-muted); padding: 12px 0; }
.rows__total { font-size: 13px; color: var(--zap-muted); }
.rows__total.is-bad { color: var(--zap-danger); font-weight: 600; }

/* sticky save bar on long forms */
.savebar { position: sticky; bottom: 0; z-index: 5; display: flex; justify-content: flex-end; gap: 8px; padding: 12px 0;
  background: linear-gradient(to top, var(--zap-elevated) 70%, transparent); }

/* tasks */
.view-switch { display: inline-flex; border: 1px solid var(--zap-border); border-radius: 999px; padding: 3px; background: var(--zap-surface); }
.view-switch button { all: unset; cursor: pointer; padding: 5px 14px; border-radius: 999px; font-size: 13px; }
.view-switch button.is-active { background: var(--zap-primary); color: var(--zap-primary-contrast); }
.filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.filters > * { min-width: 180px; }
.task-meta { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; font-size: 13px; color: var(--zap-muted); }
.subtask { display: flex; align-items: center; gap: 10px; padding: 6px 0; border-bottom: 1px solid var(--zap-border); }
.subtask:last-child { border-bottom: 0; }
.subtask.is-done span { text-decoration: line-through; color: var(--zap-muted); }
.subtask span { flex: 1; }
.comment { padding: 10px 12px; border-radius: var(--zap-radius-sm); background: var(--zap-elevated); }
.comment header { display: flex; justify-content: space-between; font-size: 12px; color: var(--zap-muted); margin-bottom: 4px; }
.comment p { margin: 0; white-space: pre-wrap; }
.link { color: var(--zap-primary); cursor: pointer; text-decoration: none; background: none; border: 0; padding: 0; font: inherit; }
.link:hover { text-decoration: underline; }

/* document templates */
.tpl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.money-pos { color: var(--zap-success); font-variant-numeric: tabular-nums; }
.money-neg { color: var(--zap-danger); font-variant-numeric: tabular-nums; }

/* signed-out pages */
.auth-area { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px;
  background: radial-gradient(1200px 600px at 10% -10%, var(--zap-primary-soft), transparent), var(--zap-elevated); }
.auth { width: min(420px, 100%); display: grid; gap: 18px; }
.auth__brand { display: grid; justify-items: center; gap: 2px; text-align: center; }
.auth__brand b { font-size: 22px; }
.auth__brand small { color: var(--zap-muted); }
.auth__logo { display: grid; place-items: center; width: 52px; height: 52px; border-radius: 14px; font-size: 28px; margin-bottom: 6px;
  background: var(--zap-primary); color: var(--zap-primary-contrast); box-shadow: var(--zap-shadow); }
.auth__link { justify-self: center; font-size: 14px; color: var(--zap-primary); text-decoration: none; }
.auth__link:hover { text-decoration: underline; }

/* language picker on the signed-out pages */
.lang-switch { display: flex; justify-content: center; gap: 4px; }
.lang-switch button { all: unset; cursor: pointer; padding: 4px 10px; border-radius: 999px; font-size: 13px; color: var(--zap-muted); }
.lang-switch button:hover, .lang-switch button:focus-visible { color: var(--zap-text); background: var(--zap-surface); }
.lang-switch button.is-active { color: var(--zap-primary); font-weight: 600; background: var(--zap-primary-soft); }

/* "or" between the Google button and the email form */
.google-signin { display: flex; justify-content: center; min-height: 0; }
.google-signin:empty { display: none; }
.auth__or { display: flex; align-items: center; gap: 10px; color: var(--zap-muted); font-size: 13px; }
.auth__or::before, .auth__or::after { content: ""; flex: 1; border-top: 1px solid var(--zap-border); }
.auth__or[hidden] { display: none; }
