/* Staff site, 4 of 13: page furniture, the dashboard and its cards, filters, the week schedule and the
   founder's pages. */

/* Page furniture */
.page-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; margin-bottom: 1rem; flex-wrap: wrap; }
/* The title block holds whatever the client typed (a long name, an email): it wraps, never widens the page. */
.page-head > div:not(.actions) { min-width: 0; overflow-wrap: anywhere; }
.page-head h1 { margin-bottom: .25rem; display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.page-head .actions, .section-head .actions, .form-actions { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; }
.form-actions { margin-top: .5rem; }
/* A draft's tax sits under the line editor's add buttons: a gap so its label does not read as theirs. */
.tax-fields { margin-top: 1rem; }
.section-head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin-bottom: .5rem; }
.section-head h2 { margin: 0; }
/* A card is its content plus its padding: no paragraph margin above the first line under the
   heading, none below the last. */
.section-head + :is(p, dl) { margin-top: 0; }
.card > :last-child { margin-bottom: 0; }
.crumbs { margin: 0 0 .25rem; font-size: var(--fs-small); }
.toolbar { display: flex; gap: 1rem; align-items: center; margin-bottom: 1rem; flex-wrap: wrap; }
.toolbar input[type=search] { max-width: 360px; }
label.inline { flex-direction: row; align-items: center; gap: .4rem; margin: 0; color: var(--text); }
label.inline input { width: auto; }
.narrow { max-width: 640px; }
.grid-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 0 1rem; }
.grid-2.top { align-items: start; }
.prewrap { white-space: pre-wrap; }
.break { overflow-wrap: anywhere; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
/* The dashboard's getting-started list for a new company (Shared/GettingStartedCard) */
.setup-steps { list-style: none; margin: 0 0 .75rem; padding: 0; }
.setup-steps li + li { border-top: 1px solid var(--line-soft); }
.setup-steps a { display: flex; align-items: center; gap: .75rem; min-height: 56px; padding: .5rem 0; color: var(--ink); text-decoration: none; }
.setup-steps a:hover .setup-label { text-decoration: underline; }
.setup-tick {
    flex: none; display: grid; place-items: center; width: 1.75rem; height: 1.75rem; border-radius: 50%;
    border: 2px solid var(--primary); color: var(--primary); font-weight: 700; font-size: var(--fs-small);
}
.setup-steps .done .setup-tick { background: var(--ok); border-color: var(--ok); color: #fff; }
.setup-text { display: flex; flex-direction: column; min-width: 0; }
.setup-label { font-weight: 600; }
.setup-steps .done .setup-label { color: var(--muted); font-weight: 400; text-decoration: line-through; }
.setup-hint { color: var(--muted); font-size: var(--fs-small); }
.crew-prompt { display: flex; align-items: center; gap: .5rem; }
.crew-prompt .setup-steps { flex: 1; min-width: 0; margin: 0; }
.crew-prompt form { margin: 0; flex: none; }
/* The founder's health report as JSON (Platform/PlatformHealth) */
pre.json { white-space: pre-wrap; overflow-wrap: anywhere; background: var(--well); padding: .75rem; border-radius: 6px; font-size: var(--fs-small); margin: 0; }
tr.current td { font-weight: 700; }
.card-table { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.card-table th:first-child, .card-table td:first-child { padding-left: 1rem; }
tr.archived td { color: var(--muted); }
h3 { font-size: 1rem; margin: 1.25rem 0 .5rem; }
.badge-info { background: var(--info-wash); color: var(--info-ink); }
.badge-danger { background: var(--danger-wash); color: var(--danger-ink); }
.alert-warn { background: var(--warn-wash); color: var(--warn-ink); }

/* Dashboard cards: a job (ProjectCard, the whole card a link) or a company (FounderHome, name link and a button) */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1rem; }
/* A further list under the dashboard's project cards (its company locations). */
.dashboard-section { margin-top: 1.5rem; }
.project-card, .company-card {
    display: flex; flex-direction: column; gap: .35rem; background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 1rem; color: var(--text); text-decoration: none;
}
/* Hover outlines the card but leaves its left edge alone: that colour is the job's status. */
.project-card:hover { border-top-color: var(--primary); border-right-color: var(--primary); border-bottom-color: var(--primary); box-shadow: var(--shadow); }
/* A dashboard card's head (name and pill) and its small print under a rule: project and company cards. */
.card-head { display: flex; justify-content: space-between; align-items: center; gap: .5rem; }
.card-foot { display: flex; gap: .15rem .75rem; flex-wrap: wrap; font-size: var(--fs-small); margin-top: .25rem; padding-top: .5rem; border-top: 1px solid var(--line-soft); }
/* The coloured left edge (CardEdge) says at a glance whether it is live: brand blue, or grey once done. */
.edge-active { border-left: 4px solid var(--brand-blue); }
.edge-idle { border-left: 4px solid var(--line); }
.project-card-client { color: var(--muted); font-size: var(--fs-small); overflow-wrap: anywhere; }
.project-card-title { font-size: 1.05rem; overflow-wrap: anywhere; }
.company-card-name { font-size: 1.05rem; font-weight: 700; color: var(--ink); text-decoration: none; overflow-wrap: anywhere; }
.company-card form { margin: .35rem 0 0; }
.count { font-size: var(--fs-small); font-weight: 600; color: var(--muted); }

/* A two- or three-way filter as links (static SSR: the choice is the URL), the current one raised. */
.segmented { display: inline-flex; gap: 2px; padding: 3px; margin-bottom: 1rem; background: var(--well); border: 1px solid var(--line); border-radius: 10px; }
.segmented a { display: flex; align-items: center; justify-content: center; padding: .3rem 1rem; border-radius: 7px; color: var(--ink-3); font-weight: 600; text-decoration: none; }
.segmented a:hover { color: var(--ink); }
/* Raised and ringed, so the current choice reads in dark mode too, where surface and well are close. */
.segmented a[aria-current="page"] { background: var(--surface); color: var(--ink); box-shadow: 0 0 0 1px var(--line), 0 1px 2px rgba(20, 33, 43, .15); }
.pager { display: flex; align-items: center; justify-content: center; gap: 1rem; margin: 1rem 0; }

/* Week schedule */
.week-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: .5rem; margin-bottom: 1.25rem; }
.day {
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
    padding: .5rem; min-height: 8rem; display: flex; flex-direction: column; gap: .4rem;
}
.day.today { border-color: var(--primary); box-shadow: inset 0 2px 0 var(--primary); }
.day-head { display: flex; justify-content: space-between; align-items: baseline; gap: .25rem; font-size: var(--fs-small); }
.day-empty { margin: 0; }
.visit-chip {
    border: 1px solid var(--border); border-left: 3px solid var(--brand-green); border-radius: 6px;
    padding: .35rem .45rem; font-size: var(--fs-small); display: flex; flex-direction: column; gap: .1rem;
    background: var(--well); overflow-wrap: anywhere; color: var(--ink); text-decoration: none;
}
.visit-chip:hover { color: var(--ink); border-color: var(--primary); border-left-color: var(--brand-green); }
.visit-chip .badge { align-self: flex-start; }
.visit-title { color: var(--primary); font-weight: 600; }
.visit-time { font-weight: 600; }
.visit-crew { color: var(--muted); }
.visit-form { border-bottom: 1px solid var(--border); padding-bottom: .75rem; margin-bottom: .75rem; }

@media (max-width: 1000px) {
    .week-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .day { min-height: 0; }
}
@media (max-width: 800px) {
    .week-grid { grid-template-columns: 1fr; gap: .35rem; }
    /* A day with nothing on it is one quiet line, so the days with work stand out. */
    .day:has(.day-empty) { padding: .45rem .75rem; background: transparent; }
    .day:has(.day-empty) .day-head { color: var(--muted); }
    .day-empty { display: none; }
}

/* ---- founder signed in as someone ---- */
.founder-banner { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 1rem; }
.founder-banner form { margin: 0; }
