/* Practice module: firm profile, daybook, projects, HR, links, reports, GST invoice composer */

/* searchable client picker */
.pk { position: relative; }
.pk-list { position: absolute; left: 0; right: 0; top: 100%; max-height: 280px; overflow-y: auto; margin-top: 2px; z-index: 1060; }
.pk-list .dropdown-item { gap: .55rem; }
.pk-list .grow { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; }

/* forms */
.form-section { display: flex; align-items: center; gap: .5rem; margin: .5rem 0 .9rem; padding-bottom: .5rem; border-bottom: 1px solid var(--border); font-size: .78rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.form-section .icon { color: var(--brand); }
.drawer-actions { position: sticky; bottom: -1.4rem; display: flex; justify-content: flex-end; gap: .5rem; margin: 1rem -1.4rem -1.4rem; padding: .9rem 1.4rem; background: var(--surface); border-top: 1px solid var(--border); z-index: 2; }
.card-surface.pad > .drawer-actions, .card-surface > form > .drawer-actions { position: static; margin: 1.25rem 0 0; padding: 1rem 0 0; background: transparent; }
form.card-surface.pad > .drawer-actions { position: static; margin: 1.25rem -1.25rem -1.25rem; padding: 1rem 1.25rem; border-radius: 0 0 var(--radius-lg) var(--radius-lg); background: var(--surface-2); }
.offcanvas.drawer.wide { width: min(1100px, 100vw) !important; }
.upper-field input, input[data-upper] { text-transform: uppercase; font-family: var(--font-mono); letter-spacing: .04em; }
.upper-field input::placeholder, input[data-upper]::placeholder { font-family: var(--font-sans); letter-spacing: normal; }
.table .sn { width: 48px; }

/* file slots (logo, signature, attachments) */
.file-slot { background: var(--surface-2); }
.fs-label { font-size: .72rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin-bottom: .7rem; }
.fs-preview { width: 64px; height: 64px; flex: none; border-radius: 50%; display: grid; place-items: center; overflow: hidden; background: var(--surface); border: 1px dashed var(--border-strong); color: var(--faint); font-size: .72rem; text-align: center; }
.fs-preview.wide { width: 180px; height: 80px; border-radius: 10px; padding: .4rem; }
.fs-preview img { width: 100%; height: 100%; object-fit: contain; }
.fs-files { margin-top: .6rem; }
.ent-logo { width: 34px; height: 34px; border-radius: 50%; object-fit: contain; background: #fff; border: 1px solid var(--border); display: inline-grid; place-items: center; }
.ent-logo.ph { background: var(--brand-soft); color: var(--brand); font-size: .7rem; font-weight: 700; }

/* firm info */
.firm-info { padding: 0; overflow: hidden; }
.fi-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0; }
.fi-grid section { padding: 1.25rem 1.4rem .5rem; border-bottom: 1px solid var(--border); }
.fi-grid section:nth-child(odd) { border-right: 1px solid var(--border); }
.fi-h { display: flex; align-items: center; gap: .55rem; font-size: .95rem; font-weight: 700; margin: 0 0 1rem; padding-bottom: .65rem; border-bottom: 1px solid var(--border); }
.fi-h .icon { color: var(--brand); }
.fi-foot { display: flex; justify-content: flex-end; padding: 1rem 1.4rem; background: var(--surface-2); }
@media (max-width: 991.98px) { .fi-grid { grid-template-columns: 1fr; } .fi-grid section:nth-child(odd) { border-right: 0; } }

/* client services */
.svc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .5rem; padding: .75rem; border: 1px solid var(--border); border-radius: 10px; background: var(--surface-2); }
.svc-chip { display: flex; align-items: center; gap: .55rem; padding: .5rem .65rem; border-radius: 8px; border: 1px solid transparent; cursor: pointer; font-size: .9rem; transition: background var(--dur-fast), border-color var(--dur-fast); }
.svc-chip:hover { background: var(--surface-hover); }
.svc-chip input { width: 1.05rem; height: 1.05rem; accent-color: var(--brand); }
.svc-chip:has(input:checked) { border-color: rgba(var(--brand-rgb), .45); background: var(--brand-soft); color: var(--text); font-weight: 600; }

/* bulk / multi daybook, template & project steps */
.bk-results { max-height: 220px; overflow-y: auto; margin-bottom: .5rem; }
.bk-pick { width: 100%; border: 0; background: transparent; color: var(--text); text-align: left; padding: .45rem .6rem; border-radius: 8px; }
.bk-pick:hover { background: var(--surface-hover); }
.bk-pick .icon { color: var(--brand); }
.bk-chips { display: flex; flex-wrap: wrap; gap: .4rem; min-height: 2rem; }
.bk-chip { padding: .25rem .3rem .25rem .6rem; font-family: var(--font-sans); font-size: .82rem; }
.bk-chip button { border: 0; background: transparent; color: var(--muted); padding: 0 .2rem; display: inline-grid; place-items: center; }
.bk-chip button:hover { color: var(--bad); }
.mb-row { padding: .9rem 1rem .1rem; margin-bottom: .8rem; background: var(--surface-2); animation: rise var(--dur) var(--ease); }
.mb-row-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: .6rem; }
.mb-row-head .tag { background: var(--brand-soft); color: var(--brand); border-color: rgba(var(--brand-rgb), .3); font-family: var(--font-sans); font-weight: 700; }
.mb-row [data-up] .icon { transform: rotate(90deg); }
.mode-seg { display: flex; }
.mode-seg button { flex: 1; justify-content: center; padding: .6rem; }

/* office notes */
.notes-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 1rem; }
.note-card { padding: 1rem 1.1rem; cursor: pointer; border-top: 3px solid var(--border-strong); }
.note-card h3 { font-size: 1rem; margin: 0 0 .5rem; }
.note-card p { font-size: .9rem; color: var(--text-2); max-height: 9.5em; overflow: hidden; }
.note-green { border-top-color: var(--ok); } .note-amber { border-top-color: var(--warn); } .note-red { border-top-color: var(--bad); } .note-teal { border-top-color: #14b8a6; }

/* reports */
.table tfoot .tot td { font-weight: 800; border-top: 2px solid var(--border-strong); background: var(--surface-2); }
.grp-row .tree-toggle { margin-right: .35rem; }
.pl-chart { display: grid; grid-template-columns: repeat(12, 1fr); gap: .4rem; align-items: end; height: 220px; padding: 1rem 1.25rem .75rem; }
.pl-col { display: flex; flex-direction: column; align-items: center; gap: .35rem; height: 100%; }
.pl-bars { flex: 1; width: 100%; display: flex; align-items: flex-end; justify-content: center; gap: 3px; }
.pl-bars span { width: 40%; max-width: 16px; height: 2%; border-radius: 4px 4px 0 0; transition: height 900ms var(--ease); }
.pl-bars .inc, .lg-dot.inc { background: var(--brand); }
.pl-bars .exp, .lg-dot.exp { background: var(--warn); }
.pl-col small { font-size: .66rem; color: var(--muted); white-space: nowrap; }
.lg-dot { display: inline-block; width: 9px; height: 9px; border-radius: 2px; vertical-align: 0; }

/* GST invoice composer */
.gi { padding: 0; overflow: visible; }
.gi-head { display: flex; justify-content: space-between; gap: 1rem; padding: 1.25rem 1.5rem; border-bottom: 1px solid var(--border); }
.gi-ent { display: flex; gap: 1rem; align-items: flex-start; }
.gi-ent h2 { font-size: 1.5rem; font-weight: 800; margin: 0 0 .3rem; }
.gi-logo { width: 58px; height: 58px; flex: none; border: 1px solid var(--border); border-radius: 10px; background: #fff; display: grid; place-items: center; overflow: hidden; }
.gi-logo img { width: 100%; height: 100%; object-fit: contain; }
.gi-logo-ph { font-weight: 800; color: var(--brand); }
.gi-title { text-align: right; display: flex; flex-direction: column; align-items: flex-end; gap: .5rem; }
.gi-title h2 { font-size: 2rem; font-weight: 800; letter-spacing: .02em; margin: 0; color: var(--text); }
.gi-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; padding: 1rem 1.5rem 0; }
.gi-box { border: 1px solid var(--border); border-radius: 12px; padding: 1rem 1.1rem; background: var(--surface); }
.gi-box h3 { font-size: .74rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin: 0 0 .8rem; }
.gi-kv { display: grid; grid-template-columns: 42% 1fr; align-items: center; gap: .5rem; margin-bottom: .5rem; font-size: .86rem; color: var(--text-2); }
.gi-lines { margin: 1rem 1.5rem 0; overflow-x: auto; }
.gi-lines th { white-space: nowrap; }
.gi-add { margin: 1rem 1.5rem 0; padding: 1rem; border: 1px dashed var(--border-strong); border-radius: 12px; background: var(--surface-2); }
.gi-sumlist { display: grid; grid-template-columns: 1fr auto; gap: .45rem 1rem; margin: 0 0 .75rem; font-size: .88rem; }
.gi-sumlist dt { color: var(--muted); font-weight: 500; }
.gi-sumlist dd { margin: 0; text-align: right; font-weight: 700; }
.gi-grand { display: flex; justify-content: space-between; align-items: center; padding: .75rem 1rem; border-radius: 10px; background: var(--brand-soft); color: var(--text); font-size: 1.35rem; font-weight: 800; font-family: var(--font-mono); }
.gi-words { margin: 1rem 1.5rem 0; padding: .7rem 1rem; border-radius: 10px; border: 1px solid var(--border); background: var(--surface-2); font-size: .86rem; }
.gi-words span { text-transform: uppercase; font-size: .72rem; letter-spacing: .06em; color: var(--muted); font-weight: 700; }
.gi-sign { padding: 1rem 1.5rem 0; }
.gi-signimg { max-width: 180px; max-height: 70px; object-fit: contain; background: #fff; border-radius: 6px; padding: .2rem; }
.gi > .drawer-actions { position: static; margin: 1.25rem 0 0; padding: 1rem 1.5rem; border-radius: 0 0 var(--radius-lg) var(--radius-lg); background: var(--surface-2); }
@media (max-width: 991.98px) { .gi-grid { grid-template-columns: 1fr; } .gi-head { flex-direction: column; } .gi-title { align-items: flex-start; text-align: left; } }

/* print: the composer prints as a clean white invoice */
@media print {
  body.print-invoice .nav-wrap, body.print-invoice .topbar, body.print-invoice .app-footer, body.print-invoice .page-head, body.print-invoice .gi-add, body.print-invoice .drawer-actions, body.print-invoice [data-rmline], body.print-invoice .sb-scrim, body.print-invoice .toast-stack { display: none !important; }
  body.print-invoice .main { margin: 0 !important; padding: 0 !important; }
  body.print-invoice .content { padding: 0 !important; }
  body.print-invoice, body.print-invoice .gi, body.print-invoice .gi-box, body.print-invoice .card-surface { background: #fff !important; color: #111 !important; box-shadow: none !important; }
  body.print-invoice .gi * { color: #111 !important; border-color: #ccc !important; }
  body.print-invoice .form-control, body.print-invoice .form-select { border: 0 !important; background: transparent !important; padding: 0 !important; appearance: none; }
  body:not(.print-invoice) .nav-wrap, body:not(.print-invoice) .topbar, body:not(.print-invoice) .app-footer, body:not(.print-invoice) .toolbar .btn { display: none !important; }
  body:not(.print-invoice) .main { margin: 0 !important; }
}
.table td .mono, .table td.text-end { white-space: nowrap; }
