/* ---- Work board (Work/Index): lanes on the page background, cards on them ---- */
.work-board { display: grid; grid-template-columns: repeat(5, minmax(190px, 1fr)); gap: .85rem; overflow-x: auto; padding-bottom: .5rem; align-items: start; }
.board-column { background: var(--px-line-2); border-radius: 12px; padding: .6rem; min-width: 0; }
.board-column-head { display: flex; align-items: center; gap: .5rem; padding: .3rem .4rem .7rem; }
.board-column-title { font-size: var(--px-text-sm); font-weight: 650; margin: 0; color: var(--px-ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; letter-spacing: 0; }
.board-count { margin-left: auto; min-width: 22px; height: 20px; padding: 0 6px; border-radius: 99px; background: var(--px-surface); color: var(--px-ink-3); font-size: var(--px-text-xs); font-weight: 650; display: inline-grid; place-items: center; }
.board-dot { width: 8px; height: 8px; border-radius: 50%; flex: none; background: var(--px-ink-3); }
.board-dot-inprogress { background: var(--px-brand); }
.board-dot-waitingonclient { background: var(--px-warn); }
.board-dot-review { background: var(--px-info); }
.board-dot-complete { background: var(--px-ok); }
.work-card {
    display: block; cursor: grab; margin-bottom: .55rem; padding: .7rem .8rem .65rem;
    background: var(--px-surface); border: 1px solid var(--px-line); border-radius: 9px; box-shadow: var(--px-shadow);
    transition: box-shadow .15s ease, border-color .15s ease, opacity .15s ease;
}
.work-card:hover { border-color: #CBD2DC; box-shadow: 0 4px 12px rgba(15, 23, 42, .08); }
[data-bs-theme=dark] .work-card:hover { border-color: #334155; }
.work-card-client { color: var(--px-ink-3); font-size: var(--px-text-xs); font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.work-card-title { display: block; color: var(--px-ink); font-weight: 600; font-size: var(--px-text-sm); line-height: 1.35; margin: .15rem 0 .55rem; }
.work-card-title:hover { color: var(--px-brand-ink); }
.work-card-meta { display: flex; align-items: center; gap: .45rem; }
.work-card-due { display: inline-flex; align-items: center; gap: .3rem; color: var(--px-ink-3); font-size: var(--px-text-xs); font-weight: 500; white-space: nowrap; }
.work-card-due.is-late { color: var(--px-bad); }
.work-card-avatar { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; background: var(--px-brand-soft); color: var(--px-brand-ink); font-size: 10px; font-weight: 700; }
.work-card-avatar.is-empty { background: var(--px-line-2); color: var(--px-ink-3); font-size: 11px; }
.work-card-edit { display: none; width: 22px; height: 22px; border-radius: 6px; place-items: center; color: var(--px-ink-3); font-size: 12px; }
.work-card:hover .work-card-edit, .work-card-edit:focus-visible { display: grid; }
.work-card:hover .work-card-who { display: none; }
.work-card-edit:hover { background: var(--px-line-2); color: var(--px-ink); }
@media (max-width: 1199.98px) { .work-board { grid-template-columns: repeat(5, 260px); } }


.work-lane {
    min-height: 160px;
    display: flex;
    flex-direction: column;
    gap: 0;
    border-radius: 0.5rem;
    transition: background-color 0.2s ease;
}

body.is-dragging-active .work-lane {
    pointer-events: all;
}

.work-lane.is-drag-over {
    background: var(--px-accent-soft);
    box-shadow: inset 0 0 0 2px var(--px-brand);
}

.work-lane.is-reordering {
    position: relative;
}


.work-card.is-dragging {
    opacity: 0.5;
    cursor: grabbing;
}

.work-card.is-reorder-preview {
    opacity: 0.4;
    border: 2px solid var(--px-brand);
}

.work-lane-placeholder {
    height: 80px;
    background: linear-gradient(135deg, var(--px-brand) 0%, var(--px-brand) 100%);
    opacity: 0.15;
    border: 2px dashed var(--px-brand);
    border-radius: 0.75rem;
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    color: var(--px-brand);
    font-weight: 500;
    animation: placeholderPulse 0.6s ease-in-out infinite;
    position: relative;
}

.work-lane-placeholder::before {
    content: '⬇';
    font-size: 1.5rem;
    color: var(--px-brand);
    opacity: 0.6;
}

@keyframes placeholderPulse {
    0%, 100% {
        opacity: 0.15;
        border-color: var(--px-brand);
    }
    50% {
        opacity: 0.25;
        border-color: var(--px-brand-hover);
        background: linear-gradient(135deg, var(--px-brand) 0%, var(--px-brand-hover) 100%);
    }
}

.work-drop-zone {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px dashed var(--px-line);
    border-radius: 0.75rem;
    color: var(--px-ink-3);
    font-size: 0.85rem;
    font-weight: 500;
    padding: 0.6rem 1rem;
    margin-top: 0.25rem;
    transition: background-color 0.2s ease, border-color 0.2s ease, padding 0.2s ease, flex 0.2s ease;
}

.work-drop-zone.is-empty {
    flex: 1 1 auto;
    padding: 2.5rem 1rem;
}

body.is-dragging-active .work-drop-zone.is-drag-over {
    background: var(--px-accent-soft);
    border-color: var(--px-brand);
    color: var(--px-brand);
}

/* Invoice lines: keep the inputs usable on phones; the .table-responsive wrapper scrolls sideways. */
#invoice-lines {
    min-width: 640px;
}

/* ---- Dashboard (Dashboard/Index): greeting, hero tiles, then the lists ---- */
.today-date { color: var(--px-ink-3); font-size: var(--px-text-xs); font-weight: 600; text-transform: uppercase; letter-spacing: .07em; }
.today-title { font-size: var(--px-text-4xl); font-weight: 650; letter-spacing: -.025em; margin: .3rem 0 .35rem; color: var(--px-ink); }
.today-sub { color: var(--px-ink-2); font-size: var(--px-text-base-plus); }

.today-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1rem; }
.today-stat { display: block; padding: 1.15rem 1.25rem 1.1rem; text-decoration: none; }
.today-stat-k { display: flex; align-items: center; gap: .45rem; color: var(--px-ink-3); font-size: var(--px-text-sm); font-weight: 500; }
.today-stat-k .bi { font-size: 14px; }
.today-stat-v { font-size: var(--px-text-5xl); font-weight: 600; letter-spacing: -.03em; line-height: 1.1; margin-top: .55rem; color: var(--px-ink); font-variant-numeric: tabular-nums; }
.today-stat-d { color: var(--px-ink-3); font-size: var(--px-text-sm); margin-top: .35rem; }
.today-stat .is-bad { color: var(--px-bad); }
a.today-stat:hover .today-stat-k { color: var(--px-brand-ink); }

.today-grid { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 1.25rem; align-items: start; }
.today-side { display: grid; gap: 1.25rem; }
.today-num { color: var(--px-ink-3); font-size: var(--px-text-sm); font-variant-numeric: tabular-nums; }

.today-group { padding: .6rem 1.5rem .45rem; font-size: var(--px-text-xs); color: var(--px-ink-3); text-transform: uppercase; letter-spacing: .07em; font-weight: 600; background: var(--px-surface-2); border-top: 1px solid var(--px-line-2); border-bottom: 1px solid var(--px-line-2); }
.today-group:first-child { border-top: 0; }
.today-group-note { text-transform: none; letter-spacing: 0; font-weight: 400; }
.today-row, .today-dl, .today-team { display: flex; align-items: center; gap: .9rem; padding: .85rem 1.5rem; border-bottom: 1px solid var(--px-line-2); }
.today-row { color: var(--px-ink); text-decoration: none; }
.today-row:hover { background: var(--px-surface-2); color: var(--px-ink); }
.today-row:hover .today-row-t { color: var(--px-brand-ink); }
.today-row-main { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.today-row-t { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.today-row-s { color: var(--px-ink-3); font-size: var(--px-text-sm); margin-top: .1rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.today-row .badge, .today-dl .badge, .today-team .badge { flex: none; }
.today-kind { width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; flex: none; font-size: 15px; }
.today-kind-accent { background: var(--px-brand-soft); color: var(--px-brand-ink); }
.today-kind-amber { background: var(--px-warn-soft); color: var(--px-warn); }
.today-kind-violet { background: var(--px-violet-soft); color: var(--px-violet); }
.today-kind-muted { background: var(--px-line-2); color: var(--px-ink-3); }
.today-more { display: block; padding: .6rem 1.5rem; font-size: var(--px-text-sm); border-bottom: 1px solid var(--px-line-2); }
.today-foot { padding: .8rem 1.5rem; color: var(--px-ink-3); font-size: var(--px-text-sm); }
.today-empty { text-align: center; padding: 2.5rem 1.5rem; color: var(--px-ink-2); }
.today-empty .bi { width: 44px; height: 44px; margin: 0 auto .7rem; border-radius: 12px; display: grid; place-items: center; background: var(--px-ok-soft); color: var(--px-ok); font-size: 20px; }
.today-needs > .card-body > :last-child { border-bottom: 0; }
.today-side .card-body.p-0 > :last-child { border-bottom: 0; }

.today-days { display: grid; grid-template-columns: repeat(5, 1fr); gap: .6rem; }
.today-day { text-align: center; }
.today-day-col { height: 84px; background: var(--px-surface-2); border: 1px solid var(--px-line-2); border-radius: 7px; position: relative; overflow: hidden; }
.today-day-h { display: block; color: var(--px-ink-3); font-weight: 500; font-variant-numeric: tabular-nums; }
.today-day-col span { position: absolute; bottom: 0; left: 0; right: 0; background: rgba(var(--px-brand-rgb), .35); border-radius: 7px 7px 0 0; }
.today-day.is-today .today-day-col span { background: var(--px-brand); }
.today-day-col span.over { background: var(--px-warn) !important; }
.today-day small { display: block; margin-top: .45rem; color: var(--px-ink-3); font-size: var(--px-text-xs); font-weight: 500; }
.today-day.is-today small { color: var(--px-brand-ink); font-weight: 650; }

.today-cal { width: 42px; text-align: center; border: 1px solid var(--px-line); border-radius: 8px; padding: 3px 0 4px; flex: none; line-height: 1.15; background: var(--px-surface); }
.today-cal small { display: block; font-size: 10px; color: var(--px-brand-ink); font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
.today-cal b { font-size: var(--px-text-base-plus); font-weight: 650; }
.today-cal.is-late small { color: var(--px-bad); }

@media (max-width: 1199.98px) {
  .today-grid { grid-template-columns: minmax(0, 1fr); }
  .today-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 575.98px) {
  .today-stats { gap: .65rem; }
  .today-stat { padding: .9rem 1rem; }
  .today-stat-v { font-size: var(--px-text-3xl); }
  .today-title { font-size: var(--px-text-2xl); }
  .today-row, .today-dl, .today-team, .today-group, .today-more, .today-foot { padding-left: 1rem; padding-right: 1rem; }
}

/* ---- Phones ----
   Page headers wrap instead of squeezing their buttons, cards use less padding, and
   data tables (labelled by PraxiOS.stackTables in site.js) show each row as a card. */
@media (max-width: 575.98px) {

    .table-responsive:has(> .table-stack) { overflow: visible; }
    table.table-stack { min-width: 0 !important; }
    .table-stack thead { display: none; }
    .table-stack, .table-stack tbody, .table-stack tfoot, .table-stack tr { display: block; width: 100%; }
    .table-stack tr { padding: .75rem 0; border-bottom: 1px dashed var(--px-line) !important; }
    .table-stack tbody tr:last-child { border-bottom: 0 !important; }
    /* Totals rows already carry their own label in the first cell: show them as one line. */
    .table-stack tfoot tr { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .25rem 1rem; border-top: 1px solid var(--px-line) !important; border-bottom: 0 !important; }
    .table-stack tfoot tr > * { width: auto !important; }
    .table-stack tfoot tr > :empty { display: none; }
    .table-stack td, .table-stack tfoot th, .table-stack tfoot td {
        display: block; width: 100%; min-width: 0 !important; border: 0 !important;
        padding: .2rem 0 !important; text-align: right !important; overflow-wrap: anywhere;
    }
    .table-stack tbody td::after { content: ""; display: table; clear: both; }
    .table-stack td[data-label]::before {
        content: attr(data-label); float: left; margin-right: 1rem;
        color: var(--px-ink-3); font-size: .8rem; font-weight: 500; text-align: left;
    }
    .table-stack td:first-child, .table-stack tfoot tr > :first-child, .table-stack td[colspan] { text-align: left !important; }
    .table-stack tbody td:first-child { padding-bottom: .4rem !important; }
    .table-stack tbody td:not(:first-child):not([data-label]):not([colspan]) { padding-top: .5rem !important; }
}

/* Report stat tiles (a label and one number) sit two to a row below tablet width
   instead of one tall card each. */
@media (max-width: 767.98px) {
    .row > [class*="col-md-"]:has(> .card > .card-body > div:last-child:nth-child(2)[class*="fs-"]) { flex: 0 0 auto; width: 50%; }
    .row > [class*="col-md-"]:has(> .card > .card-body > div:last-child:nth-child(2)[class*="fs-"]) > .card > .card-body { padding: 1rem; }
    .row > [class*="col-md-"]:has(> .card > .card-body > div:last-child:nth-child(2)[class*="fs-"]) .fs-2 { font-size: 1.25rem !important; }
}

/* Some forms make the card body itself a .row; its negative gutters pushed the
   fields past the card edge. Keep the row inside and let the column padding space it. */
.card .card-body.row { margin-left: 0; margin-right: 0; }

/* New-invoice line editor on phones: description and remove button on one line,
   then quantity, unit price and line total side by side under it. */
@media (max-width: 575.98px) {
    .table-responsive:has(> #invoice-lines) { overflow: visible; }
    #invoice-lines thead { display: none; }
    #invoice-lines, #invoice-lines tbody, #invoice-lines tfoot { display: block; width: 100% !important; min-width: 0 !important; }
    #invoice-lines tbody tr { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)) auto; gap: .5rem; padding: .75rem 0; border-bottom: 1px dashed var(--px-line); }
    #invoice-lines tbody td { display: block; padding: 0 !important; border: 0 !important; width: auto !important; }
    #invoice-lines tbody td:nth-child(1) { grid-column: 1 / 4; }
    #invoice-lines tbody td:nth-child(5) { grid-column: 4; grid-row: 1; align-self: center; }
    #invoice-lines tbody td:nth-child(2) { grid-column: 1; }
    #invoice-lines tbody td:nth-child(3) { grid-column: 2; }
    #invoice-lines tbody td:nth-child(4) { grid-column: 3 / 5; }
    #invoice-lines tbody td:nth-child(n+2):nth-child(-n+4)::before { display: block; margin-bottom: .2rem; color: var(--px-ink-3); font-size: .75rem; font-weight: 500; }
    #invoice-lines tbody td:nth-child(2)::before { content: "Qty"; }
    #invoice-lines tbody td:nth-child(3)::before { content: "Unit price"; }
    #invoice-lines tbody td:nth-child(4)::before { content: "Line total"; }
    #invoice-lines tfoot tr { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .75rem 0; }
    #invoice-lines tfoot th { padding: 0 !important; border: 0 !important; }
    #invoice-lines tfoot th:empty { display: none; }
    #invoice-lines tfoot th:nth-child(2) { max-width: 55%; }
}

/* New invoice: the computed totals read as figures, not as fields. */
#invoice-lines .js-line-total, #invoice-total { border: 0; background: transparent; box-shadow: none; text-align: right; font-variant-numeric: tabular-nums; padding-right: 0; pointer-events: none; }
#invoice-total { font-size: var(--px-text-md); }
#invoice-lines tfoot th { border-top: 1px solid var(--px-line); }

/* Sign-up decoy field for bots (SignupGuard): off-screen rather than display:none, which some bots skip. */
.px-hp { position: absolute; left: -10000px; top: auto; width: 1px; height: 1px; overflow: hidden; }

/* AI suggestions (site.js data-ai-suggest): plain text from the model, line breaks kept. */
.ai-suggestion { white-space: pre-wrap; line-height: 1.55; }
