/* ============================================================
   INVOICES — two-column layout: table + slide panel (wider)
   ============================================================ */

.invoices-search {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}
.invoices-search .form-control { max-width: 200px; font-size: 13px; }

.invoices-layout {
  display: flex;
  gap: 0;
  height: calc(100vh - var(--header-h) - 97px);
  overflow: hidden;
  border-radius: var(--radius-lg);
}

.invoices-table-wrap {
  flex: 1;
  min-width: 0;
  overflow-y: auto;
  border-radius: var(--radius-lg) 0 0 var(--radius-lg);
  border: 1px solid var(--border);
  background: var(--card);
}

/* Wider panel — line items need room */
.invoices-layout .slide-panel.open {
  width: 480px;
  min-width: 480px;
}
.invoices-layout .slide-panel-inner { width: 480px; }

/* ---- Invoice amount display ----------------------------- */
.invoice-total-block {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 14px 0 6px;
}
.invoice-total-value {
  font-size: 24px;
  font-weight: 700;
  color: var(--text-1);
}
.invoice-total-currency {
  font-size: 13px;
  color: var(--text-2);
}

/* ---- Line items table in panel ------------------------- */
.line-items-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  margin-bottom: 12px;
}
.line-items-table th {
  text-align: left;
  padding: 6px 4px;
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .6px;
  color: var(--text-2);
  border-bottom: 1px solid var(--border);
}
.line-items-table td {
  padding: 8px 4px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
  color: var(--text-1);
}
.line-items-table tr:last-child td { border-bottom: none; }
.li-col-desc  { width: 44%; }
.li-col-qty   { width: 12%; text-align: right; }
.li-col-price { width: 18%; text-align: right; }
.li-col-total { width: 18%; text-align: right; font-weight: 600; }
.li-col-act   { width: 8%;  text-align: right; }

/* Totals block */
.invoice-totals-block {
  border-top: 2px solid var(--border);
  padding-top: 10px;
  margin-top: 6px;
}
.totals-row {
  display: flex;
  justify-content: space-between;
  padding: 4px 0;
  font-size: 13px;
}
.totals-row.grand {
  font-weight: 700;
  font-size: 15px;
  color: var(--primary);
  border-top: 1px solid var(--border);
  margin-top: 4px;
  padding-top: 8px;
}
.totals-label { color: var(--text-2); }
.totals-val   { color: var(--text-1); }

/* Inline add-line-item form */
.add-line-item-form {
  margin-top: 14px;
  padding: 12px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.add-line-item-form .form-label {
  font-size: 11.5px;
}
.line-item-row-inputs {
  display: grid;
  grid-template-columns: 1fr 80px 110px;
  gap: 8px;
  margin-bottom: 8px;
}

/* ---- Payments tab in panel ----------------------------- */
.payment-record {
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}
.payment-record:last-child { border-bottom: none; }
.payment-record-top {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 3px;
}
.payment-record-amount {
  font-weight: 700;
  font-size: 14px;
  color: var(--text-1);
  flex: 1;
}
.payment-record-meta {
  font-size: 12px;
  color: var(--text-2);
  line-height: 1.5;
}
.balance-row {
  display: flex;
  justify-content: space-between;
  padding: 10px 12px;
  background: var(--bg);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  margin-top: 12px;
  font-size: 13.5px;
}
.balance-label { color: var(--text-2); }
.balance-val   { font-weight: 700; }
.balance-val.due  { color: var(--danger); }
.balance-val.paid { color: var(--success); }

/* ---- Status action strip -------------------------------- */
.invoice-actions-strip {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  padding: 10px 0;
}

/* Overdue highlight */
.due-overdue { color: var(--danger); font-weight: 600; }

/* ---- Send modal ---------------------------------------- */
.send-warning {
  font-size: 12.5px;
  color: #92400E;
  background: #FEF3C7;
  border: 1px solid #FDE68A;
  border-radius: var(--radius);
  padding: 10px 12px;
  margin-top: 12px;
  line-height: 1.5;
}
.send-schedule-note {
  font-size: 12.5px;
  color: var(--text-2);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 12px;
  margin-top: 12px;
  line-height: 1.5;
}

/* ---- Billable work pickers (audit G07) --------------------
   The rows in the Bill Hours and Rebill Expenses dialogs. */
.billable-row { transition: background .12s ease; }
.billable-row:hover { background: var(--bg); }
.billable-row:last-child { border-bottom: none; }
.billable-pick { accent-color: var(--primary); cursor: pointer; }
