/* Documents suite — layout for the Invoice Generator.
   Builds on shared.css; overrides the suite accent to teal. */
:root {
  --accent:       #0d9488;
  --accent-h:     #0f766e;
  --accent-bg:    #f0fdfa;
  --accent-fg:    #115e59;
  --accent-light: #14b8a6;
  --icon-bg:      #99f6e4;
}

/* ---- two-pane workspace ---- */
.inv-wrap {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
  gap: 22px;
  align-items: start;
}
@media (max-width: 900px) {
  .inv-wrap { grid-template-columns: minmax(0, 1fr); }
}

.inv-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 18px;
}
.btn {
  font-family: inherit;
  font-size: .95rem;
  font-weight: 600;
  border-radius: var(--radius);
  padding: 11px 18px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: background .15s, border-color .15s, transform .05s;
}
.btn:hover { border-color: var(--accent); color: var(--accent-h); }
.btn:active { transform: translateY(1px); }
.btn svg { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 2; }
.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.btn-primary:hover { background: var(--accent-h); border-color: var(--accent-h); color: #fff; }
.btn-ghost { background: transparent; }

/* ---- form ---- */
.inv-form .fieldset { border: 0; margin: 0 0 20px; padding: 0; min-width: 0; }
.inv-form legend {
  font-family: var(--mono);
  font-size: .72rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--accent-fg);
  font-weight: 600;
  margin-bottom: 10px;
  display: block;
}
.inv-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
@media (max-width: 460px) { .inv-grid-2 { grid-template-columns: 1fr; } }
.field { margin-bottom: 12px; }
.field-label {
  display: block;
  font-size: .82rem;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 5px;
}
.calc-input, .inv-input, textarea.inv-input, select.inv-input {
  width: 100%;
  font-family: inherit;
  font-size: .95rem;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 12px;
  box-sizing: border-box;
}
textarea.inv-input { resize: vertical; min-height: 62px; line-height: 1.45; }
.inv-input:focus, .calc-input:focus, select.inv-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-bg);
}

/* logo */
.logo-row { display: flex; align-items: center; gap: 12px; }
.logo-thumb {
  width: 56px; height: 56px; border-radius: var(--radius);
  border: 1px dashed var(--border); object-fit: contain; background: var(--surface2);
  display: none;
}
.logo-thumb.show { display: block; }
.file-btn {
  font-size: .85rem; font-weight: 600; color: var(--accent-h);
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: 8px 12px; cursor: pointer; background: var(--surface);
}
.file-btn:hover { border-color: var(--accent); }
.link-btn {
  background: none; border: none; color: var(--muted); cursor: pointer;
  font: inherit; font-size: .8rem; text-decoration: underline; padding: 0;
}

/* line items */
.items-table { width: 100%; border-collapse: collapse; }
.items-table th {
  text-align: left; font-size: .72rem; letter-spacing: .06em; text-transform: uppercase;
  color: var(--muted); font-weight: 600; padding: 4px 6px;
}
.items-table td { padding: 4px 6px; vertical-align: middle; }
.items-table .col-amt { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.items-table .col-x { width: 30px; text-align: center; }
.items-table input { padding: 8px 9px; }
.qty-input, .price-input { text-align: right; }
.row-x {
  background: none; border: none; color: var(--muted); cursor: pointer;
  font-size: 1.2rem; line-height: 1; padding: 2px 6px; border-radius: 6px;
}
.row-x:hover { background: #fee2e2; color: #dc2626; }
.add-item {
  margin-top: 8px; font-size: .88rem; font-weight: 600; color: var(--accent-h);
  background: none; border: 1px dashed var(--border); border-radius: var(--radius);
  padding: 8px 12px; cursor: pointer;
}
.add-item:hover { border-color: var(--accent); background: var(--accent-bg); }

.totals-config { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.inline-2 { display: flex; gap: 8px; }
.inline-2 select { flex: 0 0 96px; }

/* ---- preview (the printable invoice) ---- */
.inv-preview {
  background: #fff;
  color: #111827;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 34px 34px 30px;
  font-size: .9rem;
  position: sticky;
  top: 14px;
}
.pv-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 26px; }
.pv-title { font-family: var(--mono); font-size: 1.7rem; font-weight: 700; letter-spacing: .16em; color: var(--accent-h); text-transform: uppercase; margin: 0; }
.pv-logo { max-width: 130px; max-height: 66px; object-fit: contain; }
.pv-logo:not([src]), .pv-logo[src=""] { display: none; }
.pv-meta { text-align: right; font-size: .82rem; color: #374151; line-height: 1.6; }
.pv-meta b { color: #111827; }
.pv-parties { display: flex; justify-content: space-between; gap: 24px; margin-bottom: 22px; }
.pv-party h4 { font-size: .68rem; letter-spacing: .1em; text-transform: uppercase; color: #6b7280; margin: 0 0 4px; }
.pv-party .pv-name { font-weight: 700; font-size: 1rem; color: #111827; }
.pv-party .pv-lines { white-space: pre-line; color: #374151; font-size: .84rem; line-height: 1.5; margin-top: 2px; }
.pv-table { width: 100%; border-collapse: collapse; margin-bottom: 16px; }
.pv-table th {
  background: var(--accent); color: #fff; font-size: .74rem; letter-spacing: .04em;
  text-transform: uppercase; padding: 9px 10px; text-align: left; font-weight: 600;
}
.pv-table th.r, .pv-table td.r { text-align: right; }
.pv-table td { padding: 9px 10px; border-bottom: 1px solid #eef0f4; color: #374151; font-variant-numeric: tabular-nums; }
.pv-table td.desc { color: #111827; }
.pv-totals { width: 58%; margin-left: auto; font-size: .88rem; }
.pv-totals .row { display: flex; justify-content: space-between; padding: 6px 2px; color: #374151; }
.pv-totals .row.grand { border-top: 2px solid var(--accent); margin-top: 4px; padding-top: 10px; font-size: 1.15rem; font-weight: 700; color: #111827; }
.pv-totals .row .amt { font-variant-numeric: tabular-nums; }
.pv-notes { margin-top: 24px; border-top: 1px solid #eef0f4; padding-top: 14px; }
.pv-notes h4 { font-size: .68rem; letter-spacing: .1em; text-transform: uppercase; color: #6b7280; margin: 0 0 4px; }
.pv-notes .pv-lines { white-space: pre-line; color: #4b5563; font-size: .82rem; line-height: 1.5; }
.pv-empty { color: #9ca3af; }

/* ---- print: show only the invoice ---- */
@media print {
  body > *:not(.print-root) { display: none !important; }
  .print-root .inv-form, .print-root .inv-toolbar, .print-root .tool-hero,
  .print-root .section, .print-root .related-note { display: none !important; }
  .print-root, .print-root main, .print-root .card, .print-root .inv-wrap { display: block !important; margin: 0; padding: 0; box-shadow: none; border: none; background: #fff; }
  .inv-preview { position: static; box-shadow: none; border: none; padding: 0; }
}

.summary { margin-top: 16px; font-size: 0.95rem; line-height: 1.5; }
.summary .summary-skip { color: #b45309; }
.summary ul { margin: 6px 0 0; padding-left: 20px; }

/* ---- bulk invoice generator: roomy numbered steps ---- */
.bulk-card { padding: clamp(20px, 4vw, 40px); }
.bulk-logo {
  display: flex; justify-content: space-between; align-items: center;
  gap: 16px 24px; flex-wrap: wrap;
  padding-bottom: 24px; margin-bottom: 28px;
  border-bottom: 1px solid var(--border);
}
.bulk-logo-label { font-weight: 700; color: var(--text); margin-right: 8px; }

.bulk-steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 32px; }
.bulk-step { display: flex; gap: 20px; align-items: flex-start; }
.bulk-step-num {
  flex: 0 0 auto; width: 36px; height: 36px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--accent); color: #fff;
  font-family: var(--mono); font-weight: 700; font-size: 1.05rem;
}
.bulk-step-body { flex: 1 1 auto; min-width: 0; }
.bulk-step-title { font-size: 1.2rem; font-weight: 700; color: var(--text); margin: 5px 0 8px; }
.bulk-step-desc { color: var(--muted); line-height: 1.6; margin: 0 0 18px; max-width: 62ch; }
.bulk-step-hint { color: var(--muted); font-size: .85rem; margin: 12px 0 0; }

/* styled blue file picker */
.file-picker { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.file-picker-btn {
  display: inline-flex; align-items: center; gap: 9px;
  font-weight: 600; font-size: .95rem; color: #fff;
  background: #2563eb; border: 1px solid #2563eb; border-radius: var(--radius);
  padding: 11px 20px; cursor: pointer;
  box-shadow: 0 1px 2px rgba(37, 99, 235, .28);
  transition: background .15s ease, box-shadow .15s ease, transform .05s ease;
}
.file-picker-btn:hover { background: #1d4ed8; border-color: #1d4ed8; box-shadow: 0 4px 12px rgba(37, 99, 235, .32); }
.file-picker-btn:active { transform: translateY(1px); }
.file-picker-btn:focus-visible { outline: 2px solid #1d4ed8; outline-offset: 2px; }
.file-picker-btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.file-picker-name { color: var(--muted); font-size: .92rem; }
.file-picker-name.has-file { color: var(--text); font-weight: 600; }

/* step 3 summary sits tight under its button */
.bulk-step-body .summary { margin-top: 14px; }

@media (max-width: 560px) {
  .bulk-step { gap: 15px; }
  .bulk-step-num { width: 31px; height: 31px; font-size: .95rem; }
  .bulk-step-title { font-size: 1.1rem; }
}
