/* LMNT ERP - Online Ajánlat & Előkalkuláció Stíluslap */
:root {
  --primary-color: #1e3a8a;
  --primary-hover: #172554;
  --success-color: #16a34a;
  --success-hover: #15803d;
  --warning-color: #ea580c;
  --warning-hover: #c2410c;
  --text-color: #222222;
  --bg-color: #f1f5f9;
  --border-color: #555555;
  --light-border: #d1d5db;
  --card-bg: #ffffff;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 0;
  font-family: Arial, "Helvetica Neue", Helvetica, sans-serif;
  color: var(--text-color);
  background-color: var(--bg-color);
  font-size: 14px;
  line-height: 1.45;
  -webkit-print-color-adjust: exact !important;
  print-color-adjust: exact !important;
}

/* Felső rögzített akciósáv (csak képernyőn) */
.action-bar {
  position: sticky;
  top: 0;
  left: 0;
  right: 0;
  background: #ffffff;
  border-bottom: 1px solid #e2e8f0;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
  z-index: 1000;
  padding: 12px 24px;
}

.action-bar-inner {
  max-width: 960px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

.action-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.doc-title {
  font-size: 16px;
  font-weight: 700;
  color: #1e293b;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 12px;
  border-radius: 9999px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.status-created,
.status-sent {
  background-color: #dbeafe;
  color: #1e40af;
}

.status-viewed {
  background-color: #f3e8ff;
  color: #6b21a8;
}

.status-accepted {
  background-color: #dcfce7;
  color: #166534;
}

.status-modification {
  background-color: #ffedd5;
  color: #9a3412;
}

.action-buttons {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 18px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.15s ease-in-out;
}

.btn-primary {
  background-color: var(--primary-color);
  color: #ffffff;
}

.btn-primary:hover {
  background-color: var(--primary-hover);
}

.btn-success {
  background-color: var(--success-color);
  color: #ffffff;
}

.btn-success:hover {
  background-color: var(--success-hover);
}

.btn-warning {
  background-color: var(--warning-color);
  color: #ffffff;
}

.btn-warning:hover {
  background-color: var(--warning-hover);
}

.btn-outline {
  background-color: #ffffff;
  color: #334155;
  border-color: #cbd5e1;
}

.btn-outline:hover {
  background-color: #f8fafc;
  border-color: #94a3b8;
}

/* Állapot értesítő bannerek */
.banner {
  max-width: 900px;
  margin: 16px auto 0;
  padding: 14px 20px;
  border-radius: 8px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  font-size: 14px;
}

.banner-success {
  background-color: #f0fdf4;
  border: 1px solid #bbf7d0;
  color: #166534;
}

.banner-warning {
  background-color: #fff7ed;
  border: 1px solid #fed7aa;
  color: #9a3412;
}

.banner-info {
  background-color: #eff6ff;
  border: 1px solid #bfdbfe;
  color: #1e40af;
}

.banner h4 {
  margin: 0 0 4px 0;
  font-size: 15px;
}

.banner p {
  margin: 0;
}

/* A4 Papír / Nyomtatható dokumentum konténer */
.page-wrapper {
  max-width: 900px;
  margin: 24px auto 48px;
  padding: 0 16px;
}

.document-paper {
  background-color: var(--card-bg);
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.08);
  border-radius: 6px;
  padding: 40px;
  position: relative;
}

/* Fejléc */
.doc-header {
  display: table;
  width: 100%;
  table-layout: fixed;
  margin-bottom: 24px;
  border-bottom: 2px solid #555555;
  padding-bottom: 18px;
}

.header-left {
  display: table-cell;
  width: 50%;
  vertical-align: top;
}

.header-right {
  display: table-cell;
  width: 50%;
  text-align: right;
  vertical-align: top;
}

.logo {
  max-width: 160px;
  height: auto;
  margin-bottom: 10px;
}

.company-details {
  font-size: 13px;
  line-height: 1.4;
  color: #333333;
}

.company-details div {
  margin-bottom: 2px;
}

.barcode-container {
  text-align: right;
  margin-bottom: 8px;
}

.barcode-img {
  width: 280px;
  height: 48px;
  display: inline-block;
}

.barcode-subtext {
  font-size: 11px;
  color: #666666;
  margin-top: 2px;
}

.doc-main-title {
  font-size: 20px;
  font-weight: 700;
  margin: 10px 0 6px 0;
  color: #111827;
}

.job-name-highlight {
  font-size: 15px;
  font-weight: 700;
  color: #1e3a8a;
  margin-bottom: 6px;
}

.issue-date {
  font-size: 13px;
  color: #4b5563;
}

/* Ügyfél információs doboz */
.info-section {
  display: table;
  width: 100%;
  margin-bottom: 24px;
}

.info-box {
  width: 52%;
  padding: 14px 16px;
  background-color: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 4px;
  font-size: 13px;
  line-height: 1.5;
}

.info-title {
  font-weight: 700;
  margin-bottom: 6px;
  color: #374151;
  border-bottom: 1px solid #d1d5db;
  padding-bottom: 4px;
  font-size: 14px;
}

/* Munka leírása */
.job-description-section {
  margin-bottom: 24px;
}

.section-title {
  font-size: 15px;
  font-weight: 700;
  color: #1f2937;
  margin: 20px 0 8px 0;
}

.job-description-text {
  font-size: 13px;
  line-height: 1.5;
  color: #374151;
  background-color: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 4px;
  padding: 12px 14px;
  white-space: pre-wrap;
  word-break: break-word;
}

/* Táblázatok */
table.items-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 20px;
  font-size: 13px;
}

table.items-table th,
table.items-table td {
  border: 1px solid var(--border-color) !important;
  padding: 6px 8px;
  text-align: left;
}

table.items-table th {
  background-color: #f8f8f8;
  font-weight: 700;
  color: #333333;
}

table.items-table tr.total-row {
  font-weight: 700;
  background-color: #e9e9e9;
}

.amount-cell {
  text-align: right;
  white-space: nowrap;
}

/* Előkalkuláció Végösszeg Kiemelt Doboz */
.estimate-summary-box {
  margin: 24px 0;
  padding: 20px;
  border: 2px solid #555555;
  background-color: #f9f9f9;
  border-radius: 6px;
  text-align: center;
}

.estimate-summary-title {
  margin-top: 0;
  color: #222222;
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 12px;
}

.estimate-line {
  font-size: 15px;
  margin-bottom: 6px;
}

.estimate-gross {
  font-size: 22px;
  font-weight: 800;
  margin-top: 12px;
  color: #d32f2f;
  padding-top: 10px;
  border-top: 1px solid #cccccc;
  display: inline-block;
}

/* Tervezési díj kiemelés */
.design-fee-box {
  margin-top: 16px;
  padding: 12px 14px;
  background-color: #f8fafc;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  font-weight: 700;
  font-size: 13px;
  color: #334155;
}

.design-fee-subtext {
  font-weight: normal;
  font-size: 12px;
  color: #64748b;
  margin-top: 2px;
}

/* Árajánlat Összegző Sáv (Jobbra igazított) */
.quote-summary-section {
  margin-top: 20px;
  text-align: right;
  page-break-inside: avoid;
}

.summary-row {
  font-size: 15px;
  margin-bottom: 6px;
}

.summary-row.discount {
  color: #15803d;
  font-weight: 600;
}

.summary-divider {
  border-top: 2px solid #333333;
  margin: 10px 0 8px auto;
  width: 320px;
}

.summary-gross {
  font-size: 20px;
  font-weight: 800;
  color: #111827;
  margin: 10px 0 14px 0;
}

.advance-box {
  font-size: 15px;
  font-weight: 700;
  color: #1e3a8a;
  background-color: #eff6ff;
  border: 1px solid #bfdbfe;
  display: inline-block;
  padding: 8px 14px;
  border-radius: 4px;
  margin-bottom: 16px;
}

/* Megrendelői Nyilatkozat */
.statement-box {
  margin-top: 30px;
  margin-bottom: 20px;
  font-size: 11px;
  line-height: 1.45;
  color: #333333;
  text-align: justify;
  background-color: #fbfbfc;
  border: 1px solid #e2e8f0;
  padding: 12px;
  border-radius: 4px;
}

/* Aláírások */
.signature-table {
  width: 100%;
  margin-top: 40px;
  border: none !important;
  border-collapse: collapse;
}

.signature-table td {
  border: none !important;
  padding: 0;
  vertical-align: bottom;
}

.client-signature-cell {
  width: 58%;
  text-align: left;
}

.client-signed-badge {
  display: inline-block;
  padding: 8px 12px;
  background-color: #dcfce7;
  border: 2px solid #16a34a;
  border-radius: 6px;
  color: #14532d;
  font-weight: 700;
  font-size: 12px;
  margin-bottom: 12px;
}

.signature-date-line {
  padding-top: 20px;
  margin-bottom: 30px;
  font-size: 11px;
  color: #333333;
}

.signature-line-text {
  border-top: 1px solid #000000;
  width: 80%;
  padding-top: 5px;
  font-weight: 700;
  font-size: 12px;
}

.contractor-signature-cell {
  width: 42%;
  text-align: right;
}

.signature-img {
  width: 140px;
  height: auto;
  display: block;
  margin-left: auto;
  margin-bottom: 0;
}

.contractor-line-text {
  margin: 0;
  padding-top: 4px;
  font-weight: 700;
  font-size: 12px;
}

.footer-disclaimer {
  margin-top: 24px;
  font-size: 11px;
  color: #64748b;
  text-align: center;
  border-top: 1px solid #e2e8f0;
  padding-top: 10px;
}

/* Általános Feltételek szekció */
.terms-section {
  margin-top: 40px;
  border-top: 2px dashed #cbd5e1;
  padding-top: 24px;
}

.terms-title {
  font-size: 15px;
  font-weight: 700;
  color: #1e293b;
  margin-bottom: 12px;
}

.terms-body {
  font-size: 10.5px;
  line-height: 1.5;
  color: #475569;
  text-align: justify;
}

.terms-body p {
  margin: 0 0 8px 0;
}

.software-branding {
  text-align: center;
  font-size: 10px;
  color: #94a3b8;
  margin-top: 24px;
}

/* Modális ablakok */
.modal-overlay {
  position: fixed;
  inset: 0;
  background-color: rgba(15, 23, 42, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  padding: 16px;
  backdrop-filter: blur(2px);
}

.modal-card {
  background: #ffffff;
  border-radius: 10px;
  max-width: 500px;
  width: 100%;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
  overflow: hidden;
  animation: modalIn 0.2s ease-out;
}

@keyframes modalIn {
  from {
    opacity: 0;
    transform: scale(0.96);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.modal-header {
  padding: 18px 24px;
  background-color: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-header h3 {
  margin: 0;
  font-size: 17px;
  font-weight: 700;
  color: #0f172a;
}

.modal-close-btn {
  background: none;
  border: none;
  font-size: 20px;
  cursor: pointer;
  color: #64748b;
  padding: 4px;
  line-height: 1;
}

.modal-body {
  padding: 20px 24px;
}

.modal-footer {
  padding: 14px 24px;
  background-color: #f8fafc;
  border-top: 1px solid #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.form-group {
  margin-bottom: 16px;
}

.form-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: #334155;
  margin-bottom: 6px;
}

.form-control {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  font-size: 14px;
  font-family: inherit;
  transition: border-color 0.15s;
}

.form-control:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(30, 58, 138, 0.1);
}

textarea.form-control {
  min-height: 100px;
  resize: vertical;
}

.checkbox-label {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 12.5px;
  color: #475569;
  cursor: pointer;
  line-height: 1.4;
}

.checkbox-label input {
  margin-top: 3px;
}

/* Töltés állapot */
.loading-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 80px 20px;
  text-align: center;
}

.spinner {
  width: 48px;
  height: 48px;
  border: 4px solid #e2e8f0;
  border-top-color: var(--primary-color);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin-bottom: 16px;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.error-container {
  max-width: 500px;
  margin: 60px auto;
  padding: 32px;
  background: #ffffff;
  border-radius: 8px;
  text-align: center;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

/* @media print: Nyomtatási és PDF-mentési szabályok */
@media print {
  @page {
    size: A4;
    margin: 12mm 15mm 15mm 15mm;
  }

  body {
    background: #ffffff !important;
    color: #222222 !important;
    font-size: 12px !important;
  }

  .action-bar,
  .banner,
  .modal-overlay,
  .no-print {
    display: none !important;
  }

  .page-wrapper {
    max-width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  .document-paper {
    box-shadow: none !important;
    border-radius: 0 !important;
    padding: 0 !important;
  }

  table.items-table {
    page-break-inside: auto;
  }

  table.items-table tr {
    page-break-inside: avoid;
    page-break-after: auto;
  }

  table.items-table th,
  table.items-table td {
    padding: 4px 6px !important;
    font-size: 11px !important;
  }

  .quote-summary-section,
  .estimate-summary-box,
  .statement-box,
  .signature-table,
  .terms-section {
    page-break-inside: avoid;
  }

  .terms-body {
    font-size: 9.5px !important;
    line-height: 1.35 !important;
  }
}

