/* Hatch freelancer app layout: top bar with pill navigation and a centred column. */

.topbar { position: sticky; top: 0; z-index: 30; background: rgba(247, 247, 247, .82); backdrop-filter: saturate(1.6) blur(14px); -webkit-backdrop-filter: saturate(1.6) blur(14px); }
.topbar-in { width: min(1000px, 100%); margin: 0 auto; padding: 18px 24px; display: flex; align-items: center; gap: 16px; }
.logo { display: flex; align-items: center; gap: 10px; text-decoration: none; flex: none; }
.logo img:first-child { width: 36px; height: 36px; }
.logo-text { width: 68px; height: 18px; }
.pills { display: flex; gap: 2px; margin-left: auto; padding: 4px; border-radius: 999px; background: var(--card); box-shadow: inset 0 0 0 1px var(--line); overflow-x: auto; scrollbar-width: none; }
.pills::-webkit-scrollbar { display: none; }
.pills a { display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 16px; border-radius: 999px; color: var(--ink-2); text-decoration: none; font-weight: 500; font-size: 15px; white-space: nowrap; transition: background .25s var(--ease), color .25s var(--ease); }
.pills a:hover { color: var(--ink); background: rgba(0,0,0,.04); }
.pills a[aria-current="page"] { background: rgba(0,0,0,.07); color: var(--ink); }
.pills .count { min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: var(--blue); color: #fff; font-size: 11px; font-weight: 700; display: inline-grid; place-items: center; }
.me { text-decoration: none; flex: none; }
.av { width: 36px; height: 36px; border-radius: 50%; background: var(--blue); color: #fff; display: grid; place-items: center; font-weight: 600; font-size: 13px; flex: none; }

.main { width: min(1000px, 100%); margin: 0 auto; padding: 32px 24px 64px; min-height: calc(100dvh - 140px); }
.app-foot { width: min(1000px, 100%); margin: 0 auto; padding: 24px; display: flex; justify-content: space-between; align-items: center; gap: 12px; font-size: 13px; color: var(--ink-3); flex-wrap: wrap; }

.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; margin-bottom: 28px; flex-wrap: wrap; }
.page-head h1 { font-family: var(--display); font-weight: 400; font-size: 48px; line-height: 1; letter-spacing: 0; }
.page-head p { color: var(--ink-2); margin-top: 10px; }
.page-head .actions { display: flex; gap: 8px; flex-wrap: wrap; }
.crumb { display: inline-flex; align-items: center; height: 32px; padding: 0 12px; margin-bottom: 14px; border-radius: 999px; background: var(--card); box-shadow: inset 0 0 0 1px var(--line); font-size: 13px; font-weight: 600; color: var(--ink); text-decoration: none; }

.grid-2 { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.stack { display: grid; gap: 16px; }
.box { padding: 22px 24px; min-width: 0; }
.box-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.box-head h2 { font-size: 18px; font-weight: 600; }
.box-head a, .box-head .link { font-size: 14px; font-weight: 600; text-decoration: none; background: none; border: 0; padding: 0; color: var(--blue); cursor: pointer; }

/* Stat tiles */
.tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 16px; }
.tile { padding: 18px 20px; display: grid; gap: 4px; }
.tile .k { font-size: 13px; color: var(--ink-3); font-weight: 500; }
.tile .v { font-family: var(--display); font-weight: 400; font-size: 36px; line-height: 1.05; letter-spacing: 0; }
.tile .s { font-size: 12px; color: var(--ink-3); }

/* Needs attention: notification rows like the site's payment notifications */
.todo { display: grid; gap: 8px; }
.todo a { display: grid; grid-template-columns: 38px 1fr auto; gap: 12px; align-items: center; padding: 10px 14px 10px 10px; border-radius: 18px; box-shadow: inset 0 0 0 1px var(--line); color: var(--ink); text-decoration: none; transition: background .2s var(--ease); }
.todo a:hover { background: #fafafa; color: var(--ink); }
.todo .dot { width: 38px; height: 38px; border-radius: 11px; background: var(--blue); position: relative; }
.todo .dot::after { content: ""; position: absolute; inset: 0; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 12h12m-4-5 5 5-5 5'/%3E%3C/svg%3E") center/18px no-repeat; }
.todo .dot.warn { background: var(--orange); }
.todo .dot.danger { background: var(--red); }
.todo .dot.good { background: var(--green); }
.todo strong { font-weight: 600; font-size: 15px; }
.todo small { display: block; color: var(--ink-3); font-size: 13px; }
.todo .when { font-size: 12px; color: var(--ink-3); white-space: nowrap; }

/* Single-series income bars */
.bars { display: grid; grid-template-columns: repeat(12, 1fr); gap: 6px; align-items: end; height: 170px; padding-top: 8px; }
.bar { position: relative; height: 100%; display: flex; align-items: flex-end; }
.bar i { display: block; width: 100%; background: var(--blue); border-radius: 6px; min-height: 4px; }
.bar.zero i { background: rgba(0,0,0,.07); }
.bar:hover i, .bar:focus-visible i { background: var(--blue-hover); }
.bar .tt { position: absolute; bottom: calc(100% + 6px); left: 50%; transform: translateX(-50%); background: var(--ink); color: #fff; font-size: 12px; font-weight: 500; padding: 6px 10px; border-radius: 10px; white-space: nowrap; pointer-events: none; opacity: 0; visibility: hidden; transition: opacity .15s; z-index: 2; }
.bar:hover .tt, .bar:focus-visible .tt { opacity: 1; visibility: visible; }
.bar:nth-child(-n+3) .tt { left: 0; transform: none; }
.bar:nth-last-child(-n+3) .tt { left: auto; right: 0; transform: none; }
.bar-labels { display: grid; grid-template-columns: repeat(12, 1fr); gap: 6px; font-size: 11px; color: var(--ink-3); text-align: center; margin-top: 8px; }
.chart-table { margin-top: 12px; font-size: 13px; }
.chart-table summary { cursor: pointer; color: var(--ink-3); font-weight: 500; }

/* Tables */
.table-wrap { overflow-x: auto; }
table.t { width: 100%; border-collapse: collapse; font-size: 14px; }
.t th { text-align: left; font-size: 12px; font-weight: 600; color: var(--ink-3); padding: 8px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.t td { padding: 13px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.t tr:last-child td { border-bottom: 0; }
.t td.r, .t th.r { text-align: right; }
.t tr.click { cursor: pointer; }
.t tr.click:hover td { background: #fafafa; }
.t a { color: var(--ink); font-weight: 600; text-decoration: none; }
.t small { color: var(--ink-3); display: block; font-size: 12px; }
.mono { font-family: var(--mono); letter-spacing: 0; font-size: 13px; }
.filters { display: flex; gap: 4px; flex-wrap: wrap; padding: 4px; border-radius: 999px; background: var(--surface); }
.filters button { height: 32px; padding: 0 14px; border: 0; border-radius: 999px; background: transparent; font-size: 14px; font-weight: 500; color: var(--ink-2); cursor: pointer; }
.filters button[aria-pressed="true"] { background: var(--card); color: var(--ink); box-shadow: 0 1px 3px rgba(0,0,0,.08), inset 0 0 0 1px var(--line); }

/* Project detail */
.ptrack { display: flex; gap: 4px; margin-bottom: 22px; }
.ptrack span { flex: 1; font-size: 12px; color: var(--ink-3); display: grid; gap: 8px; font-weight: 500; }
.ptrack span::before { content: ""; height: 6px; border-radius: 3px; background: rgba(0,0,0,.08); }
.ptrack span.done::before, .ptrack span.now::before { background: var(--blue); }
.ptrack span.now { color: var(--ink); font-weight: 600; }
.ms { display: grid; }
.ms li { display: grid; grid-template-columns: 1fr auto auto; gap: 12px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--line); font-size: 15px; }
.ms li:last-child { border-bottom: 0; }
.reads { display: grid; gap: 10px; }
.read { display: grid; grid-template-columns: 90px 1fr 60px; gap: 10px; align-items: center; font-size: 14px; }
.read .track { height: 8px; background: rgba(0,0,0,.06); border-radius: 4px; overflow: hidden; }
.read .track i { display: block; height: 100%; background: var(--blue); border-radius: 4px; }
.reminders { display: grid; gap: 8px; }
.reminders li { border-radius: var(--r-inner); box-shadow: inset 0 0 0 1px var(--line); padding: 12px 14px; font-size: 14px; color: var(--ink-2); }
.reminders li strong { display: block; font-size: 12px; color: var(--ink-3); font-weight: 600; margin-bottom: 2px; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 10px 14px; font-size: 14px; }
.kv dt { color: var(--ink-3); }
.kv dd { text-align: right; font-weight: 500; }
.insight { background: var(--blue-soft); color: #0058c4; border-radius: var(--r-inner); padding: 12px 14px; font-size: 14px; }

/* Builder */
.builder { display: grid; grid-template-columns: minmax(0, 420px) minmax(0, 1fr); gap: 20px; align-items: start; }
.bform { display: grid; gap: 16px; }
.bform fieldset { border: 0; border-radius: var(--r-card); background: var(--card); box-shadow: inset 0 0 0 1px var(--line); padding: 20px; margin: 0; display: grid; gap: 14px; min-width: 0; }
.bform legend { float: left; width: 100%; font-weight: 600; font-size: 18px; padding: 0; margin-bottom: 2px; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.row3 { display: grid; grid-template-columns: 1.4fr 1fr auto; gap: 8px; align-items: end; }
.tier-edit { border-radius: var(--r-inner); background: var(--surface); padding: 14px; display: grid; gap: 8px; }
.preview { position: sticky; top: 92px; max-height: calc(100dvh - 110px); overflow: auto; border-radius: 28px; padding: 14px; background: #dde7f7 var(--bg-img, none) center/cover; }
.preview .proposal { background: rgba(255,255,255,.92); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); }
.preview-label { font-size: 12px; font-weight: 600; color: #fff; margin: 2px 6px 10px; display: flex; justify-content: space-between; text-shadow: 0 1px 2px rgba(0,0,0,.25); }
.clause-list { display: grid; gap: 10px; }

/* Clients */
.clients { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
.client { display: grid; gap: 14px; }
.client-top { display: flex; gap: 12px; align-items: center; }
.client h3 { font-size: 16px; font-weight: 600; }

/* Settings */
.settings { display: grid; gap: 16px; max-width: 680px; }
.swatch { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.swatch input[type=color] { width: 44px; height: 44px; padding: 3px; border: 0; border-radius: 50%; background: var(--card); box-shadow: inset 0 0 0 1px var(--line-2); cursor: pointer; }
.swatch input[type=color]::-webkit-color-swatch { border: 0; border-radius: 50%; }
.swatch input[type=color]::-webkit-color-swatch-wrapper { padding: 0; }
.bg-pick { display: flex; gap: 10px; flex-wrap: wrap; }
.bg-pick label { cursor: pointer; }
.bg-pick input { position: absolute; opacity: 0; }
.bg-pick span { display: block; width: 120px; height: 72px; border-radius: 14px; background: #eef2f8 center/cover; box-shadow: inset 0 0 0 1px var(--line); }
.bg-pick input:checked + span { box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--blue); }
.bg-pick input:focus-visible + span { outline: 2px solid var(--blue); outline-offset: 4px; }

.empty { text-align: center; padding: 28px 12px; color: var(--ink-3); }

@media (max-width: 980px) {
  .tiles { grid-template-columns: repeat(2, 1fr); }
  .grid-2, .builder { grid-template-columns: 1fr; }
  .preview { position: static; max-height: none; }
}
@media (max-width: 700px) {
  .topbar-in { padding: 12px 16px; flex-wrap: wrap; }
  .pills { order: 3; width: 100%; margin-left: 0; }
  .me { margin-left: auto; }
  .main { padding: 20px 16px 48px; }
  .page-head h1 { font-size: 36px; }
  .row2 { grid-template-columns: 1fr; }
  .tile .v { font-size: 28px; }
  .box { padding: 18px; }
  .bars, .bar-labels { gap: 3px; }
  .bar-labels { font-size: 9px; }
}

/* ---------- Scene background with glassmorphism on top ---------- */
body { background: #7d86e3 var(--app-bg, none) center / cover fixed no-repeat; }
body::before { content: ""; position: fixed; inset: 0; z-index: -1; background: rgba(20, 24, 60, .12); pointer-events: none; }

/* Glass recipe: translucent white, heavy blur, bright hairline edge, soft lift. */
.box, .tile, .bform fieldset, .card, .crumb, .pills, .page-head .actions .btn:not(.btn-primary) {
  background: var(--glass); backdrop-filter: blur(28px) saturate(1.6); -webkit-backdrop-filter: blur(28px) saturate(1.6);
  box-shadow: inset 0 0 0 1px var(--glass-edge), inset 0 1px 0 rgba(255, 255, 255, .7), 0 18px 44px rgba(20, 24, 60, .16);
}
.todo a, .reminders li, .file, .cmt, .pp-facts > div, .tier, .addon, .schedule, .clauses details, .ms li, .tier-edit, .comment-form, .insight, .inv-lines, .inv-to {
  background: var(--glass-inner); box-shadow: inset 0 0 0 1px var(--glass-edge);
}
.ms li { box-shadow: none; background: transparent; }
.todo a:hover { background: rgba(255, 255, 255, .78); }
.input, .select, .textarea { background: rgba(255, 255, 255, .62); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .8), inset 0 1px 2px rgba(20, 24, 60, .06); }
.input:focus, .select:focus, .textarea:focus { background: rgba(255, 255, 255, .85); }
.filters { background: rgba(255, 255, 255, .4); }
.filters button[aria-pressed="true"] { background: rgba(255, 255, 255, .9); }
.t tr.click:hover td { background: rgba(255, 255, 255, .4); }
.insight { color: #0050b3; }

/* Top bar: no background at all, it simply sits on the scene and scrolls away with the page */
.topbar, .topbar.scrolled { position: relative; background: none; backdrop-filter: none; -webkit-backdrop-filter: none; box-shadow: none; }
.logo .brand-word { color: #fff; text-shadow: 0 1px 3px rgba(10, 14, 40, .25); }
.av { box-shadow: 0 0 0 2px rgba(255, 255, 255, .85); }

/* Text that sits straight on the scene */
.page-head h1, .page-head > div > p { color: #fff; text-shadow: 0 1px 3px rgba(10, 14, 40, .25); }
.page-head p .badge { text-shadow: none; }
.ptrack span { color: rgba(255, 255, 255, .85); text-shadow: 0 1px 2px rgba(10, 14, 40, .3); }
.ptrack span.now { color: #fff; }
.ptrack span::before { background: rgba(255, 255, 255, .35); }
.ptrack span.done::before, .ptrack span.now::before { background: #fff; }
.app-foot { color: rgba(255, 255, 255, .85); text-shadow: 0 1px 2px rgba(10, 14, 40, .3); }
.app-foot .demo-flag { text-shadow: none; }
.page-head .actions .btn-danger { color: var(--red); }
.preview { background-color: transparent; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .5); }
.preview .proposal { background: rgba(255, 255, 255, .7); }
.empty { color: #fff; }
.box .empty { color: var(--ink-3); }

/* ---------- First run ---------- */
.welcome { min-height: 100dvh; display: grid; place-items: center; padding: 40px 20px; }
.welcome-in { width: min(680px, 100%); display: grid; gap: 22px; justify-items: center; }
.welcome-logo { gap: 12px; }
.welcome-logo img { width: 44px; height: 44px; }
.welcome-logo .brand-word { color: #fff; font-size: 32px; text-shadow: 0 1px 3px rgba(10, 14, 40, .25); }
.welcome-card { width: 100%; padding: 36px; display: grid; gap: 12px; border-radius: 30px; }
.welcome-card h1 { font-size: 48px; line-height: 1; }
.setup { display: grid; gap: 14px; margin-top: 10px; }
.setup-err { color: var(--red); font-size: 14px; font-weight: 500; }
.setup-actions { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-top: 6px; }

/* First-steps checklist */
.first { margin-bottom: 16px; display: grid; gap: 4px; }
.steps-list { display: grid; gap: 8px; margin-bottom: 14px; }
.steps-list li { display: grid; grid-template-columns: 30px 1fr; gap: 12px; align-items: center; padding: 12px 14px; border-radius: 18px; background: var(--glass-inner); box-shadow: inset 0 0 0 1px var(--glass-edge); }
.steps-list b { display: block; font-weight: 600; }
.steps-list small { color: var(--ink-3); font-size: 13px; }
.step-n { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: 13px; background: rgba(0, 0, 0, .06); }
.steps-list li.done .step-n { background: var(--green); color: #fff; }
.steps-list li.done b { text-decoration: line-through; text-decoration-color: rgba(0, 0, 0, .3); }
.first > .btn { justify-self: start; }

/* Empty states */
.empty-box { display: grid; gap: 10px; justify-items: start; padding: 32px; margin-bottom: 16px; }
.empty-box h2 { font-size: 36px; line-height: 1; }

/* Invite email preview */
.sheet.wide { width: min(640px, calc(100% - 24px)); }
.mail-wrap { border-radius: 20px; padding: 18px; background: rgba(20, 24, 60, .06); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .6); }
.mail { background: #fff; border-radius: 16px; padding: 24px; display: grid; gap: 12px; font-size: 14px; line-height: 1.5; color: #1c1c1e; box-shadow: 0 6px 20px rgba(20, 24, 60, .08); }
.mail-from { display: flex; align-items: center; gap: 10px; }
.mail-from b { display: block; font-weight: 600; }
.mail-from span { color: var(--ink-3); font-size: 12px; }
.mail-av { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: 13px; }
.mail-hi { font-weight: 600; }
.mail-card { display: grid; gap: 4px; justify-items: start; padding: 18px; border-radius: 16px; background: #f5f6f8; }
.mail-eyebrow { font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--ink-3); }
.mail-title { font-family: var(--display); font-weight: 400; font-size: 26px; line-height: 1.1; letter-spacing: 0; }
.mail-meta { color: var(--ink-3); font-size: 13px; }
.mail-btn { margin-top: 10px; display: inline-flex; align-items: center; height: 42px; padding: 0 20px; border-radius: 999px; font-weight: 600; text-decoration: none; }
.mail-muted, .mail-foot { color: var(--ink-3); font-size: 12px; }
.mail-foot { border-top: 1px solid var(--line); padding-top: 12px; }

@media (max-width: 700px) {
  .welcome-card { padding: 24px 18px; }
  .welcome-card h1 { font-size: 36px; }
  .setup-actions { flex-direction: column-reverse; }
  .setup-actions .btn { width: 100%; }
}

.welcome .bg-pick { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.welcome .bg-pick span { width: 100%; height: 64px; }

/* Empty states: one component everywhere */
.es { display: grid; justify-items: center; text-align: center; gap: 8px; padding: 40px 24px; }
.es-ic { width: 56px; height: 56px; border-radius: 18px; display: grid; place-items: center; background: rgba(255, 255, 255, .7); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .9), 0 8px 20px rgba(20, 24, 60, .08); color: var(--blue); margin-bottom: 6px; }
.es-ic svg { width: 26px; height: 26px; }
.es h3 { font-size: 30px; line-height: 1.05; }
.es p { color: var(--ink-2); max-width: 32em; font-size: 15px; }
.es-cta { margin-top: 10px; display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.es-sm { padding: 18px 12px 10px; }
.es-sm .es-ic { width: 44px; height: 44px; border-radius: 14px; }
.es-sm .es-ic svg { width: 21px; height: 21px; }
.es-sm h3 { font-size: 22px; }
.es-sm p { font-size: 14px; }
label.btn { cursor: pointer; }
