:root {
  --bg: #f6f8fc;
  --card: #ffffff;
  --text: #162033;
  --muted: #6d7992;
  --line: #dfe5ef;
  --primary: #0a5ddf;
  --primary-dark: #083ea4;
  --success: #0f9f63;
  --danger: #c43737;
  --warning: #d58512;
  --shadow: 0 18px 35px rgba(17, 31, 64, 0.08);
  --radius: 18px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: Inter, Arial, sans-serif;
  color: var(--text);
  background: linear-gradient(180deg, #f5f7fb 0%, #eef3fa 100%);
}
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; display: block; }
.container {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
}
.page-shell { display: flex; min-height: 100vh; }
.sidebar {
  width: 270px;
  background: #0f1728;
  color: #e8eefb;
  padding: 28px 22px;
  position: sticky;
  top: 0;
  min-height: 100vh;
}
.brand-lockup { display: flex; gap: 12px; align-items: center; margin-bottom: 30px; }
.brand-lockup img { width: 46px; height: 46px; object-fit: contain; background: white; border-radius: 12px; padding: 6px; }
.brand-title { font-size: 20px; font-weight: 700; }
.brand-sub { color: #9db1d5; font-size: 13px; }
.nav-group { display: grid; gap: 8px; }
.nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 13px 14px;
  border-radius: 12px;
  color: #dce6fb;
  transition: 0.2s ease;
}
.nav-link:hover, .nav-link.active {
  background: rgba(255,255,255,0.08);
  text-decoration: none;
}
.sidebar-footer {
  margin-top: 28px;
  padding-top: 20px;
  border-top: 1px solid rgba(255,255,255,0.08);
  font-size: 13px;
  color: #96a9cd;
}
.main-content { flex: 1; padding: 28px 0 48px; }
.topbar {
  display: flex; justify-content: space-between; gap: 18px; align-items: center; margin-bottom: 26px;
}
.page-title { font-size: 30px; font-weight: 800; margin: 0; }
.page-subtitle { margin: 6px 0 0; color: var(--muted); }
.button, button, .btn {
  appearance: none;
  border: none;
  cursor: pointer;
  border-radius: 12px;
  padding: 12px 16px;
  font-weight: 700;
  background: var(--primary);
  color: white;
  display: inline-flex;
  gap: 10px;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}
.button:hover, .btn:hover { background: var(--primary-dark); text-decoration: none; }
.btn-secondary { background: #ebf1fd; color: var(--primary-dark); }
.btn-secondary:hover { background: #dfe9ff; }
.btn-danger { background: var(--danger); }
.btn-danger:hover { background: #a62323; }
.btn-ghost { background: white; color: var(--text); border: 1px solid var(--line); }
.grid {
  display: grid;
  gap: 18px;
}
.grid-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 22px;
  border: 1px solid rgba(120, 143, 181, 0.08);
}
.card-header {
  display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 18px;
}
.card-title { margin: 0; font-size: 18px; font-weight: 800; }
.kpi { display: grid; gap: 10px; }
.kpi-value { font-size: 34px; font-weight: 800; }
.kpi-label { color: var(--muted); font-size: 14px; }
.muted { color: var(--muted); }
.table-wrap { overflow-x: auto; }
table {
  width: 100%;
  border-collapse: collapse;
}
th, td {
  text-align: left;
  padding: 14px 12px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}
th { color: var(--muted); font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; }
.badge {
  display: inline-flex;
  align-items: center;
  padding: 6px 11px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 12px;
}
.badge-success { color: #0b6c44; background: #dff7eb; }
.badge-warning { color: #8c5300; background: #fff2d9; }
.badge-danger { color: #912626; background: #ffe1e1; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.form-grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.field { display: grid; gap: 8px; }
label { font-weight: 700; font-size: 14px; }
input, textarea, select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 13px 14px;
  font: inherit;
  background: white;
  color: var(--text);
}
textarea { min-height: 120px; resize: vertical; }
input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: #86b4ff;
  box-shadow: 0 0 0 4px rgba(10, 93, 223, 0.12);
}
.actions-row {
  display: flex; justify-content: flex-end; gap: 12px; flex-wrap: wrap; margin-top: 24px;
}
.flash-stack { display: grid; gap: 12px; margin-bottom: 18px; }
.alert {
  border-radius: 14px; padding: 14px 16px; font-weight: 600;
}
.alert-success { background: #dff8eb; color: #0d6b43; }
.alert-error { background: #ffe5e5; color: #8f2525; }
.alert-info { background: #eaf2ff; color: #0c46a6; }
.login-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  background: radial-gradient(circle at top left, #dce9ff, #f5f7fb 55%);
  padding: 32px 16px;
}
.login-card { width: min(480px, 100%); }
.logo-center { display: grid; place-items: center; gap: 16px; margin-bottom: 18px; }
.logo-center img { width: 88px; }
.toolbar { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.filters { display: flex; gap: 12px; flex-wrap: wrap; align-items: flex-end; }
.filters .field { min-width: 180px; }
.info-list { display: grid; gap: 14px; }
.info-row { display: grid; grid-template-columns: 180px 1fr; gap: 12px; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.info-row:last-child { border-bottom: none; padding-bottom: 0; }
.info-label { color: var(--muted); font-weight: 700; }
.voucher-shell {
  background: #edf3fb;
  min-height: 100vh;
  padding: 32px 0;
}
.voucher-paper {
  width: min(980px, calc(100% - 24px));
  margin: 0 auto;
  background: white;
  border-radius: 24px;
  box-shadow: 0 30px 60px rgba(13, 28, 61, 0.15);
  overflow: hidden;
}
.voucher-top {
  padding: 28px 32px;
  background: linear-gradient(135deg, #0a5ddf, #0f1d3a);
  color: white;
  display: flex;
  gap: 16px;
  justify-content: space-between;
  align-items: center;
}
.voucher-brand { display: flex; align-items: center; gap: 14px; }
.voucher-brand img { width: 68px; background: rgba(255,255,255,0.95); padding: 6px; border-radius: 18px; }
.voucher-body { padding: 30px 32px 10px; }
.voucher-grid { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 24px; }
.hotel-preview {
  border: 1px solid var(--line);
  border-radius: 18px;
  overflow: hidden;
  background: #fbfdff;
}
.hotel-preview img { width: 100%; height: 270px; object-fit: cover; background: #e9eef8; }
.hotel-preview-body { padding: 18px; }
.section-title { font-size: 17px; font-weight: 800; margin: 0 0 14px; }
.chip-row { display: flex; gap: 10px; flex-wrap: wrap; }
.chip { background: #eef4ff; color: #0a4bb5; padding: 8px 12px; border-radius: 999px; font-weight: 700; font-size: 13px; }
.voucher-footer {
  padding: 24px 32px 32px;
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: center;
}
.qr-box {
  border: 1px dashed #abc2ea;
  border-radius: 18px;
  padding: 18px;
  display: flex;
  gap: 16px;
  align-items: center;
}
.qr-box img { width: 118px; height: 118px; object-fit: contain; background: white; border-radius: 12px; }
.tiny { font-size: 12px; }
.preview-actions {
  padding: 18px 32px 0;
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}
.empty-state {
  text-align: center;
  padding: 36px 18px;
  color: var(--muted);
}
.template-json {
  display: none;
}
@media (max-width: 980px) {
  .grid-cols-4, .grid-cols-3, .grid-cols-2, .voucher-grid, .form-grid, .form-grid-3 {
    grid-template-columns: 1fr;
  }
  .page-shell { display: block; }
  .sidebar {
    width: 100%; min-height: auto; position: static; border-bottom-left-radius: 24px; border-bottom-right-radius: 24px;
  }
  .main-content { padding-top: 22px; }
  .topbar { flex-direction: column; align-items: flex-start; }
  .voucher-top, .voucher-footer { flex-direction: column; align-items: flex-start; }
  .info-row { grid-template-columns: 1fr; }
}
@media print {
  body, .voucher-shell { background: white; }
  .preview-actions { display: none !important; }
  .voucher-paper {
    width: 100%; box-shadow: none; border-radius: 0; margin: 0;
  }
  .voucher-top { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
