/* ── INVOICE PAGE LAYOUT ── */
.invoice-wrap {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem;
}

/* ── FORM ── */
.invoice-form {
  background: #111111;
  border: 1px solid #1f1f1f;
  border-radius: 16px;
  padding: 2rem;
}

.invoice-form h2 {
  font-size: 1.3rem;
  font-weight: 600;
  margin-bottom: 1.5rem;
  color: #ffffff;
}

.form-section {
  margin-bottom: 1.8rem;
  padding-bottom: 1.8rem;
  border-bottom: 1px solid #1f1f1f;
}

.form-section:last-child {
  border-bottom: none;
}

.form-section-title {
  font-size: 0.8rem;
  font-weight: 600;
  color: #1D9E75;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 1rem;
}

.field {
  margin-bottom: 1rem;
}

.field label {
  display: block;
  font-size: 0.85rem;
  color: #888888;
  margin-bottom: 0.4rem;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  padding: 0.75rem 1rem;
  background: #1a1a1a;
  border: 1px solid #2a2a2a;
  border-radius: 8px;
  color: #ffffff;
  font-size: 0.95rem;
  outline: none;
  transition: border 0.2s;
  font-family: 'Segoe UI', sans-serif;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: #1D9E75;
}

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

/* ── SERVICES ── */
.service-row {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.service-row input {
  padding: 0.75rem 1rem;
  background: #1a1a1a;
  border: 1px solid #2a2a2a;
  border-radius: 8px;
  color: #ffffff;
  font-size: 0.95rem;
  outline: none;
  transition: border 0.2s;
}

.service-row input:focus {
  border-color: #1D9E75;
}

.add-service-btn {
  background: transparent;
  border: 1px dashed #2a2a2a;
  color: #888888;
  padding: 0.6rem 1rem;
  border-radius: 8px;
  font-size: 0.85rem;
  cursor: pointer;
  width: 100%;
  transition: all 0.2s;
  margin-top: 0.5rem;
}

.add-service-btn:hover {
  border-color: #1D9E75;
  color: #1D9E75;
}

/* ── ACTION BUTTONS ── */
.action-buttons {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-top: 1.5rem;
}

.preview-btn {
  width: 100%;
  padding: 0.85rem;
  background: #1D9E75;
  color: #ffffff;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}

.preview-btn:hover {
  background: #0F6E56;
}

.download-btn {
  width: 100%;
  padding: 0.85rem;
  background: transparent;
  color: #1D9E75;
  border: 1px solid #1D9E75;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.download-btn:hover {
  background: #1D9E75;
  color: #ffffff;
}

.share-btn {
  width: 100%;
  padding: 0.85rem;
  background: transparent;
  color: #888888;
  border: 1px solid #2a2a2a;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.share-btn:hover {
  border-color: #888888;
  color: #ffffff;
}

/* ── PREVIEW PANEL ── */
.invoice-preview {
  position: sticky;
  top: 80px;
  height: fit-content;
}

.preview-placeholder {
  background: #111111;
  border: 1px dashed #2a2a2a;
  border-radius: 16px;
  padding: 4rem 2rem;
  text-align: center;
  color: #444444;
}

.placeholder-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
}

/* ── INVOICE DOCUMENT ── */
.invoice-document {
  background: #ffffff;
  border-radius: 16px;
  padding: 2.5rem;
  color: #111111;
}

.invoice-doc-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 2.5rem;
}

.invoice-doc-logo {
  font-size: 1.8rem;
  font-weight: 700;
  color: #111111;
}

.invoice-doc-logo span {
  color: #1D9E75;
}

.invoice-doc-meta {
  text-align: right;
}

.invoice-doc-meta h2 {
  font-size: 1.5rem;
  font-weight: 700;
  color: #111111;
  margin-bottom: 0.3rem;
}

.invoice-doc-meta p {
  font-size: 0.85rem;
  color: #666666;
}

.invoice-doc-parties {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  margin-bottom: 2rem;
  padding: 1.5rem;
  background: #f9f9f9;
  border-radius: 8px;
}

.party-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: #1D9E75;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 0.5rem;
}

.party-name {
  font-size: 1rem;
  font-weight: 600;
  color: #111111;
  margin-bottom: 0.2rem;
}

.party-detail {
  font-size: 0.85rem;
  color: #666666;
  margin-bottom: 0.1rem;
}

.invoice-doc-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 1.5rem;
}

.invoice-doc-table th {
  background: #111111;
  color: #ffffff;
  padding: 0.75rem 1rem;
  text-align: left;
  font-size: 0.85rem;
  font-weight: 600;
}

.invoice-doc-table th:last-child {
  text-align: right;
}

.invoice-doc-table td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid #eeeeee;
  font-size: 0.9rem;
  color: #333333;
}

.invoice-doc-table td:last-child {
  text-align: right;
  font-weight: 500;
}

.invoice-total-row {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 2rem;
}

.invoice-total-box {
  background: #111111;
  color: #ffffff;
  padding: 1rem 1.5rem;
  border-radius: 8px;
  text-align: right;
  min-width: 200px;
}

.invoice-total-label {
  font-size: 0.85rem;
  color: #888888;
  margin-bottom: 0.3rem;
}

.invoice-total-amount {
  font-size: 1.8rem;
  font-weight: 700;
  color: #1D9E75;
}

.invoice-payment-info {
  background: #f9f9f9;
  border-radius: 8px;
  padding: 1.2rem 1.5rem;
  margin-bottom: 1.5rem;
}

.invoice-payment-title {
  font-size: 0.75rem;
  font-weight: 600;
  color: #1D9E75;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 0.5rem;
}

.invoice-payment-detail {
  font-size: 0.9rem;
  color: #333333;
}

.invoice-notes {
  font-size: 0.85rem;
  color: #666666;
  border-top: 1px solid #eeeeee;
  padding-top: 1rem;
  font-style: italic;
}

.invoice-footer {
  text-align: center;
  margin-top: 1.5rem;
  font-size: 0.75rem;
  color: #aaaaaa;
}

/* ── RESPONSIVE ── */
/* ── RESPONSIVE ── */
@media (max-width: 900px) {
  .invoice-wrap {
    grid-template-columns: 1fr;
    padding: 1rem;
  }

  .invoice-preview {
    position: static;
  }
}

@media (max-width: 600px) {
  .invoice-wrap {
    padding: 0.75rem;
    gap: 1rem;
  }

  .invoice-form {
    padding: 1rem;
  }

  .invoice-form h2 {
    font-size: 1.1rem;
  }

  .field-row {
    grid-template-columns: 1fr;
  }

  .service-row {
    grid-template-columns: 1fr;
  }

  .calc-box button {
    font-size: 0.9rem;
  }

  .invoice-document {
    padding: 1.2rem;
    border-radius: 8px;
  }

  .invoice-doc-header {
    flex-direction: column;
    gap: 0.75rem;
  }

  .invoice-doc-meta {
    text-align: left;
  }

  .invoice-doc-meta h2 {
    font-size: 1.2rem;
  }

  .invoice-doc-parties {
    grid-template-columns: 1fr;
    gap: 0.75rem;
    padding: 1rem;
  }

  .invoice-doc-table th,
  .invoice-doc-table td {
    padding: 0.5rem 0.75rem;
    font-size: 0.8rem;
  }

  .invoice-total-box {
    min-width: unset;
    width: 100%;
  }

  .invoice-total-amount {
    font-size: 1.4rem;
  }

  .result-top {
    flex-direction: column;
    gap: 0.75rem;
  }

  .action-buttons {
    gap: 0.5rem;
  }

  .preview-btn,
  .download-btn,
  .share-btn {
    font-size: 0.9rem;
    padding: 0.75rem;
  }
}
