/* InvoiceFlow-specific pieces. The shared shell, tokens and components live in
   arvion.css; this file only adds the printable invoice and the editor grid. */

/* ---------- invoice tables inside flush cards ----------------------------- */
.card > #recent-invoices .table-wrap,
.card > #invoice-table .table-wrap {
  border: 0;
  border-radius: 0;
  border-top: 1px solid var(--line);
}

.invoice-cell { display: flex; flex-direction: column; gap: 2px; }
.invoice-cell .num { color: var(--text); font-weight: 600; font-family: var(--font-mono); font-size: 12.5px; }
.invoice-cell .client { color: var(--muted); font-size: 12.5px; }
.due-cell { display: flex; flex-direction: column; gap: 2px; }
.due-cell .late { color: var(--red); font-size: 11.5px; font-weight: 600; }
.due-cell .soon { color: var(--gold); font-size: 11.5px; font-weight: 600; }
.due-cell .plain { color: var(--muted); font-size: 11.5px; }
.actions { display: flex; gap: 6px; justify-content: flex-end; }

/* ---------- dashboard side panels ---------------------------------------- */
[data-view-panel="dashboard"] .page-head { margin-bottom: 14px; }
.main { padding-top: 20px; }
#kpis .card { padding: 15px 18px; }
#kpis .stat-value { font-size: 27px; }
.card > #recent-invoices .table td { padding: 8px 14px; }
.ageing-row { display: flex; align-items: center; gap: 7px; min-width: 0; }
.ageing-row .label { color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 11.5px; }
.ageing-row .amount { color: var(--text-2); font-variant-numeric: tabular-nums; font-size: 11.5px; white-space: nowrap; }
.card > #recent-invoices .table td { padding: 9px 14px; }
.card > #recent-invoices .table th { padding: 10px 14px; }
.attention-item {
  display: flex; flex-direction: column; gap: 4px;
  padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px;
  background: rgba(248, 113, 113, 0.05); cursor: pointer;
}
.attention-item:hover { border-color: rgba(248, 113, 113, 0.35); }
.attention-item .top { display: flex; align-items: center; gap: 8px; }
.attention-item .top .client { font-weight: 600; font-size: 13px; }
.attention-item .top .num { color: var(--muted); font-family: var(--font-mono); font-size: 11px; }
.attention-item .bottom { display: flex; align-items: baseline; gap: 8px; }
.attention-item .amount { color: var(--gold); font-weight: 600; font-variant-numeric: tabular-nums; }
.attention-item .late { color: var(--red); font-size: 11.5px; }

.recurring-line {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 13px;
}
.recurring-line:last-child { border-bottom: 0; }
.recurring-line .date { font-family: var(--font-mono); font-size: 12px; color: var(--text); }
.recurring-line .client { color: var(--muted); font-size: 12px; }

/* ---------- editor ------------------------------------------------------- */
.line-row {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) 76px 124px 104px 112px 32px;
  gap: 8px; align-items: center;
  padding: 10px 20px; border-top: 1px solid var(--line);
}
.line-row.line-head {
  padding: 8px 20px; border-top: 0; background: rgba(255, 255, 255, 0.02);
  font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); font-weight: 600;
}
.line-row .input, .line-row .select { padding: 7px 9px; font-size: 13px; }
.line-row .amount { text-align: right; font-variant-numeric: tabular-nums; font-size: 13px; color: var(--text-2); }
.line-row .btn { justify-self: end; }
.editor-total {
  display: flex; align-items: baseline; justify-content: space-between;
  padding: 8px 0; border-bottom: 1px dashed var(--line); font-size: 13.5px;
}
.editor-total:last-of-type { border-bottom: 0; }
.editor-total .label { color: var(--muted); }
.editor-total .value { font-variant-numeric: tabular-nums; color: var(--text-2); }
.editor-total.grand { border-top: 1px solid var(--line-strong); padding-top: 14px; margin-top: 6px; }
.editor-total.grand .label { color: var(--text); font-weight: 600; }
.editor-total.grand .value { font-family: var(--font-display); font-size: 26px; color: var(--gold); font-weight: 600; }
.words { font-size: 11.5px; color: var(--muted); line-height: 1.5; }

/* ---------- printable invoice ------------------------------------------- */
.print-toolbar { margin-bottom: 16px; }
.paper {
  width: 860px; max-width: 100%; margin: 0 auto;
  background: #f8f5ee; color: #1a2233;
  border-radius: 10px; padding: 44px 50px 34px;
  box-shadow: 0 30px 80px -30px rgba(0, 0, 0, 0.9);
  font-size: 13px; line-height: 1.5;
}
.paper .paper-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 24px; }
.paper .paper-brand { display: flex; gap: 12px; align-items: flex-start; }
.paper .paper-logo {
  width: 38px; height: 38px; border-radius: 10px; flex: none;
  background: #10182b; color: #f5c26b; display: grid; place-items: center;
  font-family: var(--font-display); font-weight: 700; font-size: 18px;
}
.paper .paper-biz { font-family: var(--font-display); font-weight: 600; font-size: 17px; color: #10182b; }
.paper .paper-meta { color: #6a7487; font-size: 11.5px; margin-top: 3px; max-width: 270px; }
.paper .paper-title { text-align: right; }
.paper .paper-label {
  font-size: 9.5px; letter-spacing: 0.14em; text-transform: uppercase;
  color: #8a92a3; font-weight: 700;
}
.paper .paper-title .big {
  font-family: var(--font-display); font-size: 26px; font-weight: 700;
  letter-spacing: 0.06em; color: #10182b; line-height: 1.1;
}
.paper .paper-number { font-family: var(--font-mono); font-size: 12px; color: #45506a; margin-top: 3px; }
.paper .chip {
  display: inline-block; margin-top: 8px; padding: 3px 10px; border-radius: 999px;
  font-size: 10px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase;
}
.paper .chip.paid { background: #d9f5ea; color: #0c6b4d; }
.paper .chip.overdue { background: #fde2e2; color: #a01b1b; }
.paper .chip.partial { background: #fbeccd; color: #8a5a06; }
.paper .chip.sent { background: #e3ecff; color: #1f4fb8; }
.paper .chip.draft { background: #e9ecf2; color: #4b5568; }
.paper .chip.void { background: #e9e2f7; color: #5b3fa0; }

.paper .paper-parties {
  display: grid; grid-template-columns: 1.6fr 1fr; gap: 30px;
  margin-top: 30px; padding-top: 22px; border-top: 1px solid #ddd8ca;
}
.paper .party-name { font-family: var(--font-display); font-weight: 600; font-size: 15px; color: #10182b; margin-top: 5px; }
.paper .party-line { color: #5b6577; font-size: 12px; line-height: 1.6; }
.paper .paper-facts { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 18px; align-content: start; }
.paper .paper-facts div { display: flex; flex-direction: column; gap: 2px; }
.paper .paper-facts .k { font-size: 9.5px; letter-spacing: 0.1em; text-transform: uppercase; color: #8a92a3; font-weight: 700; }
.paper .paper-facts .v { font-size: 12.5px; color: #1a2233; font-weight: 600; }

.paper table.paper-table { width: 100%; border-collapse: collapse; margin-top: 26px; }
.paper .paper-table th {
  text-align: left; font-size: 9.5px; letter-spacing: 0.1em; text-transform: uppercase;
  color: #8a92a3; font-weight: 700; padding: 0 8px 8px 0; border-bottom: 1px solid #b9b3a3;
}
.paper .paper-table td { padding: 10px 8px 10px 0; border-bottom: 1px solid #e4dfd2; color: #38414f; vertical-align: top; }
.paper .paper-table td.desc { color: #1a2233; font-weight: 500; }
.paper .paper-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.paper .paper-table th.num { text-align: right; }
.paper .paper-table .qty { text-align: right; color: #5b6577; }

.paper .paper-bottom { display: grid; grid-template-columns: 1fr 300px; gap: 40px; margin-top: 22px; }
.paper .paper-note { color: #5b6577; font-size: 11.5px; line-height: 1.65; }
.paper .paper-note .block { margin-top: 12px; }
.paper .paper-note b { color: #1a2233; font-weight: 600; }
.paper .paper-totals { font-size: 12.5px; }
.paper .paper-totals .line { display: flex; justify-content: space-between; padding: 4px 0; color: #45506a; }
.paper .paper-totals .line .v { font-variant-numeric: tabular-nums; }
.paper .paper-totals .line.discount { color: #0c6b4d; }
.paper .paper-totals .line.grand {
  border-top: 1px solid #b9b3a3; margin-top: 8px; padding-top: 10px;
  font-family: var(--font-display); font-weight: 700; font-size: 17px; color: #10182b;
}
.paper .paper-totals .line.balance { color: #a01b1b; font-weight: 700; }
.paper .paper-words {
  margin-top: 24px; padding: 12px 14px; border-radius: 8px;
  background: #efeadc; color: #45506a; font-size: 11.5px;
}
.paper .paper-words b { color: #1a2233; }
.paper .paper-foot {
  display: flex; justify-content: space-between; gap: 20px;
  margin-top: 26px; padding-top: 12px; border-top: 1px solid #ddd8ca;
  color: #8a92a3; font-size: 10.5px;
}

/* ---------- recurring + reminders --------------------------------------- */
.rule-meta { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 14px; }
.rule-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.rule-table th {
  text-align: left; font-size: 9.5px; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--muted); font-weight: 600; padding: 6px 0; border-bottom: 1px solid var(--line);
}
.rule-table td { padding: 8px 0; border-bottom: 1px solid var(--line); color: var(--text-2); }
.rule-table tr:last-child td { border-bottom: 0; }
.rule-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.reminder {
  border: 1px solid var(--line); border-radius: 10px; padding: 12px;
  background: rgba(255, 255, 255, 0.02);
}
.reminder .reminder-text { font-size: 12.5px; color: var(--text-2); line-height: 1.55; }
.reminder .reminder-actions { display: flex; align-items: center; gap: 8px; margin-top: 10px; }

/* ---------- print stylesheet -------------------------------------------- */
@media print {
  @page { size: A4; margin: 14mm; }
  body { background: #fff; color: #000; }
  .aurora, .grid-lines, .sidebar, .topbar, .demo-banner, .toasts, .print-toolbar { display: none !important; }
  .shell { display: block; }
  .main { padding: 0; }
  [data-view-panel] { display: none !important; }
  [data-view-panel="print"] { display: block !important; }
  .paper {
    width: auto; max-width: none; margin: 0; padding: 0;
    box-shadow: none; border-radius: 0; background: #fff;
  }
  .paper .paper-table td, .paper .paper-table th { border-color: #bbb; }
}
