/* Generic list-page shell -- the canonical layout every migrated top-level
   list page shares (/projects, /contractors, ...): full-bleed white title bar,
   chip + search + filter toolbar bar, active-filter subheader, muted body.
   Source: ledgerwise-ui gc-projects-page.tsx / gc-vendors-page.tsx page
   chrome (measured during the /projects migration, 2026-07-10; the vendors
   page renders the identical bars). Moved up from lw-projects.css when
   /contractors became the second consumer. Page-specific styles (identity
   columns, status maps) stay with their page. */

/* Full-bleed shell: break out of the content shell's pa-6 so the header and
   toolbar bars span edge-to-edge like ledgerwise-ui (main padding = 0 there). */
.lw-page-shell {
    display: flex;
    flex-direction: column;
    margin: -24px;
    min-height: calc(100% + 48px);
    background: var(--lw-bg-muted);
}

/* Title bar -- full-bleed white bar, bottom hairline. Measured reference:
   16px 24px padding, 88px tall, title 22/700 foreground + subtitle 14/400
   content-secondary, action-sm buttons on the right. */
.lw-page-titlebar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    padding: 16px 24px;
    background: var(--lw-white);
    border-bottom: 1px solid var(--lw-border);
}

.lw-page-titlebar-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.lw-page-title {
    margin: 0;
    font-family: var(--lw-font-family);
    font-size: var(--lw-title-size);
    line-height: 33px;
    font-weight: var(--lw-title-weight);
    letter-spacing: var(--lw-tracking-tight);
    color: var(--lw-title-color);
}

.lw-page-subtitle {
    margin: 0;
    font-family: var(--lw-font-family);
    font-size: 14px;
    line-height: 20px;
    color: var(--lw-gray-graphite);
}

/* Title-bar action cluster (reference: flex flex-wrap items-center gap-2). */
.lw-page-titlebar-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

/* action-sm button (ui/button.tsx size="action-sm"): h-9 (36px), 13px/500,
   8px radius, px-4. --primary = filled navy; --outline = hairline border on
   white with accent hover (also the toolbar Filter button). */
.lw-page-action {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 36px;
    padding: 0 16px;
    border: none;
    border-radius: var(--lw-radius-control);
    cursor: pointer;
    font-family: var(--lw-font-family);
    font-size: 13px;
    font-weight: var(--lw-font-medium);
    text-decoration: none; /* also used on <a> styled as a button */
    white-space: nowrap;
    transition: background 0.15s ease;
}

.lw-page-action--primary {
    background: var(--lw-primary-dark);
    color: var(--lw-white);
}

.lw-page-action--primary:hover {
    background: var(--lw-primary-dark-hover);
}

.lw-page-action--outline {
    border: 1px solid var(--lw-border);
    background: var(--lw-white);
    color: var(--lw-text-primary);
}

/* Reference outline hover is the OPAQUE muted fill (#F0F3F6), not the
   translucent accent -- corrected 2026-07-23 (primitives audit). */
.lw-page-action--outline:hover {
    background: var(--lw-bg-muted);
}

/* Body: padded muted region holding the list. */
.lw-page-body {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 24px;
}

/* Toolbar bar -- full-bleed white bar, bottom hairline. Reference: 12px 24px
   padding, 61px tall, chips left / search + filter right (justify-between). */
.lw-page-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    padding: 12px 24px;
    background: var(--lw-white);
    border-bottom: 1px solid var(--lw-border);
}

/* Quick-filter chip rail (stage chips, vendor-type chips, ...). */
.lw-page-chips {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.lw-page-toolbar-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Search: h-9 rounded-md bordered, 208px, leading icon, focus border primary. */
.lw-page-search {
    position: relative;
    display: flex;
    align-items: center;
    width: 208px;
    height: 36px;
    border: 1px solid var(--lw-border);
    border-radius: var(--lw-radius-control);
    background: var(--lw-white);
    transition: border-color 0.15s ease;
}

/* Reference focus:border-primary is the NAVY primary (#020B2B), not the
   blue accent -- corrected 2026-07-23 (primitives audit). */
.lw-page-search:focus-within {
    border-color: var(--lw-primary-dark);
}

/* Reference: size-4 (16px) icon at left-3 (12px), pl-9 (36px) -- corrected
   2026-07-23 (primitives audit). */
.lw-page-search-icon {
    position: absolute;
    left: 12px;
    font-size: 16px !important;
    width: 16px;
    height: 16px;
    color: var(--lw-gray-space);
    pointer-events: none;
}

.lw-page-search-input {
    width: 100%;
    height: 100%;
    padding: 0 12px 0 36px;
    border: 0;
    background: transparent;
    outline: none;
    font-family: var(--lw-font-family);
    font-size: 14px;
    color: var(--lw-text-primary);
}

.lw-page-search-input::placeholder {
    color: var(--lw-gray-space);
}

/* Active-filter subheader -- full-bleed white bar between the toolbar and the
   list (reference: border-b, bg-white, min-h-60, flex-wrap gap-2, px-6 py-2.5).
   Sits outside .lw-page-body so it is NOT inset by the body's muted padding. */
.lw-page-active-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    min-height: 60px;
    padding: 10px 24px;
    background: var(--lw-white);
    border-bottom: 1px solid var(--lw-border);
}

.lw-page-active-bar-label {
    font-size: 12px;
    font-weight: 500;
    color: var(--lw-gray-space);
}

/* "Clear All" -- link-styled button, brand accent, medium. */
.lw-page-active-clear {
    margin-left: 4px;
    padding: 0;
    border: 0;
    background: none;
    font-size: 13px;
    font-weight: 500;
    color: var(--lw-primary-blue);
    cursor: pointer;
}

.lw-page-active-clear:hover {
    text-decoration: underline;
}

/* Empty-results card (filters matched nothing -- distinct from the zero-data
   welcome hero). Surface provided by the shared Card primitive. */
.lw-page-empty-results {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: var(--lw-spacing-sm);
    padding: 3rem 1rem;
    text-align: center;
}

.lw-page-empty-title {
    font-size: 1.125rem;
    font-weight: var(--lw-font-semibold);
    color: var(--lw-primary-dark);
    margin: 0.5rem 0 0;
    font-family: var(--lw-font-family-heading);
}

.lw-page-empty-desc {
    font-size: 0.875rem;
    color: var(--lw-gray-graphite);
    margin: 0;
    max-width: 420px;
}

/* ---- List row content (shared by /contractors, /clients, ...) ----
   Source: ledgerwise-app gc-vendors-page.tsx row cells: identity flex-1
   (title 14/500 + sub 12 muted, truncated), fixed-width trailing cells
   (main 14 / sub 12 muted / numeric 14 500 tabular), ghost icon-sm row
   buttons. All columns are left-aligned (headers and values; Cody 2026-07-12). Column widths stay inline per page (they are the page's
   column spec); these classes own the cell chrome. */

.lw-row-identity {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
    flex: 1;
}

.lw-row-title {
    font-size: 14px;
    font-weight: var(--lw-font-medium);
    color: var(--lw-text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.lw-row-sub {
    font-size: 12px;
    color: var(--lw-gray-space);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.lw-row-cell {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
    flex-shrink: 0;
}

.lw-row-cell-main {
    font-size: 14px;
    color: var(--lw-text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.lw-row-cell-num {
    font-size: 14px;
    font-weight: var(--lw-font-medium);
    color: var(--lw-text-primary);
    font-variant-numeric: tabular-nums;
}

.lw-row-cell-sub {
    font-size: 12px;
    color: var(--lw-gray-space);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.lw-row-cell-sub--warning {
    color: var(--lw-status-warning-fg);
}

.lw-row-cell-sub--error {
    color: var(--lw-status-error-fg);
}

.lw-row-cell-num--success {
    color: var(--lw-status-success-fg);
}

.lw-row-cell-num--error {
    color: var(--lw-status-error-fg);
}

.lw-row-cell-num--muted {
    color: var(--lw-gray-graphite);
    font-weight: var(--lw-font-regular);
}

/* Status column: fixed-width badge cell. Left-aligned like every other
   column (Cody, 2026-07-12: list columns are always left-aligned -- headers
   and values; overrides the reference's right-aligned numeric/status cells). */
.lw-row-status-cell {
    display: flex;
    justify-content: flex-start;
    flex-shrink: 0;
}

/* Ghost icon button (reference ui/button.tsx variant="ghost" size="icon-sm":
   32px square, 8px radius, accent hover, 16px icon). */
.lw-row-icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    padding: 0;
    border: 0;
    border-radius: var(--lw-radius-control);
    background: none;
    color: var(--lw-gray-graphite);
    cursor: pointer;
    transition: background 0.15s ease;
}

.lw-row-icon-btn:hover {
    background: var(--lw-accent);
    color: var(--lw-text-primary);
}

.lw-row-icon-btn--danger:hover {
    color: var(--lw-status-error-fg);
}

.lw-row-icon-btn .mud-icon-root {
    font-size: 16px;
}

/* Column-header cells (inside LwListCard's ColumnHeader) mirroring the row
   grid: name flex-1, fixed-width stat cluster on a 24px gap. */
.lw-list-col-name {
    flex: 1;
}

.lw-list-col-stats {
    display: flex;
    align-items: center;
    gap: 24px;
    flex-shrink: 0;
}

/* Access-summary caption under a list. */
.lw-page-caption {
    margin: 0;
    font-size: 12px;
    color: var(--lw-gray-graphite);
    text-align: center;
}

/* Fixed 40px squircle icon tile for non-entity rows (document/template
   lists) -- the icon analog of LwAvatar's squircle. Pages color it from
   filetype/status tokens via a page-scoped modifier class. */
.lw-row-tile {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    flex-shrink: 0;
    border-radius: var(--lw-radius-control);
}

.lw-row-tile .mud-icon-root {
    font-size: 20px;
}

/* Column-header spacer over a row-actions column: the 48px actions cell
   (8px pads + 32px button) minus the header's 16px right padding and gap. */
.lw-list-col-actions {
    width: 16px;
    flex-shrink: 0;
}

/* ---- LwEmptyState slot vocabulary ----
   Source: ledgerwise-app *-empty-state organisms. Global (not scoped to
   LwEmptyState) because signature rows / CTA / value points are authored by
   the consuming page inside RenderFragments. */

/* Signature mini-preview row: 24px avatar + name + (amount) + status chip. */
.lw-empty-sig-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 8px;
    border-radius: var(--lw-radius-control);
    background: var(--lw-bg-body);
}

/* 24px mini variant of .lw-row-tile for signature rows (avatar-sized). */
.lw-empty-sig-tile {
    width: 24px;
    height: 24px;
    border-radius: 6px;
}

.lw-empty-sig-name {
    min-width: 0;
    flex: 1;
    font-size: 13px;
    font-weight: var(--lw-font-medium);
    line-height: 1.25;
    color: var(--lw-text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.lw-empty-sig-sub {
    display: block;
    font-size: 11px;
    font-weight: var(--lw-font-regular);
    line-height: 1.25;
    color: var(--lw-gray-graphite);
}

.lw-empty-sig-amount {
    font-size: 13px;
    font-weight: var(--lw-font-semibold);
    font-variant-numeric: tabular-nums;
    color: var(--lw-text-primary);
}

/* Value point: 36px info-tinted icon tile, 14/600 label, 12px description. */
.lw-empty-point {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    text-align: center;
}

.lw-empty-point-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: var(--lw-radius-card);
    background: var(--lw-status-info-bg);
    color: var(--lw-primary-blue);
}

.lw-empty-point-icon .mud-icon-root {
    font-size: 18px;
}

.lw-empty-point-label {
    margin: 0;
    font-size: 14px;
    font-weight: var(--lw-font-semibold);
    color: var(--lw-text-primary);
}

.lw-empty-point-desc {
    margin: 0;
    font-size: 12px;
    line-height: 1.6;
    color: var(--lw-gray-graphite);
}

/* size="action" CTA (ui/button.tsx): h-10 (40px), px-5, 14px, 8px gap. */
.lw-page-action--lg {
    height: 40px;
    padding: 0 20px;
    gap: 8px;
    font-size: 14px;
}

/* ---- Embedded list section (company-page cards: team, invitation) ---- */
.lw-section {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.lw-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.lw-section-title {
    margin: 0;
    font-family: var(--lw-font-family);
    font-size: 16px;
    font-weight: var(--lw-font-semibold);
    letter-spacing: var(--lw-tracking-tight);
    color: var(--lw-text-primary);
}

/* -- Inbox drop zone + extraction affordances -----------------------------
   Shared chrome for the document-inbox pages (/invoices, /proposals): the
   mandated drag-and-drop + click-to-browse PDF drop zone, the extraction
   spinner tile, the animated "Extracting" chip dots, and the hidden picker
   behind the empty-state CTA. Moved up from Invoices.razor.css (scoped CSS
   never reaches sibling pages) when /proposals became the second consumer
   (US-600, 2026-07-24). Selectors that needed ::deep in the scoped file are
   plain descendants here -- global sheets carry no isolation attribute. */

.inv-dropzone {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 2rem 1.25rem;
    border: 1px dashed var(--lw-border);
    border-radius: var(--lw-radius-card);
    background-color: var(--lw-white);
    cursor: pointer;
    text-align: center;
    transition: border-color 0.15s ease, background-color 0.15s ease;
    overflow: hidden;
}

.inv-dropzone:hover {
    border-color: var(--lw-primary-dark);
    background-color: rgba(2, 11, 43, 0.06); /* primary-soft hover tint (was --inv-primary-soft) */
}

/* The InputFile's rendered <input> stretches invisibly over the whole zone so
   both click and drop land on it. */
.inv-dropzone .inv-dropzone__input {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
    z-index: 1;
}

.inv-dropzone__icon .mud-icon-root {
    color: var(--lw-primary-dark) !important;
}

.inv-dropzone__title {
    font-family: var(--lw-font-family, inherit);
    font-size: 0.9375rem;
    font-weight: var(--lw-font-semibold);
    color: var(--lw-text-primary);
    margin: 0;
}

.inv-dropzone__hint {
    font-size: 0.8125rem;
    color: var(--lw-gray-graphite);
    margin: 0;
}

/* Spinner tile shown in place of the vendor avatar while extracting. */
.inv-extract-tile {
    background: var(--lw-status-info-bg);
}

/* Animated trailing dots inside the "Extracting" status chip. */
.inv-extracting-dots::after {
    content: '';
    display: inline-block;
    width: 1em;
    text-align: left;
    animation: inv-extracting-dots 1.4s steps(4, end) infinite;
}

@keyframes inv-extracting-dots {
    0%   { content: ''; }
    25%  { content: '.'; }
    50%  { content: '..'; }
    75%  { content: '...'; }
    100% { content: ''; }
}

/* Hidden InputFile behind the empty-state CTA label (the drop zone above
   remains the drag-and-drop surface; this is the same picker). */
.lw-page-action .inv-hidden-input {
    display: none;
}

@media (max-width: 640px) {
    .inv-dropzone {
        padding: 1.5rem 1rem;
    }
}
