/* Controls bar styling */
.controls {
  background: #f8f9fa;
  border-radius: 0.375rem;
}

.controls label {
  font-size: 0.85rem;
  font-weight: 500;
}

#colorPicker {
  width: 50px;
  height: 35px;
  cursor: pointer;
  border: none;
  padding: 0;
  background: none;
}

/* Accent color applied globally */
:root {
  --accent-color: #2563eb;
}

#invoiceTitle,
#CompanyName,
#language_invoiceTitle {
  color: var(--accent-color);
}

#BgcolorLine {
  background-color: var(--accent-color);
}

/* Theme presets */
.theme-classic {
  --accent-color: #2563eb;
  --bg-color: #f9fafb;
  --header-bg: linear-gradient(90deg, #2563eb 0%, #1d4ed8 100%);
  --text-color: #111827;
}

.theme-ocean {
  --accent-color: #0ea5e9;
  --bg-color: #f0f9ff;
  --header-bg: linear-gradient(90deg, #0ea5e9 0%, #0369a1 100%);
  --text-color: #0f172a;
}

.theme-amber {
  --accent-color: #f59e0b;
  --bg-color: #fffdf5;
  --header-bg: linear-gradient(90deg, #f59e0b 0%, #d97706 100%);
  --text-color: #3f3f46;
}

.theme-charcoal {
  --accent-color: #374151;
  --bg-color: #f3f4f6;
  --header-bg: #374151;
  --text-color: #111827;
}

.theme-emerald {
  --accent-color: #10b981;
  --bg-color: #f0fdf4;
  --header-bg: linear-gradient(90deg, #10b981 0%, #059669 100%);
  --text-color: #064e3b;
}

.theme-rose {
  --accent-color: #e11d48;
  --bg-color: #fff1f2;
  --header-bg: linear-gradient(90deg, #e11d48 0%, #be123c 100%);
  --text-color: #881337;
}

.theme-slate {
  --accent-color: #475569;
  --bg-color: #f8fafc;
  --header-bg: #475569;
  --text-color: #1e293b;
}

.theme-violet {
  --accent-color: #8b5cf6;
  --bg-color: #f5f3ff;
  --header-bg: linear-gradient(90deg, #8b5cf6 0%, #6d28d9 100%);
  --text-color: #312e81;
}

.theme-copper {
  --accent-color: #b45309;
  --bg-color: #fffbf5;
  --header-bg: linear-gradient(90deg, #b45309 0%, #92400e 100%);
  --text-color: #451a03;
}

.theme-forest {
  --accent-color: #065f46;
  --bg-color: #ecfdf5;
  --header-bg: linear-gradient(90deg, #065f46 0%, #064e3b 100%);
  --text-color: #022c22;
}

html,
body {
  margin: 0 !important;
  padding: 0 !important;
}

#invoice-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px; /* space between pages */
  padding: 0;
}

/* A4 page */
.page {
  background: white;
  width: 210mm;
  height: 297mm;
  box-shadow: 0 0 10px rgba(69, 69, 69, 0.25);
  position: relative;
  overflow: hidden; /* show content clipped like real paper */
  padding: 0;
  box-sizing: border-box;
}

/* Full-page gray background */
/* Print mode: remove shadow and spacing */
@media print {
  body {
    background: white;
  }
  #invoice-wrapper {
    gap: 0;
    padding: 0;
  }
  .page {
    margin: 0;
    box-shadow: none;
    page-break-after: always; /* force A4 pages */
  }
  .page:last-child {
    page-break-after: auto;
  }
  .tooltip-guide {
    display: none !important;
  }
}

#invoice-canvas {
  background: #fff;
  width: 210mm;
  min-height: auto;
  box-sizing: border-box;
  position: relative;
  margin: 0;
  padding: 40px;
}

/* Add shadow to look like paper */
#invoice-canvas.shadow {
  box-shadow: 0 0 10px rgba(69, 69, 69, 0.25);
}

/* Item Start */

/* Remove input borders inside table */
#itemsTable input {
  border: none;
  background: transparent;
  text-align: end;
  width: 100%;
}

#itemsTable input:focus {
  outline: none;
  box-shadow: none;
  background: #f9fafb; /* light gray on focus */
}
