/* Reset & Base */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background-color: #f1f5f9;
  color: #0f172a;
  min-height: 100vh;
}

/* App Layout */
.app-layout {
  display: grid;
  grid-template-columns: 380px 1fr;
  min-height: 100vh;
  max-width: 1680px;
  margin: 0 auto;
  gap: 24px;
  padding: 24px;
}

@media (max-width: 1024px) {
  .app-layout {
    grid-template-columns: 1fr;
    padding: 16px;
  }
}

/* Sidebar */
.sidebar {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  padding: 24px;
  height: fit-content;
  position: sticky;
  top: 24px;
  box-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.05);
}

.brand-badge {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: #dc2626;
  margin-bottom: 4px;
}

.sidebar-title {
  font-size: 22px;
  font-weight: 800;
  color: #0f172a;
  letter-spacing: -0.02em;
}

.sidebar-desc {
  font-size: 13px;
  line-height: 1.5;
  color: #64748b;
  margin-top: 6px;
  margin-bottom: 20px;
}

/* Form Controls */
.form-container {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.form-group {
  display: flex;
  flex-direction: column;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.form-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #475569;
  margin-bottom: 5px;
}

.label-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 5px;
}

.action-link {
  background: none;
  border: none;
  font-size: 11px;
  font-weight: 600;
  color: #dc2626;
  cursor: pointer;
  padding: 0;
  transition: color 0.15s;
}

.action-link:hover {
  color: #b91c1c;
  text-decoration: underline;
}

.form-input {
  width: 100%;
  border: 1px solid #cbd5e1;
  background-color: #ffffff;
  padding: 9px 12px;
  font-size: 13px;
  color: #0f172a;
  border-radius: 8px;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
  font-family: inherit;
}

.form-input:focus {
  border-color: #dc2626;
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.15);
}

.textarea {
  resize: vertical;
  min-height: 60px;
}

.helper-text {
  font-size: 12px;
  color: #64748b;
  margin-top: -6px;
}

.toggle-link {
  background: none;
  border: none;
  color: #334155;
  font-size: 13px;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
  padding: 0;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.toggle-link:hover {
  color: #0f172a;
}

.extra-fields {
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 14px;
}

.extra-fields.hidden {
  display: none;
}

/* Button Group */
.button-group {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 8px;
}

.btn {
  width: 100%;
  padding: 11px 16px;
  font-size: 13px;
  font-weight: 600;
  border-radius: 10px;
  border: none;
  cursor: pointer;
  transition: all 0.15s;
  text-align: center;
  font-family: inherit;
}

.btn-primary {
  background: #dc2626;
  color: #ffffff;
  box-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.05);
}

.btn-primary:hover:not(:disabled) {
  background: #b91c1c;
}

.btn-primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.btn-secondary {
  background: #ffffff;
  color: #334155;
  border: 1px solid #cbd5e1;
}

.btn-secondary:hover {
  background: #f8fafc;
  color: #0f172a;
}

.btn-link {
  background: none;
  border: none;
  color: #64748b;
  font-size: 12px;
  font-weight: 500;
  padding: 4px;
}

.btn-link:hover {
  color: #0f172a;
  text-decoration: underline;
}

/* Preview Section */
.preview-section {
  background: #e2e8f0;
  border: 1px solid #cbd5e1;
  border-radius: 16px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  overflow: auto;
}

.preview-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.preview-title {
  font-size: 14px;
  font-weight: 700;
  color: #334155;
}

.preview-tag {
  font-size: 12px;
  color: #64748b;
}

.preview-viewport {
  overflow: auto;
  display: flex;
  justify-content: center;
  padding-bottom: 24px;
}

.voucher-wrapper {
  width: calc(210mm * 0.72);
  height: calc(297mm * 0.72);
  overflow: hidden;
  box-shadow: 0 10px 25px -5px rgb(0 0 0 / 0.15), 0 8px 10px -6px rgb(0 0 0 / 0.1);
}

.voucher-wrapper > .sheet {
  transform: scale(0.72);
  transform-origin: top left;
}

/* Exact Voucher Document CSS */
.sheet {
  width: 210mm;
  height: 297mm;
  min-height: 297mm;
  padding: 10mm 10mm 9mm;
  position: relative;
  overflow: hidden;
  background: #ffffff;
  color: #000000;
  font-family: Arial, Helvetica, "Noto Naskh Arabic", sans-serif;
  font-size: 10px;
  line-height: 1.25;
}

.frame {
  border: 1.5px solid #000000;
  height: 204mm;
  padding: 8px 10px 8px;
  display: flex;
  flex-direction: column;
}

.header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 0 0 2px;
}

.logoWrap {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.logoWord {
  font-family: Arial, Helvetica, sans-serif;
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.4px;
  line-height: 0.95;
  color: #1a1a1a;
}

.dots {
  display: flex;
  gap: 4px;
  margin-top: 4px;
  margin-left: 2px;
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}

.titleBlock {
  text-align: right;
  padding-top: 2px;
}

.title {
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.2px;
  line-height: 1;
  color: #000000;
}

.titleConfirm {
  color: #d60000;
  font-weight: 800;
}

.subtitle {
  margin-top: 4px;
  font-size: 8.5px;
  color: #000000;
  font-weight: 700;
  line-height: 1.2;
}

.agodaBar {
  margin-top: 5px;
  margin-bottom: 6px;
  background: #b2b2b2;
  height: 15px;
  line-height: 15px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 8px;
  font-size: 8.5px;
  color: #ffffff;
  font-weight: 700;
  letter-spacing: 0.25px;
}

.agodaBar span {
  display: inline-block;
  line-height: 15px;
  white-space: nowrap;
}

.details {
  display: grid;
  grid-template-columns: 1.16fr 0.84fr;
  gap: 12px;
  margin-top: 4px;
}

.leftCol {
  display: flex;
  flex-direction: column;
}

.row {
  display: grid;
  grid-template-columns: 124px 1fr;
  align-items: start;
  margin-bottom: 4px;
  min-height: 14px;
}

.label {
  color: #111111;
  font-size: 9.8px;
  font-weight: 500;
}

.value {
  font-weight: 800;
  color: #000000;
  font-size: 9.8px;
}

.box {
  border: 1px solid #555555;
  padding: 3px 6px 4px;
  min-height: 52px;
  font-size: 9.2px;
  line-height: 1.35;
  font-weight: 700;
  color: #000000;
}

.rightCol {
  display: flex;
  flex-direction: column;
}

.rightRow {
  display: grid;
  grid-template-columns: 1fr 132px;
  align-items: center;
  gap: 4px;
  margin-bottom: 5px;
}

.rightLabel {
  font-size: 9.8px;
  color: #111111;
  font-weight: 500;
}

.rightBox {
  border: 1px solid #b8b8b8;
  background: #ebebeb;
  min-height: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 9.8px;
  color: #000000;
  text-align: center;
  padding: 0 4px;
  line-height: 1;
}

.promoNote {
  margin-top: 3px;
  font-size: 9.2px;
  color: #111111;
  font-weight: 500;
}

.banner {
  margin-top: 6px;
  background: #bebebe;
  padding: 3px 6px 4px;
  font-size: 9px;
  line-height: 1.25;
  color: #000000;
}

.wifi {
  margin-top: 5px;
  margin-bottom: 5px;
  padding-bottom: 4px;
  border-bottom: 1px solid #aaaaaa;
  font-size: 9.8px;
  font-weight: 600;
  color: #000000;
  line-height: 1.2;
}

.dates {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  margin-top: 2px;
  margin-bottom: 6px;
  align-items: center;
}

.dateGroup {
  display: flex;
  align-items: center;
  gap: 8px;
}

.dateLabel {
  font-size: 11.5px;
  font-weight: 700;
  color: #000000;
}

.dateBox {
  background: #c2c2c2;
  border: 1px solid #adadad;
  min-width: 135px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 800;
  color: #000000;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.paySection {
  display: grid;
  grid-template-columns: 1fr 182px;
  gap: 8px;
  align-items: stretch;
  margin-top: 4px;
}

.payLeft {
  display: flex;
  flex-direction: column;
}

.payTitle {
  font-weight: 700;
  font-size: 10px;
  line-height: 1.2;
  margin-bottom: 3px;
}

.payBox {
  background: #c8c8c8;
  border: 1px solid #b4b4b4;
  padding: 6px 8px 7px;
  font-size: 9px;
  line-height: 1.35;
  color: #000000;
  flex: 1;
}

.arabicLine {
  direction: rtl;
  text-align: right;
  font-family: "Noto Naskh Arabic", Arial, sans-serif;
  font-size: 9.6px;
  font-weight: 600;
  line-height: 1.35;
}

.payEnglish {
  font-size: 9.2px;
  margin-top: 2px;
  line-height: 1.3;
}

.maroon {
  color: #8a0000;
  font-weight: 800;
}

.stampWrap {
  display: flex;
  align-items: flex-end;
  justify-content: flex-end;
}

.stamp {
  width: 182px;
  height: auto;
  display: block;
}

.remarksRow {
  display: grid;
  grid-template-columns: 1fr 182px;
  gap: 8px;
  margin-top: 6px;
  align-items: flex-end;
}

.remarks {
  font-size: 9.6px;
  line-height: 1.32;
  color: #000000;
}

.remarks p {
  margin: 0 0 1px;
}

.boldRemark {
  font-weight: 800;
}

.support {
  text-align: right;
  font-size: 9.8px;
  line-height: 1.3;
  font-weight: 800;
  color: #000000;
}

.supportLine {
  margin-top: 1px;
}

.supportSmall {
  font-size: 8.8px;
  font-weight: 400;
}

.notes {
  margin-top: 8px;
  border: 1.2px solid #000000;
  padding: 6px 10px 7px;
  font-size: 8.5px;
  line-height: 1.34;
  color: #000000;
}

.notesTitle {
  font-weight: 800;
  font-size: 9.5px;
  margin-bottom: 2px;
}

.notes ul {
  margin: 0;
  padding-left: 14px;
}

.notes li {
  margin-bottom: 2px;
}

/* Print Styles */
@media print {
  body {
    background: #ffffff !important;
  }
  .sidebar,
  .preview-header {
    display: none !important;
  }
  .app-layout {
    display: block !important;
    padding: 0 !important;
    margin: 0 !important;
  }
  .preview-section {
    background: transparent !important;
    border: none !important;
    padding: 0 !important;
  }
  .preview-viewport {
    display: block !important;
    padding: 0 !important;
  }
  .voucher-wrapper {
    width: 210mm !important;
    height: 297mm !important;
    box-shadow: none !important;
  }
  .voucher-wrapper > .sheet {
    transform: none !important;
  }
}
