:root {
  --bg: #120f1c;
  --surface: #1b1730;
  --surface-2: #241e3d;
  --surface-3: #2c2549;
  --border: #362f56;
  --border-soft: #2a2445;
  --text: #f3f0fc;
  --text-muted: #a79fc6;
  --text-faint: #766f95;
  --accent: #5b4ff0;
  --accent-strong: #7466ff;
  --accent-cyan: #4fc3f5;
  --accent-magenta: #e23f92;
  --success: #34d399;
  --danger: #f2727a;
  --warning: #f0b429;

  --font-display: "Newsreader", "Iowan Old Style", Georgia, serif;
  --font-body: "IBM Plex Sans", "Segoe UI", Arial, sans-serif;
  --font-mono: "IBM Plex Mono", "Consolas", monospace;
  --font-script: "Caveat", cursive;

  color-scheme: dark;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.5;
}

body {
  padding-inline: 20px;
  min-height: 100%;
}

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 600;
  text-wrap: balance;
  margin: 0;
}

a { color: var(--accent-cyan); }

.page {
  max-width: 1180px;
  margin: 0 auto;
}

/* ---------- Top bar ---------- */

.topbar {
  display: flex;
  align-items: center;
  gap: 14px;
  padding-block: 22px;
  border-bottom: 1px solid var(--border-soft);
  flex-wrap: wrap;
}

.logo-mark { height: 36px; width: auto; flex: none; }

.wordmark {
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 19px;
  letter-spacing: 0.04em;
  color: var(--text);
}

.tagline {
  font-family: var(--font-script);
  font-size: 20px;
  color: var(--accent-cyan);
  margin-left: 2px;
  transform: translateY(1px);
}

.topbar-meta {
  margin-left: auto;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-faint);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 6px 14px;
  white-space: nowrap;
}

.topbar-nav {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 10px;
}

.topbar-nav .topbar-meta { margin-left: 0; }

.topbar-link {
  text-decoration: none;
  transition: border-color 0.15s, color 0.15s;
}

.topbar-link:hover {
  border-color: var(--accent-cyan);
  color: var(--accent-cyan);
}

.track-hint {
  text-align: center;
  font-size: 12.5px;
  color: var(--text-faint);
  margin: -10px 0 16px;
}

/* ---------- Contact page ---------- */

.contact-card {
  padding: 12px 0;
  border-bottom: 1px solid var(--border-soft);
}

.contact-card:last-of-type { border-bottom: none; }

.contact-card-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-faint);
  margin-bottom: 4px;
}

.contact-card-value {
  display: inline-block;
  font-size: 14px;
  font-weight: 600;
  color: var(--accent-cyan);
  text-decoration: none;
}

.contact-card-value:hover { text-decoration: underline; }

/* ---------- Track page ---------- */

.track-wrap { max-width: 640px; margin: 0 auto; padding-block: 36px 60px; }
.track-form { display: flex; gap: 10px; margin-bottom: 26px; }
.track-form input { flex: 1; font-family: var(--font-mono); letter-spacing: 0.03em; }
.track-form .btn { flex: none; }

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  border-radius: 999px;
  padding: 5px 14px;
}

.status-pill.status-new { background: rgba(240, 180, 41, 0.16); color: var(--warning); }
.status-pill.status-confirmed { background: rgba(79, 195, 245, 0.16); color: var(--accent-cyan); }
.status-pill.status-completed { background: rgba(52, 211, 153, 0.16); color: var(--success); }
.status-dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }

.track-result-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.track-ref { font-family: var(--font-mono); color: var(--accent-cyan); font-size: 15px; }

.track-empty {
  text-align: center;
  color: var(--text-faint);
  font-size: 13.5px;
  border: 1px dashed var(--border);
  border-radius: 12px;
  padding: 40px 20px;
}

.track-meta { color: var(--text-muted); font-size: 12.5px; margin-top: 4px; }

/* ---------- Small reusable utilities (kept out of inline style="" — CSP blocks those) ---------- */

.overflow-x-auto { overflow-x: auto; }
.text-faint { color: var(--text-faint); }
.mt-sm { margin-top: 14px; }
.mb-lg { margin-bottom: 20px; }
.intro-compact { padding-block: 30px 20px; }

/* ---------- Admin page ---------- */

.admin-main { padding-block: 30px 60px; }

.req-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.req-table th {
  text-align: left;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-faint);
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
}
.req-table td { padding: 10px; border-bottom: 1px solid var(--border-soft); vertical-align: top; }
.req-ref { font-family: var(--font-mono); color: var(--accent-cyan); }
.status-select {
  background: var(--surface-2);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 4px 8px;
  font-size: 12px;
}
.login-box { max-width: 340px; margin: 80px auto; }
.req-table tr.row-urgent td:first-child { box-shadow: inset 3px 0 0 var(--danger); }

.notes-input {
  width: 180px;
  min-height: 46px;
  font-size: 12px;
  resize: vertical;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 6px 8px;
  color: var(--text);
}

.notes-input:focus {
  outline: 2px solid var(--accent-strong);
  outline-offset: 1px;
  border-color: var(--accent-strong);
}

/* ---------- Intro ---------- */

.intro { padding-block: 36px 28px; max-width: 640px; }
.intro h1 { font-size: clamp(28px, 4vw, 38px); }
.intro .lede {
  margin-top: 10px;
  color: var(--text-muted);
  font-size: 16px;
  max-width: 56ch;
}

/* ---------- Workspace layout ---------- */

.workspace {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 20px;
  align-items: start;
  padding-bottom: 60px;
}

.stack-left { display: flex; flex-direction: column; gap: 20px; min-width: 0; }

.panel {
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: 14px;
  padding: 22px;
}

.panel h2 {
  font-size: 13px;
  font-family: var(--font-body);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-faint);
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.count-badge {
  font-family: var(--font-mono);
  background: var(--accent);
  color: white;
  border-radius: 999px;
  padding: 1px 9px;
  font-size: 11px;
}

/* ---------- Field grid ---------- */

.field-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px 16px;
}

.field { display: flex; flex-direction: column; gap: 6px; }
.field.span-2 { grid-column: span 2; }

.field label {
  font-size: 12.5px;
  color: var(--text-muted);
  font-weight: 500;
}

.field .hint { font-size: 11.5px; color: var(--text-faint); }

input, select, textarea {
  font-family: var(--font-body);
  font-size: 14px;
  color: var(--text);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: 10px 12px;
  width: 100%;
}

input::placeholder, textarea::placeholder { color: var(--text-faint); }

input:focus, select:focus, textarea:focus {
  outline: 2px solid var(--accent-strong);
  outline-offset: 1px;
  border-color: var(--accent-strong);
}

.field.field-invalid input,
.field.field-invalid select {
  border-color: var(--danger);
  background: rgba(242, 114, 122, 0.07);
}

.verified-badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--success);
  background: rgba(52, 211, 153, 0.12);
  border-radius: 999px;
  padding: 2px 8px;
  margin-left: 6px;
  vertical-align: middle;
}

input[readonly] {
  background: var(--surface-3);
  color: var(--text-muted);
  cursor: not-allowed;
}

.invalid-client-panel {
  max-width: 520px;
  margin: 60px auto;
  text-align: center;
}

.invalid-client-panel h2 {
  font-family: var(--font-display);
  font-size: 22px;
  text-transform: none;
  letter-spacing: normal;
  color: var(--text);
  margin-bottom: 10px;
}

.invalid-client-panel p { color: var(--text-muted); font-size: 14px; }

input[data-mono], .mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }

/* ---------- Service tabs ---------- */

.service-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.service-tab {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 16px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text-muted);
  font-family: var(--font-body);
  font-size: 13.5px;
  font-weight: 500;
  cursor: pointer;
}

.service-tab svg { width: 16px; height: 16px; flex: none; }
.service-tab:hover { border-color: var(--accent); color: var(--text); }

.service-tab.active {
  background: linear-gradient(135deg, var(--accent), var(--accent-magenta));
  border-color: transparent;
  color: white;
}

.service-form-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.service-form-title {
  font-family: var(--font-display);
  font-size: 19px;
  font-style: italic;
  color: var(--text);
}

.edit-hint {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  color: var(--warning);
  background: rgba(240, 180, 41, 0.1);
  border: 1px solid rgba(240, 180, 41, 0.3);
  border-radius: 999px;
  padding: 4px 6px 4px 12px;
}

.edit-hint .cancel-edit {
  background: transparent;
  border: none;
  color: var(--text);
  font-size: 11px;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: 999px;
  cursor: pointer;
}

.edit-hint .cancel-edit:hover { background: rgba(255, 255, 255, 0.1); }

.item-card.editing {
  border-color: var(--warning);
  box-shadow: 0 0 0 1px rgba(240, 180, 41, 0.3);
}

.item-actions { display: flex; gap: 4px; }

.attachment-section {
  border: 1px dashed var(--border);
  border-radius: 10px;
  padding: 14px 16px;
  margin-top: 16px;
}

.attachment-head {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 10px;
}

.attachment-head .hint {
  display: block;
  font-weight: 400;
  font-size: 11.5px;
  color: var(--text-faint);
  margin-top: 2px;
}

.attachment-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}

.attachment-chips:empty { margin-bottom: 0; }

.attachment-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--surface-2);
  border: 1px solid var(--border-soft);
  border-radius: 999px;
  padding: 6px 8px 6px 12px;
  font-size: 12.5px;
  color: var(--text);
  max-width: 100%;
}

.attachment-chip .chip-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 220px;
}

.attachment-chip .chip-size { color: var(--text-faint); font-family: var(--font-mono); font-size: 11px; }

.attachment-chip button {
  background: none;
  border: none;
  color: var(--text-faint);
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
  padding: 2px;
}

.attachment-chip button:hover { color: var(--danger); }

.attachment-upload-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--accent-cyan);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 7px 12px;
  cursor: pointer;
}

.attachment-upload-btn:hover { border-color: var(--accent-cyan); }
.attachment-upload-btn.disabled { opacity: 0.4; pointer-events: none; }

.add-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-top: 18px;
  flex-wrap: wrap;
}

.urgency-toggle {
  display: flex;
  gap: 4px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 3px;
}

.urgency-option {
  font-family: var(--font-body);
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text-muted);
  background: transparent;
  border: none;
  border-radius: 8px;
  padding: 7px 12px;
  cursor: pointer;
}

.urgency-option.active {
  background: var(--danger);
  color: white;
}

.urgency-option:first-child.active {
  background: var(--surface-3);
  color: var(--text);
}

.urgent-badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: white;
  background: var(--danger);
  border-radius: 999px;
  padding: 2px 8px;
  margin-left: 6px;
}

.item-card-badges { display: flex; align-items: center; gap: 4px; }

/* ---------- Buttons ---------- */

.btn {
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 600;
  border-radius: 10px;
  padding: 11px 20px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  cursor: pointer;
}

.btn:hover { border-color: var(--accent); }

.btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  border: none;
  color: white;
  width: 100%;
}

.btn-primary:hover { filter: brightness(1.08); }

.btn-primary:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  filter: none;
}

.btn-ghost {
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-faint);
  padding: 4px 8px;
  font-size: 12px;
}

.btn-ghost:hover { color: var(--danger); border-color: transparent; }

/* ---------- Cart panel ---------- */

.cart-panel { position: sticky; top: 20px; }

.item-list {
  list-style: none;
  margin: 0 0 16px;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 46vh;
  overflow-y: auto;
}

.item-card {
  background: var(--surface-2);
  border: 1px solid var(--border-soft);
  border-radius: 10px;
  padding: 12px 14px;
}

.item-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.item-type-pill {
  font-size: 10.5px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
  color: white;
}

.item-type-pill.flight { background: #3568d4; }
.item-type-pill.hotel { background: #b5722f; }
.item-type-pill.cab { background: #2f9e6d; }
.item-type-pill.visa { background: var(--accent-magenta); }
.item-type-pill.meetassist { background: #c9942f; }
.item-type-pill.insurance { background: #2f8f9e; }
.item-type-pill.forex { background: #c94f3f; }

.item-summary {
  margin-top: 6px;
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.45;
}

.item-summary strong { color: var(--text); font-weight: 600; }

.cart-empty {
  color: var(--text-faint);
  font-size: 13px;
  text-align: center;
  padding: 18px 0;
  border: 1px dashed var(--border);
  border-radius: 10px;
  margin-bottom: 16px;
}

/* ---------- Note ---------- */

.note {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  font-size: 12.5px;
  color: var(--text-muted);
  background: var(--surface-2);
  border: 1px solid var(--border-soft);
  border-radius: 10px;
  padding: 12px 14px;
  margin-top: 16px;
}

.note svg { width: 15px; height: 15px; flex: none; margin-top: 2px; color: var(--warning); }
.note.danger svg { color: var(--danger); }

.error-banner {
  background: rgba(242, 114, 122, 0.12);
  border: 1px solid rgba(242, 114, 122, 0.4);
  color: var(--danger);
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 13px;
  margin-bottom: 14px;
}

.hidden { display: none !important; }

/* ---------- Overlay / confirmation ---------- */

.overlay {
  position: fixed;
  inset: 0;
  background: rgba(8, 6, 16, 0.72);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 50;
}

.confirm-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 36px;
  max-width: 420px;
  width: 100%;
  text-align: center;
}

.confirm-card .check {
  width: 52px;
  height: 52px;
  margin: 0 auto 18px;
  border-radius: 50%;
  background: rgba(52, 211, 153, 0.14);
  display: flex;
  align-items: center;
  justify-content: center;
}

.confirm-card .check svg { width: 26px; height: 26px; color: var(--success); }

.confirm-card h2 {
  text-transform: none;
  letter-spacing: normal;
  font-family: var(--font-display);
  font-size: 22px;
  color: var(--text);
  margin-bottom: 8px;
}

.confirm-ref {
  font-family: var(--font-mono);
  font-size: 15px;
  color: var(--accent-cyan);
  background: var(--surface-2);
  border-radius: 8px;
  padding: 8px 14px;
  display: inline-block;
  margin: 10px 0 16px;
  letter-spacing: 0.03em;
}

.confirm-card p { color: var(--text-muted); font-size: 13.5px; margin: 0 0 20px; }

.confirm-card { max-width: 480px; text-align: left; }
.confirm-card .check,
.confirm-card h2,
.confirm-card .confirm-ref,
.confirm-card > .confirm-card-inner > p { text-align: center; }
.confirm-card .check { margin-inline: auto; }

.confirm-actions { display: flex; gap: 10px; margin-top: 8px; }
.confirm-actions .btn { flex: 1; }

.print-only { display: none; }

/* ---------- Review overlay ---------- */

.review-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 30px;
  max-width: 560px;
  width: 100%;
  max-height: 86vh;
  overflow-y: auto;
}

.review-card h2 { font-size: 22px; margin-bottom: 6px; }
.review-sub { color: var(--text-muted); font-size: 13px; margin: 0 0 20px; }

.review-section { margin-bottom: 20px; }
.review-section h3 {
  font-family: var(--font-body);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-faint);
  font-weight: 600;
  margin-bottom: 10px;
}

.detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px 16px;
  background: var(--surface-2);
  border: 1px solid var(--border-soft);
  border-radius: 10px;
  padding: 12px 14px;
}

.detail-row { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.detail-row span {
  color: var(--text-faint);
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.detail-row strong {
  color: var(--text);
  font-weight: 500;
  font-size: 13px;
  overflow-wrap: break-word;
}

.review-items { display: flex; flex-direction: column; gap: 10px; }

.review-item {
  background: var(--surface-2);
  border: 1px solid var(--border-soft);
  border-radius: 10px;
  padding: 12px 14px;
}

.attachment-summary-line {
  font-size: 12px;
  color: var(--text-faint);
  margin-top: 8px;
}

.review-item .detail-grid {
  background: none;
  border: none;
  padding: 8px 0 0;
  grid-template-columns: 1fr 1fr;
}

.review-actions { display: flex; gap: 10px; margin-top: 6px; }
.review-actions .btn { flex: 1; }

/* ---------- Footer ---------- */

footer {
  border-top: 1px solid var(--border-soft);
  padding-block: 20px 40px;
  color: var(--text-faint);
  font-size: 12.5px;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 20px;
}

.footer-brand, .footer-contact {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.footer-contact { text-align: right; }

.footer-privacy { max-width: 46ch; color: var(--text-faint); }

@media (max-width: 640px) {
  .footer-contact { text-align: left; }
  .detail-grid, .review-item .detail-grid { grid-template-columns: 1fr; }
}

/* ---------- Print ---------- */

@media print {
  body * { visibility: hidden; }
  .overlay { position: static; background: none; padding: 0; }
  #confirmOverlay, #confirmOverlay * { visibility: visible; }
  #confirmOverlay { display: block !important; }
  .confirm-actions { display: none !important; }
  .confirm-card {
    box-shadow: none;
    border: none;
    max-width: 100%;
    margin: 0;
    color: #000;
    background: #fff;
  }
  .print-only { display: block !important; }
  .detail-grid, .review-item { background: #fff; border-color: #ccc; }
  .detail-row span, .detail-row strong { color: #000; }
}

/* ---------- Responsive ---------- */

@media (max-width: 860px) {
  .workspace { grid-template-columns: 1fr; }
  .cart-panel { position: static; order: -1; }
  .field-grid { grid-template-columns: 1fr; }
  .field.span-2 { grid-column: span 1; }
}
