/* EVO TrustGuard — page-invoices.css
 *
 * Owned by:    invoices.html
 * Category:    portal feature page
 * Cascade:     tokens → base → utilities → components → portal-chrome → shared → shared-themes → page
 * Edit policy: rules unique to this page only. Anything used by 5+
 *              pages should be promoted to /css/components.css or
 *              /css/portal-chrome.css with a /css/AGENTS.md update.
 *
 * Extracted:   2 <style> block(s), 118 lines.
 * Method:      verbatim move — no token substitution applied yet.
 *              See C56 audit Section 10.A for the deferred token
 *              normalization sprint plan.
 */

/* ── extracted <style> block 1 of 2 ── */

  body { font-family: var(--font-sans); background: var(--bg); color: var(--dark); line-height: var(--leading-loose); min-height: 100vh; display: flex; flex-direction: column; padding-bottom: var(--space-20); }

  /* NAV — byte-identical to dashboard / my-leads / clients / contracts */
  .dash-nav { background: var(--white); border-bottom: 1px solid var(--border); padding: calc(14px + env(safe-area-inset-top)) 20px 14px; display: flex; justify-content: space-between; align-items: center; position: sticky; top: 0; z-index: var(--z-nav); }
  .dash-nav-brand { text-decoration: none; display: flex; align-items: center; }
  .dash-nav-brand img { display: block; height: 48px; }
  .dash-nav-right { display: flex; align-items: center; gap: var(--space-4); }

  /* STICKY HEAD — title + filter bar stick together */
  .sticky-head { position: sticky; top: calc(77px + env(safe-area-inset-top)); z-index: 90; background: var(--white); }

  .title-row { background: var(--white); border-bottom: 1px solid var(--border); padding: var(--space-2-5) var(--space-5); display: flex; align-items: center; }
  .title-text { font-family: var(--font-serif); font-size: var(--text-3xl); color: var(--dark); font-weight: var(--weight-regular); line-height: var(--leading-tight); margin: 0; }

  /* FILTER BAR — same underline style as contracts.html filter tabs. */
  .filter-tabs { background: var(--white); border-bottom: 1px solid var(--border); padding: 0 var(--space-5); display: flex; gap: var(--space-5-5); overflow-x: auto; overflow-y: hidden; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
  .filter-tabs::-webkit-scrollbar { display: none; }
  .filter-tab { flex-shrink: 0; padding: var(--space-2-5) 0; background: none; border: none; border-bottom: 2px solid transparent; font-family: var(--font-sans); font-size: var(--text-md); font-weight: var(--weight-medium); color: var(--light); cursor: pointer; white-space: nowrap; display: inline-flex; align-items: center; gap: var(--space-1-5); transition: color 0.15s, border-color 0.15s; }
  .filter-tab:hover { color: var(--dark); }
  .filter-tab.active { color: var(--red); border-bottom-color: var(--red); font-weight: var(--weight-semibold); }
  .filter-tab-count { font-size: var(--text-sm); font-weight: var(--weight-medium); color: inherit; opacity: 0.75; }
  .filter-tab.active .filter-tab-count { opacity: 1; }

  /* SEARCH BAR */
  .search-row { padding: var(--space-3) var(--space-4) var(--space-1-5); max-width: 640px; margin: 0 auto; width: 100%; }
  .search-wrap { position: relative; }
  .search-icon { position: absolute; left: var(--space-3); top: 50%; transform: translateY(-50%); width: 16px; height: 16px; stroke: var(--light); stroke-width: 2; fill: none; stroke-linecap: round; stroke-linejoin: round; pointer-events: none; }
  .search-input { width: 100%; padding: 10px 12px 10px 36px; border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--white); font-family: var(--font-sans); font-size: var(--text-base); color: var(--dark); box-sizing: border-box; transition: border-color 0.15s; }
  .search-input:focus { outline: none; border-color: var(--red); }
  .search-input::placeholder { color: var(--light); }

  .page-header { padding: var(--space-2) var(--space-5) 0; max-width: 640px; margin: 0 auto; width: 100%; }
  .page-count { font-size: var(--text-md); color: var(--light); font-weight: var(--weight-regular); }

  .feed { padding: var(--space-2-5) var(--space-4) var(--space-6); display: flex; flex-direction: column; gap: var(--space-3); flex: 1; max-width: 640px; margin: 0 auto; width: 100%; }

  /* INVOICE CARD — same left-border status palette as the per-client
     list on client-detail.html. Tapping routes to
     client-detail.html#billing for that client. */
  .invoice-card { background: var(--white); border: 1px solid var(--border); border-left: 4px solid var(--status-inactive); border-radius: var(--radius-lg); padding: var(--space-3-5) var(--space-3-5) var(--space-3-5) var(--space-4); box-shadow: 0 2px 6px rgba(0,0,0,0.04); cursor: pointer; transition: box-shadow 0.15s, transform 0.1s; text-decoration: none; color: inherit; display: block; }
  .invoice-card:hover { box-shadow: 0 4px 12px rgba(0,0,0,0.08); }
  .invoice-card:active { transform: scale(0.995); }
  .invoice-card.status-draft         { border-left-color: var(--status-inactive); }
  .invoice-card.status-sent          { border-left-color: var(--status-pending); }
  .invoice-card.status-viewed        { border-left-color: #8B5CF6; }
  .invoice-card.status-paid          { border-left-color: var(--status-active); }
  .invoice-card.status-overdue       { border-left-color: var(--danger); }
  .invoice-card.status-void          { border-left-color: var(--status-inactive); }
  .invoice-card.status-refunded      { border-left-color: #F97316; }
  .invoice-card.status-uncollectible { border-left-color: var(--status-inactive); }

  .invoice-top { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--space-2-5); margin-bottom: var(--space-1); }
  .invoice-primary { flex: 1; min-width: 0; }
  .invoice-client { font-size: var(--text-input); font-weight: var(--weight-bold); color: var(--dark); line-height: 1.25; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .invoice-num { font-size: var(--text-md); color: var(--mid); margin-top: var(--space-0-5); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

  .invoice-right { display: flex; flex-direction: column; align-items: flex-end; gap: var(--space-1-5); flex-shrink: 0; }
  .invoice-amount { font-size: var(--text-lg); font-weight: var(--weight-bold); color: var(--dark); white-space: nowrap; }

  .invoice-status-pill { font-size: var(--text-xxs); font-weight: var(--weight-semibold); padding: 3px 8px; border-radius: 6px; text-transform: uppercase; letter-spacing: var(--tracking-wide); flex-shrink: 0; background-color: #1f2937; color: var(--text-dim); white-space: nowrap; }
  .invoice-status-pill.draft         { background-image: linear-gradient(rgba(115, 115, 115, 0.2), rgba(115, 115, 115, 0.2)); color: var(--text-dim); }
  .invoice-status-pill.sent          { background-image: linear-gradient(rgba(59, 130, 246, 0.2), rgba(59, 130, 246, 0.2)); color: var(--status-pending); }
  .invoice-status-pill.viewed        { background-image: linear-gradient(rgba(139, 92, 246, 0.2), rgba(139, 92, 246, 0.2)); color: #c4b5fd; }
  .invoice-status-pill.paid          { background-image: linear-gradient(rgba(16, 185, 129, 0.2), rgba(16, 185, 129, 0.2)); color: var(--status-active-disabled); }
  .invoice-status-pill.overdue       { background-image: linear-gradient(rgba(239, 68, 68, 0.2), rgba(239, 68, 68, 0.2)); color: var(--danger); }
  .invoice-status-pill.void          { background-image: linear-gradient(rgba(115, 115, 115, 0.2), rgba(115, 115, 115, 0.2)); color: var(--text-dim); }
  .invoice-status-pill.refunded      { background-image: linear-gradient(rgba(249, 115, 22, 0.2), rgba(249, 115, 22, 0.2)); color: #fdba74; }
  .invoice-status-pill.uncollectible { background-image: linear-gradient(rgba(115, 115, 115, 0.2), rgba(115, 115, 115, 0.2)); color: var(--text-dim); }

  .invoice-meta { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-1-5) var(--space-3-5); font-size: var(--text-sm); color: var(--light); margin-top: var(--space-2-5); }
  .invoice-meta-item { display: inline-flex; align-items: center; gap: 5px; }
  .invoice-meta-item svg { width: 13px; height: 13px; stroke: currentColor; stroke-width: 2; fill: none; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
  .invoice-meta-item.danger { color: var(--danger); font-weight: var(--weight-semibold); }

  /* EMPTY STATE */
  .feed-empty { flex: 1; display: none; flex-direction: column; align-items: center; justify-content: center; padding: 60px 20px; text-align: center; }
  .feed-empty-icon { width: 48px; height: 48px; color: var(--border-strong); margin-bottom: var(--space-4); }
  .feed-empty-icon svg { width: 48px; height: 48px; stroke: currentColor; stroke-width: 1.4; fill: none; stroke-linecap: round; stroke-linejoin: round; }
  .feed-empty h2 { font-family: var(--font-serif); font-size: var(--text-3xl); color: var(--dark); margin-bottom: var(--space-2); font-weight: var(--weight-regular); }
  .feed-empty p { font-size: var(--text-base); color: var(--light); max-width: 320px; font-weight: var(--weight-light); }

  .feed-loading { flex: 1; display: flex; align-items: center; justify-content: center; padding: 60px 20px; }
  .spinner { width: 32px; height: 32px; border: 3px solid var(--border); border-top-color: var(--red); border-radius: 50%; animation: spin 0.6s linear infinite; }
  @keyframes spin { to { transform: rotate(360deg); } }

  /* BOTTOM NAV — matches clients.html / contracts.html nav chrome */
  .bottom-nav { position: fixed; bottom: 0; left: 0; right: 0; height: calc(56px + env(safe-area-inset-bottom) / 2); padding-bottom: calc(env(safe-area-inset-bottom) / 2); background: var(--white); border-top: 1px solid var(--border); display: flex; z-index: var(--z-nav); }
  .bottom-nav-item { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: var(--space-0-5); text-decoration: none; color: var(--light); min-height: 44px; transition: color 0.15s; }
  .bottom-nav-item:hover { color: var(--mid); }
  .bottom-nav-item.active { color: var(--red); }
  .bottom-nav-item svg { width: 22px; height: 22px; stroke: currentColor; stroke-width: 1.8; fill: none; }
  .bottom-nav-label { font-size: var(--text-xs); font-weight: var(--weight-semibold); font-family: var(--font-sans); }

  [data-theme="dark"] .invoice-card { background: var(--surface); border-top-color: var(--border); border-right-color: var(--border); border-bottom-color: var(--border); color: var(--text); }
  [data-theme="dark"] .invoice-client,
  [data-theme="dark"] .invoice-amount { color: var(--text); }
  [data-theme="dark"] .invoice-num,
  [data-theme="dark"] .invoice-meta { color: var(--text-muted); }
  [data-theme="dark"] .feed-empty h2 { color: var(--text); }
  [data-theme="dark"] .feed-empty p { color: var(--text-muted); }

  /* Dark-mode chrome — sticky head + filter bar + search input. Mirrors
     the same overrides present on contracts.html so the two master-list
     surfaces feel identical in both themes. */
  [data-theme="dark"] .dash-nav,
  [data-theme="dark"] .sticky-head,
  [data-theme="dark"] .title-row,
  [data-theme="dark"] .filter-tabs { background: var(--surface); border-bottom-color: var(--border); }
  [data-theme="dark"] .title-text { color: var(--text); }
  [data-theme="dark"] .filter-tab { color: var(--text-muted); }
  [data-theme="dark"] .filter-tab:hover { color: var(--text); }
  [data-theme="dark"] .filter-tab.active { color: var(--red); border-bottom-color: var(--red); }
  [data-theme="dark"] .search-input { background: var(--surface-elevated); border-color: var(--border); color: var(--text); }
  [data-theme="dark"] .search-input::placeholder { color: var(--text-dim); }
  [data-theme="dark"] .search-icon { stroke: var(--text-muted); }
  [data-theme="dark"] .page-count { color: var(--text-muted); }
  [data-theme="dark"] .bottom-nav { background: var(--surface); border-top-color: var(--border); }

/* ── extracted <style> block 2 of 2 ── */

.nav-brand img, .dash-nav-brand img { height: 48px !important; width: auto !important; min-height: 48px !important; max-height: none !important; }
