:root {
  --ground: #F4F5F7; --surface: #FFFFFF; --ink: #16202A; --ink2: #3A4550; --muted: #55606B;
  --line: #E1E4E8; --line2: #C9CED4; --accent: #0F6B62; --accent-dark: #0B4F49; --accent-soft: #E3F1EF;
  --danger: #B42318; --danger-dark: #9A1C12; --danger-line: #E5A9A2; --warn: #6B4500;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--ground); color: var(--ink); font: 400 14px/1.45 'DM Sans', system-ui, sans-serif; }
h1, h2, h3 { margin: 0; }
h1 { font-size: 28px; font-weight: 700; line-height: 1.2; }
h2 { font-size: 16px; font-weight: 600; }
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-dark); }
.muted { color: var(--muted); }
.danger-text { color: var(--danger-dark); font-weight: 600; }
.ok-text { color: var(--accent-dark); font-weight: 600; }
.warn-text { color: var(--warn); font-weight: 600; }
[hidden] { display: none !important; }

/* layout */
.app { display: flex; flex-wrap: wrap; min-height: 100vh; }
.side { flex: 1 0 208px; background: var(--surface); border-right: 1px solid var(--line); padding: 24px 16px; display: flex; flex-direction: column; gap: 4px; }
.side .brand { font-size: 18px; font-weight: 700; padding: 4px 12px 20px; }
.side a { padding: 12px; border-radius: 8px; font-size: 15px; font-weight: 500; color: var(--ink2); }
.side a:hover { background: var(--ground); }
.side a[aria-current="page"] { font-weight: 600; color: var(--accent-dark); background: var(--accent-soft); }
main { flex: 999 1 560px; min-width: 0; padding: 32px; display: flex; flex-direction: column; gap: 24px; }
.page-head { display: flex; flex-wrap: wrap; align-items: center; gap: 16px 24px; }
.page-head .push { margin-left: auto; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 20px; display: flex; flex-direction: column; gap: 12px; }
.panel-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; }
.row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.cols { display: flex; flex-wrap: wrap; gap: 20px; align-items: flex-start; }
.cols > .wide { flex: 3 1 420px; min-width: 0; display: flex; flex-direction: column; gap: 20px; }
.cols > .narrow { flex: 2 1 300px; min-width: 0; display: flex; flex-direction: column; gap: 20px; }

/* controls */
button, input, select, textarea { font: inherit; color: inherit; }
.btn { min-height: 44px; padding: 0 16px; border: 1px solid #8A939C; border-radius: 8px; background: var(--surface); font-weight: 600; cursor: pointer; }
.btn:hover { background: var(--ground); }
.btn.primary { border-color: var(--accent); background: var(--accent); color: #fff; }
.btn.primary:hover { background: var(--accent-dark); }
.btn.danger { border-color: var(--danger-line); color: var(--danger-dark); }
.btn.small { min-height: 36px; padding: 0 10px; font-size: 13px; }
.link-btn { border: 0; background: none; padding: 8px 4px; color: var(--accent); font-weight: 500; cursor: pointer; }
.link-btn.danger { color: var(--danger-dark); }
input[type=text], input[type=search], input[type=email], input[type=tel], input[type=date], input[type=number], select, textarea {
  height: 44px; padding: 0 12px; border: 1px solid var(--line2); border-radius: 8px; background: var(--surface); min-width: 0; }
textarea { height: auto; min-height: 76px; padding: 12px; resize: vertical; width: 100%; }
input[type=checkbox] { width: 18px; height: 18px; accent-color: var(--accent); flex: 0 0 auto; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
label.field { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--muted); flex: 1 1 160px; min-width: 0; }
label.inline { display: flex; align-items: center; gap: 8px; color: var(--muted); }
.search { flex: 1 1 280px; max-width: 440px; position: relative; }
.search svg { position: absolute; left: 14px; top: 13px; }
.search input { width: 100%; padding-left: 40px; font-size: 15px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; font-size: 12px; color: var(--ink2); }
.chips span { border: 1px solid var(--line2); border-radius: 6px; padding: 2px 8px; white-space: nowrap; }
.bar { display: flex; height: 6px; border-radius: 3px; overflow: hidden; background: var(--line); }
.bar i { display: block; background: var(--accent); }
.bar i.late { background: var(--danger); }
.error { color: var(--danger-dark); font-weight: 600; min-height: 20px; }

/* timeline */
.tl-scroll { overflow-x: auto; }
.tl { position: relative; height: 144px; min-width: 760px; margin: 0 40px; }
.tl .line { position: absolute; left: 0; right: 0; top: 68px; height: 2px; background: var(--line2); }
.tl .today-line { position: absolute; top: 20px; width: 2px; height: 96px; margin-left: -1px; background: var(--ink); }
.tl .today-pill { position: absolute; top: 0; transform: translateX(-50%); background: var(--ink); color: #fff; font-size: 11px; font-weight: 600; line-height: 20px; padding: 0 8px; border-radius: 10px; }
.tl .dot { position: absolute; top: 62px; width: 14px; height: 14px; margin-left: -7px; border-radius: 50%; background: var(--accent); }
.tl .dot:hover { transform: scale(1.3); }
.tl .dot.past { background: var(--surface); border: 3px solid #8A939C; }
.tl .lbl { position: absolute; white-space: nowrap; font-size: 12px; line-height: 16px; text-align: center; transform: translateX(-50%); color: var(--ink); }
.tl .lbl.up { top: 26px; } .tl .lbl.down { top: 82px; }
.tl .lbl b { display: block; font-weight: 600; }
.tl .lbl span { color: var(--muted); }
.tl .lbl.past, .tl .lbl.past b { color: var(--muted); }
.tl .tick { position: absolute; top: 124px; border-left: 1px solid var(--line2); padding-left: 6px; font-size: 11px; line-height: 16px; color: var(--muted); white-space: nowrap; }
.tl .empty { position: absolute; left: 0; right: 0; top: 26px; text-align: center; color: var(--muted); font-size: 13px; }

/* board */
.board-scroll { overflow-x: auto; padding-bottom: 8px; }
.board { display: flex; align-items: flex-start; gap: 12px; }
.column { flex: 1 0 232px; min-width: 0; max-width: 340px; display: flex; flex-direction: column; gap: 10px; }
.column-head { display: flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 4px; }
.column-head h2 { font-size: 14px; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.column-head button { border: 0; background: none; width: 36px; height: 36px; border-radius: 8px; cursor: pointer; color: var(--muted); font-size: 18px; line-height: 1; }
.column-head button:hover { background: var(--line); }
.cards { display: flex; flex-direction: column; gap: 10px; min-height: 80px; border-radius: 12px; }
.cards.over { outline: 2px dashed var(--accent); outline-offset: 2px; }
.cards .drop-hint { border: 1px dashed var(--line2); border-radius: 12px; padding: 24px 16px; font-size: 13px; color: var(--muted); text-align: center; }
.card > * { flex-shrink: 0; }
.card { height: 248px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 16px; display: flex; flex-direction: column; gap: 10px; color: var(--ink); overflow: hidden; }
.card:hover { border-color: #8A939C; color: var(--ink); }
.card.late { border-color: var(--danger-line); }
.card-head { display: flex; align-items: center; gap: 10px; min-width: 0; }
.thumb { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; flex: 0 0 auto; }
.card-title { min-width: 0; }
.card h3 { font-size: 16px; font-weight: 600; }
.clip { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card .sub { font-size: 13px; color: var(--muted); margin-top: 2px; }
.card .chips { height: 84px; overflow: hidden; align-content: flex-start; flex: 0 0 auto; }
.card .chips span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; height: 24px; line-height: 18px; }
.card .chips .cover { background: var(--accent-soft); border-color: var(--accent-soft); color: var(--accent-dark); font-weight: 600; }
.card .next { font-size: 13px; }
.card .fin { margin-top: auto; border-top: 1px solid var(--line); padding-top: 10px; display: flex; flex-direction: column; gap: 5px; font-size: 13px; }
.add-column { flex: 0 0 116px; min-height: 44px; border: 1px dashed #8A939C; border-radius: 8px; background: transparent; color: var(--ink2); font-weight: 600; cursor: pointer; }
.add-column:hover { background: var(--line); }

/* lists */
.list { display: flex; flex-direction: column; }
.item { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; min-height: 48px; padding: 4px 0; border-top: 1px solid var(--line); }
.item .grow { flex: 1 1 200px; min-width: 0; }
.item .when { flex: 0 0 96px; color: var(--muted); }
.item .who { flex: 0 0 56px; color: var(--muted); }
.item.done .grow { text-decoration: line-through; color: var(--muted); }
.note { border-top: 1px solid var(--line); padding-top: 4px; }
.note p { margin: 0; white-space: pre-wrap; }
.note .meta { display: flex; justify-content: space-between; align-items: center; font-size: 12px; font-weight: 600; color: var(--muted); }
.kv { display: flex; justify-content: space-between; gap: 12px; }
.kv b { font-weight: 600; }
.hero { flex-direction: row; flex-wrap: wrap; align-items: center; gap: 20px; }
.hero .photo { width: 96px; height: 96px; border-radius: 50%; object-fit: cover; flex: 0 0 auto; }
.hero .info { flex: 1 1 280px; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.group-title { font-size: 14px; font-weight: 600; }
.panel.late { border-color: var(--danger-line); }

/* dialogs */
dialog { border: 1px solid var(--line); border-radius: 12px; padding: 24px; width: min(520px, calc(100vw - 32px)); color: var(--ink); }
dialog::backdrop { background: rgba(22, 32, 42, .45); }
dialog form { display: flex; flex-direction: column; gap: 14px; }
dialog .actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; margin-top: 6px; }
dialog .actions .left { margin-right: auto; }

@media (max-width: 700px) {
  main { padding: 20px 16px; }
  .side { flex-direction: row; flex-wrap: wrap; padding: 12px; border-right: 0; border-bottom: 1px solid var(--line); }
  .side .brand { flex: 1 0 100%; padding: 4px 12px 8px; }
}

/* project page (payments / documents / details layout) */
.stats { display: flex; flex-wrap: wrap; gap: 16px 48px; padding: 4px 0 8px; }
.stat .label { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--ink2); }
.stat .label i { width: 10px; height: 10px; border-radius: 50%; background: var(--accent); }
.stat.upcoming .label i { background: #C98A00; }
.stat.late .label i { background: var(--danger); }
.stat .value { font-size: 26px; font-weight: 500; margin-top: 6px; }
.pill { display: inline-block; font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; padding: 5px 10px; border-radius: 12px; white-space: nowrap; background: #E8EAED; color: var(--ink2); }
.pill.green { background: var(--accent-soft); color: var(--accent-dark); }
.pill.amber { background: #FFF1CC; color: var(--warn); }
.pill.red { background: #FDE7E4; color: var(--danger-dark); }
.pill.blue { background: #E6ECFA; color: #2A4590; }
.table-scroll { overflow-x: auto; }
table.pay { width: 100%; border-collapse: collapse; min-width: 520px; }
table.pay th { text-align: left; font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); padding: 8px 8px 10px 0; border-bottom: 1px solid var(--line); }
table.pay td { padding: 10px 8px 10px 0; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.pay td.amount { font-weight: 600; white-space: nowrap; }
table.pay td.actions { text-align: right; white-space: nowrap; padding-right: 0; }
.doc { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; padding: 12px 0; border-top: 1px solid var(--line); }
.doc-icon { flex: 0 0 40px; height: 48px; border: 1px solid var(--line2); border-radius: 4px; display: flex; align-items: center; justify-content: center; color: var(--muted); }
.doc .grow { flex: 1 1 180px; min-width: 0; }
.doc .name { font-weight: 600; font-size: 15px; }
.icon-btn { width: 44px; height: 44px; border: 0; border-radius: 8px; background: none; color: var(--accent); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }
.icon-btn:hover { background: var(--ground); }
.drawer { border-top: 1px solid var(--line); padding-top: 14px; }
.details { display: grid; grid-template-columns: minmax(96px, 34%) minmax(0, 1fr); gap: 14px 12px; margin: 0; }
.details dt { color: var(--muted); }
.details dd { margin: 0; overflow-wrap: anywhere; }
dialog.wide { width: min(760px, calc(100vw - 32px)); }

/* row menus */
.menu { display: inline-flex; }
.icon-btn.dots { color: var(--muted); font-size: 22px; line-height: 1; }
.menu-list { position: fixed; z-index: 20; min-width: 170px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 8px 24px rgba(22, 32, 42, .14); padding: 6px; display: flex; flex-direction: column; }
.menu-list button, .menu-list a { text-align: left; border: 0; background: none; padding: 10px 12px; min-height: 40px; border-radius: 6px; cursor: pointer; color: var(--ink); font-weight: 500; }
.menu-list button:hover, .menu-list a:hover { background: var(--ground); color: var(--ink); }
.menu-list .danger { color: var(--danger-dark); }

/* notifications */
.bell-badge { flex: 0 0 auto; margin-left: auto; display: inline-flex; align-items: center; gap: 4px; padding: 3px 8px 3px 6px; border-radius: 12px; background: #FFF1CC; color: var(--warn); font-size: 12px; font-weight: 700; align-self: flex-start; }
.bell-badge.urgent { background: #FDE7E4; color: var(--danger-dark); }
.bell-badge svg { width: 16px; height: 16px; }
.bell-wrap { position: relative; }
.bell-btn { position: relative; width: 48px; height: 48px; border: 1px solid #8A939C; border-radius: 10px; background: var(--surface); color: var(--ink); cursor: pointer; display: flex; align-items: center; justify-content: center; }
.bell-btn:hover { background: var(--ground); }
.bell-btn svg { width: 24px; height: 24px; }
.bell-btn .count { position: absolute; top: -8px; right: -8px; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 11px; background: #8A5A00; color: #fff; font-size: 12px; font-weight: 700; line-height: 22px; text-align: center; }
.bell-btn .count.urgent { background: var(--danger); }
.bell-panel { position: absolute; z-index: 15; top: 58px; right: 0; width: min(400px, calc(100vw - 48px)); background: var(--surface); border: 1px solid var(--line2); border-radius: 12px; box-shadow: 0 12px 32px rgba(22, 32, 42, .18); padding: 16px 16px 8px; }
.bell-panel h2 { font-size: 15px; margin-bottom: 6px; }
.bell-list { max-height: 320px; overflow-y: auto; padding-right: 8px; }
.notif { display: flex; gap: 12px; align-items: flex-start; padding: 12px 0; border-top: 1px solid var(--line); }
.notif i { flex: 0 0 10px; height: 10px; border-radius: 50%; background: #C98A00; margin-top: 5px; }
.notif.urgent i { background: var(--danger); }
.notif.event i { background: var(--accent); }
.notif.email i { background: #2A4590; }
.notif .body { flex: 1; min-width: 0; }
.notif .title { font-weight: 600; }
.notif .sub { font-size: 13px; color: var(--muted); }
.notif.urgent .sub { color: var(--danger-dark); font-weight: 600; }
.notif .when { font-size: 12px; color: var(--muted); white-space: nowrap; }

/* tasks page: view switch, filters, kanban, sprints */
.seg { display: flex; border: 1px solid var(--line2); border-radius: 8px; overflow: hidden; background: var(--surface); }
.seg button { min-height: 44px; padding: 0 16px; border: 0; background: var(--surface); color: var(--ink2); font-weight: 500; cursor: pointer; }
.seg button[aria-pressed="true"] { background: var(--ink); color: #fff; font-weight: 600; }
.filters { padding: 12px 16px; gap: 10px; }
.filter { position: relative; }
.filter summary { list-style: none; display: flex; align-items: center; min-height: 44px; padding: 0 14px; border: 1px solid var(--line2); border-radius: 8px; background: var(--surface); font-weight: 500; cursor: pointer; white-space: nowrap; }
.filter summary::-webkit-details-marker { display: none; }
.filter summary.on { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-dark); font-weight: 600; }
.filter-panel { position: absolute; z-index: 15; top: 50px; left: 0; min-width: 220px; max-height: 300px; overflow-y: auto; background: var(--surface); border: 1px solid var(--line2); border-radius: 10px; box-shadow: 0 8px 24px rgba(22, 32, 42, .14); padding: 6px; }
.filter-panel label { display: flex; align-items: center; gap: 10px; min-height: 40px; padding: 0 10px; border-radius: 6px; cursor: pointer; }
.filter-panel label:hover { background: var(--ground); }
.chip { display: inline-flex; align-items: center; gap: 4px; padding: 4px 4px 4px 10px; border-radius: 14px; background: var(--accent-soft); color: var(--accent-dark); font-size: 13px; font-weight: 600; }
.chip button { width: 26px; height: 26px; border: 0; border-radius: 50%; background: transparent; color: inherit; font-size: 16px; line-height: 1; cursor: pointer; }
.chip button:hover { background: rgba(15, 107, 98, .15); }
.kanban { display: flex; align-items: flex-start; gap: 16px; }
.kcol { flex: 1 0 260px; min-width: 0; background: #E9ECEF; border-radius: 12px; padding: 12px; display: flex; flex-direction: column; gap: 10px; min-height: 140px; }
.kcol.over { outline: 2px dashed var(--accent); outline-offset: 2px; }
.kcol h2 { font-size: 14px; padding: 4px; display: flex; justify-content: space-between; }
.kcard { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 12px 8px 12px 14px; display: flex; flex-direction: column; gap: 6px; cursor: grab; }
.kcard.late { border-color: var(--danger-line); }
.kcard .top { display: flex; align-items: flex-start; gap: 4px; }
.kcard .title { flex: 1; min-width: 0; font-weight: 600; padding-top: 4px; overflow-wrap: anywhere; }
.kcard.done .title { text-decoration: line-through; color: var(--muted); }
.kcard .icon-btn { width: 32px; height: 32px; margin-top: -2px; }
.kcard .meta { display: flex; justify-content: space-between; gap: 8px; font-size: 13px; color: var(--muted); padding-right: 6px; }
.sprint-block.current { border: 2px solid var(--ink); }
.eyebrow { font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.sprint-block.current .eyebrow { color: var(--accent-dark); }
.sprint-block h2 { font-size: 18px; margin-top: 2px; }
.item .state { flex: 0 0 104px; }
.bar i.doing { background: #C98A00; }
.kcol h2 { align-items: center; padding: 0 0 0 4px; }
.kcol h2 .icon-btn { width: 36px; height: 36px; }
.kanban .add-column { flex: 0 0 130px; }

/* timeline: engagement shoots are amber diamonds, weddings are teal dots */
.tl .dot.eng { width: 12px; height: 12px; margin-left: -6px; top: 63px; border-radius: 2px; background: #C98A00; transform: rotate(45deg); }
.tl .dot.eng:hover { transform: rotate(45deg) scale(1.3); }
.tl .dot.eng.past { background: var(--surface); border: 3px solid #8A939C; }
.key { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: var(--accent); }
.key.eng { border-radius: 2px; background: #C98A00; transform: rotate(45deg); }
.key.past { background: var(--surface); border: 2px solid #8A939C; }
.card .fin { flex-direction: row; align-items: center; }

/* settings page and price breakdowns */
.tabs { display: flex; flex-wrap: wrap; gap: 4px 28px; border-bottom: 1px solid var(--line); }
.tabs button { border: 0; background: none; padding: 12px 0; min-height: 44px; font-size: 16px; font-weight: 500; color: var(--ink2); cursor: pointer; border-bottom: 3px solid transparent; margin-bottom: -1px; }
.tabs button[aria-selected="true"] { color: var(--ink); font-weight: 600; border-bottom-color: var(--accent); }
.price-grid { display: grid; grid-template-columns: minmax(0, 1fr) 150px; gap: 10px 16px; align-items: center; max-width: 560px; }
.price-grid input { width: 100%; text-align: right; }
.breakdown { margin-top: 6px; font-size: 13px; }
.breakdown summary { cursor: pointer; color: var(--accent); font-weight: 500; padding: 4px 0; }
.breakdown-lines { display: flex; flex-direction: column; gap: 4px; max-width: 420px; padding: 8px 12px; background: var(--ground); border-radius: 8px; font-size: 13px; }

/* invoice panel */
.inv-backdrop { position: fixed; inset: 0; z-index: 30; background: rgba(22, 32, 42, .45); }
.inv-panel { position: fixed; z-index: 31; top: 0; right: 0; bottom: 0; width: min(820px, 100%); overflow-y: auto; background: var(--surface); box-shadow: -12px 0 32px rgba(22, 32, 42, .18); padding: 20px 32px 48px; display: flex; flex-direction: column; gap: 18px; }
.inv-panel > * { flex-shrink: 0; }
.inv-panel h2 { margin-top: 10px; padding-bottom: 10px; border-bottom: 1px solid var(--line); font-size: 18px; }
.inv-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; position: sticky; top: -20px; background: var(--surface); padding: 12px 0; z-index: 2; border-bottom: 1px solid var(--line); }
.stat .label { color: var(--muted); }
table.pay th.num, table.pay td.num { text-align: right; padding-right: 0; padding-left: 12px; white-space: nowrap; }
table.inv-items td { vertical-align: top; padding-top: 14px; padding-bottom: 14px; }
.inv-totals { align-self: flex-end; width: min(340px, 100%); display: flex; flex-direction: column; gap: 8px; }
.inv-edit-rows { display: flex; flex-direction: column; gap: 10px; }
/* each item is a grey block: name with its description underneath, quantity, price, and the line amount */
.inv-edit-item { display: grid; grid-template-columns: minmax(0, 1fr) 76px 128px 110px; gap: 12px; align-items: start; background: var(--ground); border-radius: 8px; padding: 16px; }
.inv-name { display: flex; flex-direction: column; }
.inv-name input { border-radius: 8px 8px 0 0; font-weight: 500; }
.inv-name textarea { border-top: 0; border-radius: 0 0 8px 8px; min-height: 44px; padding: 10px 12px; color: var(--ink2); }
.inv-edit-item > input { width: 100%; }
.inv-amount { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; padding-top: 11px; color: var(--ink2); white-space: nowrap; }
.inv-edit-foot { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-start; gap: 16px; }
.inv-edit-foot .inv-totals { align-self: auto; }
.inv-add { display: inline-flex; align-items: center; gap: 8px; font-size: 15px; }
.inv-notes { margin: 0; white-space: pre-wrap; color: var(--ink2); max-width: 620px; }
@media (max-width: 700px) { .inv-panel { padding: 16px; } .inv-edit-item { grid-template-columns: minmax(0, 1fr) 64px 96px; } .inv-edit-item .inv-name { grid-column: 1 / -1; } .inv-amount { grid-column: 1 / -1; flex-direction: row; justify-content: space-between; align-items: center; padding-top: 0; } }

/* contacts */
.avatar { display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; margin-right: 8px; border-radius: 50%; background: var(--accent-soft); color: var(--accent-dark); font-size: 12px; font-weight: 700; vertical-align: middle; }
.contact-pick { display: flex; flex-direction: column; gap: 8px; }
.contact-pick select { width: 100%; }

/* project header photo, edit form sections */
.photo-wrap { position: relative; flex: 0 0 auto; }
.photo-wrap .menu { position: absolute; right: -4px; bottom: -4px; }
.photo-pen { width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--line2); background: var(--surface); color: var(--ink); cursor: pointer; display: flex; align-items: center; justify-content: center; box-shadow: 0 2px 6px rgba(22, 32, 42, .15); }
.photo-pen:hover { background: var(--ground); }
.photo-add { flex: 0 0 auto; width: 96px; height: 96px; border-radius: 50%; border: 1px dashed #8A939C; background: var(--ground); color: var(--muted); cursor: pointer; display: flex; align-items: center; justify-content: center; }
.photo-add:hover { background: var(--line); color: var(--ink); }
.form-section { border-top: 1px solid var(--line); padding-top: 14px; display: flex; flex-direction: column; gap: 12px; }
.form-section h3 { font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.field-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
.field-grid input, .field-grid select { width: 100%; }
.check-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 4px 16px; }
.check-grid label { min-height: 36px; color: var(--ink); }
.check-grid:empty, #second-shooters:not(:has(label:not([hidden]))) { display: none; }
dialog.wide { max-height: calc(100vh - 48px); overflow-y: auto; }
#form-details { gap: 18px; }

/* rows you can click: soft highlight and a small slide on hover */
/* the slide uses padding, not transform: a transformed row would misplace the "..." menu inside it */
.clickable { cursor: pointer; margin: 0 -10px; padding-left: 10px; padding-right: 10px; border-radius: 10px; transition: background-color .16s ease, padding-left .16s ease, box-shadow .16s ease; }
.clickable:hover, .clickable:focus-within { background: var(--ground); padding-left: 14px; box-shadow: inset 3px 0 0 var(--accent); }
.clickable:hover .name { color: var(--accent-dark) !important; }
@media (prefers-reduced-motion: reduce) { .clickable { transition: none; } .clickable:hover, .clickable:focus-within { padding-left: 10px; } }

/* contacts in Project Details: clickable, with initials and an arrow on hover */
.contact-chip { display: flex; align-items: center; gap: 4px; width: calc(100% + 20px); text-align: left; border: 0; background: none; padding-top: 6px; padding-bottom: 6px; font: inherit; color: inherit; }
.contact-chip .go { font-size: 22px; color: var(--accent); opacity: 0; transition: opacity .16s ease; }
.contact-chip:hover .go, .contact-chip:focus-visible .go { opacity: 1; }

/* action items on the project page: same hover highlight as the document rows */
#tasks .item { margin: 0 -10px; padding-left: 10px; padding-right: 10px; border-radius: 10px; transition: background-color .16s ease, padding-left .16s ease, box-shadow .16s ease; }
#tasks .item:hover, #tasks .item:focus-within { background: var(--ground); padding-left: 14px; box-shadow: inset 3px 0 0 var(--accent); }
@media (prefers-reduced-motion: reduce) { #tasks .item { transition: none; } #tasks .item:hover, #tasks .item:focus-within { padding-left: 10px; } }

/* project header: back arrow and column badge */
.back-arrow { flex: 0 0 auto; width: 44px; height: 44px; margin: 0 -8px 0 -6px; display: flex; align-items: center; justify-content: center; border-radius: 8px; color: var(--ink); }
.back-arrow:hover { background: var(--ground); color: var(--ink); }
.col-badge { border: 0; cursor: pointer; display: inline-flex; align-items: center; gap: 8px; min-height: 32px; padding: 0 12px; border-radius: 16px; background: var(--accent-soft); color: var(--accent-dark); font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.col-badge i { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }
.col-badge.lead { background: #E6ECFA; color: #2A4590; }
.col-badge.lead i { background: #2A4590; }
.col-badge:hover { filter: brightness(.96); }

/* sub-pages in the side menu, finance pages */
.side a.sub { padding: 9px 12px 9px 30px; font-size: 14px; }
table.pay tr.clickable-row { cursor: pointer; transition: background-color .16s ease; }
table.pay tr.clickable-row:hover { background: var(--ground); }
@media (max-width: 700px) { .side a.sub { padding-left: 12px; } }

/* project cards: clickable block with a "..." menu that shows on hover */
.card { cursor: pointer; }
.card h3 a { color: inherit; }
.card-menu { flex: 0 0 auto; margin: -8px -8px -8px auto; opacity: 0; transition: opacity .16s ease; }
.card-menu .icon-btn { width: 36px; height: 36px; }
.card:hover .card-menu, .card:focus-within .card-menu, .card-menu:has([aria-expanded="true"]) { opacity: 1; }
@media (hover: none) { .card-menu { opacity: 1; } }

/* conversations on the project page */
.msg { display: flex; align-items: flex-start; gap: 8px; border-top: 1px solid var(--line); padding: 6px 0; }
.msg details { flex: 1 1 auto; min-width: 0; }
.msg summary { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; min-height: 44px; cursor: pointer; list-style: none; border-radius: 8px; }
.msg summary::-webkit-details-marker { display: none; }
.msg summary .subject { flex: 1 1 200px; min-width: 0; font-weight: 600; }
.msg summary .when { color: var(--muted); font-size: 13px; white-space: nowrap; }
.msg .body { margin: 4px 0 10px; padding: 12px 14px; background: var(--ground); border-radius: 8px; white-space: pre-wrap; overflow-wrap: anywhere; }
.msg .to { font-size: 13px; color: var(--muted); }
#form-email label.field { flex: 0 0 auto; }

/* task reports */
.report-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); gap: 20px; }
.report-cards .panel { min-width: 0; }
.avatar { flex: 0 0 36px; width: 36px; height: 36px; border-radius: 50%; background: var(--accent-soft); color: var(--accent-dark); font-weight: 700; font-size: 14px; display: inline-flex; align-items: center; justify-content: center; }
.report-nums { display: flex; flex-wrap: wrap; gap: 8px 28px; }
.report-nums b { display: block; font-size: 22px; font-weight: 500; }
.report-nums span { font-size: 12px; color: var(--muted); }
.report-line { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 0; border-top: 1px solid var(--line); font-size: 14px; }
.report-line .what { min-width: 0; overflow-wrap: anywhere; }
.segmented { display: flex; border: 1px solid var(--line-strong, #C9CED4); border-radius: 8px; overflow: hidden; background: #fff; }
.segmented button { border: 0; background: none; min-height: 44px; padding: 0 14px; font-size: 14px; font-weight: 500; cursor: pointer; }
.segmented button[aria-pressed="true"] { background: var(--ink); color: #fff; font-weight: 600; }

/* team */
.member-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr)); gap: 16px; }
.member-card { background: var(--card, #fff); border: 1px solid var(--line); border-radius: 12px; padding: 18px; display: flex; flex-direction: column; gap: 10px; color: inherit; text-decoration: none; transition: border-color .16s ease, box-shadow .16s ease; }
.member-card:hover, .member-card:focus-visible { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); color: inherit; }
.member-card .foot { border-top: 1px solid var(--line); padding-top: 10px; font-size: 13px; display: flex; flex-wrap: wrap; gap: 4px 16px; }
.avatar.big { flex-basis: 64px; width: 64px; height: 64px; font-size: 22px; margin-right: 0; }
dl.member-info { display: grid; grid-template-columns: 110px 1fr; gap: 10px 12px; margin: 0; }
dl.member-info dt { color: var(--muted); }
dl.member-info dd { margin: 0; overflow-wrap: anywhere; }

/* task panel and history */
.inv-panel.task-panel { width: min(480px, 100%); }
.task-open { border: 0; background: none; padding: 0; margin: 0; font: inherit; color: inherit; text-align: left; cursor: pointer; text-decoration: inherit; overflow-wrap: anywhere; }
.task-open:hover, .task-open:focus-visible { color: var(--accent); text-decoration: underline; }
.history { display: flex; flex-direction: column; }
.history-line { position: relative; display: flex; gap: 12px; padding-bottom: 16px; font-size: 14px; }
.history-line::before { content: ""; position: absolute; left: 5px; top: 16px; bottom: 0; width: 2px; background: var(--line); }
.history-line:last-child::before { display: none; }
.history-line i { flex: 0 0 12px; height: 12px; margin-top: 4px; border-radius: 50%; background: #8A939C; z-index: 1; }
.history-line i.green { background: var(--accent); }
.history-line i.amber { background: #C98A00; }
.history-line small { display: block; margin-top: 2px; font-size: 12px; color: var(--muted); }

/* tasks page: rows and cards react to the pointer and open the task */
.task-row { cursor: pointer; margin: 0 -10px; padding-left: 10px; padding-right: 10px; border-radius: 10px; transition: background-color .16s ease, padding-left .16s ease, box-shadow .16s ease; }
.task-row:hover, .task-row:focus-within { background: var(--ground); padding-left: 14px; box-shadow: inset 3px 0 0 var(--accent); }
.kcard[data-open-task] { cursor: pointer; transition: border-color .16s ease, box-shadow .16s ease; }
.kcard[data-open-task]:hover, .kcard[data-open-task]:focus-within { border-color: var(--accent); box-shadow: 0 4px 14px rgba(22, 32, 42, .12); }
@media (prefers-reduced-motion: reduce) { .task-row, .kcard[data-open-task] { transition: none; } .task-row:hover, .task-row:focus-within { padding-left: 10px; } }
#form-task-edit > label.field { flex: 0 0 auto; }

/* KPIs */
.kpi-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: 16px; }
.kpi-card { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 18px; display: flex; flex-direction: column; gap: 10px; cursor: pointer; transition: border-color .16s ease, box-shadow .16s ease; }
.kpi-card:hover, .kpi-card:focus-visible { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); outline: none; }
.kpi-card .top { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.kpi-card .name { font-weight: 600; overflow-wrap: anywhere; }
.kpi-card .figure, .kpi-figure { font-size: 26px; font-weight: 500; }
.kpi-card .figure small, .kpi-figure small { font-size: 14px; font-weight: 400; color: var(--muted); }
.kpi-card .foot, .kpi-foot { display: flex; justify-content: space-between; gap: 12px; font-size: 13px; color: var(--ink2); }
.kpi-foot { margin-top: 8px; }
.kpi-figure { font-size: 30px; margin-bottom: 10px; }
.kpi-bar { height: 8px; border-radius: 4px; background: var(--line); overflow: hidden; }
.kpi-bar i { display: block; height: 100%; border-radius: 4px; background: var(--accent); }
.kpi-bar i.amber { background: #C98A00; }
.kpi-bar i.red { background: var(--danger); }
.kpi-ms { display: flex; align-items: flex-start; gap: 10px; padding: 8px 0; border-top: 1px solid var(--line); font-size: 14px; }
.kpi-ms:first-child { border-top: 0; }
.kpi-ms input[type=checkbox] { margin-top: 3px; }
.kpi-ms .grow { flex: 1 1 auto; min-width: 0; overflow-wrap: anywhere; }
.kpi-ms small { display: block; font-size: 12px; color: var(--muted); }
.kpi-ms small.danger-text { color: var(--danger-dark); }
.kpi-add { margin-top: 10px; }
label.field.kpi-field { flex: 0 0 auto; }
.kpi-nums { display: flex; flex-wrap: wrap; gap: 16px 44px; }
.kpi-nums b { display: block; font-size: 26px; font-weight: 500; }
.kpi-nums span { font-size: 13px; color: var(--muted); }
.kpi-chart { position: relative; }
.kpi-chart svg { display: block; width: 100%; height: auto; }
.kpi-legend { display: flex; flex-wrap: wrap; gap: 6px 20px; font-size: 13px; color: var(--ink2); }
.kpi-legend span { display: inline-flex; align-items: center; gap: 8px; }
.kpi-legend svg { width: 28px; height: 8px; }
.kpi-tip { position: absolute; pointer-events: none; background: var(--ink); color: #fff; font-size: 12px; line-height: 1.5; padding: 8px 10px; border-radius: 8px; white-space: nowrap; transform: translate(-50%, -100%); margin-top: -12px; z-index: 2; }
.kpi-report-cols { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 20px; align-items: start; }
@media (max-width: 1000px) { .kpi-report-cols { grid-template-columns: minmax(0, 1fr); } }
.kpi-step { display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; margin-right: 8px; border-radius: 50%; background: var(--ink); color: #fff; font-size: 12px; font-weight: 700; vertical-align: 2px; }
.kpi-note { border-top: 1px solid var(--line); padding: 10px 0; display: flex; gap: 8px; align-items: flex-start; }
.kpi-note:first-child { border-top: 0; padding-top: 0; }
.kpi-note small { display: block; font-size: 12px; font-weight: 600; color: var(--muted); margin-bottom: 2px; }

/* menu: icons and section titles */
.side a { display: flex; align-items: center; gap: 12px; }
.side a svg { flex: 0 0 20px; }
.side a.sub { padding-left: 44px; }
.side .nav-section { margin-top: 14px; padding: 14px 12px 6px; border-top: 1px solid var(--line); font-size: 12px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
@media (max-width: 700px) { .side a.sub { padding-left: 12px; } .side .nav-section { flex: 1 0 100%; margin-top: 6px; padding-top: 10px; } }

/* task tags */
.tag-chip { display: inline-block; padding: 1px 8px; border-radius: 10px; background: #EEF0F3; color: var(--ink2); font-size: 12px; font-weight: 500; white-space: nowrap; vertical-align: 1px; }
.tag-row { display: flex; flex-wrap: wrap; gap: 4px; }
.tag-pick { border: 0; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.tag-pick legend { padding: 0; margin-bottom: 6px; font-size: 13px; color: var(--muted); }
.tag-pick label { cursor: pointer; }
.tag-pick label input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.tag-pick label span { display: inline-flex; align-items: center; min-height: 34px; padding: 0 12px; border: 1px solid var(--line2, #C9CED4); border-radius: 17px; font-size: 13px; font-weight: 500; }
.tag-pick label input:checked + span { background: var(--accent-soft); border-color: var(--accent); color: var(--accent-dark); font-weight: 600; }
.tag-pick label input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.task-row .tag-chip { margin-right: 3px; }

/* leads */
.lead-cols { display: grid; grid-template-columns: minmax(0, 2.2fr) minmax(0, 1fr); gap: 20px; align-items: start; }
@media (max-width: 1000px) { .lead-cols { grid-template-columns: minmax(0, 1fr); } }
.lead-stack { display: flex; flex-direction: column; gap: 20px; min-width: 0; }
.lead-row { display: flex; align-items: center; gap: 8px 16px; flex-wrap: wrap; padding: 12px 10px; margin: 0 -10px; border-top: 1px solid var(--line); border-radius: 10px; font-size: 14px; cursor: pointer; transition: background-color .16s ease, box-shadow .16s ease; }
.lead-row:hover, .lead-row:focus-visible { background: var(--ground); box-shadow: inset 3px 0 0 var(--accent); outline: none; }
.lead-row .who { flex: 1 1 160px; min-width: 0; }
.lead-row .who b { font-weight: 600; }
.lead-row .said { flex: 2 1 220px; min-width: 0; color: var(--ink2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lead-row .wait { flex: 0 0 auto; white-space: nowrap; color: var(--ink2); }
.lead-said-cell { max-width: 280px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink2); }
.lead-bar { display: grid; grid-template-columns: 110px minmax(0, 1fr) 32px; gap: 10px; align-items: center; padding: 6px 0; font-size: 13px; }
.lead-bar .track { display: block; }
.lead-bar .track i { display: block; height: 8px; min-width: 2px; border-radius: 4px; background: var(--accent); }
.lead-bar b { text-align: right; font-weight: 600; }
.history-line .menu { margin-left: auto; }

/* sections that fold */
.fold-btn { display: flex; align-items: center; gap: 8px; width: 100%; min-height: 32px; padding: 0; border: 0; background: none; font: inherit; color: inherit; text-align: left; cursor: pointer; }
.fold-btn svg { flex: 0 0 16px; color: var(--muted); transition: transform .16s ease; }
.fold-btn[aria-expanded="true"] svg { transform: rotate(90deg); }
.fold-btn:hover svg { color: var(--ink); }
@media (prefers-reduced-motion: reduce) { .fold-btn svg { transition: none; } }

/* column titles that sort the table */
.sort-btn { display: inline-flex; align-items: center; gap: 6px; padding: 0; border: 0; background: none; font: inherit; letter-spacing: inherit; text-transform: inherit; color: inherit; cursor: pointer; }
.sort-btn span { font-size: 9px; opacity: .45; }
.sort-btn:hover, th[aria-sort] .sort-btn { color: var(--ink); }
th[aria-sort] .sort-btn span { opacity: 1; color: var(--accent); }

/* who is signed in, at the bottom of the menu */
.side .who { margin-top: auto; padding: 16px 12px 4px; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.side .who-name { font-weight: 600; overflow-wrap: anywhere; }
@media (max-width: 700px) { .side .who { flex: 1 0 100%; flex-direction: row; align-items: center; justify-content: space-between; margin-top: 6px; padding-top: 10px; } }

/* sign-in page */
.login { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px 16px; }
.login-card { width: min(420px, 100%); background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 32px 28px; display: flex; flex-direction: column; gap: 16px; }
.login-card .brand { font-size: 18px; font-weight: 700; }
.login-card h1 { font-size: 24px; }
.login-card form { display: flex; flex-direction: column; gap: 12px; }
.login-card label.field { flex: 0 0 auto; }
.login-card .btn { justify-content: center; text-align: center; }
.login-card .or { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 13px; }
.login-card .or::before, .login-card .or::after { content: ""; flex: 1; border-top: 1px solid var(--line); }
.login-note { background: var(--accent-soft); color: var(--accent-dark); border-radius: 8px; padding: 12px 14px; }
.copy-row { display: flex; gap: 8px; }
.copy-row input { flex: 1; min-width: 0; }

/* the menu stays in view while the page scrolls, so "Sign out" is always reachable */
@media (min-width: 701px) {
  .side { position: sticky; top: 0; align-self: flex-start; height: 100vh; overflow-y: auto; }
  /* on a short screen the menu scrolls, and "Sign out" stays pinned at its bottom */
  .side .who { position: sticky; bottom: -24px; background: var(--surface); padding-bottom: 24px; }
}

/* hidden for the roles that cannot use them (the server refuses them anyway) */
html[data-role="employee"] [data-owner-only], html[data-role="contractor"] [data-owner-only],
html[data-role="contractor"] [data-not-contractor] { display: none !important; }
